diff --git a/.gitmodules b/.gitmodules index adfcfdc..0dc77de6 100644 --- a/.gitmodules +++ b/.gitmodules
@@ -1,438 +1,438 @@ [submodule "third_party/clang-format/script"] path = third_party/clang-format/script - url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/clang/tools/clang-format + url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/clang/tools/clang-format.git [submodule "chrome/browser/resources/preinstalled_web_apps/internal"] path = chrome/browser/resources/preinstalled_web_apps/internal - url = https://chrome-internal.googlesource.com/chrome/components/default_apps + url = https://chrome-internal.googlesource.com/chrome/components/default_apps.git gclient-condition = checkout_src_internal [submodule "chrome/installer/mac/third_party/xz/xz"] path = chrome/installer/mac/third_party/xz/xz - url = https://chromium.googlesource.com/chromium/deps/xz + url = https://chromium.googlesource.com/chromium/deps/xz.git gclient-condition = checkout_mac [submodule "third_party/libc++/src"] path = third_party/libc++/src - url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx + url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git [submodule "third_party/libc++abi/src"] path = third_party/libc++abi/src - url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi + url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git [submodule "third_party/libunwind/src"] path = third_party/libunwind/src - url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind + url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git [submodule "chrome/test/data/autofill/captured_sites/artifacts"] path = chrome/test/data/autofill/captured_sites/artifacts - url = https://chrome-internal.googlesource.com/chrome/test/captured_sites/autofill + url = https://chrome-internal.googlesource.com/chrome/test/captured_sites/autofill.git gclient-condition = checkout_chromium_autofill_test_dependencies [submodule "chrome/test/data/password/captured_sites/artifacts"] path = chrome/test/data/password/captured_sites/artifacts - url = https://chrome-internal.googlesource.com/chrome/test/captured_sites/password + url = https://chrome-internal.googlesource.com/chrome/test/captured_sites/password.git gclient-condition = checkout_chromium_password_manager_test_dependencies [submodule "chrome/test/data/perf/canvas_bench"] path = chrome/test/data/perf/canvas_bench - url = https://chromium.googlesource.com/chromium/canvas_bench + url = https://chromium.googlesource.com/chromium/canvas_bench.git [submodule "chrome/test/data/perf/frame_rate/content"] path = chrome/test/data/perf/frame_rate/content - url = https://chromium.googlesource.com/chromium/frame_rate/content + url = https://chromium.googlesource.com/chromium/frame_rate/content.git [submodule "chrome/test/data/xr/webvr_info"] path = chrome/test/data/xr/webvr_info - url = https://chromium.googlesource.com/external/github.com/toji/webvr.info + url = https://chromium.googlesource.com/external/github.com/toji/webvr.info.git [submodule "clank"] path = clank - url = https://chrome-internal.googlesource.com/clank/internal/apps + url = https://chrome-internal.googlesource.com/clank/internal/apps.git gclient-condition = checkout_android and checkout_src_internal [submodule "docs/website"] path = docs/website - url = https://chromium.googlesource.com/website + url = https://chromium.googlesource.com/website.git [submodule "ios/third_party/earl_grey2/src"] path = ios/third_party/earl_grey2/src - url = https://chromium.googlesource.com/external/github.com/google/EarlGrey + url = https://chromium.googlesource.com/external/github.com/google/EarlGrey.git gclient-condition = checkout_ios [submodule "ios/third_party/edo/src"] path = ios/third_party/edo/src - url = https://chromium.googlesource.com/external/github.com/google/eDistantObject + url = https://chromium.googlesource.com/external/github.com/google/eDistantObject.git gclient-condition = checkout_ios [submodule "ios/third_party/gtx/src"] path = ios/third_party/gtx/src - url = https://chromium.googlesource.com/external/github.com/google/GTXiLib + url = https://chromium.googlesource.com/external/github.com/google/GTXiLib.git gclient-condition = checkout_ios [submodule "ios/third_party/lottie/src"] path = ios/third_party/lottie/src - url = https://chromium.googlesource.com/external/github.com/airbnb/lottie-ios + url = https://chromium.googlesource.com/external/github.com/airbnb/lottie-ios.git gclient-condition = checkout_ios [submodule "ios/third_party/material_components_ios/src"] path = ios/third_party/material_components_ios/src - url = https://chromium.googlesource.com/external/github.com/material-components/material-components-ios + url = https://chromium.googlesource.com/external/github.com/material-components/material-components-ios.git gclient-condition = checkout_ios [submodule "ios/third_party/material_font_disk_loader_ios/src"] path = ios/third_party/material_font_disk_loader_ios/src - url = https://chromium.googlesource.com/external/github.com/material-foundation/material-font-disk-loader-ios + url = https://chromium.googlesource.com/external/github.com/material-foundation/material-font-disk-loader-ios.git gclient-condition = checkout_ios [submodule "ios/third_party/material_internationalization_ios/src"] path = ios/third_party/material_internationalization_ios/src - url = https://chromium.googlesource.com/external/github.com/material-foundation/material-internationalization-ios + url = https://chromium.googlesource.com/external/github.com/material-foundation/material-internationalization-ios.git gclient-condition = checkout_ios [submodule "ios/third_party/material_roboto_font_loader_ios/src"] path = ios/third_party/material_roboto_font_loader_ios/src - url = https://chromium.googlesource.com/external/github.com/material-foundation/material-roboto-font-loader-ios + url = https://chromium.googlesource.com/external/github.com/material-foundation/material-roboto-font-loader-ios.git gclient-condition = checkout_ios [submodule "ios/third_party/material_sprited_animation_view_ios/src"] path = ios/third_party/material_sprited_animation_view_ios/src - url = https://chromium.googlesource.com/external/github.com/material-foundation/material-sprited-animation-view-ios + url = https://chromium.googlesource.com/external/github.com/material-foundation/material-sprited-animation-view-ios.git gclient-condition = checkout_ios [submodule "ios/third_party/material_text_accessibility_ios/src"] path = ios/third_party/material_text_accessibility_ios/src - url = https://chromium.googlesource.com/external/github.com/material-foundation/material-text-accessibility-ios + url = https://chromium.googlesource.com/external/github.com/material-foundation/material-text-accessibility-ios.git gclient-condition = checkout_ios [submodule "ios/third_party/motion_interchange_objc/src"] path = ios/third_party/motion_interchange_objc/src - url = https://chromium.googlesource.com/external/github.com/material-motion/motion-interchange-objc + url = https://chromium.googlesource.com/external/github.com/material-motion/motion-interchange-objc.git gclient-condition = checkout_ios [submodule "ios/third_party/motion_animator_objc/src"] path = ios/third_party/motion_animator_objc/src - url = https://chromium.googlesource.com/external/github.com/material-motion/motion-animator-objc + url = https://chromium.googlesource.com/external/github.com/material-motion/motion-animator-objc.git gclient-condition = checkout_ios [submodule "ios/third_party/motion_transitioning_objc/src"] path = ios/third_party/motion_transitioning_objc/src - url = https://chromium.googlesource.com/external/github.com/material-motion/motion-transitioning-objc + url = https://chromium.googlesource.com/external/github.com/material-motion/motion-transitioning-objc.git gclient-condition = checkout_ios [submodule "ios/third_party/ochamcrest/src"] path = ios/third_party/ochamcrest/src - url = https://chromium.googlesource.com/external/github.com/hamcrest/OCHamcrest + url = https://chromium.googlesource.com/external/github.com/hamcrest/OCHamcrest.git gclient-condition = checkout_ios [submodule "ios/third_party/webkit/src"] path = ios/third_party/webkit/src - url = https://chromium.googlesource.com/external/github.com/WebKit/webkit + url = https://chromium.googlesource.com/external/github.com/WebKit/webkit.git gclient-condition = checkout_ios and checkout_ios_webkit [submodule "media/cdm/api"] path = media/cdm/api - url = https://chromium.googlesource.com/chromium/cdm + url = https://chromium.googlesource.com/chromium/cdm.git [submodule "native_client"] path = native_client - url = https://chromium.googlesource.com/native_client/src/native_client + url = https://chromium.googlesource.com/native_client/src/native_client.git gclient-condition = checkout_nacl [submodule "net/third_party/quiche/src"] path = net/third_party/quiche/src - url = https://quiche.googlesource.com/quiche + url = https://quiche.googlesource.com/quiche.git [submodule "third_party/android_protobuf/src"] path = third_party/android_protobuf/src - url = https://android.googlesource.com/platform/external/protobuf + url = https://android.googlesource.com/platform/external/protobuf.git gclient-condition = checkout_android [submodule "third_party/androidx_javascriptengine/src"] path = third_party/androidx_javascriptengine/src - url = https://chromium.googlesource.com/aosp/platform/frameworks/support/javascriptengine/javascriptengine/src + url = https://chromium.googlesource.com/aosp/platform/frameworks/support/javascriptengine/javascriptengine/src.git gclient-condition = checkout_android [submodule "third_party/angle"] path = third_party/angle - url = https://chromium.googlesource.com/angle/angle + url = https://chromium.googlesource.com/angle/angle.git [submodule "third_party/anonymous_tokens/src"] path = third_party/anonymous_tokens/src - url = https://chromium.googlesource.com/external/github.com/google/anonymous-tokens + url = https://chromium.googlesource.com/external/github.com/google/anonymous-tokens.git [submodule "third_party/content_analysis_sdk/src"] path = third_party/content_analysis_sdk/src - url = https://chromium.googlesource.com/external/github.com/chromium/content_analysis_sdk + url = https://chromium.googlesource.com/external/github.com/chromium/content_analysis_sdk.git [submodule "third_party/dav1d/libdav1d"] path = third_party/dav1d/libdav1d - url = https://chromium.googlesource.com/external/github.com/videolan/dav1d + url = https://chromium.googlesource.com/external/github.com/videolan/dav1d.git [submodule "third_party/dawn"] path = third_party/dawn - url = https://dawn.googlesource.com/dawn + url = https://dawn.googlesource.com/dawn.git [submodule "third_party/highway/src"] path = third_party/highway/src - url = https://chromium.googlesource.com/external/github.com/google/highway + url = https://chromium.googlesource.com/external/github.com/google/highway.git [submodule "third_party/apache-portable-runtime/src"] path = third_party/apache-portable-runtime/src - url = https://chromium.googlesource.com/external/apache-portable-runtime + url = https://chromium.googlesource.com/external/apache-portable-runtime.git gclient-condition = checkout_android [submodule "third_party/barhopper"] path = third_party/barhopper - url = https://chrome-internal.googlesource.com/chrome/deps/barhopper + url = https://chrome-internal.googlesource.com/chrome/deps/barhopper.git gclient-condition = checkout_src_internal and checkout_chromeos [submodule "third_party/google_benchmark/src"] path = third_party/google_benchmark/src - url = https://chromium.googlesource.com/external/github.com/google/benchmark + url = https://chromium.googlesource.com/external/github.com/google/benchmark.git [submodule "third_party/boringssl/src"] path = third_party/boringssl/src - url = https://boringssl.googlesource.com/boringssl + url = https://boringssl.googlesource.com/boringssl.git [submodule "third_party/breakpad/breakpad"] path = third_party/breakpad/breakpad - url = https://chromium.googlesource.com/breakpad/breakpad + url = https://chromium.googlesource.com/breakpad/breakpad.git [submodule "third_party/cast_core/public/src"] path = third_party/cast_core/public/src url = https://chromium.googlesource.com/cast_core/public [submodule "third_party/catapult"] path = third_party/catapult - url = https://chromium.googlesource.com/catapult + url = https://chromium.googlesource.com/catapult.git [submodule "third_party/ced/src"] path = third_party/ced/src - url = https://chromium.googlesource.com/external/github.com/google/compact_enc_det + url = https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git [submodule "third_party/chromium-variations"] path = third_party/chromium-variations - url = https://chromium.googlesource.com/chromium-variations + url = https://chromium.googlesource.com/chromium-variations.git [submodule "third_party/chromevox/third_party/sre/src"] path = third_party/chromevox/third_party/sre/src - url = https://chromium.googlesource.com/external/github.com/zorkow/speech-rule-engine + url = https://chromium.googlesource.com/external/github.com/zorkow/speech-rule-engine.git gclient-condition = checkout_chromeos [submodule "third_party/chromite"] path = third_party/chromite - url = https://chromium.googlesource.com/chromiumos/chromite + url = https://chromium.googlesource.com/chromiumos/chromite.git gclient-condition = checkout_chromeos [submodule "third_party/cld_3/src"] path = third_party/cld_3/src - url = https://chromium.googlesource.com/external/github.com/google/cld_3 + url = https://chromium.googlesource.com/external/github.com/google/cld_3.git [submodule "third_party/colorama/src"] path = third_party/colorama/src - url = https://chromium.googlesource.com/external/colorama + url = https://chromium.googlesource.com/external/colorama.git [submodule "third_party/cpu_features/src"] path = third_party/cpu_features/src - url = https://chromium.googlesource.com/external/github.com/google/cpu_features + url = https://chromium.googlesource.com/external/github.com/google/cpu_features.git [submodule "third_party/cpuinfo/src"] path = third_party/cpuinfo/src - url = https://chromium.googlesource.com/external/github.com/pytorch/cpuinfo + url = https://chromium.googlesource.com/external/github.com/pytorch/cpuinfo.git [submodule "third_party/crc32c/src"] path = third_party/crc32c/src - url = https://chromium.googlesource.com/external/github.com/google/crc32c + url = https://chromium.googlesource.com/external/github.com/google/crc32c.git [submodule "third_party/cros_system_api"] path = third_party/cros_system_api url = https://chromium.googlesource.com/chromiumos/platform2/system_api.git - gclient-condition = checkout_linux + gclient-condition = checkout_linux or checkout_chromeos [submodule "third_party/crossbench"] path = third_party/crossbench - url = https://chromium.googlesource.com/crossbench + url = https://chromium.googlesource.com/crossbench.git [submodule "third_party/crubit/src"] path = third_party/crubit/src - url = https://chromium.googlesource.com/external/github.com/google/crubit + url = https://chromium.googlesource.com/external/github.com/google/crubit.git gclient-condition = checkout_crubit [submodule "third_party/depot_tools"] path = third_party/depot_tools - url = https://chromium.googlesource.com/chromium/tools/depot_tools + url = https://chromium.googlesource.com/chromium/tools/depot_tools.git [submodule "third_party/devtools-frontend/src"] path = third_party/devtools-frontend/src url = https://chromium.googlesource.com/devtools/devtools-frontend [submodule "third_party/devtools-frontend-internal"] path = third_party/devtools-frontend-internal - url = https://chrome-internal.googlesource.com/devtools/devtools-internal + url = https://chrome-internal.googlesource.com/devtools/devtools-internal.git gclient-condition = checkout_src_internal [submodule "third_party/dom_distiller_js/dist"] path = third_party/dom_distiller_js/dist - url = https://chromium.googlesource.com/chromium/dom-distiller/dist + url = https://chromium.googlesource.com/chromium/dom-distiller/dist.git [submodule "third_party/eigen3/src"] path = third_party/eigen3/src - url = https://chromium.googlesource.com/external/gitlab.com/libeigen/eigen + url = https://chromium.googlesource.com/external/gitlab.com/libeigen/eigen.git [submodule "third_party/emoji-metadata/src"] path = third_party/emoji-metadata/src url = https://chromium.googlesource.com/external/github.com/googlefonts/emoji-metadata gclient-condition = checkout_chromeos [submodule "third_party/farmhash/src"] path = third_party/farmhash/src - url = https://chromium.googlesource.com/external/github.com/google/farmhash + url = https://chromium.googlesource.com/external/github.com/google/farmhash.git [submodule "third_party/ffmpeg"] path = third_party/ffmpeg - url = https://chromium.googlesource.com/chromium/third_party/ffmpeg + url = https://chromium.googlesource.com/chromium/third_party/ffmpeg.git [submodule "third_party/flac"] path = third_party/flac - url = https://chromium.googlesource.com/chromium/deps/flac + url = https://chromium.googlesource.com/chromium/deps/flac.git [submodule "third_party/flatbuffers/src"] path = third_party/flatbuffers/src - url = https://chromium.googlesource.com/external/github.com/google/flatbuffers + url = https://chromium.googlesource.com/external/github.com/google/flatbuffers.git [submodule "third_party/fontconfig/src"] path = third_party/fontconfig/src - url = https://chromium.googlesource.com/external/fontconfig + url = https://chromium.googlesource.com/external/fontconfig.git gclient-condition = checkout_linux [submodule "third_party/fp16/src"] path = third_party/fp16/src - url = https://chromium.googlesource.com/external/github.com/Maratyszcza/FP16 + url = https://chromium.googlesource.com/external/github.com/Maratyszcza/FP16.git [submodule "third_party/gemmlowp/src"] path = third_party/gemmlowp/src - url = https://chromium.googlesource.com/external/github.com/google/gemmlowp + url = https://chromium.googlesource.com/external/github.com/google/gemmlowp.git [submodule "third_party/grpc/src"] path = third_party/grpc/src - url = https://chromium.googlesource.com/external/github.com/grpc/grpc + url = https://chromium.googlesource.com/external/github.com/grpc/grpc.git [submodule "third_party/freetype/src"] path = third_party/freetype/src - url = https://chromium.googlesource.com/chromium/src/third_party/freetype2 + url = https://chromium.googlesource.com/chromium/src/third_party/freetype2.git [submodule "third_party/freetype-testing/src"] path = third_party/freetype-testing/src - url = https://chromium.googlesource.com/external/github.com/freetype/freetype2-testing + url = https://chromium.googlesource.com/external/github.com/freetype/freetype2-testing.git [submodule "third_party/fxdiv/src"] path = third_party/fxdiv/src - url = https://chromium.googlesource.com/external/github.com/Maratyszcza/FXdiv + url = https://chromium.googlesource.com/external/github.com/Maratyszcza/FXdiv.git [submodule "third_party/harfbuzz-ng/src"] path = third_party/harfbuzz-ng/src - url = https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz + url = https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git [submodule "third_party/jszip/src"] path = third_party/jszip/src - url = https://chromium.googlesource.com/external/github.com/Stuk/jszip + url = https://chromium.googlesource.com/external/github.com/Stuk/jszip.git gclient-condition = checkout_ios [submodule "third_party/emoji-segmenter/src"] path = third_party/emoji-segmenter/src - url = https://chromium.googlesource.com/external/github.com/google/emoji-segmenter + url = https://chromium.googlesource.com/external/github.com/google/emoji-segmenter.git [submodule "third_party/ots/src"] path = third_party/ots/src - url = https://chromium.googlesource.com/external/github.com/khaledhosny/ots + url = https://chromium.googlesource.com/external/github.com/khaledhosny/ots.git [submodule "third_party/libgav1/src"] path = third_party/libgav1/src - url = https://chromium.googlesource.com/codecs/libgav1 + url = https://chromium.googlesource.com/codecs/libgav1.git [submodule "third_party/google_toolbox_for_mac/src"] path = third_party/google_toolbox_for_mac/src - url = https://chromium.googlesource.com/external/github.com/google/google-toolbox-for-mac + url = https://chromium.googlesource.com/external/github.com/google/google-toolbox-for-mac.git gclient-condition = checkout_ios or checkout_mac [submodule "third_party/google-truth/src"] path = third_party/google-truth/src - url = https://chromium.googlesource.com/external/github.com/google/truth + url = https://chromium.googlesource.com/external/github.com/google/truth.git gclient-condition = checkout_android [submodule "third_party/googletest/src"] path = third_party/googletest/src - url = https://chromium.googlesource.com/external/github.com/google/googletest + url = https://chromium.googlesource.com/external/github.com/google/googletest.git [submodule "third_party/gperf"] path = third_party/gperf - url = https://chromium.googlesource.com/chromium/deps/gperf + url = https://chromium.googlesource.com/chromium/deps/gperf.git gclient-condition = checkout_win [submodule "third_party/gvr-android-sdk/src"] path = third_party/gvr-android-sdk/src - url = https://chromium.googlesource.com/external/github.com/googlevr/gvr-android-sdk + url = https://chromium.googlesource.com/external/github.com/googlevr/gvr-android-sdk.git gclient-condition = checkout_android [submodule "third_party/cardboard/src"] path = third_party/cardboard/src - url = https://chromium.googlesource.com/external/github.com/googlevr/cardboard + url = https://chromium.googlesource.com/external/github.com/googlevr/cardboard/ gclient-condition = checkout_android [submodule "third_party/arcore-android-sdk/src"] path = third_party/arcore-android-sdk/src - url = https://chromium.googlesource.com/external/github.com/google-ar/arcore-android-sdk + url = https://chromium.googlesource.com/external/github.com/google-ar/arcore-android-sdk.git gclient-condition = checkout_android [submodule "third_party/hunspell_dictionaries"] path = third_party/hunspell_dictionaries - url = https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries + url = https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries.git [submodule "third_party/icu"] path = third_party/icu - url = https://chromium.googlesource.com/chromium/deps/icu + url = https://chromium.googlesource.com/chromium/deps/icu.git [submodule "third_party/javalang/src"] path = third_party/javalang/src - url = https://chromium.googlesource.com/external/github.com/c2nes/javalang + url = https://chromium.googlesource.com/external/github.com/c2nes/javalang.git gclient-condition = checkout_android [submodule "third_party/jsoncpp/source"] path = third_party/jsoncpp/source - url = https://chromium.googlesource.com/external/github.com/open-source-parsers/jsoncpp + url = https://chromium.googlesource.com/external/github.com/open-source-parsers/jsoncpp.git [submodule "third_party/junit/src"] path = third_party/junit/src - url = https://chromium.googlesource.com/external/junit + url = https://chromium.googlesource.com/external/junit.git gclient-condition = checkout_android [submodule "third_party/leveldatabase/src"] path = third_party/leveldatabase/src - url = https://chromium.googlesource.com/external/leveldb + url = https://chromium.googlesource.com/external/leveldb.git [submodule "third_party/libFuzzer/src"] path = third_party/libFuzzer/src - url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/compiler-rt/lib/fuzzer + url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/compiler-rt/lib/fuzzer.git [submodule "third_party/fuzztest/src"] path = third_party/fuzztest/src - url = https://chromium.googlesource.com/external/github.com/google/fuzztest + url = https://chromium.googlesource.com/external/github.com/google/fuzztest.git [submodule "third_party/libaddressinput/src"] path = third_party/libaddressinput/src - url = https://chromium.googlesource.com/external/libaddressinput + url = https://chromium.googlesource.com/external/libaddressinput.git [submodule "third_party/libaom/source/libaom"] path = third_party/libaom/source/libaom - url = https://aomedia.googlesource.com/aom + url = https://aomedia.googlesource.com/aom.git [submodule "third_party/libavif/src"] path = third_party/libavif/src - url = https://chromium.googlesource.com/external/github.com/AOMediaCodec/libavif + url = https://chromium.googlesource.com/external/github.com/AOMediaCodec/libavif.git [submodule "third_party/libavifinfo/src"] path = third_party/libavifinfo/src - url = https://aomedia.googlesource.com/libavifinfo + url = https://aomedia.googlesource.com/libavifinfo.git [submodule "third_party/nearby/src"] path = third_party/nearby/src - url = https://chromium.googlesource.com/external/github.com/google/nearby-connections + url = https://chromium.googlesource.com/external/github.com/google/nearby-connections.git [submodule "third_party/beto-core/src"] path = third_party/beto-core/src - url = https://beto-core.googlesource.com/beto-core + url = https://beto-core.googlesource.com/beto-core.git [submodule "third_party/securemessage/src"] path = third_party/securemessage/src - url = https://chromium.googlesource.com/external/github.com/google/securemessage + url = https://chromium.googlesource.com/external/github.com/google/securemessage.git [submodule "third_party/speedometer/v3.0"] path = third_party/speedometer/v3.0 - url = https://chromium.googlesource.com/external/github.com/WebKit/Speedometer + url = https://chromium.googlesource.com/external/github.com/WebKit/Speedometer.git [submodule "third_party/ukey2/src"] path = third_party/ukey2/src - url = https://chromium.googlesource.com/external/github.com/google/ukey2 + url = https://chromium.googlesource.com/external/github.com/google/ukey2.git [submodule "third_party/cros-components/src"] path = third_party/cros-components/src - url = https://chromium.googlesource.com/external/google3/cros_components + url = https://chromium.googlesource.com/external/google3/cros_components.git [submodule "third_party/libdrm/src"] path = third_party/libdrm/src - url = https://chromium.googlesource.com/chromiumos/third_party/libdrm + url = https://chromium.googlesource.com/chromiumos/third_party/libdrm.git gclient-condition = checkout_linux [submodule "third_party/expat/src"] path = third_party/expat/src - url = https://chromium.googlesource.com/external/github.com/libexpat/libexpat + url = https://chromium.googlesource.com/external/github.com/libexpat/libexpat.git [submodule "third_party/libipp/libipp"] path = third_party/libipp/libipp - url = https://chromium.googlesource.com/chromiumos/platform2/libipp + url = https://chromium.googlesource.com/chromiumos/platform2/libipp.git gclient-condition = checkout_linux [submodule "third_party/libjpeg_turbo"] path = third_party/libjpeg_turbo - url = https://chromium.googlesource.com/chromium/deps/libjpeg_turbo + url = https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git [submodule "third_party/liblouis/src"] path = third_party/liblouis/src - url = https://chromium.googlesource.com/external/liblouis-github + url = https://chromium.googlesource.com/external/liblouis-github.git gclient-condition = checkout_linux [submodule "third_party/libphonenumber/dist"] path = third_party/libphonenumber/dist - url = https://chromium.googlesource.com/external/libphonenumber + url = https://chromium.googlesource.com/external/libphonenumber.git [submodule "third_party/libprotobuf-mutator/src"] path = third_party/libprotobuf-mutator/src - url = https://chromium.googlesource.com/external/github.com/google/libprotobuf-mutator + url = https://chromium.googlesource.com/external/github.com/google/libprotobuf-mutator.git [submodule "third_party/libsrtp"] path = third_party/libsrtp - url = https://chromium.googlesource.com/chromium/deps/libsrtp + url = https://chromium.googlesource.com/chromium/deps/libsrtp.git [submodule "third_party/libsync/src"] path = third_party/libsync/src - url = https://chromium.googlesource.com/aosp/platform/system/core/libsync + url = https://chromium.googlesource.com/aosp/platform/system/core/libsync.git gclient-condition = checkout_linux [submodule "third_party/libunwindstack"] path = third_party/libunwindstack - url = https://chromium.googlesource.com/chromium/src/third_party/libunwindstack + url = https://chromium.googlesource.com/chromium/src/third_party/libunwindstack.git gclient-condition = checkout_android [submodule "third_party/libvpx/source/libvpx"] path = third_party/libvpx/source/libvpx - url = https://chromium.googlesource.com/webm/libvpx + url = https://chromium.googlesource.com/webm/libvpx.git [submodule "third_party/libwebm/source"] path = third_party/libwebm/source - url = https://chromium.googlesource.com/webm/libwebm + url = https://chromium.googlesource.com/webm/libwebm.git [submodule "third_party/libwebp/src"] path = third_party/libwebp/src - url = https://chromium.googlesource.com/webm/libwebp + url = https://chromium.googlesource.com/webm/libwebp.git [submodule "third_party/libyuv"] path = third_party/libyuv - url = https://chromium.googlesource.com/libyuv/libyuv + url = https://chromium.googlesource.com/libyuv/libyuv.git [submodule "third_party/lighttpd"] path = third_party/lighttpd - url = https://chromium.googlesource.com/chromium/deps/lighttpd + url = https://chromium.googlesource.com/chromium/deps/lighttpd.git gclient-condition = checkout_mac or checkout_win [submodule "third_party/lss"] path = third_party/lss - url = https://chromium.googlesource.com/linux-syscall-support + url = https://chromium.googlesource.com/linux-syscall-support.git gclient-condition = checkout_android or checkout_linux [submodule "third_party/material_color_utilities/src"] path = third_party/material_color_utilities/src - url = https://chromium.googlesource.com/external/github.com/material-foundation/material-color-utilities + url = https://chromium.googlesource.com/external/github.com/material-foundation/material-color-utilities.git [submodule "third_party/material_design_icons/src"] path = third_party/material_design_icons/src - url = https://chromium.googlesource.com/external/github.com/google/material-design-icons + url = https://chromium.googlesource.com/external/github.com/google/material-design-icons.git gclient-condition = checkout_ios [submodule "third_party/minigbm/src"] path = third_party/minigbm/src - url = https://chromium.googlesource.com/chromiumos/platform/minigbm + url = https://chromium.googlesource.com/chromiumos/platform/minigbm.git gclient-condition = checkout_linux [submodule "third_party/nasm"] path = third_party/nasm - url = https://chromium.googlesource.com/chromium/deps/nasm + url = https://chromium.googlesource.com/chromium/deps/nasm.git [submodule "third_party/neon_2_sse/src"] path = third_party/neon_2_sse/src - url = https://chromium.googlesource.com/external/github.com/intel/ARM_NEON_2_x86_SSE + url = https://chromium.googlesource.com/external/github.com/intel/ARM_NEON_2_x86_SSE.git [submodule "third_party/netty-tcnative/src"] path = third_party/netty-tcnative/src - url = https://chromium.googlesource.com/external/netty-tcnative + url = https://chromium.googlesource.com/external/netty-tcnative.git gclient-condition = checkout_android [submodule "third_party/netty4/src"] path = third_party/netty4/src - url = https://chromium.googlesource.com/external/netty4 + url = https://chromium.googlesource.com/external/netty4.git gclient-condition = checkout_android [submodule "third_party/openh264/src"] path = third_party/openh264/src @@ -446,376 +446,376 @@ gclient-condition = checkout_openxr [submodule "third_party/pdfium"] path = third_party/pdfium - url = https://pdfium.googlesource.com/pdfium + url = https://pdfium.googlesource.com/pdfium.git [submodule "third_party/perfetto"] path = third_party/perfetto - url = https://android.googlesource.com/platform/external/perfetto + url = https://android.googlesource.com/platform/external/perfetto.git [submodule "third_party/perl"] path = third_party/perl - url = https://chromium.googlesource.com/chromium/deps/perl + url = https://chromium.googlesource.com/chromium/deps/perl.git gclient-condition = checkout_win [submodule "third_party/pthreadpool/src"] path = third_party/pthreadpool/src - url = https://chromium.googlesource.com/external/github.com/Maratyszcza/pthreadpool + url = https://chromium.googlesource.com/external/github.com/Maratyszcza/pthreadpool.git [submodule "third_party/pyelftools"] path = third_party/pyelftools - url = https://chromium.googlesource.com/chromiumos/third_party/pyelftools + url = https://chromium.googlesource.com/chromiumos/third_party/pyelftools.git gclient-condition = checkout_linux [submodule "third_party/quic_trace/src"] path = third_party/quic_trace/src - url = https://chromium.googlesource.com/external/github.com/google/quic-trace + url = https://chromium.googlesource.com/external/github.com/google/quic-trace.git [submodule "third_party/pywebsocket3/src"] path = third_party/pywebsocket3/src - url = https://chromium.googlesource.com/external/github.com/GoogleChromeLabs/pywebsocket3 + url = https://chromium.googlesource.com/external/github.com/GoogleChromeLabs/pywebsocket3.git [submodule "third_party/re2/src"] path = third_party/re2/src - url = https://chromium.googlesource.com/external/github.com/google/re2 + url = https://chromium.googlesource.com/external/github.com/google/re2.git [submodule "third_party/requests/src"] path = third_party/requests/src - url = https://chromium.googlesource.com/external/github.com/kennethreitz/requests + url = https://chromium.googlesource.com/external/github.com/kennethreitz/requests.git gclient-condition = checkout_android [submodule "third_party/ruy/src"] path = third_party/ruy/src - url = https://chromium.googlesource.com/external/github.com/google/ruy + url = https://chromium.googlesource.com/external/github.com/google/ruy.git [submodule "third_party/skia"] path = third_party/skia - url = https://skia.googlesource.com/skia + url = https://skia.googlesource.com/skia.git [submodule "third_party/smhasher/src"] path = third_party/smhasher/src - url = https://chromium.googlesource.com/external/smhasher + url = https://chromium.googlesource.com/external/smhasher.git [submodule "third_party/snappy/src"] path = third_party/snappy/src - url = https://chromium.googlesource.com/external/github.com/google/snappy + url = https://chromium.googlesource.com/external/github.com/google/snappy.git [submodule "third_party/sqlite/src"] path = third_party/sqlite/src - url = https://chromium.googlesource.com/chromium/deps/sqlite + url = https://chromium.googlesource.com/chromium/deps/sqlite.git [submodule "third_party/swiftshader"] path = third_party/swiftshader - url = https://swiftshader.googlesource.com/SwiftShader + url = https://swiftshader.googlesource.com/SwiftShader.git [submodule "third_party/text-fragments-polyfill/src"] path = third_party/text-fragments-polyfill/src - url = https://chromium.googlesource.com/external/github.com/GoogleChromeLabs/text-fragments-polyfill + url = https://chromium.googlesource.com/external/github.com/GoogleChromeLabs/text-fragments-polyfill.git [submodule "third_party/tflite/src"] path = third_party/tflite/src - url = https://chromium.googlesource.com/external/github.com/tensorflow/tensorflow + url = https://chromium.googlesource.com/external/github.com/tensorflow/tensorflow.git [submodule "third_party/vulkan-deps"] path = third_party/vulkan-deps url = https://chromium.googlesource.com/vulkan-deps [submodule "third_party/vulkan_memory_allocator"] path = third_party/vulkan_memory_allocator - url = https://chromium.googlesource.com/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator + url = https://chromium.googlesource.com/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git [submodule "third_party/wayland/src"] path = third_party/wayland/src - url = https://chromium.googlesource.com/external/anongit.freedesktop.org/git/wayland/wayland + url = https://chromium.googlesource.com/external/anongit.freedesktop.org/git/wayland/wayland.git gclient-condition = checkout_linux [submodule "third_party/wayland-protocols/src"] path = third_party/wayland-protocols/src - url = https://chromium.googlesource.com/external/anongit.freedesktop.org/git/wayland/wayland-protocols + url = https://chromium.googlesource.com/external/anongit.freedesktop.org/git/wayland/wayland-protocols.git gclient-condition = checkout_linux [submodule "third_party/wayland-protocols/kde"] path = third_party/wayland-protocols/kde - url = https://chromium.googlesource.com/external/github.com/KDE/plasma-wayland-protocols + url = https://chromium.googlesource.com/external/github.com/KDE/plasma-wayland-protocols.git gclient-condition = checkout_linux [submodule "third_party/wayland-protocols/gtk"] path = third_party/wayland-protocols/gtk - url = https://chromium.googlesource.com/external/github.com/GNOME/gtk + url = https://chromium.googlesource.com/external/github.com/GNOME/gtk.git gclient-condition = checkout_linux [submodule "third_party/webdriver/pylib"] path = third_party/webdriver/pylib - url = https://chromium.googlesource.com/external/github.com/SeleniumHQ/selenium/py + url = https://chromium.googlesource.com/external/github.com/SeleniumHQ/selenium/py.git [submodule "third_party/webgl/src"] path = third_party/webgl/src - url = https://chromium.googlesource.com/external/khronosgroup/webgl + url = https://chromium.googlesource.com/external/khronosgroup/webgl.git [submodule "third_party/webgpu-cts/src"] path = third_party/webgpu-cts/src - url = https://chromium.googlesource.com/external/github.com/gpuweb/cts + url = https://chromium.googlesource.com/external/github.com/gpuweb/cts.git [submodule "third_party/webrtc"] path = third_party/webrtc - url = https://webrtc.googlesource.com/src + url = https://webrtc.googlesource.com/src.git [submodule "third_party/wuffs/src"] path = third_party/wuffs/src - url = https://skia.googlesource.com/external/github.com/google/wuffs-mirror-release-c + url = https://skia.googlesource.com/external/github.com/google/wuffs-mirror-release-c.git [submodule "third_party/weston/src"] path = third_party/weston/src - url = https://chromium.googlesource.com/external/anongit.freedesktop.org/git/wayland/weston + url = https://chromium.googlesource.com/external/anongit.freedesktop.org/git/wayland/weston.git gclient-condition = checkout_linux [submodule "third_party/wlcs/src"] path = third_party/wlcs/src - url = https://chromium.googlesource.com/external/github.com/MirServer/wlcs + url = https://chromium.googlesource.com/external/github.com/MirServer/wlcs.git gclient-condition = checkout_chromeos [submodule "third_party/xdg-utils"] path = third_party/xdg-utils - url = https://chromium.googlesource.com/chromium/deps/xdg-utils + url = https://chromium.googlesource.com/chromium/deps/xdg-utils.git gclient-condition = checkout_linux [submodule "third_party/xnnpack/src"] path = third_party/xnnpack/src - url = https://chromium.googlesource.com/external/github.com/google/XNNPACK + url = https://chromium.googlesource.com/external/github.com/google/XNNPACK.git [submodule "tools/page_cycler/acid3"] path = tools/page_cycler/acid3 - url = https://chromium.googlesource.com/chromium/deps/acid3 + url = https://chromium.googlesource.com/chromium/deps/acid3.git [submodule "third_party/zstd/src"] path = third_party/zstd/src - url = https://chromium.googlesource.com/external/github.com/facebook/zstd + url = https://chromium.googlesource.com/external/github.com/facebook/zstd.git [submodule "v8"] path = v8 - url = https://chromium.googlesource.com/v8/v8 + url = https://chromium.googlesource.com/v8/v8.git [submodule "internal"] path = internal - url = https://chrome-internal.googlesource.com/chrome/src-internal + url = https://chrome-internal.googlesource.com/chrome/src-internal.git gclient-condition = checkout_src_internal [submodule "third_party/android_prebuilts/build_tools"] path = third_party/android_prebuilts/build_tools - url = https://android.googlesource.com/platform/prebuilts/build-tools + url = https://android.googlesource.com/platform/prebuilts/build-tools.git gclient-condition = checkout_android_prebuilts_build_tools [submodule "chromeos/assistant/internal"] path = chromeos/assistant/internal - url = https://chrome-internal.googlesource.com/chrome/assistant + url = https://chrome-internal.googlesource.com/chrome/assistant.git gclient-condition = checkout_src_internal and checkout_chromeos [submodule "build/fuchsia/internal"] path = build/fuchsia/internal - url = https://chrome-internal.googlesource.com/fuchsia/build + url = https://chrome-internal.googlesource.com/fuchsia/build.git gclient-condition = checkout_fuchsia_internal and checkout_src_internal [submodule "chrome/app/theme/default_100_percent/google_chrome"] path = chrome/app/theme/default_100_percent/google_chrome - url = https://chrome-internal.googlesource.com/chrome/theme/default_100_percent/google_chrome + url = https://chrome-internal.googlesource.com/chrome/theme/default_100_percent/google_chrome.git gclient-condition = checkout_src_internal [submodule "chrome/app/theme/default_200_percent/google_chrome"] path = chrome/app/theme/default_200_percent/google_chrome - url = https://chrome-internal.googlesource.com/chrome/theme/default_200_percent/google_chrome + url = https://chrome-internal.googlesource.com/chrome/theme/default_200_percent/google_chrome.git gclient-condition = checkout_src_internal [submodule "chrome/app/theme/google_chrome"] path = chrome/app/theme/google_chrome - url = https://chrome-internal.googlesource.com/chrome/theme/google_chrome + url = https://chrome-internal.googlesource.com/chrome/theme/google_chrome.git gclient-condition = checkout_src_internal [submodule "chrome/browser/enterprise/connectors/internal"] path = chrome/browser/enterprise/connectors/internal - url = https://chrome-internal.googlesource.com/chrome/browser/enterprise/connectors/internal + url = https://chrome-internal.googlesource.com/chrome/browser/enterprise/connectors/internal.git gclient-condition = checkout_src_internal [submodule "chrome/browser/google/linkdoctor_internal"] path = chrome/browser/google/linkdoctor_internal - url = https://chrome-internal.googlesource.com/chrome/linkdoctor + url = https://chrome-internal.googlesource.com/chrome/linkdoctor.git gclient-condition = checkout_src_internal [submodule "chrome/browser/internal"] path = chrome/browser/internal - url = https://chrome-internal.googlesource.com/chrome/browser_internal + url = https://chrome-internal.googlesource.com/chrome/browser_internal.git gclient-condition = checkout_src_internal [submodule "chrome/browser/media/engagement_internal"] path = chrome/browser/media/engagement_internal - url = https://chrome-internal.googlesource.com/chrome/browser/media/engagement_internal + url = https://chrome-internal.googlesource.com/chrome/browser/media/engagement_internal.git gclient-condition = checkout_src_internal [submodule "chrome/browser/nearby_sharing/internal"] path = chrome/browser/nearby_sharing/internal - url = https://chrome-internal.googlesource.com/chrome/browser/nearby_sharing/internal + url = https://chrome-internal.googlesource.com/chrome/browser/nearby_sharing/internal.git gclient-condition = checkout_src_internal [submodule "chrome/browser/resources/chromeos/quickoffice"] path = chrome/browser/resources/chromeos/quickoffice - url = https://chrome-internal.googlesource.com/quickoffice/crx + url = https://chrome-internal.googlesource.com/quickoffice/crx.git gclient-condition = (checkout_chromeos or checkout_linux) and checkout_src_internal [submodule "chrome/browser/resources/settings_internal"] path = chrome/browser/resources/settings_internal - url = https://chrome-internal.googlesource.com/chrome/browser/resources/settings_internal + url = https://chrome-internal.googlesource.com/chrome/browser/resources/settings_internal.git gclient-condition = checkout_src_internal [submodule "chrome/browser/spellchecker/internal"] path = chrome/browser/spellchecker/internal - url = https://chrome-internal.googlesource.com/chrome/spellchecker/internal + url = https://chrome-internal.googlesource.com/chrome/spellchecker/internal.git gclient-condition = checkout_src_internal [submodule "chrome/installer/mac/internal"] path = chrome/installer/mac/internal - url = https://chrome-internal.googlesource.com/chrome/installer/mac/internal + url = https://chrome-internal.googlesource.com/chrome/installer/mac/internal.git gclient-condition = checkout_src_internal [submodule "chrome/test/data/firefox3_profile/searchplugins"] path = chrome/test/data/firefox3_profile/searchplugins - url = https://chrome-internal.googlesource.com/chrome/data/osdd/firefox3_profile_searchplugins + url = https://chrome-internal.googlesource.com/chrome/data/osdd/firefox3_profile_searchplugins.git gclient-condition = checkout_src_internal [submodule "chrome/test/data/firefox3_searchplugins"] path = chrome/test/data/firefox3_searchplugins - url = https://chrome-internal.googlesource.com/chrome/data/osdd/firefox3_searchplugins + url = https://chrome-internal.googlesource.com/chrome/data/osdd/firefox3_searchplugins.git gclient-condition = checkout_src_internal [submodule "chrome/test/data/gpu/vt"] path = chrome/test/data/gpu/vt - url = https://chrome-internal.googlesource.com/chrome/data/vectortown_endurance/vectortownstatic-20121022 + url = https://chrome-internal.googlesource.com/chrome/data/vectortown_endurance/vectortownstatic-20121022.git gclient-condition = checkout_src_internal [submodule "chrome/test/data/perf/frame_rate/private"] path = chrome/test/data/perf/frame_rate/private - url = https://chrome-internal.googlesource.com/chrome/data/frame_rate_tests + url = https://chrome-internal.googlesource.com/chrome/data/frame_rate_tests.git gclient-condition = checkout_src_internal [submodule "chrome/test/data/perf/private"] path = chrome/test/data/perf/private - url = https://chrome-internal.googlesource.com/chrome/data/perf_tests + url = https://chrome-internal.googlesource.com/chrome/data/perf_tests.git gclient-condition = checkout_src_internal [submodule "chrome/test/data/pdf_private"] path = chrome/test/data/pdf_private - url = https://chrome-internal.googlesource.com/chrome/data/pdf_private + url = https://chrome-internal.googlesource.com/chrome/data/pdf_private.git gclient-condition = checkout_src_internal [submodule "chrome/test/media_router/internal"] path = chrome/test/media_router/internal - url = https://chrome-internal.googlesource.com/chrome/test/media_router/internal + url = https://chrome-internal.googlesource.com/chrome/test/media_router/internal.git gclient-condition = checkout_src_internal [submodule "chrome/test/python_tests"] path = chrome/test/python_tests - url = https://chrome-internal.googlesource.com/chrome/test/python_tests + url = https://chrome-internal.googlesource.com/chrome/test/python_tests.git gclient-condition = checkout_src_internal [submodule "chrome/tools/memory"] path = chrome/tools/memory - url = https://chrome-internal.googlesource.com/chrome/tools/memory + url = https://chrome-internal.googlesource.com/chrome/tools/memory.git gclient-condition = checkout_win and checkout_src_internal [submodule "chrome/services/speech/internal"] path = chrome/services/speech/internal - url = https://chrome-internal.googlesource.com/chromeos/speech + url = https://chrome-internal.googlesource.com/chromeos/speech.git gclient-condition = checkout_chromeos and checkout_src_internal [submodule "components/autofill/core/browser/form_parsing/internal_resources"] path = components/autofill/core/browser/form_parsing/internal_resources - url = https://chrome-internal.googlesource.com/chrome/components/autofill_regex_patterns + url = https://chrome-internal.googlesource.com/chrome/components/autofill_regex_patterns.git gclient-condition = checkout_src_internal [submodule "components/crash/core/app/internal"] path = components/crash/core/app/internal - url = https://chrome-internal.googlesource.com/chrome/components/crash + url = https://chrome-internal.googlesource.com/chrome/components/crash.git gclient-condition = checkout_src_internal [submodule "components/metrics/internal"] path = components/metrics/internal - url = https://chrome-internal.googlesource.com/chrome/components/metrics/internal + url = https://chrome-internal.googlesource.com/chrome/components/metrics/internal.git gclient-condition = checkout_src_internal [submodule "components/ntp_tiles/resources/internal"] path = components/ntp_tiles/resources/internal - url = https://chrome-internal.googlesource.com/chrome/components/ntp_tiles/resources + url = https://chrome-internal.googlesource.com/chrome/components/ntp_tiles/resources.git gclient-condition = checkout_src_internal [submodule "components/optimization_guide/internal"] path = components/optimization_guide/internal - url = https://chrome-internal.googlesource.com/chrome/components/optimization_guide + url = https://chrome-internal.googlesource.com/chrome/components/optimization_guide.git gclient-condition = checkout_src_internal [submodule "components/resources/default_100_percent/google_chrome"] path = components/resources/default_100_percent/google_chrome - url = https://chrome-internal.googlesource.com/chrome/components/default_100_percent/google_chrome + url = https://chrome-internal.googlesource.com/chrome/components/default_100_percent/google_chrome.git gclient-condition = checkout_src_internal [submodule "components/resources/default_200_percent/google_chrome"] path = components/resources/default_200_percent/google_chrome - url = https://chrome-internal.googlesource.com/chrome/components/default_200_percent/google_chrome + url = https://chrome-internal.googlesource.com/chrome/components/default_200_percent/google_chrome.git gclient-condition = checkout_src_internal [submodule "components/resources/default_300_percent/google_chrome"] path = components/resources/default_300_percent/google_chrome - url = https://chrome-internal.googlesource.com/chrome/components/default_300_percent/google_chrome + url = https://chrome-internal.googlesource.com/chrome/components/default_300_percent/google_chrome.git gclient-condition = checkout_src_internal [submodule "components/site_isolation/internal"] path = components/site_isolation/internal - url = https://chrome-internal.googlesource.com/chrome/components/site_isolation + url = https://chrome-internal.googlesource.com/chrome/components/site_isolation.git gclient-condition = checkout_src_internal [submodule "components/test/data/autofill/heuristics-json/internal"] path = components/test/data/autofill/heuristics-json/internal - url = https://chrome-internal.googlesource.com/chrome/test/autofill/structured_forms + url = https://chrome-internal.googlesource.com/chrome/test/autofill/structured_forms.git gclient-condition = checkout_chromium_autofill_test_dependencies [submodule "components/vector_icons/google_chrome"] path = components/vector_icons/google_chrome - url = https://chrome-internal.googlesource.com/chrome/vector_icons/google_chrome + url = https://chrome-internal.googlesource.com/chrome/vector_icons/google_chrome.git gclient-condition = checkout_src_internal [submodule "content/test/data/plugin"] path = content/test/data/plugin - url = https://chrome-internal.googlesource.com/chrome/data/chrome_plugin_tests + url = https://chrome-internal.googlesource.com/chrome/data/chrome_plugin_tests.git gclient-condition = checkout_src_internal [submodule "google_apis/internal"] path = google_apis/internal - url = https://chrome-internal.googlesource.com/chrome/google_apis/internal + url = https://chrome-internal.googlesource.com/chrome/google_apis/internal.git gclient-condition = checkout_src_internal [submodule "ios_internal"] path = ios_internal - url = https://chrome-internal.googlesource.com/chrome/ios_internal + url = https://chrome-internal.googlesource.com/chrome/ios_internal.git gclient-condition = checkout_ios and checkout_src_internal [submodule "remoting/android/internal"] path = remoting/android/internal - url = https://chrome-internal.googlesource.com/chrome/remoting/android/internal + url = https://chrome-internal.googlesource.com/chrome/remoting/android/internal.git gclient-condition = checkout_android and checkout_src_internal [submodule "remoting/host/installer/linux/internal"] path = remoting/host/installer/linux/internal - url = https://chrome-internal.googlesource.com/chrome/remoting/host/installer/linux/internal + url = https://chrome-internal.googlesource.com/chrome/remoting/host/installer/linux/internal.git gclient-condition = checkout_linux and checkout_src_internal [submodule "remoting/internal"] path = remoting/internal - url = https://chrome-internal.googlesource.com/chrome/remoting/internal + url = https://chrome-internal.googlesource.com/chrome/remoting/internal.git gclient-condition = checkout_src_internal [submodule "remoting/test/internal"] path = remoting/test/internal - url = https://chrome-internal.googlesource.com/chrome/remoting/test/internal + url = https://chrome-internal.googlesource.com/chrome/remoting/test/internal.git gclient-condition = checkout_src_internal [submodule "remoting/tools/internal"] path = remoting/tools/internal - url = https://chrome-internal.googlesource.com/chrome/remoting/tools/internal + url = https://chrome-internal.googlesource.com/chrome/remoting/tools/internal.git gclient-condition = checkout_src_internal [submodule "signing_keys"] path = signing_keys - url = https://chrome-internal.googlesource.com/clank/apptestkey + url = https://chrome-internal.googlesource.com/clank/apptestkey.git gclient-condition = checkout_android and checkout_google_internal and checkout_src_internal [submodule "skia/tools/clusterfuzz-data"] path = skia/tools/clusterfuzz-data - url = https://chrome-internal.googlesource.com/chrome/tools/clusterfuzz-data + url = https://chrome-internal.googlesource.com/chrome/tools/clusterfuzz-data.git gclient-condition = checkout_clusterfuzz_data and checkout_src_internal [submodule "third_party/amd"] path = third_party/amd - url = https://chrome-internal.googlesource.com/chrome/deps/amd + url = https://chrome-internal.googlesource.com/chrome/deps/amd.git gclient-condition = checkout_win and checkout_src_internal [submodule "third_party/android_tools_internal"] path = third_party/android_tools_internal - url = https://chrome-internal.googlesource.com/clank/third_party/android_tools + url = https://chrome-internal.googlesource.com/clank/third_party/android_tools.git gclient-condition = checkout_android and checkout_src_internal [submodule "third_party/gles2_conform"] path = third_party/gles2_conform - url = https://chrome-internal.googlesource.com/chrome/deps/gles2_conform + url = https://chrome-internal.googlesource.com/chrome/deps/gles2_conform.git gclient-condition = checkout_src_internal [submodule "third_party/googlemac"] path = third_party/googlemac - url = https://chrome-internal.googlesource.com/chrome/deps/googlemac + url = https://chrome-internal.googlesource.com/chrome/deps/googlemac.git gclient-condition = checkout_mac and checkout_src_internal [submodule "third_party/khronos_glcts"] path = third_party/khronos_glcts - url = https://chrome-internal.googlesource.com/chrome/deps/khronos_glcts + url = https://chrome-internal.googlesource.com/chrome/deps/khronos_glcts.git gclient-condition = checkout_src_internal [submodule "third_party/widevine/cdm/chromeos"] path = third_party/widevine/cdm/chromeos - url = https://chrome-internal.googlesource.com/chrome/deps/widevine/cdm/chromeos + url = https://chrome-internal.googlesource.com/chrome/deps/widevine/cdm/chromeos.git gclient-condition = (checkout_chromeos or checkout_linux) and checkout_src_internal [submodule "third_party/widevine/cdm/linux"] path = third_party/widevine/cdm/linux - url = https://chrome-internal.googlesource.com/chrome/deps/widevine/cdm/linux + url = https://chrome-internal.googlesource.com/chrome/deps/widevine/cdm/linux.git gclient-condition = checkout_linux and checkout_src_internal [submodule "third_party/widevine/cdm/mac"] path = third_party/widevine/cdm/mac - url = https://chrome-internal.googlesource.com/chrome/deps/widevine/cdm/mac + url = https://chrome-internal.googlesource.com/chrome/deps/widevine/cdm/mac.git gclient-condition = checkout_mac and checkout_src_internal [submodule "third_party/widevine/cdm/win"] path = third_party/widevine/cdm/win - url = https://chrome-internal.googlesource.com/chrome/deps/widevine/cdm/win + url = https://chrome-internal.googlesource.com/chrome/deps/widevine/cdm/win.git gclient-condition = checkout_win and checkout_src_internal [submodule "third_party/widevine/scripts"] path = third_party/widevine/scripts - url = https://chrome-internal.googlesource.com/chrome/deps/widevine/scripts + url = https://chrome-internal.googlesource.com/chrome/deps/widevine/scripts.git gclient-condition = checkout_src_internal [submodule "third_party/widevine/test/license_server"] path = third_party/widevine/test/license_server - url = https://chrome-internal.googlesource.com/chrome/deps/widevine/test/license_server + url = https://chrome-internal.googlesource.com/chrome/deps/widevine/test/license_server.git gclient-condition = checkout_linux and checkout_src_internal [submodule "third_party/wix"] path = third_party/wix - url = https://chrome-internal.googlesource.com/chrome/deps/wix/v3_5_2519 + url = https://chrome-internal.googlesource.com/chrome/deps/wix/v3_5_2519.git gclient-condition = checkout_win and checkout_src_internal [submodule "tools/perf/data"] path = tools/perf/data - url = https://chrome-internal.googlesource.com/chrome/tools/perf/data + url = https://chrome-internal.googlesource.com/chrome/tools/perf/data.git gclient-condition = checkout_src_internal [submodule "ui/file_manager/internal"] path = ui/file_manager/internal - url = https://chrome-internal.googlesource.com/chrome/file_manager + url = https://chrome-internal.googlesource.com/chrome/file_manager.git gclient-condition = (checkout_chromeos or checkout_linux) and checkout_src_internal [submodule "ui/webui/internal"] path = ui/webui/internal - url = https://chrome-internal.googlesource.com/chrome/ui-webui-internal + url = https://chrome-internal.googlesource.com/chrome/ui-webui-internal.git gclient-condition = checkout_chromeos and checkout_src_internal [submodule "webkit/data/bmp_decoder"] path = webkit/data/bmp_decoder - url = https://chrome-internal.googlesource.com/chrome/data/bmp_decoder + url = https://chrome-internal.googlesource.com/chrome/data/bmp_decoder.git gclient-condition = checkout_src_internal [submodule "webkit/data/ico_decoder"] path = webkit/data/ico_decoder - url = https://chrome-internal.googlesource.com/chrome/data/ico_decoder + url = https://chrome-internal.googlesource.com/chrome/data/ico_decoder.git gclient-condition = checkout_src_internal [submodule "webkit/data/test_shell/plugins"] path = webkit/data/test_shell/plugins - url = https://chrome-internal.googlesource.com/chrome/data/webkit_plugin_tests + url = https://chrome-internal.googlesource.com/chrome/data/webkit_plugin_tests.git gclient-condition = checkout_src_internal
diff --git a/AUTHORS b/AUTHORS index 6c5f4c6..db4cd10 100644 --- a/AUTHORS +++ b/AUTHORS
@@ -134,7 +134,7 @@ Anshul Jain <anshul.jain@samsung.com> Anssi Hannula <anssi.hannula@iki.fi> Anthony Halliday <anth.halliday12@gmail.com> -Anton Bershanskiy <8knots@protonmail.com> +Anton Bershanskyi <bershanskyi@gmail.com> Anton Obzhirov <a.obzhirov@samsung.com> Antonin Hildebrand <antonin.hildebrand@gmail.com> Antonio Gomes <a1.gomes@sisa.samsung.com>
diff --git a/DEPS b/DEPS index a647221..1f062c91 100644 --- a/DEPS +++ b/DEPS
@@ -302,27 +302,27 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'src_internal_revision': '63855671b456f868bcdbce8a29290156fca3dc6b', + 'src_internal_revision': '1931bbc2e77812d0a84aaadc2ab830a556752026', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '38e60fd69349502a6cd44962133cae1936167352', + 'skia_revision': '2f01d500a3527e3bbe031b5d8030537cc6c19c30', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '30e826391ad51011e6829dde5a1b246dd1588f19', + 'v8_revision': 'e91bf136784e87899d01ddd36ed3d41de55a91e1', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': 'd696b40fad24202791ecb40d9ea13a2ab4be15cf', + 'angle_revision': '58a32acce662472ccc6b098ae14b54769bd8b8dd', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. - 'swiftshader_revision': '35b1a501141a4c77353376fc47121e95d2559e9a', + 'swiftshader_revision': '4befa3ada54ce2fbdadb2383712da70811efe85e', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '40d92c45b3aaf51cf033360e06ab497a2d6afdc8', + 'pdfium_revision': 'd06523d84bb3152be44a07e8cf0ca7fe30c8bc8e', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. @@ -377,11 +377,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': 'd9aa189385c2a4ec17be2f88291a6cd826ca62fd', + 'catapult_revision': 'ee967548fe6a699fc295d81bd05c8116bcaf5e7e', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling chromium_variations # and whatever else without interference from each other. - 'chromium_variations_revision': '9d9709a512f866a5d5f129157b8545c46b2c44c6', + 'chromium_variations_revision': '61a1f74eb3fecaecda6e1ecfcbaae52fcbe2ea02', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling CrossBench # and whatever else without interference from each other. @@ -397,7 +397,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': '2c58d1b91203d9e638f50506b6d9532189d3a671', + 'devtools_frontend_revision': '3244a16141e7321b545e26eacd86748560134607', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -421,7 +421,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': '5b846751ebc47dfdd36a185ae3ce177dc7ab0133', + 'dawn_revision': '58f8ed20eee52baa84b9ce9c336e7b51278fe413', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -465,7 +465,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'cros_components_revision': 'ca55e0d202b250efb4b91464090b31d79bf4b38e', + 'cros_components_revision': 'b4f7f5b1b91f7c174be87a85b056c6b52f7fdf11', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -473,7 +473,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'libcxxabi_revision': 'c21fd3819a09fb151561b738ce1e4fdb6dbf3627', + 'libcxxabi_revision': '4cb5c2cefedc025433f81735bacbc0f773fdcd8f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -497,7 +497,7 @@ # If you change this, also update the libc++ revision in # //buildtools/deps_revisions.gni. - 'libcxx_revision': '6cd38f6d30dda7bed3df08427db0b2a4e3fa9e47', + 'libcxx_revision': '0ad014cff4509d293e62d1d8c7ffd080bcb2f2d6', # GN CIPD package version. 'gn_version': 'git_revision:7367b0df0a0aa25440303998d54045bda73935a5', @@ -821,12 +821,12 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - 'e4d96a442aa336f431e66b1a29d61da34f59bcb6', + '0b5f021a8a68d2e7b9608875dbca50ec07256d1f', 'condition': 'checkout_android and checkout_src_internal', }, 'src/docs/website': { - 'url': Var('chromium_git') + '/website.git' + '@' + '6e489be4eaddfb81f7a34feb9bb32529751afc8a', + 'url': Var('chromium_git') + '/website.git' + '@' + '3ad9a16c79e736566dbd597d88cdbe86878895c4', }, 'src/ios/third_party/earl_grey2/src': { @@ -1125,28 +1125,6 @@ 'src/third_party/breakpad/breakpad': Var('chromium_git') + '/breakpad/breakpad.git' + '@' + 'f49c2f1a2023da0cb055874fba050563dfea57db', - 'src/third_party/byte_buddy': { - 'packages': [ - { - 'package': 'chromium/third_party/byte_buddy', - 'version': 'c9b53316603fc2d997c899c7ca1707f809b918cd', - }, - ], - 'condition': 'checkout_android', - 'dep_type': 'cipd', - }, - - 'src/third_party/byte_buddy/android_sdk_build_tools_25_0_2': { - 'packages': [ - { - 'package': 'chromium/third_party/android_sdk/public/build-tools', - 'version': 'kwIs2vdfTm93yEP8LG5aSnchN4BVEdVxbqQtF4XpPdkC', - }, - ], - 'condition': 'checkout_android', - 'dep_type': 'cipd', - }, - 'src/third_party/cast_core/public/src': Var('chromium_git') + '/cast_core/public' + '@' + '71f51fd6fa45fac73848f65421081edd723297cd', @@ -1180,7 +1158,7 @@ # Tools used when building Chrome for Chrome OS. This affects both the Simple # Chrome workflow, as well as the chromeos-chrome ebuild. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '24d536be3fb5c0952c1fce422827d1077b2ee558', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '0592ecc29eed261523605aca05147096225eb883', 'condition': 'checkout_chromeos', }, @@ -1215,13 +1193,13 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '9e5fc28b6b27ad4ffb4c3ddc66388e53e4f0f5b0', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'b5393e57bb81eb1b6fbecbd7f466abcb61d278b4', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), 'src/third_party/devtools-frontend-internal': { - 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + 'd567cf29ad32e9aaeac80a6f7f69a978c28c2aa0', + 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '7268173c709ac8cb6c9a61b79a22faf2b819cd1e', 'condition': 'checkout_src_internal', }, @@ -1554,7 +1532,7 @@ }, 'src/third_party/libvpx/source/libvpx': - Var('chromium_git') + '/webm/libvpx.git' + '@' + '9142314c2cec2be364e6844d1630a056e7b0a3c8', + Var('chromium_git') + '/webm/libvpx.git' + '@' + '741b8f6228984e888c99849d7675ea4132eaf268', 'src/third_party/libwebm/source': Var('chromium_git') + '/webm/libwebm.git' + '@' + 'e4fbea0c9751ae8aa86629b197a28d8276a2b0da', @@ -1726,7 +1704,7 @@ 'packages': [ { 'package': 'chromium/third_party/r8', - 'version': '1cleC9ETmNTNjX-TQoPj14Siz7FFAy6HR6x5pbSS00oC', + 'version': 'wtFJRWzGTig_UR3UW82YW63l-sTznrAPEatq-o7zNqYC', }, ], 'condition': 'checkout_android', @@ -1868,10 +1846,10 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'f4bf599a8b575df685c31d9c4729a70a04e377ed', 'src/third_party/webgpu-cts/src': - Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '2979ce07231ba66e06675c83e1cdd3c483165820', + Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '2480dfa32642f7baeb3cd02a13833bc353d1adec', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'ee46340054fac6072259be0d7f43263299d9b88b', + Var('webrtc_git') + '/src.git' + '@' + '59d0b8de33f2195895dc7765e0f9919352e0c45c', # Wuffs' canonical repository is at github.com/google/wuffs, but we use # Skia's mirror of Wuffs, the same as in upstream Skia's DEPS file. @@ -2005,7 +1983,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/media_app/app', - 'version': 'ic7q4tzhjvSxyXW9fh8QKP40_gG0DzFoLGt9aFqmRtgC', + 'version': 'MJtC2-S2vM2TQbEDoFIxCe1fNPEGibKAKk_rK-2lDA0C', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -2038,7 +2016,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/projector_app/app', - 'version': 'zRfUGoidH27lQB6gGRQY9zwb7VojE61lJHk7sr-ga_cC', + 'version': 'nddQ8la023Mm8RAi5AZaRdcw3v_NL_YXwVpSWxXu6K0C', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -3837,7 +3815,7 @@ 'src/chrome/browser/internal': { 'url': Var('chrome_git') + '/chrome/browser_internal.git' + '@' + - '0f2c0c17153168a10ee3206f800580f05aea966f', + '6f0dc0a0599614e23371f3b66b671d8b31f42c5b', 'condition': 'checkout_src_internal', }, @@ -3849,7 +3827,7 @@ 'src/chrome/browser/nearby_sharing/internal': { 'url': Var('chrome_git') + '/chrome/browser/nearby_sharing/internal.git' + '@' + - 'f7a3a3e99e2606d37b8adc16f66dd5803d652d8c', + 'c7dd8f2ba6f41ff0676995239789b84f4e26596d', 'condition': 'checkout_src_internal', }, @@ -3974,7 +3952,7 @@ 'src/components/optimization_guide/internal': { 'url': Var('chrome_git') + '/chrome/components/optimization_guide.git' + '@' + - 'a7c5748d8b64f469eddd7b4beebc55267eda8f7e', + '83caffe8cb8abb5143134df88373014063133602', 'condition': 'checkout_src_internal', }, @@ -4028,7 +4006,7 @@ 'src/ios_internal': { 'url': Var('chrome_git') + '/chrome/ios_internal.git' + '@' + - 'a71771e41c4c362860b19a619ce1ba6b018903b1', + '3421205b08a716356d3f36e2c93e118e12a92f6f', 'condition': 'checkout_ios and checkout_src_internal', },
diff --git a/WATCHLISTS b/WATCHLISTS index b73738dc..6c45f11 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -147,6 +147,10 @@ 'arc_auth': { 'filepath': 'chrome/browser/ash/arc/auth' }, + 'arc_compat_mode': { + 'filepath': 'ash/components/arc/compat_mode/|' \ + 'arc_compat_mode|resize_lock', + }, 'arc_fileapi': { 'filepath': 'chrome/browser/ash/arc/fileapi' }, @@ -1141,6 +1145,9 @@ 'chromeos/ash/components/dbus/fwupd/|' \ 'chromeos/ash/components/fwupd/', }, + 'float': { + 'filepath': 'ash/wm/float/' + }, 'freetype_update': { 'filepath': 'third_party/freetype/README.chromium', }, @@ -1998,6 +2005,9 @@ '|third_party/hunspell/'\ '|third_party/hunspell_dictionaries/', }, + 'splitview': { + 'filepath': 'ash/wm/splitview/' + }, 'startup': { 'filepath': 'chrome/browser/ui/startup/', }, @@ -2324,6 +2334,12 @@ 'windows_sandboxing': { 'filepath': 'sandbox/win/', }, + 'wm_state': { + 'filepath': 'ash/wm/base_state.*|' \ + 'ash/wm/client_controlled_state.*|' \ + 'ash/wm/default_state.*|' \ + 'ash/wm/tablet_mode/tablet_mode_window_state.*' + }, 'wpt_tools': { 'filepath': 'third_party/blink/web_tests/external/wpt/tools/', }, @@ -2420,6 +2436,7 @@ 'arc': ['hidehiko+watch@chromium.org', 'arc-reviews+chromium@google.com'], 'arc_auth': ['khmel+watch@chromium.org'], + 'arc_compat_mode': ['toshikikikuchi+watch-compat@chromium.org'], 'arc_fileapi': ['alanding+watch@chromium.org', 'djacobo+watch@chromium.org'], 'arc_ime': ['yhanada+watch@chromium.org'], @@ -2837,6 +2854,7 @@ 'firmware_update': ['zentaro+firmware-watch@chromium.org', 'jimmyxgong+firmware-watch@chromium.org', 'michaelcheco+firmware-watch@google.com'], + 'float': ['toshikikikuchi+watch-float@chromium.org'], 'freetype_update': ['drott+watch@chromium.org', 'thestig@chromium.org'], 'fsp': ['mtomasz+watch@chromium.org'], @@ -3165,6 +3183,7 @@ 'sullivan@chromium.org'], 'spellcheck': ['rlp+watch@chromium.org', 'rouslan+spell@chromium.org'], + 'splitview': ['toshikikikuchi+watch-splitview@chromium.org'], 'startup': ['cmfcmf+watch@chromium.org', 'nicolaso+watch@chromium.org', 'ydago+watch@chromium.org'], @@ -3299,6 +3318,7 @@ 'website_settings': ['dullweber+watch@chromium.org', 'msramek+watch@chromium.org'], 'windows_sandboxing': ['wfh+watch@chromium.org'], + 'wm_state': ['toshikikikuchi+watch-state@chromium.org'], 'wpt_tools': ['lpz+watch@chromium.org'], 'x11': ['sadrul@chromium.org'], 'zlib': ['cblume+zlib@chromium.org'],
diff --git a/android_webview/BUILD.gn b/android_webview/BUILD.gn index d0726f9..4020844 100644 --- a/android_webview/BUILD.gn +++ b/android_webview/BUILD.gn
@@ -752,6 +752,7 @@ android_library("common_platform_services_java") { sources = [ "java/src/org/chromium/android_webview/common/AwSupervisedUserUrlClassifierDelegate.java", + "java/src/org/chromium/android_webview/common/MediaIntegrityApiStatus.java", "java/src/org/chromium/android_webview/common/PlatformServiceBridge.java", "java/src/org/chromium/android_webview/common/PlatformServiceBridgeImpl.java", ] @@ -827,7 +828,6 @@ "java/src/org/chromium/android_webview/common/Flag.java", "java/src/org/chromium/android_webview/common/FlagOverrideHelper.java", "java/src/org/chromium/android_webview/common/Lifetime.java", - "java/src/org/chromium/android_webview/common/MediaIntegrityApiStatus.java", "java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java", "java/src/org/chromium/android_webview/common/SafeModeAction.java", "java/src/org/chromium/android_webview/common/SafeModeActionIds.java",
diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc index ac020d9..1b25bba 100644 --- a/android_webview/browser/aw_content_browser_client.cc +++ b/android_webview/browser/aw_content_browser_client.cc
@@ -639,7 +639,7 @@ : HashRealTimeSelection::kNone; std::vector<std::unique_ptr<blink::URLLoaderThrottle>> result; result.push_back(safe_browsing::BrowserURLLoaderThrottle::Create( - base::BindOnce( + base::BindRepeating( [](AwContentBrowserClient* client) { return client->GetSafeBrowsingUrlCheckerDelegate(); }, @@ -702,7 +702,7 @@ std::vector<std::unique_ptr<blink::URLLoaderThrottle>> result; result.push_back(safe_browsing::BrowserURLLoaderThrottle::Create( - base::BindOnce( + base::BindRepeating( [](AwContentBrowserClient* client) { return client->GetSafeBrowsingUrlCheckerDelegate(); },
diff --git a/android_webview/browser/aw_field_trials.cc b/android_webview/browser/aw_field_trials.cc index f6b851c6..401ea22 100644 --- a/android_webview/browser/aw_field_trials.cc +++ b/android_webview/browser/aw_field_trials.cc
@@ -86,6 +86,9 @@ aw_feature_overrides.DisableFeature( blink::features::kReduceUserAgentMinorVersion); + // Disable fenced frames on WebView. + aw_feature_overrides.DisableFeature(blink::features::kFencedFrames); + // Disable skip Safe Browsing subresource checks on WebView since WebView's // rollout schedule is behind Clank's schedule. aw_feature_overrides.DisableFeature(
diff --git a/android_webview/browser/aw_field_trials_unittest.cc b/android_webview/browser/aw_field_trials_unittest.cc index dcd5a35e..b3028e5b 100644 --- a/android_webview/browser/aw_field_trials_unittest.cc +++ b/android_webview/browser/aw_field_trials_unittest.cc
@@ -79,7 +79,7 @@ TEST_F(AwFieldTrialsTest, CommandLineEnableFeatureOverrides) { AwFieldTrials aw_field_trials; auto feature_list = std::make_unique<base::FeatureList>(); - feature_list->InitializeFromCommandLine(kUserAgentClientHintFeatureName, ""); + feature_list->InitFromCommandLine(kUserAgentClientHintFeatureName, ""); aw_field_trials.RegisterFeatureOverrides(feature_list.get()); base::FeatureList::SetInstance(std::move(feature_list)); @@ -90,7 +90,7 @@ TEST_F(AwFieldTrialsTest, CommandLineDisableFeatureOverrides) { AwFieldTrials aw_field_trials; auto feature_list = std::make_unique<base::FeatureList>(); - feature_list->InitializeFromCommandLine("", kUserAgentClientHintFeatureName); + feature_list->InitFromCommandLine("", kUserAgentClientHintFeatureName); aw_field_trials.RegisterFeatureOverrides(feature_list.get()); base::FeatureList::SetInstance(std::move(feature_list));
diff --git a/android_webview/browser/metrics/aw_metrics_service_client_unittest.cc b/android_webview/browser/metrics/aw_metrics_service_client_unittest.cc index f84534d1..285113f 100644 --- a/android_webview/browser/metrics/aw_metrics_service_client_unittest.cc +++ b/android_webview/browser/metrics/aw_metrics_service_client_unittest.cc
@@ -99,9 +99,7 @@ } // namespace -TEST_F( - AwMetricsServiceClientTest, - TestServerSideAllowlist_TestShouldRecordPackageNameWithServerSideAllowlistEnabled) { +TEST_F(AwMetricsServiceClientTest, TestShouldRecordPackageName) { AwMetricsServiceClient* client = GetClient(); EXPECT_TRUE(client->ShouldRecordPackageName()); }
diff --git a/android_webview/java/src/org/chromium/android_webview/common/MediaIntegrityApiStatus.java b/android_webview/java/src/org/chromium/android_webview/common/MediaIntegrityApiStatus.java index 1013ede..9ad0669 100644 --- a/android_webview/java/src/org/chromium/android_webview/common/MediaIntegrityApiStatus.java +++ b/android_webview/java/src/org/chromium/android_webview/common/MediaIntegrityApiStatus.java
@@ -11,15 +11,26 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +/** + * Defines permission levels for the Media Integrity API. + * + * This enum is logged in Android.WebView.MediaIntegrity.ApiStatus + * histogram and its values correspond to + * AndroidWebViewMediaIntegrityApiStatus in enums.xml + * + * Please do not delete, reorder or reuse these values. + */ @Target(ElementType.TYPE_USE) @Retention(RetentionPolicy.SOURCE) @IntDef({ MediaIntegrityApiStatus.DISABLED, MediaIntegrityApiStatus.ENABLED_WITHOUT_APP_IDENTITY, - MediaIntegrityApiStatus.ENABLED + MediaIntegrityApiStatus.ENABLED, + MediaIntegrityApiStatus.COUNT }) public @interface MediaIntegrityApiStatus { int DISABLED = 0; int ENABLED_WITHOUT_APP_IDENTITY = 1; int ENABLED = 2; + int COUNT = 3; }
diff --git a/android_webview/java/src/org/chromium/android_webview/common/PlatformServiceBridge.java b/android_webview/java/src/org/chromium/android_webview/common/PlatformServiceBridge.java index 7617a0b8..89ba645 100644 --- a/android_webview/java/src/org/chromium/android_webview/common/PlatformServiceBridge.java +++ b/android_webview/java/src/org/chromium/android_webview/common/PlatformServiceBridge.java
@@ -196,7 +196,7 @@ ProfileIdentifier getProfileIdentifier(); /** Get the availability status of the WebView Media Integrity API for given URI. */ - int getMediaIntegrityApiStatusForUri(Uri uri); + @MediaIntegrityApiStatus int getMediaIntegrityApiStatusForUri(Uri uri); } /** @see {@link org.chromium.android_webview.WebMessageListener} */
diff --git a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java index 821bb5e..9dd51364 100644 --- a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java +++ b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java
@@ -788,6 +788,10 @@ + " contention."), Flag.baseFeature( ContentFeatures.BACK_FORWARD_CACHE, "Controls if back/forward cache is enabled."), + Flag.baseFeature( + VizFeatures.INVALIDATE_LOCAL_SURFACE_ID_PRE_COMMIT, + "When enabled, invalidates the LocalSurfaceId of the DelegatedFrameHostAndroid when" + + " the old page is about to be unloaded."), // Add new commandline switches and features above. The final entry should have a // trailing comma for cleaner diffs. };
diff --git a/android_webview/support_library/BUILD.gn b/android_webview/support_library/BUILD.gn index daca5edc..aeb618e 100644 --- a/android_webview/support_library/BUILD.gn +++ b/android_webview/support_library/BUILD.gn
@@ -37,6 +37,7 @@ deps = [ "//android_webview:browser_java", "//android_webview:common_java", + "//android_webview:common_platform_services_java", "//android_webview/glue:glue_java", "//android_webview/support_library/boundary_interfaces:boundary_interface_java", "//android_webview/support_library/callback:callback_java",
diff --git a/android_webview/test/components/OWNERS b/android_webview/test/components/OWNERS index b981873a..75f9f76a 100644 --- a/android_webview/test/components/OWNERS +++ b/android_webview/test/components/OWNERS
@@ -1 +1 @@ -rmhasan@google.com +zbikowski@google.com
diff --git a/android_webview/tools/cts_config/webview_cts_gcs_path.json b/android_webview/tools/cts_config/webview_cts_gcs_path.json index c7368fbd..8790128 100644 --- a/android_webview/tools/cts_config/webview_cts_gcs_path.json +++ b/android_webview/tools/cts_config/webview_cts_gcs_path.json
@@ -243,10 +243,6 @@ "_bug_id": "crbug.com/1482550" }, { - "match": "android.webkit.cts.WebViewTest#testPauseResumeTimers", - "_bug_id": "crbug.com/1500845" - }, - { "match": "android.webkit.cts.WebViewTest#testLoadUrl", "_bug_id": "crbug.com/1450170" } @@ -320,10 +316,6 @@ "_bug_id": "crbug.com/1482550" }, { - "match": "android.webkit.cts.WebViewTest#testPauseResumeTimers", - "_bug_id": "crbug.com/1500845" - }, - { "match": "android.webkit.cts.WebViewClientTest#testShouldOverrideUrlLoadingOnCreateWindow", "_bug_id": "crbug.com/1100950" }, @@ -397,10 +389,6 @@ "_bug_id": "crbug.com/1482550" }, { - "match": "android.webkit.cts.WebViewTest#testPauseResumeTimers", - "_bug_id": "crbug.com/1500845" - }, - { "match": "android.webkit.cts.WebViewClientTest#testOnSafeBrowsingMalwareCode", "_bug_id": "crbug.com/1245351" }, @@ -501,10 +489,6 @@ "_bug_id": "crbug.com/1482550" }, { - "match": "android.webkit.cts.WebViewTest#testPauseResumeTimers", - "_bug_id": "crbug.com/1500845" - }, - { "match": "android.webkit.cts.WebViewClientTest#testOnSafeBrowsingMalwareCode", "_bug_id": "crbug.com/1245351" }, @@ -653,10 +637,6 @@ "_bug_id": "crbug.com/1482550" }, { - "match": "android.webkit.cts.WebViewTest#testPauseResumeTimers", - "_bug_id": "crbug.com/1500845" - }, - { "match": "android.webkit.cts.WebViewClientTest#testOnSafeBrowsingMalwareCode", "_bug_id": "crbug.com/1245351" }, @@ -832,10 +812,6 @@ "_bug_id": "crbug.com/1482550" }, { - "match": "android.webkit.cts.WebViewTest#testPauseResumeTimers", - "_bug_id": "crbug.com/1500845" - }, - { "match": "android.webkit.cts.WebViewClientTest#testOnSafeBrowsingMalwareCode", "_bug_id": "crbug.com/1245351" },
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 145184d0..e51afba9 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -2417,8 +2417,6 @@ "wm/desks/desk_bar_view_base.h", "wm/desks/desk_button/desk_button.cc", "wm/desks/desk_button/desk_button.h", - "wm/desks/desk_button_base.cc", - "wm/desks/desk_button_base.h", "wm/desks/desk_drag_proxy.cc", "wm/desks/desk_drag_proxy.h", "wm/desks/desk_mini_view.cc", @@ -2443,8 +2441,6 @@ "wm/desks/desks_restore_util.h", "wm/desks/desks_util.cc", "wm/desks/desks_util.h", - "wm/desks/expanded_desks_bar_button.cc", - "wm/desks/expanded_desks_bar_button.h", "wm/desks/legacy_desk_bar_view.cc", "wm/desks/legacy_desk_bar_view.h", "wm/desks/root_window_desk_switch_animator.cc", @@ -2484,8 +2480,6 @@ "wm/desks/templates/saved_desk_save_desk_button_container.h", "wm/desks/templates/saved_desk_util.cc", "wm/desks/templates/saved_desk_util.h", - "wm/desks/zero_state_button.cc", - "wm/desks/zero_state_button.h", "wm/drag_details.cc", "wm/drag_details.h", "wm/drag_window_controller.cc",
diff --git a/ash/accelerators/accelerator_alias_converter.cc b/ash/accelerators/accelerator_alias_converter.cc index 82952f6..3afc2c6 100644 --- a/ash/accelerators/accelerator_alias_converter.cc +++ b/ash/accelerators/accelerator_alias_converter.cc
@@ -418,10 +418,7 @@ std::vector<ui::Accelerator> AcceleratorAliasConverter::CreateSixPackAliases( const ui::Accelerator& accelerator, std::optional<int> device_id) const { - // For all |six_pack_keys|, avoid remapping if [Search] is part of the - // original accelerator. - if (accelerator.IsCmdDown() || - !::features::IsImprovedKeyboardShortcutsEnabled() || + if (!::features::IsImprovedKeyboardShortcutsEnabled() || !ui::KeyboardCapability::IsSixPackKey(accelerator.key_code())) { return std::vector<ui::Accelerator>(); } @@ -450,6 +447,15 @@ return std::vector<ui::Accelerator>(); } + // For all |six_pack_keys|, avoid remapping if the six-pack remap modifier + // (Search or Alt) is part of the original accelerator. + const bool is_search_remap = + six_pack_shortcut_modifier == ui::mojom::SixPackShortcutModifier::kSearch; + if ((is_search_remap && accelerator.IsCmdDown()) || + (!is_search_remap && accelerator.IsAltDown())) { + return std::vector<ui::Accelerator>(); + } + int modifiers; ui::KeyboardCode key_code; if (six_pack_shortcut_modifier ==
diff --git a/ash/accelerators/accelerator_alias_converter_unittest.cc b/ash/accelerators/accelerator_alias_converter_unittest.cc index 7b95591..dd4ff3a 100644 --- a/ash/accelerators/accelerator_alias_converter_unittest.cc +++ b/ash/accelerators/accelerator_alias_converter_unittest.cc
@@ -790,6 +790,17 @@ {ui::Accelerator{ui::VKEY_NEXT, ui::EF_NONE}, ui::Accelerator{ui::VKEY_DOWN, ui::EF_ALT_DOWN}}, + // The following should not perform an alias since Alt is part of the + // original accelerator. + {ui::Accelerator{ui::VKEY_DELETE, ui::EF_ALT_DOWN}, absl::nullopt}, + + {ui::Accelerator{ui::VKEY_HOME, ui::EF_ALT_DOWN}, absl::nullopt}, + + {ui::Accelerator{ui::VKEY_PRIOR, ui::EF_ALT_DOWN}, absl::nullopt}, + + {ui::Accelerator{ui::VKEY_END, ui::EF_ALT_DOWN}, absl::nullopt}, + + {ui::Accelerator{ui::VKEY_NEXT, ui::EF_ALT_DOWN}, absl::nullopt}, })); TEST_P(SixPackAliasAltTest, CheckSixPackAliasAlt) { @@ -818,8 +829,14 @@ std::vector<ui::Accelerator> accelerator_alias = accelerator_alias_converter_.CreateAcceleratorAlias(accelerator_); - EXPECT_EQ(1u, accelerator_alias.size()); - EXPECT_EQ(expected_accelerators_, accelerator_alias[0]); + + if (expected_accelerators_.has_value()) { + // Accelerator has valid a remapping. + EXPECT_EQ(1u, accelerator_alias.size()); + EXPECT_EQ(expected_accelerators_, accelerator_alias[0]); + } else { + EXPECT_EQ(0u, accelerator_alias.size()); + } } class SixPackAliasSearchTest
diff --git a/ash/accessibility/magnifier/docked_magnifier_controller_unittest.cc b/ash/accessibility/magnifier/docked_magnifier_controller_unittest.cc index db9af38..6a0315a 100644 --- a/ash/accessibility/magnifier/docked_magnifier_controller_unittest.cc +++ b/ash/accessibility/magnifier/docked_magnifier_controller_unittest.cc
@@ -24,7 +24,6 @@ #include "ash/test/ash_test_helper.h" #include "ash/test/test_window_builder.h" #include "ash/wm/desks/legacy_desk_bar_view.h" -#include "ash/wm/desks/zero_state_button.h" #include "ash/wm/overview/overview_controller.h" #include "ash/wm/overview/overview_grid.h" #include "ash/wm/overview/overview_item.h"
diff --git a/ash/ambient/managed/screensaver_image_downloader_unittest.cc b/ash/ambient/managed/screensaver_image_downloader_unittest.cc index 860a4d7..ef4ff22 100644 --- a/ash/ambient/managed/screensaver_image_downloader_unittest.cc +++ b/ash/ambient/managed/screensaver_image_downloader_unittest.cc
@@ -8,6 +8,7 @@ #include <optional> #include "ash/ambient/metrics/managed_screensaver_metrics.h" +#include "base/containers/contains.h" #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" @@ -105,9 +106,7 @@ ASSERT_EQ(expected_images.size(), image_list.size()); for (const auto& [path, file_content] : expected_images) { - bool found = std::find(image_list.begin(), image_list.end(), path) != - image_list.end(); - ASSERT_TRUE(found); + ASSERT_TRUE(base::Contains(image_list, path)); ASSERT_TRUE(base::PathExists(path)); std::string actual_file_contents;
diff --git a/ash/ambient/managed/screensaver_images_policy_handler_unittest.cc b/ash/ambient/managed/screensaver_images_policy_handler_unittest.cc index 53ff276..b164bfa 100644 --- a/ash/ambient/managed/screensaver_images_policy_handler_unittest.cc +++ b/ash/ambient/managed/screensaver_images_policy_handler_unittest.cc
@@ -4,7 +4,6 @@ #include "ash/ambient/managed/screensaver_images_policy_handler.h" -#include <algorithm> #include <memory> #include <optional> #include <vector> @@ -21,6 +20,7 @@ #include "ash/test/ash_test_base.h" #include "ash/test/ash_test_helper.h" #include "base/base_paths.h" +#include "base/containers/contains.h" #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" @@ -322,10 +322,8 @@ EXPECT_TRUE(test_future.Wait()); std::vector<base::FilePath> file_paths = test_future.Take(); ASSERT_EQ(2u, file_paths.size()); - EXPECT_NE(file_paths.end(), - std::find(file_paths.begin(), file_paths.end(), file_path1)); - EXPECT_NE(file_paths.end(), - std::find(file_paths.begin(), file_paths.end(), file_path2)); + EXPECT_TRUE(base::Contains(file_paths, file_path1)); + EXPECT_TRUE(base::Contains(file_paths, file_path2)); } EXPECT_TRUE(test_future.IsEmpty()); @@ -372,10 +370,8 @@ EXPECT_TRUE(test_future.Wait()); std::vector<base::FilePath> file_paths = test_future.Take(); EXPECT_EQ(2u, file_paths.size()); - EXPECT_NE(file_paths.end(), std::find(file_paths.begin(), file_paths.end(), - GetExpectedFilePath(kImageUrl1))); - EXPECT_NE(file_paths.end(), std::find(file_paths.begin(), file_paths.end(), - GetExpectedFilePath(kImageUrl2))); + EXPECT_TRUE(base::Contains(file_paths, GetExpectedFilePath(kImageUrl1))); + EXPECT_TRUE(base::Contains(file_paths, GetExpectedFilePath(kImageUrl2))); } }
diff --git a/ash/app_list/app_list_test_api.cc b/ash/app_list/app_list_test_api.cc index b73a28cd..c3775d45 100644 --- a/ash/app_list/app_list_test_api.cc +++ b/ash/app_list/app_list_test_api.cc
@@ -566,15 +566,6 @@ AppListNudgeController::SetReorderNudgeDisabledForTest(disable); } -void AppListTestApi::DisableSearchNotifier(bool disable) { - auto* prefs = - Shell::Get()->session_controller()->GetLastActiveUserPrefService(); - ScopedDictPrefUpdate pref_update(prefs, - ash::prefs::kImageSearchPrivacyNotice); - // Accept the notifier to disable it. - pref_update->Set("accepted", disable); -} - void AppListTestApi::SetContinueSectionPrivacyNoticeAccepted() { AppListNudgeController::SetPrivacyNoticeAcceptedForTest(true); }
diff --git a/ash/app_list/views/app_list_bubble_search_page.cc b/ash/app_list/views/app_list_bubble_search_page.cc index 4ed8d71..01ecbd20 100644 --- a/ash/app_list/views/app_list_bubble_search_page.cc +++ b/ash/app_list/views/app_list_bubble_search_page.cc
@@ -52,7 +52,6 @@ if (search_view_->search_notifier_view() && !notifier_controller->ShouldShowPrivacyNotice()) { search_view_->RemoveSearchNotifierView(); - notifier_controller->EnableImageSearch(); } } }
diff --git a/ash/app_list/views/app_list_search_view.cc b/ash/app_list/views/app_list_search_view.cc index 8d4a1ef3..db5d23f 100644 --- a/ash/app_list/views/app_list_search_view.cc +++ b/ash/app_list/views/app_list_search_view.cc
@@ -61,9 +61,6 @@ constexpr base::TimeDelta kForcedFastAnimationInterval = base::Milliseconds(500); -// The size of the icon in the search notifier. -constexpr int kSearchNotifierIconSize = 30; - } // namespace AppListSearchView::AppListSearchView( @@ -110,48 +107,6 @@ if (features::IsProductivityLauncherImageSearchEnabled()) { search_notifier_controller_ = std::make_unique<SearchNotifierController>(); - if (search_notifier_controller_->ShouldShowPrivacyNotice()) { - // The image search category should be always disabled unless the search - // notifier is accepted or timeout. - view_delegate->SetCategoryEnabled(AppListSearchControlCategory::kImages, - false); - - const std::u16string notifier_title = l10n_util::GetStringUTF16( - IDS_ASH_SEARCH_IMAGE_SEARCH_PRIVACY_NOTICE_TITLE); - const std::u16string notifier_subtitle = l10n_util::GetStringUTF16( - IDS_ASH_SEARCH_IMAGE_SEARCH_PRIVACY_NOTICE_CONTENT); - - AppListToastView::Builder toast_view_builder(notifier_title); - toast_view_builder.SetButton( - l10n_util::GetStringUTF16(IDS_ASH_CONTINUE_BUTTON), - base::BindRepeating(&AppListSearchView::OnSearchNotifierButtonPressed, - weak_ptr_factory_.GetWeakPtr())); - search_notifier_ = scroll_contents->AddChildView( - toast_view_builder.SetViewDelegate(view_delegate) - .SetIcon(ui::ImageModel::FromVectorIcon( - vector_icons::kImageSearchIcon, ui::kColorMenuIcon, - kSearchNotifierIconSize)) - .SetSubtitle(notifier_subtitle) - .SetSubtitleMultiline(true) - .Build()); - search_notifier_->SetProperty(views::kMarginsKey, - gfx::Insets::TLBR(16, 16, 0, 16)); - search_notifier_->icon()->SetProperty(views::kMarginsKey, - gfx::Insets::TLBR(8, 8, 8, 0)); - search_notifier_->toast_button()->SetAccessibleDescription( - notifier_subtitle); - - // Add a guidance under AppListSearchView to guide users to move focus to - // the search notifier. - auto notifier_guide = std::make_unique<views::AXVirtualView>(); - search_notifier_guide_ = notifier_guide.get(); - auto& data = notifier_guide->GetCustomData(); - data.role = ax::mojom::Role::kAlert; - data.SetName(notifier_title); - data.SetDescription(l10n_util::GetStringUTF16( - IDS_ASH_SEARCH_IMAGE_SEARCH_PRIVACY_NOTICE_ACCESSIBILITY_GUIDANCE)); - GetViewAccessibility().AddVirtualChildView(std::move(notifier_guide)); - } } auto add_result_container = [&](SearchResultContainerView* new_container) { @@ -441,6 +396,8 @@ } void AppListSearchView::RemoveSearchNotifierView() { + // TODO(b/311785210): Remove this function if the category nudge is not + // wanted. if (!search_notifier_) { return; } @@ -534,6 +491,8 @@ } void AppListSearchView::OnSearchNotifierButtonPressed() { + // TODO(b/311785210): Remove this function if the category nudge is not + // wanted. search_notifier_controller_->SetPrivacyNoticeAcceptedPref(); RemoveSearchNotifierView();
diff --git a/ash/app_list/views/app_list_search_view_unittest.cc b/ash/app_list/views/app_list_search_view_unittest.cc index 9918c05..8059ba5 100644 --- a/ash/app_list/views/app_list_search_view_unittest.cc +++ b/ash/app_list/views/app_list_search_view_unittest.cc
@@ -544,86 +544,6 @@ client->set_search_callback(TestAppListClient::SearchCallback()); } -TEST_P(SearchResultImageViewTest, SearchNotifierController) { - GetAppListTestHelper()->ShowAppList(); - PrefService* prefs = - Shell::Get()->session_controller()->GetLastActiveUserPrefService(); - auto* notifier_controller = GetSearchView()->search_notifier_controller(); - EXPECT_EQ(notifier_controller->GetPrivacyNoticeShownCount(prefs), 0); - EXPECT_TRUE(notifier_controller->ShouldShowPrivacyNotice()); - EXPECT_FALSE(IsImageSearchEnabled(prefs)); - - // Press a character key to open the search. - PressAndReleaseKey(ui::VKEY_A); - EXPECT_TRUE(GetSearchPage()->GetVisible()); - EXPECT_EQ(notifier_controller->GetPrivacyNoticeShownCount(prefs), 1); - EXPECT_TRUE(notifier_controller->ShouldShowPrivacyNotice()); - // The search notifier shows for the first time. - auto* search_notifier = GetSearchView()->search_notifier_view(); - ASSERT_TRUE(search_notifier); - EXPECT_TRUE(search_notifier->GetVisible()); - - PressAndReleaseKey(ui::VKEY_BACK); - EXPECT_FALSE(GetSearchPage()->GetVisible()); - EXPECT_EQ(notifier_controller->GetPrivacyNoticeShownCount(prefs), 1); - - // The search notifier shows for the second time. - PressAndReleaseKey(ui::VKEY_A); - EXPECT_TRUE(GetSearchPage()->GetVisible()); - EXPECT_EQ(notifier_controller->GetPrivacyNoticeShownCount(prefs), 2); - EXPECT_TRUE(notifier_controller->ShouldShowPrivacyNotice()); - EXPECT_TRUE(search_notifier->GetVisible()); - - PressAndReleaseKey(ui::VKEY_BACK); - EXPECT_FALSE(GetSearchPage()->GetVisible()); - EXPECT_EQ(notifier_controller->GetPrivacyNoticeShownCount(prefs), 2); - - // The search notifier shows for the third time. - PressAndReleaseKey(ui::VKEY_A); - EXPECT_TRUE(GetSearchPage()->GetVisible()); - EXPECT_EQ(notifier_controller->GetPrivacyNoticeShownCount(prefs), 3); - EXPECT_TRUE(notifier_controller->ShouldShowPrivacyNotice()); - EXPECT_TRUE(search_notifier->GetVisible()); - - PressAndReleaseKey(ui::VKEY_BACK); - EXPECT_FALSE(GetSearchPage()->GetVisible()); - EXPECT_EQ(notifier_controller->GetPrivacyNoticeShownCount(prefs), 3); - - // The search notifier should not show more than 3 times. - PressAndReleaseKey(ui::VKEY_A); - EXPECT_TRUE(GetSearchPage()->GetVisible()); - EXPECT_EQ(notifier_controller->GetPrivacyNoticeShownCount(prefs), 4); - EXPECT_FALSE(notifier_controller->ShouldShowPrivacyNotice()); - EXPECT_FALSE(GetSearchView()->search_notifier_view()); - EXPECT_TRUE(IsImageSearchEnabled(prefs)); -} - -TEST_P(SearchResultImageViewTest, AcceptingPrivacyNoticeRemovesIt) { - GetAppListTestHelper()->ShowAppList(); - - auto* search_notifier_controller = - GetSearchView()->search_notifier_controller(); - EXPECT_TRUE(search_notifier_controller->ShouldShowPrivacyNotice()); - PrefService* prefs = - Shell::Get()->session_controller()->GetLastActiveUserPrefService(); - EXPECT_FALSE(IsImageSearchEnabled(prefs)); - - // Press a character key to open the search. - PressAndReleaseKey(ui::VKEY_A); - EXPECT_TRUE(GetSearchPage()->GetVisible()); - auto* search_notifier = GetSearchView()->search_notifier_view(); - ASSERT_TRUE(search_notifier); - EXPECT_TRUE(search_notifier->GetVisible()); - - // Accept the privacy notice. - LeftClickOn(search_notifier->toast_button()); - - // The privacy notice should not be shown again after accepted. - EXPECT_FALSE(GetSearchView()->search_notifier_view()); - EXPECT_FALSE(search_notifier_controller->ShouldShowPrivacyNotice()); - EXPECT_TRUE(IsImageSearchEnabled(prefs)); -} - TEST_P(SearchResultImageViewTest, SearchCategoryMenuItemToggleTest) { base::HistogramTester histogram_tester; GetAppListTestHelper()->ShowAppList(); @@ -795,13 +715,6 @@ // Press a key to start a search. PressAndReleaseKey(ui::VKEY_A); - - // Focus cycle with search notifier will be done in - // ResultSelectionCycleWithSearchNotifier. Remove it here. - auto* search_notifier = GetSearchView()->search_notifier_view(); - EXPECT_TRUE(search_notifier); - LeftClickOn(search_notifier->toast_button()); - EXPECT_FALSE(GetSearchView()->search_notifier_view()); SearchModel::SearchResults* results = test_helper->GetSearchResults(); // Create categorized app results. @@ -863,66 +776,6 @@ kDefaultSearchItems - 1); } -// Tests that key traversal correctly cycles between the list of results and -// search box buttons. -TEST_P(SearchResultImageViewTest, ResultSelectionCycleWithSearchNotifier) { - auto* test_helper = GetAppListTestHelper(); - test_helper->ShowAppList(); - EXPECT_FALSE(GetSearchView()->CanSelectSearchResults()); - - // Press a key to start a search. - PressAndReleaseKey(ui::VKEY_A); - SearchModel::SearchResults* results = test_helper->GetSearchResults(); - - // Create categorized app results. - AppListModelProvider::Get()->search_model()->DeleteAllResults(); - test_helper->GetOrderedResultCategories()->push_back( - AppListSearchResultCategory::kApps); - SetUpSearchResults(results, 1, /*new_result_count=*/2, 100, false, - SearchResult::Category::kApps); - - std::vector<SearchResultContainerView*> result_containers = - GetSearchView()->result_container_views_for_test(); - for (auto* container : result_containers) { - EXPECT_TRUE(container->RunScheduledUpdateForTest()); - } - - // When the search starts, the first result view is selected. - EXPECT_TRUE(GetSearchView()->CanSelectSearchResults()); - ResultSelectionController* controller = - GetSearchView()->result_selection_controller_for_test(); - EXPECT_EQ(controller->selected_location_details()->result_index, 0); - - // When search notifier exists, move the focus to it by pressing up from the - // first search result. - PressAndReleaseKey(ui::VKEY_UP); - auto* search_notifier = GetSearchView()->search_notifier_view(); - EXPECT_FALSE(controller->selected_result()); - EXPECT_TRUE(search_notifier->toast_button()->HasFocus()); - - // Pressing left and right won't change the focus on the search notifier. - PressAndReleaseKey(ui::VKEY_LEFT); - EXPECT_TRUE(search_notifier->toast_button()->HasFocus()); - PressAndReleaseKey(ui::VKEY_RIGHT); - EXPECT_TRUE(search_notifier->toast_button()->HasFocus()); - - // The previous view to focus is the close button. - PressAndReleaseKey(ui::VKEY_UP); - EXPECT_FALSE(controller->selected_result()); - EXPECT_TRUE(GetSearchBoxView()->close_button()->HasFocus()); - - // Pressing down from the close button goes back to the search notifier. - PressAndReleaseKey(ui::VKEY_DOWN); - EXPECT_FALSE(controller->selected_result()); - EXPECT_TRUE(search_notifier->toast_button()->HasFocus()); - - // Return the focus back to the search box and select the first result from - // the search notifier. - PressAndReleaseKey(ui::VKEY_DOWN); - EXPECT_TRUE(GetSearchBoxView()->search_box()->HasFocus()); - EXPECT_EQ(controller->selected_location_details()->result_index, 0); -} - TEST_P(SearchViewClamshellAndTabletTest, AnimateSearchResultView) { // Enable animations. ui::ScopedAnimationDurationScaleMode duration(
diff --git a/ash/app_list/views/app_list_toast_view.cc b/ash/app_list/views/app_list_toast_view.cc index 4af1b61..aa0289d 100644 --- a/ash/app_list/views/app_list_toast_view.cc +++ b/ash/app_list/views/app_list_toast_view.cc
@@ -5,6 +5,7 @@ #include "ash/app_list/views/app_list_toast_view.h" #include <memory> +#include <utility> #include "ash/app_list/app_list_controller_impl.h" #include "ash/app_list/app_list_view_delegate.h" @@ -101,10 +102,10 @@ toast->AddIconBackground(); if (button_callback_) - toast->SetButton(*button_text_, button_callback_); + toast->SetButton(*button_text_, std::move(button_callback_)); if (close_button_callback_) - toast->SetCloseButton(close_button_callback_); + toast->SetCloseButton(std::move(close_button_callback_)); if (subtitle_) toast->SetSubtitle(*subtitle_); @@ -146,7 +147,7 @@ DCHECK(button_callback); button_text_ = button_text; - button_callback_ = button_callback; + button_callback_ = std::move(button_callback); return *this; } @@ -154,7 +155,7 @@ views::Button::PressedCallback close_button_callback) { DCHECK(close_button_callback); - close_button_callback_ = close_button_callback; + close_button_callback_ = std::move(close_button_callback); return *this; } @@ -252,7 +253,7 @@ toast_button_ = AddChildView(std::make_unique<AppListToastView::ToastPillButton>( - view_delegate_, button_callback, button_text, + view_delegate_, std::move(button_callback), button_text, PillButton::Type::kDefaultWithoutIcon, /*icon=*/nullptr)); toast_button_->SetBorder(views::NullBorder()); @@ -263,7 +264,7 @@ DCHECK(close_button_callback); close_button_ = AddChildView(std::make_unique<IconButton>( - close_button_callback, IconButton::Type::kMediumFloating, + std::move(close_button_callback), IconButton::Type::kMediumFloating, &vector_icons::kCloseIcon, IDS_ASH_LAUNCHER_CLOSE_SORT_TOAST_BUTTON_SPOKEN_TEXT)); close_button_->SetProperty(views::kMarginsKey, kCloseButtonMargin); @@ -348,7 +349,8 @@ const std::u16string& text, Type type, const gfx::VectorIcon* icon) - : PillButton(callback, text, type, icon), view_delegate_(view_delegate) { + : PillButton(std::move(callback), text, type, icon), + view_delegate_(view_delegate) { views::FocusRing::Get(this)->SetHasFocusPredicate( base::BindRepeating([](const View* view) { const auto* v = views::AsViewClass<ToastPillButton>(view);
diff --git a/ash/app_list/views/search_notifier_controller.cc b/ash/app_list/views/search_notifier_controller.cc index ed9af6d..b2306a9 100644 --- a/ash/app_list/views/search_notifier_controller.cc +++ b/ash/app_list/views/search_notifier_controller.cc
@@ -17,10 +17,6 @@ namespace ash { namespace { -// Image search privacy notice dictionary pref keys. -constexpr char kPrivacyNoticeShownCount[] = "shown_count"; -constexpr char kPrivacyNoticeAccepted[] = "accepted"; - // Maximum number of times that the notifier can be shown to users. constexpr int kMaxShowCount = 3; @@ -40,20 +36,18 @@ // static void SearchNotifierController::RegisterProfilePrefs( PrefRegistrySimple* registry) { - registry->RegisterDictionaryPref(prefs::kImageSearchPrivacyNotice); + // TODO(b/311785210): Maybe implement category nudge. } // static void SearchNotifierController::ResetPrefsForNewUserSession(PrefService* prefs) { - prefs->ClearPref(prefs::kImageSearchPrivacyNotice); + // TODO(b/311785210): Maybe implement category nudge. } // static int SearchNotifierController::GetPrivacyNoticeShownCount(PrefService* prefs) { - const base::Value::Dict& dictionary = - prefs->GetDict(prefs::kImageSearchPrivacyNotice); - - return dictionary.FindInt(kPrivacyNoticeShownCount).value_or(0); + // TODO(b/311785210): Maybe implement category nudge. + return 0; } // static @@ -72,59 +66,16 @@ // static bool SearchNotifierController::IsPrivacyNoticeAccepted() { - const PrefService* prefs = GetPrefs(); - if (!prefs) { - return false; - } - - return prefs->GetDict(prefs::kImageSearchPrivacyNotice) - .FindBool(kPrivacyNoticeAccepted) - .value_or(false); -} - -void SearchNotifierController::EnableImageSearch() { - PrefService* prefs = GetPrefs(); - if (!prefs) { - return; - } - - ScopedDictPrefUpdate update(prefs, - prefs::kLauncherSearchCategoryControlStatus); - update->Set( - GetAppListControlCategoryName(AppListSearchControlCategory::kImages), - true); + // TODO(b/311785210): Maybe implement category nudge. + return false; } void SearchNotifierController::SetPrivacyNoticeAcceptedPref() { - PrefService* prefs = GetPrefs(); - if (!prefs) { - return; - } - - ScopedDictPrefUpdate privacy_pref_update(prefs, - prefs::kImageSearchPrivacyNotice); - privacy_pref_update->Set(kPrivacyNoticeAccepted, true); - - // Enable the image search as the privacy notice is accepted. - EnableImageSearch(); + // TODO(b/311785210): Maybe implement category nudge. } void SearchNotifierController::UpdateNotifierVisibility(bool visible) { - PrefService* prefs = GetPrefs(); - if (!prefs) { - return; - } - - bool is_visible_updated = visible != is_visible_; - is_visible_ = visible; - ScopedDictPrefUpdate update(prefs, prefs::kImageSearchPrivacyNotice); - - // Update the number of times that the notifier was shown to users if the - // visibility updates. - if (visible && is_visible_updated) { - update->Set(kPrivacyNoticeShownCount, - GetPrivacyNoticeShownCount(prefs) + 1); - } + // TODO(b/311785210): Maybe implement category nudge. } } // namespace ash
diff --git a/ash/app_list/views/search_notifier_controller.h b/ash/app_list/views/search_notifier_controller.h index c94745ee..14fe017 100644 --- a/ash/app_list/views/search_notifier_controller.h +++ b/ash/app_list/views/search_notifier_controller.h
@@ -13,6 +13,9 @@ namespace ash { // Controls the toast search notifier in launcher search. +// TODO(b/311785210): Currently this is not used before the category toggle is +// finished. Either remove this controller if we don't need any notifier in +// launcher search or implement the category nudge to keep this. class ASH_EXPORT SearchNotifierController { public: SearchNotifierController(); @@ -37,9 +40,6 @@ // Whether the privacy notice is accepted by the user. static bool IsPrivacyNoticeAccepted(); - // Enables the image search category in launcher search. - void EnableImageSearch(); - // Updates the privacy notice's accepted pref. void SetPrivacyNoticeAcceptedPref();
diff --git a/ash/app_list/views/search_result_actions_view.cc b/ash/app_list/views/search_result_actions_view.cc index 467503d..ffaa953a 100644 --- a/ash/app_list/views/search_result_actions_view.cc +++ b/ash/app_list/views/search_result_actions_view.cc
@@ -9,6 +9,7 @@ #include <algorithm> #include <memory> #include <optional> +#include <utility> #include "ash/app_list/app_list_util.h" #include "ash/app_list/views/search_result_actions_view_delegate.h" @@ -82,7 +83,7 @@ Type type, const gfx::VectorIcon* icon, const std::u16string& accessible_name) - : IconButton(callback, + : IconButton(std::move(callback), type, icon, action.tooltip_text,
diff --git a/ash/app_list/views/search_result_page_view.cc b/ash/app_list/views/search_result_page_view.cc index b331aedd..38a0a5d 100644 --- a/ash/app_list/views/search_result_page_view.cc +++ b/ash/app_list/views/search_result_page_view.cc
@@ -132,7 +132,6 @@ if (search_view_->search_notifier_view() && !notifier_controller->ShouldShowPrivacyNotice()) { search_view_->RemoveSearchNotifierView(); - notifier_controller->EnableImageSearch(); } } }
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index 8c85f97..2267dea 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd
@@ -2312,15 +2312,6 @@ <message name="IDS_ASH_SEARCH_CATEGORY_FILTER_MENU_WEBSITES_TOOLTIP" desc="The tooltip text of the website menu item in the search category filter menu that shows what search results the category includes."> Websites including pages you've visited and open pages </message> - <message name="IDS_ASH_SEARCH_IMAGE_SEARCH_PRIVACY_NOTICE_TITLE" desc="The title of the search privacy notice that guides users to search their image files by the content of the image."> - Find your images by the content - </message> - <message name="IDS_ASH_SEARCH_IMAGE_SEARCH_PRIVACY_NOTICE_CONTENT" desc="The content of the search privacy notice that guides users to search their image files by the content of the image. Sunset and tree are two of the examples for users to try."> - Try searching "sunset" or "tree" instead of the file name. You can turn off image search in the search bar. - </message> - <message name="IDS_ASH_SEARCH_IMAGE_SEARCH_PRIVACY_NOTICE_ACCESSIBILITY_GUIDANCE" desc="The accessibility guidance in the launcher search to guide users to move focus to the search privacy notice."> - Press shift plus tab to learn more - </message> <message name="IDS_ASH_SEARCH_RESULT_SEPARATOR" desc="Separator between the title and details text in ash search result view."> ''' - ''' </message> @@ -6136,6 +6127,9 @@ <message name="IDS_ASH_SCREEN_CAPTURE_EDUCATION_TUTORIAL_TITLE" desc="The title of the tutorial dialog for Screen Capture Education (Arm 2)."> Press the screenshot shortcut </message> + <message name="IDS_ASH_SCREEN_CAPTURE_EDUCATION_SETTINGS_NUDGE_LABEL" desc="The label of the Screen Capture Education settings nudge (Arm 3) for using the quick settings menu."> + Use the screen capture tool in quick settings to take screenshots + </message> <!-- Snap Group --> <message name="IDS_ASH_SNAP_GROUP_CLICK_TO_LOCK_WINDOWS" desc="Click to lock the windows.">
diff --git a/ash/ash_strings_grd/IDS_ASH_SCREEN_CAPTURE_EDUCATION_SETTINGS_NUDGE_LABEL.png.sha1 b/ash/ash_strings_grd/IDS_ASH_SCREEN_CAPTURE_EDUCATION_SETTINGS_NUDGE_LABEL.png.sha1 new file mode 100644 index 0000000..cf61e32 --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_SCREEN_CAPTURE_EDUCATION_SETTINGS_NUDGE_LABEL.png.sha1
@@ -0,0 +1 @@ +8610c616aa79506fc599fed631f635e5d67ec039 \ No newline at end of file
diff --git a/ash/ash_strings_grd/IDS_ASH_SEARCH_IMAGE_SEARCH_PRIVACY_NOTICE_ACCESSIBILITY_GUIDANCE.png.sha1 b/ash/ash_strings_grd/IDS_ASH_SEARCH_IMAGE_SEARCH_PRIVACY_NOTICE_ACCESSIBILITY_GUIDANCE.png.sha1 deleted file mode 100644 index c03000e..0000000 --- a/ash/ash_strings_grd/IDS_ASH_SEARCH_IMAGE_SEARCH_PRIVACY_NOTICE_ACCESSIBILITY_GUIDANCE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -716d02e92f48d396fd0c677a8769bef98dfa152f \ No newline at end of file
diff --git a/ash/ash_strings_grd/IDS_ASH_SEARCH_IMAGE_SEARCH_PRIVACY_NOTICE_CONTENT.png.sha1 b/ash/ash_strings_grd/IDS_ASH_SEARCH_IMAGE_SEARCH_PRIVACY_NOTICE_CONTENT.png.sha1 deleted file mode 100644 index 92f3275..0000000 --- a/ash/ash_strings_grd/IDS_ASH_SEARCH_IMAGE_SEARCH_PRIVACY_NOTICE_CONTENT.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -08ababc8604b9ada37e4d3b7203210db7f79b029 \ No newline at end of file
diff --git a/ash/ash_strings_grd/IDS_ASH_SEARCH_IMAGE_SEARCH_PRIVACY_NOTICE_TITLE.png.sha1 b/ash/ash_strings_grd/IDS_ASH_SEARCH_IMAGE_SEARCH_PRIVACY_NOTICE_TITLE.png.sha1 deleted file mode 100644 index 92f3275..0000000 --- a/ash/ash_strings_grd/IDS_ASH_SEARCH_IMAGE_SEARCH_PRIVACY_NOTICE_TITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -08ababc8604b9ada37e4d3b7203210db7f79b029 \ No newline at end of file
diff --git a/ash/assistant/ui/main_stage/assistant_opt_in_view.cc b/ash/assistant/ui/main_stage/assistant_opt_in_view.cc index 26dbc84..b12eb88 100644 --- a/ash/assistant/ui/main_stage/assistant_opt_in_view.cc +++ b/ash/assistant/ui/main_stage/assistant_opt_in_view.cc
@@ -5,6 +5,7 @@ #include "ash/assistant/ui/main_stage/assistant_opt_in_view.h" #include <memory> +#include <utility> #include <vector> #include "ash/assistant/ui/assistant_ui_constants.h" @@ -53,7 +54,7 @@ METADATA_HEADER(AssistantOptInContainer); explicit AssistantOptInContainer(views::Button::PressedCallback callback) - : views::Button(callback) { + : views::Button(std::move(callback)) { constexpr float kHighlightOpacity = 0.06f; SetFocusPainter(views::Painter::CreateSolidRoundRectPainter( SkColorSetA(SK_ColorBLACK, 0xff * kHighlightOpacity),
diff --git a/ash/capture_mode/capture_mode_controller.cc b/ash/capture_mode/capture_mode_controller.cc index 0477282..55344143 100644 --- a/ash/capture_mode/capture_mode_controller.cc +++ b/ash/capture_mode/capture_mode_controller.cc
@@ -1112,6 +1112,10 @@ }, weak_ptr_factory_.GetWeakPtr(), std::move(callback), IsActive())); + if (education_controller_) { + education_controller_->CloseAllEducationNudgesAndTutorials(); + } + if (capture_mode_session_ || pending_dlp_check_) { return; }
diff --git a/ash/capture_mode/capture_mode_education_controller.cc b/ash/capture_mode/capture_mode_education_controller.cc index d64bf21..a944d1fc 100644 --- a/ash/capture_mode/capture_mode_education_controller.cc +++ b/ash/capture_mode/capture_mode_education_controller.cc
@@ -14,11 +14,15 @@ #include "ash/public/cpp/system/anchored_nudge_data.h" #include "ash/public/cpp/system/anchored_nudge_manager.h" #include "ash/resources/vector_icons/vector_icons.h" +#include "ash/root_window_controller.h" +#include "ash/shelf/shelf.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" #include "ash/style/ash_color_id.h" #include "ash/style/keyboard_shortcut_view.h" #include "ash/style/system_dialog_delegate_view.h" +#include "ash/system/status_area_widget.h" +#include "ash/system/unified/unified_system_tray.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "ui/base/l10n/l10n_util.h" @@ -59,6 +63,7 @@ return g_clock_override ? g_clock_override->Now() : base::Time::Now(); } +// Creates nudge data common to Arms 1 and 2. AnchoredNudgeData CreateBaseNudgeData(NudgeCatalogName catalog_name) { AnchoredNudgeData nudge_data( kCaptureModeNudgeId, catalog_name, @@ -171,10 +176,10 @@ } // static -bool CaptureModeEducationController::IsArm3SettingsNudgeEnabled() { +bool CaptureModeEducationController::IsArm3QuickSettingsNudgeEnabled() { return features::IsCaptureModeEducationEnabled() && features::kCaptureModeEducationParam.Get() == - features::CaptureModeEducationParam::kSettingsNudge; + features::CaptureModeEducationParam::kQuickSettingsNudge; } void CaptureModeEducationController::MaybeShowEducation() { @@ -208,9 +213,7 @@ pref_service->SetTime(prefs::kCaptureModeEducationLastShown, now); } - // Close any existing forms of education. - AnchoredNudgeManager::Get()->Cancel(kCaptureModeNudgeId); - tutorial_widget_.reset(); + CloseAllEducationNudgesAndTutorials(); if (IsArm1ShortcutNudgeEnabled()) { ShowShortcutNudge(); @@ -219,6 +222,15 @@ if (IsArm2ShortcutTutorialEnabled()) { ShowTutorialNudge(); } + + if (IsArm3QuickSettingsNudgeEnabled()) { + ShowQuickSettingsNudge(); + } +} + +void CaptureModeEducationController::CloseAllEducationNudgesAndTutorials() { + AnchoredNudgeManager::Get()->Cancel(kCaptureModeNudgeId); + tutorial_widget_.reset(); } // static @@ -228,10 +240,6 @@ } void CaptureModeEducationController::ShowShortcutNudge() { - // Close the nudge if it already exists. - auto* nudge_manager = AnchoredNudgeManager::Get(); - nudge_manager->Cancel(kCaptureModeNudgeId); - AnchoredNudgeData nudge_data = CreateBaseNudgeData(NudgeCatalogName::kCaptureModeEducationShortcutNudge); @@ -251,6 +259,24 @@ AnchoredNudgeManager::Get()->Show(nudge_data); } +void CaptureModeEducationController::ShowQuickSettingsNudge() { + AnchoredNudgeData nudge_data( + kCaptureModeNudgeId, + NudgeCatalogName::kCaptureModeEducationQuickSettingsNudge, + l10n_util::GetStringUTF16( + IDS_ASH_SCREEN_CAPTURE_EDUCATION_SETTINGS_NUDGE_LABEL)); + + nudge_data.image_model = ui::ImageModel::FromVectorIcon( + kCaptureModeIcon, kColorAshIconColorPrimary, kShortcutIconSize); + nudge_data.SetAnchorView( + RootWindowController::ForWindow(Shell::GetRootWindowForNewWindows()) + ->shelf() + ->status_area_widget() + ->unified_system_tray()); + + AnchoredNudgeManager::Get()->Show(nudge_data); +} + void CaptureModeEducationController::CreateAndShowTutorialDialog() { // As we are creating a system modal dialog, it will automatically be parented // to `kShellWindowId_SystemModalContainer`.
diff --git a/ash/capture_mode/capture_mode_education_controller.h b/ash/capture_mode/capture_mode_education_controller.h index c3e94e0..c406aef 100644 --- a/ash/capture_mode/capture_mode_education_controller.h +++ b/ash/capture_mode/capture_mode_education_controller.h
@@ -6,7 +6,6 @@ #define ASH_CAPTURE_MODE_CAPTURE_MODE_EDUCATION_CONTROLLER_H_ #include "ash/ash_export.h" -#include "base/gtest_prod_util.h" #include "base/memory/weak_ptr.h" #include "base/time/clock.h" #include "ui/views/widget/unique_widget_ptr.h" @@ -24,7 +23,7 @@ // - Arm 2: Shortcut Tutorial. Similar to Arm 1, but the nudge also appears // with a button that opens a new popup, showing the keyboard layout of where // the shortcut keys are found. -// - Arm 3: Settings Nudge. A system nudge anchored to the quick settings +// - Arm 3: Quick Settings Nudge. A system nudge anchored to the quick settings // button in the shelf, with text alerting users to the Screen Capture tile // in the quick settings menu. class ASH_EXPORT CaptureModeEducationController { @@ -48,14 +47,17 @@ static bool IsArm2ShortcutTutorialEnabled(); // Returns true if the feature flag 'kCaptureModeEducation' is enabled and - // the associated param is 'kSettingsNudge'; - static bool IsArm3SettingsNudgeEnabled(); + // the associated param is 'kQuickSettingsNudge'; + static bool IsArm3QuickSettingsNudgeEnabled(); // If a form of user education has already been shown 3 times or once in the // past 24 hours, returns. Otherwise, shows the appropriate form of user // education based on the enabled arm/feature param. void MaybeShowEducation(); + // Closes any Screen Capture nudges or tutorials that may be open. + void CloseAllEducationNudgesAndTutorials(); + views::Widget* tutorial_widget_for_test() { return tutorial_widget_.get(); } private: @@ -72,6 +74,11 @@ // take a screenshot, with a button to open a new tutorial widget. void ShowTutorialNudge(); + // Shows Arm 3, a system nudge anchored to the unified system tray button, + // indicating the location of the screen capture tool in the quick settings + // menu. + void ShowQuickSettingsNudge(); + // Creates and shows the system dialog displaying the keyboard shortcut and // illustration for taking a screenshot. void CreateAndShowTutorialDialog();
diff --git a/ash/capture_mode/capture_mode_education_controller_unittest.cc b/ash/capture_mode/capture_mode_education_controller_unittest.cc index c4d9f30f..bf7bb5fb 100644 --- a/ash/capture_mode/capture_mode_education_controller_unittest.cc +++ b/ash/capture_mode/capture_mode_education_controller_unittest.cc
@@ -10,6 +10,7 @@ #include "ash/constants/ash_pref_names.h" #include "ash/constants/notifier_catalogs.h" #include "ash/public/cpp/ash_view_ids.h" +#include "ash/root_window_controller.h" #include "ash/shell.h" #include "ash/style/keyboard_shortcut_view.h" #include "ash/system/toast/anchored_nudge.h" @@ -37,6 +38,7 @@ "Ash.NotifierFramework.Nudge.TimeToAction.WithinSession"; constexpr float kKeyboardImageWidth = 448; +constexpr int kNudgeWorkAreaSpacing = 8; PrefService* GetPrefService() { return Shell::Get()->session_controller()->GetActivePrefService(); @@ -71,9 +73,13 @@ CaptureModeEducationController::SetOverrideClockForTesting(test_clock); } - void ActivateNudgeAndCheckVisibility() { + // By default, attempts to use the Windows Snipping Tool (capture bar) + // shortcut to activate the nudge. + void ActivateNudgeAndCheckVisibility(ui::KeyboardCode key_code = ui::VKEY_S, + int flags = ui::EF_COMMAND_DOWN | + ui::EF_SHIFT_DOWN) { // Attempt to use the Windows Snipping Tool (capture bar) shortcut. - PressAndReleaseKey(ui::VKEY_S, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN); + PressAndReleaseKey(key_code, flags); // Get the list of visible nudges from the nudge manager and make sure our // education nudge is in the list and visible. @@ -84,6 +90,32 @@ EXPECT_TRUE(nudge->GetVisible()); } + // Starts a capture session using the screenshort shortcut, and verifies that + // the nudge and tutorial are both closed. Stops the session afterwards. + void StartSessionAndCheckEducationClosed() { + // Use the screenshot shortcut to start a capture session. + PressAndReleaseKey(ui::VKEY_MEDIA_LAUNCH_APP1, + ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN); + + auto* capture_mode_controller = CaptureModeController::Get(); + ASSERT_TRUE(capture_mode_controller->IsActive()); + + // Get the list of visible nudges from the nudge manager and make sure our + // education nudge is no longer in the list. + const AnchoredNudge* nudge = + Shell::Get()->anchored_nudge_manager()->GetNudgeIfShown( + kCaptureModeNudgeId); + EXPECT_FALSE(nudge); + + // The tutorial should also be closed. + EXPECT_FALSE(capture_mode_controller->education_controller() + ->tutorial_widget_for_test()); + + // Stop the session in case we start a new one later. + capture_mode_controller->Stop(); + ASSERT_FALSE(capture_mode_controller->IsActive()); + } + // Skip the 3 times/24 hours show limit for testing. void SkipNudgePrefs() { CaptureModeController::Get()->education_controller()->skip_prefs_for_test_ = @@ -115,7 +147,7 @@ continue; } - ActivateNudgeAndCheckVisibility(); + ActivateNudgeAndCheckVisibility(tracker_data.key_code, tracker_data.flags); // Close nudge to get ready for the next input. CancelNudge(kCaptureModeNudgeId); @@ -135,7 +167,7 @@ ~CaptureModeEducationShortcutNudgeTest() override = default; }; -TEST_F(CaptureModeEducationShortcutNudgeTest, CorrectStyling) { +TEST_F(CaptureModeEducationShortcutNudgeTest, KeyboardShortcutVisible) { base::SimpleTestClock test_clock; CaptureModeEducationControllerTest::SetOverrideClock(&test_clock); @@ -160,6 +192,8 @@ ASSERT_TRUE(shortcut_view); EXPECT_TRUE(shortcut_view->GetVisible()); + StartSessionAndCheckEducationClosed(); + CaptureModeEducationControllerTest::SetOverrideClock(nullptr); } @@ -331,7 +365,7 @@ ~CaptureModeEducationShortcutTutorialTest() override = default; }; -TEST_F(CaptureModeEducationShortcutTutorialTest, DialogShowsOnButtonPressed) { +TEST_F(CaptureModeEducationShortcutTutorialTest, DialogOpensAndCloses) { base::SimpleTestClock test_clock; CaptureModeEducationControllerTest::SetOverrideClock(&test_clock); @@ -360,6 +394,60 @@ VIEW_ID_SCREEN_CAPTURE_EDUCATION_KEYBOARD_IMAGE); ASSERT_TRUE(image_view); EXPECT_EQ(kKeyboardImageWidth, image_view->width()); + + StartSessionAndCheckEducationClosed(); +} + +// Test fixture to verify the behaviour of Arm 3, the settings nudge. +class CaptureModeEducationQuickSettingsNudgeTest + : public CaptureModeEducationControllerTest { + public: + CaptureModeEducationQuickSettingsNudgeTest() + : CaptureModeEducationControllerTest("QuickSettingsNudge") {} + CaptureModeEducationQuickSettingsNudgeTest( + const CaptureModeEducationQuickSettingsNudgeTest&) = delete; + CaptureModeEducationQuickSettingsNudgeTest& operator=( + const CaptureModeEducationQuickSettingsNudgeTest&) = delete; + ~CaptureModeEducationQuickSettingsNudgeTest() override = default; +}; + +TEST_F(CaptureModeEducationQuickSettingsNudgeTest, NudgeLocation) { + UpdateDisplay("800x600"); + base::SimpleTestClock test_clock; + CaptureModeEducationControllerTest::SetOverrideClock(&test_clock); + + // Advance clock so we aren't at zero time. + test_clock.Advance(base::Hours(25)); + + // Attempt to use the Windows Snipping Tool (capture bar) shortcut. + PressAndReleaseKey(ui::VKEY_S, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN); + + // Get the list of visible nudges from the nudge manager and make sure our + // education nudge is in the list and visible. + AnchoredNudge* nudge = + Shell::Get()->anchored_nudge_manager()->GetNudgeIfShown( + kCaptureModeNudgeId); + ASSERT_TRUE(nudge); + EXPECT_TRUE(nudge->GetVisible()); + + // Test the shelf in horizontal (bottom) alignment. + ASSERT_TRUE(Shell::GetPrimaryRootWindowController() + ->shelf() + ->IsHorizontalAlignment()); + + // The nudge should appear on the bottom right side of the screen. Compare the + // positions of the bottom right corners of the nudge and the work area. + const auto nudge_corner = nudge->GetBoundsInScreen().bottom_right(); + auto work_area_corner = + nudge->GetWidget()->GetWorkAreaBoundsInScreen().bottom_right(); + EXPECT_EQ(work_area_corner.x() - kNudgeWorkAreaSpacing, nudge_corner.x()); + EXPECT_EQ(work_area_corner.y() - kNudgeWorkAreaSpacing, nudge_corner.y()); + + StartSessionAndCheckEducationClosed(); + + // TODO(hewer): Test shelf in vertical positions. + + CaptureModeEducationControllerTest::SetOverrideClock(nullptr); } } // namespace ash
diff --git a/ash/capture_mode/capture_mode_menu_group.cc b/ash/capture_mode/capture_mode_menu_group.cc index 4ac053a..4b34cf6 100644 --- a/ash/capture_mode/capture_mode_menu_group.cc +++ b/ash/capture_mode/capture_mode_menu_group.cc
@@ -153,7 +153,7 @@ CaptureModeMenuItem(views::Button::PressedCallback callback, std::u16string item_label, bool indented) - : views::Button(callback), + : views::Button(std::move(callback)), label_view_(AddChildView( std::make_unique<views::Label>(std::move(item_label)))) { SetBorder(views::CreateEmptyBorder(indented ? kIndentedMenuItemPadding @@ -203,7 +203,7 @@ bool checked, bool enabled, bool indented) - : views::Button(callback), + : views::Button(std::move(callback)), option_icon_(option_icon), option_icon_view_( option_icon_ ? AddChildView(std::make_unique<views::ImageView>()) @@ -423,9 +423,10 @@ void CaptureModeMenuGroup::AddMenuItem(views::Button::PressedCallback callback, std::u16string item_label) { - menu_items_.push_back(views::View::AddChildView( - std::make_unique<CaptureModeMenuItem>(callback, std::move(item_label), - /*indented=*/!!menu_header_))); + menu_items_.push_back( + views::View::AddChildView(std::make_unique<CaptureModeMenuItem>( + std::move(callback), std::move(item_label), + /*indented=*/!!menu_header_))); } bool CaptureModeMenuGroup::IsOptionChecked(int option_id) const {
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index 021e231..1f2461c9 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -387,7 +387,7 @@ capture_mode_education_type_options[] = { {CaptureModeEducationParam::kShortcutNudge, "ShortcutNudge"}, {CaptureModeEducationParam::kShortcutTutorial, "ShortcutTutorial"}, - {CaptureModeEducationParam::kSettingsNudge, "SettingsNudge"}}; + {CaptureModeEducationParam::kQuickSettingsNudge, "QuickSettingsNudge"}}; const base::FeatureParam<CaptureModeEducationParam> kCaptureModeEducationParam{ &kCaptureModeEducation, "CaptureModeEducationParam", CaptureModeEducationParam::kShortcutNudge, @@ -781,7 +781,7 @@ // When enabled, it will make login WebUI loaded only before showing it. BASE_FEATURE(kEnableLazyLoginWebUILoading, "EnableLazyLoginWebUILoading", - base::FEATURE_ENABLED_BY_DEFAULT); + base::FEATURE_DISABLED_BY_DEFAULT); // Enables LocalSearchService to be initialized. BASE_FEATURE(kEnableLocalSearchService, @@ -1483,7 +1483,7 @@ // Control whether the hotspot tethering is enabled. When enabled, it will allow // the Chromebook to share its cellular internet connection to other devices. -BASE_FEATURE(kHotspot, "Hotspot", base::FEATURE_ENABLED_BY_DEFAULT); +BASE_FEATURE(kHotspot, "Hotspot", base::FEATURE_DISABLED_BY_DEFAULT); // If enabled, allows the user to cycle between windows of an app using Alt + `. BASE_FEATURE(kSameAppWindowCycle, @@ -2772,7 +2772,7 @@ // This is only used as a way to disable stopAllScreenShare. BASE_FEATURE(kVcStopAllScreenShare, "VcStopAllScreenShare", - base::FEATURE_ENABLED_BY_DEFAULT); + base::FEATURE_DISABLED_BY_DEFAULT); // Enable or disable the fake effects for ChromeOS video conferencing controls // UI. Only meaningful in the emulator.
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h index 7fe7cae..0844f73 100644 --- a/ash/constants/ash_features.h +++ b/ash/constants/ash_features.h
@@ -108,7 +108,7 @@ enum class CaptureModeEducationParam { kShortcutNudge, kShortcutTutorial, - kSettingsNudge + kQuickSettingsNudge }; COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::FeatureParam<CaptureModeEducationParam>
diff --git a/ash/constants/ash_pref_names.h b/ash/constants/ash_pref_names.h index 3212954..c27691f5 100644 --- a/ash/constants/ash_pref_names.h +++ b/ash/constants/ash_pref_names.h
@@ -1337,11 +1337,6 @@ inline constexpr char kLauncherFilesPrivacyNotice[] = "ash.launcher.continue_section_privacy_notice"; -// A dictionary pref that determines if the image search privacy notice in the -// launcher search should be shown or not. -inline constexpr char kImageSearchPrivacyNotice[] = - "ash.launcher.image_search_privacy_notice"; - // A boolean pref that indicates whether lock screen media controls are enabled. // Controlled by user policy. inline constexpr char kLockScreenMediaControlsEnabled[] =
diff --git a/ash/constants/notifier_catalogs.h b/ash/constants/notifier_catalogs.h index f887c95..a098f668 100644 --- a/ash/constants/notifier_catalogs.h +++ b/ash/constants/notifier_catalogs.h
@@ -226,7 +226,8 @@ kMultitaskMenuTablet = 21, kCaptureModeEducationShortcutNudge = 22, kCaptureModeEducationShortcutTutorial = 23, - kMaxValue = kCaptureModeEducationShortcutTutorial + kCaptureModeEducationQuickSettingsNudge = 24, + kMaxValue = kCaptureModeEducationQuickSettingsNudge }; // A living catalog that registers toasts.
diff --git a/ash/display/display_color_manager.cc b/ash/display/display_color_manager.cc index 561f5a31..94a4238 100644 --- a/ash/display/display_color_manager.cc +++ b/ash/display/display_color_manager.cc
@@ -32,7 +32,7 @@ namespace { -std::unique_ptr<DisplayColorManager::ColorCalibrationData> ParseDisplayProfile( +std::unique_ptr<display::ColorCalibration> ParseDisplayProfile( qcms_profile* display_profile, bool has_color_correction_matrix) { if (!display_profile) { @@ -49,8 +49,7 @@ return nullptr; } - std::unique_ptr<DisplayColorManager::ColorCalibrationData> data( - new DisplayColorManager::ColorCalibrationData()); + auto data = std::make_unique<display::ColorCalibration>(); if (vcgt_channel_length) { VLOG_IF(1, has_color_correction_matrix) << "Using VCGT data on CTM enabled platform."; @@ -71,7 +70,7 @@ gamma_lut[i].g = vcgt_data[vcgt_channel_length + i]; gamma_lut[i].b = vcgt_data[(vcgt_channel_length * 2) + i]; } - data->gamma_curve = display::GammaCurve(gamma_lut); + data->linear_to_device = display::GammaCurve(gamma_lut); } } else { VLOG(1) << "Using full degamma/gamma/CTM from profile."; @@ -133,7 +132,7 @@ degamma_lut[i].g = degamma_data[(i * 4) + 1]; degamma_lut[i].b = degamma_data[(i * 4) + 2]; } - data->degamma_curve = display::GammaCurve(degamma_lut); + data->srgb_to_linear = display::GammaCurve(degamma_lut); } { @@ -144,13 +143,14 @@ gamma_lut[i].g = gamma_data[(i * 4) + 1]; gamma_lut[i].b = gamma_data[(i * 4) + 2]; } - data->gamma_curve = display::GammaCurve(gamma_lut); + data->linear_to_device = display::GammaCurve(gamma_lut); } - data->correction_matrix.resize(9); - for (int i = 0; i < 9; ++i) { - data->correction_matrix[i] = - qcms_transform_get_matrix(transform, i / 3, i % 3); + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + data->srgb_to_device_matrix.vals[i][j] = + qcms_transform_get_matrix(transform, i, j); + } } qcms_transform_release(transform); @@ -163,9 +163,9 @@ } // Runs on a background thread because it does file IO. -std::unique_ptr<DisplayColorManager::ColorCalibrationData> -ParseDisplayProfileFile(const base::FilePath& path, - bool has_color_correction_matrix) { +std::unique_ptr<display::ColorCalibration> ParseDisplayProfileFile( + const base::FilePath& path, + bool has_color_correction_matrix) { VLOG(1) << "Trying ICC file " << path.value() << " has_color_correction_matrix: " << (has_color_correction_matrix ? "true" : "false"); @@ -176,7 +176,7 @@ return ParseDisplayProfile(display_profile, has_color_correction_matrix); } -std::unique_ptr<DisplayColorManager::ColorCalibrationData> ParseVpdEntry( +std::unique_ptr<display::ColorCalibration> ParseVpdEntry( bool has_color_correction_matrix) { std::optional<std::string_view> display_profile_string = system::StatisticsProvider::GetInstance()->GetMachineStatistic( @@ -202,10 +202,15 @@ has_color_correction_matrix); } -// Fills |out_result_matrix_vector| from the given skia |matrix|. -void ColorMatrixVectorFromSkMatrix44( - const SkM44& matrix, +// Combines `srgb_to_device_matrix` and `color_matrix` and populates +// `out_result_matrix_vector` with the result. +void ColorMatrixVectorFromSrgbToDeviceAndColorMatrix( + const SkM44& srgb_to_device_matrix, + const SkM44& color_matrix, std::vector<float>* out_result_matrix_vector) { + SkM44 matrix = color_matrix; + matrix.preConcat(srgb_to_device_matrix); + DCHECK(out_result_matrix_vector); out_result_matrix_vector->assign(9, 0.0f); (*out_result_matrix_vector)[0] = matrix.rc(0, 0); @@ -213,14 +218,6 @@ (*out_result_matrix_vector)[8] = matrix.rc(2, 2); } -SkM44 SkMatrix44FromColorMatrixVector(const std::vector<float>& matrix_vector) { - if (matrix_vector.empty()) - return SkM44(); - - DCHECK_EQ(matrix_vector.size(), 9u); - return gfx::SkM44FromRowMajor3x3(matrix_vector.data()); -} - bool HasColorCorrectionMatrix(display::DisplayConfigurator* configurator, int64_t display_id) { for (const auto* display_snapshot : configurator->cached_displays()) { @@ -250,42 +247,38 @@ configurator_->RemoveObserver(this); } -bool DisplayColorManager::SetDisplayColorMatrix(int64_t display_id, - const SkM44& color_matrix) { - for (const auto* display_snapshot : configurator_->cached_displays()) { - if (display_snapshot->display_id() != display_id) - continue; - - return SetDisplayColorMatrix(display_snapshot, color_matrix); - } - - LOG(ERROR) << "Display ID: " << display_id << " cannot be found."; - return false; -} - -bool DisplayColorManager::SetDisplayColorMatrix( - const display::DisplaySnapshot* display_snapshot, - const SkM44& color_matrix) { - DCHECK(display_snapshot); - DCHECK(base::Contains(configurator_->cached_displays(), display_snapshot)); - - if (!display_snapshot->has_color_correction_matrix()) { +bool DisplayColorManager::SetDisplayColorTemperatureAdjustment( + int64_t display_id, + const display::ColorTemperatureAdjustment& cta) { + if (!HasColorCorrectionMatrix(configurator_, display_id)) { // This display doesn't support setting a CRTC matrix. return false; } // Always overwrite any existing matrix for this display. - const int64_t display_id = display_snapshot->display_id(); + SkM44 color_matrix = gfx::SkM44FromSkcmsMatrix3x3(cta.srgb_matrix); displays_color_matrix_map_[display_id] = color_matrix; - const auto iter = calibration_map_.find(display_snapshot->product_code()); - SkM44 combined_matrix = color_matrix; - if (iter != calibration_map_.end()) { - DCHECK(iter->second); - combined_matrix.preConcat( - SkMatrix44FromColorMatrixVector(iter->second->correction_matrix)); + + // Look up the calibration matrix, if one exists. + SkM44 srgb_to_device_matrix; + { + for (const auto* display_snapshot : configurator_->cached_displays()) { + if (display_snapshot->display_id() != display_id) { + continue; + } + const auto iter = calibration_map_.find(display_snapshot->product_code()); + if (iter == calibration_map_.end()) { + continue; + } + DCHECK(iter->second); + srgb_to_device_matrix = + gfx::SkM44FromSkcmsMatrix3x3(iter->second->srgb_to_device_matrix); + break; + } } - ColorMatrixVectorFromSkMatrix44(combined_matrix, &matrix_buffer_); + ColorMatrixVectorFromSrgbToDeviceAndColorMatrix( + srgb_to_device_matrix, color_matrix, &matrix_buffer_); return configurator_->SetColorMatrix(display_id, matrix_buffer_); } @@ -324,25 +317,29 @@ void DisplayColorManager::ApplyDisplayColorCalibration( int64_t display_id, - const ColorCalibrationData& calibration_data) { + const display::ColorCalibration& calibration) { if (HasColorCorrectionMatrix(configurator_, display_id)) { - const auto color_matrix_iter = displays_color_matrix_map_.find(display_id); - const std::vector<float>* final_matrix = - &calibration_data.correction_matrix; - if (color_matrix_iter != displays_color_matrix_map_.end()) { - SkM44 combined_matrix = color_matrix_iter->second; - combined_matrix.preConcat(SkMatrix44FromColorMatrixVector(*final_matrix)); - ColorMatrixVectorFromSkMatrix44(combined_matrix, &matrix_buffer_); - final_matrix = &matrix_buffer_; + SkM44 srgb_to_device_matrix = + gfx::SkM44FromSkcmsMatrix3x3(calibration.srgb_to_device_matrix); + + SkM44 color_matrix; + { + const auto color_matrix_iter = + displays_color_matrix_map_.find(display_id); + if (color_matrix_iter != displays_color_matrix_map_.end()) { + color_matrix = color_matrix_iter->second; + } } - if (!configurator_->SetColorMatrix(display_id, *final_matrix)) + ColorMatrixVectorFromSrgbToDeviceAndColorMatrix( + srgb_to_device_matrix, color_matrix, &matrix_buffer_); + if (!configurator_->SetColorMatrix(display_id, matrix_buffer_)) { LOG(WARNING) << "Error applying the color matrix."; + } } - if (!configurator_->SetGammaCorrection(display_id, - calibration_data.degamma_curve, - calibration_data.gamma_curve)) { + if (!configurator_->SetGammaCorrection(display_id, calibration.srgb_to_linear, + calibration.linear_to_device)) { LOG(WARNING) << "Error applying gamma correction data."; } } @@ -462,7 +459,7 @@ void DisplayColorManager::UpdateCalibrationData( int64_t display_id, int64_t product_id, - std::unique_ptr<ColorCalibrationData> data) { + std::unique_ptr<display::ColorCalibration> data) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Apply the received |data| if valid or reset color calibration. if (data) { @@ -493,9 +490,4 @@ ApplyDisplayColorCalibration(display_id, {} /* calibration_data */); } -DisplayColorManager::ColorCalibrationData::ColorCalibrationData() - : correction_matrix{1, 0, 0, 0, 1, 0, 0, 0, 1} {} - -DisplayColorManager::ColorCalibrationData::~ColorCalibrationData() = default; - } // namespace ash
diff --git a/ash/display/display_color_manager.h b/ash/display/display_color_manager.h index d53b3009..e9b9e25 100644 --- a/ash/display/display_color_manager.h +++ b/ash/display/display_color_manager.h
@@ -63,17 +63,11 @@ return displays_ctm_support_; } - // Sets the given |color_matrix| on the display hardware of |display_id|, - // combining the given matrix with any available color calibration matrix for - // this display. This doesn't affect gamma or degamma values. - // Returns true if the hardware supports this operation and the matrix was - // successfully sent to the GPU. - bool SetDisplayColorMatrix(int64_t display_id, const SkM44& color_matrix); - - // Similar to the above but can be used when a display snapshot is known to - // the caller. - bool SetDisplayColorMatrix(const display::DisplaySnapshot* display_snapshot, - const SkM44& color_matrix); + // Sets the color temperature adjustment for |display_id|. Returns true if the + // hardware supports this operation. + bool SetDisplayColorTemperatureAdjustment( + int64_t display_id, + const display::ColorTemperatureAdjustment& cta); // display::DisplayConfigurator::Observer void OnDisplayModeChanged( @@ -85,16 +79,6 @@ // display::DisplayObserver: void OnDisplayRemoved(const display::Display& old_display) override; - struct ColorCalibrationData { - ColorCalibrationData(); - ~ColorCalibrationData(); - - display::GammaCurve degamma_curve; - display::GammaCurve gamma_curve; - // Initialized to identity to reset color correction. - std::vector<float> correction_matrix; - }; - protected: virtual void FinishLoadCalibrationForDisplay( int64_t display_id, @@ -106,14 +90,14 @@ virtual void UpdateCalibrationData( int64_t display_id, int64_t product_code, - std::unique_ptr<ColorCalibrationData> data); + std::unique_ptr<display::ColorCalibration> data); private: friend class DisplayColorManagerTest; void ApplyDisplayColorCalibration( int64_t display_id, - const ColorCalibrationData& calibration_data); + const display::ColorCalibration& calibration_data); // Attempts to start requesting the ICC profile for |display|. Returns true if // it was successful at initiating the request, false otherwise. @@ -163,7 +147,7 @@ // Maps a display's color calibration data by the display's product code as // the key. - base::flat_map<int64_t, std::unique_ptr<ColorCalibrationData>> + base::flat_map<int64_t, std::unique_ptr<display::ColorCalibration>> calibration_map_; SEQUENCE_CHECKER(sequence_checker_);
diff --git a/ash/display/display_color_manager_unittest.cc b/ash/display/display_color_manager_unittest.cc index e8f3b45..a6358e7 100644 --- a/ash/display/display_color_manager_unittest.cc +++ b/ash/display/display_color_manager_unittest.cc
@@ -97,7 +97,7 @@ void UpdateCalibrationData( int64_t display_id, int64_t product_id, - std::unique_ptr<ColorCalibrationData> data) override { + std::unique_ptr<display::ColorCalibration> data) override { DisplayColorManager::UpdateCalibrationData(display_id, product_id, std::move(data)); if (on_finished_for_test_) { @@ -290,10 +290,11 @@ EXPECT_FALSE(base::MatchPattern(actions, "*set_color_matrix*")); // Attempt to set a color matrix. - SkM44 matrix; - matrix.setRC(1, 1, 0.7); - matrix.setRC(2, 2, 0.3); - EXPECT_FALSE(color_manager_->SetDisplayColorMatrix(kDisplayId, matrix)); + display::ColorTemperatureAdjustment cta; + cta.srgb_matrix.vals[1][1] = 0.7f; + cta.srgb_matrix.vals[2][2] = 0.3f; + EXPECT_FALSE( + color_manager_->SetDisplayColorTemperatureAdjustment(kDisplayId, cta)); EXPECT_EQ(color_manager_->displays_ctm_support(), DisplayColorManager::DisplayCtmSupport::kNone); EXPECT_STREQ("", log_->GetActionsAndClear().c_str()); @@ -322,10 +323,11 @@ log_->GetActionsAndClear(); // Attempt to set a color matrix. - SkM44 matrix; - matrix.setRC(1, 1, 0.7); - matrix.setRC(2, 2, 0.3); - EXPECT_TRUE(color_manager_->SetDisplayColorMatrix(kDisplayId, matrix)); + display::ColorTemperatureAdjustment cta; + cta.srgb_matrix.vals[1][1] = 0.7f; + cta.srgb_matrix.vals[2][2] = 0.3f; + EXPECT_TRUE( + color_manager_->SetDisplayColorTemperatureAdjustment(kDisplayId, cta)); EXPECT_EQ(color_manager_->displays_ctm_support(), DisplayColorManager::DisplayCtmSupport::kAll); // This display has no color calibration data. Gamma/degamma won't be @@ -379,10 +381,11 @@ DisplayColorManager::DisplayCtmSupport::kMixed); // Attempt to set a color matrix. - SkM44 matrix; - matrix.setRC(1, 1, 0.7); - matrix.setRC(2, 2, 0.3); - EXPECT_TRUE(color_manager_->SetDisplayColorMatrix(kDisplayWithCtmId, matrix)); + display::ColorTemperatureAdjustment cta; + cta.srgb_matrix.vals[1][1] = 0.7f; + cta.srgb_matrix.vals[2][2] = 0.3f; + EXPECT_TRUE(color_manager_->SetDisplayColorTemperatureAdjustment( + kDisplayWithCtmId, cta)); // This display has no color calibration data. Gamma/degamma won't be // affected. Color matrix is applied as is. EXPECT_TRUE(base::MatchPattern( @@ -390,7 +393,8 @@ "set_color_matrix(id=123,ctm[0]=1*ctm[4]=0.7*ctm[8]=0.3*)")); // No matrix will be applied to this display. - EXPECT_FALSE(color_manager_->SetDisplayColorMatrix(kDisplayNoCtmId, matrix)); + EXPECT_FALSE(color_manager_->SetDisplayColorTemperatureAdjustment( + kDisplayNoCtmId, cta)); EXPECT_STREQ("", log_->GetActionsAndClear().c_str()); } @@ -416,10 +420,11 @@ log_->GetActionsAndClear(); // Attempt to set a color matrix. - SkM44 matrix; - matrix.setRC(1, 1, 0.7); - matrix.setRC(2, 2, 0.3); - EXPECT_TRUE(color_manager_->SetDisplayColorMatrix(kDisplayId, matrix)); + display::ColorTemperatureAdjustment cta; + cta.srgb_matrix.vals[1][1] = 0.7f; + cta.srgb_matrix.vals[2][2] = 0.3f; + EXPECT_TRUE( + color_manager_->SetDisplayColorTemperatureAdjustment(kDisplayId, cta)); EXPECT_EQ(color_manager_->displays_ctm_support(), DisplayColorManager::DisplayCtmSupport::kAll); // The applied matrix is the combination of this color matrix and the color
diff --git a/ash/fast_ink/fast_ink_host.cc b/ash/fast_ink/fast_ink_host.cc index a56e06f..214f563f 100644 --- a/ash/fast_ink/fast_ink_host.cc +++ b/ash/fast_ink/fast_ink_host.cc
@@ -178,7 +178,7 @@ if (switches::ShouldClearFastInkBuffer()) { if (features::ShouldUseMappableSharedImage()) { - std::unique_ptr<gpu::SharedImageInterface::ScopedMapping> mapping; + std::unique_ptr<gpu::ClientSharedImage::ScopedMapping> mapping; if (client_shared_image_) { mapping = client_shared_image_->Map(); } @@ -241,7 +241,7 @@ } void FastInkHost::DrawBitmap(SkBitmap bitmap, const gfx::Rect& damage_rect) { - std::unique_ptr<gpu::SharedImageInterface::ScopedMapping> mapping; + std::unique_ptr<gpu::ClientSharedImage::ScopedMapping> mapping; { // TODO(zoraiznaeem): Investigate the precision as we will get non trivial
diff --git a/ash/fast_ink/view_tree_host_root_view_frame_factory.cc b/ash/fast_ink/view_tree_host_root_view_frame_factory.cc index b29adbd..10595af 100644 --- a/ash/fast_ink/view_tree_host_root_view_frame_factory.cc +++ b/ash/fast_ink/view_tree_host_root_view_frame_factory.cc
@@ -259,7 +259,7 @@ DCHECK(gpu_buffer || base::FeatureList::IsEnabled( kUseMappableSIInViewTreeHostRootViewFrameFactory)); - std::unique_ptr<gpu::SharedImageInterface::ScopedMapping> mapping; + std::unique_ptr<gpu::ClientSharedImage::ScopedMapping> mapping; auto display_item_list = base::MakeRefCounted<cc::DisplayItemList>(); float dsf = widget_->GetCompositor()->device_scale_factor();
diff --git a/ash/game_dashboard/game_dashboard_button.cc b/ash/game_dashboard/game_dashboard_button.cc index 8d3aaad..d79172a4 100644 --- a/ash/game_dashboard/game_dashboard_button.cc +++ b/ash/game_dashboard/game_dashboard_button.cc
@@ -6,6 +6,7 @@ #include <memory> #include <string> +#include <utility> #include "ash/bubble/bubble_utils.h" #include "ash/game_dashboard/game_dashboard_context.h" @@ -72,7 +73,7 @@ } // namespace GameDashboardButton::GameDashboardButton(PressedCallback callback) - : views::Button(callback) { + : views::Button(std::move(callback)) { auto* layout = SetLayoutManager(std::make_unique<views::BoxLayout>()); layout->set_cross_axis_alignment( views::BoxLayout::CrossAxisAlignment::kCenter);
diff --git a/ash/hud_display/graph_page_view_base.cc b/ash/hud_display/graph_page_view_base.cc index 70ab5f0..620241c 100644 --- a/ash/hud_display/graph_page_view_base.cc +++ b/ash/hud_display/graph_page_view_base.cc
@@ -4,6 +4,8 @@ #include "ash/hud_display/graph_page_view_base.h" +#include <utility> + #include "ash/hud_display/hud_constants.h" #include "ash/hud_display/hud_properties.h" #include "ash/hud_display/legend.h" @@ -35,7 +37,7 @@ METADATA_HEADER(MinMaxButton); explicit MinMaxButton(views::Button::PressedCallback callback) - : views::ImageButton(callback) { + : views::ImageButton(std::move(callback)) { SetBorder(views::CreateEmptyBorder(kMinMaxButtonBorder)); SetBackground(std::make_unique<SolidSourceBackground>(kHUDLegendBackground, /*radius=*/0));
diff --git a/ash/hud_display/hud_header_view.cc b/ash/hud_display/hud_header_view.cc index 5710facf..78fccaa 100644 --- a/ash/hud_display/hud_header_view.cc +++ b/ash/hud_display/hud_header_view.cc
@@ -4,6 +4,8 @@ #include "ash/hud_display/hud_header_view.h" +#include <utility> + #include "ash/hud_display/hud_constants.h" #include "ash/hud_display/hud_display.h" #include "ash/hud_display/hud_properties.h" @@ -72,7 +74,7 @@ METADATA_HEADER(SettingsButton); explicit SettingsButton(views::Button::PressedCallback callback) - : views::ImageButton(callback) { + : views::ImageButton(std::move(callback)) { SetImageModel( views::Button::ButtonState::STATE_NORMAL, ui::ImageModel::FromVectorIcon(vector_icons::kSettingsIcon,
diff --git a/ash/login/ui/login_camera_timeout_view.cc b/ash/login/ui/login_camera_timeout_view.cc index b602e8ce..50f7752 100644 --- a/ash/login/ui/login_camera_timeout_view.cc +++ b/ash/login/ui/login_camera_timeout_view.cc
@@ -4,6 +4,8 @@ #include "ash/login/ui/login_camera_timeout_view.h" +#include <utility> + #include "ash/login/ui/arrow_button_view.h" #include "ash/login/ui/views_utils.h" #include "ash/style/ash_color_id.h" @@ -57,7 +59,7 @@ } LoginCameraTimeoutView::LoginCameraTimeoutView( - const views::Button::PressedCallback& callback) + views::Button::PressedCallback callback) : NonAccessibleView(kLoginCameraTimeoutViewClassName) { SetLayoutManager(std::make_unique<views::BoxLayout>( views::BoxLayout::Orientation::kVertical, gfx::Insets(), @@ -86,8 +88,8 @@ kFontDeltaSubtitle)); // Create arrow button. - auto arrow_button = - std::make_unique<ArrowButtonView>(callback, kArrowButtonSizeDp); + auto arrow_button = std::make_unique<ArrowButtonView>(std::move(callback), + kArrowButtonSizeDp); arrow_button->SetAccessibleName(base::JoinString( {l10n_util::GetStringFUTF16(IDS_ASH_LOGIN_CAMERA_TIME_OUT_TITLE, ui::GetChromeOSDeviceName()),
diff --git a/ash/login/ui/login_camera_timeout_view.h b/ash/login/ui/login_camera_timeout_view.h index 949b096..832e6df 100644 --- a/ash/login/ui/login_camera_timeout_view.h +++ b/ash/login/ui/login_camera_timeout_view.h
@@ -39,7 +39,7 @@ using OnPublicAccountTapped = base::RepeatingClosure; - LoginCameraTimeoutView(const views::Button::PressedCallback& callback); + LoginCameraTimeoutView(views::Button::PressedCallback callback); LoginCameraTimeoutView(const LoginCameraTimeoutView&) = delete; LoginCameraTimeoutView& operator=(const LoginCameraTimeoutView&) = delete;
diff --git a/ash/projector/ui/projector_button.cc b/ash/projector/ui/projector_button.cc index 205835a..0e3ab58 100644 --- a/ash/projector/ui/projector_button.cc +++ b/ash/projector/ui/projector_button.cc
@@ -4,6 +4,8 @@ #include "ash/projector/ui/projector_button.h" +#include <utility> + #include "ash/public/cpp/style/color_provider.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/style/ash_color_provider.h" @@ -26,7 +28,7 @@ ProjectorButton::ProjectorButton(views::Button::PressedCallback callback, const std::u16string& name) - : ToggleImageButton(callback), name_(name) { + : ToggleImageButton(std::move(callback)), name_(name) { SetPreferredSize(gfx::Size(kProjectorButtonSize, kProjectorButtonSize)); SetBorder(views::CreateEmptyBorder(kButtonPadding));
diff --git a/ash/projector/ui/projector_color_button.cc b/ash/projector/ui/projector_color_button.cc index fed88bc..9d01f32d 100644 --- a/ash/projector/ui/projector_color_button.cc +++ b/ash/projector/ui/projector_color_button.cc
@@ -4,6 +4,8 @@ #include "ash/projector/ui/projector_color_button.h" +#include <utility> + #include "ash/resources/vector_icons/vector_icons.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/canvas.h" @@ -18,7 +20,7 @@ int size, float radius, const std::u16string& name) - : ProjectorButton(callback, name), color_(color), size_(size) {} + : ProjectorButton(std::move(callback), name), color_(color), size_(size) {} void ProjectorColorButton::PaintButtonContents(gfx::Canvas* canvas) { cc::PaintFlags flags;
diff --git a/ash/public/cpp/accelerators_util.cc b/ash/public/cpp/accelerators_util.cc index 87a2678..467fd08 100644 --- a/ash/public/cpp/accelerators_util.cc +++ b/ash/public/cpp/accelerators_util.cc
@@ -10,6 +10,7 @@ #include "ash/public/cpp/accelerator_keycode_lookup_cache.h" #include "base/logging.h" #include "base/no_destructor.h" +#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "ui/base/ime/ash/input_method_manager.h" #include "ui/base/ui_base_features.h" @@ -224,6 +225,9 @@ ui::KeycodeConverter::DomKeyToKeyString(domkey_it.dom_key)); } } + // Else, return "Unidentified {digit}" for Unidentified key. + return base::UTF8ToUTF16(base::StringPrintf( + "Unidentified %u", static_cast<unsigned int>(key_code))); } // Otherwise, get the key_display from a util function. return KeycodeToKeyString(key_code);
diff --git a/ash/public/cpp/accelerators_util_unittest.cc b/ash/public/cpp/accelerators_util_unittest.cc index 8b9a74a..da1a41c 100644 --- a/ash/public/cpp/accelerators_util_unittest.cc +++ b/ash/public/cpp/accelerators_util_unittest.cc
@@ -89,4 +89,13 @@ EXPECT_EQ(expected, found_key_string.value()); } +TEST_F(AcceleratorsUtilTest, UnIdentifiedKey) { + EXPECT_EQ(u"Unidentified 10", GetKeyDisplay(ui::KeyboardCode::VKEY_BACKTAB)); + EXPECT_EQ(u"Unidentified 231", GetKeyDisplay(ui::KeyboardCode::VKEY_PACKET)); + EXPECT_EQ(u"Unidentified 240", + GetKeyDisplay(ui::KeyboardCode::VKEY_OEM_ATTN)); + EXPECT_EQ(u"Unidentified 241", + GetKeyDisplay(ui::KeyboardCode::VKEY_OEM_FINISH)); +} + } // namespace ash
diff --git a/ash/public/cpp/in_session_auth_dialog_controller.h b/ash/public/cpp/in_session_auth_dialog_controller.h index 2ede268..3cba7a9 100644 --- a/ash/public/cpp/in_session_auth_dialog_controller.h +++ b/ash/public/cpp/in_session_auth_dialog_controller.h
@@ -19,8 +19,8 @@ public: enum Reason { kAccessPasswordManager, - kModifyAuthFactors, - kModifyAuthFactorsMultidevice + kAccessAuthenticationSettings, + kAccessMultideviceSettings, }; // Returns the singleton instance.
diff --git a/ash/public/cpp/test/app_list_test_api.h b/ash/public/cpp/test/app_list_test_api.h index c971d0e..ca03b88 100644 --- a/ash/public/cpp/test/app_list_test_api.h +++ b/ash/public/cpp/test/app_list_test_api.h
@@ -152,10 +152,6 @@ // Enables/Disables the app list nudge for testing. void DisableAppListNudge(bool disable); - // Enables/Disables the search notifier which shows the privacy notice in - // launcher search for testing. - void DisableSearchNotifier(bool disable); - // Marks continue section privacy notice as accepted. void SetContinueSectionPrivacyNoticeAccepted();
diff --git a/ash/rounded_display/rounded_display_frame_factory.cc b/ash/rounded_display/rounded_display_frame_factory.cc index 880853e..31bb6246 100644 --- a/ash/rounded_display/rounded_display_frame_factory.cc +++ b/ash/rounded_display/rounded_display_frame_factory.cc
@@ -307,7 +307,7 @@ const RoundedDisplayGutter& gutter, RoundedDisplayUiResource* resource) const { gfx::GpuMemoryBuffer* buffer = resource->gpu_memory_buffer.get(); - std::unique_ptr<gpu::SharedImageInterface::ScopedMapping> mapping; + std::unique_ptr<gpu::ClientSharedImage::ScopedMapping> mapping; gfx::Canvas canvas(gutter.bounds().size(), 1.0, true); gutter.Paint(&canvas);
diff --git a/ash/style/checkbox.cc b/ash/style/checkbox.cc index c4aee1ff..c33a2ee 100644 --- a/ash/style/checkbox.cc +++ b/ash/style/checkbox.cc
@@ -4,6 +4,8 @@ #include "ash/style/checkbox.h" +#include <utility> + #include "ash/resources/vector_icons/vector_icons.h" #include "ui/accessibility/ax_enums.mojom-shared.h" #include "ui/accessibility/ax_node_data.h" @@ -23,7 +25,7 @@ const gfx::Insets& insets, int image_label_spacing) : OptionButtonBase(button_width, - callback, + std::move(callback), label, insets, image_label_spacing) {} @@ -50,4 +52,4 @@ BEGIN_METADATA(Checkbox, OptionButtonBase) END_METADATA -} // namespace ash \ No newline at end of file +} // namespace ash
diff --git a/ash/style/checkbox_group.cc b/ash/style/checkbox_group.cc index 9d907d3..d816caac 100644 --- a/ash/style/checkbox_group.cc +++ b/ash/style/checkbox_group.cc
@@ -4,6 +4,8 @@ #include "ash/style/checkbox_group.h" +#include <utility> + #include "ui/base/metadata/metadata_impl_macros.h" namespace ash { @@ -29,7 +31,7 @@ Checkbox* CheckboxGroup::AddButton(Checkbox::PressedCallback callback, const std::u16string& label) { auto* button = AddChildView(std::make_unique<Checkbox>( - group_width_ - inside_border_insets_.width(), callback, label, + group_width_ - inside_border_insets_.width(), std::move(callback), label, button_padding_, image_label_spacing_)); button->set_delegate(this); buttons_.push_back(button); @@ -43,4 +45,4 @@ BEGIN_METADATA(CheckboxGroup, OptionButtonGroup) END_METADATA -} // namespace ash \ No newline at end of file +} // namespace ash
diff --git a/ash/style/combobox.cc b/ash/style/combobox.cc index c22c60b..b5032cd 100644 --- a/ash/style/combobox.cc +++ b/ash/style/combobox.cc
@@ -5,6 +5,7 @@ #include "ash/style/combobox.h" #include <memory> +#include <utility> #include "ash/public/cpp/shell_window_ids.h" #include "ash/public/cpp/style/color_provider.h" @@ -85,7 +86,7 @@ PressedCallback callback, const std::u16string& label) : RadioButton(button_width, - callback, + std::move(callback), label, RadioButton::IconDirection::kLeading, RadioButton::IconType::kCheck, @@ -135,7 +136,8 @@ RadioButton* AddButton(RadioButton::PressedCallback callback, const std::u16string& label) override { auto* button = AddChildView(std::make_unique<ComboboxMenuOption>( - group_width_ - inside_border_insets_.width(), callback, label)); + group_width_ - inside_border_insets_.width(), std::move(callback), + label)); button->set_delegate(this); buttons_.push_back(button); return button;
diff --git a/ash/style/drop_down_checkbox.cc b/ash/style/drop_down_checkbox.cc index bbf4cc6..25ffd633 100644 --- a/ash/style/drop_down_checkbox.cc +++ b/ash/style/drop_down_checkbox.cc
@@ -6,6 +6,7 @@ #include <memory> #include <string> +#include <utility> #include "ash/public/cpp/shell_window_ids.h" #include "ash/resources/vector_icons/vector_icons.h" @@ -86,8 +87,8 @@ Checkbox* AddButton(Checkbox::PressedCallback callback, const std::u16string& label) override { auto* button = AddChildView(std::make_unique<Checkbox>( - group_width_ - inside_border_insets_.width(), callback, label, - kMenuItemInnerPadding, kCheckmarkLabelSpacing)); + group_width_ - inside_border_insets_.width(), std::move(callback), + label, kMenuItemInnerPadding, kCheckmarkLabelSpacing)); button->set_delegate(this); buttons_.push_back(button); return button;
diff --git a/ash/style/pagination_view.cc b/ash/style/pagination_view.cc index cc50ca2..69a98c4 100644 --- a/ash/style/pagination_view.cc +++ b/ash/style/pagination_view.cc
@@ -5,6 +5,7 @@ #include "ash/style/pagination_view.h" #include <optional> +#include <utility> #include "ash/public/cpp/pagination/pagination_model.h" #include "ash/resources/vector_icons/vector_icons.h" @@ -75,7 +76,7 @@ IndicatorButton(PressedCallback callback, const std::u16string& accessible_name) - : views::Button(callback) { + : views::Button(std::move(callback)) { SetFocusBehavior(views::View::FocusBehavior::ACCESSIBLE_ONLY); SetAccessibleName(accessible_name); }
diff --git a/ash/style/radio_button_group.cc b/ash/style/radio_button_group.cc index d0f2d4a..429833b0 100644 --- a/ash/style/radio_button_group.cc +++ b/ash/style/radio_button_group.cc
@@ -4,6 +4,8 @@ #include "ash/style/radio_button_group.h" +#include <utility> + #include "ash/style/radio_button.h" #include "ui/base/metadata/metadata_impl_macros.h" @@ -40,7 +42,7 @@ RadioButton* RadioButtonGroup::AddButton(RadioButton::PressedCallback callback, const std::u16string& label) { auto* button = AddChildView(std::make_unique<RadioButton>( - group_width_ - inside_border_insets_.width(), callback, label, + group_width_ - inside_border_insets_.width(), std::move(callback), label, icon_direction_, icon_type_, button_padding_, image_label_spacing_)); button->set_delegate(this); buttons_.push_back(button);
diff --git a/ash/style/style_viewer/system_ui_components_style_viewer_view.cc b/ash/style/style_viewer/system_ui_components_style_viewer_view.cc index 863a917..a5a75f6 100644 --- a/ash/style/style_viewer/system_ui_components_style_viewer_view.cc +++ b/ash/style/style_viewer/system_ui_components_style_viewer_view.cc
@@ -6,6 +6,7 @@ #include <memory> #include <string> +#include <utility> #include "ash/shell.h" #include "ash/style/style_viewer/system_ui_components_grid_view.h" @@ -66,7 +67,7 @@ public: ComponentButton(views::LabelButton::PressedCallback pressed_callback, const std::u16string& name) - : views::LabelButton(pressed_callback, name) { + : views::LabelButton(std::move(pressed_callback), name) { SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_CENTER); SetBorder(std::make_unique<views::HighlightBorder>( 0, chromeos::features::IsJellyrollEnabled()
diff --git a/ash/style/switch.cc b/ash/style/switch.cc index 182b520..17eee2ed 100644 --- a/ash/style/switch.cc +++ b/ash/style/switch.cc
@@ -4,6 +4,8 @@ #include "ash/style/switch.h" +#include <utility> + #include "ash/style/switch.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/gfx/geometry/insets.h" @@ -29,7 +31,7 @@ // Switch: Switch::Switch(PressedCallback callback) - : views::ToggleButton(callback, /*has_thumb_shadow=*/false) { + : views::ToggleButton(std::move(callback), /*has_thumb_shadow=*/false) { SetBorder(views::CreateEmptyBorder(gfx::Insets(kSwitchInnerPadding))); auto* focus_ring = views::FocusRing::Get(this); focus_ring->SetOutsetFocusRingDisabled(true);
diff --git a/ash/style/tab_slider.h b/ash/style/tab_slider.h index 6e57655..b01de08 100644 --- a/ash/style/tab_slider.h +++ b/ash/style/tab_slider.h
@@ -6,6 +6,7 @@ #define ASH_STYLE_TAB_SLIDER_H_ #include <cstddef> +#include <utility> #include "ash/ash_export.h" #include "base/memory/raw_ptr.h" @@ -66,8 +67,8 @@ // Add a button with the button's ctor arguments. For example // AddButton<SliderButtonType>(arg1, arg2, ...). template <typename T, typename... Args> - T* AddButton(Args... args) { - auto button = std::make_unique<T>(args...); + T* AddButton(Args&&... args) { + auto button = std::make_unique<T>(std::forward<Args>(args)...); return AddButton(std::move(button)); }
diff --git a/ash/system/accessibility/floating_menu_button.cc b/ash/system/accessibility/floating_menu_button.cc index 050626c6..4eb5590 100644 --- a/ash/system/accessibility/floating_menu_button.cc +++ b/ash/system/accessibility/floating_menu_button.cc
@@ -4,6 +4,8 @@ #include "ash/system/accessibility/floating_menu_button.h" +#include <utility> + #include "ash/style/ash_color_id.h" #include "ash/style/color_util.h" #include "ash/style/style_util.h" @@ -38,7 +40,7 @@ const gfx::VectorIcon& icon, int accessible_name_id, bool flip_for_rtl) - : FloatingMenuButton(callback, + : FloatingMenuButton(std::move(callback), icon, accessible_name_id, flip_for_rtl, @@ -53,7 +55,7 @@ int size, bool draw_highlight, bool is_a11y_togglable) - : views::ImageButton(callback), + : views::ImageButton(std::move(callback)), icon_(&icon), size_(size), draw_highlight_(draw_highlight),
diff --git a/ash/system/brightness/unified_brightness_slider_controller.cc b/ash/system/brightness/unified_brightness_slider_controller.cc index 2a419850..ef54f64e 100644 --- a/ash/system/brightness/unified_brightness_slider_controller.cc +++ b/ash/system/brightness/unified_brightness_slider_controller.cc
@@ -5,6 +5,7 @@ #include "ash/system/brightness/unified_brightness_slider_controller.h" #include <memory> +#include <utility> #include "ash/constants/quick_settings_catalogs.h" #include "ash/shell.h" @@ -28,7 +29,7 @@ UnifiedBrightnessSliderController::UnifiedBrightnessSliderController( scoped_refptr<UnifiedSystemTrayModel> model, views::Button::PressedCallback callback) - : model_(model), callback_(callback) {} + : model_(model), callback_(std::move(callback)) {} UnifiedBrightnessSliderController::~UnifiedBrightnessSliderController() = default;
diff --git a/ash/system/focus_mode/focus_mode_detailed_view.cc b/ash/system/focus_mode/focus_mode_detailed_view.cc index 50856f31..29a0e6a 100644 --- a/ash/system/focus_mode/focus_mode_detailed_view.cc +++ b/ash/system/focus_mode/focus_mode_detailed_view.cc
@@ -5,6 +5,7 @@ #include "ash/system/focus_mode/focus_mode_detailed_view.h" #include <memory> +#include <utility> #include "ash/accessibility/accessibility_controller_impl.h" #include "ash/resources/vector_icons/vector_icons.h" @@ -97,7 +98,8 @@ ui::ColorId background_color, int accessible_name_id) { std::unique_ptr<IconButton> timer_adjustment_button = - std::make_unique<IconButton>(callback, IconButton::Type::kLarge, &icon, + std::make_unique<IconButton>(std::move(callback), + IconButton::Type::kLarge, &icon, accessible_name_id); timer_adjustment_button->SetImageHorizontalAlignment( views::ImageButton::HorizontalAlignment::ALIGN_CENTER); @@ -378,8 +380,8 @@ toggle_view_->AddRightView( std::make_unique<PillButton>( - base::BindRepeating(&FocusModeDetailedView::ToggleButtonPressed, - base::Unretained(this)), + base::BindRepeating(&FocusModeController::ToggleFocusMode, + base::Unretained(FocusModeController::Get())), l10n_util::GetStringUTF16( in_focus_session ? IDS_ASH_STATUS_TRAY_FOCUS_MODE_TOGGLE_END_BUTTON @@ -676,20 +678,9 @@ decrement)); } -void FocusModeDetailedView::ToggleButtonPressed() { - auto* controller = FocusModeController::Get(); - // TODO(b/308019963): we don't need to manually set the session duration once - // SystemTextfield is fixed, since it will be set when it is blurred. - controller->SetSessionDuration(base::Minutes( - focus_mode_util::GetTimerTextfieldInputInMinutes(timer_textfield_))); - controller->ToggleFocusMode(); -} - void FocusModeDetailedView::UpdateTimerSettingViewUI() { - FocusModeController* focus_mode_controller = FocusModeController::Get(); - CHECK(!focus_mode_controller->in_focus_session()); const base::TimeDelta session_duration = - focus_mode_controller->session_duration(); + FocusModeController::Get()->session_duration(); end_time_label_->SetText(focus_mode_util::GetFormattedEndTimeString( session_duration + base::Time::Now())); std::u16string new_session_duration_string = @@ -706,12 +697,8 @@ void FocusModeDetailedView::SetInactiveSessionDuration( base::TimeDelta duration) { - // TODO(b/308019963): remove this check once SystemTextfield is fixed. - if (auto* controller = FocusModeController::Get(); - !controller->in_focus_session()) { - controller->SetSessionDuration(duration); - UpdateTimerSettingViewUI(); - } + FocusModeController::Get()->SetSessionDuration(duration); + UpdateTimerSettingViewUI(); } void FocusModeDetailedView::UpdateEndTimeLabelUI() {
diff --git a/ash/system/focus_mode/focus_mode_detailed_view.h b/ash/system/focus_mode/focus_mode_detailed_view.h index 45b5b068..a9c237f 100644 --- a/ash/system/focus_mode/focus_mode_detailed_view.h +++ b/ash/system/focus_mode/focus_mode_detailed_view.h
@@ -99,9 +99,6 @@ // This is only used outside of a focus session. void AdjustInactiveSessionDuration(bool decrement); - // Called whenever the Start/End button in the toggle row is pressed. - void ToggleButtonPressed(); - // Called whenever the session duration is adjusted. Updates the labels and // button visibilities in the timer setting view. void UpdateTimerSettingViewUI();
diff --git a/ash/system/message_center/ash_notification_view.cc b/ash/system/message_center/ash_notification_view.cc index e43a58a..c8cbd3b 100644 --- a/ash/system/message_center/ash_notification_view.cc +++ b/ash/system/message_center/ash_notification_view.cc
@@ -711,6 +711,179 @@ main_view_->SetVisible(expanded); } +void AshNotificationView::AnimateGroupedChildExpandedCollapse(bool expanded) { + message_center_utils::InitLayerForAnimations(collapsed_summary_view_); + message_center_utils::InitLayerForAnimations(main_view_); + // Fade out `collapsed_summary_view_`, then fade in `main_view_` in expanded + // state and vice versa in collapsed state. + if (expanded) { + message_center_utils::FadeOutView( + collapsed_summary_view_, + base::BindRepeating( + [](base::WeakPtr<ash::AshNotificationView> parent, + views::View* collapsed_summary_view) { + if (parent) { + collapsed_summary_view->layer()->SetOpacity(1.0f); + collapsed_summary_view->SetVisible(false); + } + }, + weak_factory_.GetWeakPtr(), collapsed_summary_view_), + 0, kCollapsedSummaryViewAnimationDurationMs, gfx::Tween::LINEAR, + "Ash.NotificationView.CollapsedSummaryView.FadeOut." + "AnimationSmoothness"); + message_center_utils::FadeInView( + main_view_, kCollapsedSummaryViewAnimationDurationMs, + kChildMainViewFadeInAnimationDurationMs, gfx::Tween::LINEAR, + "Ash.NotificationView.MainView.FadeIn.AnimationSmoothness"); + return; + } + + message_center_utils::FadeOutView( + main_view_, + base::BindRepeating( + [](base::WeakPtr<ash::AshNotificationView> parent, + views::View* main_view) { + if (parent) { + main_view->layer()->SetOpacity(1.0f); + main_view->SetVisible(false); + } + }, + weak_factory_.GetWeakPtr(), main_view_), + 0, kChildMainViewFadeOutAnimationDurationMs, gfx::Tween::LINEAR, + "Ash.NotificationView.MainView.FadeOut.AnimationSmoothness"); + message_center_utils::FadeInView( + collapsed_summary_view_, kChildMainViewFadeOutAnimationDurationMs, + kCollapsedSummaryViewAnimationDurationMs, gfx::Tween::LINEAR, + "Ash.NotificationView.CollapsedSummaryView.FadeIn.AnimationSmoothness"); +} + +void AshNotificationView::AnimateSingleToGroup( + NotificationGroupingController* grouping_controller, + const std::string& notification_id, + std::string parent_id) { + ash::message_center_utils::InitLayerForAnimations(left_content()); + ash::message_center_utils::InitLayerForAnimations(right_content()); + ash::message_center_utils::InitLayerForAnimations( + message_label_in_expanded_state_); + ash::message_center_utils::InitLayerForAnimations(image_container_view()); + ash::message_center_utils::InitLayerForAnimations(action_buttons_row()); + + auto on_animation_ended = base::BindOnce( + [](base::WeakPtr<ash::AshNotificationView> parent, + views::View* left_content, views::View* right_content, + views::View* message_label_in_expanded_state, + views::View* image_container_view, views::View* action_buttons_row, + AshNotificationExpandButton* expand_button, + NotificationGroupingController* grouping_controller, + const std::string& notification_id, std::string parent_id) { + if (!parent) { + return; + } + + auto* parent_notification = + message_center::MessageCenter::Get()->FindNotificationById( + parent_id); + auto* child_notification = + message_center::MessageCenter::Get()->FindNotificationById( + notification_id); + // The child and parent notifications are not guaranteed to exist. If + // they were deleted avoid the animation cleanup. + if (!parent_notification || !child_notification) { + return; + } + + grouping_controller->ConvertFromSingleToGroupNotificationAfterAnimation( + notification_id, parent_id, parent_notification); + + left_content->layer()->SetOpacity(1.0f); + right_content->layer()->SetOpacity(1.0f); + message_label_in_expanded_state->layer()->SetOpacity(1.0f); + image_container_view->layer()->SetOpacity(1.0f); + action_buttons_row->layer()->SetOpacity(1.0f); + + // After fade out single notification and set up a group one, perform + // a fade in. + parent->AnimateSingleToGroupFadeIn(); + + expand_button->set_previous_bounds(expand_button->GetContentsBounds()); + parent->Layout(); + expand_button->AnimateSingleToGroupNotification(); + }, + weak_factory_.GetWeakPtr(), left_content_, right_content(), + message_label_in_expanded_state_, image_container_view(), + action_buttons_row(), expand_button_, grouping_controller, + notification_id, parent_id); + + std::pair<base::OnceClosure, base::OnceClosure> split = + base::SplitOnceCallback(std::move(on_animation_ended)); + + ui::AnimationThroughputReporter reporter( + left_content()->layer()->GetAnimator(), + metrics_util::ForSmoothness(base::BindRepeating([](int smoothness) { + base::UmaHistogramPercentage( + "Ash.NotificationView.ConvertSingleToGroup.FadeOut." + "AnimationSmoothness", + smoothness); + }))); + + views::AnimationBuilder() + .SetPreemptionStrategy( + ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET) + .OnEnded(std::move(split.first)) + .OnAborted(std::move(split.second)) + .Once() + .SetDuration( + base::Milliseconds(kConvertFromSingleToGroupFadeOutDurationMs)) + .SetOpacity(left_content(), 0.0f, gfx::Tween::LINEAR) + .SetOpacity(right_content(), 0.0f, gfx::Tween::LINEAR) + .SetOpacity(message_label_in_expanded_state_, 0.0f, gfx::Tween::LINEAR) + .SetOpacity(image_container_view(), 0.0f, gfx::Tween::LINEAR) + .SetOpacity(action_buttons_row(), 0.0f, gfx::Tween::LINEAR); +} + +void AshNotificationView::ToggleExpand() { + const bool target_expanded_state = !IsExpanded(); + + SetManuallyExpandedOrCollapsed( + target_expanded_state ? message_center::ExpandState::USER_EXPANDED + : message_center::ExpandState::USER_COLLAPSED); + + if (inline_reply() && inline_reply()->GetVisible()) { + message_center_utils::FadeOutView( + inline_reply(), + base::BindOnce( + [](base::WeakPtr<ash::AshNotificationView> parent, + views::View* inline_reply) { + if (parent) { + inline_reply->layer()->SetOpacity(1.0f); + } + }, + weak_factory_.GetWeakPtr(), inline_reply()), + /*delay_in_ms=*/0, kInlineReplyFadeOutAnimationDurationMs, + gfx::Tween::LINEAR, + "Ash.NotificationView.InlineReply.FadeOut.AnimationSmoothness"); + } + + SetExpanded(target_expanded_state); + + PerformExpandCollapseAnimation(); + + // Log expand button click action. + if (IsExpanded()) { + is_grouped_parent_view_ + ? metrics_utils::LogExpandButtonClickAction( + metrics_utils::ExpandButtonClickAction::EXPAND_GROUP) + : metrics_utils::LogExpandButtonClickAction( + metrics_utils::ExpandButtonClickAction::EXPAND_INDIVIDUAL); + } else { + is_grouped_parent_view_ + ? metrics_utils::LogExpandButtonClickAction( + metrics_utils::ExpandButtonClickAction::COLLAPSE_GROUP) + : metrics_utils::LogExpandButtonClickAction( + metrics_utils::ExpandButtonClickAction::COLLAPSE_INDIVIDUAL); + } +} + void AshNotificationView::GroupedNotificationsPreferredSizeChanged() { PreferredSizeChanged(); } @@ -808,178 +981,6 @@ return base::Milliseconds(kGeneralCollapseAnimationDuration); } -void AshNotificationView::AnimateGroupedChildExpandedCollapse(bool expanded) { - message_center_utils::InitLayerForAnimations(collapsed_summary_view_); - message_center_utils::InitLayerForAnimations(main_view_); - // Fade out `collapsed_summary_view_`, then fade in `main_view_` in expanded - // state and vice versa in collapsed state. - if (expanded) { - message_center_utils::FadeOutView( - collapsed_summary_view_, - base::BindRepeating( - [](base::WeakPtr<ash::AshNotificationView> parent, - views::View* collapsed_summary_view) { - if (parent) { - collapsed_summary_view->layer()->SetOpacity(1.0f); - collapsed_summary_view->SetVisible(false); - } - }, - weak_factory_.GetWeakPtr(), collapsed_summary_view_), - 0, kCollapsedSummaryViewAnimationDurationMs, gfx::Tween::LINEAR, - "Ash.NotificationView.CollapsedSummaryView.FadeOut." - "AnimationSmoothness"); - message_center_utils::FadeInView( - main_view_, kCollapsedSummaryViewAnimationDurationMs, - kChildMainViewFadeInAnimationDurationMs, gfx::Tween::LINEAR, - "Ash.NotificationView.MainView.FadeIn.AnimationSmoothness"); - return; - } - - message_center_utils::FadeOutView( - main_view_, - base::BindRepeating( - [](base::WeakPtr<ash::AshNotificationView> parent, - views::View* main_view) { - if (parent) { - main_view->layer()->SetOpacity(1.0f); - main_view->SetVisible(false); - } - }, - weak_factory_.GetWeakPtr(), main_view_), - 0, kChildMainViewFadeOutAnimationDurationMs, gfx::Tween::LINEAR, - "Ash.NotificationView.MainView.FadeOut.AnimationSmoothness"); - message_center_utils::FadeInView( - collapsed_summary_view_, kChildMainViewFadeOutAnimationDurationMs, - kCollapsedSummaryViewAnimationDurationMs, gfx::Tween::LINEAR, - "Ash.NotificationView.CollapsedSummaryView.FadeIn.AnimationSmoothness"); -} - -void AshNotificationView::AnimateSingleToGroup( - const std::string& notification_id, - std::string parent_id) { - ash::message_center_utils::InitLayerForAnimations(left_content()); - ash::message_center_utils::InitLayerForAnimations(right_content()); - ash::message_center_utils::InitLayerForAnimations( - message_label_in_expanded_state_); - ash::message_center_utils::InitLayerForAnimations(image_container_view()); - ash::message_center_utils::InitLayerForAnimations(action_buttons_row()); - - auto on_animation_ended = base::BindOnce( - [](base::WeakPtr<ash::AshNotificationView> parent, - views::View* left_content, views::View* right_content, - views::View* message_label_in_expanded_state, - views::View* image_container_view, views::View* action_buttons_row, - AshNotificationExpandButton* expand_button, - const std::string& notification_id, std::string parent_id) { - if (!parent) { - return; - } - - auto* parent_notification = - message_center::MessageCenter::Get()->FindNotificationById( - parent_id); - auto* child_notification = - message_center::MessageCenter::Get()->FindNotificationById( - notification_id); - // The child and parent notifications are not guaranteed to exist. If - // they were deleted avoid the animation cleanup. - if (!parent_notification || !child_notification) { - return; - } - - message_center_utils::GetGroupingControllerForNotificationView( - parent.get()) - ->ConvertFromSingleToGroupNotificationAfterAnimation( - notification_id, parent_id, parent_notification); - - left_content->layer()->SetOpacity(1.0f); - right_content->layer()->SetOpacity(1.0f); - message_label_in_expanded_state->layer()->SetOpacity(1.0f); - image_container_view->layer()->SetOpacity(1.0f); - action_buttons_row->layer()->SetOpacity(1.0f); - - // After fade out single notification and set up a group one, perform - // a fade in. - parent->AnimateSingleToGroupFadeIn(); - - expand_button->set_previous_bounds(expand_button->GetContentsBounds()); - parent->Layout(); - expand_button->AnimateSingleToGroupNotification(); - }, - weak_factory_.GetWeakPtr(), left_content_, right_content(), - message_label_in_expanded_state_, image_container_view(), - action_buttons_row(), expand_button_, notification_id, parent_id); - - std::pair<base::OnceClosure, base::OnceClosure> split = - base::SplitOnceCallback(std::move(on_animation_ended)); - - ui::AnimationThroughputReporter reporter( - left_content()->layer()->GetAnimator(), - metrics_util::ForSmoothness(base::BindRepeating([](int smoothness) { - base::UmaHistogramPercentage( - "Ash.NotificationView.ConvertSingleToGroup.FadeOut." - "AnimationSmoothness", - smoothness); - }))); - - views::AnimationBuilder() - .SetPreemptionStrategy( - ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET) - .OnEnded(std::move(split.first)) - .OnAborted(std::move(split.second)) - .Once() - .SetDuration( - base::Milliseconds(kConvertFromSingleToGroupFadeOutDurationMs)) - .SetOpacity(left_content(), 0.0f, gfx::Tween::LINEAR) - .SetOpacity(right_content(), 0.0f, gfx::Tween::LINEAR) - .SetOpacity(message_label_in_expanded_state_, 0.0f, gfx::Tween::LINEAR) - .SetOpacity(image_container_view(), 0.0f, gfx::Tween::LINEAR) - .SetOpacity(action_buttons_row(), 0.0f, gfx::Tween::LINEAR); -} - -void AshNotificationView::ToggleExpand() { - const bool target_expanded_state = !IsExpanded(); - - SetManuallyExpandedOrCollapsed( - target_expanded_state ? message_center::ExpandState::USER_EXPANDED - : message_center::ExpandState::USER_COLLAPSED); - - if (inline_reply() && inline_reply()->GetVisible()) { - message_center_utils::FadeOutView( - inline_reply(), - base::BindOnce( - [](base::WeakPtr<ash::AshNotificationView> parent, - views::View* inline_reply) { - if (parent) { - inline_reply->layer()->SetOpacity(1.0f); - } - }, - weak_factory_.GetWeakPtr(), inline_reply()), - /*delay_in_ms=*/0, kInlineReplyFadeOutAnimationDurationMs, - gfx::Tween::LINEAR, - "Ash.NotificationView.InlineReply.FadeOut.AnimationSmoothness"); - } - - SetExpanded(target_expanded_state); - - PerformExpandCollapseAnimation(); - - // Log expand button click action. - if (IsExpanded()) { - is_grouped_parent_view_ - ? metrics_utils::LogExpandButtonClickAction( - metrics_utils::ExpandButtonClickAction::EXPAND_GROUP) - : metrics_utils::LogExpandButtonClickAction( - metrics_utils::ExpandButtonClickAction::EXPAND_INDIVIDUAL); - } else { - is_grouped_parent_view_ - ? metrics_utils::LogExpandButtonClickAction( - metrics_utils::ExpandButtonClickAction::COLLAPSE_GROUP) - : metrics_utils::LogExpandButtonClickAction( - metrics_utils::ExpandButtonClickAction::COLLAPSE_INDIVIDUAL); - } -} - void AshNotificationView::AddGroupNotification( const message_center::Notification& notification) { DCHECK(is_grouped_parent_view_); @@ -1019,10 +1020,15 @@ for (auto* notification : notifications) { auto notification_view = MessageViewFactory::Create(*notification, /*shown_in_popup=*/false); - - auto* child_notification_view = - static_cast<message_center::MessageView*>(notification_view.get()); - child_notification_view->SetGroupedChildExpanded(IsExpanded()); + // The child can either be an AshNotificationView or an ARC custom + // notification view. + // TODO(b/308814203): clean the static_cast checks by replacing + // `AshNotificationView*` with a base class. + if (message_center_utils::IsAshNotification(notification)) { + auto* ash_notification_view = + static_cast<AshNotificationView*>(notification_view.get()); + ash_notification_view->SetGroupedChildExpanded(IsExpanded()); + } if (!total_grouped_notifications_) { header_row()->SetTimestamp(notification->timestamp()); @@ -1207,10 +1213,13 @@ int notification_count = 0; for (auto* child : grouped_notifications_container_->children()) { - auto* notification_view = - static_cast<message_center::MessageView*>(child); - notification_view->AnimateGroupedChildExpandedCollapse(expanded); - notification_view->SetGroupedChildExpanded(expanded); + // TODO(b/308814203): clean the static_cast checks by replacing + // `AshNotificationView*` with a base class. + if (message_center_utils::IsAshNotificationView(child)) { + auto* notification_view = static_cast<AshNotificationView*>(child); + notification_view->AnimateGroupedChildExpandedCollapse(expanded); + notification_view->SetGroupedChildExpanded(expanded); + } notification_count++; if (notification_count >
diff --git a/ash/system/message_center/ash_notification_view.h b/ash/system/message_center/ash_notification_view.h index 670e41cf..80f56e9 100644 --- a/ash/system/message_center/ash_notification_view.h +++ b/ash/system/message_center/ash_notification_view.h
@@ -36,6 +36,7 @@ class RoundedImageView; class AshNotificationExpandButton; class IconButton; +class NotificationGroupingController; // Customized NotificationView for notification on ChromeOS. This view is used // to displays all current types of notification on ChromeOS (web, basic, image, @@ -54,6 +55,18 @@ AshNotificationView& operator=(const AshNotificationView&) = delete; ~AshNotificationView() override; + // Update the expanded state for grouped child notification. + void SetGroupedChildExpanded(bool expanded); + + // Animate the grouped child notification when switching between expand and + // collapse state. + void AnimateGroupedChildExpandedCollapse(bool expanded); + + // Animations when converting from single to group notification. + void AnimateSingleToGroup(NotificationGroupingController* grouping_controller, + const std::string& notification_id, + std::string parent_id); + // Toggle the expand state of the notification. This function should only be // used to handle user manually expand/collapse a notification. void ToggleExpand(); @@ -80,16 +93,12 @@ bool IsDraggable() const; // message_center::MessageView: - void AnimateGroupedChildExpandedCollapse(bool expanded) override; - void AnimateSingleToGroup(const std::string& notification_id, - std::string parent_id) override; void AddGroupNotification( const message_center::Notification& notification) override; void PopulateGroupNotifications( const std::vector<const message_center::Notification*>& notifications) override; void RemoveGroupNotification(const std::string& notification_id) override; - void SetGroupedChildExpanded(bool expanded) override; // Called after `PreferredSizeChanged()`, so the current state is the target // state. base::TimeDelta GetBoundsAnimationDuration(
diff --git a/ash/system/message_center/message_center_utils.cc b/ash/system/message_center/message_center_utils.cc index ec397ef..cb1ecd2 100644 --- a/ash/system/message_center/message_center_utils.cc +++ b/ash/system/message_center/message_center_utils.cc
@@ -153,7 +153,6 @@ GetActiveNotificationViewControllerForDisplay(int64_t display_id) { RootWindowController* root_window_controller = Shell::GetRootWindowControllerWithDisplayId(display_id); - // Can be null in tests. if (!root_window_controller || !root_window_controller->GetStatusAreaWidget()) { return nullptr; @@ -175,25 +174,6 @@ return GetActiveNotificationViewControllerForDisplay(display_id); } -NotificationGroupingController* GetGroupingControllerForNotificationView( - views::View* notification_view) { - aura::Window* window = notification_view->GetWidget()->GetNativeWindow(); - auto display_id = - display::Screen::GetScreen()->GetDisplayNearestWindow(window).id(); - - RootWindowController* root_window_controller = - Shell::GetRootWindowControllerWithDisplayId(display_id); - // Can be null in tests. - if (!root_window_controller || - !root_window_controller->GetStatusAreaWidget()) { - return nullptr; - } - - return root_window_controller->GetStatusAreaWidget() - ->notification_center_tray() - ->notification_grouping_controller(); -} - void InitLayerForAnimations(views::View* view) { view->SetPaintToLayer(); view->layer()->SetFillsBoundsOpaquely(false);
diff --git a/ash/system/message_center/message_center_utils.h b/ash/system/message_center/message_center_utils.h index 861a211..b7b9168 100644 --- a/ash/system/message_center/message_center_utils.h +++ b/ash/system/message_center/message_center_utils.h
@@ -21,11 +21,7 @@ class View; } -namespace ash { - -class NotificationGroupingController; - -namespace message_center_utils { +namespace ash::message_center_utils { // Return a hash string derived from `notifier_id` data. This is appended to a // notification's `id` to create a unique identifier for a grouped notification. @@ -66,12 +62,6 @@ GetActiveNotificationViewControllerForNotificationView( views::View* notification_view); -// Gets the grouping controller for the provided notification view. Each display -// has it's own `NotificationGroupingController` so we need to look up the -// display for the provide view first. -NotificationGroupingController* GetGroupingControllerForNotificationView( - views::View* notification_view); - // Utils for animation within a notification view. // Initializes the layer for the specified `view` for animations. @@ -117,7 +107,6 @@ // checks for casting `AshNotificationView*`. bool IsAshNotification(const message_center::Notification* notification); -} // namespace message_center_utils -} // namespace ash +} // namespace ash::message_center_utils #endif // ASH_SYSTEM_MESSAGE_CENTER_MESSAGE_CENTER_UTILS_H_
diff --git a/ash/system/message_center/notification_grouping_controller.cc b/ash/system/message_center/notification_grouping_controller.cc index e5d0e71..c2874d7 100644 --- a/ash/system/message_center/notification_grouping_controller.cc +++ b/ash/system/message_center/notification_grouping_controller.cc
@@ -371,9 +371,12 @@ } std::string parent_id = parent_notification->id(); + // TODO(b/308814203): clean the static_cast checks by replacing + // AshNotificationView* with a base class. auto* parent_view = - (GetActiveNotificationViewController()) - ? static_cast<MessageView*>( + (GetActiveNotificationViewController() && + message_center_utils::IsAshNotification(parent_notification)) + ? static_cast<AshNotificationView*>( GetActiveNotificationViewController() ->GetMessageViewForNotificationId(parent_id)) : nullptr; @@ -390,7 +393,7 @@ // will be handled in // `ConvertFromSingleToGroupNotificationAfterAnimation()`, which is called // after the animation from the parent view is completed. - parent_view->AnimateSingleToGroup(notification_id, parent_id); + parent_view->AnimateSingleToGroup(this, notification_id, parent_id); return; }
diff --git a/ash/system/night_light/night_light_controller_impl.cc b/ash/system/night_light/night_light_controller_impl.cc index e731acd..2f2d271 100644 --- a/ash/system/night_light/night_light_controller_impl.cc +++ b/ash/system/night_light/night_light_controller_impl.cc
@@ -46,6 +46,7 @@ #include "ui/gfx/animation/animation_delegate.h" #include "ui/gfx/animation/linear_animation.h" #include "ui/gfx/geometry/vector3d_f.h" +#include "ui/gfx/skia_color_space_util.h" #include "ui/message_center/message_center.h" #include "ui/message_center/public/cpp/notification.h" @@ -168,16 +169,11 @@ // the matrix was successfully sent to the GPU. bool AttemptSettingHardwareCtm(int64_t display_id, const SkM44& gamma_compressed_matrix) { - for (const auto* snapshot : - Shell::Get()->display_configurator()->cached_displays()) { - if (snapshot->display_id() == display_id && - snapshot->has_color_correction_matrix()) { - return Shell::Get()->display_color_manager()->SetDisplayColorMatrix( - snapshot, gamma_compressed_matrix); - } - } - - return false; + display::ColorTemperatureAdjustment ctm; + ctm.srgb_matrix = gfx::SkcmsMatrix3x3FromSkM44(gamma_compressed_matrix); + return Shell::Get() + ->display_color_manager() + ->SetDisplayColorTemperatureAdjustment(display_id, ctm); } // Applies the given |temperature| to the display associated with the given
diff --git a/ash/system/notification_center/notification_list_view.cc b/ash/system/notification_center/notification_list_view.cc index e60fe44a..fae28c13f5 100644 --- a/ash/system/notification_center/notification_list_view.cc +++ b/ash/system/notification_center/notification_list_view.cc
@@ -697,17 +697,18 @@ } // Update the child notification view with the updated notification. + // TODO(b/308814203): clean the static_cast checks by replacing + // `AshNotificationView*` with a base class. auto* child_view = parent_view->FindGroupNotificationView(child_notification_id); - - if (!child_view) { - return; - } - auto* notification = MessageCenter::Get()->FindNotificationById(child_notification_id); - static_cast<MessageView*>(child_view)->UpdateWithNotification(*notification); - ResetBounds(); + + if (child_view && message_center_utils::IsAshNotification(notification)) { + auto* ash_child_view = static_cast<AshNotificationView*>(child_view); + ash_child_view->UpdateWithNotification(*notification); + ResetBounds(); + } } void NotificationListView::OnNotificationAdded(const std::string& id) {
diff --git a/ash/system/phonehub/phone_hub_recent_app_button.cc b/ash/system/phonehub/phone_hub_recent_app_button.cc index b6872f38..6e6ad99 100644 --- a/ash/system/phonehub/phone_hub_recent_app_button.cc +++ b/ash/system/phonehub/phone_hub_recent_app_button.cc
@@ -4,6 +4,8 @@ #include "ash/system/phonehub/phone_hub_recent_app_button.h" +#include <utility> + #include "ash/style/ash_color_provider.h" #include "ash/style/style_util.h" #include "ui/base/metadata/metadata_impl_macros.h" @@ -26,7 +28,7 @@ const gfx::Image& icon, const std::u16string& visible_app_name, PressedCallback callback) - : views::ImageButton(callback) { + : views::ImageButton(std::move(callback)) { SetImageModel( views::Button::STATE_NORMAL, ui::ImageModel::FromImageSkia(
diff --git a/ash/system/phonehub/phone_hub_recent_apps_view.cc b/ash/system/phonehub/phone_hub_recent_apps_view.cc index 8de69b7..3e33320 100644 --- a/ash/system/phonehub/phone_hub_recent_apps_view.cc +++ b/ash/system/phonehub/phone_hub_recent_apps_view.cc
@@ -6,6 +6,7 @@ #include <algorithm> #include <numeric> +#include <utility> #include "ash/constants/ash_features.h" #include "ash/resources/vector_icons/vector_icons.h" @@ -158,7 +159,7 @@ if (features::IsEcheNetworkConnectionStateEnabled()) { error_button_ = - AddChildView(std::make_unique<views::ImageButton>(callback)); + AddChildView(std::make_unique<views::ImageButton>(std::move(callback))); ui::ImageModel image = ui::ImageModel::FromVectorIcon( kPhoneHubEcheErrorStatusIcon, AshColorProvider::Get()->GetContentLayerColor(
diff --git a/ash/system/power/OWNERS b/ash/system/power/OWNERS new file mode 100644 index 0000000..bd39034 --- /dev/null +++ b/ash/system/power/OWNERS
@@ -0,0 +1 @@ +jiamingc@chromium.org \ No newline at end of file
diff --git a/ash/system/power/battery_notification.cc b/ash/system/power/battery_notification.cc index 04286c9..0dd76b99 100644 --- a/ash/system/power/battery_notification.cc +++ b/ash/system/power/battery_notification.cc
@@ -81,7 +81,7 @@ notification_state == PowerNotificationController::NOTIFICATION_CRITICAL; const bool enabling_at_threshold_notification = - features::IsBatterySaverAvailable() && + IsBatterySaverAllowed() && notification_state == PowerNotificationController::NOTIFICATION_BSM_ENABLING_AT_THRESHOLD; @@ -118,8 +118,7 @@ // Send notification immediately with only battery percentage, but update // string to battery percentage + time remaining when available. - if (features::IsBatterySaverAvailable() && - enabling_at_threshold_notification) { + if (IsBatterySaverAllowed() && enabling_at_threshold_notification) { return should_display_time ? l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_LOW_BATTERY_BSM_AUTOENABLED_MESSAGE, @@ -129,7 +128,7 @@ base::NumberToString16(battery_percentage)); } - if (features::IsBatterySaverAvailable() && + if (IsBatterySaverAllowed() && (opt_in_at_threshold_notification || generic_low_power_notification || critical_notification)) { return should_display_time @@ -160,7 +159,7 @@ // There are no buttons to add if either battery saver mode isn't available, // or if it is available, but there are no notifications showing, or if our // battery is a generic low power or critical notification. - if (!features::IsBatterySaverAvailable() || no_notification || + if (!IsBatterySaverAllowed() || no_notification || generic_low_power_notification || critical_battery_notification) { return std::nullopt; } @@ -259,7 +258,7 @@ IDS_ASH_STATUS_TRAY_BATTERY_CHARGING_UNRELIABLE); } else if (time && (power_utils::ShouldDisplayBatteryTime(*time) || - features::IsBatterySaverAvailable()) && + IsBatterySaverAllowed()) && !status.IsBatteryDischargingOnLinePower()) { std::u16string duration = ui::TimeFormat::Simple( ui::TimeFormat::FORMAT_DURATION, ui::TimeFormat::LENGTH_LONG, *time);
diff --git a/ash/system/power/battery_notification_unittest.cc b/ash/system/power/battery_notification_unittest.cc index 74f78fa0..19bda76 100644 --- a/ash/system/power/battery_notification_unittest.cc +++ b/ash/system/power/battery_notification_unittest.cc
@@ -63,6 +63,7 @@ } void TearDown() override { + OverrideIsBatterySaverAllowedForTesting(absl::nullopt); battery_notification_.reset(); AshTestBase::TearDown(); chromeos::PowerManagerClient::Shutdown(); @@ -159,16 +160,6 @@ buttons.size() != 0 ? buttons[0].title : u""); } - void SetBatterySaverFeature(bool enabled) { - scoped_feature_list_.reset(); - if (enabled) { - scoped_feature_list_ = std::make_unique<base::test::ScopedFeatureList>( - features::kBatterySaver); - } else { - scoped_feature_list_ = std::make_unique<base::test::ScopedFeatureList>(); - } - } - void SetNotificationStateForTesting( PowerNotificationController::NotificationState new_state) { Shell::Get() @@ -250,7 +241,7 @@ // Keep test for backwards compatibility for time-based notifications. TEST_F(BatteryNotificationTest, LowPowerNotification) { // Disable Battery Saver feature to test original notification. - SetBatterySaverFeature(false); + OverrideIsBatterySaverAllowedForTesting(false); // Set the rounded value matches the low power threshold, percentage here is // arbitrary.
diff --git a/ash/system/power/battery_saver_controller.cc b/ash/system/power/battery_saver_controller.cc index ec229d79..943a37ee 100644 --- a/ash/system/power/battery_saver_controller.cc +++ b/ash/system/power/battery_saver_controller.cc
@@ -12,6 +12,7 @@ #include "ash/strings/grit/ash_strings.h" #include "ash/system/power/power_notification_controller.h" #include "ash/system/system_notification_controller.h" +#include "base/check_is_test.h" #include "base/logging.h" #include "base/metrics/histogram_functions.h" #include "base/notreached.h" @@ -38,10 +39,29 @@ } } +// Overrides the result of IsBatterySaverAllowed for testing. +absl::optional<bool> override_allowed_for_testing; + } // namespace namespace ash { +bool IsBatterySaverAllowed() { + if (override_allowed_for_testing) { + CHECK_IS_TEST(); + return *override_allowed_for_testing; + } + if (features::IsBatterySaverAvailable()) { + return !Shell::Get()->battery_saver_controller()->IsDisabledByPolicy(); + } + return false; +} + +void OverrideIsBatterySaverAllowedForTesting(absl::optional<bool> isAllowed) { + CHECK_IS_TEST(); + override_allowed_for_testing = isAllowed; +} + BatterySaverController::BatterySaverController(PrefService* local_state) : local_state_(local_state), activation_charge_percent_( @@ -312,4 +332,10 @@ power_manager::PowerSupplyProperties_BatteryState_NOT_PRESENT; } +bool BatterySaverController::IsDisabledByPolicy() const { + // Pref is managed and set to false. + return local_state_->IsManagedPreference(prefs::kPowerBatterySaver) && + !local_state_->GetBoolean(prefs::kPowerBatterySaver); +} + } // namespace ash
diff --git a/ash/system/power/battery_saver_controller.h b/ash/system/power/battery_saver_controller.h index 4abd291..67fec7e 100644 --- a/ash/system/power/battery_saver_controller.h +++ b/ash/system/power/battery_saver_controller.h
@@ -20,6 +20,14 @@ namespace ash { +// IsBatterySaverAllowed returns true if the Battery Saver feature is enabled +// and it is not disabled via policy. +ASH_EXPORT bool IsBatterySaverAllowed(); + +// Test method to allow testing without the Battery Saver feature. +ASH_EXPORT void OverrideIsBatterySaverAllowedForTesting( + absl::optional<bool> isAllowed); + // BatterySaverController is a singleton that controls battery saver state via // PowerManagerClient by watching for updates to ash::prefs::kPowerBatterySaver // from settings and power status for charging state, and logs metrics. @@ -53,6 +61,8 @@ bool IsBatterySaverSupported() const; + bool IsDisabledByPolicy() const; + void ShowBatterySaverModeDisabledToast(); void ShowBatterySaverModeEnabledToast();
diff --git a/ash/system/power/battery_saver_controller_unittest.cc b/ash/system/power/battery_saver_controller_unittest.cc index 64c1ab5..e037e19 100644 --- a/ash/system/power/battery_saver_controller_unittest.cc +++ b/ash/system/power/battery_saver_controller_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> #include "ash/constants/ash_features.h" +#include "ash/constants/ash_pref_names.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" #include "ash/system/power/battery_notification.h" @@ -405,6 +406,21 @@ EXPECT_EQ(current_toast, nullptr); } +TEST_F(BatterySaverControllerTest, Allowed) { + // Battery Saver is allowed by default. + EXPECT_TRUE(IsBatterySaverAllowed()); + + // If pref is managed and false, then Battery Saver is not allowed. + local_state()->SetManagedPref(prefs::kPowerBatterySaver, base::Value(false)); + EXPECT_FALSE(IsBatterySaverAllowed()); + + local_state()->RemoveManagedPref(prefs::kPowerBatterySaver); + + // If the experiment is off, Battery Saver is not allowed. + scoped_feature_list_.reset(); + EXPECT_FALSE(IsBatterySaverAllowed()); +} + TEST_F(BatterySaverControllerNotificationTest, ShowEnableToastAtCriticalPercentageForAutoEnable) { SetExperimentArm(features::kBSMAutoEnable);
diff --git a/ash/system/power/power_notification_controller.cc b/ash/system/power/power_notification_controller.cc index 987a1fe..d036441 100644 --- a/ash/system/power/power_notification_controller.cc +++ b/ash/system/power/power_notification_controller.cc
@@ -337,15 +337,14 @@ // Battery Saver Notification doesn't have a time remaining text, so send // the notification + turn on battery saver right away. if (!status.IsBatteryPresent() || - (!features::IsBatterySaverAvailable() && - status.IsBatteryTimeBeingCalculated()) || + (!IsBatterySaverAllowed() && status.IsBatteryTimeBeingCalculated()) || on_AC_power) { notification_state_ = NOTIFICATION_NONE; return false; } - // Send different notifications if Battery Saver flag is enabled. - if (features::IsBatterySaverAvailable()) { + // Send different notifications if Battery Saver flag is allowed. + if (IsBatterySaverAllowed()) { const double rounded_battery_percent = status.GetRoundedBatteryPercent(); const bool on_line_power = status.IsLinePowerConnected();
diff --git a/ash/system/power/power_sounds_controller.cc b/ash/system/power/power_sounds_controller.cc index c53da3f..7941d90 100644 --- a/ash/system/power/power_sounds_controller.cc +++ b/ash/system/power/power_sounds_controller.cc
@@ -7,6 +7,7 @@ #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "ash/shell.h" +#include "ash/system/power/battery_saver_controller.h" #include "ash/system/power/power_status.h" #include "base/check.h" #include "base/check_is_test.h" @@ -47,7 +48,7 @@ return Sound::kChargeHighBattery; const int threshold = - features::IsBatterySaverAvailable() + IsBatterySaverAllowed() ? features::kBatterySaverActivationChargePercent.Get() + 1 : kMidPercentageForCharging; @@ -208,9 +209,9 @@ bool is_calculating_battery_time, ExternalPower external_power, std::optional<base::TimeDelta> remaining_time) const { - const bool is_battery_saver_available = features::IsBatterySaverAvailable(); + const bool is_battery_saver_allowed = IsBatterySaverAllowed(); - if ((is_calculating_battery_time && !is_battery_saver_available) || + if ((is_calculating_battery_time && !is_battery_saver_allowed) || is_ac_charger_connected_) { return BatteryState::kNone; } @@ -224,7 +225,7 @@ // automatically reflects this differentiation in its logic. Otherwise, when // the device is disconnected, we calculate it based on the remaining time // until the battery is empty. - if (is_battery_saver_available || external_power == kUsbPower) { + if (is_battery_saver_allowed || external_power == kUsbPower) { return GetBatteryStateFromBatteryLevel(); } return GetBatteryStateFromRemainingTime(remaining_time); @@ -237,7 +238,7 @@ } const int low_power_warning_percentage = - features::IsBatterySaverAvailable() + IsBatterySaverAllowed() ? features::kBatterySaverActivationChargePercent.Get() : kLowPowerWarningPercentage;
diff --git a/ash/system/power/power_sounds_controller_unittest.cc b/ash/system/power/power_sounds_controller_unittest.cc index c04f349..9441700 100644 --- a/ash/system/power/power_sounds_controller_unittest.cc +++ b/ash/system/power/power_sounds_controller_unittest.cc
@@ -9,6 +9,7 @@ #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "ash/shell.h" +#include "ash/system/power/battery_saver_controller.h" #include "ash/system/system_notification_controller.h" #include "ash/system/test_system_sounds_delegate.h" #include "ash/test/ash_test_base.h" @@ -40,13 +41,8 @@ class PowerSoundsControllerTest : public AshTestBase { public: - PowerSoundsControllerTest() - : PowerSoundsControllerTest({features::kSystemSounds}) {} - - explicit PowerSoundsControllerTest( - const std::vector<base::test::FeatureRef>& enabled_features) { - scoped_feature_.InitWithFeatures(enabled_features, {}); - } + PowerSoundsControllerTest(absl::optional<bool> battery_saver_allowed = false) + : battery_saver_allowed_(battery_saver_allowed) {} PowerSoundsControllerTest(const PowerSoundsControllerTest&) = delete; PowerSoundsControllerTest& operator=(const PowerSoundsControllerTest&) = @@ -56,10 +52,18 @@ // AshTestBase: void SetUp() override { + scoped_feature_.InitWithFeatures( + {features::kSystemSounds, features::kBatterySaver}, {}); AshTestBase::SetUp(); + OverrideIsBatterySaverAllowedForTesting(battery_saver_allowed_); SetInitialPowerStatus(); } + void TearDown() override { + AshTestBase::TearDown(); + OverrideIsBatterySaverAllowedForTesting(absl::nullopt); + } + TestSystemSoundsDelegate* GetSystemSoundsDelegate() const { return static_cast<TestSystemSoundsDelegate*>( Shell::Get()->system_sounds_delegate()); @@ -147,6 +151,7 @@ private: bool is_ac_charger_connected_; + absl::optional<bool> battery_saver_allowed_; }; class PowerSoundsControllerWithBatterySaverTest @@ -155,8 +160,7 @@ features::BatterySaverNotificationBehavior> { public: PowerSoundsControllerWithBatterySaverTest() - : PowerSoundsControllerTest( - {features::kSystemSounds, features::kBatterySaver}) {} + : PowerSoundsControllerTest(true) {} }; INSTANTIATE_TEST_SUITE_P(
diff --git a/ash/system/time/calendar_up_next_view.cc b/ash/system/time/calendar_up_next_view.cc index 694e5e9..3a51213 100644 --- a/ash/system/time/calendar_up_next_view.cc +++ b/ash/system/time/calendar_up_next_view.cc
@@ -6,6 +6,7 @@ #include <algorithm> #include <memory> +#include <utility> #include "ash/bubble/bubble_utils.h" #include "ash/resources/vector_icons/vector_icons.h" @@ -197,7 +198,7 @@ ->SetLayoutManager(std::make_unique<views::BoxLayout>()) ->set_main_axis_alignment(views::BoxLayout::MainAxisAlignment::kCenter); todays_events_button_container_->AddChildView( - CreateTodaysEventsButton(callback)); + CreateTodaysEventsButton(std::move(callback))); // Header. auto* header_layout_manager =
diff --git a/ash/system/time/calendar_up_next_view_unittest.cc b/ash/system/time/calendar_up_next_view_unittest.cc index 190b96a9..cfe53525 100644 --- a/ash/system/time/calendar_up_next_view_unittest.cc +++ b/ash/system/time/calendar_up_next_view_unittest.cc
@@ -4,6 +4,8 @@ #include "ash/system/time/calendar_up_next_view.h" +#include <utility> + #include "ash/public/cpp/test/test_system_tray_client.h" #include "ash/shell.h" #include "ash/system/model/system_tray_model.h" @@ -90,8 +92,8 @@ google_apis::ApiErrorCode::HTTP_SUCCESS, calendar_test_utils::CreateMockEventList(std::move(events)).get()); - auto up_next_view = - std::make_unique<CalendarUpNextView>(controller_.get(), callback); + auto up_next_view = std::make_unique<CalendarUpNextView>( + controller_.get(), std::move(callback)); up_next_view_ = widget_->SetContentsView(std::move(up_next_view)); // Set the widget to reflect the CalendarUpNextView size in reality. If we // don't then the view will never be scrollable.
diff --git a/ash/system/unified/feature_tile.cc b/ash/system/unified/feature_tile.cc index c1efcca..4bb62fce 100644 --- a/ash/system/unified/feature_tile.cc +++ b/ash/system/unified/feature_tile.cc
@@ -4,6 +4,8 @@ #include "ash/system/unified/feature_tile.h" +#include <utility> + #include "ash/resources/vector_icons/vector_icons.h" #include "ash/strings/grit/ash_strings.h" #include "ash/style/ash_color_id.h" @@ -85,7 +87,7 @@ FeatureTile::FeatureTile(PressedCallback callback, bool is_togglable, TileType type) - : Button(callback), + : Button(std::move(callback)), corner_radius_(kDefaultCornerRadius), is_togglable_(is_togglable), type_(type) {
diff --git a/ash/system/unified/power_button.cc b/ash/system/unified/power_button.cc index 5cc0c66..18637c1 100644 --- a/ash/system/unified/power_button.cc +++ b/ash/system/unified/power_button.cc
@@ -4,6 +4,8 @@ #include "ash/system/unified/power_button.h" +#include <utility> + #include "ash/constants/quick_settings_catalogs.h" #include "ash/public/cpp/ash_view_ids.h" #include "ash/public/cpp/session/session_controller.h" @@ -339,7 +341,7 @@ }; PowerButtonContainer::PowerButtonContainer(PressedCallback callback) - : Button(callback) { + : Button(std::move(callback)) { auto* layout = SetLayoutManager(std::make_unique<views::BoxLayout>()); layout->SetOrientation(views::BoxLayout::Orientation::kHorizontal);
diff --git a/ash/system/unified/unified_slider_view.cc b/ash/system/unified/unified_slider_view.cc index 07ed313..4c84ae0 100644 --- a/ash/system/unified/unified_slider_view.cc +++ b/ash/system/unified/unified_slider_view.cc
@@ -5,6 +5,7 @@ #include "ash/system/unified/unified_slider_view.h" #include <memory> +#include <utility> #include "ash/constants/quick_settings_catalogs.h" #include "ash/system/tray/tray_constants.h" @@ -61,7 +62,7 @@ bool is_togglable, bool read_only, QuickSettingsSlider::Style slider_style) - : icon_(&icon), callback_(callback), is_togglable_(is_togglable) { + : icon_(&icon), is_togglable_(is_togglable) { slider_ = AddChildView(CreateSlider(listener, read_only, slider_style)); slider_->SetBorder(views::CreateEmptyBorder(kQsSliderBorder)); // Sets `slider_` to have a `BoxLayout` to align the child view
diff --git a/ash/system/unified/unified_slider_view.h b/ash/system/unified/unified_slider_view.h index 125a2f76..3ea9159e 100644 --- a/ash/system/unified/unified_slider_view.h +++ b/ash/system/unified/unified_slider_view.h
@@ -83,7 +83,6 @@ private: raw_ptr<const gfx::VectorIcon, ExperimentalAsh> icon_; - views::Button::PressedCallback callback_; const bool is_togglable_; // Unowned. Owned by views hierarchy.
diff --git a/ash/system/video_conference/bubble/toggle_effects_view.cc b/ash/system/video_conference/bubble/toggle_effects_view.cc index 403bc09..726f2b2 100644 --- a/ash/system/video_conference/bubble/toggle_effects_view.cc +++ b/ash/system/video_conference/bubble/toggle_effects_view.cc
@@ -7,6 +7,7 @@ #include <algorithm> #include <memory> +#include <utility> #include "ash/bubble/bubble_utils.h" #include "ash/resources/vector_icons/vector_icons.h" @@ -169,7 +170,7 @@ std::optional<int> container_id, const VcEffectId effect_id, int num_button_per_row) - : callback_(callback), + : callback_(std::move(callback)), toggled_(toggle_state), effect_id_(effect_id), vector_icon_(vector_icon),
diff --git a/ash/system/video_conference/effects/video_conference_tray_effects_manager_types.cc b/ash/system/video_conference/effects/video_conference_tray_effects_manager_types.cc index eff391e..3707c84 100644 --- a/ash/system/video_conference/effects/video_conference_tray_effects_manager_types.cc +++ b/ash/system/video_conference/effects/video_conference_tray_effects_manager_types.cc
@@ -4,6 +4,8 @@ #include "ash/system/video_conference/effects/video_conference_tray_effects_manager_types.h" +#include <utility> + #include "ash/system/video_conference/effects/video_conference_tray_effects_manager.h" #include "ui/gfx/vector_icon_types.h" @@ -17,7 +19,7 @@ : icon_(icon), label_text_(label_text), accessible_name_id_(accessible_name_id), - button_callback_(button_callback), + button_callback_(std::move(button_callback)), state_value_(state_value) { DCHECK(icon); } @@ -44,4 +46,4 @@ return states_[index].get(); } -} // namespace ash \ No newline at end of file +} // namespace ash
diff --git a/ash/system/video_conference/video_conference_tray.cc b/ash/system/video_conference/video_conference_tray.cc index bd71cdf..2a0a511 100644 --- a/ash/system/video_conference/video_conference_tray.cc +++ b/ash/system/video_conference/video_conference_tray.cc
@@ -277,16 +277,22 @@ VIDEO_CONFERENCE_TOGGLE_BUTTON_TYPE_CAMERA)); camera_icon_->SetVisible(false); - screen_share_icon_ = tray_container()->AddChildView( - std::make_unique<VideoConferenceTrayButton>( - base::BindRepeating(&VideoConferenceTray::OnScreenShareButtonClicked, - weak_ptr_factory_.GetWeakPtr()), - &kVideoConferenceScreenShareIcon, &kVideoConferenceScreenShareIcon, - &kVideoConferenceScreenShareIcon, - VIDEO_CONFERENCE_TOGGLE_BUTTON_TYPE_SCREEN_SHARE)); - // Toggling screen share stops screen share, and removes the item. - screen_share_icon_->set_toggle_is_one_way(); - screen_share_icon_->SetVisible(false); + const bool allow_stop_screen_share = + base::FeatureList::IsEnabled(features::kVcStopAllScreenShare); + + if (allow_stop_screen_share) { + screen_share_icon_ = tray_container()->AddChildView( + std::make_unique<VideoConferenceTrayButton>( + base::BindRepeating( + &VideoConferenceTray::OnScreenShareButtonClicked, + weak_ptr_factory_.GetWeakPtr()), + &kVideoConferenceScreenShareIcon, &kVideoConferenceScreenShareIcon, + &kVideoConferenceScreenShareIcon, + VIDEO_CONFERENCE_TOGGLE_BUTTON_TYPE_SCREEN_SHARE)); + // Toggling screen share stops screen share, and removes the item. + screen_share_icon_->set_toggle_is_one_way(); + screen_share_icon_->SetVisible(false); + } toggle_bubble_button_ = tray_container()->AddChildView(std::make_unique<ToggleBubbleButton>( @@ -302,7 +308,8 @@ // so force update all state. UpdateTrayAndIconsState(); - DCHECK_EQ(4u, tray_container()->children().size()) + DCHECK_EQ(allow_stop_screen_share ? 4u : 3u, + tray_container()->children().size()) << "Icons must be updated here in case a media session begins prior to " "connecting a secondary display."; } @@ -396,9 +403,11 @@ } void VideoConferenceTray::OnScreenSharingStateChange(bool is_capturing_screen) { - screen_share_icon_->SetVisible(is_capturing_screen); - screen_share_icon_->SetIsCapturing( - /*is_capturing=*/is_capturing_screen); + if (screen_share_icon_) { + screen_share_icon_->SetVisible(is_capturing_screen); + screen_share_icon_->SetIsCapturing( + /*is_capturing=*/is_capturing_screen); + } } void VideoConferenceTray::OnCameraCapturingStateChange(bool is_capturing) { @@ -444,9 +453,11 @@ audio_icon_->SetIsCapturing(controller->IsCapturingMicrophone()); audio_icon_->SetToggled(/*toggled=*/controller->GetMicrophoneMuted()); - bool is_capturing_screen = controller->IsCapturingScreen(); - screen_share_icon_->SetVisible(is_capturing_screen); - screen_share_icon_->SetIsCapturing(is_capturing_screen); + if (screen_share_icon_) { + bool is_capturing_screen = controller->IsCapturingScreen(); + screen_share_icon_->SetVisible(is_capturing_screen); + screen_share_icon_->SetIsCapturing(is_capturing_screen); + } } IconButton* VideoConferenceTray::GetToggleBubbleButtonForTest() {
diff --git a/ash/system/video_conference/video_conference_tray_pixeltest.cc b/ash/system/video_conference/video_conference_tray_pixeltest.cc index c9e73b4..472e24d 100644 --- a/ash/system/video_conference/video_conference_tray_pixeltest.cc +++ b/ash/system/video_conference/video_conference_tray_pixeltest.cc
@@ -38,6 +38,7 @@ scoped_feature_list_.InitWithFeatures( /*enabled_features=*/{chromeos::features::kJellyroll, features::kVideoConference, + features::kVcStopAllScreenShare, chromeos::features::kJelly, features::kCameraEffectsSupportedByHardware}, /*disabled_features=*/{});
diff --git a/ash/system/video_conference/video_conference_tray_unittest.cc b/ash/system/video_conference/video_conference_tray_unittest.cc index 39b6f35..7847274 100644 --- a/ash/system/video_conference/video_conference_tray_unittest.cc +++ b/ash/system/video_conference/video_conference_tray_unittest.cc
@@ -112,7 +112,7 @@ // AshTestBase: void SetUp() override { scoped_feature_list_.InitWithFeatures( - {features::kVideoConference, + {features::kVideoConference, features::kVcStopAllScreenShare, features::kCameraEffectsSupportedByHardware}, {});
diff --git a/ash/user_education/views/help_bubble_view_ash.cc b/ash/user_education/views/help_bubble_view_ash.cc index 4ff3810..40343e7 100644 --- a/ash/user_education/views/help_bubble_view_ash.cc +++ b/ash/user_education/views/help_bubble_view_ash.cc
@@ -145,7 +145,7 @@ public: ClosePromoButton(const std::u16string accessible_name, PressedCallback callback) { - SetCallback(callback); + SetCallback(std::move(callback)); views::ConfigureVectorImageButton(this); views::HighlightPathGenerator::Install( this,
diff --git a/ash/webui/camera_app_ui/resources/css/main.css b/ash/webui/camera_app_ui/resources/css/main.css index 8ba22b76..5afae682 100644 --- a/ash/webui/camera_app_ui/resources/css/main.css +++ b/ash/webui/camera_app_ui/resources/css/main.css
@@ -15,11 +15,13 @@ --exit-easing: cubic-bezier(0.4, 0, 1, 1); /* App specific settings */ + --big-icon: 48px; --bottom-line: 44px; --default-font-family: 'Google Sans', sans-serif; --fixed-width-font-family: 'Cousine', monospace; --left-line: 44px; --right-line: 50px; + --small-icon: 40px; --top-line: 48px; /* From https://www.w3.org/TR/css-backgrounds-3/#corner-overlap. */ @@ -504,7 +506,7 @@ } body:is(:not(.video), .record-type-gif, .record-type-time-lapse) #toggle-mic, -body:not(.multi-camera) #switch-device { +body:not(.multi-camera) switch-device-button { visibility: hidden; } @@ -543,25 +545,6 @@ visibility: visible; } -#switch-device { - height: var(--big-icon); - outline-offset: 8px; - width: var(--big-icon); -} - -#switch-device.animate { - animation: switch-device-rotate 350ms ease-out; -} - -@keyframes switch-device-rotate { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(-180deg); - } -} - body.doc-mode-reviewing #gallery-enter { visibility: hidden; } @@ -778,8 +761,6 @@ } #view-camera { - --big-icon: 48px; - --small-icon: 40px; --shutter-vertical-center: 180px; align-items: center;
diff --git a/ash/webui/camera_app_ui/resources/js/animation.ts b/ash/webui/camera_app_ui/resources/js/animation.ts index 3da96f8..86f5ecd6 100644 --- a/ash/webui/camera_app_ui/resources/js/animation.ts +++ b/ash/webui/camera_app_ui/resources/js/animation.ts
@@ -23,6 +23,12 @@ * pseudo-elements. */ function getAnimations(el: HTMLElement): Animation[] { + if (el.shadowRoot !== null) { + // The element is a custom web component, assuming that we want to wait for + // all inner animations to settle down when applying animation to the + // element. + return el.shadowRoot.getAnimations(); + } return el.getAnimations({subtree: true}) .filter((a) => assertInstanceof(a.effect, KeyframeEffect).target === el); }
diff --git a/ash/webui/camera_app_ui/resources/js/externs/types.d.ts b/ash/webui/camera_app_ui/resources/js/externs/types.d.ts index 3e1d7736..778f8a6 100644 --- a/ash/webui/camera_app_ui/resources/js/externs/types.d.ts +++ b/ash/webui/camera_app_ui/resources/js/externs/types.d.ts
@@ -196,3 +196,24 @@ interface Performance { measureUserAgentSpecificMemory(): Promise<MemoryMeasurement>; } + +/* + * This is the return value for LitElement render function. + * + * Since the render function can return multiple different renderable types [1], + * the type gets really complex if we explicitly list all possible types. + * LitElement own typing use `unknown` for render return type, and upstream + * discussion [2] also suggests using `unknown`, so we just alias the type to + * `unknown` and don't further restrict what types can be returned by render. + * + * Since directly writing `unknown` as return type of the render function is + * a bit confusing to readers, we expose a type alias here makes the code more + * readable. + * + * Also see + * https://chromium-review.googlesource.com/c/chromium/src/+/4318288/comment/c7a4600e_6ce078bc/ + * + * [1]: https://lit.dev/docs/components/rendering/#renderable-values + * [2]: https://github.com/lit/lit/discussions/2359 + */ +type RenderResult = unknown;
diff --git a/ash/webui/camera_app_ui/resources/js/js.gni b/ash/webui/camera_app_ui/resources/js/js.gni index d908936..c329521 100644 --- a/ash/webui/camera_app_ui/resources/js/js.gni +++ b/ash/webui/camera_app_ui/resources/js/js.gni
@@ -42,8 +42,11 @@ "lib/comlink.ts", "lib/comlink_protocol.ts", "lib/ffmpeg.js", + "lit/components/index.ts", "lit/components/record-time-chip.ts", "lit/components/svg-wrapper.ts", + "lit/components/switch-device-button.ts", + "lit/directives/with_tooltip.ts", "lit/state_observer_controller.ts", "local_dev.ts", "main.ts",
diff --git a/ash/webui/camera_app_ui/resources/js/lit/components/index.ts b/ash/webui/camera_app_ui/resources/js/lit/components/index.ts new file mode 100644 index 0000000..2eb96299 --- /dev/null +++ b/ash/webui/camera_app_ui/resources/js/lit/components/index.ts
@@ -0,0 +1,8 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file is imported by main.ts to have all Lit components registered. +import './record-time-chip.js'; +import './svg-wrapper.js'; +import './switch-device-button.js';
diff --git a/ash/webui/camera_app_ui/resources/js/lit/components/record-time-chip.ts b/ash/webui/camera_app_ui/resources/js/lit/components/record-time-chip.ts index c8afcdf..bd5b75f 100644 --- a/ash/webui/camera_app_ui/resources/js/lit/components/record-time-chip.ts +++ b/ash/webui/camera_app_ui/resources/js/lit/components/record-time-chip.ts
@@ -53,7 +53,7 @@ private readonly recordingUiPausedState = new StateObserverController(this, State.RECORDING_UI_PAUSED); - override render(): unknown { + override render(): RenderResult { const recordingIcon = html`<div id="icon"></div>`; const pausedText = html`<div id="paused-msg">${ getI18nMessage(I18nString.RECORD_VIDEO_PAUSED_MSG)}</div>`;
diff --git a/ash/webui/camera_app_ui/resources/js/lit/components/svg-wrapper.ts b/ash/webui/camera_app_ui/resources/js/lit/components/svg-wrapper.ts index a00853a..92c7f64 100644 --- a/ash/webui/camera_app_ui/resources/js/lit/components/svg-wrapper.ts +++ b/ash/webui/camera_app_ui/resources/js/lit/components/svg-wrapper.ts
@@ -43,7 +43,7 @@ } } - override render(): unknown { + override render(): RenderResult { if (this.name === null) { return null; }
diff --git a/ash/webui/camera_app_ui/resources/js/lit/components/switch-device-button.ts b/ash/webui/camera_app_ui/resources/js/lit/components/switch-device-button.ts new file mode 100644 index 0000000..05ba677 --- /dev/null +++ b/ash/webui/camera_app_ui/resources/js/lit/components/switch-device-button.ts
@@ -0,0 +1,80 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import { + css, + html, + LitElement, +} from 'chrome://resources/mwc/lit/index.js'; + +import {I18nString} from '../../i18n_string.js'; +import {getI18nMessage} from '../../models/load_time_data.js'; +import {withTooltip} from '../directives/with_tooltip.js'; + +export class SwitchDeviceButton extends LitElement { + static override shadowRootOptions = { + ...LitElement.shadowRootOptions, + delegatesFocus: true, + }; + + static override styles = css` + :host { + display: block; + } + + button { + align-items: center; + background-color: transparent; + border-radius: 50%; + border: none; + display: flex; + flex-shrink: 0; + height: var(--big-icon); + justify-content: center; + outline-offset: 8px; + padding: 0; + width: var(--big-icon); + } + + button:enabled:active { + transform: scale(1.07); + } + + button:focus-visible { + outline: 2px solid var(--cros-sys-focus_ring); + } + + :host(.animate) button { + animation: rotate180 350ms ease-out; + } + + @keyframes rotate180 { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(-180deg); + } + } + `; + + override render(): RenderResult { + return html` + <button tabindex="0" + aria-label=${getI18nMessage(I18nString.SWITCH_CAMERA_BUTTON)} + ${withTooltip()}> + <svg-wrapper name="camera_button_switch_device.svg"></svg-wrapper> + </button> + `; + } +} + +window.customElements.define('switch-device-button', SwitchDeviceButton); + +declare global { + interface HTMLElementTagNameMap { + /* eslint-disable-next-line @typescript-eslint/naming-convention */ + 'switch-device-button': SwitchDeviceButton; + } +}
diff --git a/ash/webui/camera_app_ui/resources/js/lit/directives/with_tooltip.ts b/ash/webui/camera_app_ui/resources/js/lit/directives/with_tooltip.ts new file mode 100644 index 0000000..df2e6e0 --- /dev/null +++ b/ash/webui/camera_app_ui/resources/js/lit/directives/with_tooltip.ts
@@ -0,0 +1,44 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import { + directive, + Directive, + ElementPart, + nothing, + PartInfo, + PartType, +} from 'chrome://resources/mwc/lit/index.js'; + +import {assert} from '../../assert.js'; +import * as tooltip from '../../tooltip.js'; + + +class WithTooltip extends Directive { + private firstUpdate = true; + + constructor(partInfo: PartInfo) { + super(partInfo); + assert( + partInfo.type === PartType.ELEMENT, + 'The `withTooltip` directive must be used in element tag'); + } + + override update(part: ElementPart) { + if (this.firstUpdate) { + tooltip.setupElements([part.element]); + this.firstUpdate = false; + } + return this.render(); + } + + override render() { + return nothing; + } +} + +/** + * The directive set up tooltip when the element is focused or hovered. + */ +export const withTooltip = directive(WithTooltip);
diff --git a/ash/webui/camera_app_ui/resources/js/main.ts b/ash/webui/camera_app_ui/resources/js/main.ts index e7dc3b8..779e73a6 100644 --- a/ash/webui/camera_app_ui/resources/js/main.ts +++ b/ash/webui/camera_app_ui/resources/js/main.ts
@@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import './lit/components/record-time-chip.js'; -import './lit/components/svg-wrapper.js'; +import './lit/components/index.js'; import { ColorChangeUpdater,
diff --git a/ash/webui/camera_app_ui/resources/js/test/cca_type.ts b/ash/webui/camera_app_ui/resources/js/test/cca_type.ts index a20936ca..3c280ea 100644 --- a/ash/webui/camera_app_ui/resources/js/test/cca_type.ts +++ b/ash/webui/camera_app_ui/resources/js/test/cca_type.ts
@@ -91,7 +91,7 @@ settingsButtonContainer: 'div:has(> #open-settings)', settingsHeader: '#settings-header', shutter: '.shutter', - switchDeviceButton: '#switch-device', + switchDeviceButton: 'switch-device-button', tiltDownButton: '#tilt-down', tiltUpButton: '#tilt-up', timeLapseRecordingOption:
diff --git a/ash/webui/camera_app_ui/resources/js/tooltip.ts b/ash/webui/camera_app_ui/resources/js/tooltip.ts index 12ff2248..c5970ca 100644 --- a/ash/webui/camera_app_ui/resources/js/tooltip.ts +++ b/ash/webui/camera_app_ui/resources/js/tooltip.ts
@@ -13,7 +13,7 @@ /** * The element whose tooltip should be shown. */ -let activeElement: HTMLElement|null = null; +let activeElement: Element|null = null; /** * Name of event triggered for positioning tooltip. @@ -60,7 +60,7 @@ * * @param element Active element whose tooltip to be shown. */ -function show(element: HTMLElement) { +function show(element: Element) { assert(tooltipElement !== null); hide(); @@ -75,7 +75,7 @@ * * @param elements Elements whose tooltips to be shown. */ -export function setupElements(elements: HTMLElement[]): void { +export function setupElements(elements: Element[]): void { for (const el of elements) { function hideHandler() { if (activeElement === el) { @@ -106,7 +106,7 @@ }); } -function triggerPosition(element: HTMLElement) { +function triggerPosition(element: Element) { const event = new CustomEvent(TOOLTIP_POSITION_EVENT_NAME, {cancelable: true}); const doDefault = element.dispatchEvent(event);
diff --git a/ash/webui/camera_app_ui/resources/js/views/camera/options.ts b/ash/webui/camera_app_ui/resources/js/views/camera/options.ts index c1a2dcb..1745931 100644 --- a/ash/webui/camera_app_ui/resources/js/views/camera/options.ts +++ b/ash/webui/camera_app_ui/resources/js/views/camera/options.ts
@@ -37,7 +37,7 @@ private readonly openPTZPanel = dom.get('#open-ptz-panel', HTMLButtonElement); private readonly switchDeviceButton = - dom.get('#switch-device', HTMLButtonElement); + dom.get('switch-device-button', HTMLElement); /** * CameraConfig of the camera device currently used or selected. @@ -62,7 +62,7 @@ } const switching = this.cameraManager.switchCamera(); if (switching !== null) { - animate.play(dom.get('#switch-device', HTMLElement)); + animate.play(this.switchDeviceButton); } }); dom.get('#open-settings', HTMLButtonElement)
diff --git a/ash/webui/camera_app_ui/resources/views/main.html b/ash/webui/camera_app_ui/resources/views/main.html index 9d3bcd5..288cdcd3 100644 --- a/ash/webui/camera_app_ui/resources/views/main.html +++ b/ash/webui/camera_app_ui/resources/views/main.html
@@ -269,11 +269,8 @@ <div class="two-bars" data-svg="camera_shutter_video_pause.svg"></div> </button> </div> - <div class="bottom-stripe left-stripe buttons circle"> - <button id="switch-device" tabindex="0" - i18n-label="switch_camera_button" - data-svg="camera_button_switch_device.svg"></button> - </div> + <switch-device-button tabindex="0" class="bottom-stripe left-stripe"> + </switch-device-button> <div id="mode-selector" class="bottom-stripe"> <div id="modes-group" class="buttons" role="radiogroup" i18n-aria="aria_camera_mode_group">
diff --git a/ash/webui/color_internals/test/color_internals_browsertest.js b/ash/webui/color_internals/test/color_internals_browsertest.js index 4953221..304735c 100644 --- a/ash/webui/color_internals/test/color_internals_browsertest.js +++ b/ash/webui/color_internals/test/color_internals_browsertest.js
@@ -28,7 +28,7 @@ // Tests that chrome://color-internals loads successfully. TEST_F('ColorInternalsUIBrowserTest', 'HasChromeSchemeURL', async () => { - await import('chrome://webui-test/mojo_webui_test_support.js'); + await import('chrome://webui-test/chromeos/mojo_webui_test_support.js'); assertEquals(document.location.origin, HOST_ORIGIN); testDone(); }); @@ -36,14 +36,14 @@ // Tests that the table body has been constructed properly and has had token // rows added into it. TEST_F('ColorInternalsUIBrowserTest', 'BuildsTokenTable', async () => { - await import('chrome://webui-test/mojo_webui_test_support.js'); + await import('chrome://webui-test/chromeos/mojo_webui_test_support.js'); const table = document.querySelector('table'); assertNotEquals(table.tBodies[0].rows.length, 0); testDone(); }); TEST_F('ColorInternalsUIBrowserTest', 'DisplaysWallpaperColors', async () => { - await import('chrome://webui-test/mojo_webui_test_support.js'); + await import('chrome://webui-test/chromeos/mojo_webui_test_support.js'); // Wait for initial load to finish to reduce flakiness. await new Promise(async (resolve) => { const block = document.getElementById('wallpaper-block');
diff --git a/ash/webui/common/resources/network/network_ip_config.html b/ash/webui/common/resources/network/network_ip_config.html index 225f8e5..7494efe 100644 --- a/ash/webui/common/resources/network/network_ip_config.html +++ b/ash/webui/common/resources/network/network_ip_config.html
@@ -18,7 +18,7 @@ </cr-toggle> </div> </template> -<template is="dom-if" if="[[hasIpConfigFields_(ipConfig_)]]"> +<template is="dom-if" if="[[hasIpConfigFields_(ipConfig_, ipConfig_.*)]]"> <div class$="[[getFieldsClassList_(shouldShowAutoIpConfigToggle_)]]"> <network-property-list-mojo fields="[[ipConfigFields_]]" all-fields-read-only="[[automatic_]]"
diff --git a/ash/webui/common/resources/network/network_ip_config.js b/ash/webui/common/resources/network/network_ip_config.js index 1ba8071..40931ac 100644 --- a/ash/webui/common/resources/network/network_ip_config.js +++ b/ash/webui/common/resources/network/network_ip_config.js
@@ -239,22 +239,25 @@ }, /** - * Overrides null values of |ipv4| with defaults so |ipv4| passes validation - * after being converted to ONC StaticIPConfig. + * Overrides null values of this.ipConfig_.ipv4 with defaults so that + * this.ipConfig_.ipv4 passes validation after being converted to ONC + * StaticIPConfig. * TODO(https://crbug.com/1148841): Setting defaults here is strange, find * some better way. - * @param {!OncMojo.IPConfigUIProperties} ipv4 this will be modified in place * @private */ - setIpv4Defaults_(ipv4) { - if (!ipv4.gateway) { - ipv4.gateway = '192.168.1.1'; + setIpv4Defaults_() { + if (!this.ipConfig_ || !this.ipConfig_.ipv4) { + return; } - if (!ipv4.ipAddress) { - ipv4.ipAddress = '192.168.1.1'; + if (!this.ipConfig_.ipv4.gateway) { + this.set('ipConfig_.ipv4.gateway', '192.168.1.1'); } - if (!ipv4.netmask) { - ipv4.netmask = '255.255.255.0'; + if (!this.ipConfig_.ipv4.ipAddress) { + this.set('ipConfig_.ipv4.ipAddress', '192.168.1.1'); + } + if (!this.ipConfig_.ipv4.netmask) { + this.set('ipConfig_.ipv4.netmask', '255.255.255.0'); } }, @@ -272,7 +275,7 @@ type: IPConfigType.kIPv4, }; } - this.setIpv4Defaults_(this.ipConfig_.ipv4); + this.setIpv4Defaults_(); this.sendStaticIpConfig_(); return; }
diff --git a/ash/webui/os_feedback_ui/resources/BUILD.gn b/ash/webui/os_feedback_ui/resources/BUILD.gn index f0e21b4..2739f52 100644 --- a/ash/webui/os_feedback_ui/resources/BUILD.gn +++ b/ash/webui/os_feedback_ui/resources/BUILD.gn
@@ -21,7 +21,7 @@ web_component_files = [ "confirmation_page.ts", - "feedback_flow.js", + "feedback_flow.ts", "file_attachment.ts", "help_content.js", "search_page.js", @@ -43,6 +43,8 @@ mojo_files_deps = [ "//ash/webui/os_feedback_ui/mojom:mojom_webui_js" ] + ts_definitions = [ "//tools/typescript/definitions/chrome_send.d.ts" ] + ts_deps = [ "//ash/webui/common/resources:build_ts", "//third_party/polymer/v3_0:library",
diff --git a/ash/webui/os_feedback_ui/resources/feedback_flow.html b/ash/webui/os_feedback_ui/resources/feedback_flow.html index efb8f1cc..0ddb28b 100644 --- a/ash/webui/os_feedback_ui/resources/feedback_flow.html +++ b/ash/webui/os_feedback_ui/resources/feedback_flow.html
@@ -1,25 +1,25 @@ <div> - <iron-pages attr-for-selected="id" selected="[[currentState_]]"> - <search-page id="searchPage" on-continue-click="handleContinueClick_" - feedback-context="[[feedbackContext_]]" - description-template="[[descriptionTemplate_]]" - description-placeholder-text="[[descriptionPlaceholderText_]]" - help-content-search-result-count="{{helpContentSearchResultCount_}}" - no-help-content-displayed="{{noHelpContentDisplayed_}}"> + <iron-pages attr-for-selected="id" selected="[[currentState]]"> + <search-page id="searchPage" on-continue-click="handleContinueClick" + feedback-context="[[feedbackContext]]" + description-template="[[descriptionTemplate]]" + description-placeholder-text="[[descriptionPlaceholderText]]" + help-content-search-result-count="{{helpContentSearchResultCount}}" + no-help-content-displayed="{{noHelpContentDisplayed}}"> </search-page> - <share-data-page id="shareDataPage" feedback-context="[[feedbackContext_]]" - should-show-assistant-checkbox="[[shouldShowAssistantCheckbox_]]" - should-show-autofill-checkbox="[[shouldShowAutofillCheckbox_]]" - should-show-bluetooth-checkbox="[[shouldShowBluetoothCheckbox_]]" - should-show-wifi-debug-logs-checkbox="[[shouldShowWifiDebugLogsCheckbox_]]" - should-show-link-cross-device-dogfood-feedback-checkbox="[[shouldShowLinkCrossDeviceDogfoodFeedbackCheckbox_]]" - on-continue-click="handleContinueClick_" - on-go-back-click="handleGoBackClick_"> + <share-data-page id="shareDataPage" feedback-context="[[feedbackContext]]" + should-show-assistant-checkbox="[[shouldShowAssistantCheckbox]]" + should-show-autofill-checkbox="[[shouldShowAutofillCheckbox]]" + should-show-bluetooth-checkbox="[[shouldShowBluetoothCheckbox]]" + should-show-wifi-debug-logs-checkbox="[[shouldShowWifiDebugLogsCheckbox]]" + should-show-link-cross-device-dogfood-feedback-checkbox="[[shouldShowLinkCrossDeviceDogfoodFeedbackCheckbox]]" + on-continue-click="handleContinueClick" + on-go-back-click="handleGoBackClick"> </share-data-page> <confirmation-page id="confirmationPage" - is-user-logged-in="[[isUserLoggedIn_]]" - send-report-status="[[sendReportStatus_]]" - on-go-back-click="handleGoBackClick_"> + is-user-logged-in="[[isUserLoggedIn]]" + send-report-status="[[sendReportStatus]]" + on-go-back-click="handleGoBackClick"> </confirmation-page> </iron-pages> </div>
diff --git a/ash/webui/os_feedback_ui/resources/feedback_flow.js b/ash/webui/os_feedback_ui/resources/feedback_flow.js deleted file mode 100644 index c80e96c8..0000000 --- a/ash/webui/os_feedback_ui/resources/feedback_flow.js +++ /dev/null
@@ -1,786 +0,0 @@ -// Copyright 2022 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'chrome://resources/polymer/v3_0/iron-pages/iron-pages.js'; -import './confirmation_page.js'; -import './search_page.js'; -import './share_data_page.js'; -import './strings.m.js'; - -import {assert} from 'chrome://resources/ash/common/assert.js'; -import {loadTimeData} from 'chrome://resources/ash/common/load_time_data.m.js'; -import {ColorChangeUpdater} from 'chrome://resources/cr_components/color_change_listener/colors_css_updater.js'; -import {stringToMojoString16} from 'chrome://resources/js/mojo_type_util.js'; -import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; - -import {getTemplate} from './feedback_flow.html.js'; -import {showScrollingEffectOnStart, showScrollingEffects} from './feedback_utils.js'; -import {getFeedbackServiceProvider} from './mojo_interface_provider.js'; -import {FeedbackAppExitPath, FeedbackAppHelpContentOutcome, FeedbackAppPreSubmitAction, FeedbackContext, Report, SendReportStatus} from './os_feedback_ui.mojom-webui.js'; - -/** - * The host of untrusted child page. - * @type {string} - */ -const OS_FEEDBACK_UNTRUSTED_ORIGIN = 'chrome-untrusted://os-feedback'; - -/** - * The id of help-content-clicked message. - * @type {string} - */ -const HELP_CONTENT_CLICKED = 'help-content-clicked'; - -/** - * Enum for actions on search page. - * @enum {string} - */ -export const SearchPageAction = { - CONTINUE: 'continue', - QUIT: 'quit', -}; - -/** - * Enum for feedback flow states. - * @enum {string} - */ -export const FeedbackFlowState = { - SEARCH: 'searchPage', - SHARE_DATA: 'shareDataPage', - CONFIRMATION: 'confirmationPage', -}; - -/** - * Enum for reserved query parameters used by feedback source to provide - * addition context to final report. - * @enum {string} - */ -export const AdditionalContextQueryParam = { - DESCRIPTION_TEMPLATE: 'description_template', - DESCRIPTION_PLACEHOLDER_TEXT: 'description_placeholder_text', - EXTRA_DIAGNOSTICS: 'extra_diagnostics', - CATEGORY_TAG: 'category_tag', - PAGE_URL: 'page_url', - FROM_ASSISTANT: 'from_assistant', - FROM_SETTINGS_SEARCH: 'from_settings_search', - FROM_AUTOFILL: 'from_autofill', - AUTOFILL_METADATA: 'autofill_metadata', -}; - -/** - * Builds a RegExp that matches one of the given words. Each word has to match - * at word boundary and is not at the end of the tested string. For example, - * the word "SIM" would match the string "I have a sim card issue" but not - * "I have a simple issue" nor "I have a sim" (because the user might not have - * finished typing yet). - * @param {!Array<!string>} words - * @return {!RegExp} - * @protected - */ -export function buildWordMatcher(words) { - return new RegExp( - words.map((word) => '\\b' + word + '\\b[^$]').join('|'), 'i'); -} - -/** - * Regular expression to check for all variants of blu[e]toot[h] with or - * without space between the words; for BT when used as an individual word, - * or as two individual characters, and for BLE, BlueZ, and Floss when used - * as an individual word. Case insensitive matching. - * @type {!RegExp} - * @protected - */ -export const btRegEx = new RegExp( - 'blu[e]?[ ]?toot[h]?|\\bb[ ]?t\\b|\\bble\\b|\\bfloss\\b|\\bbluez\\b', 'i'); - -/** - * Regular expression to check for all strings indicating that a user can't - * connect to a HID or Audio device. - * Sample strings this will match: - * "I can't connect the speaker!", - * "The keyboard has connection problem." - * @type {!RegExp} - * @protected - */ -const cantConnectRegEx = new RegExp( - '((headphone|keyboard|mouse|speaker)((?!(connect|pair)).*)(connect|pair))' + - '|((connect|pair).*(headphone|keyboard|mouse|speaker))', - 'i'); - -/** - * Regular expression to check for "tether", "tethering" or "hotspot". Case - * insensitive matching. - * @type {!RegExp} - * @protected - */ -const tetherRegEx = new RegExp('tether(ing)?|hotspot', 'i'); - -/** - * Regular expression to check for "Smart (Un)lock" or "Easy (Un)lock" with - * or without space between the words. Case insensitive matching. - * @type {!RegExp} - * @protected - */ -const smartLockRegEx = new RegExp('(smart|easy)[ ]?(un)?lock', 'i'); - -/** - * Regular expression to check for keywords related to Nearby Share like - * "nearby (share)" or "phone (hub)". - * Case insensitive matching. - * @type {!RegExp} - * @protected - */ -const nearbyShareRegEx = new RegExp('nearby|phone', 'i'); - -/** - * Regular expression to check for keywords related to Fast Pair like - * "fast pair". - * Case insensitive matching. - * @type {!RegExp} - * @protected - */ -const fastPairRegEx = new RegExp('fast[ ]?pair', 'i'); - -/** - * Regular expression to check for Bluetooth device specific keywords. - * @type {!RegExp} - * @protected - */ -const btDeviceRegEx = - buildWordMatcher(['apple', 'allegro', 'pixelbud', 'microsoft', 'sony']); - -/** - * Regular expression to check for Phone Hub / Eche device specific keywords - * like "app stream" or "camera roll". - * @type {!RegExp} - * @protected - */ -const phoneHubRegEx = - new RegExp('app[ ]?stream(ing)?|phone|camera[ ]?roll', 'i'); - -/** - * Regular expression to check for wifi-related keywords. - */ -const wifiRegEx = - new RegExp('\\b(wifi|wi\-fi|internet|network|hotspot)\\b', 'i'); - -/** - * @fileoverview - * 'feedback-flow' manages the navigation among the steps to be taken. - */ -export class FeedbackFlowElement extends PolymerElement { - static get is() { - return 'feedback-flow'; - } - - static get template() { - return getTemplate(); - } - - static get properties() { - return { - currentState_: {type: FeedbackFlowState}, - feedbackContext_: {type: FeedbackContext, readonly: false, notify: true}, - }; - } - /** - * @suppress {missingProperties} - */ - constructor() { - super(); - - /** - * The id of an element on the page that is currently shown. - * @protected {FeedbackFlowState} - */ - this.currentState_ = FeedbackFlowState.SEARCH; - - /** - * The feedback context. - * @type {?FeedbackContext} - * @protected - */ - this.feedbackContext_ = null; - - /** - * Whether to show the bluetooth Logs checkbox in share data page. - * @type {boolean} - */ - this.shouldShowBluetoothCheckbox_; - - /** - * Whether to show the Wifi debug Logs checkbox in share data page. - * @type {boolean} - */ - this.shouldShowWifiDebugLogsCheckbox_ = false; - - /** - * Whether to show the Link Cross Device Dogfood Feedback checkbox in share - * data page. - * @type {boolean} - */ - this.shouldShowLinkCrossDeviceDogfoodFeedbackCheckbox_; - - /** - * Whether to show the autofill checkbox in share data page. - * @type {boolean} - * @protected - */ - this.shouldShowAutofillCheckbox_; - - /** - * Whether to show the assistant checkbox in share data page. - * @type {boolean} - */ - this.shouldShowAssistantCheckbox_; - - /** @private {!FeedbackServiceProviderInterface} */ - this.feedbackServiceProvider_ = getFeedbackServiceProvider(); - - /** - * The description entered by the user. It is set when the user clicks the - * next button on the search page. - * @type {string} - * @private - */ - this.description_; - - /** - * The description template provided source application to help user write - * feedback. - * @type {string} - * @protected - */ - this.descriptionTemplate_; - - /** - * The descripiton placeholder text is used to give the user a hint on how - * to write the description. Some apps, such as the Camera app can use a - * custom placeholder. - * @type {string} - * @protected - */ - this.descriptionPlaceholderText_; - - /** - * The status of sending report. - * @type {?SendReportStatus} - * @private - */ - this.sendReportStatus_; - - /** - * Whether user clicks the help content or not. - * @type {boolean} - * @private - */ - this.helpContentClicked_ = false; - - /** - * To avoid helpContentOutcome metric emit more than one time. - * @type {boolean} - * @private - */ - this.helpContentOutcomeMetricEmitted_ = false; - - /** - * Number of results returned in each search. - * @type {number} - * @private - */ - this.helpContentSearchResultCount_; - - /** - * Whether there is no help content shown(offline or search is down). - * @type {boolean} - * @private - */ - this.noHelpContentDisplayed_; - - /** - * When the feedback tool is opened as a dialog, feedback context is passed - * to front end via dialog args. - * - * @type {string} - * @private - */ - this.dialogArgs_ = chrome.getVariableValue('dialogArguments'); - - /** - * Whether the user has logged in (not on oobe or on the login screen). - * @type {boolean} - * @private - */ - this.isUserLoggedIn_; - } - - connectedCallback() { - super.connectedCallback(); - if (loadTimeData.getBoolean('isJellyEnabledForOsFeedback')) { - // TODO(b/276493287): After the Jelly experiment is launched, replace - // `cros_styles.css` with `theme/colors.css` directly in `index.html`. - // Also add `theme/typography.css` to `index.html`. - document.querySelector('link[href*=\'cros_styles.css\']') - ?.setAttribute('href', 'chrome://theme/colors.css?sets=legacy,sys'); - const typographyLink = document.createElement('link'); - typographyLink.href = 'chrome://theme/typography.css'; - typographyLink.rel = 'stylesheet'; - document.head.appendChild(typographyLink); - document.body.classList.add('jelly-enabled'); - /** @suppress {checkTypes} */ - (function() { - ColorChangeUpdater.forDocument().start(); - })(); - } - } - - ready() { - super.ready(); - if (this.dialogArgs_ && this.dialogArgs_.length > 0) { - this.initializeForDialogMode_(); - } else { - this.initializeForNonDialogMode_(); - } - - window.addEventListener('message', event => { - if (event.data.id !== HELP_CONTENT_CLICKED) { - return; - } - if (event.origin !== OS_FEEDBACK_UNTRUSTED_ORIGIN) { - console.error('Unknown origin: ' + event.origin); - return; - } - this.helpContentClicked_ = true; - this.feedbackServiceProvider_.recordPreSubmitAction( - FeedbackAppPreSubmitAction.kViewedHelpContent); - this.feedbackServiceProvider_.recordHelpContentSearchResultCount( - this.helpContentSearchResultCount_); - }); - - window.addEventListener('beforeunload', event => { - switch (this.currentState_) { - case FeedbackFlowState.SEARCH: - this.recordExitPath_( - FeedbackAppExitPath.kQuitSearchPageHelpContentClicked, - FeedbackAppExitPath.kQuitSearchPageNoHelpContentClicked); - if (!this.helpContentOutcomeMetricEmitted_) { - this.recordHelpContentOutcome_( - SearchPageAction.QUIT, - FeedbackAppHelpContentOutcome.kQuitHelpContentClicked, - FeedbackAppHelpContentOutcome.kQuitNoHelpContentClicked); - this.helpContentOutcomeMetricEmitted_ = true; - } - break; - case FeedbackFlowState.SHARE_DATA: - this.recordExitPath_( - FeedbackAppExitPath.kQuitShareDataPageHelpContentClicked, - FeedbackAppExitPath.kQuitShareDataPageNoHelpContentClicked); - break; - case FeedbackFlowState.CONFIRMATION: - this.recordExitPath_( - FeedbackAppExitPath.kSuccessHelpContentClicked, - FeedbackAppExitPath.kSuccessNoHelpContentClicked); - break; - } - }); - - this.style.setProperty( - '--window-height', window.innerHeight.toString() + 'px'); - window.addEventListener('resize', (event) => { - this.style.setProperty( - '--window-height', window.innerHeight.toString() + 'px'); - let page = null; - switch (this.currentState_) { - case FeedbackFlowState.SEARCH: - page = this.shadowRoot.querySelector('search-page'); - break; - case FeedbackFlowState.SHARE_DATA: - page = this.shadowRoot.querySelector('share-data-page'); - break; - case FeedbackFlowState.CONFIRMATION: - page = this.shadowRoot.querySelector('confirmation-page'); - break; - default: - console.warn('unexpected state: ', this.currentState_); - } - showScrollingEffects(event, page); - }); - } - - /** - * @suppress {checkTypes} suppress feedbackInfo type check in closure - * compiler. - * TODO(http://b/issues/233080620): Add a type definition for feedbackInfo. - * - * @private - */ - initializeForDialogMode_() { - // This is on Dialog mode. The `dialogArgs_` contains feedback context - // info. - const feedbackInfo = JSON.parse(this.dialogArgs_); - assert(!!feedbackInfo); - this.feedbackContext_ = { - assistantDebugInfoAllowed: false, - fromSettingsSearch: feedbackInfo.fromSettingsSearch ?? false, - isInternalAccount: feedbackInfo.isInternalAccount ?? false, - wifiDebugLogsAllowed: false, - traceId: feedbackInfo.traceId ?? 0, - pageUrl: {url: feedbackInfo.pageUrl ?? ''}, - fromAssistant: feedbackInfo.fromAssistant ?? false, - fromAutofill: feedbackInfo.fromAutofill ?? false, - autofillMetadata: feedbackInfo.autofillMetadata ? - JSON.stringify(feedbackInfo.autofillMetadata) : - '{}', - hasLinkedCrossDevicePhone: - feedbackInfo.hasLinkedCrossDevicePhone ?? false, - categoryTag: feedbackInfo.categoryTag ?? '', - }; - this.descriptionTemplate_ = feedbackInfo.description ?? ''; - this.descriptionPlaceholderText_ = - feedbackInfo.descriptionPlaceholder ?? ''; - this.feedbackContext_.extraDiagnostics = ''; - if (feedbackInfo.systemInformation?.length == 1) { - // Currently, one extra diagnostics string may be passed to feedback - // app. - // - // Sample input: - //" systemInformation": [ - // { - // "key": "EXTRA_DIAGNOSTICS", - // "value": "extra log data" - // } - // ]. - assert('EXTRA_DIAGNOSTICS' === feedbackInfo.systemInformation[0].key); - this.feedbackContext_.extraDiagnostics = - feedbackInfo.systemInformation[0].value; - } - this.isUserLoggedIn_ = this.feedbackContext_.categoryTag !== 'Login'; - this.onFeedbackContextReceived_(); - } - - /** - * @private - */ - initializeForNonDialogMode_() { - this.feedbackServiceProvider_.getFeedbackContext().then((response) => { - this.feedbackContext_ = response.feedbackContext; - this.isUserLoggedIn_ = true; - this.setAdditionalContextFromQueryParams_(); - this.onFeedbackContextReceived_(); - }); - } - - /** - * @private - */ - fetchScreenshot_() { - const shareDataPage = this.shadowRoot.querySelector('share-data-page'); - // Fetch screenshot if not fetched before. - if (!shareDataPage.screenshotUrl) { - this.feedbackServiceProvider_.getScreenshotPng().then((response) => { - if (response.pngData.length > 0) { - const blob = new Blob( - [Uint8Array.from(response.pngData)], {type: 'image/png'}); - const imageUrl = URL.createObjectURL(blob); - shareDataPage.screenshotUrl = imageUrl; - } - }); - } - } - - /** - * @private - */ - onFeedbackContextReceived_() { - assert(this.feedbackContext_); - this.shouldShowAssistantCheckbox_ = - this.feedbackContext_.isInternalAccount && - this.feedbackContext_.fromAssistant; - this.shouldShowAutofillCheckbox_ = this.feedbackContext_.fromAutofill; - } - /** - * Sets additional context passed from RequestFeedbackFlow as part of the URL. - * See `AdditionalContextQueryParam` for valid query parameters. - * @private - */ - setAdditionalContextFromQueryParams_() { - const params = new URLSearchParams(window.location.search); - const extraDiagnostics = - params.get(AdditionalContextQueryParam.EXTRA_DIAGNOSTICS); - this.feedbackContext_.extraDiagnostics = - extraDiagnostics ? decodeURIComponent(extraDiagnostics) : ''; - const descriptionTemplate = - params.get(AdditionalContextQueryParam.DESCRIPTION_TEMPLATE); - this.descriptionTemplate_ = - descriptionTemplate && descriptionTemplate.length > 0 ? - decodeURIComponent(descriptionTemplate) : - ''; - const descriptionPlaceholderText = - params.get(AdditionalContextQueryParam.DESCRIPTION_PLACEHOLDER_TEXT); - this.descriptionPlaceholderText_ = - descriptionPlaceholderText && descriptionPlaceholderText.length > 0 ? - decodeURIComponent(descriptionPlaceholderText) : - ''; - const categoryTag = params.get(AdditionalContextQueryParam.CATEGORY_TAG); - this.feedbackContext_.categoryTag = - categoryTag ? decodeURIComponent(categoryTag) : ''; - const pageUrl = params.get(AdditionalContextQueryParam.PAGE_URL); - if (pageUrl) { - this.set('feedbackContext_.pageUrl', {url: pageUrl}); - } - const fromAssistant = - params.get(AdditionalContextQueryParam.FROM_ASSISTANT); - this.feedbackContext_.fromAssistant = !!fromAssistant; - const fromSettingsSearch = - params.get(AdditionalContextQueryParam.FROM_SETTINGS_SEARCH); - this.set('feedbackContext_.fromSettingsSearch', !!fromSettingsSearch); - - const fromAutofill = params.get(AdditionalContextQueryParam.FROM_AUTOFILL); - this.feedbackContext_.fromAutofill = !!fromAutofill; - const autofillMetadata = - params.get(AdditionalContextQueryParam.AUTOFILL_METADATA); - if (autofillMetadata) { - this.feedbackContext_.autofillMetadata = autofillMetadata; - } - } - - /** - * @param {!Event} event - * @protected - */ - handleContinueClick_(event) { - switch (event.detail.currentState) { - case FeedbackFlowState.SEARCH: - this.currentState_ = FeedbackFlowState.SHARE_DATA; - this.description_ = event.detail.description; - this.shouldShowBluetoothCheckbox_ = this.feedbackContext_ !== null && - this.feedbackContext_.isInternalAccount && - this.isDescriptionRelatedToBluetooth(this.description_); - this.shouldShowWifiDebugLogsCheckbox_ = - this.computeShouldShowWifiDebugLogsCheckbox_(); - this.shouldShowLinkCrossDeviceDogfoodFeedbackCheckbox_ = - this.feedbackContext_ !== null && - loadTimeData.getBoolean( - 'enableLinkCrossDeviceDogfoodFeedbackFlag') && - this.feedbackContext_.isInternalAccount && - this.feedbackContext_.hasLinkedCrossDevicePhone && - this.isDescriptionRelatedToCrossDevice(this.description_); - this.fetchScreenshot_(); - const shareDataPage = this.shadowRoot.querySelector('share-data-page'); - shareDataPage.focusScreenshotCheckbox(); - showScrollingEffectOnStart(shareDataPage); - - if (!this.helpContentOutcomeMetricEmitted_) { - this.recordHelpContentOutcome_( - SearchPageAction.CONTINUE, - FeedbackAppHelpContentOutcome.kContinueHelpContentClicked, - FeedbackAppHelpContentOutcome.kContinueNoHelpContentClicked); - this.helpContentOutcomeMetricEmitted_ = true; - } - break; - case FeedbackFlowState.SHARE_DATA: - /** @type {!Report} */ - const report = event.detail.report; - report.description = stringToMojoString16(this.description_); - - // TODO(xiangdongkong): Show a spinner or the like for sendReport could - // take a while. - this.feedbackServiceProvider_.sendReport(report).then((response) => { - this.currentState_ = FeedbackFlowState.CONFIRMATION; - this.sendReportStatus_ = response.status; - const confirmationPage = - this.shadowRoot.querySelector('confirmation-page'); - confirmationPage.focusPageTitle(); - showScrollingEffectOnStart(confirmationPage); - }); - break; - default: - console.warn('unexpected state: ', event.detail.currentState); - } - } - - /** - * @param {!Event} event - * @protected - */ - handleGoBackClick_(event) { - switch (event.detail.currentState) { - case FeedbackFlowState.SHARE_DATA: - this.navigateToSearchPage_(); - break; - case FeedbackFlowState.CONFIRMATION: - // Remove the text from previous search. - const searchPage = this.shadowRoot.querySelector('search-page'); - searchPage.setDescription(/*text=*/ ''); - showScrollingEffectOnStart(searchPage); - - // Re-enable the send button in share data page. - const shareDataPage = this.shadowRoot.querySelector('share-data-page'); - shareDataPage.reEnableSendReportButton(); - - // Re-enable helpContentOutcomeMetric to be emitted in search page. - this.helpContentOutcomeMetricEmitted_ = false; - - this.navigateToSearchPage_(); - break; - default: - console.warn('unexpected state: ', event.detail.currentState); - } - } - - /** @private */ - computeShouldShowWifiDebugLogsCheckbox_() { - return this.feedbackContext_ && this.feedbackContext_.isInternalAccount && - this.feedbackContext_.wifiDebugLogsAllowed && - wifiRegEx.test(this.description_); - } - - /** @private */ - navigateToSearchPage_() { - this.currentState_ = FeedbackFlowState.SEARCH; - const searchPage = this.shadowRoot.querySelector('search-page'); - searchPage.focusInputElement(); - showScrollingEffectOnStart(searchPage); - } - - /** - * @param {!SearchPageAction} action - * @param {!FeedbackAppHelpContentOutcome} outcomeHelpContentClicked - * @param {!FeedbackAppHelpContentOutcome} outcomeNoHelpContentClicked - * @private - */ - recordHelpContentOutcome_( - action, outcomeHelpContentClicked, outcomeNoHelpContentClicked) { - if (this.noHelpContentDisplayed_) { - action == SearchPageAction.CONTINUE ? - this.feedbackServiceProvider_.recordHelpContentOutcome( - FeedbackAppHelpContentOutcome.kContinueNoHelpContentDisplayed) : - this.feedbackServiceProvider_.recordHelpContentOutcome( - FeedbackAppHelpContentOutcome.kQuitNoHelpContentDisplayed); - return; - } - - this.helpContentClicked_ ? - this.feedbackServiceProvider_.recordHelpContentOutcome( - outcomeHelpContentClicked) : - this.feedbackServiceProvider_.recordHelpContentOutcome( - outcomeNoHelpContentClicked); - } - - /** - * @param {!FeedbackAppExitPath} pathHelpContentClicked - * @param {!FeedbackAppExitPath} pathNoHelpContentClicked - * @private - */ - recordExitPath_(pathHelpContentClicked, pathNoHelpContentClicked) { - if (this.noHelpContentDisplayed_) { - this.feedbackServiceProvider_.recordExitPath( - FeedbackAppExitPath.kQuitNoHelpContentDisplayed); - return; - } - this.helpContentClicked_ ? - this.feedbackServiceProvider_.recordExitPath(pathHelpContentClicked) : - this.feedbackServiceProvider_.recordExitPath(pathNoHelpContentClicked); - } - - /** - * @param {!FeedbackFlowState} newState - */ - setCurrentStateForTesting(newState) { - this.currentState_ = newState; - } - - /** - * @param {!SendReportStatus} status - */ - setSendReportStatusForTesting(status) { - this.sendReportStatus_ = status; - } - - /** - * @param {string} text - */ - setDescriptionForTesting(text) { - this.description_ = text; - } - - /** - * @param {boolean} helpContentClicked - */ - setHelpContentClickedForTesting(helpContentClicked) { - this.helpContentClicked_ = helpContentClicked; - } - - /** - * @param {boolean} noHelpContentDisplayed - */ - setNoHelpContentDisplayedForTesting(noHelpContentDisplayed) { - this.noHelpContentDisplayed_ = noHelpContentDisplayed; - } - - /** - * @returns {?string} - */ - getDescriptionTemplateForTesting() { - return this.descriptionTemplate_; - } - - /** - * @returns {?string} - */ - getDescriptionPlaceholderTextForTesting() { - return this.descriptionPlaceholderText_; - } - - /** - * @returns {boolean} - */ - getIsUserLoggedInForTesting() { - return this.isUserLoggedIn_; - } - - /** - * @returns {boolean} - */ - getShouldShowWifiDebugLogsCheckboxForTesting() { - return this.shouldShowWifiDebugLogsCheckbox_; - } - - /** - * Checks if any keywords related to bluetooth have been typed. If they are, - * we show the bluetooth logs option, otherwise hide it. - * @return {boolean} - * @param {!string} textInput The input text for the description textarea. - * @protected - */ - isDescriptionRelatedToBluetooth(textInput) { - /** - * If the user is not signed in with a internal google account, the - * bluetooth checkbox should be hidden and skip the relative check. - */ - const isRelatedToBluetooth = btRegEx.test(textInput) || - cantConnectRegEx.test(textInput) || - this.isDescriptionRelatedToCrossDevice(textInput) || - fastPairRegEx.test(textInput) || btDeviceRegEx.test(textInput); - return isRelatedToBluetooth; - } - - /** - * If the user is not signed in with a internal google account, the Cross - * Device checkbox should be hidden and skip the relative check. - * - * Checks if any keywords related to Cross Device have been typed. If they - * are, we show the cross device checkbox, otherwise hide it. - * @return {boolean} - * @param {!string} textInput The input text for the description textarea. - * @protected - */ - isDescriptionRelatedToCrossDevice(textInput) { - const isRelatedToCrossDevice = phoneHubRegEx.test(textInput) || - tetherRegEx.test(textInput) || smartLockRegEx.test(textInput) || - nearbyShareRegEx.test(textInput); - return isRelatedToCrossDevice; - } -} - -customElements.define(FeedbackFlowElement.is, FeedbackFlowElement);
diff --git a/ash/webui/os_feedback_ui/resources/feedback_flow.ts b/ash/webui/os_feedback_ui/resources/feedback_flow.ts new file mode 100644 index 0000000..fcd3b95 --- /dev/null +++ b/ash/webui/os_feedback_ui/resources/feedback_flow.ts
@@ -0,0 +1,671 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'chrome://resources/polymer/v3_0/iron-pages/iron-pages.js'; +import './confirmation_page.js'; +import './search_page.js'; +import './share_data_page.js'; +import './strings.m.js'; + +import {assert} from 'chrome://resources/ash/common/assert.js'; +import {loadTimeData} from 'chrome://resources/ash/common/load_time_data.m.js'; +import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js'; +import {ColorChangeUpdater} from 'chrome://resources/cr_components/color_change_listener/colors_css_updater.js'; +import {stringToMojoString16} from 'chrome://resources/js/mojo_type_util.js'; +import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import {ConfirmationPageElement} from './confirmation_page.js'; +import {getTemplate} from './feedback_flow.html.js'; +import {showScrollingEffectOnStart, showScrollingEffects} from './feedback_utils.js'; +import {getFeedbackServiceProvider} from './mojo_interface_provider.js'; +import {FeedbackAppExitPath, FeedbackAppHelpContentOutcome, FeedbackAppPreSubmitAction, FeedbackContext, FeedbackServiceProviderInterface, Report, SendReportStatus} from './os_feedback_ui.mojom-webui.js'; +import {SearchPageElement} from './search_page.js'; +import {ShareDataPageElement} from './share_data_page.js'; + +/** The host of untrusted child page. */ +const OS_FEEDBACK_UNTRUSTED_ORIGIN = 'chrome-untrusted://os-feedback'; + +/** The id of help-content-clicked message. */ +const HELP_CONTENT_CLICKED = 'help-content-clicked'; + +export type FeedbackFlowButtonClickEvent = CustomEvent<{ + currentState: FeedbackFlowState, + description?: string, + report?: Report, +}>; + +/** Enum for actions on search page. */ +export enum SearchPageAction { + CONTINUE = 'continue', + QUIT = 'quit', +} + +/** Enum for feedback flow states. */ +export enum FeedbackFlowState { + SEARCH = 'searchPage', + SHARE_DATA = 'shareDataPage', + CONFIRMATION = 'confirmationPage' +} + +/** + * Enum for reserved query parameters used by feedback source to provide + * addition context to final report. + */ +export const AdditionalContextQueryParam = { + DESCRIPTION_TEMPLATE: 'description_template', + DESCRIPTION_PLACEHOLDER_TEXT: 'description_placeholder_text', + EXTRA_DIAGNOSTICS: 'extra_diagnostics', + CATEGORY_TAG: 'category_tag', + PAGE_URL: 'page_url', + FROM_ASSISTANT: 'from_assistant', + FROM_SETTINGS_SEARCH: 'from_settings_search', + FROM_AUTOFILL: 'from_autofill', + AUTOFILL_METADATA: 'autofill_metadata', +}; + +/** + * Builds a RegExp that matches one of the given words. Each word has to match + * at word boundary and is not at the end of the tested string. For example, + * the word "SIM" would match the string "I have a sim card issue" but not + * "I have a simple issue" nor "I have a sim" (because the user might not have + * finished typing yet). + */ +export function buildWordMatcher(words: string[]): RegExp { + return new RegExp( + words.map((word) => '\\b' + word + '\\b[^$]').join('|'), 'i'); +} + +/** + * Regular expression to check for all variants of blu[e]toot[h] with or + * without space between the words; for BT when used as an individual word, + * or as two individual characters, and for BLE, BlueZ, and Floss when used + * as an individual word. Case insensitive matching. + */ +export const btRegEx = new RegExp( + 'blu[e]?[ ]?toot[h]?|\\bb[ ]?t\\b|\\bble\\b|\\bfloss\\b|\\bbluez\\b', 'i'); + +/** + * Regular expression to check for all strings indicating that a user can't + * connect to a HID or Audio device. + * Sample strings this will match: + * "I can't connect the speaker!", + * "The keyboard has connection problem." + */ +const cantConnectRegEx = new RegExp( + '((headphone|keyboard|mouse|speaker)((?!(connect|pair)).*)(connect|pair))' + + '|((connect|pair).*(headphone|keyboard|mouse|speaker))', + 'i'); + +/** + * Regular expression to check for "tether", "tethering" or "hotspot". Case + * insensitive matching. + */ +const tetherRegEx = new RegExp('tether(ing)?|hotspot', 'i'); + +/** + * Regular expression to check for "Smart (Un)lock" or "Easy (Un)lock" with + * or without space between the words. Case insensitive matching. + */ +const smartLockRegEx = new RegExp('(smart|easy)[ ]?(un)?lock', 'i'); + +/** + * Regular expression to check for keywords related to Nearby Share like + * "nearby (share)" or "phone (hub)". + * Case insensitive matching. + */ +const nearbyShareRegEx = new RegExp('nearby|phone', 'i'); + +/** + * Regular expression to check for keywords related to Fast Pair like + * "fast pair". + * Case insensitive matching. + */ +const fastPairRegEx = new RegExp('fast[ ]?pair', 'i'); + +/** Regular expression to check for Bluetooth device specific keywords. */ +const btDeviceRegEx = + buildWordMatcher(['apple', 'allegro', 'pixelbud', 'microsoft', 'sony']); + +/** + * Regular expression to check for Phone Hub / Eche device specific keywords + * like "app stream" or "camera roll". + */ +const phoneHubRegEx = + new RegExp('app[ ]?stream(ing)?|phone|camera[ ]?roll', 'i'); + +/** Regular expression to check for wifi-related keywords. */ +const wifiRegEx = + new RegExp('\\b(wifi|wi\-fi|internet|network|hotspot)\\b', 'i'); + +/** + * @fileoverview + * 'feedback-flow' manages the navigation among the steps to be taken. + */ + +export class FeedbackFlowElement extends PolymerElement { + static get is() { + return 'feedback-flow' as const; + } + + static get template() { + return getTemplate(); + } + + static get properties() { + return { + currentState: {type: FeedbackFlowState}, + feedbackContext: {type: FeedbackContext, readonly: false, notify: true}, + }; + } + + /** The id of an element on the page that is currently shown. */ + protected currentState: FeedbackFlowState = FeedbackFlowState.SEARCH; + + /** The feedback context. */ + protected feedbackContext: FeedbackContext|null; + + /** Whether to show the bluetooth Logs checkbox in share data page. */ + shouldShowBluetoothCheckbox: boolean = false; + + /** Whether to show the Wifi debug Logs checkbox in share data page. */ + shouldShowWifiDebugLogsCheckbox = false; + + /** + * Whether to show the Link Cross Device Dogfood Feedback checkbox in share + * data page. + */ + shouldShowLinkCrossDeviceDogfoodFeedbackCheckbox = false; + + /** Whether to show the autofill checkbox in share data page. */ + protected shouldShowAutofillCheckbox = false; + + /** Whether to show the assistant checkbox in share data page. */ + shouldShowAssistantCheckbox = false; + + private feedbackServiceProvider: FeedbackServiceProviderInterface; + + /** + * The description entered by the user. It is set when the user clicks the + * next button on the search page. + */ + private description: string; + + /** + * The description template provided source application to help user write + * feedback. + */ + protected descriptionTemplate: string; + + /** + * The description placeholder text is used to give the user a hint on how + * to write the description. Some apps, such as the Camera app can use a + * custom placeholder. + */ + protected descriptionPlaceholderText: string; + + /** The status of sending report. */ + private sendReportStatus: SendReportStatus|null; + + /** Whether user clicks the help content or not. */ + private helpContentClicked = false; + + /** To avoid helpContentOutcome metric emit more than one time. */ + private helpContentOutcomeMetricEmitted = false; + + /** Number of results returned in each search. */ + private helpContentSearchResultCount: number; + + /** Whether there is no help content shown(offline or search is down). */ + private noHelpContentDisplayed: boolean; + + /** + * When the feedback tool is opened as a dialog, feedback context is passed + * to front end via dialog args. + */ + private dialogArgs: string; + + /** Whether the user has logged in (not on oobe or on the login screen). */ + private isUserLoggedIn: boolean; + + constructor() { + super(); + this.dialogArgs = chrome.getVariableValue('dialogArguments'); + this.feedbackServiceProvider = getFeedbackServiceProvider(); + } + + override connectedCallback() { + super.connectedCallback(); + if (loadTimeData.getBoolean('isJellyEnabledForOsFeedback')) { + // TODO(b/276493287): After the Jelly experiment is launched, replace + // `cros_styles.css` with `theme/colors.css` directly in `index.html`. + // Also add `theme/typography.css` to `index.html`. + document.querySelector('link[href*=\'cros_styles.css\']') + ?.setAttribute('href', 'chrome://theme/colors.css?sets=legacy,sys'); + const typographyLink = document.createElement('link'); + typographyLink.href = 'chrome://theme/typography.css'; + typographyLink.rel = 'stylesheet'; + document.head.appendChild(typographyLink); + document.body.classList.add('jelly-enabled'); + /** @suppress {checkTypes} */ + (function() { + ColorChangeUpdater.forDocument().start(); + })(); + } + } + + override ready() { + super.ready(); + if (this.dialogArgs && this.dialogArgs.length > 0) { + this.initializeForDialogMode(); + } else { + this.initializeForNonDialogMode(); + } + + window.addEventListener('message', event => { + if (event.data.id !== HELP_CONTENT_CLICKED) { + return; + } + if (event.origin !== OS_FEEDBACK_UNTRUSTED_ORIGIN) { + console.error('Unknown origin: ' + event.origin); + return; + } + this.helpContentClicked = true; + this.feedbackServiceProvider.recordPreSubmitAction( + FeedbackAppPreSubmitAction.kViewedHelpContent); + this.feedbackServiceProvider.recordHelpContentSearchResultCount( + this.helpContentSearchResultCount); + }); + + window.addEventListener('beforeunload', _event => { + switch (this.currentState) { + case FeedbackFlowState.SEARCH: + this.recordExitPath( + FeedbackAppExitPath.kQuitSearchPageHelpContentClicked, + FeedbackAppExitPath.kQuitSearchPageNoHelpContentClicked); + if (!this.helpContentOutcomeMetricEmitted) { + this.recordHelpContentOutcome( + SearchPageAction.QUIT, + FeedbackAppHelpContentOutcome.kQuitHelpContentClicked, + FeedbackAppHelpContentOutcome.kQuitNoHelpContentClicked); + this.helpContentOutcomeMetricEmitted = true; + } + break; + case FeedbackFlowState.SHARE_DATA: + this.recordExitPath( + FeedbackAppExitPath.kQuitShareDataPageHelpContentClicked, + FeedbackAppExitPath.kQuitShareDataPageNoHelpContentClicked); + break; + case FeedbackFlowState.CONFIRMATION: + this.recordExitPath( + FeedbackAppExitPath.kSuccessHelpContentClicked, + FeedbackAppExitPath.kSuccessNoHelpContentClicked); + break; + } + }); + + this.style.setProperty( + '--window-height', window.innerHeight.toString() + 'px'); + window.addEventListener('resize', (event) => { + this.style.setProperty( + '--window-height', window.innerHeight.toString() + 'px'); + let page = null; + switch (this.currentState) { + case FeedbackFlowState.SEARCH: + page = strictQuery('search-page', this.shadowRoot, SearchPageElement); + break; + case FeedbackFlowState.SHARE_DATA: + page = strictQuery( + 'share-data-page', this.shadowRoot, ShareDataPageElement); + break; + case FeedbackFlowState.CONFIRMATION: + page = strictQuery( + 'confirmation-page', this.shadowRoot, ConfirmationPageElement); + break; + default: + console.warn('unexpected state: ', this.currentState); + } + if (page) { + showScrollingEffects(event, page as HTMLElement); + } + }); + } + + /** TODO(http://b/issues/233080620): Add a type definition for feedbackInfo.*/ + private initializeForDialogMode() { + // This is on Dialog mode. The `dialogArgs` contains feedback context + // info. + const feedbackInfo = JSON.parse(this.dialogArgs); + assert(!!feedbackInfo); + this.feedbackContext = { + assistantDebugInfoAllowed: false, + fromSettingsSearch: feedbackInfo.fromSettingsSearch ?? false, + isInternalAccount: feedbackInfo.isInternalAccount ?? false, + wifiDebugLogsAllowed: false, + traceId: feedbackInfo.traceId ?? 0, + pageUrl: {url: feedbackInfo.pageUrl ?? ''}, + fromAssistant: feedbackInfo.fromAssistant ?? false, + fromAutofill: feedbackInfo.fromAutofill ?? false, + autofillMetadata: feedbackInfo.autofillMetadata ? + JSON.stringify(feedbackInfo.autofillMetadata) : + '{}', + hasLinkedCrossDevicePhone: + feedbackInfo.hasLinkedCrossDevicePhone ?? false, + categoryTag: feedbackInfo.categoryTag ?? '', + email: '', + extraDiagnostics: '', + }; + this.descriptionTemplate = feedbackInfo.description ?? ''; + this.descriptionPlaceholderText = feedbackInfo.descriptionPlaceholder ?? ''; + + if (feedbackInfo.systemInformation?.length == 1) { + // Currently, one extra diagnostics string may be passed to feedback + // app. + // + // Sample input: + //" systemInformation": [ + // { + // "key": "EXTRA_DIAGNOSTICS", + // "value": "extra log data" + // } + // ]. + assert('EXTRA_DIAGNOSTICS' === feedbackInfo.systemInformation[0].key); + this.feedbackContext!.extraDiagnostics = + feedbackInfo.systemInformation[0].value; + } + this.isUserLoggedIn = this.feedbackContext!.categoryTag !== 'Login'; + this.onFeedbackContextReceived(); + } + + + private initializeForNonDialogMode(): void { + this.feedbackServiceProvider.getFeedbackContext().then( + (response: {feedbackContext: FeedbackContext}) => { + this.feedbackContext = response.feedbackContext; + this.isUserLoggedIn = true; + this.setAdditionalContextFromQueryParams(); + this.onFeedbackContextReceived(); + }); + } + + private fetchScreenshot(): void { + const shareDataPage = + strictQuery('share-data-page', this.shadowRoot, ShareDataPageElement); + // Fetch screenshot if not fetched before. + if (!shareDataPage.screenshotUrl) { + this.feedbackServiceProvider.getScreenshotPng().then( + (response: {pngData: number[]}) => { + if (response.pngData.length > 0) { + const blob = new Blob( + [Uint8Array.from(response.pngData)], {type: 'image/png'}); + const imageUrl = URL.createObjectURL(blob); + shareDataPage.screenshotUrl = imageUrl; + } + }); + } + } + + private onFeedbackContextReceived(): void { + if (!this.feedbackContext) { + return; + } + this.shouldShowAssistantCheckbox = this.feedbackContext.isInternalAccount && + this.feedbackContext.fromAssistant; + this.shouldShowAutofillCheckbox = this.feedbackContext.fromAutofill; + } + /** + * Sets additional context passed from RequestFeedbackFlow as part of the URL. + * See `AdditionalContextQueryParam` for valid query parameters. + */ + private setAdditionalContextFromQueryParams(): void { + if (!this.feedbackContext) { + return; + } + + const params = new URLSearchParams(window.location.search); + const extraDiagnostics = + params.get(AdditionalContextQueryParam.EXTRA_DIAGNOSTICS); + this.feedbackContext.extraDiagnostics = + extraDiagnostics ? decodeURIComponent(extraDiagnostics) : ''; + const descriptionTemplate = + params.get(AdditionalContextQueryParam.DESCRIPTION_TEMPLATE); + this.descriptionTemplate = + descriptionTemplate && descriptionTemplate.length > 0 ? + decodeURIComponent(descriptionTemplate) : + ''; + const descriptionPlaceholderText = + params.get(AdditionalContextQueryParam.DESCRIPTION_PLACEHOLDER_TEXT); + this.descriptionPlaceholderText = + descriptionPlaceholderText && descriptionPlaceholderText.length > 0 ? + decodeURIComponent(descriptionPlaceholderText) : + ''; + const categoryTag = params.get(AdditionalContextQueryParam.CATEGORY_TAG); + this.feedbackContext.categoryTag = + categoryTag ? decodeURIComponent(categoryTag) : ''; + const pageUrl = params.get(AdditionalContextQueryParam.PAGE_URL); + if (pageUrl) { + this.set('feedbackContext.pageUrl', {url: pageUrl}); + } + const fromAssistant = + params.get(AdditionalContextQueryParam.FROM_ASSISTANT); + this.feedbackContext.fromAssistant = !!fromAssistant; + const fromSettingsSearch = + params.get(AdditionalContextQueryParam.FROM_SETTINGS_SEARCH); + this.set('feedbackContext.fromSettingsSearch', !!fromSettingsSearch); + + const fromAutofill = params.get(AdditionalContextQueryParam.FROM_AUTOFILL); + this.feedbackContext.fromAutofill = !!fromAutofill; + const autofillMetadata = + params.get(AdditionalContextQueryParam.AUTOFILL_METADATA); + if (autofillMetadata) { + this.feedbackContext.autofillMetadata = autofillMetadata; + } + } + + protected handleContinueClick(event: Event): void { + const customEvent = event as FeedbackFlowButtonClickEvent; + switch (customEvent.detail.currentState) { + case FeedbackFlowState.SEARCH: + this.currentState = FeedbackFlowState.SHARE_DATA; + this.description = customEvent.detail.description ?? ''; + this.shouldShowBluetoothCheckbox = this.feedbackContext !== null && + this.feedbackContext.isInternalAccount && + this.isDescriptionRelatedToBluetooth(this.description); + this.shouldShowWifiDebugLogsCheckbox = + this.computeShouldShowWifiDebugLogsCheckbox(); + this.shouldShowLinkCrossDeviceDogfoodFeedbackCheckbox = + this.feedbackContext !== null && + loadTimeData.getBoolean( + 'enableLinkCrossDeviceDogfoodFeedbackFlag') && + this.feedbackContext.isInternalAccount && + this.feedbackContext.hasLinkedCrossDevicePhone && + this.isDescriptionRelatedToCrossDevice(this.description); + this.fetchScreenshot(); + const shareDataPage = strictQuery( + 'share-data-page', this.shadowRoot, ShareDataPageElement); + shareDataPage.focusScreenshotCheckbox(); + showScrollingEffectOnStart(shareDataPage); + + if (!this.helpContentOutcomeMetricEmitted) { + this.recordHelpContentOutcome( + SearchPageAction.CONTINUE, + FeedbackAppHelpContentOutcome.kContinueHelpContentClicked, + FeedbackAppHelpContentOutcome.kContinueNoHelpContentClicked); + this.helpContentOutcomeMetricEmitted = true; + } + break; + case FeedbackFlowState.SHARE_DATA: + const report = customEvent.detail.report as Report; + report.description = stringToMojoString16(this.description); + + // TODO(xiangdongkong): Show a spinner or the like for sendReport could + // take a while. + this.feedbackServiceProvider.sendReport(report).then( + (response: {status: SendReportStatus}) => { + this.currentState = FeedbackFlowState.CONFIRMATION; + this.sendReportStatus = response.status; + const confirmationPage = strictQuery( + 'confirmation-page', this.shadowRoot, + ConfirmationPageElement); + confirmationPage.focusPageTitle(); + showScrollingEffectOnStart(confirmationPage); + }); + break; + default: + console.warn('unexpected state: ', customEvent.detail.currentState); + } + } + + protected handleGoBackClick(event: Event): void { + const customEvent = event as FeedbackFlowButtonClickEvent; + switch (customEvent.detail.currentState) { + case FeedbackFlowState.SHARE_DATA: + this.navigateToSearchPage(); + break; + case FeedbackFlowState.CONFIRMATION: + // Remove the text from previous search. + const searchPage = + strictQuery('search-page', this.shadowRoot, SearchPageElement); + searchPage.setDescription(/*text=*/ ''); + showScrollingEffectOnStart(searchPage); + + // Re-enable the send button in share data page. + const shareDataPage = strictQuery( + 'share-data-page', this.shadowRoot, ShareDataPageElement); + shareDataPage.reEnableSendReportButton(); + + // Re-enable helpContentOutcomeMetric to be emitted in search page. + this.helpContentOutcomeMetricEmitted = false; + + this.navigateToSearchPage(); + break; + default: + console.warn('unexpected state: ', customEvent.detail.currentState); + } + } + + private computeShouldShowWifiDebugLogsCheckbox(): boolean { + return this.feedbackContext !== null && + this.feedbackContext.isInternalAccount && + this.feedbackContext.wifiDebugLogsAllowed && + wifiRegEx.test(this.description); + } + + private navigateToSearchPage(): void { + this.currentState = FeedbackFlowState.SEARCH; + const searchPage = + strictQuery('search-page', this.shadowRoot, SearchPageElement); + searchPage.focusInputElement(); + showScrollingEffectOnStart(searchPage); + } + + private recordHelpContentOutcome( + action: SearchPageAction, + outcomeHelpContentClicked: FeedbackAppHelpContentOutcome, + outcomeNoHelpContentClicked: FeedbackAppHelpContentOutcome): void { + if (this.noHelpContentDisplayed) { + action == SearchPageAction.CONTINUE ? + this.feedbackServiceProvider.recordHelpContentOutcome( + FeedbackAppHelpContentOutcome.kContinueNoHelpContentDisplayed) : + this.feedbackServiceProvider.recordHelpContentOutcome( + FeedbackAppHelpContentOutcome.kQuitNoHelpContentDisplayed); + return; + } + + this.helpContentClicked ? + this.feedbackServiceProvider.recordHelpContentOutcome( + outcomeHelpContentClicked) : + this.feedbackServiceProvider.recordHelpContentOutcome( + outcomeNoHelpContentClicked); + } + + private recordExitPath( + pathHelpContentClicked: FeedbackAppExitPath, + pathNoHelpContentClicked: FeedbackAppExitPath) { + if (this.noHelpContentDisplayed) { + this.feedbackServiceProvider.recordExitPath( + FeedbackAppExitPath.kQuitNoHelpContentDisplayed); + return; + } + this.helpContentClicked ? + this.feedbackServiceProvider.recordExitPath(pathHelpContentClicked) : + this.feedbackServiceProvider.recordExitPath(pathNoHelpContentClicked); + } + + + setCurrentStateForTesting(newState: FeedbackFlowState) { + this.currentState = newState; + } + + setSendReportStatusForTesting(status: SendReportStatus) { + this.sendReportStatus = status; + } + + setDescriptionForTesting(text: string) { + this.description = text; + } + + setHelpContentClickedForTesting(helpContentClicked: boolean) { + this.helpContentClicked = helpContentClicked; + } + + setNoHelpContentDisplayedForTesting(noHelpContentDisplayed: boolean) { + this.noHelpContentDisplayed = noHelpContentDisplayed; + } + + getDescriptionTemplateForTesting(): string|null { + return this.descriptionTemplate; + } + + getDescriptionPlaceholderTextForTesting(): string|null { + return this.descriptionPlaceholderText; + } + + + getIsUserLoggedInForTesting(): boolean { + return this.isUserLoggedIn; + } + + + getShouldShowWifiDebugLogsCheckboxForTesting(): boolean { + return this.shouldShowWifiDebugLogsCheckbox; + } + + /** + * Checks if any keywords related to bluetooth have been typed. If they are, + * we show the bluetooth logs option, otherwise hide it. + */ + protected isDescriptionRelatedToBluetooth(textInput: string): boolean { + /** + * If the user is not signed in with a internal google account, the + * bluetooth checkbox should be hidden and skip the relative check. + */ + const isRelatedToBluetooth = btRegEx.test(textInput) || + cantConnectRegEx.test(textInput) || + this.isDescriptionRelatedToCrossDevice(textInput) || + fastPairRegEx.test(textInput) || btDeviceRegEx.test(textInput); + return isRelatedToBluetooth; + } + + /** + * If the user is not signed in with a internal google account, the Cross + * Device checkbox should be hidden and skip the relative check. + * + * Checks if any keywords related to Cross Device have been typed. If they + * are, we show the cross device checkbox, otherwise hide it. + */ + protected isDescriptionRelatedToCrossDevice(textInput: string): boolean { + const isRelatedToCrossDevice = phoneHubRegEx.test(textInput) || + tetherRegEx.test(textInput) || smartLockRegEx.test(textInput) || + nearbyShareRegEx.test(textInput); + return isRelatedToCrossDevice; + } +} + +declare global { + interface HTMLElementTagNameMap { + [FeedbackFlowElement.is]: FeedbackFlowElement; + } +} + +customElements.define(FeedbackFlowElement.is, FeedbackFlowElement);
diff --git a/ash/webui/personalization_app/resources/BUILD.gn b/ash/webui/personalization_app/resources/BUILD.gn index b47d248..04a6f1ec 100644 --- a/ash/webui/personalization_app/resources/BUILD.gn +++ b/ash/webui/personalization_app/resources/BUILD.gn
@@ -40,6 +40,7 @@ "images/no_google_photos_images.svg", "images/no_google_photos_images_dark.svg", "images/slideshow.png", + "images/sea_pen_tile.svg", "css/base.css", ]
diff --git a/ash/webui/personalization_app/resources/images/sea_pen_tile.svg b/ash/webui/personalization_app/resources/images/sea_pen_tile.svg new file mode 100644 index 0000000..c926602 --- /dev/null +++ b/ash/webui/personalization_app/resources/images/sea_pen_tile.svg
@@ -0,0 +1,2 @@ + <!-- TODO(b/299359804): Replace with the real image. --> +<svg xmlns="http://www.w3.org/2000/svg" height="192" width="192">
diff --git a/ash/webui/personalization_app/resources/js/wallpaper/wallpaper_collections_element.ts b/ash/webui/personalization_app/resources/js/wallpaper/wallpaper_collections_element.ts index 7db1df1..7701d754e 100644 --- a/ash/webui/personalization_app/resources/js/wallpaper/wallpaper_collections_element.ts +++ b/ash/webui/personalization_app/resources/js/wallpaper/wallpaper_collections_element.ts
@@ -224,8 +224,7 @@ id: kSeaPenId, name: 'Sea Pen', type: TileType.SEA_PEN, - // TODO(b/299359804): Replace with the real preview. - preview: [{url: 'chrome://personalization/images/google_photos.svg'}], + preview: [{url: 'chrome://personalization/images/sea_pen_tile.svg'}], }; }
diff --git a/ash/webui/shortcut_customization_ui/resources/js/shortcut_utils.ts b/ash/webui/shortcut_customization_ui/resources/js/shortcut_utils.ts index 224f509..02f961e 100644 --- a/ash/webui/shortcut_customization_ui/resources/js/shortcut_utils.ts +++ b/ash/webui/shortcut_customization_ui/resources/js/shortcut_utils.ts
@@ -402,6 +402,27 @@ }; /** + * Translate an unidentified key to a display string. + */ +export const getUnidentifiedKeyDisplay = (e: KeyboardEvent): string => { + if (e.code === 'Backquote') { + // Backquote `key` will become 'unidentified' when ctrl + // is pressed. + if (e.ctrlKey) { + return unidentifiedKeyCodeToKey[e.keyCode]; + } + return e.key; + } + if (e.code === '') { + // If there is no `code`, check the `key`. If the `key` is + // `unidentified`, we need to manually lookup the key. + return unidentifiedKeyCodeToKey[e.keyCode] || e.key; + } + + return `Unidentified ${e.keyCode}`; +}; + +/** * @returns the Aria label for the standard accelerators. */ export const getAriaLabelForStandardAccelerators = @@ -472,6 +493,10 @@ if (e.code.startsWith('Numpad')) { return getNumpadKeyDisplay(e.code); } + // Handle unidentified keys: + if (e.key === 'Unidentified' || e.code === '') { + return getUnidentifiedKeyDisplay(e); + } switch (e.code) { case 'Space': // Space key: e.key: ' ', e.code: 'Space', set keyDisplay @@ -482,17 +507,6 @@ // 'LaunchApplication1' and will display as // 'overview' icon. return 'LaunchApplication1'; - case 'Backquote': - // Backquote `key` will become 'unidentified' when ctrl - // is pressed. - if (e.ctrlKey && e.key === 'Unidentified') { - return unidentifiedKeyCodeToKey[e.keyCode]; - } - return e.key; - case '': - // If there is no `code`, check the `key`. If the `key` is - // `unidentified`, we need to manually lookup the key. - return unidentifiedKeyCodeToKey[e.keyCode] || e.key; default: // All other keys: Use the original e.key as keyDisplay. return e.key; }
diff --git a/ash/wm/base_state.cc b/ash/wm/base_state.cc index f538cf29..c150fdf 100644 --- a/ash/wm/base_state.cc +++ b/ash/wm/base_state.cc
@@ -12,7 +12,6 @@ #include "ash/wm/overview/overview_controller.h" #include "ash/wm/splitview/split_view_controller.h" #include "ash/wm/splitview/split_view_utils.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_positioning_utils.h" #include "ash/wm/window_util.h" #include "ash/wm/wm_metrics.h" @@ -20,6 +19,7 @@ #include "ui/aura/client/aura_constants.h" #include "ui/aura/window.h" #include "ui/compositor/layer.h" +#include "ui/display/screen.h" namespace ash { @@ -107,8 +107,8 @@ // static void BaseState::CycleSnap(WindowState* window_state, WMEventType event) { auto* shell = Shell::Get(); - // For tablet mode, use |TabletModeWindowState::CycleTabletSnap|. - DCHECK(!shell->tablet_mode_controller()->InTabletMode()); + // For tablet mode, use `TabletModeWindowState::CycleTabletSnap`. + DCHECK(!display::Screen::GetScreen()->InTabletMode()); WindowStateType desired_snap_state = event == WM_EVENT_CYCLE_SNAP_PRIMARY ? WindowStateType::kPrimarySnapped
diff --git a/ash/wm/client_controlled_state.cc b/ash/wm/client_controlled_state.cc index 7433239..547f7ee 100644 --- a/ash/wm/client_controlled_state.cc +++ b/ash/wm/client_controlled_state.cc
@@ -11,7 +11,6 @@ #include "ash/wm/pip/pip_positioner.h" #include "ash/wm/screen_pinning_controller.h" #include "ash/wm/splitview/split_view_controller.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_positioning_utils.h" #include "ash/wm/window_state.h" #include "ash/wm/window_state_delegate.h" @@ -129,7 +128,7 @@ bounds, window_state->GetDisplay().id()); } else if (window_state->IsFloated()) { const gfx::Rect bounds = - Shell::Get()->tablet_mode_controller()->InTabletMode() + display::Screen::GetScreen()->InTabletMode() ? FloatController::GetFloatWindowTabletBounds( window_state->window()) : FloatController::GetFloatWindowClamshellBounds( @@ -280,7 +279,7 @@ // the window. auto* const float_controller = Shell::Get()->float_controller(); if (next_state_type == WindowStateType::kFloated) { - if (Shell::Get()->tablet_mode_controller()->InTabletMode()) { + if (display::Screen::GetScreen()->InTabletMode()) { float_controller->FloatForTablet(window, previous_state_type); } else { float_controller->FloatImpl(window); @@ -316,9 +315,10 @@ const WindowStateType next = GetStateForTransitionEvent(window_state, event); - if (Shell::Get()->tablet_mode_controller()->InTabletMode() && - next == WindowStateType::kNormal && window_state->CanMaximize()) + if (display::Screen::GetScreen()->InTabletMode() && + next == WindowStateType::kNormal && window_state->CanMaximize()) { return WindowStateType::kMaximized; + } return next; } @@ -379,7 +379,7 @@ } else if (next_state_type == WindowStateType::kFloated) { if (chromeos::wm::CanFloatWindow(window)) { const gfx::Rect bounds = - Shell::Get()->tablet_mode_controller()->InTabletMode() + display::Screen::GetScreen()->InTabletMode() ? FloatController::GetFloatWindowTabletBounds(window) : FloatController::GetFloatWindowClamshellBounds( window, event_type == WM_EVENT_FLOAT
diff --git a/ash/wm/client_controlled_state_unittest.cc b/ash/wm/client_controlled_state_unittest.cc index 6d620b8..47d5f9d 100644 --- a/ash/wm/client_controlled_state_unittest.cc +++ b/ash/wm/client_controlled_state_unittest.cc
@@ -39,6 +39,7 @@ #include "chromeos/ui/wm/window_util.h" #include "ui/aura/client/aura_constants.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" +#include "ui/display/screen.h" #include "ui/events/test/event_generator.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/point_conversions.h" @@ -820,7 +821,7 @@ TEST_F(ClientControlledStateTest, WmEventNormalIsResolvedToMaximizeInTabletMode) { Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true); - ASSERT_EQ(true, Shell::Get()->tablet_mode_controller()->InTabletMode()); + ASSERT_TRUE(display::Screen::GetScreen()->InTabletMode()); window_state()->window()->SetProperty( aura::client::kResizeBehaviorKey, aura::client::kResizeBehaviorCanMaximize); @@ -912,7 +913,7 @@ // Enter tablet mode Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true); - ASSERT_EQ(true, Shell::Get()->tablet_mode_controller()->InTabletMode()); + ASSERT_TRUE(display::Screen::GetScreen()->InTabletMode()); // Float window. const WindowFloatWMEvent float_event( @@ -965,7 +966,7 @@ // Enter tablet mode Shell::Get()->tablet_mode_controller()->SetEnabledForTest(true); - ASSERT_TRUE(Shell::Get()->tablet_mode_controller()->InTabletMode()); + ASSERT_TRUE(display::Screen::GetScreen()->InTabletMode()); // Float window. const WindowFloatWMEvent float_event(
diff --git a/ash/wm/desks/cros_next_desk_icon_button.cc b/ash/wm/desks/cros_next_desk_icon_button.cc index 981164f..4bf00e6 100644 --- a/ash/wm/desks/cros_next_desk_icon_button.cc +++ b/ash/wm/desks/cros_next_desk_icon_button.cc
@@ -11,7 +11,6 @@ #include "ash/wm/desks/desk_mini_view.h" #include "ash/wm/desks/desk_preview_view.h" #include "ash/wm/desks/desks_controller.h" -#include "ash/wm/desks/zero_state_button.h" #include "ash/wm/overview/overview_constants.h" #include "base/check_op.h" #include "ui/base/metadata/metadata_impl_macros.h"
diff --git a/ash/wm/desks/desk_bar_controller.cc b/ash/wm/desks/desk_bar_controller.cc index eaad129..13dd2bf 100644 --- a/ash/wm/desks/desk_bar_controller.cc +++ b/ash/wm/desks/desk_bar_controller.cc
@@ -22,7 +22,6 @@ #include "ash/wm/desks/desks_controller.h" #include "ash/wm/overview/overview_controller.h" #include "ash/wm/overview/overview_utils.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "base/auto_reset.h" #include "base/check.h" #include "base/containers/contains.h" @@ -30,6 +29,7 @@ #include "base/task/single_thread_task_runner.h" #include "ui/compositor/layer.h" #include "ui/compositor/presentation_time_recorder.h" +#include "ui/display/tablet_state.h" #include "ui/events/event.h" #include "ui/events/types/event_type.h" #include "ui/gfx/geometry/point.h" @@ -140,7 +140,6 @@ DeskBarController::DeskBarController() { Shell::Get()->overview_controller()->AddObserver(this); - Shell::Get()->tablet_mode_controller()->AddObserver(this); DesksController::Get()->AddObserver(this); Shell::Get()->activation_client()->AddObserver(this); // TODO(b/301274861): DeskBarController should only be doing pre-target @@ -155,7 +154,6 @@ Shell::Get()->RemovePreTargetHandler(this); Shell::Get()->activation_client()->RemoveObserver(this); DesksController::Get()->RemoveObserver(this); - Shell::Get()->tablet_mode_controller()->RemoveObserver(this); Shell::Get()->overview_controller()->RemoveObserver(this); } @@ -327,7 +325,12 @@ desk_bars_.clear(); } -void DeskBarController::OnTabletModeStarting() { +void DeskBarController::OnDisplayTabletStateChanged( + display::TabletState state) { + if (state != display::TabletState::kEnteringTabletMode) { + return; + } + CloseAllDeskBars(); }
diff --git a/ash/wm/desks/desk_bar_controller.h b/ash/wm/desks/desk_bar_controller.h index 63e505d..be64264 100644 --- a/ash/wm/desks/desk_bar_controller.h +++ b/ash/wm/desks/desk_bar_controller.h
@@ -9,7 +9,6 @@ #include <vector> #include "ash/ash_export.h" -#include "ash/public/cpp/tablet_mode_observer.h" #include "ash/shell_observer.h" #include "ash/wm/desks/desk_bar_view_base.h" #include "ash/wm/desks/desk_button/desk_button.h" @@ -25,6 +24,10 @@ class Window; } // namespace aura +namespace display { +enum class TabletState; +} // namespace display + namespace ash { // Controller for the desk bars that is responsible for creating, destroying, @@ -35,7 +38,6 @@ public ui::EventHandler, public OverviewObserver, public ShellObserver, - public TabletModeObserver, public wm::ActivationChangeObserver, public display::DisplayObserver { public: @@ -86,9 +88,6 @@ // ShellObserver: void OnShellDestroying() override; - // TabletModeObserver: - void OnTabletModeStarting() override; - // wm::ActivationChangeObserver: void OnWindowActivated(ActivationReason reason, aura::Window* gained_active, @@ -97,6 +96,7 @@ // display::DisplayObserver: void OnDisplayMetricsChanged(const display::Display& display, uint32_t changed_metrics) override; + void OnDisplayTabletStateChanged(display::TabletState state) override; // Returns desk bar view in `root`. If there is no such desk bar, nullptr is // returned.
diff --git a/ash/wm/desks/desk_bar_view_base.cc b/ash/wm/desks/desk_bar_view_base.cc index 40f3cefa..5490d21 100644 --- a/ash/wm/desks/desk_bar_view_base.cc +++ b/ash/wm/desks/desk_bar_view_base.cc
@@ -47,6 +47,7 @@ #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/compositor/layer.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" +#include "ui/display/screen.h" #include "ui/events/devices/device_data_manager.h" #include "ui/events/devices/haptic_touchpad_effects.h" #include "ui/events/event_observer.h" @@ -860,7 +861,7 @@ // If we're in tablet mode and there are no external keyboards, open up the // virtual keyboard. - if (Shell::Get()->tablet_mode_controller()->InTabletMode() && + if (display::Screen::GetScreen()->InTabletMode() && !HasExternalKeyboard()) { keyboard::KeyboardUIController::Get()->ShowKeyboard(/*lock=*/false); } @@ -974,7 +975,7 @@ // Only update visibility when needed. This will save a lot of repeated work. if (library_ui_visibility_ == LibraryUiVisibility::kToBeChecked) { if (!saved_desk_util::IsSavedDesksEnabled() || - Shell::Get()->tablet_mode_controller()->InTabletMode()) { + display::Screen::GetScreen()->InTabletMode()) { library_ui_visibility_ = LibraryUiVisibility::kHidden; } else { auto* desk_model = Shell::Get()->saved_desk_delegate()->GetDeskModel();
diff --git a/ash/wm/desks/desk_bar_view_base.h b/ash/wm/desks/desk_bar_view_base.h index 40a91405..adc71e3c 100644 --- a/ash/wm/desks/desk_bar_view_base.h +++ b/ash/wm/desks/desk_bar_view_base.h
@@ -13,9 +13,7 @@ #include "ash/wm/desks/desk_drag_proxy.h" #include "ash/wm/desks/desk_mini_view.h" #include "ash/wm/desks/desks_controller.h" -#include "ash/wm/desks/expanded_desks_bar_button.h" #include "ash/wm/desks/scroll_arrow_button.h" -#include "ash/wm/desks/zero_state_button.h" #include "ash/wm/overview/overview_grid.h" #include "base/memory/raw_ptr.h" #include "ui/base/metadata/metadata_header_macros.h"
diff --git a/ash/wm/desks/desk_button/desk_button.cc b/ash/wm/desks/desk_button/desk_button.cc index 120c85ba..04c5fd2 100644 --- a/ash/wm/desks/desk_button/desk_button.cc +++ b/ash/wm/desks/desk_button/desk_button.cc
@@ -5,6 +5,7 @@ #include "ash/wm/desks/desk_button/desk_button.h" #include <string> +#include <utility> #include "ash/resources/vector_icons/vector_icons.h" #include "ash/screen_util.h" @@ -44,7 +45,7 @@ //////////////////////////////////////////////////////////////////////////////// // DeskSwitchButton: DeskSwitchButton::DeskSwitchButton(PressedCallback callback) - : ImageButton(callback) { + : ImageButton(std::move(callback)) { SetPaintToLayer(); layer()->SetFillsBoundsOpaquely(false); SetSize(
diff --git a/ash/wm/desks/desk_button_base.cc b/ash/wm/desks/desk_button_base.cc deleted file mode 100644 index 1a1275b1..0000000 --- a/ash/wm/desks/desk_button_base.cc +++ /dev/null
@@ -1,158 +0,0 @@ -// Copyright 2022 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ash/wm/desks/desk_button_base.h" - -#include "ash/style/ash_color_provider.h" -#include "ash/style/color_util.h" -#include "ash/style/style_util.h" -#include "ash/wm/desks/desk_bar_view_base.h" -#include "ash/wm/overview/overview_utils.h" -#include "ui/compositor/layer.h" -#include "ui/gfx/canvas.h" -#include "ui/gfx/text_constants.h" -#include "ui/views/border.h" -#include "ui/views/controls/focus_ring.h" -#include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/view.h" -#include "ui/views/view_utils.h" - -namespace ash { - -constexpr int kFocusRingRadius = 8; - -DeskButtonBase::DeskButtonBase(const std::u16string& text, - bool set_text, - DeskBarViewBase* bar_view, - base::RepeatingClosure pressed_callback, - int corner_radius) - : LabelButton(pressed_callback, std::u16string()), - bar_view_(bar_view), - corner_radius_(corner_radius), - pressed_callback_(pressed_callback) { - DCHECK(!text.empty()); - if (set_text) - SetText(text); - SetPaintToLayer(); - layer()->SetFillsBoundsOpaquely(false); - SetHorizontalAlignment(gfx::ALIGN_CENTER); - - // Do not show highlight on hover and focus. Since the button will be painted - // with a background, see `should_paint_background_` for more details. - StyleUtil::SetUpInkDropForButton(this, gfx::Insets(), - /*highlight_on_hover=*/false, - /*highlight_on_focus=*/false); - SetFocusPainter(nullptr); - SetFocusBehavior(views::View::FocusBehavior::ALWAYS); - - SetAccessibleName(text); - SetTooltipText(text); - - // Create an empty border, otherwise in `LabelButton` a default border with - // non-empty insets will be created. - SetBorder(views::CreateEmptyBorder(gfx::Insets())); - - views::InstallRoundRectHighlightPathGenerator(this, gfx::Insets(), - kFocusRingRadius); - views::FocusRing* focus_ring = views::FocusRing::Get(this); - focus_ring->SetOutsetFocusRingDisabled(true); - focus_ring->SetColorId(ui::kColorAshFocusRing); - if (bar_view_->type() == DeskBarViewBase::Type::kOverview) { - focus_ring->SetHasFocusPredicate( - base::BindRepeating([](const views::View* view) { - const auto* v = views::AsViewClass<DeskButtonBase>(view); - CHECK(v); - return v->is_focused(); - })); - } -} - -DeskButtonBase::~DeskButtonBase() = default; - -void DeskButtonBase::OnFocus() { - if (bar_view_->type() == DeskBarViewBase::Type::kOverview) { - MoveFocusToView(this); - } - - UpdateFocusState(); - View::OnFocus(); -} - -void DeskButtonBase::OnBlur() { - UpdateFocusState(); - View::OnBlur(); -} - -void DeskButtonBase::OnPaintBackground(gfx::Canvas* canvas) { - if (should_paint_background_) { - cc::PaintFlags flags; - flags.setAntiAlias(true); - flags.setStyle(cc::PaintFlags::kFill_Style); - flags.setColor(background_color_); - canvas->DrawRoundRect(gfx::RectF(GetLocalBounds()), corner_radius_, flags); - } -} - -void DeskButtonBase::OnThemeChanged() { - LabelButton::OnThemeChanged(); - background_color_ = AshColorProvider::Get()->GetControlsLayerColor( - AshColorProvider::ControlsLayerType::kControlBackgroundColorInactive); - StyleUtil::ConfigureInkDropAttributes(this, StyleUtil::kBaseColor); - UpdateFocusState(); - SchedulePaint(); -} - -views::View* DeskButtonBase::GetView() { - return this; -} - -void DeskButtonBase::MaybeActivateFocusedView() { - pressed_callback_.Run(); -} - -void DeskButtonBase::MaybeCloseFocusedView(bool primary_action) {} - -void DeskButtonBase::MaybeSwapFocusedView(bool right) {} - -void DeskButtonBase::OnFocusableViewFocused() { - UpdateFocusState(); - - views::View* view = this; - while (view->parent()) { - if (view->parent() == bar_view_->scroll_view_contents()) { - bar_view_->ScrollToShowViewIfNecessary(view); - break; - } - view = view->parent(); - } -} - -void DeskButtonBase::OnFocusableViewBlurred() { - UpdateFocusState(); -} - -void DeskButtonBase::SetShouldPaintBackground(bool should_paint_background) { - if (should_paint_background_ == should_paint_background) - return; - - should_paint_background_ = should_paint_background; - SchedulePaint(); -} - -void DeskButtonBase::UpdateFocusState() { - views::FocusRing::Get(this)->SchedulePaint(); -} - -void DeskButtonBase::UpdateBackgroundColor() { - const auto* color_provider = AshColorProvider::Get(); - background_color_ = color_provider->GetControlsLayerColor( - AshColorProvider::ControlsLayerType::kControlBackgroundColorInactive); - if (!GetEnabled()) - background_color_ = ColorUtil::GetDisabledColor(background_color_); -} - -BEGIN_METADATA(DeskButtonBase, views::LabelButton) -END_METADATA - -} // namespace ash
diff --git a/ash/wm/desks/desk_button_base.h b/ash/wm/desks/desk_button_base.h deleted file mode 100644 index fe10082..0000000 --- a/ash/wm/desks/desk_button_base.h +++ /dev/null
@@ -1,91 +0,0 @@ -// Copyright 2022 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef ASH_WM_DESKS_DESK_BUTTON_BASE_H_ -#define ASH_WM_DESKS_DESK_BUTTON_BASE_H_ - -#include "ash/ash_export.h" -#include "ash/wm/overview/overview_focusable_view.h" -#include "base/functional/callback_forward.h" -#include "base/memory/raw_ptr.h" -#include "ui/base/metadata/metadata_impl_macros.h" -#include "ui/views/controls/button/label_button.h" - -namespace ash { - -class DeskBarViewBase; - -// The base class of buttons that appear in the desk bar view classes. It's -// guaranteed this button always lives under a desk bar view. -class ASH_EXPORT DeskButtonBase : public views::LabelButton, - public OverviewFocusableView { - public: - METADATA_HEADER(DeskButtonBase); - - // This button will include either text or image. Set `text` only if - // `set_text` is true, otherwise, the given `text` will only be used for the - // tooltip, accessible name etc. If the text is empty, an image will be - // assigned to the button instead. This button is under `bar_view` in the view - // hierarchy. - DeskButtonBase(const std::u16string& text, - bool set_text, - DeskBarViewBase* bar_view, - base::RepeatingClosure pressed_callback, - int corner_radius); - ~DeskButtonBase() override; - - // views::View: - void OnFocus() override; - void OnBlur() override; - - // views::LabelButton: - void OnPaintBackground(gfx::Canvas* canvas) override; - void OnThemeChanged() override; - - // OverviewFocusableView: - views::View* GetView() override; - void MaybeActivateFocusedView() override; - void MaybeCloseFocusedView(bool primary_action) override; - void MaybeSwapFocusedView(bool right) override; - void OnFocusableViewFocused() override; - void OnFocusableViewBlurred() override; - - // Updates the label's text of the button. E.g, ZeroStateDefaultDeskButton - // showing the desk's name, which should be updated on desk name changes. - virtual void UpdateLabelText() {} - - // Sets `should_paint_background_` and repaints the button so that the button - // may or may not have the background. - void SetShouldPaintBackground(bool should_paint_background); - - SkColor GetBackgroundColorForTest() { return background_color_; } - - protected: - virtual void UpdateFocusState(); - - // views::LabelButton: - void UpdateBackgroundColor() override; - - protected: - // The desk bar view instance above this button in the view hierarchy. - raw_ptr<DeskBarViewBase, ExperimentalAsh> bar_view_; - - private: - friend class DesksTestApi; - - // If true, paints a background of the button with `background_color_`. The - // button is painted with the background by default, exception like - // ZeroStateIconButton only wants to be painted when the mouse hovers. - bool should_paint_background_ = true; - - SkColor background_color_; - - const int corner_radius_; - - base::RepeatingClosure pressed_callback_; -}; - -} // namespace ash - -#endif // ASH_WM_DESKS_DESK_BUTTON_BASE_H_
diff --git a/ash/wm/desks/desk_mini_view.cc b/ash/wm/desks/desk_mini_view.cc index f72cdf5..7c7a994 100644 --- a/ash/wm/desks/desk_mini_view.cc +++ b/ash/wm/desks/desk_mini_view.cc
@@ -45,6 +45,7 @@ #include "ui/chromeos/styles/cros_tokens_color_mappings.h" #include "ui/color/color_id.h" #include "ui/compositor/layer.h" +#include "ui/display/screen.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/size.h" @@ -315,7 +316,7 @@ // the desk. const bool old_force_show_desk_buttons = force_show_desk_buttons_; force_show_desk_buttons_ = - !Shell::Get()->tablet_mode_controller()->InTabletMode() && + !display::Screen::GetScreen()->InTabletMode() && ((is_long_gesture && IsPointOnMiniView(screen_rect.CenterPoint())) || (!is_long_gesture && desk_action_view_->GetVisible() && desk_action_view_->HitTestRect(
diff --git a/ash/wm/desks/desk_mini_view_animations.cc b/ash/wm/desks/desk_mini_view_animations.cc index ae2ed4d7..aa8b1501 100644 --- a/ash/wm/desks/desk_mini_view_animations.cc +++ b/ash/wm/desks/desk_mini_view_animations.cc
@@ -13,7 +13,6 @@ #include "ash/wm/desks/desk_mini_view.h" #include "ash/wm/desks/desk_preview_view.h" #include "ash/wm/desks/desks_constants.h" -#include "ash/wm/desks/expanded_desks_bar_button.h" #include "ash/wm/overview/cleanup_animation_observer.h" #include "ash/wm/overview/overview_controller.h" #include "ash/wm/overview/overview_grid.h"
diff --git a/ash/wm/desks/desks_controller.cc b/ash/wm/desks/desks_controller.cc index c58c1ea0..d49e03a 100644 --- a/ash/wm/desks/desks_controller.cc +++ b/ash/wm/desks/desks_controller.cc
@@ -40,7 +40,6 @@ #include "ash/wm/splitview/split_view_controller.h" #include "ash/wm/splitview/split_view_utils.h" #include "ash/wm/switchable_windows.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_cycle/window_cycle_controller.h" #include "ash/wm/window_properties.h" #include "ash/wm/window_restore/window_restore_controller.h" @@ -71,6 +70,7 @@ #include "ui/aura/client/aura_constants.h" #include "ui/aura/window_tracker.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/display/screen.h" #include "ui/events/devices/haptic_touchpad_effects.h" #include "ui/views/widget/native_widget_private.h" #include "ui/wm/core/window_animations.h" @@ -237,11 +237,11 @@ bool IsApplistActiveInTabletMode(const aura::Window* active_window) { DCHECK(active_window); - Shell* shell = Shell::Get(); - if (!shell->tablet_mode_controller()->InTabletMode()) + if (!display::Screen::GetScreen()->InTabletMode()) { return false; + } - auto* app_list_controller = shell->app_list_controller(); + auto* app_list_controller = Shell::Get()->app_list_controller(); return active_window == app_list_controller->GetWindow(); }
diff --git a/ash/wm/desks/desks_test_api.cc b/ash/wm/desks/desks_test_api.cc index 50e19b6d..9fb48730 100644 --- a/ash/wm/desks/desks_test_api.cc +++ b/ash/wm/desks/desks_test_api.cc
@@ -15,7 +15,6 @@ #include "ash/wm/desks/desk_preview_view.h" #include "ash/wm/desks/desks_controller.h" #include "ash/wm/desks/desks_restore_util.h" -#include "ash/wm/desks/expanded_desks_bar_button.h" #include "ash/wm/desks/legacy_desk_bar_view.h" #include "ash/wm/overview/overview_controller.h" #include "ash/wm/overview/overview_grid.h"
diff --git a/ash/wm/desks/desks_unittests.cc b/ash/wm/desks/desks_unittests.cc index 0039128..730416ff 100644 --- a/ash/wm/desks/desks_unittests.cc +++ b/ash/wm/desks/desks_unittests.cc
@@ -66,13 +66,11 @@ #include "ash/wm/desks/desks_test_api.h" #include "ash/wm/desks/desks_test_util.h" #include "ash/wm/desks/desks_util.h" -#include "ash/wm/desks/expanded_desks_bar_button.h" #include "ash/wm/desks/legacy_desk_bar_view.h" #include "ash/wm/desks/root_window_desk_switch_animator_test_api.h" #include "ash/wm/desks/scroll_arrow_button.h" #include "ash/wm/desks/templates/saved_desk_test_helper.h" #include "ash/wm/desks/templates/saved_desk_test_util.h" -#include "ash/wm/desks/zero_state_button.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/overview/overview_controller.h" #include "ash/wm/overview/overview_focus_cycler.h"
diff --git a/ash/wm/desks/desks_util.cc b/ash/wm/desks/desks_util.cc index 43e5560..68f4a087 100644 --- a/ash/wm/desks/desks_util.cc +++ b/ash/wm/desks/desks_util.cc
@@ -7,7 +7,6 @@ #include <array> #include "ash/constants/ash_features.h" -#include "ash/public/cpp/tablet_mode.h" #include "ash/shell.h" #include "ash/wm/desks/desk.h" #include "ash/wm/desks/desks_controller.h" @@ -22,6 +21,7 @@ #include "ui/aura/client/aura_constants.h" #include "ui/aura/window.h" #include "ui/compositor/layer.h" +#include "ui/display/screen.h" namespace ash { @@ -172,7 +172,7 @@ } bool ShouldDesksBarBeCreated() { - return !TabletMode::Get()->InTabletMode() || + return !display::Screen::GetScreen()->InTabletMode() || DesksController::Get()->desks().size() > 1; }
diff --git a/ash/wm/desks/expanded_desks_bar_button.cc b/ash/wm/desks/expanded_desks_bar_button.cc deleted file mode 100644 index e8576345..0000000 --- a/ash/wm/desks/expanded_desks_bar_button.cc +++ /dev/null
@@ -1,259 +0,0 @@ -// Copyright 2021 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ash/wm/desks/expanded_desks_bar_button.h" - -#include "ash/resources/vector_icons/vector_icons.h" -#include "ash/shell.h" -#include "ash/style/ash_color_id.h" -#include "ash/style/ash_color_provider.h" -#include "ash/style/color_util.h" -#include "ash/style/style_util.h" -#include "ash/style/typography.h" -#include "ash/wm/desks/desk_bar_view_base.h" -#include "ash/wm/desks/desk_button_base.h" -#include "ash/wm/desks/desk_mini_view.h" -#include "ash/wm/desks/desk_name_view.h" -#include "ash/wm/overview/overview_constants.h" -#include "ash/wm/overview/overview_controller.h" -#include "ash/wm/overview/overview_focus_cycler.h" -#include "ash/wm/overview/overview_session.h" -#include "ui/compositor/layer.h" -#include "ui/gfx/paint_vector_icon.h" -#include "ui/gfx/text_elider.h" -#include "ui/views/controls/focus_ring.h" -#include "ui/views/controls/highlight_path_generator.h" -#include "ui/views/controls/label.h" -#include "ui/views/view_utils.h" - -namespace ash { - -namespace { - -constexpr int kDeskBarButtonAndNameSpacing = 8; - -constexpr int kBorderCornerRadius = 6; - -constexpr int kCornerRadius = 4; - -} // namespace - -// ----------------------------------------------------------------------------- -// InnerExpandedDesksBarButton: - -class ASH_EXPORT InnerExpandedDesksBarButton : public DeskButtonBase { - public: - METADATA_HEADER(InnerExpandedDesksBarButton); - - InnerExpandedDesksBarButton(ExpandedDesksBarButton* outer_button, - DeskBarViewBase* bar_view, - base::RepeatingClosure callback, - const std::u16string& text) - : DeskButtonBase(text, - /*set_text=*/false, - bar_view, - std::move(callback), - kCornerRadius), - outer_button_(outer_button) {} - InnerExpandedDesksBarButton(const InnerExpandedDesksBarButton&) = delete; - InnerExpandedDesksBarButton operator=(const InnerExpandedDesksBarButton&) = - delete; - ~InnerExpandedDesksBarButton() override = default; - - std::optional<ui::ColorId> focus_color_id() { return focus_color_id_; } - void set_focus_color_id(std::optional<ui::ColorId> focus_color_id) { - focus_color_id_ = focus_color_id; - } - - // views::View: - void OnThemeChanged() override { - DeskButtonBase::OnThemeChanged(); - const SkColor enabled_icon_color = - AshColorProvider::Get()->GetContentLayerColor( - AshColorProvider::ContentLayerType::kButtonIconColor); - SetImageModel(views::Button::STATE_NORMAL, - ui::ImageModel::FromVectorIcon(*outer_button_->button_icon(), - enabled_icon_color)); - SetImageModel(views::Button::STATE_DISABLED, - ui::ImageModel::FromVectorIcon( - *outer_button_->button_icon(), - ColorUtil::GetDisabledColor(enabled_icon_color))); - SetButtonState(GetEnabled()); - } - - // views::View: - gfx::Size CalculatePreferredSize() const override { - return DeskMiniView::GetDeskPreviewBounds(bar_view_->root()).size(); - } - - void SetButtonState(bool enabled) { - outer_button_->UpdateLabelColor(enabled); - // Notify the overview focus cycler if we are about to be disabled. - if (!enabled && bar_view_->type() == DeskBarViewBase::Type::kOverview) { - OverviewSession* overview_session = - Shell::Get()->overview_controller()->overview_session(); - DCHECK(overview_session); - overview_session->focus_cycler()->OnViewDestroyingOrDisabling(this); - } - SetEnabled(enabled); - UpdateBackgroundColor(); - StyleUtil::ConfigureInkDropAttributes( - this, StyleUtil::kBaseColor | StyleUtil::kInkDropOpacity); - SchedulePaint(); - } - - void UpdateFocusState() override { outer_button_->UpdateFocusColor(); } - - private: - raw_ptr<ExpandedDesksBarButton, ExperimentalAsh> outer_button_; - std::optional<ui::ColorId> focus_color_id_; -}; - -BEGIN_METADATA(InnerExpandedDesksBarButton, views::LabelButton) -END_METADATA - -// ----------------------------------------------------------------------------- -// ExpandedDesksBarButton: - -ExpandedDesksBarButton::ExpandedDesksBarButton( - DeskBarViewBase* bar_view, - const gfx::VectorIcon* button_icon, - const std::u16string& button_label, - bool initially_enabled, - base::RepeatingClosure callback) - : bar_view_(bar_view), - button_icon_(button_icon), - button_label_(button_label), - inner_button_(AddChildView( - std::make_unique<InnerExpandedDesksBarButton>(this, - bar_view, - callback, - button_label))), - label_(AddChildView(std::make_unique<views::Label>())) { - DCHECK(button_icon_); - SetPaintToLayer(); - layer()->SetFillsBoundsOpaquely(false); - label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); - label_->SetFontList(TypographyProvider::Get()->ResolveTypographyToken( - TypographyToken::kCrosAnnotation1)); - SetButtonState(initially_enabled); - - views::InstallRoundRectHighlightPathGenerator( - inner_button_, gfx::Insets(kFocusRingHaloInset), kBorderCornerRadius); - if (bar_view_->type() == DeskBarViewBase::Type::kOverview) { - auto* focus_ring = views::FocusRing::Get(inner_button_); - focus_ring->SetOutsetFocusRingDisabled(true); - focus_ring->SetHasFocusPredicate(base::BindRepeating( - [](const ExpandedDesksBarButton* desks_bar_button, - const views::View* view) { - const auto* inner_button = - views::AsViewClass<InnerExpandedDesksBarButton>(view); - CHECK(inner_button); - return inner_button->is_focused() || - ((desks_bar_button->bar_view_->dragged_item_over_bar() && - desks_bar_button->IsPointOnButton( - desks_bar_button->bar_view_ - ->last_dragged_item_screen_location())) || - desks_bar_button->active_); - }, - base::Unretained(this))); - } -} - -DeskButtonBase* ExpandedDesksBarButton::GetInnerButton() { - return static_cast<DeskButtonBase*>(inner_button_); -} - -void ExpandedDesksBarButton::SetButtonState(bool enabled) { - inner_button_->SetButtonState(enabled); -} - -void ExpandedDesksBarButton::UpdateLabelColor(bool enabled) { - const SkColor label_color = AshColorProvider::Get()->GetContentLayerColor( - AshColorProvider::ContentLayerType::kTextColorPrimary); - label_->SetEnabledColor(enabled ? label_color - : ColorUtil::GetDisabledColor(label_color)); -} - -bool ExpandedDesksBarButton::IsPointOnButton( - const gfx::Point& screen_location) const { - gfx::Point point_in_view = screen_location; - ConvertPointFromScreen(this, &point_in_view); - return HitTestPoint(point_in_view); -} - -void ExpandedDesksBarButton::UpdateFocusColor() const { - DCHECK(inner_button_); - auto* inner_button_focus_ring = views::FocusRing::Get(inner_button_); - std::optional<ui::ColorId> new_focus_color_id; - - if (inner_button_->is_focused() || - (bar_view_->dragged_item_over_bar() && - IsPointOnButton(bar_view_->last_dragged_item_screen_location()))) { - new_focus_color_id = ui::kColorAshFocusRing; - } else if (active_) { - new_focus_color_id = kColorAshCurrentDeskColor; - } else { - new_focus_color_id = std::nullopt; - } - - if (inner_button_->focus_color_id() == new_focus_color_id) - return; - - // Only repaint the focus ring if the color gets updated. - inner_button_->set_focus_color_id(new_focus_color_id); - inner_button_focus_ring->SetColorId(new_focus_color_id); - - inner_button_focus_ring->SchedulePaint(); -} - -void ExpandedDesksBarButton::Layout() { - // Layout the button until |mini_views_| have been created. This button only - // needs to be laid out in the expanded desks bar where the |mini_views_| is - // always not empty. - if (bar_view_->mini_views().empty()) - return; - const gfx::Rect inner_button_bounds = {{0, 0}, CalculatePreferredSize()}; - inner_button_->SetBoundsRect(inner_button_bounds); - auto* desk_mini_view = bar_view_->mini_views()[0]; - auto* desk_name_view = desk_mini_view->desk_name_view(); - // `button_label_` string might exceed the maximum width in different - // languages. Elide the string `button_label_` if it exceeds the width limit - // after been translated into a different language. - label_->SetText(gfx::ElideText( - button_label_, gfx::FontList(), - inner_button_bounds.width() - desk_name_view->GetInsets().width(), - gfx::ELIDE_TAIL)); - const gfx::Size label_size = label_->GetPreferredSize(); - // Set the label to have the same height as the DeskNameView to keep them at - // the same horizontal level. Note, don't get the label's width from - // DeskNameView since desk's name is changeable, but this label here is not. - const int label_height = desk_name_view->GetPreferredSize().height(); - label_->SetBoundsRect(gfx::Rect( - gfx::Point((inner_button_bounds.width() - label_size.width()) / 2, - inner_button_bounds.bottom() - - desk_mini_view->GetPreviewBorderInsets().bottom() + - kDeskBarButtonAndNameSpacing), - gfx::Size(label_size.width(), label_height))); -} - -void ExpandedDesksBarButton::OnThemeChanged() { - views::View::OnThemeChanged(); - label_->SetBackgroundColor( - GetColorProvider()->GetColor(kColorAshShieldAndBase80)); - UpdateFocusColor(); -} - -gfx::Size ExpandedDesksBarButton::CalculatePreferredSize() const { - return inner_button_->GetPreferredSize(); -} - -std::optional<ui::ColorId> ExpandedDesksBarButton::GetFocusColorIdForTesting() { - return inner_button_->focus_color_id(); -} - -BEGIN_METADATA(ExpandedDesksBarButton, views::View) -END_METADATA - -} // namespace ash
diff --git a/ash/wm/desks/expanded_desks_bar_button.h b/ash/wm/desks/expanded_desks_bar_button.h deleted file mode 100644 index 072a3a5..0000000 --- a/ash/wm/desks/expanded_desks_bar_button.h +++ /dev/null
@@ -1,83 +0,0 @@ -// Copyright 2021 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef ASH_WM_DESKS_EXPANDED_DESKS_BAR_BUTTON_H_ -#define ASH_WM_DESKS_EXPANDED_DESKS_BAR_BUTTON_H_ - -#include "ash/ash_export.h" -#include "base/memory/raw_ptr.h" -#include "ui/base/metadata/metadata_header_macros.h" -#include "ui/color/color_id.h" -#include "ui/views/view.h" - -namespace gfx { -struct VectorIcon; -} // namespace gfx - -namespace views { -class Label; -} // namespace views - -namespace ash { - -class DeskButtonBase; -class InnerExpandedDesksBarButton; -class DeskBarViewBase; - -// A desk button view in the expanded desks bar. It includes the -// InnerExpandedDesksBarButton and a name label below, which has the same style -// as a DeskMiniView, but the name label is not changeable and not focusable. -class ASH_EXPORT ExpandedDesksBarButton : public views::View { - public: - METADATA_HEADER(ExpandedDesksBarButton); - - ExpandedDesksBarButton(DeskBarViewBase* bar_view, - const gfx::VectorIcon* button_icon, - const std::u16string& button_label, - bool initially_enabled, - base::RepeatingClosure callback); - ExpandedDesksBarButton(const ExpandedDesksBarButton&) = delete; - ExpandedDesksBarButton& operator=(const ExpandedDesksBarButton&) = delete; - ~ExpandedDesksBarButton() override = default; - - const gfx::VectorIcon* button_icon() const { return button_icon_; } - - void set_active(bool active) { active_ = active; } - - DeskButtonBase* GetInnerButton(); - - // Updates `inner_button_`'s state on current desks state. - void SetButtonState(bool enabled); - - // Updates the `label_`'s color on DesksController::CanCreateDesks. - void UpdateLabelColor(bool enabled); - - bool IsPointOnButton(const gfx::Point& screen_location) const; - - // Updates the border color of the ExpandedDesksBarButton based on - // the dragged item's position and `active_`. - void UpdateFocusColor() const; - - // views::View: - void Layout() override; - void OnThemeChanged() override; - gfx::Size CalculatePreferredSize() const override; - - std::optional<ui::ColorId> GetFocusColorIdForTesting(); - - private: - const raw_ptr<DeskBarViewBase, ExperimentalAsh> bar_view_; // Not owned. - const raw_ptr<const gfx::VectorIcon, ExperimentalAsh> button_icon_; - const std::u16string button_label_; - raw_ptr<InnerExpandedDesksBarButton, ExperimentalAsh> inner_button_; - raw_ptr<views::Label, ExperimentalAsh> label_; - - // If `active_` is true, then the focus ring of `inner_button_` will be shown - // if it's not already visible. - bool active_ = false; -}; - -} // namespace ash - -#endif // ASH_WM_DESKS_EXPANDED_DESKS_BAR_BUTTON_H_
diff --git a/ash/wm/desks/templates/saved_desk_presenter.cc b/ash/wm/desks/templates/saved_desk_presenter.cc index 9090f63..7c9834d 100644 --- a/ash/wm/desks/templates/saved_desk_presenter.cc +++ b/ash/wm/desks/templates/saved_desk_presenter.cc
@@ -34,6 +34,7 @@ #include "base/time/time.h" #include "third_party/re2/src/re2/re2.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/display/screen.h" #include "ui/wm/core/window_util.h" namespace ash { @@ -355,8 +356,7 @@ // The library and the library button is always hidden if we enter tablet // mode. If not in tablet mode, the library button is visible if there are // saved desks in the model, *or* we are already showing the library. - const bool in_tablet_mode = - Shell::Get()->tablet_mode_controller()->InTabletMode(); + const bool in_tablet_mode = display::Screen::GetScreen()->InTabletMode(); for (auto& overview_grid : overview_session_->grid_list()) { const bool is_showing_library = overview_grid->IsShowingSavedDeskLibrary();
diff --git a/ash/wm/desks/templates/saved_desk_unittest.cc b/ash/wm/desks/templates/saved_desk_unittest.cc index c47065f..8622fdb 100644 --- a/ash/wm/desks/templates/saved_desk_unittest.cc +++ b/ash/wm/desks/templates/saved_desk_unittest.cc
@@ -26,7 +26,6 @@ #include "ash/wm/desks/desks_test_api.h" #include "ash/wm/desks/desks_test_util.h" #include "ash/wm/desks/desks_util.h" -#include "ash/wm/desks/expanded_desks_bar_button.h" #include "ash/wm/desks/legacy_desk_bar_view.h" #include "ash/wm/desks/templates/saved_desk_dialog_controller.h" #include "ash/wm/desks/templates/saved_desk_grid_view.h" @@ -41,7 +40,6 @@ #include "ash/wm/desks/templates/saved_desk_save_desk_button_container.h" #include "ash/wm/desks/templates/saved_desk_test_util.h" #include "ash/wm/desks/templates/saved_desk_util.h" -#include "ash/wm/desks/zero_state_button.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/overview/overview_controller.h" #include "ash/wm/overview/overview_focus_cycler.h"
diff --git a/ash/wm/desks/zero_state_button.cc b/ash/wm/desks/zero_state_button.cc deleted file mode 100644 index 74fa559..0000000 --- a/ash/wm/desks/zero_state_button.cc +++ /dev/null
@@ -1,148 +0,0 @@ -// Copyright 2021 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ash/wm/desks/zero_state_button.h" - -#include <algorithm> - -#include "ash/accessibility/accessibility_controller_impl.h" -#include "ash/shell.h" -#include "ash/strings/grit/ash_strings.h" -#include "ash/style/ash_color_provider.h" -#include "ash/wm/desks/desk.h" -#include "ash/wm/desks/desk_bar_view_base.h" -#include "ash/wm/desks/desk_mini_view.h" -#include "ash/wm/desks/desk_preview_view.h" -#include "ash/wm/desks/desks_controller.h" -#include "ui/base/l10n/l10n_util.h" -#include "ui/gfx/canvas.h" -#include "ui/gfx/font_list.h" -#include "ui/gfx/paint_vector_icon.h" -#include "ui/gfx/text_constants.h" -#include "ui/gfx/text_elider.h" -#include "ui/views/accessibility/view_accessibility.h" -#include "ui/views/controls/focus_ring.h" -#include "ui/views/controls/highlight_path_generator.h" - -namespace ash { - -namespace { - -constexpr int kCornerRadius = 8; - -constexpr int kZeroStateButtonHeight = 28; - -constexpr int kZeroStateDefaultButtonHorizontalPadding = 16; - -// The width for the zero state new desk button and library button. -constexpr int kZeroStateIconButtonWidth = 36; - -constexpr int kZeroStateDefaultDeskButtonMinWidth = 56; - -} // namespace - -// ----------------------------------------------------------------------------- -// ZeroStateDefaultDeskButton: - -ZeroStateDefaultDeskButton::ZeroStateDefaultDeskButton( - DeskBarViewBase* bar_view) - : DeskButtonBase( - DesksController::Get()->desks()[0]->name(), - /*set_text=*/true, - bar_view, - base::BindRepeating(&ZeroStateDefaultDeskButton::OnButtonPressed, - base::Unretained(this)), - kCornerRadius) { - GetViewAccessibility().OverrideName( - l10n_util::GetStringFUTF16(IDS_ASH_DESKS_DESK_ACCESSIBLE_NAME, - DesksController::Get()->desks()[0]->name())); -} - -void ZeroStateDefaultDeskButton::OnThemeChanged() { - DeskButtonBase::OnThemeChanged(); - SetEnabledTextColors(AshColorProvider::Get()->GetContentLayerColor( - AshColorProvider::ContentLayerType::kTextColorPrimary)); -} - -gfx::Size ZeroStateDefaultDeskButton::CalculatePreferredSize() const { - auto* root_window = - bar_view_->GetWidget()->GetNativeWindow()->GetRootWindow(); - const int preview_width = DeskMiniView::GetPreviewWidth( - root_window->bounds().size(), DeskPreviewView::GetHeight(root_window)); - int label_width = 0, label_height = 0; - gfx::Canvas::SizeStringInt(DesksController::Get()->desks()[0]->name(), - gfx::FontList(), &label_width, &label_height, 0, - gfx::Canvas::NO_ELLIPSIS); - - // `preview_width` is supposed to be larger than - // `kZeroStateDefaultDeskButtonMinWidth`, but it might be not the truth for - // tests with extreme abnormal size of display. - const int min_width = - std::min(preview_width, kZeroStateDefaultDeskButtonMinWidth); - const int max_width = - std::max(preview_width, kZeroStateDefaultDeskButtonMinWidth); - const int width = - std::clamp(label_width + 2 * kZeroStateDefaultButtonHorizontalPadding, - min_width, max_width); - return gfx::Size(width, kZeroStateButtonHeight); -} - -void ZeroStateDefaultDeskButton::UpdateLabelText() { - SetText(gfx::ElideText( - DesksController::Get()->desks()[0]->name(), gfx::FontList(), - bounds().width() - 2 * kZeroStateDefaultButtonHorizontalPadding, - gfx::ELIDE_TAIL)); -} - -void ZeroStateDefaultDeskButton::OnButtonPressed() { - bar_view_->UpdateNewMiniViews(/*initializing_bar_view=*/false, - /*expanding_bar_view=*/true); - bar_view_->NudgeDeskName(/*desk_index=*/0); -} - -BEGIN_METADATA(ZeroStateDefaultDeskButton, DeskButtonBase) -END_METADATA - -// ----------------------------------------------------------------------------- -// ZeroStateIconButton: - -ZeroStateIconButton::ZeroStateIconButton(DeskBarViewBase* bar_view, - const gfx::VectorIcon* button_icon, - const std::u16string& text, - base::RepeatingClosure callback) - : DeskButtonBase(text, - /*set_text=*/false, - bar_view, - std::move(callback), - kCornerRadius), - button_icon_(button_icon) { - SetShouldPaintBackground(false); -} - -ZeroStateIconButton::~ZeroStateIconButton() = default; - -void ZeroStateIconButton::OnThemeChanged() { - DeskButtonBase::OnThemeChanged(); - const SkColor icon_color = AshColorProvider::Get()->GetContentLayerColor( - AshColorProvider::ContentLayerType::kButtonIconColor); - SetImageModel(views::Button::STATE_NORMAL, - ui::ImageModel::FromVectorIcon(*button_icon_, icon_color)); -} - -gfx::Size ZeroStateIconButton::CalculatePreferredSize() const { - return gfx::Size(kZeroStateIconButtonWidth, kZeroStateButtonHeight); -} - -void ZeroStateIconButton::OnMouseEntered(const ui::MouseEvent& event) { - SetShouldPaintBackground(true); -} - -void ZeroStateIconButton::OnMouseExited(const ui::MouseEvent& event) { - SetShouldPaintBackground(false); -} - -BEGIN_METADATA(ZeroStateIconButton, DeskButtonBase) -END_METADATA - -} // namespace ash
diff --git a/ash/wm/desks/zero_state_button.h b/ash/wm/desks/zero_state_button.h deleted file mode 100644 index 8afd4a6..0000000 --- a/ash/wm/desks/zero_state_button.h +++ /dev/null
@@ -1,74 +0,0 @@ -// Copyright 2021 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef ASH_WM_DESKS_ZERO_STATE_BUTTON_H_ -#define ASH_WM_DESKS_ZERO_STATE_BUTTON_H_ - -#include "ash/ash_export.h" -#include "ash/wm/desks/desk_button_base.h" -#include "base/memory/raw_ptr.h" -#include "ui/base/metadata/metadata_impl_macros.h" - -namespace gfx { -struct VectorIcon; -} - -namespace ash { - -class DeskBarViewBase; - -// A button in zero state bar showing "Desk 1". Zero state is the state of the -// desks bar when there's only a single desk available, in which case the bar is -// shown in a minimized state. Clicking the button will switch to the expanded -// desks bar and focus on the single desk's name view. The expanded bar will -// include the single desk and the ExpandedDesksBarButton. -class ASH_EXPORT ZeroStateDefaultDeskButton : public DeskButtonBase { - public: - METADATA_HEADER(ZeroStateDefaultDeskButton); - - explicit ZeroStateDefaultDeskButton(DeskBarViewBase* bar_view); - ZeroStateDefaultDeskButton(const ZeroStateDefaultDeskButton&) = delete; - ZeroStateDefaultDeskButton& operator=(const ZeroStateDefaultDeskButton&) = - delete; - ~ZeroStateDefaultDeskButton() override = default; - - // DeskButtonBase: - void OnThemeChanged() override; - gfx::Size CalculatePreferredSize() const override; - void UpdateLabelText() override; - - private: - void OnButtonPressed(); -}; - -// A button in the zero state bar with an icon. Zero state is the state of the -// desks bar when there's only a single desk available, in which case the bar is -// shown in a minimized state. -class ASH_EXPORT ZeroStateIconButton : public DeskButtonBase { - public: - METADATA_HEADER(ZeroStateIconButton); - - ZeroStateIconButton(DeskBarViewBase* bar_view, - const gfx::VectorIcon* button_icon, - const std::u16string& text, - base::RepeatingClosure callback); - ZeroStateIconButton(const ZeroStateIconButton&) = delete; - ZeroStateIconButton& operator=(const ZeroStateIconButton&) = delete; - ~ZeroStateIconButton() override; - - // DeskButtonBase: - void OnThemeChanged() override; - gfx::Size CalculatePreferredSize() const override; - - // views::Button: - void OnMouseEntered(const ui::MouseEvent& event) override; - void OnMouseExited(const ui::MouseEvent& event) override; - - private: - const raw_ptr<const gfx::VectorIcon, ExperimentalAsh> button_icon_; -}; - -} // namespace ash - -#endif // ASH_WM_DESKS_ZERO_STATE_BUTTON_H_
diff --git a/ash/wm/drag_details.cc b/ash/wm/drag_details.cc index 5e92c4e..d857b14 100644 --- a/ash/wm/drag_details.cc +++ b/ash/wm/drag_details.cc
@@ -5,11 +5,10 @@ #include "ash/wm/drag_details.h" #include "ash/public/cpp/window_properties.h" -#include "ash/shell.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_resizer.h" #include "ui/aura/window.h" #include "ui/base/hit_test.h" +#include "ui/display/screen.h" #include "ui/wm/core/coordinate_conversion.h" namespace ash { @@ -49,7 +48,7 @@ if (WindowState::Get(window)->IsFloated()) return window->bounds(); - if (Shell::Get()->tablet_mode_controller()->InTabletMode()) { + if (display::Screen::GetScreen()->InTabletMode()) { gfx::Rect* override_bounds = window->GetProperty(kRestoreBoundsOverrideKey); if (override_bounds && !override_bounds->IsEmpty()) { wm::ConvertRectFromScreen(window->GetRootWindow(), override_bounds); @@ -68,7 +67,7 @@ // TODO(xdai): Move these logic to WindowState::GetRestoreBoundsInScreen() // and let it return the right value. gfx::Rect restore_bounds; - if (Shell::Get()->tablet_mode_controller()->InTabletMode()) { + if (display::Screen::GetScreen()->InTabletMode()) { gfx::Rect* override_bounds = window->GetProperty(kRestoreBoundsOverrideKey); if (override_bounds && !override_bounds->IsEmpty()) { restore_bounds = *override_bounds;
diff --git a/ash/wm/float/float_controller.cc b/ash/wm/float/float_controller.cc index d33ebf7e..7c738ed0 100644 --- a/ash/wm/float/float_controller.cc +++ b/ash/wm/float/float_controller.cc
@@ -26,7 +26,6 @@ #include "ash/wm/mru_window_tracker.h" #include "ash/wm/scoped_window_tucker.h" #include "ash/wm/screen_pinning_controller.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/tablet_mode/tablet_mode_window_state.h" #include "ash/wm/window_state.h" #include "ash/wm/window_util.h" @@ -48,6 +47,7 @@ #include "ui/aura/window_delegate.h" #include "ui/aura/window_observer.h" #include "ui/display/screen.h" +#include "ui/display/tablet_state.h" #include "ui/gfx/canvas.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/wm/core/coordinate_conversion.h" @@ -290,7 +290,7 @@ if (desk->is_active()) float_start_time_ = base::TimeTicks::Now(); - if (Shell::Get()->tablet_mode_controller()->InTabletMode() && + if (display::Screen::GetScreen()->InTabletMode() && TabletModeTuckEducation::CanActivateTuckEducation()) { tuck_education_ = std::make_unique<TabletModeTuckEducation>(floated_window); @@ -818,34 +818,6 @@ workspace_event_handlers_.erase(root); } -void FloatController::OnTabletModeStarted() { - DCHECK(!floated_window_info_map_.empty()); - // If a window can still remain floated, update its bounds, otherwise unfloat - // it. Note that the bounds update has to happen after tablet mode has started - // as opposed to while it is still starting, since some windows change their - // minimum size, which tablet float bounds depend on. - for (auto& [window, info] : floated_window_info_map_) { - if (chromeos::wm::CanFloatWindow(window)) { - info->set_magnetism_corner( - GetMagnetismCornerForBounds(window->GetBoundsInScreen())); - UpdateWindowBoundsForTablet( - window, WindowState::BoundsChangeAnimationType::kCrossFade); - } else { - ResetFloatedWindow(window); - } - } -} - -void FloatController::OnTabletModeEnding() { - for (auto& [window, info] : floated_window_info_map_) { - info->MaybeUntuckWindow(/*animate=*/false); - } -} - -void FloatController::OnTabletControllerDestroyed() { - tablet_mode_observation_.Reset(); -} - void FloatController::OnDeskActivationChanged(const Desk* activated, const Desk* deactivated) { // Since floated windows are not children of desk containers, switching desks @@ -934,6 +906,20 @@ } } +void FloatController::OnDisplayTabletStateChanged(display::TabletState state) { + switch (state) { + case display::TabletState::kInClamshellMode: + case display::TabletState::kEnteringTabletMode: + break; + case display::TabletState::kInTabletMode: + OnTabletModeStarted(); + break; + case display::TabletState::kExitingTabletMode: + OnTabletModeEnding(); + break; + } +} + void FloatController::OnRootWindowAdded(aura::Window* root_window) { workspace_event_handlers_[root_window] = std::make_unique<WorkspaceEventHandler>( @@ -963,7 +949,7 @@ if (window->GetProperty(aura::client::kAppType) == static_cast<int>(AppType::ARC_APP)) { const gfx::Rect bounds = - Shell::Get()->tablet_mode_controller()->InTabletMode() + display::Screen::GetScreen()->InTabletMode() ? GetFloatWindowTabletBounds(window) : GetFloatWindowClamshellBounds( window, chromeos::FloatStartLocation::kBottomRight); @@ -1128,8 +1114,6 @@ // counted as 2 floated windows. ++floated_window_counter_; - if (!tablet_mode_observation_.IsObserving()) - tablet_mode_observation_.Observe(Shell::Get()->tablet_mode_controller()); if (!desks_controller_observation_.IsObserving()) desks_controller_observation_.Observe(desk_controller); if (!display_observer_) @@ -1157,7 +1141,6 @@ floated_window_info_map_.erase(window); if (floated_window_info_map_.empty()) { desks_controller_observation_.Reset(); - tablet_mode_observation_.Reset(); display_observer_.reset(); } @@ -1187,9 +1170,32 @@ floated_window_info_map_.erase(floated_window); if (floated_window_info_map_.empty()) { desks_controller_observation_.Reset(); - tablet_mode_observation_.Reset(); display_observer_.reset(); } } +void FloatController::OnTabletModeStarted() { + DCHECK(!floated_window_info_map_.empty()); + // If a window can still remain floated, update its bounds, otherwise unfloat + // it. Note that the bounds update has to happen after tablet mode has started + // as opposed to while it is still starting, since some windows change their + // minimum size, which tablet float bounds depend on. + for (auto& [window, info] : floated_window_info_map_) { + if (chromeos::wm::CanFloatWindow(window)) { + info->set_magnetism_corner( + GetMagnetismCornerForBounds(window->GetBoundsInScreen())); + UpdateWindowBoundsForTablet( + window, WindowState::BoundsChangeAnimationType::kCrossFade); + } else { + ResetFloatedWindow(window); + } + } +} + +void FloatController::OnTabletModeEnding() { + for (auto& [window, info] : floated_window_info_map_) { + info->MaybeUntuckWindow(/*animate=*/false); + } +} + } // namespace ash
diff --git a/ash/wm/float/float_controller.h b/ash/wm/float/float_controller.h index 32f1730..ce326d75 100644 --- a/ash/wm/float/float_controller.h +++ b/ash/wm/float/float_controller.h
@@ -8,7 +8,6 @@ #include <memory> #include "ash/ash_export.h" -#include "ash/public/cpp/tablet_mode_observer.h" #include "ash/rotator/screen_rotation_animator_observer.h" #include "ash/shell_observer.h" #include "ash/wm/desks/desks_controller.h" @@ -23,6 +22,10 @@ class Window; } // namespace aura +namespace display { +enum class TabletState; +} // namespace display + namespace views { class Widget; } // namespace views @@ -30,15 +33,13 @@ namespace ash { class Shell; -class TabletModeController; class WorkspaceEventHandler; // This controller allows windows to be on top of all app windows, but below // pips. When a window is 'floated', it remains always on top for the user so // that they can complete secondary tasks. Floated window stays in the // `kShellWindowId_FloatContainer`. -class ASH_EXPORT FloatController : public TabletModeObserver, - public display::DisplayObserver, +class ASH_EXPORT FloatController : public display::DisplayObserver, public ShellObserver, public DesksController::Observer, public chromeos::FloatControllerBase, @@ -126,11 +127,6 @@ void ClearWorkspaceEventHandler(aura::Window* root); - // TabletModeObserver: - void OnTabletModeStarted() override; - void OnTabletModeEnding() override; - void OnTabletControllerDestroyed() override; - // DesksController::Observer: void OnDeskActivationChanged(const Desk* activated, const Desk* deactivated) override; @@ -138,6 +134,7 @@ // display::DisplayObserver: void OnDisplayMetricsChanged(const display::Display& display, uint32_t metrics) override; + void OnDisplayTabletStateChanged(display::TabletState state) override; // ShellObserver: void OnRootWindowAdded(aura::Window* root_window) override; @@ -187,6 +184,10 @@ // `floated_window` from `floated_window_info_map_`. void OnFloatedWindowDestroying(aura::Window* floated_window); + // Called by `OnDisplayTabletStateChanged. + void OnTabletModeStarted(); + void OnTabletModeEnding(); + // Used to map floated window to to its FloatedWindowInfo. // Contains extra info for a floated window such as its pre-float auto managed // state and tablet mode magnetism. @@ -210,9 +211,6 @@ ScreenRotationAnimatorObserver> screen_rotation_observations_{this}; - base::ScopedObservation<TabletModeController, TabletModeObserver> - tablet_mode_observation_{this}; - base::ScopedObservation<DesksController, DesksController::Observer> desks_controller_observation_{this};
diff --git a/ash/wm/gestures/back_gesture/back_gesture_contextual_nudge_controller_impl.cc b/ash/wm/gestures/back_gesture/back_gesture_contextual_nudge_controller_impl.cc index eb48f54..fc062f95 100644 --- a/ash/wm/gestures/back_gesture/back_gesture_contextual_nudge_controller_impl.cc +++ b/ash/wm/gestures/back_gesture/back_gesture_contextual_nudge_controller_impl.cc
@@ -15,6 +15,7 @@ #include "base/time/time.h" #include "components/prefs/pref_service.h" #include "ui/aura/client/window_types.h" +#include "ui/display/tablet_state.h" #include "ui/wm/public/activation_client.h" namespace ash { @@ -29,7 +30,6 @@ BackGestureContextualNudgeControllerImpl:: BackGestureContextualNudgeControllerImpl() { - tablet_mode_observation_.Observe(Shell::Get()->tablet_mode_controller()); shelf_control_visible_ = ShelfConfig::Get()->shelf_controls_shown(); ShelfConfig::Get()->AddObserver(this); } @@ -56,16 +56,19 @@ UpdateWindowMonitoring(/*can_show_nudge_immediately=*/true); } -void BackGestureContextualNudgeControllerImpl::OnTabletModeStarted() { - UpdateWindowMonitoring(/*can_show_nudge_immediately=*/true); -} - -void BackGestureContextualNudgeControllerImpl::OnTabletModeEnded() { - UpdateWindowMonitoring(/*can_show_nudge_immediately=*/false); -} - -void BackGestureContextualNudgeControllerImpl::OnTabletControllerDestroyed() { - DoCleanUp(); +void BackGestureContextualNudgeControllerImpl::OnDisplayTabletStateChanged( + display::TabletState state) { + switch (state) { + case display::TabletState::kEnteringTabletMode: + case display::TabletState::kExitingTabletMode: + break; + case display::TabletState::kInClamshellMode: + UpdateWindowMonitoring(/*can_show_nudge_immediately=*/false); + break; + case display::TabletState::kInTabletMode: + UpdateWindowMonitoring(/*can_show_nudge_immediately=*/true); + break; + } } void BackGestureContextualNudgeControllerImpl::OnWindowActivated( @@ -216,8 +219,6 @@ } void BackGestureContextualNudgeControllerImpl::DoCleanUp() { - tablet_mode_observation_.Reset(); - if (is_monitoring_windows_) { Shell::Get()->activation_client()->RemoveObserver(this); nudge_delegate_.reset();
diff --git a/ash/wm/gestures/back_gesture/back_gesture_contextual_nudge_controller_impl.h b/ash/wm/gestures/back_gesture/back_gesture_contextual_nudge_controller_impl.h index 294959d..feec42b 100644 --- a/ash/wm/gestures/back_gesture/back_gesture_contextual_nudge_controller_impl.h +++ b/ash/wm/gestures/back_gesture/back_gesture_contextual_nudge_controller_impl.h
@@ -9,16 +9,20 @@ #include "ash/public/cpp/back_gesture_contextual_nudge_controller.h" #include "ash/public/cpp/session/session_observer.h" #include "ash/public/cpp/shelf_config.h" -#include "ash/public/cpp/tablet_mode_observer.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" #include "base/timer/timer.h" +#include "ui/display/display_observer.h" #include "ui/wm/public/activation_change_observer.h" namespace aura { class Window; -} +} // namespace aura + +namespace display { +enum class TabletState; +} // namespace display namespace ash { @@ -28,7 +32,7 @@ // The class to decide when to show/hide back gesture contextual nudge. class ASH_EXPORT BackGestureContextualNudgeControllerImpl : public SessionObserver, - public TabletModeObserver, + public display::DisplayObserver, public wm::ActivationChangeObserver, public BackGestureContextualNudgeController, public ShelfConfig::Observer { @@ -49,10 +53,8 @@ void OnActiveUserSessionChanged(const AccountId& account_id) override; void OnSessionStateChanged(session_manager::SessionState state) override; - // TabletModeObserver: - void OnTabletModeStarted() override; - void OnTabletModeEnded() override; - void OnTabletControllerDestroyed() override; + // display::DisplayObserver: + void OnDisplayTabletStateChanged(display::TabletState state) override; // wm::ActivationChangeObserver: void OnWindowActivated(ActivationReason reason, @@ -105,8 +107,7 @@ void DoCleanUp(); ScopedSessionObserver session_observer_{this}; - base::ScopedObservation<TabletModeController, TabletModeObserver> - tablet_mode_observation_{this}; + display::ScopedDisplayObserver display_observer_{this}; // The delegate to monitor the current active window's navigation status. std::unique_ptr<BackGestureContextualNudgeDelegate> nudge_delegate_;
diff --git a/ash/wm/gestures/back_gesture/back_gesture_event_handler.cc b/ash/wm/gestures/back_gesture/back_gesture_event_handler.cc index 7bbebf5..cbefc50 100644 --- a/ash/wm/gestures/back_gesture/back_gesture_event_handler.cc +++ b/ash/wm/gestures/back_gesture/back_gesture_event_handler.cc
@@ -23,7 +23,6 @@ #include "ash/wm/overview/overview_controller.h" #include "ash/wm/splitview/split_view_constants.h" #include "ash/wm/splitview/split_view_divider.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_state.h" #include "ash/wm/window_util.h" #include "ash/wm/wm_event.h" @@ -33,6 +32,7 @@ #include "chromeos/ui/base/window_properties.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/window.h" +#include "ui/display/screen.h" #include "ui/wm/core/coordinate_conversion.h" #include "ui/wm/core/window_util.h" @@ -440,8 +440,9 @@ if (shell->session_controller()->IsRunningInAppMode()) return false; - if (!shell->tablet_mode_controller()->InTabletMode()) + if (!display::Screen::GetScreen()->InTabletMode()) { return false; + } // Do not enable back gesture if it is not in an ACTIVE session. e.g, login // screen, lock screen.
diff --git a/ash/wm/overview/overview_controller.cc b/ash/wm/overview/overview_controller.cc index 82ef81c2..7a50a805 100644 --- a/ash/wm/overview/overview_controller.cc +++ b/ash/wm/overview/overview_controller.cc
@@ -24,7 +24,6 @@ #include "ash/wm/screen_pinning_controller.h" #include "ash/wm/snap_group/snap_group_controller.h" #include "ash/wm/splitview/split_view_controller.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_state.h" #include "ash/wm/window_util.h" #include "base/containers/unique_ptr_adapters.h" @@ -36,6 +35,7 @@ #include "chromeos/constants/chromeos_features.h" #include "ui/compositor/layer.h" #include "ui/compositor/presentation_time_recorder.h" +#include "ui/display/screen.h" #include "ui/wm/core/window_util.h" #include "ui/wm/public/activation_client.h" @@ -79,8 +79,9 @@ return original_type; // Use normal type if home launcher is not available. - if (!Shell::Get()->tablet_mode_controller()->InTabletMode()) + if (!display::Screen::GetScreen()->InTabletMode()) { return original_type; + } // Transition to home screen only if all windows are minimized. for (const aura::Window* window : windows) {
diff --git a/ash/wm/overview/overview_focus_cycler.cc b/ash/wm/overview/overview_focus_cycler.cc index e0bb714..caf903f2 100644 --- a/ash/wm/overview/overview_focus_cycler.cc +++ b/ash/wm/overview/overview_focus_cycler.cc
@@ -13,13 +13,11 @@ #include "ash/wm/desks/desk_name_view.h" #include "ash/wm/desks/desk_preview_view.h" #include "ash/wm/desks/desks_controller.h" -#include "ash/wm/desks/expanded_desks_bar_button.h" #include "ash/wm/desks/legacy_desk_bar_view.h" #include "ash/wm/desks/templates/saved_desk_grid_view.h" #include "ash/wm/desks/templates/saved_desk_item_view.h" #include "ash/wm/desks/templates/saved_desk_library_view.h" #include "ash/wm/desks/templates/saved_desk_name_view.h" -#include "ash/wm/desks/zero_state_button.h" #include "ash/wm/overview/overview_focusable_view.h" #include "ash/wm/overview/overview_grid.h" #include "ash/wm/overview/overview_item.h"
diff --git a/ash/wm/overview/overview_focus_cycler_unittest.cc b/ash/wm/overview/overview_focus_cycler_unittest.cc index 06a9a3d..2ccfe2c 100644 --- a/ash/wm/overview/overview_focus_cycler_unittest.cc +++ b/ash/wm/overview/overview_focus_cycler_unittest.cc
@@ -13,7 +13,6 @@ #include "ash/wm/desks/desk_name_view.h" #include "ash/wm/desks/desk_preview_view.h" #include "ash/wm/desks/desks_test_util.h" -#include "ash/wm/desks/expanded_desks_bar_button.h" #include "ash/wm/desks/legacy_desk_bar_view.h" #include "ash/wm/desks/templates/saved_desk_util.h" #include "ash/wm/overview/overview_controller.h"
diff --git a/ash/wm/overview/overview_grid.cc b/ash/wm/overview/overview_grid.cc index 3de976f2..68386e08 100644 --- a/ash/wm/overview/overview_grid.cc +++ b/ash/wm/overview/overview_grid.cc
@@ -30,7 +30,6 @@ #include "ash/wm/desks/desk_name_view.h" #include "ash/wm/desks/desks_controller.h" #include "ash/wm/desks/desks_util.h" -#include "ash/wm/desks/expanded_desks_bar_button.h" #include "ash/wm/desks/legacy_desk_bar_view.h" #include "ash/wm/desks/templates/saved_desk_animations.h" #include "ash/wm/desks/templates/saved_desk_grid_view.h" @@ -39,7 +38,6 @@ #include "ash/wm/desks/templates/saved_desk_presenter.h" #include "ash/wm/desks/templates/saved_desk_save_desk_button.h" #include "ash/wm/desks/templates/saved_desk_util.h" -#include "ash/wm/desks/zero_state_button.h" #include "ash/wm/gestures/wm_gesture_handler.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/overview/overview_constants.h" @@ -61,7 +59,6 @@ #include "ash/wm/splitview/split_view_divider.h" #include "ash/wm/splitview/split_view_overview_session.h" #include "ash/wm/splitview/split_view_utils.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_properties.h" #include "ash/wm/window_state_delegate.h" #include "ash/wm/window_util.h" @@ -82,6 +79,7 @@ #include "ui/compositor/layer_animator.h" #include "ui/compositor/presentation_time_recorder.h" #include "ui/compositor/throughput_tracker.h" +#include "ui/display/screen.h" #include "ui/gfx/geometry/size_f.h" #include "ui/gfx/geometry/transform.h" #include "ui/gfx/geometry/transform_util.h" @@ -525,8 +523,7 @@ animator->RemoveObserver(this); } - Shell* shell = Shell::Get(); - shell->wallpaper_controller()->RemoveObserver(this); + Shell::Get()->wallpaper_controller()->RemoveObserver(this); grid_event_handler_.reset(); if (IsShowingSavedDeskLibrary()) @@ -553,7 +550,7 @@ OverviewEnterExitType::kFadeOutExit; const bool single_animation_in_clamshell = (animate_count == 1 && !has_non_cover_animating) && - !shell->tablet_mode_controller()->InTabletMode(); + !display::Screen::GetScreen()->InTabletMode(); // The following instance self-destructs when shutdown animation ends. new ShutdownAnimationMetricsTrackerObserver( root_window_->layer()->GetCompositor(), in_split_view, @@ -599,7 +596,7 @@ } SplitViewController::Get(root_window_)->AddObserver(this); - if (Shell::Get()->tablet_mode_controller()->InTabletMode()) { + if (display::Screen::GetScreen()->InTabletMode()) { if (auto* animator = RootWindowController::ForWindow(root_window_) ->GetScreenRotationAnimator()) { animator->AddObserver(this); @@ -748,7 +745,7 @@ !window_list_.empty()) { bool single_animation_in_clamshell = animate_count == 1 && !has_non_cover_animating && - !Shell::Get()->tablet_mode_controller()->InTabletMode(); + !display::Screen::GetScreen()->InTabletMode(); bool minimized_in_tablet = overview_session_->enter_exit_overview_type() == OverviewEnterExitType::kFadeInEnter; metrics_tracker_ = std::make_unique<OverviewEnterMetricsTracker>( @@ -1276,7 +1273,7 @@ : items[i]->GetWindow()->GetBoundsInRootWindow(); if (!src_bounds_temp.IsEmpty()) { if (transition == OverviewTransition::kEnter && - Shell::Get()->tablet_mode_controller()->InTabletMode()) { + display::Screen::GetScreen()->InTabletMode()) { BackdropController* backdrop_controller = GetActiveWorkspaceController(root_window_) ->layout_manager() @@ -2065,7 +2062,7 @@ // scroll is in progress. const bool target_visible = !no_items && !overview_session_->GetCurrentDraggedOverviewItem() && - !Shell::Get()->tablet_mode_controller()->InTabletMode() && + !display::Screen::GetScreen()->InTabletMode() && !IsShowingSavedDeskLibrary() && desks_widget_ && (!features::IsContinuousOverviewScrollAnimationEnabled() || !OverviewController::Get()->is_continuous_scroll_in_progress());
diff --git a/ash/wm/overview/overview_grid_event_handler.cc b/ash/wm/overview/overview_grid_event_handler.cc index 8d4b253..5a371e22 100644 --- a/ash/wm/overview/overview_grid_event_handler.cc +++ b/ash/wm/overview/overview_grid_event_handler.cc
@@ -98,7 +98,7 @@ // The following events are for scrolling the overview scroll layout, which is // tablet only. - if (!Shell::Get()->IsInTabletMode()) { + if (!display::Screen::GetScreen()->InTabletMode()) { return; } @@ -148,7 +148,7 @@ return; } - if (Shell::Get()->tablet_mode_controller()->InTabletMode()) { + if (display::Screen::GetScreen()->InTabletMode()) { aura::Window* window = static_cast<views::View*>(event->target()) ->GetWidget() ->GetNativeWindow();
diff --git a/ash/wm/overview/overview_item.cc b/ash/wm/overview/overview_item.cc index 215567f..de23558 100644 --- a/ash/wm/overview/overview_item.cc +++ b/ash/wm/overview/overview_item.cc
@@ -33,7 +33,6 @@ #include "ash/wm/raster_scale/raster_scale_controller.h" #include "ash/wm/splitview/split_view_constants.h" #include "ash/wm/splitview/split_view_utils.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_mini_view_header_view.h" #include "ash/wm/window_preview_view.h" #include "ash/wm/window_state.h" @@ -52,6 +51,7 @@ #include "ui/compositor/layer_animation_sequence.h" #include "ui/compositor/scoped_layer_animation_settings.h" #include "ui/compositor_extra/shadow.h" +#include "ui/display/screen.h" #include "ui/gfx/geometry/rounded_corners_f.h" #include "ui/gfx/geometry/transform_util.h" #include "ui/views/widget/widget.h" @@ -211,7 +211,7 @@ OverviewController* overview_controller = OverviewController::Get(); bool show_rounded_corners_for_start_animation = false; if (features::IsContinuousOverviewScrollAnimationEnabled() && - !Shell::Get()->tablet_mode_controller()->InTabletMode()) { + !display::Screen::GetScreen()->InTabletMode()) { show_rounded_corners_for_start_animation = transform_window_.IsMinimizedOrTucked() || !IsContinuousScrollInProgress(); @@ -476,7 +476,7 @@ // TODO(oshima): SplitViewController has its own logic to adjust the // target state in `SplitViewController::OnOverviewModeEnding`. // Unify the mechanism to control it and remove ifs. - if (Shell::Get()->tablet_mode_controller()->InTabletMode() && + if (display::Screen::GetScreen()->InTabletMode() && !SplitViewController::Get(root_window_)->InSplitViewMode() && reset_transform) { MaximizeIfSnapped(GetWindow()); @@ -1332,7 +1332,7 @@ // Fade out the minimized window without animation if switch from tablet mode // to clamshell mode. if (type == OverviewEnterExitType::kFadeOutExit) { - return Shell::Get()->tablet_mode_controller()->InTabletMode() + return display::Screen::GetScreen()->InTabletMode() ? OVERVIEW_ANIMATION_EXIT_TO_HOME_LAUNCHER : OVERVIEW_ANIMATION_NONE; } @@ -1365,7 +1365,7 @@ void OverviewItem::CloseButtonPressed() { base::RecordAction( base::UserMetricsAction("WindowSelector_OverviewCloseButton")); - if (Shell::Get()->tablet_mode_controller()->InTabletMode()) { + if (display::Screen::GetScreen()->InTabletMode()) { base::RecordAction( base::UserMetricsAction("Tablet_WindowCloseFromOverviewButton")); }
diff --git a/ash/wm/overview/overview_session.cc b/ash/wm/overview/overview_session.cc index ba2ed96f..3933052e 100644 --- a/ash/wm/overview/overview_session.cc +++ b/ash/wm/overview/overview_session.cc
@@ -51,6 +51,8 @@ #include "chromeos/utils/haptics_util.h" #include "ui/aura/client/aura_constants.h" #include "ui/compositor/layer.h" +#include "ui/display/screen.h" +#include "ui/display/tablet_state.h" #include "ui/events/devices/haptic_touchpad_effects.h" #include "ui/events/event.h" #include "ui/views/accessibility/view_accessibility.h" @@ -173,7 +175,6 @@ Shell::Get()->AddShellObserver(this); if (saved_desk_util::IsSavedDesksEnabled()) { - tablet_mode_observation_.Observe(Shell::Get()->tablet_mode_controller()); hide_windows_for_saved_desks_grid_ = std::make_unique<ScopedOverviewHideWindows>( /*windows=*/std::vector<aura::Window*>{}, /*forced_hidden=*/true); @@ -313,8 +314,6 @@ float_container_stacker_.reset(); - tablet_mode_observation_.Reset(); - // Stop the presenter from receiving any events that may update the model or // UI. saved_desk_presenter_.reset(); @@ -885,7 +884,7 @@ // logic to end overview when app list (i.e., home launcher) is open in tablet // mode, so do not handle it here. if (gained_active == Shell::Get()->app_list_controller()->GetWindow() && - !Shell::Get()->tablet_mode_controller()->InTabletMode()) { + !display::Screen::GetScreen()->InTabletMode()) { RestoreWindowActivation(false); EndOverview(OverviewEndAction::kAppListActivatedInClamshell); return; @@ -1108,7 +1107,7 @@ // occlusion computations. These should not cause use to exit overview. base::AutoReset<bool> ignore(&ignore_activations_, true); - if (Shell::Get()->tablet_mode_controller()->InTabletMode() || + if (display::Screen::GetScreen()->InTabletMode() || IsShowingSavedDeskLibrary()) { return; } @@ -1347,9 +1346,8 @@ // we let the app list to handle the key event. // TODO(crbug.com/952315): Explore better ways to handle this splitview + // overview + applist case. - Shell* shell = Shell::Get(); - if (!shell->tablet_mode_controller()->InTabletMode() && - shell->app_list_controller()->IsVisible()) { + if (!display::Screen::GetScreen()->InTabletMode() && + Shell::Get()->app_list_controller()->IsVisible()) { return; } @@ -1538,11 +1536,12 @@ RefreshNoWindowsWidgetBoundsOnEachGrid(/*animate=*/false); } -void OverviewSession::OnTabletModeStarted() { - OnTabletModeChanged(); -} +void OverviewSession::OnDisplayTabletStateChanged(display::TabletState state) { + if (display::IsTabletStateChanging(state)) { + // Do nothing if the tablet state is still in the process of transition. + return; + } -void OverviewSession::OnTabletModeEnded() { OnTabletModeChanged(); } @@ -1561,7 +1560,7 @@ } bool OverviewSession::ProcessForScrolling(const ui::KeyEvent& event) { - if (!Shell::Get()->IsInTabletMode()) { + if (!display::Screen::GetScreen()->InTabletMode()) { return false; }
diff --git a/ash/wm/overview/overview_session.h b/ash/wm/overview/overview_session.h index 1ea8948..e7f8440 100644 --- a/ash/wm/overview/overview_session.h +++ b/ash/wm/overview/overview_session.h
@@ -13,7 +13,6 @@ #include "ash/ash_export.h" #include "ash/public/cpp/shelf_types.h" -#include "ash/public/cpp/tablet_mode_observer.h" #include "ash/shell_observer.h" #include "ash/wm/desks/desks_controller.h" #include "ash/wm/overview/overview_types.h" @@ -31,6 +30,10 @@ #include "ui/events/event_handler.h" #include "ui/wm/public/activation_change_observer.h" +namespace display { +enum class TabletState; +} // namespace display + namespace gfx { class PointF; } // namespace gfx @@ -62,7 +65,6 @@ public ui::EventHandler, public ShellObserver, public SplitViewObserver, - public TabletModeObserver, public DesksController::Observer { public: using WindowList = std::vector<aura::Window*>; @@ -335,6 +337,7 @@ void OnDisplayAdded(const display::Display& display) override; void OnDisplayMetricsChanged(const display::Display& display, uint32_t metrics) override; + void OnDisplayTabletStateChanged(display::TabletState state) override; // aura::WindowObserver: void OnWindowDestroying(aura::Window* window) override; @@ -354,10 +357,6 @@ SplitViewController::State state) override; void OnSplitViewDividerPositionChanged() override; - // TabletModeObserver: - void OnTabletModeStarted() override; - void OnTabletModeEnded() override; - OverviewDelegate* delegate() { return delegate_; } bool ignore_activations() const { return ignore_activations_; } @@ -531,8 +530,6 @@ // such as scrolling and dragging. std::unique_ptr<ScopedFloatContainerStacker> float_container_stacker_; - std::optional<display::ScopedDisplayObserver> display_observer_; - // Boolean to indicate whether chromeVox is enabled or not. bool chromevox_enabled_; @@ -552,8 +549,7 @@ // removed. bool allow_empty_desk_without_exiting_ = false; - base::ScopedObservation<TabletModeController, TabletModeObserver> - tablet_mode_observation_{this}; + std::optional<display::ScopedDisplayObserver> display_observer_; base::ScopedObservation<DesksController, DesksController::Observer> desks_controller_observation_{this};
diff --git a/ash/wm/overview/overview_session_unittest.cc b/ash/wm/overview/overview_session_unittest.cc index 95945ad..8857875 100644 --- a/ash/wm/overview/overview_session_unittest.cc +++ b/ash/wm/overview/overview_session_unittest.cc
@@ -107,6 +107,7 @@ #include "ui/compositor/test/test_utils.h" #include "ui/display/display_layout.h" #include "ui/display/manager/display_manager.h" +#include "ui/display/screen.h" #include "ui/display/test/display_manager_test_api.h" #include "ui/events/event_utils.h" #include "ui/events/gesture_detection/gesture_configuration.h" @@ -8857,7 +8858,7 @@ // Test some basic functionalities in clamshell splitview mode. TEST_F(SplitViewOverviewSessionInClamshellTest, BasicFunctionalitiesTest) { UpdateDisplay("600x400"); - EXPECT_FALSE(Shell::Get()->tablet_mode_controller()->InTabletMode()); + EXPECT_FALSE(display::Screen::GetScreen()->InTabletMode()); // 1. Test the 1 window scenario. const gfx::Rect bounds(400, 400);
diff --git a/ash/wm/overview/overview_utils.cc b/ash/wm/overview/overview_utils.cc index 3c9823c..ba9adadf 100644 --- a/ash/wm/overview/overview_utils.cc +++ b/ash/wm/overview/overview_utils.cc
@@ -27,7 +27,6 @@ #include "ash/wm/splitview/split_view_controller.h" #include "ash/wm/splitview/split_view_overview_session.h" #include "ash/wm/splitview/split_view_utils.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_state.h" #include "ash/wm/window_transient_descendant_iterator.h" #include "ash/wm/window_util.h" @@ -36,6 +35,7 @@ #include "ui/aura/client/aura_constants.h" #include "ui/aura/window.h" #include "ui/compositor/layer.h" +#include "ui/display/screen.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/transform_util.h" #include "ui/views/view.h" @@ -248,8 +248,7 @@ // Hotseat overlaps the work area / split view bounds when extended, but in // some cases we don't want its bounds in our calculations. - if (account_for_hotseat && - Shell::Get()->tablet_mode_controller()->InTabletMode()) { + if (account_for_hotseat && display::Screen::GetScreen()->InTabletMode()) { Shelf* shelf = Shelf::ForWindow(target_root); const bool hotseat_extended = shelf->shelf_layout_manager()->hotseat_state() == @@ -307,10 +306,12 @@ } std::optional<gfx::RectF> GetSplitviewBoundsMaintainingAspectRatio() { - if (!ShouldAllowSplitView()) - return std::nullopt; - if (!Shell::Get()->tablet_mode_controller()->InTabletMode()) - return std::nullopt; + if (!ShouldAllowSplitView()) { + return absl::nullopt; + } + if (!display::Screen::GetScreen()->InTabletMode()) { + return absl::nullopt; + } auto* overview_session = OverviewController::Get()->overview_session(); DCHECK(overview_session); aura::Window* root_window = Shell::GetPrimaryRootWindow(); @@ -334,7 +335,7 @@ } bool ShouldUseTabletModeGridLayout() { - return Shell::Get()->tablet_mode_controller()->InTabletMode(); + return display::Screen::GetScreen()->InTabletMode(); } gfx::Rect ToStableSizeRoundedRect(const gfx::RectF& rect) {
diff --git a/ash/wm/overview/overview_window_drag_controller.cc b/ash/wm/overview/overview_window_drag_controller.cc index 730e300..414d24ad 100644 --- a/ash/wm/overview/overview_window_drag_controller.cc +++ b/ash/wm/overview/overview_window_drag_controller.cc
@@ -26,7 +26,6 @@ #include "ash/wm/splitview/split_view_constants.h" #include "ash/wm/splitview/split_view_drag_indicators.h" #include "ash/wm/splitview/split_view_utils.h" -#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_positioning_utils.h" #include "ash/wm/window_util.h" #include "base/debug/crash_logging.h" @@ -39,6 +38,7 @@ #include "ui/compositor/layer.h" #include "ui/compositor/presentation_time_recorder.h" #include "ui/display/display.h" +#include "ui/display/screen.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect_conversions.h" #include "ui/wm/core/coordinate_conversion.h" @@ -1004,7 +1004,7 @@ void OverviewWindowDragController::RecordNormalDrag( NormalDragAction action, bool is_dragged_to_other_display) const { - const bool is_tablet = Shell::Get()->tablet_mode_controller()->InTabletMode(); + const bool is_tablet = display::Screen::GetScreen()->InTabletMode(); if (is_dragged_to_other_display) { DCHECK(!is_touch_dragging_); if (!is_tablet) { @@ -1046,7 +1046,7 @@ OverviewDragAction::kSwipeToCloseSuccessfulTabletTouch, OverviewDragAction::kSwipeToCloseCanceledTabletTouch, OverviewDragAction::kFlingToCloseTabletTouch}; - RecordDrag(Shell::Get()->tablet_mode_controller()->InTabletMode() + RecordDrag(display::Screen::GetScreen()->InTabletMode() ? kTabletDrag[action] : kClamshellDrag[action]); }
diff --git a/ash/wm/overview/overview_window_drag_controller_unittest.cc b/ash/wm/overview/overview_window_drag_controller_unittest.cc index c009d758..14777614 100644 --- a/ash/wm/overview/overview_window_drag_controller_unittest.cc +++ b/ash/wm/overview/overview_window_drag_controller_unittest.cc
@@ -14,7 +14,6 @@ #include "ash/wm/desks/desks_histogram_enums.h" #include "ash/wm/desks/desks_util.h" #include "ash/wm/desks/legacy_desk_bar_view.h" -#include "ash/wm/desks/zero_state_button.h" #include "ash/wm/overview/overview_controller.h" #include "ash/wm/overview/overview_drop_target.h" #include "ash/wm/overview/overview_grid.h"
diff --git a/ash/wm/pip/pip_controller_unittest.cc b/ash/wm/pip/pip_controller_unittest.cc index 98cfd98..a5d0cf9 100644 --- a/ash/wm/pip/pip_controller_unittest.cc +++ b/ash/wm/pip/pip_controller_unittest.cc
@@ -158,19 +158,42 @@ EXPECT_EQ(test_api.dimmer()->window()->layer()->opacity(), 0.f); } -TEST_F(PipControllerTest, TuckHandleIsShownOnTuck) { +TEST_F(PipControllerTest, TuckHandleIsShownAtCorrectPosition) { PipController* controller = Shell::Get()->pip_controller(); PipControllerTestAPI test_api(controller); - const gfx::Rect bounds(0, 0, kPipWidth, kPipHeight); - std::unique_ptr<aura::Window> window(CreatePipWindow(bounds)); + const gfx::Rect pip_bounds(kCollisionWindowWorkAreaInsetsDp, + kCollisionWindowWorkAreaInsetsDp, kPipWidth, + kPipHeight); + std::unique_ptr<aura::Window> window(CreatePipWindow(pip_bounds)); - // Tuck the window and confirm that the dimmer is shown. + // Tuck the window and confirm that the tuck handle is shown at the correct + // position. controller->TuckWindow(/*left=*/true); EXPECT_TRUE(test_api.scoped_window_tucker()); EXPECT_TRUE(test_api.scoped_window_tucker()->tuck_handle_widget()); + gfx::Rect tuck_handle_bounds( + 0, + kCollisionWindowWorkAreaInsetsDp + + (kPipHeight - ScopedWindowTucker::kTuckHandleHeight) / 2, + ScopedWindowTucker::kTuckHandleWidth, + ScopedWindowTucker::kTuckHandleHeight); + EXPECT_EQ(tuck_handle_bounds, test_api.scoped_window_tucker() + ->tuck_handle_widget() + ->GetWindowBoundsInScreen()); - // Untuck the window and confirm that the dimmer's opacity is now 0. + // Move PiP and confirm that the tuck handle follows. + gfx::Rect tucked_pip_bounds = window->GetBoundsInScreen(); + tucked_pip_bounds.Offset(0, 100); + SetBoundsWMEvent event(tucked_pip_bounds, /*animate=*/false); + WindowState* window_state = WindowState::Get(window.get()); + window_state->OnWMEvent(&event); + tuck_handle_bounds.Offset(0, 100); + EXPECT_EQ(tuck_handle_bounds, test_api.scoped_window_tucker() + ->tuck_handle_widget() + ->GetWindowBoundsInScreen()); + + // Untuck the window and confirm that the tuck handle is gone. controller->UntuckWindow(); EXPECT_FALSE(test_api.scoped_window_tucker()); }
diff --git a/ash/wm/scoped_window_tucker.cc b/ash/wm/scoped_window_tucker.cc index 51b1fe3..00a11999 100644 --- a/ash/wm/scoped_window_tucker.cc +++ b/ash/wm/scoped_window_tucker.cc
@@ -113,6 +113,7 @@ left_(left), event_blocker_(window) { InitializeTuckHandleWidget(); + window_observation_.Observe(window); } ScopedWindowTucker::~ScopedWindowTucker() { @@ -223,6 +224,15 @@ OnOverviewModeChanged(/*in_overview=*/false); } +void ScopedWindowTucker::OnWindowBoundsChanged( + aura::Window* window, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds, + ui::PropertyChangeReason reason) { + aura::Window* tuck_handle = tuck_handle_widget_->GetNativeWindow(); + tuck_handle->SetBounds(delegate_->GetTuckHandleBounds(left_, new_bounds)); +} + void ScopedWindowTucker::InitializeTuckHandleWidget() { views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.opacity = views::Widget::InitParams::WindowOpacity::kTranslucent;
diff --git a/ash/wm/scoped_window_tucker.h b/ash/wm/scoped_window_tucker.h index 9cd66db..53cdbc7 100644 --- a/ash/wm/scoped_window_tucker.h +++ b/ash/wm/scoped_window_tucker.h
@@ -27,7 +27,8 @@ // tuck handle widget that will bring the hidden window back onscreen. Users of // the class need to ensure that window outlives instance of this class. class ScopedWindowTucker : public wm::ActivationChangeObserver, - public OverviewObserver { + public OverviewObserver, + public aura::WindowObserver { public: static constexpr int kTuckHandleWidth = 20; static constexpr int kTuckHandleHeight = 92; @@ -137,6 +138,12 @@ void OnOverviewModeStarting() override; void OnOverviewModeEndingAnimationComplete(bool canceled) override; + // aura::WindowObserver: + void OnWindowBoundsChanged(aura::Window* window, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds, + ui::PropertyChangeReason reason) override; + private: // Initializes the tuck handle widget. void InitializeTuckHandleWidget(); @@ -163,6 +170,9 @@ base::ScopedObservation<OverviewController, OverviewObserver> overview_observer_{this}; + base::ScopedObservation<aura::Window, aura::WindowObserver> + window_observation_{this}; + base::WeakPtrFactory<ScopedWindowTucker> weak_factory_{this}; };
diff --git a/ash/wm/window_dimmer.cc b/ash/wm/window_dimmer.cc index 2b6ba9c8..7cd3071 100644 --- a/ash/wm/window_dimmer.cc +++ b/ash/wm/window_dimmer.cc
@@ -13,6 +13,7 @@ #include "ui/compositor/layer.h" #include "ui/wm/core/visibility_controller.h" #include "ui/wm/core/window_animations.h" +#include "ui/wm/public/activation_delegate.h" namespace ash { namespace { @@ -29,6 +30,7 @@ : parent_(parent), window_(new aura::Window(nullptr, aura::client::WINDOW_TYPE_NORMAL)), delegate_(delegate) { + wm::SetActivationDelegate(window_, this); window_->Init(ui::LAYER_SOLID_COLOR); window_->SetName("Dimming Window"); if (animate) { @@ -91,6 +93,11 @@ UpdateDimColor(); } +bool WindowDimmer::ShouldActivate() const { + // The dimming window should never be activate-able. + return false; +} + void WindowDimmer::OnWindowBoundsChanged(aura::Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds,
diff --git a/ash/wm/window_dimmer.h b/ash/wm/window_dimmer.h index 05c16cff..1468241 100644 --- a/ash/wm/window_dimmer.h +++ b/ash/wm/window_dimmer.h
@@ -10,6 +10,7 @@ #include "ui/aura/window_observer.h" #include "ui/color/color_id.h" #include "ui/color/color_provider_source_observer.h" +#include "ui/wm/public/activation_delegate.h" namespace ash { @@ -24,7 +25,8 @@ // deleted out from under it (this generally happens if the parent of the // window is deleted). If WindowDimmer is deleted and the window it created is // still valid, then WindowDimmer deletes the window. -class ASH_EXPORT WindowDimmer : public aura::WindowObserver, +class ASH_EXPORT WindowDimmer : public wm::ActivationDelegate, + public aura::WindowObserver, public ui::ColorProviderSourceObserver { public: // Defines an interface for an optional delegate to the WindowDimmer, which @@ -71,6 +73,9 @@ // `color_id`. This color must not be opaque. void SetDimColor(ui::ColorId color_id); + // wm::ActivationDelegate: + bool ShouldActivate() const override; + // NOTE: WindowDimmer is an observer for both |parent_| and |window_|. // aura::WindowObserver: void OnWindowBoundsChanged(aura::Window* window,
diff --git a/ash/wm/window_dimmer_unittest.cc b/ash/wm/window_dimmer_unittest.cc index 9f717fa..366bce41 100644 --- a/ash/wm/window_dimmer_unittest.cc +++ b/ash/wm/window_dimmer_unittest.cc
@@ -9,6 +9,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/aura/test/aura_test_base.h" #include "ui/aura/test/test_windows.h" +#include "ui/wm/core/window_util.h" namespace ash { @@ -21,6 +22,7 @@ SK_ColorWHITE, 1, root_window->bounds(), root_window); bottom_window->TrackOcclusionState(); WindowDimmer dimmer(root_window); + EXPECT_EQ(aura::Window::OcclusionState::VISIBLE, bottom_window->GetOcclusionState()); // Sanity check: An opaque window on top of |bottom_window| occludes it. @@ -28,6 +30,10 @@ root_window); EXPECT_EQ(aura::Window::OcclusionState::OCCLUDED, bottom_window->GetOcclusionState()); + + // The dimming window should never be activate-able even when it's visible. + dimmer.window()->Show(); + EXPECT_FALSE(wm::CanActivateWindow(dimmer.window())); } } // namespace ash
diff --git a/base/allocator/partition_allocator/DEPS b/base/allocator/partition_allocator/DEPS index 98a3aa9..8a9351b 100644 --- a/base/allocator/partition_allocator/DEPS +++ b/base/allocator/partition_allocator/DEPS
@@ -43,3 +43,8 @@ "+third_party/abseil-cpp/absl/types/optional.h", ] } + +# In the context of a module-level DEPS, the `deps` variable must be defined. +# Some tools relies on it. For instance dawn/tools/fetch_dawn_dependencies.py +# This has no use in other contexts. +deps = {}
diff --git a/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn b/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn index f01adfdf..5348ddf 100644 --- a/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn +++ b/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn
@@ -103,7 +103,7 @@ _add_configs += [ "//build/config/compiler:no_optimize" ] } -source_set("raw_ptr") { +component("raw_ptr") { # `gn check` is unhappy with most `#includes` when PA isn't # actually built. check_includes = use_partition_alloc @@ -135,6 +135,7 @@ ] } else { sources += [ "pointers/raw_ptr_noop_impl.h" ] + sources += [ "pointers/empty.cc" ] } if (use_partition_alloc) { public_deps = [ ":partition_alloc" ]
diff --git a/base/allocator/partition_allocator/src/partition_alloc/pointers/empty.cc b/base/allocator/partition_allocator/src/partition_alloc/pointers/empty.cc new file mode 100644 index 0000000..f2cab740 --- /dev/null +++ b/base/allocator/partition_allocator/src/partition_alloc/pointers/empty.cc
@@ -0,0 +1,9 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This empty.cc is built when raw_ptr_noop_impl.h is used to avoid +// the situation: no object files are linked to build raw_ptr.dll. +// If raw_ptr target's sources has only header files, no object +// files will be generated and we will see the following error: +// "lld_link:error: <root>: undefined symbol: _DllMainCRTStartup."
diff --git a/base/feature_list.cc b/base/feature_list.cc index 4bfd546..ce1a239 100644 --- a/base/feature_list.cc +++ b/base/feature_list.cc
@@ -268,9 +268,8 @@ #endif } -void FeatureList::InitializeFromCommandLine( - const std::string& enable_features, - const std::string& disable_features) { +void FeatureList::InitFromCommandLine(const std::string& enable_features, + const std::string& disable_features) { DCHECK(!initialized_); std::string parsed_enable_features; @@ -310,8 +309,7 @@ initialized_from_command_line_ = true; } -void FeatureList::InitializeFromSharedMemory( - PersistentMemoryAllocator* allocator) { +void FeatureList::InitFromSharedMemory(PersistentMemoryAllocator* allocator) { DCHECK(!initialized_); PersistentMemoryAllocator::Iterator iter(allocator); @@ -506,14 +504,14 @@ } // static -bool FeatureList::InitializeInstance(const std::string& enable_features, - const std::string& disable_features) { - return InitializeInstance(enable_features, disable_features, - std::vector<FeatureOverrideInfo>()); +bool FeatureList::InitInstance(const std::string& enable_features, + const std::string& disable_features) { + return InitInstance(enable_features, disable_features, + std::vector<FeatureOverrideInfo>()); } // static -bool FeatureList::InitializeInstance( +bool FeatureList::InitInstance( const std::string& enable_features, const std::string& disable_features, const std::vector<FeatureOverrideInfo>& extra_overrides) { @@ -540,7 +538,7 @@ } std::unique_ptr<FeatureList> feature_list(new FeatureList); - feature_list->InitializeFromCommandLine(enable_features, disable_features); + feature_list->InitFromCommandLine(enable_features, disable_features); feature_list->RegisterExtraFeatureOverrides(extra_overrides); FeatureList::SetInstance(std::move(feature_list)); return !instance_existed_before;
diff --git a/base/feature_list.h b/base/feature_list.h index 5e013b2..c986654b 100644 --- a/base/feature_list.h +++ b/base/feature_list.h
@@ -274,13 +274,13 @@ // If a feature name is prefixed with the '*' character, it will be created // with OVERRIDE_USE_DEFAULT - which is useful for associating with a trial // while using the default state. - void InitializeFromCommandLine(const std::string& enable_features, - const std::string& disable_features); + void InitFromCommandLine(const std::string& enable_features, + const std::string& disable_features); // Initializes feature overrides through the field trial allocator, which // we're using to store the feature names, their override state, and the name // of the associated field trial. - void InitializeFromSharedMemory(PersistentMemoryAllocator* allocator); + void InitFromSharedMemory(PersistentMemoryAllocator* allocator); // Returns true if the state of |feature_name| has been overridden (regardless // of whether the overridden value is the same as the default value) for any @@ -288,21 +288,21 @@ bool IsFeatureOverridden(const std::string& feature_name) const; // Returns true if the state of |feature_name| has been overridden via - // |InitializeFromCommandLine()|. This includes features explicitly + // |InitFromCommandLine()|. This includes features explicitly // disabled/enabled with --disable-features and --enable-features, as well as // any extra feature overrides that depend on command line switches. bool IsFeatureOverriddenFromCommandLine( const std::string& feature_name) const; // Returns true if the state |feature_name| has been overridden by - // |InitializeFromCommandLine()| and the state matches |state|. + // |InitFromCommandLine()| and the state matches |state|. bool IsFeatureOverriddenFromCommandLine(const std::string& feature_name, OverrideState state) const; // Associates a field trial for reporting purposes corresponding to the // command-line setting the feature state to |for_overridden_state|. The trial // will be activated when the state of the feature is first queried. This - // should be called during registration, after InitializeFromCommandLine() has + // should be called during registration, after InitFromCommandLine() has // been called but before the instance is registered via SetInstance(). void AssociateReportingFieldTrial(const std::string& feature_name, OverrideState for_overridden_state, @@ -313,7 +313,7 @@ // over field trials, so this will have no effect if the feature is being // overridden from the command-line. The associated field trial will be // activated when the feature state for this feature is queried. This should - // be called during registration, after InitializeFromCommandLine() has been + // be called during registration, after InitFromCommandLine() has been // called but before the instance is registered via SetInstance(). void RegisterFieldTrialOverride(const std::string& feature_name, OverrideState override_state, @@ -321,7 +321,7 @@ // Adds extra overrides (not associated with a field trial). Should be called // before SetInstance(). - // The ordering of calls with respect to InitializeFromCommandLine(), + // The ordering of calls with respect to InitFromCommandLine(), // RegisterFieldTrialOverride(), etc. matters. The first call wins out, // because the |overrides_| map uses insert(), which retains the first // inserted entry and does not overwrite it on subsequent calls to insert(). @@ -332,7 +332,7 @@ void AddFeaturesToAllocator(PersistentMemoryAllocator* allocator); // Returns comma-separated lists of feature names (in the same format that is - // accepted by InitializeFromCommandLine()) corresponding to features that + // accepted by InitFromCommandLine()) corresponding to features that // have been overridden - either through command-line or via FieldTrials. For // those features that have an associated FieldTrial, the output entry will be // of the format "FeatureName<TrialName" (|include_group_name|=false) or @@ -435,15 +435,15 @@ // Initializes and sets an instance of FeatureList with feature overrides via // command-line flags |enable_features| and |disable_features| if one has not // already been set from command-line flags. Returns true if an instance did - // not previously exist. See InitializeFromCommandLine() for more details + // not previously exist. See InitFromCommandLine() for more details // about |enable_features| and |disable_features| parameters. - static bool InitializeInstance(const std::string& enable_features, - const std::string& disable_features); + static bool InitInstance(const std::string& enable_features, + const std::string& disable_features); // Like the above, but also adds extra overrides. If a feature appears in // |extra_overrides| and also |enable_features| or |disable_features|, the // disable/enable will supersede the extra overrides. - static bool InitializeInstance( + static bool InitInstance( const std::string& enable_features, const std::string& disable_features, const std::vector<FeatureOverrideInfo>& extra_overrides);
diff --git a/base/feature_list_unittest.cc b/base/feature_list_unittest.cc index 0f9e6e0..c33ed75b 100644 --- a/base/feature_list_unittest.cc +++ b/base/feature_list_unittest.cc
@@ -63,7 +63,7 @@ EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault)); } -TEST_F(FeatureListTest, InitializeFromCommandLine) { +TEST_F(FeatureListTest, InitFromCommandLine) { struct { const char* enable_features; const char* disable_features; @@ -86,8 +86,8 @@ test_case.disable_features)); auto feature_list = std::make_unique<FeatureList>(); - feature_list->InitializeFromCommandLine(test_case.enable_features, - test_case.disable_features); + feature_list->InitFromCommandLine(test_case.enable_features, + test_case.disable_features); test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatureList(std::move(feature_list)); @@ -110,7 +110,7 @@ } } -TEST_F(FeatureListTest, InitializeFromCommandLineWithFeatureParams) { +TEST_F(FeatureListTest, InitFromCommandLineWithFeatureParams) { struct { const std::string enable_features; const std::string expected_field_trial_created; @@ -133,7 +133,7 @@ SCOPED_TRACE(test_case.enable_features); auto feature_list = std::make_unique<FeatureList>(); - feature_list->InitializeFromCommandLine(test_case.enable_features, ""); + feature_list->InitFromCommandLine(test_case.enable_features, ""); test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatureList(std::move(feature_list)); @@ -256,7 +256,7 @@ auto feature_list = std::make_unique<FeatureList>(); // The feature is explicitly enabled on the command-line. - feature_list->InitializeFromCommandLine(kFeatureOffByDefaultName, ""); + feature_list->InitFromCommandLine(kFeatureOffByDefaultName, ""); // But the FieldTrial would set the feature to disabled. FieldTrial* trial = FieldTrialList::CreateFieldTrial("TrialExample2", "A"); @@ -278,7 +278,7 @@ auto feature_list = std::make_unique<FeatureList>(); // The feature is explicitly disabled on the command-line. - feature_list->InitializeFromCommandLine("", kFeatureOffByDefaultName); + feature_list->InitFromCommandLine("", kFeatureOffByDefaultName); // But the FieldTrial would set the feature to enabled. FieldTrial* trial = FieldTrialList::CreateFieldTrial("TrialExample2", "A"); @@ -341,7 +341,7 @@ kFeatureOffByDefaultName, FeatureList::OVERRIDE_ENABLE_FEATURE)); // Now, enable |kFeatureOffByDefaultName| via the command-line. - feature_list->InitializeFromCommandLine(kFeatureOffByDefaultName, ""); + feature_list->InitFromCommandLine(kFeatureOffByDefaultName, ""); // It should now be overridden for the enabled group. EXPECT_TRUE(feature_list->IsFeatureOverridden(kFeatureOffByDefaultName)); @@ -414,8 +414,8 @@ outer_scope.InitWithEmptyFeatureAndFieldTrialLists(); auto feature_list = std::make_unique<FeatureList>(); - feature_list->InitializeFromCommandLine(test_case.enable_features, - test_case.disable_features); + feature_list->InitFromCommandLine(test_case.enable_features, + test_case.disable_features); FieldTrial* enable_trial = nullptr; if (feature_list->IsFeatureOverriddenFromCommandLine( @@ -469,10 +469,10 @@ EXPECT_TRUE(FeatureList::IsEnabled(kFeatureOffByDefault)); } -TEST_F(FeatureListTest, InitializeFromCommandLineThenRegisterExtraOverrides) { +TEST_F(FeatureListTest, InitFromCommandLineThenRegisterExtraOverrides) { auto feature_list = std::make_unique<FeatureList>(); - feature_list->InitializeFromCommandLine(kFeatureOnByDefaultName, - kFeatureOffByDefaultName); + feature_list->InitFromCommandLine(kFeatureOnByDefaultName, + kFeatureOffByDefaultName); std::vector<FeatureList::FeatureOverrideInfo> overrides; overrides.push_back({std::cref(kFeatureOnByDefault), FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE}); @@ -482,7 +482,7 @@ test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatureList(std::move(feature_list)); - // The InitializeFromCommandLine supersedes the RegisterExtraFeatureOverrides + // The InitFromCommandLine supersedes the RegisterExtraFeatureOverrides // because it was called first. EXPECT_TRUE(FeatureList::IsEnabled(kFeatureOnByDefault)); EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault)); @@ -497,7 +497,7 @@ TEST_F(FeatureListTest, GetFeatureOverrides) { auto feature_list = std::make_unique<FeatureList>(); - feature_list->InitializeFromCommandLine("A,X", "D"); + feature_list->InitFromCommandLine("A,X", "D"); Feature feature_b = {"B", FEATURE_ENABLED_BY_DEFAULT}; Feature feature_c = {"C", FEATURE_DISABLED_BY_DEFAULT}; @@ -531,7 +531,7 @@ TEST_F(FeatureListTest, GetFeatureOverrides_UseDefault) { auto feature_list = std::make_unique<FeatureList>(); - feature_list->InitializeFromCommandLine("A,X", "D"); + feature_list->InitFromCommandLine("A,X", "D"); FieldTrial* trial = FieldTrialList::CreateFieldTrial("Trial", "Group"); feature_list->RegisterFieldTrialOverride( @@ -560,10 +560,10 @@ EXPECT_EQ(nullptr, FeatureList::GetFieldTrial(kFeatureOffByDefault)); } -TEST_F(FeatureListTest, InitializeFromCommandLine_WithFieldTrials) { +TEST_F(FeatureListTest, InitFromCommandLine_WithFieldTrials) { FieldTrialList::CreateFieldTrial("Trial", "Group"); auto feature_list = std::make_unique<FeatureList>(); - feature_list->InitializeFromCommandLine("A,OffByDefault<Trial,X", "D"); + feature_list->InitFromCommandLine("A,OffByDefault<Trial,X", "D"); test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatureList(std::move(feature_list)); @@ -572,12 +572,12 @@ EXPECT_TRUE(FieldTrialList::IsTrialActive("Trial")); } -TEST_F(FeatureListTest, InitializeFromCommandLine_UseDefault) { +TEST_F(FeatureListTest, InitFromCommandLine_UseDefault) { FieldTrialList::CreateFieldTrial("T1", "Group"); FieldTrialList::CreateFieldTrial("T2", "Group"); auto feature_list = std::make_unique<FeatureList>(); - feature_list->InitializeFromCommandLine( - "A,*OffByDefault<T1,*OnByDefault<T2,X", "D"); + feature_list->InitFromCommandLine("A,*OffByDefault<T1,*OnByDefault<T2,X", + "D"); test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatureList(std::move(feature_list)); @@ -590,7 +590,7 @@ EXPECT_TRUE(FieldTrialList::IsTrialActive("T2")); } -TEST_F(FeatureListTest, InitializeInstance) { +TEST_F(FeatureListTest, InitInstance) { std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatureList(std::move(feature_list)); @@ -599,12 +599,12 @@ EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault)); // Initialize from command line if we haven't yet. - FeatureList::InitializeInstance("", kFeatureOnByDefaultName); + FeatureList::InitInstance("", kFeatureOnByDefaultName); EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOnByDefault)); EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault)); // Do not initialize from commandline if we have already. - FeatureList::InitializeInstance(kFeatureOffByDefaultName, ""); + FeatureList::InitInstance(kFeatureOffByDefaultName, ""); EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOnByDefault)); EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault)); } @@ -650,7 +650,7 @@ EXPECT_FALSE(feature_list2->IsFeatureOverriddenFromCommandLine( kFeatureOnByDefaultName, FeatureList::OVERRIDE_DISABLE_FEATURE)); - feature_list2->InitializeFromSharedMemory(&allocator); + feature_list2->InitFromSharedMemory(&allocator); // Check that the new feature list now has 2 overrides. EXPECT_TRUE(feature_list2->IsFeatureOverriddenFromCommandLine( kFeatureOffByDefaultName, FeatureList::OVERRIDE_ENABLE_FEATURE)); @@ -678,7 +678,7 @@ feature_list->AddFeaturesToAllocator(&allocator); std::unique_ptr<base::FeatureList> feature_list2(new base::FeatureList); - feature_list2->InitializeFromSharedMemory(&allocator); + feature_list2->InitFromSharedMemory(&allocator); feature_list2->FinalizeInitialization(); // Check that the field trials are still associated. @@ -718,7 +718,7 @@ FeatureList::OVERRIDE_USE_DEFAULT); } -TEST(FeatureListAccessorTest, InitializeFromCommandLine) { +TEST(FeatureListAccessorTest, InitFromCommandLine) { struct { const char* enable_features; const char* disable_features; @@ -750,8 +750,8 @@ test::ScopedFeatureList scoped_feature_list; auto feature_list = std::make_unique<FeatureList>(); auto feature_list_accessor = feature_list->ConstructAccessor(); - feature_list->InitializeFromCommandLine(test_case.enable_features, - test_case.disable_features); + feature_list->InitFromCommandLine(test_case.enable_features, + test_case.disable_features); scoped_feature_list.InitWithFeatureList(std::move(feature_list)); EXPECT_EQ(test_case.expected_feature_on_state, @@ -765,7 +765,7 @@ } } -TEST(FeatureListAccessorTest, InitializeFromCommandLineWithFeatureParams) { +TEST(FeatureListAccessorTest, InitFromCommandLineWithFeatureParams) { struct { const std::string enable_features; const std::map<std::string, std::string> expected_feature_params; @@ -786,7 +786,7 @@ test::ScopedFeatureList scoped_feature_list; auto feature_list = std::make_unique<FeatureList>(); auto feature_list_accessor = feature_list->ConstructAccessor(); - feature_list->InitializeFromCommandLine(test_case.enable_features, ""); + feature_list->InitFromCommandLine(test_case.enable_features, ""); scoped_feature_list.InitWithFeatureList(std::move(feature_list)); EXPECT_EQ(FeatureList::OVERRIDE_ENABLE_FEATURE,
diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc index acba79f..b7cce67 100644 --- a/base/metrics/field_trial.cc +++ b/base/metrics/field_trial.cc
@@ -722,8 +722,7 @@ CHECK(global_->create_trials_in_child_process_called_); // TODO(crbug.com/867558): Change to a CHECK. if (global_->field_trial_allocator_) { - feature_list->InitializeFromSharedMemory( - global_->field_trial_allocator_.get()); + feature_list->InitFromSharedMemory(global_->field_trial_allocator_.get()); } }
diff --git a/base/metrics/field_trial_unittest.cc b/base/metrics/field_trial_unittest.cc index f1c0fc5..1d91dd5 100644 --- a/base/metrics/field_trial_unittest.cc +++ b/base/metrics/field_trial_unittest.cc
@@ -922,7 +922,7 @@ test::ScopedFeatureList scoped_feature_list1; scoped_feature_list1.InitWithEmptyFeatureAndFieldTrialLists(); std::unique_ptr<FeatureList> feature_list(new FeatureList); - feature_list->InitializeFromCommandLine("A,B", "C"); + feature_list->InitFromCommandLine("A,B", "C"); FieldTrial* trial = FieldTrialList::CreateFieldTrial("Trial1", "Group1"); feature_list->RegisterFieldTrialOverride(
diff --git a/base/test/scoped_feature_list.cc b/base/test/scoped_feature_list.cc index 2f273be9..5189520 100644 --- a/base/test/scoped_feature_list.cc +++ b/base/test/scoped_feature_list.cc
@@ -260,7 +260,7 @@ } // Returns a command line string suitable to pass to -// FeatureList::InitializeFromCommandLine(). For example, +// FeatureList::InitFromCommandLine(). For example, // {{"Feature1", "Study1", "Group1", "Param1/Value1/"}, {"Feature2"}} returns: // - |enabled_feature|=true -> "Feature1<Study1.Group1:Param1/Value1/,Feature2" // - |enabled_feature|=false -> "Feature1<Study1.Group1,Feature2" @@ -558,7 +558,7 @@ // If |create_associated_field_trials| is true, we want to match the // behavior of VariationsFieldTrialCreator to always associate a field // trial, even when there no params. Since - // FeatureList::InitializeFromCommandLine() doesn't associate a field trial + // FeatureList::InitFromCommandLine() doesn't associate a field trial // when there are no params, we do it here. if (!feature.has_params()) { scoped_refptr<FieldTrial> field_trial_without_params = @@ -598,7 +598,7 @@ merged_features.disabled_feature_list, /*enable_features=*/false); std::unique_ptr<FeatureList> new_feature_list(new FeatureList); - new_feature_list->InitializeFromCommandLine(enabled, disabled); + new_feature_list->InitFromCommandLine(enabled, disabled); InitWithFeatureList(std::move(new_feature_list)); }
diff --git a/base/test/scoped_feature_list_unittest.cc b/base/test/scoped_feature_list_unittest.cc index 9fa54bf..7f9d4a55 100644 --- a/base/test/scoped_feature_list_unittest.cc +++ b/base/test/scoped_feature_list_unittest.cc
@@ -50,7 +50,7 @@ ScopedFeatureListTest() { // Clear default feature list. std::unique_ptr<FeatureList> feature_list(new FeatureList); - feature_list->InitializeFromCommandLine(std::string(), std::string()); + feature_list->InitFromCommandLine(std::string(), std::string()); original_feature_list_ = FeatureList::ClearInstanceForTesting(); FeatureList::SetInstance(std::move(feature_list)); } @@ -651,8 +651,7 @@ feature_list2.InitWithNullFeatureAndFieldTrialLists(); leaked_field_trial_list = std::make_unique<FieldTrialList>(); - FeatureList::InitializeInstance("TestFeature1:TestParam/TestValue2", "", - {}); + FeatureList::InitInstance("TestFeature1:TestParam/TestValue2", "", {}); EXPECT_TRUE(FeatureList::IsEnabled(kTestFeature1)); EXPECT_EQ("TestValue2", GetFieldTrialParamValueByFeature(kTestFeature1, "TestParam"));
diff --git a/base/threading/platform_thread_cros.cc b/base/threading/platform_thread_cros.cc index ec5ecc7..81a0001 100644 --- a/base/threading/platform_thread_cros.cc +++ b/base/threading/platform_thread_cros.cc
@@ -228,7 +228,7 @@ int nice_value = getpriority(PRIO_PROCESS, static_cast<id_t>(thread_id)); if (nice_value == -1 && errno != 0) { // The thread may disappear for any reason so ignore ESRCH. - DPLOG_IF(ERROR, errno != ESRCH) + DVPLOG_IF(1, errno != ESRCH) << "Failed to call getpriority for thread id " << thread_id << ", performance may be effected."; return absl::nullopt; @@ -288,7 +288,7 @@ PlatformThreadId syscall_tid = thread_id == PlatformThread::CurrentId() ? 0 : thread_id; if (sched_setscheduler(syscall_tid, policy, &prio) != 0) { - DPLOG(ERROR) << "Failed to set policy/priority for thread " << thread_id; + DVPLOG(1) << "Failed to set policy/priority for thread " << thread_id; } } @@ -298,8 +298,8 @@ PlatformThreadId syscall_tid = thread_id == PlatformThread::CurrentId() ? 0 : thread_id; const int nice_setting = internal::ThreadTypeToNiceValue(thread_type); if (setpriority(PRIO_PROCESS, static_cast<id_t>(syscall_tid), nice_setting)) { - DPLOG(ERROR) << "Failed to set nice value of thread " << thread_id << " to " - << nice_setting; + DVPLOG(1) << "Failed to set nice value of thread " << thread_id << " to " + << nice_setting; } }
diff --git a/base/win/embedded_i18n/create_string_rc.py b/base/win/embedded_i18n/create_string_rc.py index 50db6db..bccce42 100755 --- a/base/win/embedded_i18n/create_string_rc.py +++ b/base/win/embedded_i18n/create_string_rc.py
@@ -61,6 +61,7 @@ from __future__ import print_function import argparse +import collections import glob import io import os @@ -77,7 +78,8 @@ """Extracts selected strings from a .grd file. Attributes: - messages: A dict mapping string identifiers to their corresponding messages. + messages: A dict mapping string identifiers to their corresponding messages + (key "text") and transconsole ids (key "tc_id"). referenced_xtb_files: A list of all xtb files referenced inside the .grd file. """ @@ -91,18 +93,25 @@ messages are extracted if empty. """ sax.handler.ContentHandler.__init__(self) - self.messages = {} + self.messages = collections.defaultdict(dict) self.referenced_xtb_files = [] self.__id_set = string_id_set self.__message_name = None self.__element_stack = [] self.__text_scraps = [] + + # contains the text in the format required by transconsole to generate the + # corresponding TC fingerprint. + self.__tc_text_scraps = [] + self.__characters_callback = None def startElement(self, name, attrs): self.__element_stack.append(name) if name == 'message': self.__OnOpenMessage(attrs.getValue('name')) + elif name == 'ph': + self.__OnOpenPlaceholder(attrs.getValue('name')) elif name == 'file': parent = self.__element_stack[-2] if parent == 'translations': @@ -131,18 +140,35 @@ if self.__message_name: self.__characters_callback = self.__OnMessageText + def __OnOpenPlaceholder(self, ph_name): + """Invoked at the start of a <ph> with the `name` attribute.""" + if self.__IsExtractingMessage(): + # TC uses the `name` attribute as part of the fingerprint + # generation. + self.__tc_text_scraps.append(ph_name) + def __OnMessageText(self, containing_element, message_text): """Invoked to handle a block of text for a message.""" if message_text and (containing_element == 'message' or containing_element == 'ph'): self.__text_scraps.append(message_text) + if containing_element == 'message': + self.__tc_text_scraps.append(message_text) def __OnCloseMessage(self): """Invoked at the end of a message.""" if self.__IsExtractingMessage(): - self.messages[self.__message_name] = ''.join(self.__text_scraps).strip() + self.messages[self.__message_name]["text"] = ''.join( + self.__text_scraps).strip() + + # Generate the message ID for each source string to correlate it with its + # TC translations in the .xtb files. + self.messages[self.__message_name]["tc_id"] = tclib.GenerateMessageId( + ''.join(self.__tc_text_scraps).strip()) + self.__message_name = None self.__text_scraps = [] + self.__tc_text_scraps = [] self.__characters_callback = None def __OnAddXtbFile(self, xtb_file_path): @@ -175,6 +201,10 @@ self.__element_stack = [] self.__string_ids = None self.__text_scraps = [] + + # The count of the `ph` tags. + self.__ph_count = 0 + self.__characters_callback = None def startDocument(self): @@ -190,6 +220,8 @@ self.__OnLanguage(attrs.getValue('lang')) if name == 'translation': self.__OnOpenTranslation(attrs.getValue('id')) + elif name == 'ph': + self.__OnOpenPlaceholder() def endElement(self, name): popped = self.__element_stack.pop() @@ -201,26 +233,38 @@ if self.__characters_callback: self.__characters_callback(self.__element_stack[-1], content) + def __IsExtractingTranslation(self): + """Returns `True` if a translation is currently being extracted.""" + return self.__string_ids is not None + def __OnLanguage(self, lang): self.lang = lang.replace('-', '_').upper() def __OnOpenTranslation(self, translation_id): - assert self.__string_ids is None + assert not self.__IsExtractingTranslation() self.__string_ids = self.__translation_ids.get(translation_id) if self.__string_ids: self.__characters_callback = self.__OnTranslationText + def __OnOpenPlaceholder(self): + if self.__IsExtractingTranslation(): + # The XTB files contain `ph` tags instead of placeholders, so we add the + # placeholders in the format `$1` in place of the `ph` tags here. + self.__ph_count += 1 + self.__text_scraps.append('$' + str(self.__ph_count)) + def __OnTranslationText(self, containing_element, message_text): if message_text and containing_element == 'translation': self.__text_scraps.append(message_text) def __OnCloseTranslation(self): - if self.__string_ids: + if self.__IsExtractingTranslation(): translated_string = ''.join(self.__text_scraps).strip() for string_id in self.__string_ids: self.translations[string_id] = translated_string self.__string_ids = None self.__text_scraps = [] + self.__ph_count = 0 self.__characters_callback = None @@ -358,19 +402,16 @@ # Manually put the source strings as en-US in the list of translated # strings. translated_strings = [] - for string_id, message_text in source_strings.items(): + for string_id, string_data in source_strings.items(): translated_strings.append(self.__TranslationData(string_id, 'EN_US', - message_text)) + string_data["text"])) - # Generate the message ID for each source string to correlate it with its - # translations in the .xtb files. Multiple source strings may have the same - # message text; hence the message id is mapped to a list of string ids - # instead of a single value. + # Multiple source strings may have the same message text; hence the + # message id is mapped to a list of string ids instead of a single value. translation_ids = {} - for (string_id, message_text) in source_strings.items(): - message_id = tclib.GenerateMessageId(message_text) - translation_ids.setdefault(message_id, []).append(string_id); + for (string_id, string_data) in source_strings.items(): + translation_ids.setdefault(string_data["tc_id"], []).append(string_id); # Track any xtb files that appear in the xtb folder but are not present in # the grd file. @@ -383,9 +424,9 @@ if not xtb_filename in source_xtb_files: extra_xtb_files.append(xtb_filename) sax_parser.parse(xtb_filename) - for string_id, message_text in source_strings.items(): + for string_id, string_data in source_strings.items(): translated_string = xtb_handler.translations.get(string_id, - message_text) + string_data["text"]) translated_strings.append(self.__TranslationData(string_id, xtb_handler.lang, translated_string))
diff --git a/build/config/siso/devtools_frontend.star b/build/config/siso/devtools_frontend.star index a2b6af3..dc9f3e9 100644 --- a/build/config/siso/devtools_frontend.star +++ b/build/config/siso/devtools_frontend.star
@@ -25,35 +25,20 @@ ], }) - step_config["rules"].extend([ - # TODO: b/308405411 - fix deps. - { - "name": "devtools-frontend/typescript/ts_library_local", - "command_prefix": "python3 ../../third_party/devtools-frontend/src/third_party/typescript/ts_library.py", - "exclude_input_patterns": [ - "*.stamp", - ], - "remote": False, - "handler": "devtools_frontend/typescript_ts_library", - "action_outs": [ - "./gen/third_party/devtools-frontend/src/front_end/entrypoints/formatter_worker/formatter_worker-tsconfig.json", - "./gen/third_party/devtools-frontend/src/test/unittests/front_end/entrypoints/formatter_worker/formatter_worker-tsconfig.json", - "./gen/third_party/devtools-frontend/src/test/unittests/front_end/entrypoints/missing_entrypoints/missing_entrypoints-tsconfig.json", - "./gen/third_party/devtools-frontend/src/test/unittests/front_end/panels/lighthouse/lighthouse-tsconfig.json", - ], - }, - { - "name": "devtools-frontend/typescript/ts_library", - "command_prefix": "python3 ../../third_party/devtools-frontend/src/third_party/typescript/ts_library.py", - "exclude_input_patterns": [ - "*.stamp", - ], - # TODO: b/308405411 - Enable remote-devtools-frontend-typescript by default. - "remote": config.get(ctx, "remote-devtools-frontend-typescript"), - "handler": "devtools_frontend/typescript_ts_library", - "output_local": True, - }, - ]) + # TODO: b/308405411 - Enable remote-devtools-frontend-typescript by default. + if config.get(ctx, "remote-devtools-frontend-typescript"): + step_config["rules"].extend([ + { + "name": "devtools-frontend/typescript/ts_library", + "command_prefix": "python3 ../../third_party/devtools-frontend/src/third_party/typescript/ts_library.py", + "exclude_input_patterns": [ + "*.stamp", + ], + "remote": True, + "handler": "devtools_frontend/typescript_ts_library", + "output_local": True, + }, + ]) return step_config def _ts_library(ctx, cmd): @@ -122,12 +107,16 @@ # Infer gen files from source file. if gen_dir: for f in cmd.inputs + inputs: - if not f.endswith(".ts"): - continue - f = path.join(gen_dir, f) - f = f.removesuffix(".ts") + ".d.ts" - if ctx.fs.exists(f) and not f in files: - files[f] = True + if f.endswith(".ts"): + f = path.join(gen_dir, f) + f = f.removesuffix(".ts") + ".d.ts" + if ctx.fs.exists(f) and not f in files: + files[f] = True + if f.endswith(".js"): + f = path.join(gen_dir, f) + f = f.removesuffix(".js") + ".d.ts" + if ctx.fs.exists(f) and not f in files: + files[f] = True ctx.actions.fix(inputs = cmd.inputs + inputs + sources + files.keys())
diff --git a/buildtools/deps_revisions.gni b/buildtools/deps_revisions.gni index 8a4acaa..0471792 100644 --- a/buildtools/deps_revisions.gni +++ b/buildtools/deps_revisions.gni
@@ -5,5 +5,5 @@ declare_args() { # Used to cause full rebuilds on libc++ rolls. This should be kept in sync # with the libcxx_revision vars in //DEPS. - libcxx_revision = "6cd38f6d30dda7bed3df08427db0b2a4e3fa9e47" + libcxx_revision = "0ad014cff4509d293e62d1d8c7ffd080bcb2f2d6" }
diff --git a/buildtools/reclient_cfgs/linux_chroot/python/rewrapper_linux.cfg b/buildtools/reclient_cfgs/linux_chroot/python/rewrapper_linux.cfg index 13f7e39..3581ca7 100644 --- a/buildtools/reclient_cfgs/linux_chroot/python/rewrapper_linux.cfg +++ b/buildtools/reclient_cfgs/linux_chroot/python/rewrapper_linux.cfg
@@ -1,4 +1,4 @@ -platform=container-image=docker://gcr.io/chops-public-images-prod/rbe/siso-chromium/linux@sha256:26de99218a1a8b527d4840490bcbf1690ee0b55c84316300b60776e6b3a03fe1,dockerChrootPath=.,dockerRuntime=runsc +platform=container-image=docker://gcr.io/chops-public-images-prod/rbe/siso-chromium/linux@sha256:26de99218a1a8b527d4840490bcbf1690ee0b55c84316300b60776e6b3a03fe1,dockerRuntime=runsc server_address=unix:///tmp/reproxy.sock labels=type=tool exec_strategy=remote_local_fallback @@ -6,4 +6,4 @@ canonicalize_working_dir=true exec_timeout=2m reclient_timeout=2m -exec_root=/ \ No newline at end of file +exec_root=/
diff --git a/cc/raster/one_copy_raster_buffer_provider.cc b/cc/raster/one_copy_raster_buffer_provider.cc index 46807dd..f5a1cb2 100644 --- a/cc/raster/one_copy_raster_buffer_provider.cc +++ b/cc/raster/one_copy_raster_buffer_provider.cc
@@ -338,7 +338,7 @@ const RasterSource::PlaybackSettings& playback_settings, uint64_t previous_content_id, uint64_t new_content_id) { - std::unique_ptr<gpu::SharedImageInterface::ScopedMapping> mapping; + std::unique_ptr<gpu::ClientSharedImage::ScopedMapping> mapping; gfx::GpuMemoryBuffer* buffer = nullptr; void* memory = nullptr; size_t stride = 0;
diff --git a/cc/raster/zero_copy_raster_buffer_provider.cc b/cc/raster/zero_copy_raster_buffer_provider.cc index 04772bc..565bf56 100644 --- a/cc/raster/zero_copy_raster_buffer_provider.cc +++ b/cc/raster/zero_copy_raster_buffer_provider.cc
@@ -158,7 +158,7 @@ const GURL& url) override { TRACE_EVENT0("cc", "ZeroCopyRasterBuffer::Playback"); - std::unique_ptr<gpu::SharedImageInterface::ScopedMapping> mapping; + std::unique_ptr<gpu::ClientSharedImage::ScopedMapping> mapping; void* memory = nullptr; size_t stride = 0;
diff --git a/chrome/OWNERS b/chrome/OWNERS index ae44c84..95aa5c0 100644 --- a/chrome/OWNERS +++ b/chrome/OWNERS
@@ -3,19 +3,22 @@ set noparent -# Reviewers (in CET): +# Reviewers in JST (GMT+9) +erikchen@chromium.org + +# Reviewers in CET (GMT+1) alexilin@chromium.org blundell@chromium.org droger@chromium.org treib@chromium.org vasilii@chromium.org -# Reviewers (in EST): +# Reviewers in EST (GMT-5) avi@chromium.org thakis@chromium.org yfriedman@chromium.org -# Reviewers (in PST): +# Reviewers in PST (GMT-8) dtrainor@chromium.org nyquist@chromium.org sky@chromium.org @@ -72,4 +75,4 @@ per-file test/media_router/internal=* per-file test/python_tests=* per-file tools/memory=* -per-file services/speech/internal=* \ No newline at end of file +per-file services/speech/internal=*
diff --git a/chrome/VERSION b/chrome/VERSION index 16d61cf..e12ba6f 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=121 MINOR=0 -BUILD=6157 +BUILD=6158 PATCH=0
diff --git a/chrome/android/chrome_test_java_sources.gni b/chrome/android/chrome_test_java_sources.gni index 767f61d..24602e1 100644 --- a/chrome/android/chrome_test_java_sources.gni +++ b/chrome/android/chrome_test_java_sources.gni
@@ -125,6 +125,7 @@ "javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java", "javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchCriticalTest.java", "javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFakeServer.java", + "javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchHistogramTest.java", "javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInstrumentationBase.java", "javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInstrumentationTest.java", "javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateControllerWrapper.java",
diff --git a/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceHomeLayout.java b/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceHomeLayout.java index d84832b..342c4c0e 100644 --- a/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceHomeLayout.java +++ b/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceHomeLayout.java
@@ -14,6 +14,8 @@ import org.chromium.chrome.browser.layouts.EventFilter; import org.chromium.chrome.browser.layouts.LayoutType; import org.chromium.chrome.browser.layouts.scene_layer.SceneLayer; +import org.chromium.chrome.browser.tab.TabSelectionType; +import org.chromium.chrome.browser.tabmodel.TabModelUtils; import org.chromium.chrome.features.tasks.TasksView; /** A {@link Layout} that shows Start Surface home view. */ @@ -84,10 +86,10 @@ } @Override - public void startHiding(int nextTabId, boolean hintAtTabSelection) { + public void startHiding() { try (TraceEvent e = TraceEvent.scoped(TRACE_HIDE_START_SURFACE)) { StartSurfaceUserData.getInstance().setUnusedTabRestoredAtStartup(false); - super.startHiding(nextTabId, hintAtTabSelection); + super.startHiding(); mIsShown = false; mStartSurface.hide(false); doneHiding(); @@ -169,6 +171,7 @@ } private void onTabSelecting(int tabId) { - startHiding(tabId, true); + TabModelUtils.selectTabById(mTabModelSelector, tabId, TabSelectionType.FROM_USER, false); + startHiding(); } }
diff --git a/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceMediator.java b/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceMediator.java index c32d72f..966cc38 100644 --- a/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceMediator.java +++ b/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/StartSurfaceMediator.java
@@ -158,6 +158,8 @@ private final boolean mUseMagicSpace; private final boolean mIsSurfacePolishEnabled; + private boolean mShouldIgnoreTabSelecting; + // Boolean histogram used to record whether cached // ChromePreferenceKeys.FEED_ARTICLES_LIST_VISIBLE is consistent with // Pref.ARTICLES_LIST_VISIBLE. @@ -1308,8 +1310,16 @@ mHideOverviewOnTabSelecting = true; return; } + // Because there are multiple upstream tab selection listeners that attempt to re-trigger + // the onTabSelecting in response to TabModelObserver#didSelectTab it is necessary to treat + // this as a non-rentrant method until the original operation finishes. + // TODO(crbug/1495121): This can be removed once StartSurfaceRefactor is cleaned up. + if (mShouldIgnoreTabSelecting) return; + mShouldIgnoreTabSelecting = true; + assert mOnTabSelectingListener != null; mOnTabSelectingListener.onTabSelecting(tabId); + mShouldIgnoreTabSelecting = false; } // LogoCoordinator.VisibilityObserver
diff --git a/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/TabSwitcherAndStartSurfaceLayout.java b/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/TabSwitcherAndStartSurfaceLayout.java index 0173782..395a437 100644 --- a/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/TabSwitcherAndStartSurfaceLayout.java +++ b/chrome/android/features/start_surface/java/src/org/chromium/chrome/features/start_surface/TabSwitcherAndStartSurfaceLayout.java
@@ -39,8 +39,11 @@ import org.chromium.chrome.browser.layouts.scene_layer.SceneLayer; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabHidingType; +import org.chromium.chrome.browser.tab.TabLoadIfNeededCaller; +import org.chromium.chrome.browser.tab.TabSelectionType; import org.chromium.chrome.browser.tab.TabUtils; import org.chromium.chrome.browser.tabmodel.TabModelSelector; +import org.chromium.chrome.browser.tabmodel.TabModelUtils; import org.chromium.chrome.browser.tasks.ReturnToChromeUtil; import org.chromium.chrome.browser.tasks.tab_management.TabSwitcher; import org.chromium.chrome.browser.tasks.tab_management.TabSwitcher.TabListDelegate; @@ -170,6 +173,10 @@ @Override public void startedHiding() { removeFinishedShowingRunnable(); + Tab currentTab = mTabModelSelector.getCurrentTab(); + if (currentTab != null && currentTab.isHidden()) { + currentTab.show(TabSelectionType.FROM_USER, TabLoadIfNeededCaller.SET_TAB); + } } @Override @@ -441,37 +448,34 @@ } @Override - public void startHiding(int nextId, boolean hintAtTabSelection) { + public void startHiding() { int startSurfaceState = mStartSurface.getStartSurfaceState(); StartSurfaceUserData.getInstance().setUnusedTabRestoredAtStartup(false); if (startSurfaceState == StartSurfaceState.SHOWN_HOMEPAGE) { - startHidingStartSurface(nextId, hintAtTabSelection); + startHidingStartSurface(); } else { - startHidingTabSwitcher(nextId, hintAtTabSelection); + startHidingTabSwitcher(); } } - private void startHidingStartSurface(int nextId, boolean hintAtTabSelection) { + private void startHidingStartSurface() { try (TraceEvent e = TraceEvent.scoped(TRACE_HIDE_START_SURFACE)) { - startHidingImpl(nextId, hintAtTabSelection); + startHidingImpl(); } } - private void startHidingTabSwitcher(int nextId, boolean hintAtTabSelection) { + private void startHidingTabSwitcher() { try (TraceEvent e = TraceEvent.scoped(TRACE_HIDE_TAB_SWITCHER)) { mTransitionStartTime = SystemClock.elapsedRealtime(); - startHidingImpl(nextId, hintAtTabSelection); + startHidingImpl(); } } - private void startHidingImpl(int nextId, boolean hintAtTabSelection) { - super.startHiding(nextId, hintAtTabSelection); + private void startHidingImpl() { + super.startHiding(); - int sourceTabId = nextId; - if (sourceTabId == Tab.INVALID_TAB_ID) { - sourceTabId = mTabModelSelector.getCurrentTabId(); - } + int sourceTabId = mTabModelSelector.getCurrentTabId(); LayoutTab sourceLayoutTab = createLayoutTab(sourceTabId, mTabModelSelector.isIncognitoSelected()); @@ -1057,6 +1061,7 @@ } private void onTabSelecting(int tabId) { - startHiding(tabId, true); + TabModelUtils.selectTabById(mTabModelSelector, tabId, TabSelectionType.FROM_USER, false); + startHiding(); } }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherCoordinator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherCoordinator.java index b74dcf4c..9a6dea2 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherCoordinator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherCoordinator.java
@@ -497,7 +497,7 @@ shouldUseDynamicResource ? mDynamicResourceLoaderSupplier.get() : null); if (mMode == TabListCoordinator.TabListMode.GRID) { - if (ChromeFeatureList.sCloseTabSuggestions.isEnabled()) { + if (ChromeFeatureList.sArchiveTabService.isEnabled()) { mTabSuggestionsOrchestrator = new TabSuggestionsOrchestrator( mActivity, mTabModelSelector, mLifecycleDispatcher); @@ -999,7 +999,7 @@ } private boolean shouldRegisterMessageItemType() { - return ChromeFeatureList.sCloseTabSuggestions.isEnabled() + return ChromeFeatureList.sArchiveTabService.isEnabled() || !TabSwitcherCoordinator.isShowingTabsInMRUOrder(mMode); }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherLayout.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherLayout.java index e9ddd5c..c3fdc43 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherLayout.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherLayout.java
@@ -49,8 +49,11 @@ import org.chromium.chrome.browser.layouts.scene_layer.SceneLayer; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabHidingType; +import org.chromium.chrome.browser.tab.TabLoadIfNeededCaller; +import org.chromium.chrome.browser.tab.TabSelectionType; import org.chromium.chrome.browser.tab.TabUtils; import org.chromium.chrome.browser.tabmodel.TabModelSelector; +import org.chromium.chrome.browser.tabmodel.TabModelUtils; import org.chromium.chrome.browser.tasks.tab_management.TabSwitcher.TabListDelegate; import org.chromium.chrome.browser.tasks.tab_management.TabSwitcher.TabSwitcherViewObserver; import org.chromium.chrome.browser.util.ChromeAccessibilityUtil; @@ -531,14 +534,14 @@ } @Override - public void startHiding(int nextId, boolean hintAtTabSelection) { + public void startHiding() { try (TraceEvent e = TraceEvent.scoped(TRACE_HIDE_TAB_SWITCHER)) { // This is already in the process of hiding. No-op. if (isStartingToHide()) return; mTransitionStartTime = SystemClock.elapsedRealtime(); - super.startHiding(nextId, hintAtTabSelection); + super.startHiding(); // The new tab animation will handle the rest of the hide. if (mRunningNewTabAnimation) return; @@ -550,12 +553,13 @@ mBackToStartSurface = mLayoutStateProvider.getNextLayoutType() == LayoutType.START_SURFACE; - int sourceTabId = nextId; - if (sourceTabId == Tab.INVALID_TAB_ID) { - sourceTabId = mTabModelSelector.getCurrentTabId(); - } + int sourceTabId = mTabModelSelector.getCurrentTabId(); clearFinishedShowingRunnable(); + Tab currentTab = mTabModelSelector.getCurrentTab(); + if (currentTab != null && currentTab.isHidden()) { + currentTab.show(TabSelectionType.FROM_USER, TabLoadIfNeededCaller.SET_TAB); + } boolean isTablet = DeviceFormFactor.isNonMultiDisplayContextOnTablet(getContext()); boolean tabGtsAnimationEnabled = @@ -1500,6 +1504,7 @@ } private void onTabSelecting(int tabId) { - startHiding(tabId, true); + TabModelUtils.selectTabById(mTabModelSelector, tabId, TabSelectionType.FROM_USER, false); + startHiding(); } }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediator.java index be85da7..c0b2312 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherMediator.java
@@ -1223,6 +1223,7 @@ } mIsSelectingInTabSwitcher = true; if (mOnTabSelectingListener != null) { + mShouldIgnoreNextSelect = true; mOnTabSelectingListener.onTabSelecting(tabId); } }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherPane.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherPane.java index 71cb8ea..6c66a0d 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherPane.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherPane.java
@@ -28,13 +28,17 @@ @NonNull TabSwitcher tabSwitcher, @NonNull OnClickListener newTabButtonClickListener, @NonNull TabSwitcherDrawable tabSwitcherDrawable) { - super(tabSwitcher, newTabButtonClickListener); + super( + tabSwitcher, + newTabButtonClickListener, + org.chromium.chrome.browser.toolbar.R.string.button_new_tab); // TODO(crbug/1505772): Update this string to not be an a11y string and it should probably // just say "Tabs". mReferenceButtonDataSupplier.set( new DrawableButtonData( org.chromium.chrome.tab_ui.R.string.accessibility_tab_switcher, + org.chromium.chrome.tab_ui.R.string.accessibility_tab_switcher, tabSwitcherDrawable)); }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherPaneBase.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherPaneBase.java index c2f6d17..f2cfcdf 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherPaneBase.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherPaneBase.java
@@ -8,6 +8,7 @@ import android.view.View.OnClickListener; import androidx.annotation.NonNull; +import androidx.annotation.StringRes; import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.ObservableSupplierImpl; @@ -39,15 +40,20 @@ /** * @param tabSwitcher The {@link TabSwitcher} hosted by the Pane. * @param newTabButtonClickListener The {@link OnClickListener} for the new tab button. + * @param newTabButtonContentDescriptionRes The resource for the new tab button content + * description. */ TabSwitcherPaneBase( - @NonNull TabSwitcher tabSwitcher, @NonNull OnClickListener newTabButtonClickListener) { + @NonNull TabSwitcher tabSwitcher, + @NonNull OnClickListener newTabButtonClickListener, + @StringRes int newTabButtonContentDescriptionRes) { mTabSwitcher = tabSwitcher; mNewTabButtonDataSupplier.set( new DelegateButtonData( new ResourceButtonData( org.chromium.chrome.browser.toolbar.R.string.button_new_tab, + newTabButtonContentDescriptionRes, org.chromium.chrome.browser.toolbar.R.drawable.new_tab_icon), () -> newTabButtonClickListener.onClick(null))); }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherPaneUnitTest.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherPaneUnitTest.java index c512486..b7f6c30 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherPaneUnitTest.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherPaneUnitTest.java
@@ -106,6 +106,9 @@ FullButtonData buttonData = mTabSwitcherPane.getActionButtonDataSupplier().get(); assertEquals(mContext.getString(R.string.button_new_tab), buttonData.resolveText(mContext)); + assertEquals( + mContext.getString(R.string.button_new_tab), + buttonData.resolveContentDescription(mContext)); assertTrue( AppCompatResources.getDrawable(mContext, R.drawable.new_tab_icon) .getConstantState() @@ -123,6 +126,9 @@ assertEquals( mContext.getString(R.string.accessibility_tab_switcher), buttonData.resolveText(mContext)); + assertEquals( + mContext.getString(R.string.accessibility_tab_switcher), + buttonData.resolveContentDescription(mContext)); assertEquals(mTabSwitcherDrawable, buttonData.resolveIcon(mContext)); }
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsOrchestrator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsOrchestrator.java index f34d1a7..291ecc8 100644 --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsOrchestrator.java +++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/suggestions/TabSuggestionsOrchestrator.java
@@ -142,7 +142,7 @@ mNextPrefetchTime = time + ChromeFeatureList.getFieldTrialParamByFeatureAsInt( - ChromeFeatureList.CLOSE_TAB_SUGGESTIONS, + ChromeFeatureList.ARCHIVE_TAB_SERVICE, "min_time_between_prefetches", mMinTimeBetweenPrefetchesMs); performPrefetch();
diff --git a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/PriceAlertsMessageCardTest.java b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/PriceAlertsMessageCardTest.java index fbed5bcd..a93c6fe 100644 --- a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/PriceAlertsMessageCardTest.java +++ b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/PriceAlertsMessageCardTest.java
@@ -85,7 +85,7 @@ "force-fieldtrials=Study/Group" }) @Restriction({UiRestriction.RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) -@DisableFeatures({ChromeFeatureList.CLOSE_TAB_SUGGESTIONS}) +@DisableFeatures({ChromeFeatureList.ARCHIVE_TAB_SERVICE}) public class PriceAlertsMessageCardTest { private static final String BASE_PARAMS = "force-fieldtrial-params=Study.Group:implicit_subscriptions_enabled/true";
diff --git a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridIphTest.java b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridIphTest.java index c07d3f5..3ff9e92e 100644 --- a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridIphTest.java +++ b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabGridIphTest.java
@@ -90,7 +90,7 @@ @Restriction({UiRestriction.RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) // TODO(https://crbug.com/1362059): The message cards aren't shown the first time when entering GTS // with Start surface enabled. -@DisableFeatures({ChromeFeatureList.CLOSE_TAB_SUGGESTIONS, ChromeFeatureList.START_SURFACE_ANDROID}) +@DisableFeatures({ChromeFeatureList.ARCHIVE_TAB_SERVICE, ChromeFeatureList.START_SURFACE_ANDROID}) public class TabGridIphTest { private ModalDialogManager mModalDialogManager;
diff --git a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageCardTest.java b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageCardTest.java index 26b6245..18a4e01 100644 --- a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageCardTest.java +++ b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSuggestionMessageCardTest.java
@@ -54,7 +54,7 @@ /** End-to-end tests for TabSuggestion. */ @RunWith(ChromeJUnit4ClassRunner.class) @Restriction({UiRestriction.RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) -@EnableFeatures({ChromeFeatureList.CLOSE_TAB_SUGGESTIONS + "<Study"}) +@EnableFeatures({ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study"}) // Disable TAB_TO_GTS_ANIMATION to make it less flaky. When animation is enabled, the suggestion // cards will be removed temporarily, then append again. // TODO(https://crbug.com/1362059): The message cards aren't shown the first time when entering GTS @@ -70,7 +70,7 @@ + "Study.Group:baseline_tab_suggestions/true/enable_launch_polish/true" + "/min_time_between_prefetches/0/thumbnail_aspect_ratio/1.0"; private static final String ENABLE_CLOSE_SUGGESTION_PARAM = - "/baseline_close_tab_suggestions/true"; + "/baseline_archive_tab_service/true"; private static final String ENABLE_GROUP_SUGGESTION_PARAM = "/baseline_group_tab_suggestions/true";
diff --git a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherAndStartSurfaceLayoutTest.java b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherAndStartSurfaceLayoutTest.java index 704f96b3..da27345 100644 --- a/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherAndStartSurfaceLayoutTest.java +++ b/chrome/android/features/tab_ui/javatests/src/org/chromium/chrome/browser/tasks/tab_management/TabSwitcherAndStartSurfaceLayoutTest.java
@@ -1010,13 +1010,13 @@ @Feature("TabSuggestion") @UseMethodParameter(RefactorTestParams.class) @EnableFeatures({ - ChromeFeatureList.CLOSE_TAB_SUGGESTIONS + "<Study", + ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study", ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study" }) @CommandLineFlags.Add({ BASE_PARAMS + "/baseline_tab_suggestions/true" - + "/baseline_close_tab_suggestions/true/min_time_between_prefetches/0" + + "/baseline_archive_tab_service/true/min_time_between_prefetches/0" }) @DisabledTest(message = "https://crbug.com/1458026 for RefactorDisabled") public void testTabSuggestionMessageCard_dismiss(boolean isStartSurfaceRefactorEnable) @@ -1050,13 +1050,13 @@ @Feature("TabSuggestion") @UseMethodParameter(RefactorTestParams.class) @EnableFeatures({ - ChromeFeatureList.CLOSE_TAB_SUGGESTIONS + "<Study", + ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study", ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study" }) @CommandLineFlags.Add({ BASE_PARAMS + "/baseline_tab_suggestions/true" - + "/baseline_close_tab_suggestions/true/min_time_between_prefetches/0" + + "/baseline_archive_tab_service/true/min_time_between_prefetches/0" }) @DisabledTest(message = "https://crbug.com/1447282 for refactor disabled case.") public void testTabSuggestionMessageCard_review(boolean isStartSurfaceRefactorEnable) @@ -1091,13 +1091,13 @@ @Feature("TabSuggestion") @DisabledTest(message = "https://crbug.com/1230107, crbug.com/1130621") @EnableFeatures({ - ChromeFeatureList.CLOSE_TAB_SUGGESTIONS + "<Study", + ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study", ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study" }) @CommandLineFlags.Add({ BASE_PARAMS + "/baseline_tab_suggestions/true" - + "/baseline_close_tab_suggestions/true/min_time_between_prefetches/0" + + "/baseline_archive_tab_service/true/min_time_between_prefetches/0" }) public void testShowOnlyOneTabSuggestionMessageCard_withSoftCleanup( boolean isStartSurfaceRefactorEnabled) throws InterruptedException { @@ -1109,13 +1109,13 @@ @UseMethodParameter(RefactorTestParams.class) @Feature("TabSuggestion") @EnableFeatures({ - ChromeFeatureList.CLOSE_TAB_SUGGESTIONS + "<Study", + ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study", ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study" }) @CommandLineFlags.Add({ BASE_PARAMS + "/baseline_tab_suggestions/true" - + "/baseline_close_tab_suggestions/true/min_time_between_prefetches/0" + + "/baseline_archive_tab_service/true/min_time_between_prefetches/0" }) @DisabledTest(message = "https://crbug.com/1198484, crbug.com/1130621") public void testShowOnlyOneTabSuggestionMessageCard_withHardCleanup( @@ -1128,13 +1128,13 @@ @Feature("TabSuggestion") @UseMethodParameter(RefactorTestParams.class) @EnableFeatures({ - ChromeFeatureList.CLOSE_TAB_SUGGESTIONS + "<Study", + ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study", ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study" }) @CommandLineFlags.Add({ BASE_PARAMS + "/baseline_tab_suggestions/true" - + "/baseline_close_tab_suggestions/true/min_time_between_prefetches/0" + + "/baseline_archive_tab_service/true/min_time_between_prefetches/0" }) @DisabledTest(message = "https://crbug.com/1311825") public void testTabSuggestionMessageCardDismissAfterTabClosing( @@ -1168,13 +1168,13 @@ @Feature("TabSuggestion") @UseMethodParameter(RefactorTestParams.class) @EnableFeatures({ - ChromeFeatureList.CLOSE_TAB_SUGGESTIONS + "<Study", + ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study", ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study" }) @CommandLineFlags.Add({ BASE_PARAMS + "/baseline_tab_suggestions/true" - + "/baseline_close_tab_suggestions/true/min_time_between_prefetches/0" + + "/baseline_archive_tab_service/true/min_time_between_prefetches/0" }) @DisabledTest(message = "https://crbug.com/1326533") public void testTabSuggestionMessageCard_orientation(boolean isStartSurfaceRefactorEnabled) @@ -1586,12 +1586,12 @@ @MediumTest @Feature("TabSuggestion") @UseMethodParameter(LegacyTestParams.class) - @EnableFeatures({ChromeFeatureList.CLOSE_TAB_SUGGESTIONS + "<Study"}) + @EnableFeatures({ChromeFeatureList.ARCHIVE_TAB_SERVICE + "<Study"}) @DisableFeatures({ChromeFeatureList.TAB_TO_GTS_ANIMATION}) @CommandLineFlags.Add({ BASE_PARAMS + "/baseline_tab_suggestions/true" - + "/baseline_close_tab_suggestions/true/min_time_between_prefetches/0" + + "/baseline_archive_tab_service/true/min_time_between_prefetches/0" }) @DisabledTest(message = "https://crbug.com/1449985") public void testTabGroupManualSelection_AfterReviewTabSuggestion(
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml index d781eb0..818fe5ee 100644 --- a/chrome/android/java/res/xml/privacy_preferences.xml +++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -34,7 +34,7 @@ android:key="privacy_sandbox" android:title="@string/ad_privacy_link_row_label" android:summary="@string/ad_privacy_link_row_sub_label" - android:fragment="org.chromium.chrome.browser.privacy_sandbox.PrivacySandboxSettingsFragmentV4" /> + android:fragment="org.chromium.chrome.browser.privacy_sandbox.PrivacySandboxSettingsFragment" /> <Preference android:key="do_not_track" android:title="@string/do_not_track_title"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ActivityTabProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/ActivityTabProvider.java index 5bc4f52f..39b044db 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ActivityTabProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ActivityTabProvider.java
@@ -82,24 +82,28 @@ mLayoutStateObserver = new LayoutStateObserver() { @Override - public void onTabSelectionHinted(int tabId) { - if (mTabModelSelector == null) return; - set(mTabModelSelector.getTabById(tabId)); - } - - @Override public void onStartedShowing(@LayoutType int layout) { // The {@link SimpleAnimationLayout} is a special case, the intent is not to // switch tabs, but to merely run an animation. In this case, do nothing. // If the animation layout does result in a new tab {@link // TabModelObserver#didSelectTab} will trigger the event instead. If the - // tab does not change, the event will no + // tab does not change, the event will noop. if (LayoutType.SIMPLE_ANIMATION == layout) return; Tab tab = mTabModelSelector.getCurrentTab(); if (layout != LayoutType.BROWSING) tab = null; triggerActivityTabChangeEvent(tab); } + + @Override + public void onStartedHiding(@LayoutType int layout) { + if (mTabModelSelector == null) return; + + if (LayoutType.START_SURFACE == layout + || LayoutType.TAB_SWITCHER == layout) { + set(mTabModelSelector.getCurrentTab()); + } + } }; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java index 35553a7..e366372 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -665,7 +665,7 @@ if (HomepageManager.shouldCloseAppWithZeroTabs()) { finish(); } else if (isPendingClosure) { - NewTabPageUma.recordNTPImpression( + NewTabPageUma.recordNtpImpression( NewTabPageUma.NTP_IMPRESSION_POTENTIAL_NO_TAB); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java index c09899f..eb436af 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/Layout.java
@@ -22,7 +22,6 @@ import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabModelSelector; -import org.chromium.chrome.browser.tabmodel.TabModelUtils; import org.chromium.ui.modelutil.PropertyModel; import org.chromium.ui.resources.ResourceManager; @@ -120,9 +119,6 @@ // Current state of the Layout. private @LayoutState int mLayoutState; - // The next id to show when the layout is hidden, or TabBase#INVALID_TAB_ID if no change. - protected int mNextTabId = Tab.INVALID_TAB_ID; - // The ratio of dp to px. protected final float mDpToPx; protected final float mPxToDp; @@ -404,17 +400,10 @@ updateCacheVisibleIdsAndPrimary(visible, Tab.INVALID_TAB_ID); } - /** - * To be called when the layout is starting a transition out of the view mode. - * - * @param nextTabId The id of the next tab. - * @param hintAtTabSelection Whether or not the new tab selection should be broadcast as a hint - * potentially before this {@link Layout} is done hiding and the selection occurs. - */ - public void startHiding(int nextTabId, boolean hintAtTabSelection) { - mUpdateHost.startHiding(nextTabId, hintAtTabSelection); + /** To be called when the layout is starting a transition out of the view mode. */ + public void startHiding() { + mUpdateHost.startHiding(); mLayoutState = LayoutState.STARTING_TO_HIDE; - mNextTabId = nextTabId; } /** @@ -454,14 +443,6 @@ if (mLayoutState != LayoutState.STARTING_TO_HIDE) return; mLayoutState = LayoutState.HIDDEN; - if (mNextTabId != Tab.INVALID_TAB_ID) { - TabModel model = mTabModelSelector.getModelForTabId(mNextTabId); - if (model != null) { - TabModelUtils.setIndex( - model, TabModelUtils.getTabIndexById(model, mNextTabId), false); - } - mNextTabId = Tab.INVALID_TAB_ID; - } mUpdateHost.doneHiding(); if (mRenderHost != null && mRenderHost.getResourceManager() != null) { mRenderHost.getResourceManager().clearTintedResourceCache(); @@ -478,7 +459,6 @@ public void show(long time, boolean animate) { // TODO(crbug.com/1108496): Remove after LayoutManager explicitly hide the old layout. mLayoutState = LayoutState.STARTING_TO_SHOW; - mNextTabId = Tab.INVALID_TAB_ID; } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChromePhone.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChromePhone.java index 451f18a..3e309a4b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChromePhone.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerChromePhone.java
@@ -170,7 +170,7 @@ if (!mSceneOverlays.get(i).isSceneOverlayTreeShowing()) continue; if (mSceneOverlays.get(i).handlesTabCreating()) { // Prevent animation from happening if the overlay handles creation. - startHiding(layout.getLayoutTabsToRender()[0].getId(), false); + startHiding(); doneHiding(); return true; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerImpl.java index 5a9d01d..e26b4b5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerImpl.java
@@ -1055,14 +1055,8 @@ } @Override - public void startHiding(int nextTabId, boolean hintAtTabSelection) { + public void startHiding() { requestUpdate(); - if (hintAtTabSelection) { - for (LayoutStateObserver observer : mLayoutObservers) { - observer.onTabSelectionHinted(nextTabId); - } - } - Layout layoutBeingHidden = getActiveLayout(); for (LayoutStateObserver observer : mLayoutObservers) { observer.onStartedHiding(layoutBeingHidden.getLayoutType()); @@ -1102,7 +1096,7 @@ Layout activeLayout = getActiveLayout(); if (activeLayout != null && !activeLayout.isStartingToHide()) { setNextLayout(getLayoutForType(layoutType), animate); - activeLayout.startHiding(Tab.INVALID_TAB_ID, animate); + activeLayout.startHiding(); } else { startShowing(getLayoutForType(layoutType), animate); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutUpdateHost.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutUpdateHost.java index 3662024..e77170ad 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutUpdateHost.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/LayoutUpdateHost.java
@@ -32,11 +32,8 @@ /** * Tells its host {@link android.view.View} that the hide will be an animation away. This is to * be called from a {@link Layout}. - * - * @param nextTabId The id of the next tab. - * @param hintAtTabSelection Whether or not to hint about a new tab being selected. */ - void startHiding(int nextTabId, boolean hintAtTabSelection); + void startHiding(); /** * Tells its host {@link android.view.View} that the Layout has done all animation so the view
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/ToolbarSwipeLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/ToolbarSwipeLayout.java index 6533e32d..205428ce 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/ToolbarSwipeLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/ToolbarSwipeLayout.java
@@ -23,6 +23,7 @@ import org.chromium.chrome.browser.layouts.animation.CompositorAnimator; import org.chromium.chrome.browser.layouts.scene_layer.SceneLayer; import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.tab.TabSelectionType; import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabModelUtils; import org.chromium.chrome.browser.theme.TopUiThemeColorProvider; @@ -88,6 +89,9 @@ private int mToTabId; private int mFromTabId; + // The tab to select on finishing the animation. + private int mNextTabId; + /** * @param context The current Android's context. * @param updateHost The {@link LayoutUpdateHost} view for this layout. @@ -169,9 +173,17 @@ } @Override + public void doneHiding() { + TabModelUtils.selectTabById( + mTabModelSelector, mNextTabId, TabSelectionType.FROM_USER, false); + super.doneHiding(); + } + + @Override public void show(long time, boolean animate) { super.show(time, animate); init(); + mNextTabId = Tab.INVALID_TAB_ID; if (mTabModelSelector == null) return; Tab tab = mTabModelSelector.getCurrentTab(); if (tab != null && tab.isNativePage()) mTabContentManager.cacheTabThumbnail(tab); @@ -337,7 +349,8 @@ RecordUserAction.record("MobileSideSwipeFinished"); } - startHiding(mToTab.getId(), false); + mNextTabId = mToTab.getId(); + startHiding(); float start = mOffsetTarget; float end = offsetTo; @@ -539,7 +552,8 @@ mToTab = fromTabIndex < toTabIndex ? mRightTab : mLeftTab; float end = fromTabIndex < toTabIndex ? -getWidth() : getWidth(); - startHiding(toTabId, false); + mNextTabId = toTabId; + startHiding(); doTabSwitchAnimation(toTabId, 0f, end, SWITCH_TO_TAB_DURATION_MS); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/SimpleAnimationLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/SimpleAnimationLayout.java index 98de2515..ae488478 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/SimpleAnimationLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/SimpleAnimationLayout.java
@@ -24,7 +24,9 @@ import org.chromium.chrome.browser.layouts.animation.CompositorAnimator; import org.chromium.chrome.browser.layouts.scene_layer.SceneLayer; import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.tab.TabSelectionType; import org.chromium.chrome.browser.tabmodel.TabModel; +import org.chromium.chrome.browser.tabmodel.TabModelUtils; import org.chromium.ui.interpolators.Interpolators; import org.chromium.ui.resources.ResourceManager; @@ -62,6 +64,9 @@ private final TabListSceneLayer mSceneLayer; private final BlackHoleEventFilter mBlackHoleEventFilter; + // The tab to select on finishing the animation. + private int mNextTabId; + /** * Creates an instance of the {@link SimpleAnimationLayout}. * @param context The current Android's context. @@ -81,9 +86,18 @@ } @Override + public void doneHiding() { + TabModelUtils.selectTabById( + mTabModelSelector, mNextTabId, TabSelectionType.FROM_USER, false); + super.doneHiding(); + } + + @Override public void show(long time, boolean animate) { super.show(time, animate); + mNextTabId = Tab.INVALID_TAB_ID; + if (mTabModelSelector != null && mTabContentManager != null) { Tab tab = mTabModelSelector.getCurrentTab(); if (tab != null && tab.isNativePage()) mTabContentManager.cacheTabThumbnail(tab); @@ -226,7 +240,8 @@ mTabCreatedForegroundAnimation.start(); mTabModelSelector.selectModel(newIsIncognito); - startHiding(id, false); + mNextTabId = id; + startHiding(); } /** @@ -438,7 +453,8 @@ @Override public void onAnimationEnd(Animator animation) { // Once the animation has finished, we can switch layouts. - startHiding(sourceId, false); + mNextTabId = sourceId; + startHiding(); } }); step3.playTogether(animationList);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java index c78aa99..3a5e9315 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java
@@ -261,11 +261,6 @@ if (layoutType != LayoutType.TAB_SWITCHER) return; mBrowserScrimShowing = false; } - - @Override - public void onTabSelectionHinted(int tabId) { - LayoutStateObserver.super.onTabSelectionHinted(tabId); - } } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/hub/HubLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/hub/HubLayout.java index 4b0fb5f..cc39b26 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/hub/HubLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/hub/HubLayout.java
@@ -47,7 +47,7 @@ import org.chromium.chrome.browser.layouts.scene_layer.SceneLayer; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabHidingType; -import org.chromium.chrome.browser.tabmodel.TabModel; +import org.chromium.chrome.browser.tab.TabSelectionType; import org.chromium.chrome.browser.tabmodel.TabModelUtils; import org.chromium.components.browser_ui.styles.ChromeColors; import org.chromium.ui.base.DeviceFormFactor; @@ -136,17 +136,8 @@ @Override public void selectTabAndHideHubLayout(int tabId) { - if (tabId != Tab.INVALID_TAB_ID) { - TabModel model = mTabModelSelector.getModelForTabId(tabId); - if (model != null) { - TabModelUtils.setIndex(model, TabModelUtils.getTabIndexById(model, tabId), false); - } - } - - // Don't forward a tabId as it is only used to select the tab again in doneHiding() which is - // redundant work. - // TODO(crbug/1495121): Find a way to remove the tabId parameter from start hiding. - startHiding(Tab.INVALID_TAB_ID, true); + TabModelUtils.selectTabById(mTabModelSelector, tabId, TabSelectionType.FROM_USER, false); + startHiding(); } @Override @@ -267,10 +258,10 @@ } @Override - public void startHiding(int nextTabId, boolean hintAtTabSelection) { + public void startHiding() { if (isStartingToHide()) return; - super.startHiding(nextTabId, hintAtTabSelection); + super.startHiding(); // Use the EXPAND_NEW_TAB animation if it is already prepared. if (getCurrentAnimationType() == HubLayoutAnimationType.EXPAND_NEW_TAB) { @@ -280,10 +271,7 @@ forceAnimationToFinish(); - // TODO(crbug/1495121): Remove the need for this logic if feasible and just get the value - // from TabModelSelector. - int tabId = - nextTabId != Tab.INVALID_TAB_ID ? nextTabId : mTabModelSelector.getCurrentTabId(); + int tabId = mTabModelSelector.getCurrentTabId(); @LayoutType int nextLayoutType = mLayoutStateProvider.getNextLayoutType(); if (nextLayoutType == LayoutType.BROWSING) { // During fade and translate animations the composited scene layer is visible. At the
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/hub/HubLayoutUnitTest.java b/chrome/android/java/src/org/chromium/chrome/browser/hub/HubLayoutUnitTest.java index 76656ba9..28ed12b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/hub/HubLayoutUnitTest.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/hub/HubLayoutUnitTest.java
@@ -245,7 +245,7 @@ @SmallTest public void testUpdateSceneLayerAndLayoutTabsDuringHide() { animateCheckingSceneLayerAndLayoutTabs( - () -> startHiding(LayoutType.BROWSING, NEW_TAB_ID, true), NEW_TAB_ID); + () -> startHiding(LayoutType.BROWSING, NEW_TAB_ID), NEW_TAB_ID); verify(mTabContentManager, never()) .updateVisibleIds(eq(Collections.emptyList()), eq(Tab.INVALID_TAB_ID)); } @@ -533,7 +533,7 @@ assertTrue(mHubLayout.isRunningAnimations()); assertTrue(mHubLayout.onUpdateAnimation(FAKE_TIME, false)); - startHiding(LayoutType.BROWSING, NEW_TAB_ID, false); + startHiding(LayoutType.BROWSING, NEW_TAB_ID); verify(mHubLayout).doneShowing(); verify(mTab, never()).hide(anyInt()); verify(mScrimController).forceAnimationToFinish(); @@ -591,7 +591,7 @@ } else { assertFalse(mHubLayout.isRunningAnimations()); assertFalse(mHubLayout.onUpdateAnimation(FAKE_TIME, false)); - startHiding(nextLayout, nextTabId, true); + startHiding(nextLayout, nextTabId); } assertEquals(expectedAnimationType, mHubLayout.getCurrentAnimationType()); @@ -617,13 +617,17 @@ mHubLayout.show(FAKE_TIME, animate); } - private void startHiding( - @LayoutType int nextLayout, int nextTabId, boolean hintAtTabSelection) { + private void startHiding(@LayoutType int nextLayout, int nextTabId) { @LayoutType int layoutType = mHubLayout.getLayoutType(); when(mLayoutStateProvider.getActiveLayoutType()).thenReturn(layoutType); when(mLayoutStateProvider.getNextLayoutType()).thenReturn(nextLayout); - mHubLayout.startHiding(nextTabId, hintAtTabSelection); + // This selection happens before anything else in selectTabAndHideHubLayout. Mock it before + // the call. + if (nextTabId != Tab.INVALID_TAB_ID) { + when(mTabModelSelector.getCurrentTabId()).thenReturn(nextTabId); + } + mHubLayout.selectTabAndHideHubLayout(nextTabId); } private void animateCheckingSceneLayerAndLayoutTabs(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java index 672c8f3..20db421 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java
@@ -123,7 +123,7 @@ private NewTabPageUma getNewTabPageUma() { if (mNewTabPageUma == null) { mNewTabPageUma = new NewTabPageUma(mTabModelSelector); - mNewTabPageUma.monitorNTPCreation(); + mNewTabPageUma.monitorNtpCreation(); } return mNewTabPageUma; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPage.java index 7e0efc7d..e5e1d0911 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPage.java
@@ -35,7 +35,7 @@ private IncognitoCookieControlsManager mCookieControlsManager; private IncognitoCookieControlsManager.Observer mCookieControlsObserver; - private final int mIncognitoNTPBackgroundColor; + private final int mIncognitoNtpBackgroundColor; private void showIncognitoLearnMore() { Profile profile = @@ -57,7 +57,7 @@ mActivity = activity; - mIncognitoNTPBackgroundColor = host.getContext().getColor(R.color.ntp_bg_incognito); + mIncognitoNtpBackgroundColor = host.getContext().getColor(R.color.ntp_bg_incognito); mIncognitoNewTabPageManager = new IncognitoNewTabPageManager() { @@ -149,7 +149,7 @@ @Override public int getBackgroundColor() { - return mIncognitoNTPBackgroundColor; + return mIncognitoNtpBackgroundColor; } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java index d1e0b0c..ef0c402 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java
@@ -77,7 +77,7 @@ mScrollView.setDescendantFocusability(FOCUS_BEFORE_DESCENDANTS); ViewStub viewStub = findViewById(R.id.incognito_description_layout_stub); - if (shouldShowRevampedIncognitoNTP()) { + if (shouldShowRevampedIncognitoNtp()) { viewStub.setLayoutResource(R.layout.revamped_incognito_description_layout); } else { viewStub.setLayoutResource(R.layout.incognito_description_layout); @@ -95,14 +95,14 @@ // Inflate the correct cookie/tracking protection card. ViewStub cardStub = findViewById(R.id.cookie_card_stub); if (cardStub == null) return; - if (shouldShowTrackingProtectionNTP()) { + if (shouldShowTrackingProtectionNtp()) { cardStub.setLayoutResource( - shouldShowRevampedIncognitoNTP() + shouldShowRevampedIncognitoNtp() ? R.layout.revamped_incognito_tracking_protection_card : R.layout.incognito_tracking_protection_card); } else { cardStub.setLayoutResource( - shouldShowRevampedIncognitoNTP() + shouldShowRevampedIncognitoNtp() ? R.layout.revamped_incognito_cookie_controls_card : R.layout.incognito_cookie_controls_card); } @@ -147,11 +147,11 @@ || mScrollView.getScrollY() != mSnapshotScrollY; } - boolean shouldShowRevampedIncognitoNTP() { + boolean shouldShowRevampedIncognitoNtp() { return ChromeFeatureList.isEnabled(ChromeFeatureList.INCOGNITO_NTP_REVAMP); } - boolean shouldShowTrackingProtectionNTP() { + boolean shouldShowTrackingProtectionNtp() { Profile profile = Profile.getLastUsedRegularProfile() .getPrimaryOTRProfile(/* createIfNeeded= */ true);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java index 54e9ccb..59372f5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
@@ -236,7 +236,7 @@ } @Override - public boolean isLocationBarShownInNTP() { + public boolean isLocationBarShownInNtp() { if (mIsDestroyed) return false; return isInSingleUrlBarMode() && !mNewTabPageLayout.urlFocusAnimationsDisabled(); } @@ -298,9 +298,9 @@ long loadTimeMs = (System.nanoTime() - mConstructedTimeNs) / 1000000; RecordHistogram.recordTimesHistogram("Tab.NewTabOnload", loadTimeMs); mIsLoaded = true; - NewTabPageUma.recordNTPImpression(NewTabPageUma.NTP_IMPRESSION_REGULAR); + NewTabPageUma.recordNtpImpression(NewTabPageUma.NTP_IMPRESSION_REGULAR); // If not visible when loading completes, wait until onShown is received. - if (!mTab.isHidden()) recordNTPShown(); + if (!mTab.isHidden()) recordNtpShown(); } } @@ -438,13 +438,13 @@ @Override public void onShown(Tab tab, @TabSelectionType int type) { // Showing the NTP is only meaningful when the page has been loaded already. - if (mIsLoaded) recordNTPShown(); + if (mIsLoaded) recordNtpShown(); mNewTabPageLayout.onSwitchToForeground(); } @Override public void onHidden(Tab tab, @TabHidingType int type) { - if (mIsLoaded) recordNTPHidden(); + if (mIsLoaded) recordNtpHidden(); if (mSingleTabSwitcherCoordinator != null && (mHomeSurfaceTracker == null || !mHomeSurfaceTracker.canShowHomeSurface(mTab))) { @@ -794,8 +794,8 @@ /** * @return Whether the location bar is shown in the NTP. */ - public boolean isLocationBarShownInNTP() { - return mNewTabPageManager.isLocationBarShownInNTP(); + public boolean isLocationBarShownInNtp() { + return mNewTabPageManager.isLocationBarShownInNtp(); } /** @see org.chromium.chrome.browser.omnibox.NewTabPageDelegate#hasCompletedFirstLayout(). */ @@ -869,7 +869,7 @@ * Records UMA for the NTP being shown. This includes a fresh page load or being brought to the * foreground. */ - private void recordNTPShown() { + private void recordNtpShown() { mLastShownTimeNs = System.nanoTime(); RecordUserAction.record("MobileNTPShown"); mJankTracker.startTrackingScenario(JankScenario.NEW_TAB_PAGE); @@ -881,7 +881,7 @@ } /** Records UMA for the NTP being hidden and the time spent on it. */ - private void recordNTPHidden() { + private void recordNtpHidden() { mJankTracker.finishTrackingScenario(JankScenario.NEW_TAB_PAGE); RecordHistogram.recordMediumTimesHistogram( "NewTabPage.TimeSpent", @@ -955,7 +955,7 @@ assert !mIsDestroyed; assert !ViewCompat.isAttachedToWindow(getView()) : "Destroy called before removed from window"; - if (mIsLoaded && !mTab.isHidden()) recordNTPHidden(); + if (mIsLoaded && !mTab.isHidden()) recordNtpHidden(); mNewTabPageManager.onDestroy(); mTileGroupDelegate.destroy(); @@ -1000,7 +1000,7 @@ @Override public @ColorInt int getToolbarTextBoxBackgroundColor(@ColorInt int defaultColor) { - if (isLocationBarShownInNTP()) { + if (isLocationBarShownInNtp()) { if (!mIsSurfacePolishEnabled) { return isLocationBarScrolledToTopInNtp() ? ChromeColors.getSurfaceColor(mContext, R.dimen.toolbar_text_box_elevation) @@ -1030,7 +1030,7 @@ @Override public @ColorInt int getToolbarSceneLayerBackground(@ColorInt int defaultColor) { - return isLocationBarShownInNTP() ? getBackgroundColor() : defaultColor; + return isLocationBarShownInNtp() ? getBackgroundColor() : defaultColor; } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java index db58e23..3282b43 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java
@@ -763,11 +763,11 @@ if (mIsNtpAsHomeSurfaceOnTablet) { updateTilesLayoutLeftAndRightMarginsOnTablet(marginLayoutParams); } else { - int lateralPaddingsForNTP = + int lateralPaddingsForNtp = -getResources() .getDimensionPixelSize(R.dimen.ntp_header_lateral_paddings_v2); - marginLayoutParams.leftMargin = lateralPaddingsForNTP; - marginLayoutParams.rightMargin = lateralPaddingsForNTP; + marginLayoutParams.leftMargin = lateralPaddingsForNtp; + marginLayoutParams.rightMargin = lateralPaddingsForNtp; } marginLayoutParams.topMargin = getResources() @@ -1256,9 +1256,9 @@ isInNarrowWindowOnTablet(mIsTablet, mUiConfig) ? R.dimen.search_box_lateral_margin_polish : R.dimen.mvt_container_lateral_margin_polish; - int lateralPaddingsForNTP = getResources().getDimensionPixelSize(lateralPaddingId); - marginLayoutParams.leftMargin = lateralPaddingsForNTP; - marginLayoutParams.rightMargin = lateralPaddingsForNTP; + int lateralPaddingsForNtp = getResources().getDimensionPixelSize(lateralPaddingId); + marginLayoutParams.leftMargin = lateralPaddingsForNtp; + marginLayoutParams.rightMargin = lateralPaddingsForNtp; } private void updateSearchBoxWidthForPolish() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageManager.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageManager.java index 8238446..873adbd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageManager.java
@@ -9,8 +9,10 @@ /** Manages the view interaction with the rest of the system. */ public interface NewTabPageManager extends SuggestionsUiDelegate { - /** @return Whether the location bar is shown in the NTP. */ - boolean isLocationBarShownInNTP(); + /** + * @return Whether the location bar is shown in the NTP. + */ + boolean isLocationBarShownInNtp(); /** @return Whether voice search is enabled and the microphone should be shown. */ boolean isVoiceSearchEnabled();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java index f46e483..7ec3ede 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageUma.java
@@ -201,9 +201,10 @@ /** * Record a NTP impression (even potential ones to make informed product decisions). If the * impression type is {@link NewTabPageUma#NTP_IMPRESSION_REGULAR}, also records a user action. + * * @param impressionType Type of the impression from NewTabPageUma.java */ - public static void recordNTPImpression(int impressionType) { + public static void recordNtpImpression(int impressionType) { assert impressionType >= 0; assert impressionType < NUM_NTP_IMPRESSION; RecordHistogram.recordEnumeratedHistogram( @@ -214,7 +215,7 @@ * Records how often new tabs with a NewTabPage are created. This helps to determine how often * users navigate back to already opened NTPs. */ - public void monitorNTPCreation() { + public void monitorNtpCreation() { mTabCreationRecorder = new TabCreationRecorder(); mTabModelSelector.addObserver(mTabCreationRecorder); } @@ -242,8 +243,8 @@ } /** - * Records the number of new NTPs opened in a new tab. Use through - * {@link NewTabPageUma#monitorNTPCreation(TabModelSelector)}. + * Records the number of new NTPs opened in a new tab. Use through {@link + * NewTabPageUma#monitorNtpCreation(TabModelSelector)}. */ private static class TabCreationRecorder implements TabModelSelectorObserver { @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/SnapScrollHelperImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/SnapScrollHelperImpl.java index 8d0d34c..dda507e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/SnapScrollHelperImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/SnapScrollHelperImpl.java
@@ -119,7 +119,7 @@ @VisibleForTesting @Override public int calculateSnapPosition(int scrollPosition) { - if (mManager.isLocationBarShownInNTP()) { + if (mManager.isLocationBarShownInNtp()) { // Snap scroll to prevent only part of the toolbar from showing. scrollPosition = calculateSnapPositionForRegion(scrollPosition, 0, mToolbarHeight);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java index 7eb0204..4507514 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java
@@ -1481,13 +1481,13 @@ } NewTabPage ntp = getNewTabPageForCurrentTab(); - return ntp != null && ntp.isLocationBarShownInNTP(); + return ntp != null && ntp.isLocationBarShownInNtp(); } @Override public boolean transitioningAwayFromLocationBar() { return mVisibleNtp != null - && mVisibleNtp.isLocationBarShownInNTP() + && mVisibleNtp.isLocationBarShownInNtp() && !isLocationBarShown(); } @@ -1548,7 +1548,7 @@ return new ToolbarNtpDelegate() { @Override protected boolean shouldUpdateListener() { - return mVisibleNtp.isLocationBarShownInNTP(); + return mVisibleNtp.isLocationBarShownInNtp(); } }; } else if (toolbarLayout instanceof ToolbarTablet) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java index f2d6022..4684ef51a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java
@@ -565,6 +565,6 @@ private boolean isLocationBarShownInNtp() { if (!isStandardNtp()) return false; final NewTabPage newTabPage = (NewTabPage) mCurrentTab.getNativePage(); - return newTabPage != null && newTabPage.isLocationBarShownInNTP(); + return newTabPage != null && newTabPage.isLocationBarShownInNtp(); } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerTest.java index 4477a84..65f90890 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/layouts/LayoutManagerTest.java
@@ -695,43 +695,6 @@ Assert.assertEquals(LayoutType.BROWSING, startedShowingCallback.layoutType); } - @Test - @MediumTest - @DisableIf.Build(sdk_is_greater_than = N_MR1, message = "crbug.com/1139943") - public void testLayoutObserverNotification_TabSelectionHinted() throws TimeoutException { - CallbackHelper tabSelectionHintedCallback = new CallbackHelper(); - - TestThreadUtils.runOnUiThreadBlocking( - () -> { - initializeLayoutManagerPhone(2, 0); - mManager.addObserver( - new LayoutStateProvider.LayoutStateObserver() { - @Override - public void onTabSelectionHinted(int tabId) { - Log.d(TAG, "onTabSelectionHinted"); - tabSelectionHintedCallback.notifyCalled(); - } - }); - - mManager.showLayout(LayoutType.TAB_SWITCHER, true); - Assert.assertTrue( - "layoutManager is way too long to end motion", - simulateTime(mManager, 1000)); - Assert.assertEquals( - LayoutType.TAB_SWITCHER, mManager.getActiveLayout().getLayoutType()); - - mManager.showLayout(LayoutType.BROWSING, true); - Assert.assertTrue( - "layoutManager is way too long to end motion", - simulateTime(mManager, 1000)); - - Assert.assertEquals( - LayoutType.BROWSING, mManager.getActiveLayout().getLayoutType()); - }); - - tabSelectionHintedCallback.waitForCallback(0); - } - @Before public void setUp() { MockitoAnnotations.initMocks(this);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchHistogramTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchHistogramTest.java new file mode 100644 index 0000000..fe987089 --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchHistogramTest.java
@@ -0,0 +1,259 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.contextualsearch; + +import static org.chromium.base.test.util.Restriction.RESTRICTION_TYPE_NON_LOW_END_DEVICE; + +import androidx.test.filters.SmallTest; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.chromium.base.FeatureList; +import org.chromium.base.test.params.ParameterAnnotations; +import org.chromium.base.test.params.ParameterizedRunner; +import org.chromium.base.test.util.Batch; +import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.base.test.util.Feature; +import org.chromium.base.test.util.HistogramWatcher; +import org.chromium.base.test.util.Restriction; +import org.chromium.chrome.browser.compositor.bottombar.contextualsearch.RelatedSearchesControl; +import org.chromium.chrome.browser.contextualsearch.ContextualSearchFakeServer.FakeResolveSearch; +import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.chrome.browser.flags.ChromeSwitches; +import org.chromium.chrome.test.ChromeJUnit4RunnerDelegate; +import org.chromium.chrome.test.util.browser.Features.EnableFeatures; +import org.chromium.content_public.browser.test.util.TestThreadUtils; + +/** Tests the Contextual Search histograms. */ +// NOTE: Disable online detection so we we'll default to online on test bots with no network. +@RunWith(ParameterizedRunner.class) +@ParameterAnnotations.UseRunnerDelegate(ChromeJUnit4RunnerDelegate.class) +@CommandLineFlags.Add({ + ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, + "disable-features=" + ChromeFeatureList.CONTEXTUAL_SEARCH_THIN_WEB_VIEW_IMPLEMENTATION +}) +@EnableFeatures(ChromeFeatureList.CONTEXTUAL_SEARCH_DISABLE_ONLINE_DETECTION) +@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) +@Batch(Batch.PER_CLASS) +public class ContextualSearchHistogramTest extends ContextualSearchInstrumentationBase { + private HistogramWatcher mResultsSeenHistogramWatcher; + private HistogramWatcher mAllSearchesHistogramWatcher; + private HistogramWatcher mNumberOfSuggestionsClicked2HistogramWatcher; + private HistogramWatcher mSelectedCarouselIndexHistogramWatcher; + private HistogramWatcher mSelectedSuggestionIndexHistogramWatcher; + private HistogramWatcher mCTRHistogramWatcher; + private HistogramWatcher mCarouselScrolledHistogramWatcher; + private HistogramWatcher mCarouselScrollAndClickHistogramWatcher; + private HistogramWatcher mCarouselLastVisibleItemPositionHistogramWatcher; + + @Override + @Before + public void setUp() throws Exception { + mTestPage = "/chrome/test/data/android/contextualsearch/tap_test.html"; + super.setUp(); + } + + // ============================================================================================ + // UMA assertions + // ============================================================================================ + + /** + * Create HistogramWatcher for a sequence of user actions that peek and expand the panel with + * Related Searches showing and then close the panel without selecting any suggestion. + */ + private void createHistogramWatcherForPeekAndExpandForRSearches() { + createHistogramWatcherForPeekAndExpandForRSearches(-1); + } + + /** + * UMA HistogramWatcher for a sequence of user actions that peek and expand the panel with + * Related Searches showing and then close the panel. + * + * @param whichSuggestion Which suggestion was selected. A value of -1 means none. + */ + private void createHistogramWatcherForPeekAndExpandForRSearches(int whichSuggestion) { + final int relatedSearchesCount = whichSuggestion > -1 ? 1 : 0; + mResultsSeenHistogramWatcher = + HistogramWatcher.newBuilder() + .expectBooleanRecordTimes( + "Search.ContextualSearch.All.ResultsSeen", true, 1) + .build(); + HistogramWatcher.Builder histogramWatcherBuilder = + HistogramWatcher.newBuilder() + .expectBooleanRecordTimes("Search.ContextualSearch.All.Searches", false, 1); + if (relatedSearchesCount > 0) { + histogramWatcherBuilder.expectBooleanRecordTimes( + "Search.ContextualSearch.All.Searches", true, relatedSearchesCount); + } + mAllSearchesHistogramWatcher = histogramWatcherBuilder.build(); + + if (relatedSearchesCount > 0) { + mNumberOfSuggestionsClicked2HistogramWatcher = + HistogramWatcher.newBuilder() + .expectBooleanRecordTimes( + "Search.RelatedSearches.NumberOfSuggestionsClicked2", true, 1) + .build(); + + mSelectedCarouselIndexHistogramWatcher = + HistogramWatcher.newBuilder() + .expectIntRecordTimes( + "Search.RelatedSearches.SelectedCarouselIndex", + whichSuggestion, + 1) + .build(); + + mSelectedSuggestionIndexHistogramWatcher = + HistogramWatcher.newBuilder() + .expectIntRecordTimes( + "Search.RelatedSearches.SelectedSuggestionIndex", + whichSuggestion, + 1) + .build(); + + mCTRHistogramWatcher = + HistogramWatcher.newBuilder() + .expectIntRecordTimes("Search.RelatedSearches.CTR", 1, 1) + .build(); + } else { + mNumberOfSuggestionsClicked2HistogramWatcher = + HistogramWatcher.newBuilder() + .expectNoRecords("Search.RelatedSearches.NumberOfSuggestionsClicked2") + .build(); + + mSelectedCarouselIndexHistogramWatcher = + HistogramWatcher.newBuilder() + .expectNoRecords("Search.RelatedSearches.SelectedCarouselIndex") + .build(); + + mSelectedSuggestionIndexHistogramWatcher = + HistogramWatcher.newBuilder() + .expectNoRecords("Search.RelatedSearches.SelectedSuggestionIndex") + .build(); + + mCTRHistogramWatcher = + HistogramWatcher.newBuilder() + .expectIntRecordTimes("Search.RelatedSearches.CTR", 0, 1) + .build(); + } + + mCarouselScrolledHistogramWatcher = + HistogramWatcher.newBuilder() + .expectBooleanRecordTimes( + "Search.RelatedSearches.CarouselScrolled", false, 1) + .build(); + + mCarouselScrollAndClickHistogramWatcher = + HistogramWatcher.newBuilder() + .expectIntRecordTimes( + "Search.RelatedSearches.CarouselScrollAndClick", + relatedSearchesCount > 0 ? 1 : 0, + 1) + .build(); + + mCarouselLastVisibleItemPositionHistogramWatcher = + HistogramWatcher.newBuilder() + .expectAnyRecord("Search.RelatedSearches.CarouselLastVisibleItemPosition") + .allowExtraRecords("Search.RelatedSearches.CarouselLastVisibleItemPosition") + .build(); + } + + /** Assert HistogramWatcher to check the histograms are as expected. */ + private void assertHistogramWatcherForPeekAndExpandForRSearches() { + mResultsSeenHistogramWatcher.assertExpected( + "Some entry in the Search.ContextualSearch.All.Searches histogram was not logged as" + + " expected!"); + mAllSearchesHistogramWatcher.assertExpected( + "Failed to log if a search was seen in the Search.ContextualSearch.All.Searches" + + " histogram!"); + mNumberOfSuggestionsClicked2HistogramWatcher.assertExpected( + "Failed to log the correct count of Related Searches suggestions clicked in the" + + " Search.RelatedSearches.NumberOfSuggestionsClicked2 histogram!"); + mSelectedCarouselIndexHistogramWatcher.assertExpected( + "Failed to find the expected Related Searches chip logged as clicked in the" + + " Search.RelatedSearches.SelectedCarouselIndex histogram that tracks which" + + " chip was clicked!"); + mSelectedSuggestionIndexHistogramWatcher.assertExpected( + "Failed to find the expected Related Searches suggestion logged as selected in the" + + " Search.RelatedSearches.SelectedSuggestionIndex histogram that tracks which" + + " suggestion was selected!"); + mCTRHistogramWatcher.assertExpected( + "Failed to log that Related Searches were shown and if one was selected in the" + + " Search.RelatedSearches.CTR histogram!"); + mCarouselScrolledHistogramWatcher.assertExpected( + "Failed to log that the carousel is shown and it was not scrolled in the" + + " Search.RelatedSearches.CarouselScrolled histogram!"); + mCarouselScrollAndClickHistogramWatcher.assertExpected( + "Failed to log that the carousel is shown and it was not scrolled and clicked in" + + " the Search.RelatedSearches.CarouselScrollAndClick histogram!"); + mCarouselLastVisibleItemPositionHistogramWatcher.assertExpected( + "Failed to log the last visible position index for a chip in the carousel in the" + + " Search.RelatedSearches.CarouselLastVisibleItemPosition histogram!"); + } + + @Test + @SmallTest + @Feature({"ContextualSearch"}) + @ParameterAnnotations.UseMethodParameter(FeatureParamProvider.class) + public void testRelatedSearchesItemNotSelected(@EnabledFeature int enabledFeature) + throws Exception { + FeatureList.setTestFeatures(ENABLE_RELATED_SEARCHES_IN_BAR); + mPolicy.overrideAllowSendingPageUrlForTesting(true); + createHistogramWatcherForPeekAndExpandForRSearches(); + FakeResolveSearch fakeSearch = simulateResolveSearch("intelligence"); + Assert.assertFalse( + "Related Searches should have been requested but were not!", + mFakeServer.getSearchContext().getRelatedSearchesStamp().isEmpty()); + ResolvedSearchTerm resolvedSearchTerm = fakeSearch.getResolvedSearchTerm(); + Assert.assertTrue( + "Related Searches results should have been returned but were not!", + !resolvedSearchTerm.relatedSearchesJson().isEmpty()); + // Expand the panel and assert that it ends up in the right place. + expandPanelAndAssert(); + + // Don't select any Related Searches suggestion, and close the panel + closePanel(); + assertHistogramWatcherForPeekAndExpandForRSearches(); + } + + @Test + @SmallTest + @Feature({"ContextualSearch"}) + public void testRelatedSearchesItemSelected() throws Exception { + FeatureList.setTestFeatures(ENABLE_RELATED_SEARCHES_IN_BAR); + mFakeServer.reset(); + FakeResolveSearch fakeSearch = simulateResolveSearch("intelligence"); + ResolvedSearchTerm resolvedSearchTerm = fakeSearch.getResolvedSearchTerm(); + Assert.assertTrue( + "Related Searches results should have been returned but were not!", + !resolvedSearchTerm.relatedSearchesJson().isEmpty()); + // Expand the panel and assert that it ends up in the right place. + expandPanelAndAssert(); + + // Select a Related Searches suggestion. + RelatedSearchesControl relatedSearchesControl = mPanel.getRelatedSearchesInBarControl(); + final int chipToSelect = 3; + createHistogramWatcherForPeekAndExpandForRSearches(chipToSelect); + TestThreadUtils.runOnUiThreadBlocking( + () -> relatedSearchesControl.selectChipForTest(chipToSelect)); + Assert.assertEquals( + "The Related Searches query was not shown in the Bar!", + "Selection Related 3", + mPanel.getSearchBarControl().getSearchTerm()); + + // Collapse the panel back to the peeking state + peekPanel(); + Assert.assertEquals( + "The default query was not shown in the Bar after returning to peeking state!", + "Intelligence", + mPanel.getSearchBarControl().getSearchTerm()); + + // Close the panel + closePanel(); + assertHistogramWatcherForPeekAndExpandForRSearches(); + } +}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUnbatchedTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUnbatchedTest.java index de47a78..e7219eb 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUnbatchedTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUnbatchedTest.java
@@ -13,21 +13,16 @@ import org.junit.Test; import org.junit.runner.RunWith; -import org.chromium.base.FeatureList; -import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.test.params.ParameterAnnotations; import org.chromium.base.test.params.ParameterizedRunner; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.DoNotBatch; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Restriction; -import org.chromium.chrome.browser.compositor.bottombar.contextualsearch.RelatedSearchesControl; -import org.chromium.chrome.browser.contextualsearch.ContextualSearchFakeServer.FakeResolveSearch; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.test.ChromeJUnit4RunnerDelegate; import org.chromium.chrome.test.util.browser.Features.EnableFeatures; -import org.chromium.content_public.browser.test.util.TestThreadUtils; /** Tests the Contextual Search Manager using instrumentation tests. */ // NOTE: Disable online detection so we we'll default to online on test bots with no network. @@ -39,8 +34,7 @@ }) @EnableFeatures(ChromeFeatureList.CONTEXTUAL_SEARCH_DISABLE_ONLINE_DETECTION) @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) -// TODO(crbug.com/1338223):update the tests to be batched. -@DoNotBatch(reason = "Tests cannot runn batched due to RecordHistogram#forgetHistogram method.") +@DoNotBatch(reason = "testTapWithLanguage is flaky if it is batched https://crbug.com/1105488") public class ContextualSearchUnbatchedTest extends ContextualSearchInstrumentationBase { @Override @Before @@ -50,144 +44,6 @@ } // ============================================================================================ - // UMA assertions - // ============================================================================================ - - /** - * UMA assertions for a sequence of user actions that peek and expand the panel with Related - * Searches showing and then close the panel without selecting any suggestion. - */ - private void assertUmaForPeekAndExpandWithRSearchesEnabled() throws Exception { - assertUmaForPeekAndExpandWithRSearchesEnabled(-1); - } - - /** - * UMA assertions for a sequence of user actions that peek and expand the panel with Related - * Searches showing and then close the panel. - * - * @param whichSuggestion Which suggestion was selected. A value of -1 means none. - */ - private void assertUmaForPeekAndExpandWithRSearchesEnabled(int whichSuggestion) - throws Exception { - final int relatedSearchesCount = whichSuggestion > -1 ? 1 : 0; - Assert.assertEquals( - "Some entry in the Search.ContextualSearch.All.Searches histogram was not logged " - + "as expected!", - 1, - RecordHistogram.getHistogramTotalCountForTesting( - "Search.ContextualSearch.All.ResultsSeen")); - Assert.assertEquals( - "Failed to log a search seen in the Search.ContextualSearch.All.Searches " - + "histogram!", - relatedSearchesCount, - RecordHistogram.getHistogramValueCountForTesting( - "Search.ContextualSearch.All.Searches", 1)); - Assert.assertEquals( - "Failed to log a search that was not seen in the " - + "Search.ContextualSearch.All.Searches histogram!", - 1, - RecordHistogram.getHistogramValueCountForTesting( - "Search.ContextualSearch.All.Searches", 0)); - Assert.assertEquals( - "Failed to log the correct number of searches seen from Related Searches and/or " - + "Contextual Search in the Search.ContextualSearch.All.Searches " - + "histogram", - 1, - RecordHistogram.getHistogramValueCountForTesting( - "Search.ContextualSearch.All.Searches", relatedSearchesCount)); - Assert.assertEquals( - "Failed to log the correct count of Related Searches suggestions clicked in the " - + "Search.RelatedSearches.NumberOfSuggestionsClicked2 histogram!", - relatedSearchesCount, - RecordHistogram.getHistogramTotalCountForTesting( - "Search.RelatedSearches.NumberOfSuggestionsClicked2")); - Assert.assertEquals( - "Failed to log all the right Related Searches chips as clicked in the " - + "Search.RelatedSearches.SelectedCarouselIndex histogram!", - relatedSearchesCount, - RecordHistogram.getHistogramTotalCountForTesting( - "Search.RelatedSearches.SelectedCarouselIndex")); - if (relatedSearchesCount > 0) { - Assert.assertEquals( - "Failed to find the expected Related Searches chip logged as clicked in the " - + "Search.RelatedSearches.SelectedCarouselIndex histogram that tracks " - + "which chip was clicked!", - 1, - RecordHistogram.getHistogramValueCountForTesting( - "Search.RelatedSearches.SelectedCarouselIndex", whichSuggestion)); - } - Assert.assertEquals( - "Failed to log all the right Related Searches suggestions as selected in the " - + "Search.RelatedSearches.SelectedSuggestionIndex histogram!", - relatedSearchesCount, - RecordHistogram.getHistogramTotalCountForTesting( - "Search.RelatedSearches.SelectedSuggestionIndex")); - if (relatedSearchesCount > 0) { - Assert.assertEquals( - "Failed to find the expected Related Searches suggestion logged as selected " - + "in the Search.RelatedSearches.SelectedSuggestionIndex histogram " - + "that tracks which suggestion was selected!", - 1, - RecordHistogram.getHistogramValueCountForTesting( - "Search.RelatedSearches.SelectedSuggestionIndex", whichSuggestion)); - } - Assert.assertEquals( - "Failed to log that Related Searches were shown but none selected in the " - + "Search.RelatedSearches.CTR histogram!", - 1 - relatedSearchesCount, - RecordHistogram.getHistogramValueCountForTesting("Search.RelatedSearches.CTR", 0)); - Assert.assertEquals( - "Failed to log that Related Searches were shown and at least one was selected " - + "in the Search.RelatedSearches.CTR histogram!", - relatedSearchesCount, - RecordHistogram.getHistogramValueCountForTesting("Search.RelatedSearches.CTR", 1)); - Assert.assertEquals( - "Failed to log that the carousel is shown and it was not scrolled " - + "in the Search.RelatedSearches.CarouselScrolled histogram!", - 1, - RecordHistogram.getHistogramValueCountForTesting( - "Search.RelatedSearches.CarouselScrolled", 0)); - Assert.assertEquals( - "Failed to log that the carousel is shown and its scroll and click status " - + "in the Search.RelatedSearches.CarouselScrollAndClick histogram!", - 1, - RecordHistogram.getHistogramTotalCountForTesting( - "Search.RelatedSearches.CarouselScrollAndClick")); - if (relatedSearchesCount > 0) { - Assert.assertEquals( - "Failed to log that the carousel is shown and it was not scrolled and clicked " - + "in the Search.RelatedSearches.CarouselScrollAndClick histogram!", - 1, - RecordHistogram.getHistogramValueCountForTesting( - "Search.RelatedSearches.CarouselScrollAndClick", - 1 /* int NO_SCROLL_CLICKED = 1 */)); - } else { - Assert.assertEquals( - "Failed to log that the carousel is shown and it was not scrolled and not " - + "clicked in the " - + "Search.RelatedSearches.CarouselScrollAndClick histogram!", - 1, - RecordHistogram.getHistogramValueCountForTesting( - "Search.RelatedSearches.CarouselScrollAndClick", - 0 /* int NO_SCROLL_NO_CLICK = 0 */)); - } - Assert.assertTrue( - "Failed to log the last visible position index for a chip in the carousel " - + "in the Search.RelatedSearches.CarouselLastVisibleItemPosition " - + "histogram!", - RecordHistogram.getHistogramTotalCountForTesting( - "Search.RelatedSearches.CarouselLastVisibleItemPosition") - >= 0); - } - - /** Forgets all the histograms that we care about. */ - private void forgetHistograms() { - // This is a placeholder since RecordHistogram.forgetHistogramForTesting causes flakes in - // batched tests and this is an unbatched test suite -- which automatically forgets - // histograms. See https://crbug.com/1270962. - } - - // ============================================================================================ // Test Cases. Many of these tests check histograms, which have issues running batched. // ============================================================================================ @@ -211,64 +67,4 @@ + mManager.getRequest().getSearchUrl(), mManager.getRequest().isTranslationForced()); } - - @Test - @SmallTest - @Feature({"ContextualSearch"}) - @ParameterAnnotations.UseMethodParameter(FeatureParamProvider.class) - public void testRelatedSearchesItemNotSelected(@EnabledFeature int enabledFeature) - throws Exception { - FeatureList.setTestFeatures(ENABLE_RELATED_SEARCHES_IN_BAR); - mPolicy.overrideAllowSendingPageUrlForTesting(true); - FakeResolveSearch fakeSearch = simulateResolveSearch("intelligence"); - Assert.assertFalse( - "Related Searches should have been requested but were not!", - mFakeServer.getSearchContext().getRelatedSearchesStamp().isEmpty()); - ResolvedSearchTerm resolvedSearchTerm = fakeSearch.getResolvedSearchTerm(); - Assert.assertTrue( - "Related Searches results should have been returned but were not!", - !resolvedSearchTerm.relatedSearchesJson().isEmpty()); - // Expand the panel and assert that it ends up in the right place. - expandPanelAndAssert(); - - // Don't select any Related Searches suggestion, and close the panel - closePanel(); - assertUmaForPeekAndExpandWithRSearchesEnabled(); - } - - @Test - @SmallTest - @Feature({"ContextualSearch"}) - public void testRelatedSearchesItemSelected() throws Exception { - FeatureList.setTestFeatures(ENABLE_RELATED_SEARCHES_IN_BAR); - mFakeServer.reset(); - FakeResolveSearch fakeSearch = simulateResolveSearch("intelligence"); - ResolvedSearchTerm resolvedSearchTerm = fakeSearch.getResolvedSearchTerm(); - Assert.assertTrue( - "Related Searches results should have been returned but were not!", - !resolvedSearchTerm.relatedSearchesJson().isEmpty()); - // Expand the panel and assert that it ends up in the right place. - expandPanelAndAssert(); - - // Select a Related Searches suggestion. - RelatedSearchesControl relatedSearchesControl = mPanel.getRelatedSearchesInBarControl(); - final int chipToSelect = 3; - TestThreadUtils.runOnUiThreadBlocking( - () -> relatedSearchesControl.selectChipForTest(chipToSelect)); - Assert.assertEquals( - "The Related Searches query was not shown in the Bar!", - "Selection Related 3", - mPanel.getSearchBarControl().getSearchTerm()); - - // Collapse the panel back to the peeking state - peekPanel(); - Assert.assertEquals( - "The default query was not shown in the Bar after returning to peeking state!", - "Intelligence", - mPanel.getSearchBarControl().getSearchTerm()); - - // Close the panel - closePanel(); - assertUmaForPeekAndExpandWithRSearchesEnabled(chipToSelect); - } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageNavigationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageNavigationTest.java index ef6024e..62b139c3 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageNavigationTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageNavigationTest.java
@@ -58,7 +58,7 @@ @Test @MediumTest @Feature({"NewTabPage", "Main"}) - public void testNTPIsDefault() { + public void testNtpIsDefault() { Tab tab = mActivityTestRule.getActivity().getActivityTab(); Assert.assertNotNull(tab); String url = ChromeTabUtils.getUrlStringOnUiThread(tab); @@ -73,7 +73,7 @@ @Test @LargeTest @Feature({"NewTabPage"}) - public void testNavigatingFromNTP() { + public void testNavigatingFromNtp() { String url = mTestServer.getURL("/chrome/test/data/android/google.html"); mActivityTestRule.loadUrl(url); Assert.assertEquals( @@ -86,7 +86,7 @@ @Test @MediumTest @Feature({"NewTabPage"}) - public void testNavigateBackToNTPViaUrl() { + public void testNavigateBackToNtpViaUrl() { String url = mTestServer.getURL("/chrome/test/data/android/google.html"); mActivityTestRule.loadUrl(url); Assert.assertEquals( @@ -108,7 +108,7 @@ @Test @MediumTest @Feature({"NewTabPage"}) - public void testNavigateToTabSwitcherFromNTP() { + public void testNavigateToTabSwitcherFromNtp() { final ChromeTabbedActivity cta = mActivityTestRule.getActivity(); Tab tab = cta.getActivityTab(); TestThreadUtils.runOnUiThreadBlocking( @@ -129,7 +129,7 @@ /** Tests navigating to the tab switcher from the Incognito NTP. */ @Test @MediumTest - public void testNavigateToTabSwitcherFromIncognitoNTP() { + public void testNavigateToTabSwitcherFromIncognitoNtp() { mActivityTestRule.newIncognitoTabFromMenu(); final ChromeTabbedActivity cta = mActivityTestRule.getActivity(); Tab tab = cta.getActivityTab();
diff --git a/chrome/android/profiles/arm.newest.txt b/chrome/android/profiles/arm.newest.txt index 29170f60..641d63d 100644 --- a/chrome/android/profiles/arm.newest.txt +++ b/chrome/android/profiles/arm.newest.txt
@@ -1 +1 @@ -chromeos-chrome-arm-121.0.6154.0_rc-r1-merged.afdo.bz2 +chromeos-chrome-arm-121.0.6155.0_rc-r1-merged.afdo.bz2
diff --git a/chrome/android/profiles/newest.txt b/chrome/android/profiles/newest.txt index 0871730..04cfcc3 100644 --- a/chrome/android/profiles/newest.txt +++ b/chrome/android/profiles/newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-121.0.6154.0_rc-r1-merged.afdo.bz2 +chromeos-chrome-amd64-121.0.6155.0_rc-r1-merged.afdo.bz2
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index e4055c9..cdbfcd4 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -9776,9 +9776,6 @@ <message name="IDS_PASSWORD_MANAGER_TOOLTIP_SHARED_NOTIFICATION" desc="Text for the 'Manage Passwords' icon's 'shared password notification' state"> New password received </message> - <message name="IDS_PASSWORD_MANAGER_TOOLTIP_KEYCHAIN_ERROR" desc="Text for the 'Manage Passwords' icon's 'keychain error' state"> - Fix password error - </message> <message name="IDS_PASSWORD_MANAGER_IMPORT_DIALOG_TITLE" desc="The title of the file selection dialog for importing passwords"> Import Passwords To Chrome </message> @@ -13448,29 +13445,53 @@ </message> <!-- Web MIDI messages --> + <message name="IDS_ALLOWED_MIDI_TITLE" desc="Title of the info bubble shown when a site is allowed to use MIDI messages."> + MIDI devices allowed + </message> + <message name="IDS_BLOCKED_MIDI_TITLE" desc="Title of the info bubble shown when a site is denied to use MIDI smessages."> + MIDI devices blocked + </message> + <message name="IDS_ALLOWED_MIDI_MESSAGE" desc="Info bubble message and location bar icon tooltip text shown when a site has been allowed to use MIDI messages."> + This site is using your MIDI devices. + </message> + <message name="IDS_ALLOWED_MIDI_BLOCK" desc="Radio button to block access to use MIDI messages."> + Always block <ph name="HOST">$1<ex>example.com</ex></ph> from using your MIDI devices. + </message> + <message name="IDS_ALLOWED_MIDI_NO_ACTION" desc="Radio button to keep allowing access to use MIDI messages."> + Continue allowing this site to use your MIDI devices. + </message> + <message name="IDS_BLOCKED_MIDI_MESSAGE" desc="Info bubble message and location bar icon tooltip text shown when a site has been denied access to use MIDI messages."> + This site has been blocked from using your MIDI devices. + </message> + <message name="IDS_BLOCKED_MIDI_UNBLOCK" desc="Radio button choice to unblock a site from using MIDI messages."> + Always allow <ph name="HOST">$1<ex>mail.google.com</ex></ph> to use your MIDI devices. + </message> + <message name="IDS_BLOCKED_MIDI_NO_ACTION" desc="Radio button choice to continue blocking a site from using MIDI messages."> + Continue blocking this site from using your MIDI devices. + </message> <message name="IDS_ALLOWED_MIDI_SYSEX_TITLE" desc="Title of the info bubble shown when a site is allowed to use MIDI system exclusive messages."> - Full control of MIDI devices allowed + Control and reprogramming of MIDI devices allowed </message> <message name="IDS_BLOCKED_MIDI_SYSEX_TITLE" desc="Title of the info bubble shown when a site is denied to use MIDI system exclusive messages."> - Full control of MIDI devices denied + Control and reprogramming of MIDI devices blocked </message> <message name="IDS_ALLOWED_MIDI_SYSEX_MESSAGE" desc="Info bubble message and location bar icon tooltip text shown when a site has been allowed to use MIDI system exclusive messages."> - This page has full control of MIDI devices. + This site can control and reprogram your MIDI devices (SysEx). </message> <message name="IDS_ALLOWED_MIDI_SYSEX_BLOCK" desc="Radio button to block access to use MIDI system exclusive messages."> - Always block <ph name="HOST">$1<ex>example.com</ex></ph> from having full control of MIDI devices. + Always block <ph name="HOST">$1<ex>example.com</ex></ph> from controlling and reprogramming your MIDI devices. </message> <message name="IDS_ALLOWED_MIDI_SYSEX_NO_ACTION" desc="Radio button to keep allowing access to use MIDI system exclusive messages."> - Continue allowing this site to have full control of MIDI devices + Continue allowing this site to control and reprogram your MIDI devices. </message> <message name="IDS_BLOCKED_MIDI_SYSEX_MESSAGE" desc="Info bubble message and location bar icon tooltip text shown when a site has been denied access to use MIDI system exclusive messages."> - This site has been blocked from having full control of MIDI devices. + This site has been blocked from controlling and reprogramming your MIDI devices (SysEx). </message> <message name="IDS_BLOCKED_MIDI_SYSEX_UNBLOCK" desc="Radio button choice to unblock a site from using MIDI system exclusive messages."> - Always allow <ph name="HOST">$1<ex>mail.google.com</ex></ph> to have full control of MIDI devices + Always allow <ph name="HOST">$1<ex>mail.google.com</ex></ph> to control and reprogram your MIDI devices. </message> <message name="IDS_BLOCKED_MIDI_SYSEX_NO_ACTION" desc="Radio button choice to continue blocking a site from using MIDI system exclusive messages."> - Continue blocking this site from having full control of MIDI devices + Continue blocking this site from controlling and reprogramming your MIDI devices. </message> <!-- Media Stream -->
diff --git a/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_BLOCK.png.sha1 b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_BLOCK.png.sha1 new file mode 100644 index 0000000..a9d1c6d --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_BLOCK.png.sha1
@@ -0,0 +1 @@ +6f6e285eccba0c895325acdfde5a7b7369370852 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_MESSAGE.png.sha1 b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_MESSAGE.png.sha1 new file mode 100644 index 0000000..a9d1c6d --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_MESSAGE.png.sha1
@@ -0,0 +1 @@ +6f6e285eccba0c895325acdfde5a7b7369370852 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_NO_ACTION.png.sha1 b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_NO_ACTION.png.sha1 new file mode 100644 index 0000000..a9d1c6d --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_NO_ACTION.png.sha1
@@ -0,0 +1 @@ +6f6e285eccba0c895325acdfde5a7b7369370852 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_BLOCK.png.sha1 b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_BLOCK.png.sha1 index b1eb617..8b203ce 100644 --- a/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_BLOCK.png.sha1 +++ b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_BLOCK.png.sha1
@@ -1 +1 @@ -ad650f80f15cc09845a6a8966905563eaf00c1a5 \ No newline at end of file +ea3ce3c4ce561aa46d50b311c32b0686d19485e3 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_MESSAGE.png.sha1 b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_MESSAGE.png.sha1 index b1eb617..8b203ce 100644 --- a/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_MESSAGE.png.sha1 +++ b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_MESSAGE.png.sha1
@@ -1 +1 @@ -ad650f80f15cc09845a6a8966905563eaf00c1a5 \ No newline at end of file +ea3ce3c4ce561aa46d50b311c32b0686d19485e3 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_NO_ACTION.png.sha1 b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_NO_ACTION.png.sha1 index b1eb617..8b203ce 100644 --- a/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_NO_ACTION.png.sha1 +++ b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_NO_ACTION.png.sha1
@@ -1 +1 @@ -ad650f80f15cc09845a6a8966905563eaf00c1a5 \ No newline at end of file +ea3ce3c4ce561aa46d50b311c32b0686d19485e3 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_TITLE.png.sha1 b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_TITLE.png.sha1 index b1eb617..8b203ce 100644 --- a/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_TITLE.png.sha1 +++ b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_SYSEX_TITLE.png.sha1
@@ -1 +1 @@ -ad650f80f15cc09845a6a8966905563eaf00c1a5 \ No newline at end of file +ea3ce3c4ce561aa46d50b311c32b0686d19485e3 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_TITLE.png.sha1 b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_TITLE.png.sha1 new file mode 100644 index 0000000..a9d1c6d --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_ALLOWED_MIDI_TITLE.png.sha1
@@ -0,0 +1 @@ +6f6e285eccba0c895325acdfde5a7b7369370852 \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_MESSAGE.png.sha1 b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_MESSAGE.png.sha1 new file mode 100644 index 0000000..bb0dce6 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_MESSAGE.png.sha1
@@ -0,0 +1 @@ +e19fccde816be5aff25ce955f3d7aea49f01436b \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_NO_ACTION.png.sha1 b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_NO_ACTION.png.sha1 new file mode 100644 index 0000000..bb0dce6 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_NO_ACTION.png.sha1
@@ -0,0 +1 @@ +e19fccde816be5aff25ce955f3d7aea49f01436b \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_MESSAGE.png.sha1 b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_MESSAGE.png.sha1 index 2f9078a..2de32d24 100644 --- a/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_MESSAGE.png.sha1 +++ b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_MESSAGE.png.sha1
@@ -1 +1 @@ -04c7a561a565a00071ca4deb6e72921f9756182a \ No newline at end of file +e52333a05f50195cc322ee656e33081324c6785a \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_NO_ACTION.png.sha1 b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_NO_ACTION.png.sha1 index 2f9078a..2de32d24 100644 --- a/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_NO_ACTION.png.sha1 +++ b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_NO_ACTION.png.sha1
@@ -1 +1 @@ -04c7a561a565a00071ca4deb6e72921f9756182a \ No newline at end of file +e52333a05f50195cc322ee656e33081324c6785a \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_TITLE.png.sha1 b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_TITLE.png.sha1 index 2f9078a..2de32d24 100644 --- a/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_TITLE.png.sha1 +++ b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_TITLE.png.sha1
@@ -1 +1 @@ -04c7a561a565a00071ca4deb6e72921f9756182a \ No newline at end of file +e52333a05f50195cc322ee656e33081324c6785a \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_UNBLOCK.png.sha1 b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_UNBLOCK.png.sha1 index 2f9078a..2de32d24 100644 --- a/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_UNBLOCK.png.sha1 +++ b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_SYSEX_UNBLOCK.png.sha1
@@ -1 +1 @@ -04c7a561a565a00071ca4deb6e72921f9756182a \ No newline at end of file +e52333a05f50195cc322ee656e33081324c6785a \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_TITLE.png.sha1 b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_TITLE.png.sha1 new file mode 100644 index 0000000..bb0dce6 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_TITLE.png.sha1
@@ -0,0 +1 @@ +e19fccde816be5aff25ce955f3d7aea49f01436b \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_UNBLOCK.png.sha1 b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_UNBLOCK.png.sha1 new file mode 100644 index 0000000..bb0dce6 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_BLOCKED_MIDI_UNBLOCK.png.sha1
@@ -0,0 +1 @@ +e19fccde816be5aff25ce955f3d7aea49f01436b \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_PASSWORD_MANAGER_TOOLTIP_KEYCHAIN_ERROR.png.sha1 b/chrome/app/generated_resources_grd/IDS_PASSWORD_MANAGER_TOOLTIP_KEYCHAIN_ERROR.png.sha1 deleted file mode 100644 index b23afdd..0000000 --- a/chrome/app/generated_resources_grd/IDS_PASSWORD_MANAGER_TOOLTIP_KEYCHAIN_ERROR.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -5a9d08b6a7e11150237ba55511efc2081ab150b3 \ No newline at end of file
diff --git a/chrome/app/os_settings_strings.grdp b/chrome/app/os_settings_strings.grdp index 80ebb224..56368b10 100644 --- a/chrome/app/os_settings_strings.grdp +++ b/chrome/app/os_settings_strings.grdp
@@ -4083,8 +4083,8 @@ <message name="IDS_SETTINGS_INTERNET_MOBILE_DATA_NETWORKS" desc="Name of the settings page which displays a list of mobile data networks which the user can choose to connect to."> Mobile data networks </message> - <message name="IDS_SETTINGS_INTERNET_DEVICE_ENABLING" desc="Settings > Internet > Message when a device (e.g a Cellular modem) is enabling."> - Enabling + <message name="IDS_SETTINGS_NETWORK_DEVICE_TURNING_ON" desc="Settings > Network > Message when a device (e.g a Cellular modem) is turning on."> + Turning on... </message> <message name="IDS_SETTINGS_INTERNET_DEVICE_BUSY" desc="Settings > Internet > Message when the cellular modem is busy applying updates (e.g., installing an eSIM profile)."> Applying changes... @@ -5457,6 +5457,9 @@ <message name="IDS_SETTINGS_DISPLAY_NIGHT_LIGHT_SCHEDULE_SUNSET_TO_SUNRISE" desc="In Device Settings > Displays, the label of the option to set the automatic schedule of the Night Light feature to turn on at sunset and off at sunrise."> Sunset to sunrise </message> + <message name="IDS_SETTINGS_DISPLAY_NIGHT_LIGHT_GEOLOCATION_WARNING_TEXT" translateable="false" desc="In Device Settings > Displays, the warning text that tells users that system geolocation permission is needed for scheduled night light."> + Current schedule is set to 6am - 6pm. To automatically update the sunset and sunrise schedule <ph name="BEGIN_LINK"><a href="#"></ph>turn on Location access<ph name="END_LINK"></a></ph> + </message> <message name="IDS_SETTINGS_DISPLAY_NIGHT_LIGHT_TEXT" desc="In Device Settings > Displays, text describing the Night Light feature."> Make it easier to look at your screen or read in dim light </message> @@ -5685,6 +5688,9 @@ <message name="IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_IP_ONLY_DEFAULT" desc="Display name for the automatic time zone detection mode which enables time zone detection sending unprecise location to Google servers. Default means that this is the default time zone detection mode."> Use your IP address to determine location (default) </message> + <message name="IDS_SETTINGS_TIME_ZONE_DETECTION_GEOLOCATION_WARNING_TEXT" translateable="false" desc="Displays the text notifying users that the system geolocation permission is required for the Automatic Time Zone Detection. Displaying the current status of Automatic Time Zone Detection with inline link to resolve the breakage."> + Time Zone is currently set to (UTC+/-X:XX). Location access is needed to automatically update the time zone. <ph name="BEGIN_LINK"><a href="#"></ph>Turn on Location access<ph name="END_LINK"></a></ph> + </message> <message name="IDS_OS_SETTINGS_REVAMP_TIME_ZONE_DETECTION_MODE_IP_ONLY_DEFAULT" desc="Display name for the automatic time zone detection mode which enables time zone detection sending unprecise location to Google servers."> Use your IP address to determine location </message> @@ -5709,16 +5715,18 @@ <message name="IDS_SETTINGS_SET_DATE_TIME" desc="Label for the button that shows the dialog for setting the system date and time."> Set date and time </message> - <message name="IDS_SETTINGS_TIME_ZONE_GEOLOCATION_DIALOG_TITLE" desc="Title for the dialog, that pops up when user wants to access precise location for better time zone resolution, but the system geoocation access is disabled. This dialog asks if the user wants to enable the system geolocation access."> - Turn on precise location access? + <message name="IDS_SETTINGS_PRIVACY_HUB_GEOLOCATION_DIALOG_TITLE" translateable="false" desc="Title for the dialog, that enables users to grant the system geolocation permission for system services. This pop-up is used in few places (e.g. Automatic Time Zone) to let users conveniently enable geolocation and make the underlying feature fucntional, without navigating to the settings page."> + Allow system services to use your location? </message> - <message name="IDS_SETTINGS_TIME_ZONE_GEOLOCATION_DIALOG_BODY" desc="Description text of the dialog that prompts the user to enable system geolocation access. This gives detailed explanation of the outcomes, if the user accepts the dialog."> - This allows apps and websites with the location permission and ChromeOS to use the location determined by your Wi-Fi or mobile networks. <ph name="LINK_BEGIN"><a></ph>Learn more<ph name="LINK_END"></a></ph> + <message name="IDS_SETTINGS_PRIVACY_HUB_GEOLOCATION_DIALOG_BODY" translateable="false" desc="Description of the dialog that prompts the user to enable system geolocation access. This gives detailed explanation of the outcomes of enabling system geolocation access for system services."> + This allows system services with the permission to use your location. Location may use sources like Wi-Fi, mobile networks, and sensors to help estimate your device's location. <ph name="LINK_BEGIN"><a></ph>Learn more<ph name="LINK_END"></a></ph> </message> - <message name="IDS_SETTINGS_TIME_ZONE_GEOLOCATION_DIALOG_CANCEL_BUTTON" desc="Label of the cancel button, that dismisses the geolocation dialog."> + <message name="IDS_SETTINGS_PRIVACY_HUB_GEOLOCATION_DIALOG_CONFIRM_BUTTON" translateable="false" desc="Label of the confirm button for the geolocation dialog, that enables geolocation for ChromeOS system services."> + Allow + </message> + <message name="IDS_SETTINGS_PRIVACY_HUB_GEOLOCATION_DIALOG_CANCEL_BUTTON" translateable="false" desc="Label of the cancel button, that dismisses the geolocation dialog."> Cancel </message> - <!-- Per Device Keyboard page (OS settings) --> <message name="IDS_SETTINGS_BUILT_IN_KEYBOARD_NAME" desc="In Device Settings, the name of the built-in/internal keyboard device within the settings app."> Built-in Keyboard
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_NETWORK_DEVICE_TURNING_ON.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_NETWORK_DEVICE_TURNING_ON.png.sha1 new file mode 100644 index 0000000..caf25d1e --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_NETWORK_DEVICE_TURNING_ON.png.sha1
@@ -0,0 +1 @@ +d43636028afa6f5e28aefa7ee6f52330d5b076f5 \ No newline at end of file
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_TIME_ZONE_GEOLOCATION_DIALOG_BODY.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_TIME_ZONE_GEOLOCATION_DIALOG_BODY.png.sha1 deleted file mode 100644 index bedf0ab..0000000 --- a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_TIME_ZONE_GEOLOCATION_DIALOG_BODY.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -eabdf4225ae48f00e308d1f99d3dabe4a5e3efdd \ No newline at end of file
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_TIME_ZONE_GEOLOCATION_DIALOG_CANCEL_BUTTON.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_TIME_ZONE_GEOLOCATION_DIALOG_CANCEL_BUTTON.png.sha1 deleted file mode 100644 index fefe05b..0000000 --- a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_TIME_ZONE_GEOLOCATION_DIALOG_CANCEL_BUTTON.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -89e97ed8fce454ccf8911d6576aeda208802348c \ No newline at end of file
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_TIME_ZONE_GEOLOCATION_DIALOG_TITLE.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_TIME_ZONE_GEOLOCATION_DIALOG_TITLE.png.sha1 deleted file mode 100644 index 10d029ff..0000000 --- a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_TIME_ZONE_GEOLOCATION_DIALOG_TITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -08152957f1945c7472f0df19d5d1d08e37cf9e0b \ No newline at end of file
diff --git a/chrome/app_shim/chrome_main_app_mode_mac.mm b/chrome/app_shim/chrome_main_app_mode_mac.mm index e0374f2..8d0d8829 100644 --- a/chrome/app_shim/chrome_main_app_mode_mac.mm +++ b/chrome/app_shim/chrome_main_app_mode_mac.mm
@@ -145,7 +145,7 @@ if (info->mojo_ipcz_config == app_mode::MojoIpczConfig::kUseCommandLineFeatures) { const auto& command_line = *base::CommandLine::ForCurrentProcess(); - feature_list->InitializeFromCommandLine( + feature_list->InitFromCommandLine( command_line.GetSwitchValueASCII(switches::kEnableFeatures), command_line.GetSwitchValueASCII(switches::kDisableFeatures));
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 499562a..8256d79 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -6377,9 +6377,11 @@ "enterprise/signals/user_permission_service_factory.cc", "enterprise/signals/user_permission_service_factory.h", - # This policy is only supported on non-lacros desktop + # These policies are only supported on non-lacros desktop "performance_manager/public/user_tuning/high_efficiency_policy_handler.h", "performance_manager/user_tuning/high_efficiency_policy_handler.cc", + "policy/battery_saver_policy_handler.cc", + "policy/battery_saver_policy_handler.h", ] deps += [ "//chrome/browser/enterprise/connectors/device_trust:features",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index bc67aa8..a3b26ef 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -3464,75 +3464,6 @@ }; #endif -const FeatureEntry::FeatureParam - kPrivacySandboxSettings4ShowSampleDataForTesting[] = { - {privacy_sandbox::kPrivacySandboxSettings4ShowSampleDataForTestingName, - "true"}}; -const FeatureEntry::FeatureParam kPrivacySandboxSettings4NoticeRequired[] = { - {privacy_sandbox::kPrivacySandboxSettings4NoticeRequiredName, "true"}}; -const FeatureEntry::FeatureParam kPrivacySandboxSettings4ConsentRequired[] = { - {privacy_sandbox::kPrivacySandboxSettings4ConsentRequiredName, "true"}}; -const FeatureEntry::FeatureParam kPrivacySandboxSettings4RestrictedNotice[] = { - {privacy_sandbox::kPrivacySandboxSettings4RestrictedNoticeName, "true"}, - {privacy_sandbox::kPrivacySandboxSettings4NoticeRequiredName, "true"}}; -const FeatureEntry::FeatureParam - kPrivacySandboxSettings4ForceShowConsentForTesting[] = { - {privacy_sandbox:: - kPrivacySandboxSettings4ForceShowConsentForTestingName, - "true"}, - {privacy_sandbox::kPrivacySandboxSettings4ConsentRequiredName, "true"}}; -const FeatureEntry::FeatureParam - kPrivacySandboxSettings4ForceShowROWNoticeForTesting[] = { - {privacy_sandbox:: - kPrivacySandboxSettings4ForceShowNoticeRowForTestingName, - "true"}, - {privacy_sandbox::kPrivacySandboxSettings4NoticeRequiredName, "true"}}; -const FeatureEntry::FeatureParam - kPrivacySandboxSettings4ForceShowEEANoticeForTesting[] = { - {privacy_sandbox:: - kPrivacySandboxSettings4ForceShowNoticeEeaForTestingName, - "true"}, - {privacy_sandbox::kPrivacySandboxSettings4ConsentRequiredName, "true"}}; -const FeatureEntry::FeatureParam - kPrivacySandboxSettings4ForceShowRestrictedNoticeForTesting[] = { - {privacy_sandbox:: - kPrivacySandboxSettings4ForceShowNoticeRestrictedForTestingName, - "true"}, - {privacy_sandbox::kPrivacySandboxSettings4RestrictedNoticeName, "true"}, - {privacy_sandbox::kPrivacySandboxSettings4NoticeRequiredName, "true"}}; -const FeatureEntry::FeatureParam - kPrivacySandboxSettings4ForceRestrictedUserForTesting[] = { - {privacy_sandbox::kPrivacySandboxSettings4RestrictedNoticeName, "true"}, - {privacy_sandbox:: - kPrivacySandboxSettings4ForceRestrictedUserForTestingName, - "true"}}; - -const FeatureEntry::FeatureVariation kPrivacySandboxSettings4Variations[] = { - {"Sample Data", kPrivacySandboxSettings4ShowSampleDataForTesting, - std::size(kPrivacySandboxSettings4ShowSampleDataForTesting), nullptr}, - {"Notice Required", kPrivacySandboxSettings4NoticeRequired, - std::size(kPrivacySandboxSettings4NoticeRequired), nullptr}, - {"Consent Required", kPrivacySandboxSettings4ConsentRequired, - std::size(kPrivacySandboxSettings4ConsentRequired), nullptr}, - {"Restricted notice", kPrivacySandboxSettings4RestrictedNotice, - std::size(kPrivacySandboxSettings4RestrictedNotice), nullptr}, - {"Force show consent", kPrivacySandboxSettings4ForceShowConsentForTesting, - std::size(kPrivacySandboxSettings4ForceShowConsentForTesting), nullptr}, - {"Force show ROW notice", - kPrivacySandboxSettings4ForceShowROWNoticeForTesting, - std::size(kPrivacySandboxSettings4ForceShowROWNoticeForTesting), nullptr}, - {"Force show EEA notice", - kPrivacySandboxSettings4ForceShowEEANoticeForTesting, - std::size(kPrivacySandboxSettings4ForceShowEEANoticeForTesting), nullptr}, - {"Force show Restricted notice", - kPrivacySandboxSettings4ForceShowRestrictedNoticeForTesting, - std::size(kPrivacySandboxSettings4ForceShowRestrictedNoticeForTesting), - nullptr}, - {"Force restricted user", - kPrivacySandboxSettings4ForceRestrictedUserForTesting, - std::size(kPrivacySandboxSettings4ForceRestrictedUserForTesting), nullptr}, -}; - const FeatureEntry::FeatureParam kTPCPhaseOutFacilitatedTestingControl1[] = { {tpcd::experiment::kForceEligibleForTestingName, "false"}, {tpcd::experiment::kDisable3PCookiesName, "false"}, @@ -5765,6 +5696,9 @@ {"enable-federated-service", flag_descriptions::kFederatedServiceName, flag_descriptions::kFederatedServiceDescription, kOsCrOS, FEATURE_VALUE_TYPE(ash::features::kFederatedService)}, + {"screencast-v2", flag_descriptions::kScreencastV2Name, + flag_descriptions::kScreencastV2Description, kOsCrOS, + FEATURE_VALUE_TYPE(ash::features::kProjectorV2)}, #endif // BUILDFLAG(IS_CHROMEOS_ASH) {"enable-cros-touch-text-editing-redesign", flag_descriptions::kTouchTextEditingRedesignName, @@ -7259,10 +7193,9 @@ kSearchResumptionModuleAndroidVariations, "kSearchResumptionModuleAndroid")}, - {"enable-close-tab-suggestions", - flag_descriptions::kCloseTabSuggestionsName, - flag_descriptions::kCloseTabSuggestionsDescription, kOsAndroid, - FEATURE_VALUE_TYPE(chrome::android::kCloseTabSuggestions)}, + {"enable-archive-tab-service", flag_descriptions::kArchiveTabServiceName, + flag_descriptions::kArchiveTabServiceDescription, kOsAndroid, + FEATURE_VALUE_TYPE(chrome::android::kArchiveTabService)}, {"enable-critical-persisted-tab-data", flag_descriptions::kCriticalPersistedTabDataName, @@ -7279,11 +7212,6 @@ flag_descriptions::kSuppressToolbarCapturesDescription, kOsAndroid, FEATURE_VALUE_TYPE(chrome::android::kSuppressToolbarCaptures)}, - {"enable-commerce-merchant-viewer", - flag_descriptions::kCommerceMerchantViewerAndroidName, - flag_descriptions::kCommerceMerchantViewerAndroidDescription, kOsAndroid, - FEATURE_VALUE_TYPE(commerce::kCommerceMerchantViewer)}, - {"enable-commerce-price-tracking", commerce::flag_descriptions::kCommercePriceTrackingName, commerce::flag_descriptions::kCommercePriceTrackingDescription, kOsAndroid, @@ -8174,6 +8102,12 @@ kOsLinux | kOsMac | kOsWin | kOsCrOS | kOsAndroid, FEATURE_VALUE_TYPE(net::features::kUseDnsHttpsSvcbAlpn)}, +#if !BUILDFLAG(IS_ANDROID) + {"hidpi-capture", flag_descriptions::kWebContentsCaptureHiDpiName, + flag_descriptions::kWebContentsCaptureHiDpiDescription, kOsDesktop, + FEATURE_VALUE_TYPE(media::kWebContentsCaptureHiDpi)}, +#endif // !BUILDFLAG(IS_ANDROID) + #if BUILDFLAG(IS_ANDROID) {"web-otp-backend", flag_descriptions::kWebOtpBackendName, flag_descriptions::kWebOtpBackendDescription, kOsAndroid, @@ -8777,13 +8711,6 @@ FEATURE_VALUE_TYPE(privacy_sandbox::kPrivacySandboxAdsNoticeCCT)}, #endif // BUILDFLAG(IS_ANDROID) - {"privacy-sandbox-settings-4", - flag_descriptions::kPrivacySandboxSettings4Name, - flag_descriptions::kPrivacySandboxSettings4Description, kOsAll, - FEATURE_WITH_PARAMS_VALUE_TYPE(privacy_sandbox::kPrivacySandboxSettings4, - kPrivacySandboxSettings4Variations, - "PrivacySandboxSettings4")}, - {"privacy-sandbox-proactive-topics-blocking", flag_descriptions::kPrivacySandboxProactiveTopicsBlockingName, flag_descriptions::kPrivacySandboxProactiveTopicsBlockingDescription, @@ -10555,9 +10482,9 @@ {"enable-desk-button", flag_descriptions::kDeskButtonName, flag_descriptions::kDeskButtonDescription, kOsCrOS, FEATURE_VALUE_TYPE(ash::features::kDeskButton)}, -#endif - -#if BUILDFLAG(IS_CHROMEOS_ASH) + {"cros-focus-mode", flag_descriptions::kFocusModeName, + flag_descriptions::kFocusModeDescription, kOsCrOS, + FEATURE_VALUE_TYPE(ash::features::kFocusMode)}, {"render-arc-notifications-by-chrome", flag_descriptions::kRenderArcNotificationsByChromeName, flag_descriptions::kRenderArcNotificationsByChromeDescription, kOsCrOS,
diff --git a/chrome/browser/android/customtabs/branding/java/src/org/chromium/chrome/browser/customtabs/features/branding/BrandingChecker.java b/chrome/browser/android/customtabs/branding/java/src/org/chromium/chrome/browser/customtabs/features/branding/BrandingChecker.java index 52e1562..0a2dc43 100644 --- a/chrome/browser/android/customtabs/branding/java/src/org/chromium/chrome/browser/customtabs/features/branding/BrandingChecker.java +++ b/chrome/browser/android/customtabs/branding/java/src/org/chromium/chrome/browser/customtabs/features/branding/BrandingChecker.java
@@ -105,14 +105,11 @@ brandingDecision = makeBrandingDecisionFromLaunchTime(startTime, timeLastBranding); } @BrandingAppIdType int appIdType = getAppIdType(mAppId); - boolean isPackageValid = appIdType == BrandingAppIdType.PACKAGE_NAME; RecordHistogram.recordTimesHistogram( "CustomTabs.Branding.BrandingCheckDuration", SystemClock.elapsedRealtime() - startTime); RecordHistogram.recordEnumeratedHistogram( "CustomTabs.Branding.AppIdType", appIdType, BrandingAppIdType.NUM_ENTRIES); - RecordHistogram.recordBooleanHistogram( - "CustomTabs.Branding.IsPackageNameValid", isPackageValid); return brandingDecision; } @@ -163,9 +160,6 @@ "CustomTabs.Branding.BrandingDecision", brandingDecision, BrandingDecision.NUM_ENTRIES); - RecordHistogram.recordBooleanHistogram( - "CustomTabs.Branding.BrandingCheckCanceled", isCancelled()); - // Remove the storage from reference. mStorage = null; }
diff --git a/chrome/browser/android/customtabs/branding/java/src/org/chromium/chrome/browser/customtabs/features/branding/BrandingCheckerUnitTest.java b/chrome/browser/android/customtabs/branding/java/src/org/chromium/chrome/browser/customtabs/features/branding/BrandingCheckerUnitTest.java index 0ddcbe2..2c5715c9 100644 --- a/chrome/browser/android/customtabs/branding/java/src/org/chromium/chrome/browser/customtabs/features/branding/BrandingCheckerUnitTest.java +++ b/chrome/browser/android/customtabs/branding/java/src/org/chromium/chrome/browser/customtabs/features/branding/BrandingCheckerUnitTest.java
@@ -23,18 +23,16 @@ import org.robolectric.annotation.LooperMode.Mode; import org.robolectric.shadows.ShadowLooper; import org.robolectric.shadows.ShadowPackageManager; -import org.robolectric.shadows.ShadowPausedAsyncTask; import org.robolectric.shadows.ShadowSystemClock; import org.chromium.base.ContextUtils; -import org.chromium.base.metrics.RecordHistogram; -import org.chromium.base.metrics.UmaRecorderHolder; import org.chromium.base.task.AsyncTask; import org.chromium.base.task.TaskTraits; import org.chromium.base.task.test.ShadowPostTask; import org.chromium.base.task.test.ShadowPostTask.TestImpl; import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.base.test.util.CallbackHelper; +import org.chromium.base.test.util.HistogramWatcher; import org.chromium.chrome.browser.customtabs.features.branding.BrandingChecker.BrandingAppIdType; import org.chromium.chrome.browser.customtabs.features.branding.BrandingChecker.BrandingLaunchTimeStorage; @@ -56,18 +54,17 @@ private static final long PACKAGE_2_BRANDING_SHOWN_SINCE_START = 5; TestBrandingStorage mStorage = new TestBrandingStorage(); - private Context mContext; long mStartTime; @Before public void setup() { - mContext = ContextUtils.getApplicationContext(); + Context context = ContextUtils.getApplicationContext(); mStartTime = SystemClock.elapsedRealtime(); mStorage.put(PACKAGE_1, PACKAGE_1_BRANDING_SHOWN_SINCE_START + mStartTime); mStorage.put(PACKAGE_2, PACKAGE_2_BRANDING_SHOWN_SINCE_START + mStartTime); - ShadowPackageManager pm = Shadows.shadowOf(mContext.getPackageManager()); + ShadowPackageManager pm = Shadows.shadowOf(context.getPackageManager()); pm.installPackage(PackageInfoBuilder.newBuilder().setPackageName(PACKAGE_1).build()); pm.installPackage(PackageInfoBuilder.newBuilder().setPackageName(PACKAGE_2).build()); pm.installPackage(PackageInfoBuilder.newBuilder().setPackageName(NEW_APPLICATION).build()); @@ -86,10 +83,8 @@ @After public void tearDown() { - UmaRecorderHolder.resetForTesting(); ShadowPackageManager.reset(); ShadowSystemClock.reset(); - ShadowPausedAsyncTask.reset(); } @Test @@ -101,6 +96,7 @@ BrandingChecker checker = createBrandingChecker(PACKAGE_1, callbackDelegate); checker.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + HistogramWatcher watcher = newHistogramWatcher(/* decision= */ BrandingDecision.TOOLBAR); mainLooper().idle(); assertEquals( "Branding is checked after cadence, BrandingDecision should be TOOLBAR. ", @@ -108,11 +104,7 @@ callbackDelegate.getBrandingDecision()); assertEquals("Show branding time is different.", showBrandingTime, mStorage.get(PACKAGE_1)); - - assertHistogramRecorded( - /* decision= */ BrandingDecision.TOOLBAR, - /* isPackageValid= */ true, - /* isCanceled= */ false); + watcher.assertExpected(); } @Test @@ -121,6 +113,7 @@ BrandingChecker checker = createBrandingChecker(NEW_APPLICATION, callbackDelegate); checker.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + HistogramWatcher watcher = newHistogramWatcher(/* decision= */ BrandingDecision.TOAST); mainLooper().idle(); long showBrandingTime = SystemClock.elapsedRealtime(); assertEquals( @@ -131,11 +124,7 @@ "Show branding time is different.", showBrandingTime, mStorage.get(NEW_APPLICATION)); - - assertHistogramRecorded( - /* decision= */ BrandingDecision.TOAST, - /* isPackageValid= */ true, - /* isCanceled= */ false); + watcher.assertExpected(); } @Test @@ -146,6 +135,7 @@ BrandingChecker checker = createBrandingChecker(PACKAGE_1, callbackDelegate); checker.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + HistogramWatcher watcher = newHistogramWatcher(/* decision= */ BrandingDecision.TOAST); // Run looper for #doInBackground mainLooper().runOneTask(); assertEquals("BrandingDecision is not set yet.", 0, callbackDelegate.getCallCount()); @@ -159,11 +149,7 @@ BrandingDecision.TOAST, callbackDelegate.getBrandingDecision()); assertEquals("Show branding time is different.", showBrandingTime, mStorage.get(PACKAGE_1)); - - assertHistogramRecorded( - /* decision= */ BrandingDecision.TOAST, - /* isPackageValid= */ true, - /* isCanceled= */ true); + watcher.assertExpected(); } @Test @@ -172,6 +158,7 @@ BrandingChecker checker = createBrandingChecker(INVALID_ID, callbackDelegate); checker.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + HistogramWatcher watcher = newHistogramWatcher(/* decision= */ BrandingDecision.TOAST); mainLooper().idle(); assertEquals( "Package is invalid, BrandingDecision should be the test default. ", @@ -179,11 +166,7 @@ callbackDelegate.getBrandingDecision()); assertEquals( "Branding time should not record for invalid id.", -1, mStorage.get(INVALID_ID)); - - assertHistogramRecorded( - /* decision= */ BrandingDecision.TOAST, - /* isPackageValid= */ false, - /* isCanceled= */ false); + watcher.assertExpected(); } @Test @@ -253,30 +236,11 @@ ShadowSystemClock.advanceBy(increments, TimeUnit.MILLISECONDS); } - private void assertHistogramRecorded( - @BrandingDecision int decision, boolean isPackageValid, boolean isCanceled) { - assertHistogramSampleRecorded( - "CustomTabs.Branding.BrandingCheckCanceled", isCanceled ? 1 : 0); - assertHistogramSampleRecorded("CustomTabs.Branding.BrandingDecision", decision); - assertHistogramSampleRecorded( - "CustomTabs.Branding.IsPackageNameValid", isPackageValid ? 1 : 0); - - assertEquals( - "<CustomTabs.Branding.BrandingCheckDuration> not recorded.", - 1, - RecordHistogram.getHistogramTotalCountForTesting( - "CustomTabs.Branding.BrandingCheckDuration")); - } - - private void assertHistogramSampleRecorded(String name, int sample) { - assertEquals( - "<" + name + "> not recorded.", - 1, - RecordHistogram.getHistogramTotalCountForTesting(name)); - assertEquals( - "<" + name + "> sample <" + sample + "> count is different.", - 1, - RecordHistogram.getHistogramValueCountForTesting(name, sample)); + private HistogramWatcher newHistogramWatcher(@BrandingDecision int decision) { + return HistogramWatcher.newBuilder() + .expectIntRecord("CustomTabs.Branding.BrandingDecision", decision) + .expectAnyRecord("CustomTabs.Branding.BrandingCheckDuration") + .build(); } private static class CallbackDelegate extends CallbackHelper {
diff --git a/chrome/browser/android/omnibox/autocomplete_controller_android.cc b/chrome/browser/android/omnibox/autocomplete_controller_android.cc index 3431df3..c171ab7c 100644 --- a/chrome/browser/android/omnibox/autocomplete_controller_android.cc +++ b/chrome/browser/android/omnibox/autocomplete_controller_android.cc
@@ -126,6 +126,10 @@ AutocompleteControllerEmitter::GetForBrowserContext(profile_); if (emitter) autocomplete_controller_->AddObserver(emitter); + + if (profile) { + profile_observation_.Observe(profile); + } } void AutocompleteControllerAndroid::Start(JNIEnv* env, @@ -461,6 +465,21 @@ delete this; } +void AutocompleteControllerAndroid::OnProfileWillBeDestroyed(Profile* profile) { + // In the UrlKeyedDataCollectionConsentHelper there is an assumption + // that the PrefChangeRegistrar outlives the PrefService. However, in + // the case where AutocompleteControllerAndroid owns the above consent + // helper through the AutocompleteProviderClient from the + // AutocompleteController, the Profile and ProfileKeyedService (PrefService) + // is destroyed before the Java profile notifies the + // AutocompleteControllerAndroid to destroy itself via + // AutocompleteControllerAndroid::Destroy. + JNIEnv* env = base::android::AttachCurrentThread(); + Java_AutocompleteController_notifyNativeDestroyed(env, java_controller_); + java_controller_.Reset(); + Destroy(env); +} + AutocompleteControllerAndroid::~AutocompleteControllerAndroid() = default; void AutocompleteControllerAndroid::OnResultChanged(
diff --git a/chrome/browser/android/omnibox/autocomplete_controller_android.h b/chrome/browser/android/omnibox/autocomplete_controller_android.h index 36ab308..d7f6072 100644 --- a/chrome/browser/android/omnibox/autocomplete_controller_android.h +++ b/chrome/browser/android/omnibox/autocomplete_controller_android.h
@@ -10,6 +10,8 @@ #include "base/android/jni_android.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" +#include "base/scoped_observation.h" +#include "chrome/browser/profiles/profile_observer.h" #include "components/omnibox/browser/autocomplete_controller.h" #include "components/omnibox/browser/autocomplete_input.h" @@ -18,7 +20,8 @@ class Profile; // The native part of the Java AutocompleteController class. -class AutocompleteControllerAndroid : public AutocompleteController::Observer { +class AutocompleteControllerAndroid : public AutocompleteController::Observer, + ProfileObserver { public: AutocompleteControllerAndroid( JNIEnv* env, @@ -100,6 +103,9 @@ void OnResultChanged(AutocompleteController* controller, bool default_match_changed) override; + // ProfileObserver overrides. + void OnProfileWillBeDestroyed(Profile* profile) override; + // Notifies the Java AutocompleteController that suggestions were received // based on the text the user typed in last. void NotifySuggestionsReceived( @@ -129,7 +135,7 @@ // Destruction of Profile triggers destruction of both // C++ AutocompleteControllerAndroid and Java AutocompleteController objects. // Guaranteed to be non-null. - const base::android::ScopedJavaGlobalRef<jobject> java_controller_; + base::android::ScopedJavaGlobalRef<jobject> java_controller_; // AutocompleteController associated with this client. As this is directly // associated with the |provider_client_| and indirectly with |profile_| @@ -139,6 +145,8 @@ // destroyed. std::unique_ptr<AutocompleteController> autocomplete_controller_; + base::ScopedObservation<Profile, ProfileObserver> profile_observation_{this}; + // Factory used to create asynchronously invoked callbacks. // Retained throughout the lifetime of the AutocompleteControllerAndroid. const base::WeakPtrFactory<AutocompleteControllerAndroid> weak_ptr_factory_{
diff --git a/chrome/browser/apps/link_capturing/link_capturing_features.cc b/chrome/browser/apps/link_capturing/link_capturing_features.cc index 3779a65..4360209a 100644 --- a/chrome/browser/apps/link_capturing/link_capturing_features.cc +++ b/chrome/browser/apps/link_capturing/link_capturing_features.cc
@@ -25,7 +25,7 @@ BASE_FEATURE(kAppToAppLinkCapturingWorkspaceApps, "AppToAppLinkCapturingWorkspaceApps", - base::FEATURE_ENABLED_BY_DEFAULT); + base::FEATURE_DISABLED_BY_DEFAULT); #endif bool ShouldShowLinkCapturingUX() {
diff --git a/chrome/browser/apps/platform_apps/extension_app_shim_manager_delegate_mac.cc b/chrome/browser/apps/platform_apps/extension_app_shim_manager_delegate_mac.cc index 9f8681c..9f57db2 100644 --- a/chrome/browser/apps/platform_apps/extension_app_shim_manager_delegate_mac.cc +++ b/chrome/browser/apps/platform_apps/extension_app_shim_manager_delegate_mac.cc
@@ -92,7 +92,7 @@ ExtensionRegistry* registry = ExtensionRegistry::Get(context); const Extension* extension = - registry->GetExtensionById(extension_id, ExtensionRegistry::ENABLED); + registry->enabled_extensions().GetByID(extension_id); return extension && (extension->is_platform_app() || extension->is_hosted_app()) ? extension
diff --git a/chrome/browser/ash/BUILD.gn b/chrome/browser/ash/BUILD.gn index 8574b31..fdc57c3 100644 --- a/chrome/browser/ash/BUILD.gn +++ b/chrome/browser/ash/BUILD.gn
@@ -1922,6 +1922,8 @@ "login/screens/osauth/cryptohome_recovery_screen.h", "login/screens/osauth/cryptohome_recovery_setup_screen.cc", "login/screens/osauth/cryptohome_recovery_setup_screen.h", + "login/screens/osauth/enter_old_password_screen.cc", + "login/screens/osauth/enter_old_password_screen.h", "login/screens/osauth/factor_setup_success_screen.cc", "login/screens/osauth/factor_setup_success_screen.h", "login/screens/osauth/gaia_password_changed_screen.cc", @@ -3376,6 +3378,8 @@ "system_web_apps/apps/personalization_app/personalization_app_wallpaper_provider_impl.h", "system_web_apps/apps/personalization_app/personalization_system_app_delegate.cc", "system_web_apps/apps/personalization_app/personalization_system_app_delegate.h", + "system_web_apps/apps/personalization_app/wallpaper_metrics_provider.cc", + "system_web_apps/apps/personalization_app/wallpaper_metrics_provider.h", "system_web_apps/apps/print_management_web_app_info.cc", "system_web_apps/apps/print_management_web_app_info.h", "system_web_apps/apps/projector_app/untrusted_projector_annotator_ui_config.cc", @@ -5068,7 +5072,6 @@ "app_list/chrome_app_list_item_manager_unittest.cc", "app_list/md_icon_normalizer_unittest.cc", "app_list/reorder/app_list_reorder_core_unittest.cc", - "app_list/reorder/app_list_reorder_util_unittest.cc", "app_list/search/app_discovery_metrics_manager_unittest.cc", "app_list/search/app_search_provider_test_base.cc", "app_list/search/app_search_provider_test_base.h",
diff --git a/chrome/browser/ash/accessibility/spoken_feedback_app_list_browsertest.cc b/chrome/browser/ash/accessibility/spoken_feedback_app_list_browsertest.cc index d30e58e..601c92c 100644 --- a/chrome/browser/ash/accessibility/spoken_feedback_app_list_browsertest.cc +++ b/chrome/browser/ash/accessibility/spoken_feedback_app_list_browsertest.cc
@@ -784,9 +784,6 @@ } IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListSearchTest, LauncherSearch) { - // Disable search notifier to simplify the test. - AppListTestApi().DisableSearchNotifier(true); - EnableChromeVox(); ShowAppList(); @@ -991,35 +988,6 @@ sm_.Replay(); } -IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListSearchTest, - SearchNotifierAnnouncement) { - EnableChromeVox(); - ShowAppList(); - - sm_.ExpectSpeechPattern("Search your *"); - sm_.ExpectSpeech("Edit text"); - - sm_.Call([this]() { - apps_provider_->set_best_match_count(2); - apps_provider_->set_count(3); - web_provider_->set_count(4); - SendKeyPress(ui::VKEY_G); - }); - - // Announce that there is a image search notifier. - sm_.ExpectSpeech("G"); - sm_.ExpectSpeech("Displaying 8 results for g"); - sm_.ExpectSpeech("Find your images by the content"); - sm_.ExpectSpeech("Press shift plus tab to learn more"); - - // Verify the notifier announcement on focus. - sm_.Call([this]() { SendKeyPressWithShift(ui::VKEY_TAB); }); - sm_.ExpectSpeech("Continue"); - sm_.ExpectSpeechPattern("Try searching *"); - - sm_.Replay(); -} - IN_PROC_BROWSER_TEST_P(SpokenFeedbackAppListSearchTest, SearchCategoryFilter) { EnableChromeVox(); ShowAppList(); @@ -1037,11 +1005,6 @@ sm_.ExpectSpeech("G"); sm_.ExpectSpeech("Displaying 8 results for g"); - // Move focus to the search notifier. - sm_.Call([this]() { SendKeyPressWithShift(ui::VKEY_TAB); }); - sm_.ExpectSpeech("Continue"); - sm_.ExpectSpeechPattern("Try searching *"); - // Move focus to the close button. sm_.Call([this]() { SendKeyPress(ui::VKEY_UP); }); sm_.ExpectSpeech("Clear searchbox text");
diff --git a/chrome/browser/ash/app_list/chrome_app_list_item.cc b/chrome/browser/ash/app_list/chrome_app_list_item.cc index ad25e655..a83bab0 100644 --- a/chrome/browser/ash/app_list/chrome_app_list_item.cc +++ b/chrome/browser/ash/app_list/chrome_app_list_item.cc
@@ -183,7 +183,8 @@ metadata_->icon_color = is_place_holder_icon ? ash::IconColor() - : app_list::reorder::GetSortableIconColorForApp(id(), icon); + : ash::AppIconColorCache::GetInstance().GetIconColorForApp(id(), + icon); metadata_->is_placeholder_icon = is_place_holder_icon; AppListModelUpdater* updater = model_updater();
diff --git a/chrome/browser/ash/app_list/reorder/app_list_reorder_util.cc b/chrome/browser/ash/app_list/reorder/app_list_reorder_util.cc index d358dcec..8d503666 100644 --- a/chrome/browser/ash/app_list/reorder/app_list_reorder_util.cc +++ b/chrome/browser/ash/app_list/reorder/app_list_reorder_util.cc
@@ -4,13 +4,10 @@ #include "chrome/browser/ash/app_list/reorder/app_list_reorder_util.h" -#include "ash/public/cpp/app_list/app_list_types.h" #include "ash/strings/grit/ash_strings.h" -#include "base/trace_event/trace_event.h" +#include "base/i18n/string_compare.h" +#include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/ash/app_icon_color_cache.h" -#include "third_party/skia/include/core/SkBitmap.h" -#include "third_party/skia/include/core/SkColorType.h" -#include "third_party/skia/include/core/SkScalar.h" #include "ui/base/l10n/l10n_util.h" namespace app_list { @@ -25,23 +22,7 @@ } // namespace -const float kOrderResetThreshold = 0.2f; - -// On the 360 degree hue color spectrum, this value is used as a cutuff to -// indicate that any value equal to or higher than this is considered red. -const float kRedHueCutoff = 315.0f; - -// An hsv color with saturation below this cutoff will be categorized as either -// black or white. -const float kBlackWhiteSaturationCutoff = 0.1f; - -// When an hsv color has a saturation below 'kBlackWhiteSaturationCutoff' then -// if its value is below this cutoff it will be categorized as white and with a -// value above this cutoff is will be categorized as black. -const float kBlackWhiteLowSaturatonValueCutoff = 0.9f; - -// An hsv color with a value less than this cutoff will be categorized as black. -const float kBlackValueCutoff = 0.35f; +constexpr float kOrderResetThreshold = 0.2f; // ReorderParam ---------------------------------------------------------------- @@ -185,191 +166,5 @@ *collator_, lhs.key_attribute.name, rhs.key_attribute.name); return result == UCOL_LESS; } - -// Color Sort Utilities ------------------------------------------------------- - -sync_pb::AppListSpecifics::ColorGroup CalculateBackgroundColorGroup( - const SkBitmap& source, - sync_pb::AppListSpecifics::ColorGroup light_vibrant_group) { - TRACE_EVENT0("ui", "app_list::reorder::CalculateBackgroundColorGroup"); - if (source.empty()) { - return sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_WHITE; - } - - DCHECK_EQ(kN32_SkColorType, source.info().colorType()); - - int width = source.width(); - int height = source.height(); - - sync_pb::AppListSpecifics::ColorGroup left_group = sync_pb::AppListSpecifics:: - ColorGroup::AppListSpecifics_ColorGroup_COLOR_BLACK; - sync_pb::AppListSpecifics::ColorGroup right_group = sync_pb:: - AppListSpecifics::ColorGroup::AppListSpecifics_ColorGroup_COLOR_BLACK; - - // Find the color group for the first opaque pixel on the left edge of the - // icon. - const SkColor* current = - reinterpret_cast<SkColor*>(source.getAddr32(0, height / 2)); - for (int x = 0; x < width; ++x, ++current) { - if (SkColorGetA(*current) < SK_AlphaOPAQUE) { - continue; - } else { - left_group = ColorToColorGroup(*current); - break; - } - } - - // Find the color group for the first opaque pixel on the right edge of the - // icon. - current = reinterpret_cast<SkColor*>(source.getAddr32(width - 1, height / 2)); - for (int x = width - 1; x >= 0; --x, --current) { - if (SkColorGetA(*current) < SK_AlphaOPAQUE) { - continue; - } else { - right_group = ColorToColorGroup(*current); - break; - } - } - - // If the left and right edge have the same color grouping, then return that - // group as the calculated background color group. - if (left_group == right_group) - return left_group; - - // Find the color group for the first opaque pixel on the top edge of the - // icon. - sync_pb::AppListSpecifics::ColorGroup top_group = sync_pb::AppListSpecifics:: - ColorGroup::AppListSpecifics_ColorGroup_COLOR_BLACK; - current = reinterpret_cast<SkColor*>(source.getAddr32(width / 2, 0)); - for (int y = 0; y < height; ++y, current += width) { - if (SkColorGetA(*current) < SK_AlphaOPAQUE) { - continue; - } else { - top_group = ColorToColorGroup(*current); - break; - } - } - - // If the top edge has a matching color group with the left or right group, - // then return that group. - if (top_group == right_group || top_group == left_group) - return top_group; - - // When all three sampled color groups are different, then there is no - // conclusive color group for the icon's background. Return the group - // corresponding to the app icon's light vibrant color. - return light_vibrant_group; -} - -sync_pb::AppListSpecifics::ColorGroup ColorToColorGroup(SkColor color) { - TRACE_EVENT0("ui", "app_list::reorder::ColorToColorGroup"); - SkScalar hsv[3]; - SkColorToHSV(color, hsv); - - const float h = hsv[0]; - const float s = hsv[1]; - const float v = hsv[2]; - - sync_pb::AppListSpecifics::ColorGroup group; - - // Assign the ColorGroup based on the hue of `color`. Each if statement checks - // the value of the hue and groups the color based on it. These values are - // approximations for grouping like colors together. - if (h < 15) { - group = sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_RED; - } else if (h < 45) { - group = sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_ORANGE; - } else if (h < 75) { - group = sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_YELLOW; - } else if (h < 182) { - group = sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_GREEN; - } else if (h < 255) { - group = sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_BLUE; - } else if (h < kRedHueCutoff) { - group = sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_MAGENTA; - } else { - group = sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_RED; - } - - if (s < kBlackWhiteSaturationCutoff) { - if (v < kBlackWhiteLowSaturatonValueCutoff) { - group = sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_BLACK; - } else { - group = sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_WHITE; - } - } else if (v < kBlackValueCutoff) { - group = sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_BLACK; - } - - return group; -} - -ash::IconColor GetSortableIconColorForApp(const std::string& id, - const gfx::ImageSkia& image) { - TRACE_EVENT0("ui", "app_list::reorder::GetSortableIconColorForApp"); - SkColor extracted_light_vibrant_color = - ash::AppIconColorCache::GetInstance().GetLightVibrantColorForApp(id, - image); - - sync_pb::AppListSpecifics::ColorGroup light_vibrant_color_group = - ColorToColorGroup(extracted_light_vibrant_color); - - ash::IconColor sortable_icon_color; - sync_pb::AppListSpecifics::ColorGroup background_color_group = - CalculateBackgroundColorGroup(*image.bitmap(), light_vibrant_color_group); - - // `hue` represents the hue of the extracted light vibrant color and can be - // defined by the interval [-1, 360], where -1 (kHueMin) denotes that the hue - // should come before all other hue values, and 360 (kHueMax) denotes that the - // hue should come after all other hue values. - int hue; - - if (light_vibrant_color_group == - sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_BLACK) { - // If `light_vibrant_color_group` is black it should be ordered after all - // other hues. - hue = ash::IconColor::kHueMax; - } else if (light_vibrant_color_group == - sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_WHITE) { - // If 'light_vibrant_color_group' is white, then the hue should be ordered - // before all other hues. - hue = ash::IconColor::kHueMin; - - } else { - SkScalar hsv[3]; - SkColorToHSV(extracted_light_vibrant_color, hsv); - hue = hsv[0]; - - // If the hue is a red on the high end of the hsv color spectrum, then - // subtract the maximum possible hue so that reds on the high end of the hsv - // color spectrum are ordered next to reds on the low end of the hsv color - // spectrum. - if (hue >= kRedHueCutoff) - hue -= ash::IconColor::kHueMax; - - // Shift up the hue value so that the returned hue value always remains - // within the interval [0, 360]. - hue += (ash::IconColor::kHueMax - kRedHueCutoff); - - DCHECK_GE(hue, 0); - DCHECK_LE(hue, ash::IconColor::kHueMax); - } - - return ash::IconColor(background_color_group, hue); -} - } // namespace reorder } // namespace app_list
diff --git a/chrome/browser/ash/app_list/reorder/app_list_reorder_util.h b/chrome/browser/ash/app_list/reorder/app_list_reorder_util.h index b3e61f45..ec5810a 100644 --- a/chrome/browser/ash/app_list/reorder/app_list_reorder_util.h +++ b/chrome/browser/ash/app_list/reorder/app_list_reorder_util.h
@@ -9,16 +9,11 @@ #include <vector> #include "ash/public/cpp/app_list/app_list_types.h" -#include "base/i18n/string_compare.h" #include "base/memory/raw_ptr.h" -#include "base/strings/utf_string_conversions.h" #include "chrome/browser/ash/app_list/app_list_syncable_service.h" #include "chrome/browser/ash/app_list/chrome_app_list_item.h" #include "components/sync/model/string_ordinal.h" #include "third_party/icu/source/i18n/unicode/coll.h" -#include "third_party/skia/include/core/SkColor.h" - -class SkBitmap; namespace app_list { namespace reorder { @@ -160,26 +155,6 @@ SyncItemWrapper<EphemeralAwareName>::SyncItemWrapper( const ash::AppListItemMetadata& metadata); -// Color sorting utility methods ----------------------------------------------- - -// Used to calculate the color grouping of the icon image's background. -// Samples color from the left, right, and top edge of the icon image and -// determines the color group for each. Returns the most common grouping from -// the samples. If all three sampled groups are different, then returns -// 'light_vibrant_group' which is the color group for the light vibrant color of -// the whole icon image. -sync_pb::AppListSpecifics::ColorGroup CalculateBackgroundColorGroup( - const SkBitmap& source, - sync_pb::AppListSpecifics::ColorGroup light_vibrant_group); - -// Categorize `color` into one of the ColorGroups. -sync_pb::AppListSpecifics::ColorGroup ColorToColorGroup(SkColor color); - -// Returns a SortableIconColor which can be used to sort icons based on a -// combination of their background color and their light vibrant color. -ash::IconColor GetSortableIconColorForApp(const std::string& id, - const gfx::ImageSkia& image); - } // namespace reorder } // namespace app_list
diff --git a/chrome/browser/ash/app_list/reorder/app_list_reorder_util_unittest.cc b/chrome/browser/ash/app_list/reorder/app_list_reorder_util_unittest.cc deleted file mode 100644 index f7534e2..0000000 --- a/chrome/browser/ash/app_list/reorder/app_list_reorder_util_unittest.cc +++ /dev/null
@@ -1,89 +0,0 @@ -// Copyright 2021 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ash/app_list/reorder/app_list_reorder_util.h" - -#include "testing/gtest/include/gtest/gtest.h" -#include "third_party/skia/include/core/SkBitmap.h" -#include "ui/gfx/image/image_skia.h" - -using AppListReorderUtilTest = testing::Test; - -namespace app_list { - -gfx::ImageSkia GetRedIconWithBackgroundColorOf(SkColor color) { - const int width = 64; - const int height = 64; - - SkBitmap icon; - icon.allocN32Pixels(width, height); - icon.eraseColor(color); - - icon.erase(gfx::kGoogleRed300, - {width / 4, height / 4, width / 2, height / 2}); - - return gfx::ImageSkia::CreateFrom1xBitmap(icon); -} - -TEST_F(AppListReorderUtilTest, SortableIconColorTest) { - const int red_hue = 49; - - // Test a red icon with a black background color. - ash::IconColor group = reorder::GetSortableIconColorForApp( - "test_app1", GetRedIconWithBackgroundColorOf(SK_ColorBLACK)); - EXPECT_EQ(group.background_color(), - sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_BLACK); - EXPECT_EQ(group.hue(), red_hue); - - // Test a red icon with a white background color. - group = reorder::GetSortableIconColorForApp( - "test_app2", GetRedIconWithBackgroundColorOf(SK_ColorWHITE)); - EXPECT_EQ(group.background_color(), - sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_WHITE); - EXPECT_EQ(group.hue(), red_hue); - - // Test a red icon with a red background color. - group = reorder::GetSortableIconColorForApp( - "test_app3", GetRedIconWithBackgroundColorOf(SK_ColorRED)); - EXPECT_EQ(group.background_color(), - sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_RED); - EXPECT_EQ(group.hue(), red_hue); - - // Test a red icon with a yellow background color. - group = reorder::GetSortableIconColorForApp( - "test_app4", GetRedIconWithBackgroundColorOf(SK_ColorYELLOW)); - EXPECT_EQ(group.background_color(), - sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_YELLOW); - EXPECT_EQ(group.hue(), red_hue); - - // Test a red icon with a green background color. - group = reorder::GetSortableIconColorForApp( - "test_app5", GetRedIconWithBackgroundColorOf(SK_ColorGREEN)); - EXPECT_EQ(group.background_color(), - sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_GREEN); - EXPECT_EQ(group.hue(), red_hue); - - // Test a red icon with a blue background color. - group = reorder::GetSortableIconColorForApp( - "test_app6", GetRedIconWithBackgroundColorOf(SK_ColorBLUE)); - EXPECT_EQ(group.background_color(), - sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_BLUE); - EXPECT_EQ(group.hue(), red_hue); - - // Test a red icon with a magenta background color. - group = reorder::GetSortableIconColorForApp( - "test_app7", GetRedIconWithBackgroundColorOf(SK_ColorMAGENTA)); - EXPECT_EQ(group.background_color(), - sync_pb::AppListSpecifics::ColorGroup:: - AppListSpecifics_ColorGroup_COLOR_MAGENTA); - EXPECT_EQ(group.hue(), red_hue); -} - -} // namespace app_list
diff --git a/chrome/browser/ash/app_restore/arc_ghost_window_shell_surface.cc b/chrome/browser/ash/app_restore/arc_ghost_window_shell_surface.cc index cff17574..99a26e6 100644 --- a/chrome/browser/ash/app_restore/arc_ghost_window_shell_surface.cc +++ b/chrome/browser/ash/app_restore/arc_ghost_window_shell_surface.cc
@@ -142,7 +142,7 @@ : 0; gfx::RoundedCornersF window_radii(window_corner_radius); - shell_surface->SetWindowCornerRadii(window_radii); + shell_surface->SetWindowCornersRadii(window_radii); // Ghost surface shadow radii must match the window radii. shell_surface->SetShadowCornersRadii(window_radii);
diff --git a/chrome/browser/ash/arc/input_overlay/ui/action_type_button_group.cc b/chrome/browser/ash/arc/input_overlay/ui/action_type_button_group.cc index 12b03d5..d7ab038 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/action_type_button_group.cc +++ b/chrome/browser/ash/arc/input_overlay/ui/action_type_button_group.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ash/arc/input_overlay/ui/action_type_button_group.h" +#include <utility> + #include "base/notreached.h" #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/ash/arc/input_overlay/actions/action.h" @@ -67,8 +69,8 @@ ActionTypeButton::PressedCallback callback, const std::u16string& label, const gfx::VectorIcon& icon) { - auto* button = - AddChildView(std::make_unique<ActionTypeButton>(callback, label, icon)); + auto* button = AddChildView( + std::make_unique<ActionTypeButton>(std::move(callback), label, icon)); button->set_delegate(this); buttons_.push_back(button); return button; @@ -77,7 +79,7 @@ ActionTypeButton* ActionTypeButtonGroup::AddButton( ActionTypeButton::PressedCallback callback, const std::u16string& label) { - return AddActionTypeButton(callback, label, kGlobeIcon); + return AddActionTypeButton(std::move(callback), label, kGlobeIcon); } void ActionTypeButtonGroup::OnButtonSelected(ash::OptionButtonBase* button) {
diff --git a/chrome/browser/ash/arc/input_overlay/ui/edit_finish_view.cc b/chrome/browser/ash/arc/input_overlay/ui/edit_finish_view.cc index 389496f..2f268e9 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/edit_finish_view.cc +++ b/chrome/browser/ash/arc/input_overlay/ui/edit_finish_view.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ash/arc/input_overlay/ui/edit_finish_view.h" +#include <utility> + #include "ash/app_list/app_list_util.h" #include "ash/style/style_util.h" #include "base/functional/bind.h" @@ -104,7 +106,8 @@ OnMousePressedCallback on_mouse_pressed_callback, OnMouseDraggedCallback on_mouse_dragged_callback, OnMouseReleasedCallback on_mouse_released_callback) - : LabelButton(callback, l10n_util::GetStringUTF16(text_source_id)), + : LabelButton(std::move(callback), + l10n_util::GetStringUTF16(text_source_id)), on_mouse_pressed_callback_(on_mouse_pressed_callback), on_mouse_dragged_callback_(on_mouse_dragged_callback), on_mouse_released_callback_(on_mouse_released_callback) {
diff --git a/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.cc b/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.cc index bc25d3bf..c5ed1b76 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.cc +++ b/chrome/browser/ash/arc/input_overlay/ui/input_menu_view.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ash/arc/input_overlay/ui/input_menu_view.h" +#include <utility> + #include "ash/components/arc/compat_mode/style/arc_color_provider.h" #include "ash/login/ui/views_utils.h" #include "ash/public/cpp/new_window_delegate.h" @@ -124,7 +126,7 @@ public: explicit FeedbackButton(PressedCallback callback = PressedCallback(), const std::u16string& text = std::u16string()) - : LabelButton(callback, text) { + : LabelButton(std::move(callback), text) { SetAccessibleName( l10n_util::GetStringUTF16(IDS_INPUT_OVERLAY_MENU_SEND_FEEDBACK)); SetBorder(views::CreateEmptyBorder(
diff --git a/chrome/browser/ash/arc/input_overlay/ui/menu_entry_view.cc b/chrome/browser/ash/arc/input_overlay/ui/menu_entry_view.cc index 2e232006..80890f36 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/menu_entry_view.cc +++ b/chrome/browser/ash/arc/input_overlay/ui/menu_entry_view.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ash/arc/input_overlay/ui/menu_entry_view.h" #include <algorithm> +#include <utility> #include "ash/app_list/app_list_util.h" #include "ash/style/style_util.h" @@ -60,9 +61,10 @@ DisplayOverlayController* display_overlay_controller) { auto* menu_entry = display_overlay_controller->GetOverlayWidgetContentsView()->AddChildView( - std::make_unique<MenuEntryView>(pressed_callback, - on_position_changed_callback, - display_overlay_controller)); + std::make_unique<MenuEntryView>( + std::move(pressed_callback), + std::move(on_position_changed_callback), + display_overlay_controller)); menu_entry->Init(); return menu_entry; }
diff --git a/chrome/browser/ash/arc/input_overlay/ui/target_view.cc b/chrome/browser/ash/arc/input_overlay/ui/target_view.cc index 2d74663..0484360 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/target_view.cc +++ b/chrome/browser/ash/arc/input_overlay/ui/target_view.cc
@@ -125,11 +125,20 @@ SchedulePaint(); } +void TargetView::MoveCursorToViewCenter() { + auto* widget = GetWidget(); + DCHECK(widget); + auto* window = widget->GetNativeWindow(); + DCHECK(window); + window->MoveCursorTo(bounds().CenterPoint()); +} + void TargetView::VisibilityChanged(views::View* starting_from, bool is_visible) { if (is_visible) { UpdateWidgetBounds(); RequestFocus(); + MoveCursorToViewCenter(); } }
diff --git a/chrome/browser/ash/arc/input_overlay/ui/target_view.h b/chrome/browser/ash/arc/input_overlay/ui/target_view.h index e572ee89..77e39bf3 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/target_view.h +++ b/chrome/browser/ash/arc/input_overlay/ui/target_view.h
@@ -43,6 +43,9 @@ // Called when `center_` is updated. void OnCenterChanged(); + // Sets cursor intial position when this view shows up. + void MoveCursorToViewCenter(); + // views::View: void VisibilityChanged(views::View* starting_from, bool is_visible) override; void OnGestureEvent(ui::GestureEvent* event) override;
diff --git a/chrome/browser/ash/arc/input_overlay/ui/target_view_unittest.cc b/chrome/browser/ash/arc/input_overlay/ui/target_view_unittest.cc index d8c23d3..f329a8ba 100644 --- a/chrome/browser/ash/arc/input_overlay/ui/target_view_unittest.cc +++ b/chrome/browser/ash/arc/input_overlay/ui/target_view_unittest.cc
@@ -72,6 +72,14 @@ } }; +TEST_F(TargetViewTest, TestInitialCursorLocation) { + PressAddButton(); + auto* target_view = GetTargetView(); + EXPECT_TRUE(target_view); + EXPECT_EQ(target_view->GetBoundsInScreen().CenterPoint(), + aura::Env::GetInstance()->last_mouse_location()); +} + TEST_F(TargetViewTest, TestMouseSupport) { // Enter into the button placement mode and check mouse hover move and click. PressAddButton();
diff --git a/chrome/browser/ash/crosapi/BUILD.gn b/chrome/browser/ash/crosapi/BUILD.gn index 7b4d9ba1..44a84643 100644 --- a/chrome/browser/ash/crosapi/BUILD.gn +++ b/chrome/browser/ash/crosapi/BUILD.gn
@@ -154,8 +154,6 @@ "idle_service_ash.h", "image_writer_ash.cc", "image_writer_ash.h", - "in_session_auth_ash.cc", - "in_session_auth_ash.h", "kerberos_in_browser_ash.cc", "kerberos_in_browser_ash.h", "keystore_service_ash.cc", @@ -340,6 +338,7 @@ "//chromeos/components/cdm_factory_daemon:cdm_factory_daemon_browser", "//chromeos/components/certificate_provider:certificate_provider", "//chromeos/components/firewall_hole", + "//chromeos/components/in_session_auth", "//chromeos/components/kiosk", "//chromeos/components/mgs", "//chromeos/components/quick_answers/public/cpp:prefs",
diff --git a/chrome/browser/ash/crosapi/crosapi_ash.cc b/chrome/browser/ash/crosapi/crosapi_ash.cc index 484839e0..e56bb83 100644 --- a/chrome/browser/ash/crosapi/crosapi_ash.cc +++ b/chrome/browser/ash/crosapi/crosapi_ash.cc
@@ -66,7 +66,6 @@ #include "chrome/browser/ash/crosapi/identity_manager_ash.h" #include "chrome/browser/ash/crosapi/idle_service_ash.h" #include "chrome/browser/ash/crosapi/image_writer_ash.h" -#include "chrome/browser/ash/crosapi/in_session_auth_ash.h" #include "chrome/browser/ash/crosapi/kerberos_in_browser_ash.h" #include "chrome/browser/ash/crosapi/keystore_service_ash.h" #include "chrome/browser/ash/crosapi/kiosk_session_service_ash.h" @@ -110,6 +109,7 @@ #include "chrome/browser/ash/crosapi/web_kiosk_service_ash.h" #include "chrome/browser/ash/crosapi/web_page_info_ash.h" #include "chrome/browser/ash/input_method/editor_mediator_factory.h" +#include "chrome/browser/ash/login/quick_unlock/quick_unlock_factory.h" #include "chrome/browser/ash/passkeys/passkey_authenticator_service_ash.h" #include "chrome/browser/ash/passkeys/passkey_authenticator_service_factory_ash.h" #include "chrome/browser/ash/profiles/profile_helper.h" @@ -134,6 +134,8 @@ #include "chromeos/ash/components/account_manager/account_manager_factory.h" #include "chromeos/ash/components/browser_context_helper/browser_context_helper.h" #include "chromeos/components/cdm_factory_daemon/cdm_factory_daemon_proxy_ash.h" +#include "chromeos/components/in_session_auth/in_process_instances.h" +#include "chromeos/components/in_session_auth/in_session_auth.h" #include "chromeos/components/sensors/ash/sensor_hal_dispatcher.h" #include "chromeos/crosapi/mojom/device_local_account_extension_service.mojom.h" #include "chromeos/crosapi/mojom/drive_integration_service.mojom.h" @@ -253,7 +255,6 @@ identity_manager_ash_(std::make_unique<IdentityManagerAsh>()), idle_service_ash_(std::make_unique<IdleServiceAsh>()), image_writer_ash_(std::make_unique<ImageWriterAsh>()), - in_session_auth_ash_(std::make_unique<InSessionAuthAsh>()), kerberos_in_browser_ash_(std::make_unique<KerberosInBrowserAsh>()), keystore_service_ash_(std::make_unique<KeystoreServiceAsh>()), kiosk_session_service_ash_(std::make_unique<KioskSessionServiceAsh>()), @@ -657,7 +658,7 @@ void CrosapiAsh::BindInSessionAuth( mojo::PendingReceiver<chromeos::auth::mojom::InSessionAuth> receiver) { - in_session_auth_ash_->BindReceiver(std::move(receiver)); + chromeos::auth::BindToInSessionAuthService(std::move(receiver)); } void CrosapiAsh::BindKerberosInBrowser(
diff --git a/chrome/browser/ash/crosapi/crosapi_ash.h b/chrome/browser/ash/crosapi/crosapi_ash.h index 6c0936e..e6d260f4 100644 --- a/chrome/browser/ash/crosapi/crosapi_ash.h +++ b/chrome/browser/ash/crosapi/crosapi_ash.h
@@ -36,6 +36,10 @@ class TelemetryDiagnosticsRoutineServiceAsh; class TelemetryEventServiceAsh; class VideoConferenceManagerAsh; + +namespace auth { +class InSessionAuth; +} // namespace auth } // namespace ash namespace crosapi { @@ -82,7 +86,6 @@ class IdentityManagerAsh; class IdleServiceAsh; class ImageWriterAsh; -class InSessionAuthAsh; class KerberosInBrowserAsh; class KeystoreServiceAsh; class KioskSessionServiceAsh; @@ -634,7 +637,6 @@ std::unique_ptr<IdentityManagerAsh> identity_manager_ash_; std::unique_ptr<IdleServiceAsh> idle_service_ash_; std::unique_ptr<ImageWriterAsh> image_writer_ash_; - std::unique_ptr<InSessionAuthAsh> in_session_auth_ash_; std::unique_ptr<KerberosInBrowserAsh> kerberos_in_browser_ash_; std::unique_ptr<KeystoreServiceAsh> keystore_service_ash_; std::unique_ptr<KioskSessionServiceAsh> kiosk_session_service_ash_;
diff --git a/chrome/browser/ash/crosapi/desk_profiles_ash.cc b/chrome/browser/ash/crosapi/desk_profiles_ash.cc index 6182323..a898940 100644 --- a/chrome/browser/ash/crosapi/desk_profiles_ash.cc +++ b/chrome/browser/ash/crosapi/desk_profiles_ash.cc
@@ -11,6 +11,7 @@ #include "ash/shell.h" #include "base/containers/cxx20_erase_vector.h" #include "base/ranges/algorithm.h" +#include "google_apis/gaia/gaia_auth_util.h" namespace crosapi { namespace { @@ -51,7 +52,9 @@ for (auto& prof : profiles) { ash::LacrosProfileSummary summary = ConvertProfileSummary(std::move(prof)); - if (!primary_user_email.empty() && primary_user_email == summary.email) { + + if (!primary_user_email.empty() && + gaia::AreEmailsSame(primary_user_email, summary.email)) { primary_user_profile_id_ = summary.profile_id; }
diff --git a/chrome/browser/ash/crosapi/document_scan_ash.cc b/chrome/browser/ash/crosapi/document_scan_ash.cc index 65cc4bd..86a0688 100644 --- a/chrome/browser/ash/crosapi/document_scan_ash.cc +++ b/chrome/browser/ash/crosapi/document_scan_ash.cc
@@ -112,6 +112,36 @@ mojom::GetScannerListResponse::From(response_in.value())); } +void OpenScannerAdapter( + const std::string& scanner_id, + DocumentScanAsh::OpenScannerCallback callback, + const absl::optional<lorgnette::OpenScannerResponse>& response_in) { + if (!response_in) { + auto response_out = mojom::OpenScannerResponse::New(); + response_out->scanner_id = scanner_id; + response_out->result = mojom::ScannerOperationResult::kInternalError; + std::move(callback).Run(std::move(response_out)); + return; + } + std::move(callback).Run( + mojom::OpenScannerResponse::From(response_in.value())); +} + +void CloseScannerAdapter( + const std::string& scanner_handle, + DocumentScanAsh::CloseScannerCallback callback, + const absl::optional<lorgnette::CloseScannerResponse>& response_in) { + if (!response_in) { + auto response_out = mojom::CloseScannerResponse::New(); + response_out->scanner_handle = scanner_handle; + response_out->result = mojom::ScannerOperationResult::kInternalError; + std::move(callback).Run(std::move(response_out)); + return; + } + std::move(callback).Run( + mojom::CloseScannerResponse::From(response_in.value())); +} + } // namespace DocumentScanAsh::DocumentScanAsh() = default; @@ -166,4 +196,42 @@ base::BindOnce(&GetScannerListAdapter, std::move(callback))); } +void DocumentScanAsh::OpenScanner(const std::string& client_id, + const std::string& scanner_id, + OpenScannerCallback callback) { + if (!ash::features::IsAdvancedDocumentScanAPIEnabled()) { + auto response = crosapi::mojom::OpenScannerResponse::New(); + response->scanner_id = scanner_id; + response->result = crosapi::mojom::ScannerOperationResult::kUnsupported; + std::move(callback).Run(std::move(response)); + return; + } + + lorgnette::OpenScannerRequest request; + request.mutable_scanner_id()->set_connection_string(scanner_id); + request.set_client_id(client_id); + ash::LorgnetteScannerManagerFactory::GetForBrowserContext(GetProfile()) + ->OpenScanner( + std::move(request), + base::BindOnce(&OpenScannerAdapter, scanner_id, std::move(callback))); +} + +void DocumentScanAsh::CloseScanner(const std::string& scanner_handle, + CloseScannerCallback callback) { + if (!ash::features::IsAdvancedDocumentScanAPIEnabled()) { + auto response = crosapi::mojom::CloseScannerResponse::New(); + response->scanner_handle = scanner_handle; + response->result = crosapi::mojom::ScannerOperationResult::kUnsupported; + std::move(callback).Run(std::move(response)); + return; + } + + lorgnette::CloseScannerRequest request; + request.mutable_scanner()->set_token(scanner_handle); + ash::LorgnetteScannerManagerFactory::GetForBrowserContext(GetProfile()) + ->CloseScanner(std::move(request), + base::BindOnce(&CloseScannerAdapter, scanner_handle, + std::move(callback))); +} + } // namespace crosapi
diff --git a/chrome/browser/ash/crosapi/document_scan_ash.h b/chrome/browser/ash/crosapi/document_scan_ash.h index 7e9c2e3..300092a 100644 --- a/chrome/browser/ash/crosapi/document_scan_ash.h +++ b/chrome/browser/ash/crosapi/document_scan_ash.h
@@ -28,6 +28,11 @@ void GetScannerList(const std::string& client_id, mojom::ScannerEnumFilterPtr filter, GetScannerListCallback callback) override; + void OpenScanner(const std::string& client_id, + const std::string& scanner_id, + OpenScannerCallback callback) override; + void CloseScanner(const std::string& scanner_handle, + CloseScannerCallback callback) override; private: // This class supports any number of connections. This allows the client to
diff --git a/chrome/browser/ash/crosapi/document_scan_ash_type_converters.cc b/chrome/browser/ash/crosapi/document_scan_ash_type_converters.cc index 0c20a39..69cc561 100644 --- a/chrome/browser/ash/crosapi/document_scan_ash_type_converters.cc +++ b/chrome/browser/ash/crosapi/document_scan_ash_type_converters.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ash/crosapi/document_scan_ash_type_converters.h" +#include <cstdint> + #include "base/notreached.h" #include "base/strings/strcat.h" @@ -52,6 +54,305 @@ } }; +template <> +struct TypeConverter<crosapi::mojom::OptionType, lorgnette::OptionType> { + static crosapi::mojom::OptionType Convert(lorgnette::OptionType input) { + switch (input) { + default: + // Default case included to cover protobuf sentinel values. + NOTREACHED(); + [[fallthrough]]; + case lorgnette::TYPE_UNKNOWN: + return crosapi::mojom::OptionType::kUnknown; + case lorgnette::TYPE_BOOL: + return crosapi::mojom::OptionType::kBool; + case lorgnette::TYPE_INT: + return crosapi::mojom::OptionType::kInt; + case lorgnette::TYPE_FIXED: + return crosapi::mojom::OptionType::kFixed; + case lorgnette::TYPE_STRING: + return crosapi::mojom::OptionType::kString; + case lorgnette::TYPE_BUTTON: + return crosapi::mojom::OptionType::kButton; + case lorgnette::TYPE_GROUP: + return crosapi::mojom::OptionType::kGroup; + } + } +}; +crosapi::mojom::OptionType ConvertForTesting(lorgnette::OptionType input) { + return ConvertTo<crosapi::mojom::OptionType>(input); +} + +template <> +struct TypeConverter<crosapi::mojom::OptionUnit, lorgnette::OptionUnit> { + static crosapi::mojom::OptionUnit Convert(lorgnette::OptionUnit input) { + switch (input) { + default: + // Default case included to cover protobuf sentinel values. + NOTREACHED(); + [[fallthrough]]; + case lorgnette::UNIT_NONE: + return crosapi::mojom::OptionUnit::kUnitless; + case lorgnette::UNIT_PIXEL: + return crosapi::mojom::OptionUnit::kPixel; + case lorgnette::UNIT_BIT: + return crosapi::mojom::OptionUnit::kBit; + case lorgnette::UNIT_MM: + return crosapi::mojom::OptionUnit::kMm; + case lorgnette::UNIT_DPI: + return crosapi::mojom::OptionUnit::kDpi; + case lorgnette::UNIT_PERCENT: + return crosapi::mojom::OptionUnit::kPercent; + case lorgnette::UNIT_MICROSECOND: + return crosapi::mojom::OptionUnit::kMicrosecond; + } + } +}; +crosapi::mojom::OptionUnit ConvertForTesting(lorgnette::OptionUnit input) { + return ConvertTo<crosapi::mojom::OptionUnit>(input); +} + +template <> +struct TypeConverter<crosapi::mojom::OptionConstraintType, + lorgnette::OptionConstraint_ConstraintType> { + static crosapi::mojom::OptionConstraintType Convert( + lorgnette::OptionConstraint_ConstraintType input) { + switch (input) { + default: + // Default case included to cover protobuf sentinel values. + NOTREACHED(); + [[fallthrough]]; + case lorgnette::OptionConstraint::CONSTRAINT_NONE: + return crosapi::mojom::OptionConstraintType::kNone; + case lorgnette::OptionConstraint::CONSTRAINT_INT_RANGE: + return crosapi::mojom::OptionConstraintType::kIntRange; + case lorgnette::OptionConstraint::CONSTRAINT_FIXED_RANGE: + return crosapi::mojom::OptionConstraintType::kFixedRange; + case lorgnette::OptionConstraint::CONSTRAINT_INT_LIST: + return crosapi::mojom::OptionConstraintType::kIntList; + case lorgnette::OptionConstraint::CONSTRAINT_FIXED_LIST: + return crosapi::mojom::OptionConstraintType::kFixedList; + case lorgnette::OptionConstraint::CONSTRAINT_STRING_LIST: + return crosapi::mojom::OptionConstraintType::kStringList; + } + } +}; +crosapi::mojom::OptionConstraintType ConvertForTesting( // IN-TEST + lorgnette::OptionConstraint_ConstraintType input) { + return ConvertTo<crosapi::mojom::OptionConstraintType>(input); +} + +template <> +struct TypeConverter<crosapi::mojom::IntRangePtr, + lorgnette::OptionConstraint_IntRange> { + static crosapi::mojom::IntRangePtr Convert( + const lorgnette::OptionConstraint_IntRange& input) { + auto output = crosapi::mojom::IntRange::New(); + output->min = input.min(); + output->max = input.max(); + output->quant = input.quant(); + return output; + } +}; + +template <> +struct TypeConverter<crosapi::mojom::FixedRangePtr, + lorgnette::OptionConstraint_FixedRange> { + static crosapi::mojom::FixedRangePtr Convert( + const lorgnette::OptionConstraint_FixedRange& input) { + auto output = crosapi::mojom::FixedRange::New(); + output->min = input.min(); + output->max = input.max(); + output->quant = input.quant(); + return output; + } +}; + +template <> +struct TypeConverter<crosapi::mojom::OptionConstraintPtr, + lorgnette::OptionConstraint> { + static crosapi::mojom::OptionConstraintPtr Convert( + const lorgnette::OptionConstraint& input) { + auto output = crosapi::mojom::OptionConstraint::New(); + output->type = ConvertTo<crosapi::mojom::OptionConstraintType>( + input.constraint_type()); + // In the protobuf, constraints are represented as several different fields. + // In mojom, these are mapped to one union for a closer match to the JS API + // that consumes this. + // + // If the protobuf does not have the correct value field set to match its + // declared type, this will create an output with the same type and an empty + // constraint. The empty constraint will always fail to match any value, + // but will be semantically correct. + switch (output->type) { + case crosapi::mojom::OptionConstraintType::kNone: + // No constraint value. + break; + case crosapi::mojom::OptionConstraintType::kIntRange: + if (!input.has_int_range()) { + LOG(WARNING) << "OptionConstraint has type INT_RANGE but does not " + "contain a valid int_range"; + } + output->restriction = + crosapi::mojom::OptionConstraintRestriction::NewIntRange( + crosapi::mojom::IntRange::From(input.int_range())); + break; + case crosapi::mojom::OptionConstraintType::kIntList: + if (input.valid_int().empty()) { + LOG(WARNING) << "OptionConstraint has type INT_LIST but does not " + "contain a valid valid_int"; + } + output->restriction = + crosapi::mojom::OptionConstraintRestriction::NewValidInt( + std::vector<int32_t>{input.valid_int().begin(), + input.valid_int().end()}); + break; + case crosapi::mojom::OptionConstraintType::kFixedRange: + if (!input.has_fixed_range()) { + LOG(WARNING) << "OptionConstraint has type FIXED_RANGE but does not " + "contain a valid fixed_range"; + } + output->restriction = + crosapi::mojom::OptionConstraintRestriction::NewFixedRange( + crosapi::mojom::FixedRange::From(input.fixed_range())); + break; + case crosapi::mojom::OptionConstraintType::kFixedList: + if (input.valid_fixed().empty()) { + LOG(WARNING) << "OptionConstraint has type FIXED_LIST but does not " + "contain a valid valid_fixed"; + } + output->restriction = + crosapi::mojom::OptionConstraintRestriction::NewValidFixed( + std::vector<double>{input.valid_fixed().begin(), + input.valid_fixed().end()}); + break; + case crosapi::mojom::OptionConstraintType::kStringList: + if (input.valid_string().empty()) { + LOG(WARNING) << "OptionConstraint has type STRING_LIST but does not " + "contain a valid valid_string"; + } + output->restriction = + crosapi::mojom::OptionConstraintRestriction::NewValidString( + std::vector<std::string>{input.valid_string().begin(), + input.valid_string().end()}); + break; + } + return output; + } +}; +crosapi::mojom::OptionConstraintPtr ConvertForTesting( // IN-TEST + const lorgnette::OptionConstraint& input) { + return crosapi::mojom::OptionConstraint::From(input); +} + +template <> +struct TypeConverter<crosapi::mojom::ScannerOptionPtr, + lorgnette::ScannerOption> { + static crosapi::mojom::ScannerOptionPtr Convert( + const lorgnette::ScannerOption& input) { + auto output = crosapi::mojom::ScannerOption::New(); + output->name = input.name(); + output->title = input.title(); + output->description = input.description(); + output->type = ConvertTo<crosapi::mojom::OptionType>(input.option_type()); + output->unit = ConvertTo<crosapi::mojom::OptionUnit>(input.unit()); + + // The value of an option in lorgnette is represented as several separate + // fields. These map into a single union for mojom to better match the IDL + // definition on the JS side. + // + // An unset value field is explicitly allowed in the protobuf and + // means that the option does not currently have a valid value. If the + // wrong value field is set in the protobuf (i.e., some field that doesn't + // match the claimed type), this is treated the same as an unset value. + // + // INT and FIXED values are special because they can contain more than one + // value. These are mapped to separate fields to match the JS API, but are + // handled the same way in protobuf. For these two cases, a single-element + // array is mapped to the _value field and multiple-element arrays are + // mapped to the _list field. + switch (output->type) { + case crosapi::mojom::OptionType::kUnknown: + case crosapi::mojom::OptionType::kButton: + case crosapi::mojom::OptionType::kGroup: + // No value for these. + break; + case crosapi::mojom::OptionType::kBool: + if (input.has_bool_value()) { + output->value = + crosapi::mojom::OptionValue::NewBoolValue(input.bool_value()); + } + break; + case crosapi::mojom::OptionType::kInt: + if (!input.has_int_value()) { + // Unset value. Do nothing. + } else if (input.int_value().value_size() == 1) { + // Single value. + output->value = crosapi::mojom::OptionValue::NewIntValue( + input.int_value().value(0)); + } else { + // Multiple values. + output->value = crosapi::mojom::OptionValue::NewIntList( + std::vector<int32_t>{input.int_value().value().begin(), + input.int_value().value().end()}); + } + break; + case crosapi::mojom::OptionType::kFixed: + if (!input.has_fixed_value()) { + // Unset value. Do nothing. + } else if (input.fixed_value().value_size() == 1) { + // Single value. + output->value = crosapi::mojom::OptionValue::NewFixedValue( + input.fixed_value().value(0)); + } else { + // Multiple values. + output->value = crosapi::mojom::OptionValue::NewFixedList( + std::vector<double>{input.fixed_value().value().begin(), + input.fixed_value().value().end()}); + } + break; + case crosapi::mojom::OptionType::kString: + if (input.has_string_value()) { + output->value = + crosapi::mojom::OptionValue::NewStringValue(input.string_value()); + } + break; + } + + if (input.has_constraint()) { + output->constraint = + crosapi::mojom::OptionConstraint::From(input.constraint()); + } + output->isDetectable = input.detectable(); + + // Configurability represents the combinations of sw_settable+hw_settable. + // Only one is allowed to be set according to SANE, so there isn't a case + // for both. + if (input.sw_settable()) { + output->configurability = + crosapi::mojom::OptionConfigurability::kSoftwareConfigurable; + } else if (input.hw_settable()) { + output->configurability = + crosapi::mojom::OptionConfigurability::kHardwareConfigurable; + } else { + output->configurability = + crosapi::mojom::OptionConfigurability::kNotConfigurable; + } + + output->isAutoSettable = input.auto_settable(); + output->isEmulated = input.emulated(); + output->isActive = input.active(); + output->isAdvanced = input.advanced(); + output->isInternal = false; // Lorgnette currently does not return internal + // options. + return output; + } +}; +crosapi::mojom::ScannerOptionPtr ConvertForTesting( // IN-TEST + const lorgnette::ScannerOption& input) { + return crosapi::mojom::ScannerOption::From(input); +} + crosapi::mojom::ScannerOperationResult TypeConverter< crosapi::mojom::ScannerOperationResult, lorgnette::OperationResult>::Convert(lorgnette::OperationResult input) { @@ -110,4 +411,39 @@ return output; } +crosapi::mojom::OpenScannerResponsePtr +TypeConverter<crosapi::mojom::OpenScannerResponsePtr, + lorgnette::OpenScannerResponse>:: + Convert(const lorgnette::OpenScannerResponse& input) { + auto output = crosapi::mojom::OpenScannerResponse::New(); + output->scanner_id = input.scanner_id().connection_string(); + output->result = + ConvertTo<crosapi::mojom::ScannerOperationResult>(input.result()); + if (!input.has_config()) { + return output; + } + + const lorgnette::ScannerConfig& config = input.config(); + output->scanner_handle = config.scanner().token(); + output->options = + base::flat_map<std::string, crosapi::mojom::ScannerOptionPtr>(); + output->options->reserve(config.options().size()); + for (const auto& [name, option] : config.options()) { + output->options->try_emplace(name, + crosapi::mojom::ScannerOption::From(option)); + } + return output; +} + +crosapi::mojom::CloseScannerResponsePtr +TypeConverter<crosapi::mojom::CloseScannerResponsePtr, + lorgnette::CloseScannerResponse>:: + Convert(const lorgnette::CloseScannerResponse& input) { + auto output = crosapi::mojom::CloseScannerResponse::New(); + output->scanner_handle = input.scanner().token(); + output->result = + ConvertTo<crosapi::mojom::ScannerOperationResult>(input.result()); + return output; +} + } // namespace mojo
diff --git a/chrome/browser/ash/crosapi/document_scan_ash_type_converters.h b/chrome/browser/ash/crosapi/document_scan_ash_type_converters.h index d4b1cf9b..dcce961 100644 --- a/chrome/browser/ash/crosapi/document_scan_ash_type_converters.h +++ b/chrome/browser/ash/crosapi/document_scan_ash_type_converters.h
@@ -25,6 +25,31 @@ lorgnette::OperationResult input); }; +template <> +struct TypeConverter<crosapi::mojom::OpenScannerResponsePtr, + lorgnette::OpenScannerResponse> { + static crosapi::mojom::OpenScannerResponsePtr Convert( + const lorgnette::OpenScannerResponse& input); +}; + +template <> +struct TypeConverter<crosapi::mojom::CloseScannerResponsePtr, + lorgnette::CloseScannerResponse> { + static crosapi::mojom::CloseScannerResponsePtr Convert( + const lorgnette::CloseScannerResponse& input); +}; + +// Types that don't need to be converted directly, but are easier to test in +// isolation. +crosapi::mojom::OptionType ConvertForTesting(lorgnette::OptionType input); +crosapi::mojom::OptionUnit ConvertForTesting(lorgnette::OptionUnit input); +crosapi::mojom::OptionConstraintType ConvertForTesting( + lorgnette::OptionConstraint_ConstraintType input); +crosapi::mojom::OptionConstraintPtr ConvertForTesting( + const lorgnette::OptionConstraint& input); +crosapi::mojom::ScannerOptionPtr ConvertForTesting( + const lorgnette::ScannerOption& input); + } // namespace mojo #endif // CHROME_BROWSER_ASH_CROSAPI_DOCUMENT_SCAN_ASH_TYPE_CONVERTERS_H_
diff --git a/chrome/browser/ash/crosapi/document_scan_ash_type_converters_unittest.cc b/chrome/browser/ash/crosapi/document_scan_ash_type_converters_unittest.cc index c560e2d..9fc0c4e 100644 --- a/chrome/browser/ash/crosapi/document_scan_ash_type_converters_unittest.cc +++ b/chrome/browser/ash/crosapi/document_scan_ash_type_converters_unittest.cc
@@ -4,12 +4,14 @@ #include "chrome/browser/ash/crosapi/document_scan_ash_type_converters.h" +#include "base/containers/contains.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" namespace mojo { namespace { +using ::testing::ElementsAre; using ::testing::UnorderedElementsAre; TEST(DocumentScanAshTypeConvertersTest, OperationResult) { @@ -66,6 +68,381 @@ crosapi::mojom::ScannerOperationResult::kInternalError); } +TEST(DocumentScanAshTypeConvertersTest, OptionType) { + EXPECT_EQ(ConvertForTesting(lorgnette::TYPE_UNKNOWN), + crosapi::mojom::OptionType::kUnknown); + EXPECT_EQ(ConvertForTesting(lorgnette::TYPE_BOOL), + crosapi::mojom::OptionType::kBool); + EXPECT_EQ(ConvertForTesting(lorgnette::TYPE_INT), + crosapi::mojom::OptionType::kInt); + EXPECT_EQ(ConvertForTesting(lorgnette::TYPE_FIXED), + crosapi::mojom::OptionType::kFixed); + EXPECT_EQ(ConvertForTesting(lorgnette::TYPE_STRING), + crosapi::mojom::OptionType::kString); + EXPECT_EQ(ConvertForTesting(lorgnette::TYPE_BUTTON), + crosapi::mojom::OptionType::kButton); + EXPECT_EQ(ConvertForTesting(lorgnette::TYPE_GROUP), + crosapi::mojom::OptionType::kGroup); +} + +TEST(DocumentScanAshTypeConvertersTest, OptionUnit) { + EXPECT_EQ(ConvertForTesting(lorgnette::UNIT_NONE), + crosapi::mojom::OptionUnit::kUnitless); + EXPECT_EQ(ConvertForTesting(lorgnette::UNIT_PIXEL), + crosapi::mojom::OptionUnit::kPixel); + EXPECT_EQ(ConvertForTesting(lorgnette::UNIT_BIT), + crosapi::mojom::OptionUnit::kBit); + EXPECT_EQ(ConvertForTesting(lorgnette::UNIT_MM), + crosapi::mojom::OptionUnit::kMm); + EXPECT_EQ(ConvertForTesting(lorgnette::UNIT_DPI), + crosapi::mojom::OptionUnit::kDpi); + EXPECT_EQ(ConvertForTesting(lorgnette::UNIT_PERCENT), + crosapi::mojom::OptionUnit::kPercent); + EXPECT_EQ(ConvertForTesting(lorgnette::UNIT_MICROSECOND), + crosapi::mojom::OptionUnit::kMicrosecond); +} + +TEST(DocumentScanAshTypeConvertersTest, OptionConstraintType) { + EXPECT_EQ(ConvertForTesting(lorgnette::OptionConstraint::CONSTRAINT_NONE), + crosapi::mojom::OptionConstraintType::kNone); + EXPECT_EQ( + ConvertForTesting(lorgnette::OptionConstraint::CONSTRAINT_INT_RANGE), + crosapi::mojom::OptionConstraintType::kIntRange); + EXPECT_EQ( + ConvertForTesting(lorgnette::OptionConstraint::CONSTRAINT_FIXED_RANGE), + crosapi::mojom::OptionConstraintType::kFixedRange); + EXPECT_EQ(ConvertForTesting(lorgnette::OptionConstraint::CONSTRAINT_INT_LIST), + crosapi::mojom::OptionConstraintType::kIntList); + EXPECT_EQ( + ConvertForTesting(lorgnette::OptionConstraint::CONSTRAINT_FIXED_LIST), + crosapi::mojom::OptionConstraintType::kFixedList); + EXPECT_EQ( + ConvertForTesting(lorgnette::OptionConstraint::CONSTRAINT_STRING_LIST), + crosapi::mojom::OptionConstraintType::kStringList); +} + +TEST(DocumentScanAshTypeConvertersTest, OptionConstraint_TypeNone) { + lorgnette::OptionConstraint input; + input.set_constraint_type(lorgnette::OptionConstraint::CONSTRAINT_NONE); + input.mutable_int_range()->set_min(42); + input.mutable_fixed_range()->set_min(42); + input.add_valid_int(1); + input.add_valid_fixed(2.0); + input.add_valid_string("string"); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionConstraintType::kNone); + EXPECT_TRUE(output->restriction.is_null()); +} + +TEST(DocumentScanAshTypeConvertersTest, OptionConstraint_IntRangeWithoutRange) { + lorgnette::OptionConstraint input; + input.set_constraint_type(lorgnette::OptionConstraint::CONSTRAINT_INT_RANGE); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionConstraintType::kIntRange); + ASSERT_FALSE(output->restriction.is_null()); + ASSERT_TRUE(output->restriction->is_int_range()); + EXPECT_EQ(output->restriction->get_int_range()->min, 0); + EXPECT_EQ(output->restriction->get_int_range()->max, 0); + EXPECT_EQ(output->restriction->get_int_range()->quant, 0); +} + +TEST(DocumentScanAshTypeConvertersTest, OptionConstraint_IntRangeWithRange) { + lorgnette::OptionConstraint input; + input.set_constraint_type(lorgnette::OptionConstraint::CONSTRAINT_INT_RANGE); + input.mutable_int_range()->set_min(1); + input.mutable_int_range()->set_max(10); + input.mutable_int_range()->set_quant(2); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionConstraintType::kIntRange); + ASSERT_FALSE(output->restriction.is_null()); + ASSERT_TRUE(output->restriction->is_int_range()); + EXPECT_EQ(output->restriction->get_int_range()->min, 1); + EXPECT_EQ(output->restriction->get_int_range()->max, 10); + EXPECT_EQ(output->restriction->get_int_range()->quant, 2); +} + +TEST(DocumentScanAshTypeConvertersTest, + OptionConstraint_FixedRangeWithoutRange) { + lorgnette::OptionConstraint input; + input.set_constraint_type( + lorgnette::OptionConstraint::CONSTRAINT_FIXED_RANGE); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionConstraintType::kFixedRange); + ASSERT_FALSE(output->restriction.is_null()); + ASSERT_TRUE(output->restriction->is_fixed_range()); + EXPECT_EQ(output->restriction->get_fixed_range()->min, 0.0); + EXPECT_EQ(output->restriction->get_fixed_range()->max, 0.0); + EXPECT_EQ(output->restriction->get_fixed_range()->quant, 0.0); +} + +TEST(DocumentScanAshTypeConvertersTest, OptionConstraint_FixedRangeWithRange) { + lorgnette::OptionConstraint input; + input.set_constraint_type( + lorgnette::OptionConstraint::CONSTRAINT_FIXED_RANGE); + input.mutable_fixed_range()->set_min(1.0); + input.mutable_fixed_range()->set_max(10.0); + input.mutable_fixed_range()->set_quant(0.5); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionConstraintType::kFixedRange); + ASSERT_FALSE(output->restriction.is_null()); + ASSERT_TRUE(output->restriction->is_fixed_range()); + EXPECT_EQ(output->restriction->get_fixed_range()->min, 1.0); + EXPECT_EQ(output->restriction->get_fixed_range()->max, 10.0); + EXPECT_EQ(output->restriction->get_fixed_range()->quant, 0.5); +} + +TEST(DocumentScanAshTypeConvertersTest, OptionConstraint_IntListWithoutList) { + lorgnette::OptionConstraint input; + input.set_constraint_type(lorgnette::OptionConstraint::CONSTRAINT_INT_LIST); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionConstraintType::kIntList); + ASSERT_FALSE(output->restriction.is_null()); + ASSERT_TRUE(output->restriction->is_valid_int()); + EXPECT_TRUE(output->restriction->get_valid_int().empty()); +} + +TEST(DocumentScanAshTypeConvertersTest, OptionConstraint_IntListWithList) { + lorgnette::OptionConstraint input; + input.set_constraint_type(lorgnette::OptionConstraint::CONSTRAINT_INT_LIST); + input.add_valid_int(42); + input.add_valid_int(43); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionConstraintType::kIntList); + ASSERT_FALSE(output->restriction.is_null()); + ASSERT_TRUE(output->restriction->is_valid_int()); + EXPECT_THAT(output->restriction->get_valid_int(), ElementsAre(42, 43)); +} + +TEST(DocumentScanAshTypeConvertersTest, OptionConstraint_FixedListWithoutList) { + lorgnette::OptionConstraint input; + input.set_constraint_type(lorgnette::OptionConstraint::CONSTRAINT_FIXED_LIST); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionConstraintType::kFixedList); + ASSERT_FALSE(output->restriction.is_null()); + ASSERT_TRUE(output->restriction->is_valid_fixed()); + EXPECT_TRUE(output->restriction->get_valid_fixed().empty()); +} + +TEST(DocumentScanAshTypeConvertersTest, OptionConstraint_FixedListWithList) { + lorgnette::OptionConstraint input; + input.set_constraint_type(lorgnette::OptionConstraint::CONSTRAINT_FIXED_LIST); + input.add_valid_fixed(0.25); + input.add_valid_fixed(0.5); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionConstraintType::kFixedList); + ASSERT_FALSE(output->restriction.is_null()); + ASSERT_TRUE(output->restriction->is_valid_fixed()); + EXPECT_THAT(output->restriction->get_valid_fixed(), ElementsAre(0.25, 0.5)); +} + +TEST(DocumentScanAshTypeConvertersTest, + OptionConstraint_StringListWithoutList) { + lorgnette::OptionConstraint input; + input.set_constraint_type( + lorgnette::OptionConstraint::CONSTRAINT_STRING_LIST); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionConstraintType::kStringList); + ASSERT_FALSE(output->restriction.is_null()); + ASSERT_TRUE(output->restriction->is_valid_string()); + EXPECT_TRUE(output->restriction->get_valid_string().empty()); +} + +TEST(DocumentScanAshTypeConvertersTest, OptionConstraint_StringListWithList) { + lorgnette::OptionConstraint input; + input.set_constraint_type( + lorgnette::OptionConstraint::CONSTRAINT_STRING_LIST); + input.add_valid_string("1"); + input.add_valid_string("2"); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionConstraintType::kStringList); + ASSERT_FALSE(output->restriction.is_null()); + ASSERT_TRUE(output->restriction->is_valid_string()); + EXPECT_THAT(output->restriction->get_valid_string(), ElementsAre("1", "2")); +} + +// Test all the fields that don't require complicated logic so they can be +// omitted from the subsequent tests. +TEST(DocumentScanAshTypeConvertersTest, ScannerOption_BasicFields) { + lorgnette::ScannerOption input; + input.set_name("option-name"); + input.set_title("Option title"); + input.set_description("Option Description\nLine 2"); + input.set_option_type(lorgnette::OptionType::TYPE_BUTTON); + input.set_unit(lorgnette::OptionUnit::UNIT_NONE); + input.set_detectable(true); + input.set_auto_settable(true); + input.set_emulated(true); + input.set_active(true); + input.set_advanced(true); + + auto output = ConvertForTesting(input); + EXPECT_EQ(output->name, "option-name"); + EXPECT_EQ(output->title, "Option title"); + EXPECT_EQ(output->description, "Option Description\nLine 2"); + EXPECT_EQ(output->type, crosapi::mojom::OptionType::kButton); + EXPECT_EQ(output->unit, crosapi::mojom::OptionUnit::kUnitless); + EXPECT_TRUE(output->value.is_null()); + EXPECT_TRUE(output->constraint.is_null()); + EXPECT_TRUE(output->isDetectable); + EXPECT_EQ(output->configurability, + crosapi::mojom::OptionConfigurability::kNotConfigurable); + EXPECT_TRUE(output->isAutoSettable); + EXPECT_TRUE(output->isEmulated); + EXPECT_TRUE(output->isActive); + EXPECT_TRUE(output->isAdvanced); + EXPECT_FALSE(output->isInternal); +} + +TEST(DocumentScanAshTypeConvertersTest, ScannerOption_ConfigurabilitySoftware) { + lorgnette::ScannerOption input; + input.set_sw_settable(true); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->configurability, + crosapi::mojom::OptionConfigurability::kSoftwareConfigurable); +} + +TEST(DocumentScanAshTypeConvertersTest, ScannerOption_ConfigurabilityHardware) { + lorgnette::ScannerOption input; + input.set_hw_settable(true); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->configurability, + crosapi::mojom::OptionConfigurability::kHardwareConfigurable); +} + +TEST(DocumentScanAshTypeConvertersTest, ScannerOption_BoolWithoutBoolValue) { + lorgnette::ScannerOption input; + input.set_option_type(lorgnette::TYPE_BOOL); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionType::kBool); + EXPECT_TRUE(output->value.is_null()); +} + +TEST(DocumentScanAshTypeConvertersTest, ScannerOption_BoolWithBoolValue) { + lorgnette::ScannerOption input; + input.set_option_type(lorgnette::TYPE_BOOL); + input.set_bool_value(true); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionType::kBool); + ASSERT_FALSE(output->value.is_null()); + ASSERT_TRUE(output->value->is_bool_value()); + EXPECT_EQ(output->value->get_bool_value(), true); +} + +TEST(DocumentScanAshTypeConvertersTest, ScannerOption_IntWithoutIntValue) { + lorgnette::ScannerOption input; + input.set_option_type(lorgnette::TYPE_INT); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionType::kInt); + EXPECT_TRUE(output->value.is_null()); +} + +TEST(DocumentScanAshTypeConvertersTest, ScannerOption_IntWithOneIntValue) { + lorgnette::ScannerOption input; + input.set_option_type(lorgnette::TYPE_INT); + input.mutable_int_value()->add_value(1); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionType::kInt); + ASSERT_FALSE(output->value.is_null()); + ASSERT_TRUE(output->value->is_int_value()); + EXPECT_EQ(output->value->get_int_value(), 1); +} + +TEST(DocumentScanAshTypeConvertersTest, + ScannerOption_IntWithMultipleIntValues) { + lorgnette::ScannerOption input; + input.set_option_type(lorgnette::TYPE_INT); + input.mutable_int_value()->add_value(5); + input.mutable_int_value()->add_value(4); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionType::kInt); + ASSERT_FALSE(output->value.is_null()); + ASSERT_TRUE(output->value->is_int_list()); + EXPECT_THAT(output->value->get_int_list(), ElementsAre(5, 4)); +} + +TEST(DocumentScanAshTypeConvertersTest, ScannerOption_FixedWithoutFixedValue) { + lorgnette::ScannerOption input; + input.set_option_type(lorgnette::TYPE_FIXED); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionType::kFixed); + EXPECT_TRUE(output->value.is_null()); +} + +TEST(DocumentScanAshTypeConvertersTest, ScannerOption_FixedWithOneFixedValue) { + lorgnette::ScannerOption input; + input.set_option_type(lorgnette::TYPE_FIXED); + input.mutable_fixed_value()->add_value(3.25); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionType::kFixed); + ASSERT_FALSE(output->value.is_null()); + ASSERT_TRUE(output->value->is_fixed_value()); + EXPECT_EQ(output->value->get_fixed_value(), 3.25); +} + +TEST(DocumentScanAshTypeConvertersTest, + ScannerOption_FixedWithMultipleFixedValues) { + lorgnette::ScannerOption input; + input.set_option_type(lorgnette::TYPE_FIXED); + input.mutable_fixed_value()->add_value(5.0); + input.mutable_fixed_value()->add_value(4.5); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionType::kFixed); + ASSERT_FALSE(output->value.is_null()); + ASSERT_TRUE(output->value->is_fixed_list()); + EXPECT_THAT(output->value->get_fixed_list(), ElementsAre(5.0, 4.5)); +} + +TEST(DocumentScanAshTypeConvertersTest, + ScannerOption_StringWithoutStringValue) { + lorgnette::ScannerOption input; + input.set_option_type(lorgnette::TYPE_STRING); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionType::kString); + EXPECT_TRUE(output->value.is_null()); +} + +TEST(DocumentScanAshTypeConvertersTest, + ScannerOption_StringWithEmptyStringValue) { + lorgnette::ScannerOption input; + input.set_option_type(lorgnette::TYPE_STRING); + input.set_string_value(""); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionType::kString); + ASSERT_FALSE(output->value.is_null()); + ASSERT_TRUE(output->value->is_string_value()); + EXPECT_EQ(output->value->get_string_value(), ""); +} + +TEST(DocumentScanAshTypeConvertersTest, + ScannerOption_StringWithNonEmptyStringValue) { + lorgnette::ScannerOption input; + input.set_option_type(lorgnette::TYPE_STRING); + input.set_string_value("string"); + auto output = ConvertForTesting(input); + EXPECT_EQ(output->type, crosapi::mojom::OptionType::kString); + ASSERT_FALSE(output->value.is_null()); + ASSERT_TRUE(output->value->is_string_value()); + EXPECT_EQ(output->value->get_string_value(), "string"); +} + +// Verifies that a constraint is copied in. Details of the OptionConstraint +// conversion are covered in specific tests above. The case of a missing +// constraint is covered in the BasicFields test. +TEST(DocumentScanAshTypeConvertersTest, ScannerOption_NonEmptyConstraint) { + lorgnette::ScannerOption input; + input.mutable_constraint()->set_constraint_type( + lorgnette::OptionConstraint::CONSTRAINT_STRING_LIST); + input.mutable_constraint()->add_valid_string("string"); + auto output = ConvertForTesting(input); + ASSERT_FALSE(output->constraint.is_null()); + EXPECT_EQ(output->constraint->type, + crosapi::mojom::OptionConstraintType::kStringList); + ASSERT_FALSE(output->constraint->restriction.is_null()); + ASSERT_TRUE(output->constraint->restriction->is_valid_string()); + EXPECT_THAT(output->constraint->restriction->get_valid_string(), + ElementsAre("string")); +} + TEST(DocumentScanAshTypeConvertersTest, GetScannerListResponse_EmptyObjectSucceeds) { lorgnette::ListScannersResponse input; @@ -134,5 +511,53 @@ UnorderedElementsAre("image/png", "image/jpeg")); } +TEST(DocumentScanAshTypeConvertersTest, + OpenScannerResponse_EmptyObjectSucceeds) { + lorgnette::OpenScannerResponse input; + auto output = crosapi::mojom::OpenScannerResponse::From(input); + EXPECT_TRUE(output->scanner_id.empty()); + EXPECT_EQ(output->result, crosapi::mojom::ScannerOperationResult::kUnknown); + EXPECT_FALSE(output->scanner_handle.has_value()); + EXPECT_FALSE(output->options.has_value()); +} + +// Test that all provided options are copied into the mojom result. Ensuring +// that option details are converted correctly is covered by specific +// ScannerOption tests above. +TEST(DocumentScanAshTypeConvertersTest, + OpenScannerResponse_AllOptionsIncluded) { + lorgnette::OpenScannerResponse input; + input.mutable_scanner_id()->set_connection_string("scanner:id"); + input.set_result(lorgnette::OPERATION_RESULT_SUCCESS); + input.mutable_config()->mutable_scanner()->set_token("12345"); + (*input.mutable_config()->mutable_options())["option1-name"] = {}; + (*input.mutable_config()->mutable_options())["option2-name"] = {}; + auto output = crosapi::mojom::OpenScannerResponse::From(input); + EXPECT_EQ(output->scanner_id, "scanner:id"); + EXPECT_EQ(output->result, crosapi::mojom::ScannerOperationResult::kSuccess); + ASSERT_TRUE(output->scanner_handle.has_value()); + EXPECT_EQ(output->scanner_handle.value(), "12345"); + ASSERT_TRUE(output->options.has_value()); + EXPECT_TRUE(base::Contains(output->options.value(), "option1-name")); + EXPECT_TRUE(base::Contains(output->options.value(), "option2-name")); +} + +TEST(DocumentScanAshTypeConvertersTest, + CloseScannerResponse_EmptyObjectSucceeds) { + lorgnette::CloseScannerResponse input; + auto output = crosapi::mojom::CloseScannerResponse::From(input); + EXPECT_TRUE(output->scanner_handle.empty()); + EXPECT_EQ(output->result, crosapi::mojom::ScannerOperationResult::kUnknown); +} + +TEST(DocumentScanAshTypeConvertersTest, CloseScannerResponse_NonEmptyResponse) { + lorgnette::CloseScannerResponse input; + input.mutable_scanner()->set_token("55555"); + input.set_result(lorgnette::OPERATION_RESULT_SUCCESS); + auto output = crosapi::mojom::CloseScannerResponse::From(input); + EXPECT_EQ(output->scanner_handle, "55555"); + EXPECT_EQ(output->result, crosapi::mojom::ScannerOperationResult::kSuccess); +} + } // namespace } // namespace mojo
diff --git a/chrome/browser/ash/crosapi/document_scan_ash_unittest.cc b/chrome/browser/ash/crosapi/document_scan_ash_unittest.cc index f7597d4..e70af965 100644 --- a/chrome/browser/ash/crosapi/document_scan_ash_unittest.cc +++ b/chrome/browser/ash/crosapi/document_scan_ash_unittest.cc
@@ -10,6 +10,7 @@ #include <vector> #include "ash/constants/ash_features.h" +#include "base/containers/contains.h" #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" @@ -232,4 +233,114 @@ run_loop.Run(); } +TEST_F(DocumentScanAshTest, OpenScanner_FeatureDisabled) { + base::test::ScopedFeatureList feature; + feature.InitAndDisableFeature(ash::features::kAdvancedDocumentScanAPI); + + base::RunLoop run_loop; + GetLorgnetteScannerManager()->SetOpenScannerResponse(std::nullopt); + document_scan_ash().OpenScanner( + "client-id", "scanner-id", + base::BindLambdaForTesting([&](mojom::OpenScannerResponsePtr response) { + run_loop.Quit(); + EXPECT_EQ(response->scanner_id, "scanner-id"); + EXPECT_EQ(response->result, + mojom::ScannerOperationResult::kUnsupported); + EXPECT_FALSE(response->scanner_handle.has_value()); + EXPECT_FALSE(response->options.has_value()); + })); + run_loop.Run(); +} + +TEST_F(DocumentScanAshTest, OpenScanner_BadResponse) { + base::RunLoop run_loop; + GetLorgnetteScannerManager()->SetOpenScannerResponse(std::nullopt); + document_scan_ash().OpenScanner( + "client-id", "scanner-id", + base::BindLambdaForTesting([&](mojom::OpenScannerResponsePtr response) { + run_loop.Quit(); + EXPECT_EQ(response->scanner_id, "scanner-id"); + EXPECT_EQ(response->result, + mojom::ScannerOperationResult::kInternalError); + EXPECT_FALSE(response->scanner_handle.has_value()); + EXPECT_FALSE(response->options.has_value()); + })); + run_loop.Run(); +} + +TEST_F(DocumentScanAshTest, OpenScanner_GoodResponse) { + lorgnette::OpenScannerResponse fake_response; + fake_response.mutable_scanner_id()->set_connection_string("scanner-id"); + fake_response.set_result(lorgnette::OPERATION_RESULT_DEVICE_BUSY); + lorgnette::ScannerConfig* fake_config = fake_response.mutable_config(); + fake_config->mutable_scanner()->set_token("12345"); + (*fake_config->mutable_options())["option1-name"] = {}; + (*fake_config->mutable_options())["option2-name"] = {}; + base::RunLoop run_loop; + GetLorgnetteScannerManager()->SetOpenScannerResponse( + std::move(fake_response)); + document_scan_ash().OpenScanner( + "client-id", "scanner-id", + base::BindLambdaForTesting([&](mojom::OpenScannerResponsePtr response) { + run_loop.Quit(); + EXPECT_EQ(response->scanner_id, "scanner-id"); + EXPECT_EQ(response->result, mojom::ScannerOperationResult::kDeviceBusy); + ASSERT_TRUE(response->scanner_handle.has_value()); + EXPECT_EQ(response->scanner_handle.value(), "12345"); + ASSERT_TRUE(response->options.has_value()); + EXPECT_TRUE(base::Contains(response->options.value(), "option1-name")); + EXPECT_TRUE(base::Contains(response->options.value(), "option2-name")); + })); + run_loop.Run(); +} + +TEST_F(DocumentScanAshTest, CloseScanner_FeatureDisabled) { + base::test::ScopedFeatureList feature; + feature.InitAndDisableFeature(ash::features::kAdvancedDocumentScanAPI); + + base::RunLoop run_loop; + GetLorgnetteScannerManager()->SetCloseScannerResponse(std::nullopt); + document_scan_ash().CloseScanner( + "scanner-handle", + base::BindLambdaForTesting([&](mojom::CloseScannerResponsePtr response) { + run_loop.Quit(); + EXPECT_EQ(response->scanner_handle, "scanner-handle"); + EXPECT_EQ(response->result, + mojom::ScannerOperationResult::kUnsupported); + })); + run_loop.Run(); +} + +TEST_F(DocumentScanAshTest, CloseScanner_BadResponse) { + base::RunLoop run_loop; + GetLorgnetteScannerManager()->SetCloseScannerResponse(std::nullopt); + document_scan_ash().CloseScanner( + "scanner-handle", + base::BindLambdaForTesting([&](mojom::CloseScannerResponsePtr response) { + run_loop.Quit(); + EXPECT_EQ(response->scanner_handle, "scanner-handle"); + EXPECT_EQ(response->result, + mojom::ScannerOperationResult::kInternalError); + })); + run_loop.Run(); +} + +TEST_F(DocumentScanAshTest, CloseScanner_GoodResponse) { + lorgnette::CloseScannerResponse fake_response; + fake_response.mutable_scanner()->set_token("scanner-handle"); + fake_response.set_result(lorgnette::OPERATION_RESULT_MISSING); + base::RunLoop run_loop; + GetLorgnetteScannerManager()->SetCloseScannerResponse( + std::move(fake_response)); + document_scan_ash().CloseScanner( + "scanner-handle", + base::BindLambdaForTesting([&](mojom::CloseScannerResponsePtr response) { + run_loop.Quit(); + EXPECT_EQ(response->scanner_handle, "scanner-handle"); + EXPECT_EQ(response->result, + mojom::ScannerOperationResult::kDeviceMissing); + })); + run_loop.Run(); +} + } // namespace crosapi
diff --git a/chrome/browser/ash/crosapi/in_session_auth_ash.cc b/chrome/browser/ash/crosapi/in_session_auth_ash.cc deleted file mode 100644 index 9e34bd80..0000000 --- a/chrome/browser/ash/crosapi/in_session_auth_ash.cc +++ /dev/null
@@ -1,71 +0,0 @@ -// Copyright 2022 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ash/crosapi/in_session_auth_ash.h" - -#include "ash/constants/ash_features.h" -#include "ash/public/cpp/in_session_auth_dialog_controller.h" -#include "ash/shell.h" -#include "base/functional/bind.h" -#include "base/functional/callback_helpers.h" -#include "chrome/browser/ash/login/quick_unlock/auth_token.h" -#include "chrome/browser/ash/login/quick_unlock/quick_unlock_factory.h" -#include "chrome/browser/ash/login/quick_unlock/quick_unlock_storage.h" -#include "chromeos/ash/components/osauth/public/auth_session_storage.h" -#include "chromeos/components/in_session_auth/mojom/in_session_auth.mojom.h" - -namespace crosapi { - -ash::InSessionAuthDialogController::Reason ToAshReason( - chromeos::auth::mojom::Reason reason) { - switch (reason) { - case chromeos::auth::mojom::Reason::kAccessPasswordManager: - return ash::InSessionAuthDialogController::kAccessPasswordManager; - case chromeos::auth::mojom::Reason::kModifyAuthFactors: - return ash::InSessionAuthDialogController::kModifyAuthFactors; - case chromeos::auth::mojom::Reason::kModifyAuthFactorsMultidevice: - return ash::InSessionAuthDialogController::kModifyAuthFactorsMultidevice; - } -} - -InSessionAuthAsh::InSessionAuthAsh() = default; -InSessionAuthAsh::~InSessionAuthAsh() = default; - -void InSessionAuthAsh::BindReceiver( - mojo::PendingReceiver<InSessionAuth> receiver) { - receivers_.Add(this, std::move(receiver)); -} - -void InSessionAuthAsh::RequestToken(chromeos::auth::mojom::Reason reason, - const absl::optional<std::string>& prompt, - RequestTokenCallback callback) { - ash::Shell::Get()->in_session_auth_dialog_controller()->ShowAuthDialog( - ToAshReason(reason), - base::BindOnce(&InSessionAuthAsh::OnAuthComplete, - weak_factory_.GetWeakPtr(), std::move(callback))); -} - -void InSessionAuthAsh::CheckToken(chromeos::auth::mojom::Reason reason, - const std::string& token, - CheckTokenCallback callback) { - bool token_valid; - token_valid = ash::AuthSessionStorage::Get()->IsValid(token); - - std::move(callback).Run(token_valid); -} - -void InSessionAuthAsh::InvalidateToken(const std::string& token) { - ash::AuthSessionStorage::Get()->Invalidate(token, base::DoNothing()); -} - -void InSessionAuthAsh::OnAuthComplete(RequestTokenCallback callback, - bool success, - const ash::AuthProofToken& token, - base::TimeDelta timeout) { - std::move(callback).Run( - success ? chromeos::auth::mojom::RequestTokenReply::New(token, timeout) - : nullptr); -} - -} // namespace crosapi
diff --git a/chrome/browser/ash/crosapi/in_session_auth_ash.h b/chrome/browser/ash/crosapi/in_session_auth_ash.h deleted file mode 100644 index 4e75bff..0000000 --- a/chrome/browser/ash/crosapi/in_session_auth_ash.h +++ /dev/null
@@ -1,53 +0,0 @@ -// Copyright 2022 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_ASH_CROSAPI_IN_SESSION_AUTH_ASH_H_ -#define CHROME_BROWSER_ASH_CROSAPI_IN_SESSION_AUTH_ASH_H_ - -#include "base/memory/weak_ptr.h" -#include "chromeos/ash/components/osauth/public/common_types.h" -#include "chromeos/components/in_session_auth/mojom/in_session_auth.mojom-shared.h" -#include "chromeos/components/in_session_auth/mojom/in_session_auth.mojom.h" -#include "mojo/public/cpp/bindings/receiver_set.h" -#include "third_party/abseil-cpp/absl/types/optional.h" - -namespace crosapi { - -// This is the ash-chrome implementation of the InSessionAuth mojo interface. -// Used by lacros-chrome to call into ash authentication backends to -// authenticate users in session. -class InSessionAuthAsh : public chromeos::auth::mojom::InSessionAuth { - public: - InSessionAuthAsh(); - InSessionAuthAsh(const InSessionAuthAsh&) = delete; - InSessionAuthAsh& operator=(const InSessionAuthAsh&) = delete; - ~InSessionAuthAsh() override; - - void BindReceiver(mojo::PendingReceiver<InSessionAuth> receiver); - - // crosapi::mojom::InSessionAuth - void RequestToken(chromeos::auth::mojom::Reason reason, - const absl::optional<std::string>& prompt, - RequestTokenCallback callback) override; - void CheckToken(chromeos::auth::mojom::Reason reason, - const std::string& token, - CheckTokenCallback callback) override; - void InvalidateToken(const std::string& token) override; - - private: - // Continuation of InSessionAuthAsh::RequestToken. Last 3 params match - // InSessionAuthDialogController::OnAuthComplete - void OnAuthComplete(RequestTokenCallback callback, - bool success, - const ash::AuthProofToken& token, - base::TimeDelta timeout); - - mojo::ReceiverSet<chromeos::auth::mojom::InSessionAuth> receivers_; - - base::WeakPtrFactory<InSessionAuthAsh> weak_factory_{this}; -}; - -} // namespace crosapi - -#endif // CHROME_BROWSER_ASH_CROSAPI_IN_SESSION_AUTH_ASH_H_
diff --git a/chrome/browser/ash/crosapi/wallpaper_ash.cc b/chrome/browser/ash/crosapi/wallpaper_ash.cc index efc4aea..c35a4d2 100644 --- a/chrome/browser/ash/crosapi/wallpaper_ash.cc +++ b/chrome/browser/ash/crosapi/wallpaper_ash.cc
@@ -49,8 +49,9 @@ const gfx::ImageSkia& image) { float scale = std::min(static_cast<float>(image.width()) / size.width(), static_cast<float>(image.height()) / size.height()); - gfx::Size scaled_size = {base::ClampFloor(scale * size.width()), - base::ClampFloor(scale * size.height())}; + gfx::Size scaled_size = { + std::max(1, base::ClampFloor(scale * size.width())), + std::max(1, base::ClampFloor(scale * size.height()))}; gfx::Rect bounds{{0, 0}, image.size()}; bounds.ClampToCenteredSize(scaled_size); auto scaled_and_cropped_image = gfx::ImageSkiaOperations::CreateTiledImage(
diff --git a/chrome/browser/ash/crosapi/wallpaper_ash_unittest.cc b/chrome/browser/ash/crosapi/wallpaper_ash_unittest.cc index fce1e4c..d8f86d7 100644 --- a/chrome/browser/ash/crosapi/wallpaper_ash_unittest.cc +++ b/chrome/browser/ash/crosapi/wallpaper_ash_unittest.cc
@@ -32,14 +32,12 @@ namespace crosapi { -std::vector<uint8_t> CreateJpeg() { - constexpr int kWidth = 100; - constexpr int kHeight = 100; +std::vector<uint8_t> CreateJpeg(int width = 100, int height = 100) { const SkColor kRed = SkColorSetRGB(255, 0, 0); constexpr int kQuality = 80; SkBitmap bitmap; - bitmap.allocN32Pixels(kWidth, kHeight); + bitmap.allocN32Pixels(width, height); bitmap.eraseColor(kRed); std::vector<uint8_t> jpg_data; @@ -119,6 +117,26 @@ ASSERT_EQ(1, test_wallpaper_controller_.get_third_party_wallpaper_count()); } +TEST_F(WallpaperAshTest, SetWallpaper1x1) { + crosapi::mojom::WallpaperSettingsPtr settings = + crosapi::mojom::WallpaperSettings::New(); + settings->data = CreateJpeg(1, 1); + test_wallpaper_controller_.SetCurrentUser(user_manager::StubAccountId()); + + base::RunLoop loop; + wallpaper_ash_.SetWallpaper( + std::move(settings), "extension_id", "extension_name", + base::BindLambdaForTesting( + [&loop](const crosapi::mojom::SetWallpaperResultPtr result) { + ASSERT_TRUE(result->is_thumbnail_data()); + ASSERT_FALSE(result->get_thumbnail_data().empty()); + loop.Quit(); + })); + loop.Run(); + + ASSERT_EQ(1, test_wallpaper_controller_.get_third_party_wallpaper_count()); +} + TEST_F(WallpaperAshTest, SetWallpaper_InvalidWallpaper) { crosapi::mojom::WallpaperSettingsPtr settings = crosapi::mojom::WallpaperSettings::New();
diff --git a/chrome/browser/ash/dbus/chrome_features_service_provider_unittest.cc b/chrome/browser/ash/dbus/chrome_features_service_provider_unittest.cc index 128e4be..73dde75 100644 --- a/chrome/browser/ash/dbus/chrome_features_service_provider_unittest.cc +++ b/chrome/browser/ash/dbus/chrome_features_service_provider_unittest.cc
@@ -36,7 +36,7 @@ auto feature_list_accessor = feature_list->ConstructAccessor(); const char enabled[] = "CrOSLateBootA"; const char disabled[] = ""; - feature_list->InitializeFromCommandLine(enabled, disabled); + feature_list->InitFromCommandLine(enabled, disabled); base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatureList(std::move(feature_list)); @@ -65,7 +65,7 @@ auto feature_list_accessor = feature_list->ConstructAccessor(); const char enabled[] = "CrOSLateBootA"; const char disabled[] = ""; - feature_list->InitializeFromCommandLine(enabled, disabled); + feature_list->InitFromCommandLine(enabled, disabled); base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatureList(std::move(feature_list)); @@ -95,7 +95,7 @@ auto feature_list_accessor = feature_list->ConstructAccessor(); const char enabled[] = "CrOSLateBootA"; const char disabled[] = ""; - feature_list->InitializeFromCommandLine(enabled, disabled); + feature_list->InitFromCommandLine(enabled, disabled); base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatureList(std::move(feature_list)); @@ -125,7 +125,7 @@ auto feature_list_accessor = feature_list->ConstructAccessor(); const char enabled[] = ""; const char disabled[] = ""; - feature_list->InitializeFromCommandLine(enabled, disabled); + feature_list->InitFromCommandLine(enabled, disabled); base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatureList(std::move(feature_list)); @@ -155,7 +155,7 @@ auto feature_list_accessor = feature_list->ConstructAccessor(); const char enabled[] = "CrOSLateBootA:key1/value1/key2/value2,CrOSLateBootB"; const char disabled[] = "CrOSLateBootC"; - feature_list->InitializeFromCommandLine(enabled, disabled); + feature_list->InitFromCommandLine(enabled, disabled); base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatureList(std::move(feature_list)); @@ -233,7 +233,7 @@ TEST_F(ChromeFeaturesServiceProviderTest, GetFeatureParams_NoInput) { auto feature_list = std::make_unique<base::FeatureList>(); auto feature_list_accessor = feature_list->ConstructAccessor(); - feature_list->InitializeFromCommandLine("", ""); + feature_list->InitFromCommandLine("", ""); base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatureList(std::move(feature_list)); @@ -257,7 +257,7 @@ TEST_F(ChromeFeaturesServiceProviderTest, GetFeatureParams_BadInput) { auto feature_list = std::make_unique<base::FeatureList>(); auto feature_list_accessor = feature_list->ConstructAccessor(); - feature_list->InitializeFromCommandLine("", ""); + feature_list->InitFromCommandLine("", ""); base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatureList(std::move(feature_list)); @@ -283,7 +283,7 @@ TEST_F(ChromeFeaturesServiceProviderTest, GetFeatureParams_BadArrayEntry) { auto feature_list = std::make_unique<base::FeatureList>(); auto feature_list_accessor = feature_list->ConstructAccessor(); - feature_list->InitializeFromCommandLine("", ""); + feature_list->InitFromCommandLine("", ""); base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatureList(std::move(feature_list)); @@ -312,7 +312,7 @@ TEST_F(ChromeFeaturesServiceProviderTest, GetFeatureParams_BadNameFormat) { auto feature_list = std::make_unique<base::FeatureList>(); auto feature_list_accessor = feature_list->ConstructAccessor(); - feature_list->InitializeFromCommandLine("", ""); + feature_list->InitFromCommandLine("", ""); base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitWithFeatureList(std::move(feature_list));
diff --git a/chrome/browser/ash/extensions/extensions_permissions_tracker.cc b/chrome/browser/ash/extensions/extensions_permissions_tracker.cc index 30706019..3d2ee6f 100644 --- a/chrome/browser/ash/extensions/extensions_permissions_tracker.cc +++ b/chrome/browser/ash/extensions/extensions_permissions_tracker.cc
@@ -213,7 +213,7 @@ // it'll be marked safe (true) extension_safety_ratings_.insert(make_pair(extension_id, false)); const Extension* extension = - registry_->GetExtensionById(extension_id, ExtensionRegistry::ENABLED); + registry_->enabled_extensions().GetByID(extension_id); if (extension) ParseExtensionPermissions(extension); else
diff --git a/chrome/browser/ash/file_manager/file_manager_browsertest.cc b/chrome/browser/ash/file_manager/file_manager_browsertest.cc index ba65ba8..dd46ddc 100644 --- a/chrome/browser/ash/file_manager/file_manager_browsertest.cc +++ b/chrome/browser/ash/file_manager/file_manager_browsertest.cc
@@ -855,6 +855,8 @@ TestCase("directoryTreeExpandFolderOnDelayExpansionVolume") .NewDirectoryTree(), TestCase("directoryTreeExpandAndSelectedOnDragMove").NewDirectoryTree(), + TestCase("directoryTreeClickDriveRootWhenMyDriveIsActive") + .NewDirectoryTree(), // Section end - browser tests for new directory tree TestCase("directoryTreeActiveDirectory"), TestCase("directoryTreeSelectedDirectory"), @@ -868,7 +870,8 @@ TestCase("directoryTreeExpandFolderWithHiddenFileAndShowHiddenFilesOn"), TestCase("directoryTreeExpandFolderOnNonDelayExpansionVolume"), TestCase("directoryTreeExpandFolderOnDelayExpansionVolume"), - TestCase("directoryTreeExpandAndSelectedOnDragMove"))); + TestCase("directoryTreeExpandAndSelectedOnDragMove"), + TestCase("directoryTreeClickDriveRootWhenMyDriveIsActive"))); WRAPPED_INSTANTIATE_TEST_SUITE_P( DirectoryTreeContextMenu, /* directory_tree_context_menu.js */
diff --git a/chrome/browser/ash/floating_workspace/floating_workspace_service.cc b/chrome/browser/ash/floating_workspace/floating_workspace_service.cc index eeb79291..9dc7e1c 100644 --- a/chrome/browser/ash/floating_workspace/floating_workspace_service.cc +++ b/chrome/browser/ash/floating_workspace/floating_workspace_service.cc
@@ -462,6 +462,9 @@ std::vector<const ash::DeskTemplate*> FloatingWorkspaceService::GetFloatingWorkspaceTemplateEntries() { std::vector<const ash::DeskTemplate*> entries; + if (!desk_sync_service_ || !desk_sync_service_->GetDeskModel()) { + return entries; + } desks_storage::DeskModel::GetAllEntriesResult result = desk_sync_service_->GetDeskModel()->GetAllEntries(); if (result.status != desks_storage::DeskModel::GetAllEntriesStatus::kOk) { @@ -941,8 +944,6 @@ is_cache_ready_ = AreRequiredAppTypesInitialized(); } -// TODO(b/308682173): Add unittest once refactor is done to allow for testing -// this section. void FloatingWorkspaceService::OnActiveUserSessionChanged( const AccountId& account_id) { VLOG(1) << "Active User session changed for fws";
diff --git a/chrome/browser/ash/floating_workspace/floating_workspace_service.h b/chrome/browser/ash/floating_workspace/floating_workspace_service.h index 08f9b352..b5a7aac 100644 --- a/chrome/browser/ash/floating_workspace/floating_workspace_service.h +++ b/chrome/browser/ash/floating_workspace/floating_workspace_service.h
@@ -93,6 +93,9 @@ void CaptureAndUploadActiveDeskForTest( std::unique_ptr<DeskTemplate> desk_template); + // Get latest Floating Workspace Template from DeskSyncBridge. + const DeskTemplate* GetLatestFloatingWorkspaceTemplate(); + // syncer::SyncServiceObserver overrides: void OnStateChanged(syncer::SyncService* sync) override; void OnSyncShutdown(syncer::SyncService* sync) override; @@ -101,6 +104,9 @@ void Click(const absl::optional<int>& button_index, const absl::optional<std::u16string>& reply) override; + // ash::SessionObserver: + void OnActiveUserSessionChanged(const AccountId& account_id) override; + void MaybeCloseNotification(); std::vector<const ash::DeskTemplate*> GetFloatingWorkspaceTemplateEntries(); @@ -109,9 +115,6 @@ std::unique_ptr<DeskTemplate> previously_captured_desk_template_; private: - // ash::SessionObserver: - void OnActiveUserSessionChanged(const AccountId& account_id) override; - // AppRegistryCache::Observer void OnAppRegistryCacheWillBeDestroyed( apps::AppRegistryCache* cache) override; @@ -149,9 +152,6 @@ // Handles the updating of progress bar notification. void HandleProgressBarStatus(); - // Get latest Floating Workspace Template from DeskSyncBridge. - const DeskTemplate* GetLatestFloatingWorkspaceTemplate(); - // Capture the current active desk task, running every ~30(TBD) seconds. // Upload captured desk to chrome sync and record the randomly generated // UUID key to `floating_workspace_template_uuid_`.
diff --git a/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc b/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc index d308991..02ae5dc9 100644 --- a/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc +++ b/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc
@@ -20,6 +20,7 @@ #include "chrome/browser/ash/floating_workspace/floating_workspace_util.h" #include "chrome/browser/notifications/notification_display_service_tester.h" #include "chrome/browser/prefs/browser_prefs.h" +#include "chrome/browser/profiles/profile_keyed_service_factory.h" #include "chrome/browser/ui/ash/desks/desks_client.h" #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" #include "chrome/test/base/testing_browser_process.h" @@ -56,6 +57,7 @@ constexpr char kRemoteSessionOneName[] = "remote_session_1"; constexpr char kRemoteSession2Name[] = "remote_session_2"; constexpr char kTestAccount[] = "usertest@gmail.com"; +constexpr char kTestAccount2[] = "usertes2@gmail.com"; const base::Time most_recent_time = base::Time::FromSecondsSinceUnixEpoch(15); const base::Time more_recent_time = base::Time::FromSecondsSinceUnixEpoch(10); const base::Time least_recent_time = base::Time::FromSecondsSinceUnixEpoch(5); @@ -194,7 +196,6 @@ : FloatingWorkspaceService(profile, version) { Init(mock_sync_service, fake_desk_sync_service); mock_open_tabs_ = std::make_unique<MockOpenTabsUIDelegate>(); - mock_desks_client_ = std::make_unique<MockDesksClient>(); } void RestoreLocalSessionWindows() override { @@ -219,16 +220,10 @@ mock_open_tabs_->SetForeignSessionsForTesting(foreign_sessions); } - MockDesksClient* GetMockDesksClient() { return mock_desks_client_.get(); } - const DeskTemplate* GetRestoredFloatingWorkspaceTemplate() { return restored_floating_workspace_template_; } - DeskTemplate* GetUploadedFloatingWorkspaceTemplate() { - return uploaded_desk_template_; - } - private: sync_sessions::OpenTabsUIDelegate* GetOpenTabsUIDelegate() override { return mock_open_tabs_.get(); @@ -238,11 +233,6 @@ const DeskTemplate* desk_template) override { restored_floating_workspace_template_ = desk_template; } - void UploadFloatingWorkspaceTemplateToDeskModel( - std::unique_ptr<DeskTemplate> desk_template) override { - uploaded_desk_template_ = desk_template.get(); - previously_captured_desk_template_ = std::move(desk_template); - } // This field is not a raw_ptr<> because it was filtered by the rewriter // for: #addr-of @@ -252,7 +242,6 @@ restored_floating_workspace_template_ = nullptr; raw_ptr<DeskTemplate, ExperimentalAsh> uploaded_desk_template_ = nullptr; std::unique_ptr<MockOpenTabsUIDelegate> mock_open_tabs_; - std::unique_ptr<MockDesksClient> mock_desks_client_; }; class FloatingWorkspaceServiceTest : public testing::Test { @@ -291,6 +280,10 @@ return fake_user_manager_.Get(); } + MockDesksClient* mock_desks_client() { return mock_desks_client_.get(); } + + TestingProfileManager* profile_manager() { return profile_manager_.get(); } + bool HasNotificationFor(const std::string& id) { absl::optional<message_center::Notification> notification = display_service()->GetNotification(id); @@ -321,11 +314,22 @@ task_environment_.RunUntilIdle(); } + void CreateFloatingWorkspaceServiceForTesting(TestingProfile* profile) { + FloatingWorkspaceServiceFactory::GetInstance()->SetTestingFactoryAndUse( + profile, base::BindRepeating([](content::BrowserContext* context) + -> std::unique_ptr<KeyedService> { + return std::make_unique<FloatingWorkspaceService>( + Profile::FromBrowserContext(context), + floating_workspace_util::FloatingWorkspaceVersion:: + kFloatingWorkspaceV2Enabled); + })); + task_environment_.RunUntilIdle(); + } + void SetUp() override { profile_manager_ = std::make_unique<TestingProfileManager>( TestingBrowserProcess::GetGlobal()); ASSERT_TRUE(profile_manager_->SetUp()); - TestingProfile::Builder profile_builder; base::ScopedTempDir temp_dir; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); fake_user_manager_.Reset(std::make_unique<user_manager::FakeUserManager>()); @@ -357,6 +361,7 @@ /*is_child=*/false); apps::AppRegistryCacheWrapper::Get().AddAppRegistryCache(account_id_, cache_.get()); + mock_desks_client_ = std::make_unique<MockDesksClient>(); } private: @@ -374,6 +379,7 @@ std::unique_ptr<TestingProfileManager> profile_manager_; user_manager::TypedScopedUserManager<user_manager::FakeUserManager> fake_user_manager_; + std::unique_ptr<MockDesksClient> mock_desks_client_; }; TEST_F(FloatingWorkspaceServiceTest, RestoreRemoteSession) { @@ -818,8 +824,8 @@ const base::Time creation_time = base::Time::Now(); std::unique_ptr<DeskTemplate> floating_workspace_template = MakeTestFloatingWorkspaceDeskTemplate(template_name, creation_time); - test_floating_workspace_service_v2.GetMockDesksClient() - ->SetCapturedDeskTemplate(std::move(floating_workspace_template)); + mock_desks_client()->SetCapturedDeskTemplate( + std::move(floating_workspace_template)); test_sync_service()->SetDownloadStatusFor( {syncer::ModelType::WORKSPACE_DESK}, syncer::SyncService::ModelTypeDownloadStatus::kUpToDate); @@ -829,10 +835,10 @@ base::Seconds(1)); user_activity_detector()->set_last_activity_time_for_test( base::TimeTicks::Now()); - EXPECT_TRUE(test_floating_workspace_service_v2 - .GetUploadedFloatingWorkspaceTemplate()); + EXPECT_TRUE( + test_floating_workspace_service_v2.GetLatestFloatingWorkspaceTemplate()); EXPECT_EQ( - test_floating_workspace_service_v2.GetUploadedFloatingWorkspaceTemplate() + test_floating_workspace_service_v2.GetLatestFloatingWorkspaceTemplate() ->created_time(), creation_time); scoped_feature_list().Reset(); @@ -856,9 +862,8 @@ std::unique_ptr<DeskTemplate> first_captured_floating_workspace_template = MakeTestFloatingWorkspaceDeskTemplate( template_name, first_captured_template_creation_time); - test_floating_workspace_service_v2.GetMockDesksClient() - ->SetCapturedDeskTemplate( - std::move(first_captured_floating_workspace_template)); + mock_desks_client()->SetCapturedDeskTemplate( + std::move(first_captured_floating_workspace_template)); // Trigger the first capture task. task_environment().FastForwardBy( ash::features::kFloatingWorkspaceV2PeriodicJobIntervalInSeconds.Get() + @@ -871,20 +876,19 @@ template_name, second_captured_template_creation_time); // Set the 2nd template to be captured. - test_floating_workspace_service_v2.GetMockDesksClient() - ->SetCapturedDeskTemplate( - std::move(second_captured_floating_workspace_template)); + mock_desks_client()->SetCapturedDeskTemplate( + std::move(second_captured_floating_workspace_template)); // Fast forward by capture interval capture a second time. task_environment().FastForwardBy( ash::features::kFloatingWorkspaceV2PeriodicJobIntervalInSeconds.Get() + base::Seconds(1)); - EXPECT_TRUE(test_floating_workspace_service_v2 - .GetUploadedFloatingWorkspaceTemplate()); + EXPECT_TRUE( + test_floating_workspace_service_v2.GetLatestFloatingWorkspaceTemplate()); // Second captured template is the same as first, template should not be // updated, creation time is first template's creation time. EXPECT_EQ( - test_floating_workspace_service_v2.GetUploadedFloatingWorkspaceTemplate() + test_floating_workspace_service_v2.GetLatestFloatingWorkspaceTemplate() ->created_time(), first_captured_template_creation_time); scoped_feature_list().Reset(); @@ -909,9 +913,8 @@ std::unique_ptr<DeskTemplate> first_captured_floating_workspace_template = MakeTestFloatingWorkspaceDeskTemplate( template_name, first_captured_template_creation_time); - test_floating_workspace_service_v2.GetMockDesksClient() - ->SetCapturedDeskTemplate( - std::move(first_captured_floating_workspace_template)); + mock_desks_client()->SetCapturedDeskTemplate( + std::move(first_captured_floating_workspace_template)); // Trigger the first capture task. task_environment().FastForwardBy( ash::features::kFloatingWorkspaceV2PeriodicJobIntervalInSeconds.Get() + @@ -929,20 +932,19 @@ second_captured_floating_workspace_template->set_desk_restore_data( std::move(restore_data)); // Set the 2nd template to be captured. - test_floating_workspace_service_v2.GetMockDesksClient() - ->SetCapturedDeskTemplate( - std::move(second_captured_floating_workspace_template)); + mock_desks_client()->SetCapturedDeskTemplate( + std::move(second_captured_floating_workspace_template)); // Fast forward by capture interval capture a second time. task_environment().FastForwardBy( ash::features::kFloatingWorkspaceV2PeriodicJobIntervalInSeconds.Get() + base::Seconds(1)); - EXPECT_TRUE(test_floating_workspace_service_v2 - .GetUploadedFloatingWorkspaceTemplate()); + EXPECT_TRUE( + test_floating_workspace_service_v2.GetLatestFloatingWorkspaceTemplate()); // Second captured template has different restore data than first, template // should be updated, replacing the first one. EXPECT_EQ( - test_floating_workspace_service_v2.GetUploadedFloatingWorkspaceTemplate() + test_floating_workspace_service_v2.GetLatestFloatingWorkspaceTemplate() ->created_time(), second_captured_template_creation_time); scoped_feature_list().Reset(); @@ -1270,17 +1272,16 @@ MakeTestFloatingWorkspaceDeskTemplate(captured_template_name, captured_creation_time); - test_floating_workspace_service_v2.GetMockDesksClient() - ->SetCapturedDeskTemplate( - std::move(captured_floating_workspace_template)); + mock_desks_client()->SetCapturedDeskTemplate( + std::move(captured_floating_workspace_template)); task_environment().FastForwardBy( ash::features::kFloatingWorkspaceV2PeriodicJobIntervalInSeconds.Get() + base::Seconds(1)); - EXPECT_TRUE(test_floating_workspace_service_v2 - .GetUploadedFloatingWorkspaceTemplate()); + EXPECT_TRUE( + test_floating_workspace_service_v2.GetLatestFloatingWorkspaceTemplate()); EXPECT_EQ( - test_floating_workspace_service_v2.GetUploadedFloatingWorkspaceTemplate() + test_floating_workspace_service_v2.GetLatestFloatingWorkspaceTemplate() ->created_time(), captured_creation_time); @@ -1380,16 +1381,15 @@ std::unique_ptr<DeskTemplate> first_captured_floating_workspace_template = MakeTestFloatingWorkspaceDeskTemplate( template_name, first_captured_template_creation_time); - test_floating_workspace_service_v2.GetMockDesksClient() - ->SetCapturedDeskTemplate( - std::move(first_captured_floating_workspace_template)); + mock_desks_client()->SetCapturedDeskTemplate( + std::move(first_captured_floating_workspace_template)); // Trigger the first capture task. task_environment().FastForwardBy( ash::features::kFloatingWorkspaceV2PeriodicJobIntervalInSeconds.Get() + base::Seconds(1)); - EXPECT_FALSE(test_floating_workspace_service_v2 - .GetUploadedFloatingWorkspaceTemplate()); + EXPECT_FALSE( + test_floating_workspace_service_v2.GetLatestFloatingWorkspaceTemplate()); scoped_feature_list().Reset(); } @@ -1431,4 +1431,139 @@ scoped_feature_list().Reset(); } +class FloatingWorkspaceServiceMultiUserTest + : public FloatingWorkspaceServiceTest { + protected: + FloatingWorkspaceServiceMultiUserTest() = default; + ~FloatingWorkspaceServiceMultiUserTest() override { profile2_ = nullptr; } + + TestingProfile* profile2() { return profile2_.get(); } + AccountId account_id2() { return account_id2_; } + desks_storage::FakeDeskSyncService* fake_desk_sync_service2() { + return fake_desk_sync_service2_.get(); + } + + syncer::TestSyncService* test_sync_service2() { + return test_sync_service2_.get(); + } + apps::AppRegistryCache* cache2() { return cache2_.get(); } + + void PopulateAppsCache2() { + desks_storage::desk_test_util::PopulateFloatingWorkspaceAppRegistryCache( + account_id2_, cache2_.get()); + task_environment().RunUntilIdle(); + } + + void SetUp() override { + FloatingWorkspaceServiceTest::SetUp(); + EXPECT_TRUE(temp_dir2_.CreateUniqueTempDir()); + auto prefs = + std::make_unique<sync_preferences::TestingPrefServiceSyncable>(); + RegisterUserProfilePrefs(prefs->registry()); + profile2_ = profile_manager()->CreateTestingProfile( + kTestAccount2, std::move(prefs), std::u16string(), /*avatar_id=*/0, + TestingProfile::TestingFactories()); + + account_id2_ = AccountId::FromUserEmail(kTestAccount2); + const std::string username_hash2 = + user_manager::FakeUserManager::GetFakeUsernameHash(account_id2_); + fake_user_manager()->AddUser(account_id2_); + fake_user_manager()->UserLoggedIn(account_id2_, username_hash2, + /*browser_restart=*/false, + /*is_child=*/false); + + display_service2_ = + std::make_unique<NotificationDisplayServiceTester>(profile2_.get()); + fake_desk_sync_service2_ = + std::make_unique<desks_storage::FakeDeskSyncService>( + /*skip_engine_connection=*/true); + test_sync_service2_ = std::make_unique<syncer::TestSyncService>(); + cache2_ = std::make_unique<apps::AppRegistryCache>(); + } + + void TearDown() override { FloatingWorkspaceServiceTest::TearDown(); } + + private: + raw_ptr<TestingProfile, ExperimentalAsh> profile2_ = nullptr; + base::ScopedTempDir temp_dir2_; + AccountId account_id2_; + std::unique_ptr<NotificationDisplayServiceTester> display_service2_; + std::unique_ptr<syncer::TestSyncService> test_sync_service2_; + std::unique_ptr<desks_storage::FakeDeskSyncService> fake_desk_sync_service2_; + std::unique_ptr<apps::AppRegistryCache> cache2_; +}; + +TEST_F(FloatingWorkspaceServiceMultiUserTest, TwoUserLoggedInAndCaptureStops) { + scoped_feature_list().InitWithFeatures( + {features::kFloatingWorkspaceV2, features::kDeskTemplateSync}, {}); + PopulateAppsCache(); + PopulateAppsCache2(); + fake_user_manager()->SwitchActiveUser(account_id()); + CreateFloatingWorkspaceServiceForTesting(profile2()); + task_environment().RunUntilIdle(); + TestFloatingWorkSpaceService test_floating_workspace_service_v2( + profile(), fake_desk_sync_service(), test_sync_service(), + floating_workspace_util::FloatingWorkspaceVersion:: + kFloatingWorkspaceV2Enabled); + const std::string template_name = "floating_workspace_captured_template"; + const base::Time creation_time = base::Time::Now(); + std::unique_ptr<DeskTemplate> floating_workspace_template = + MakeTestFloatingWorkspaceDeskTemplate(template_name, creation_time); + mock_desks_client()->SetCapturedDeskTemplate( + std::move(floating_workspace_template)); + fake_user_manager()->SwitchActiveUser(account_id2()); + + test_floating_workspace_service_v2.OnActiveUserSessionChanged(account_id2()); + task_environment().FastForwardBy( + ash::features::kFloatingWorkspaceV2PeriodicJobIntervalInSeconds.Get() + + base::Seconds(1)); + user_activity_detector()->set_last_activity_time_for_test( + base::TimeTicks::Now()); + EXPECT_FALSE( + test_floating_workspace_service_v2.GetLatestFloatingWorkspaceTemplate()); + scoped_feature_list().Reset(); +} + +TEST_F(FloatingWorkspaceServiceMultiUserTest, + TwoUserLoggedInAndUploadsToCorrectAccount) { + scoped_feature_list().InitWithFeatures( + {features::kFloatingWorkspaceV2, features::kDeskTemplateSync}, {}); + PopulateAppsCache(); + PopulateAppsCache2(); + fake_user_manager()->SwitchActiveUser(account_id()); + TestFloatingWorkSpaceService test_floating_workspace_service_v2( + profile(), fake_desk_sync_service(), test_sync_service(), + floating_workspace_util::FloatingWorkspaceVersion:: + kFloatingWorkspaceV2Enabled); + TestFloatingWorkSpaceService test_floating_workspace_service2_v2( + profile2(), fake_desk_sync_service2(), test_sync_service2(), + floating_workspace_util::FloatingWorkspaceVersion:: + kFloatingWorkspaceV2Enabled); + test_sync_service()->SetDownloadStatusFor( + {syncer::ModelType::WORKSPACE_DESK}, + syncer::SyncService::ModelTypeDownloadStatus::kUpToDate); + test_sync_service()->FireStateChanged(); + test_sync_service2()->SetDownloadStatusFor( + {syncer::ModelType::WORKSPACE_DESK}, + syncer::SyncService::ModelTypeDownloadStatus::kUpToDate); + test_sync_service2()->FireStateChanged(); + + const std::string template_name = "floating_workspace_captured_template"; + const base::Time creation_time = base::Time::Now(); + std::unique_ptr<DeskTemplate> floating_workspace_template = + MakeTestFloatingWorkspaceDeskTemplate(template_name, creation_time); + mock_desks_client()->SetCapturedDeskTemplate( + std::move(floating_workspace_template)); + task_environment().FastForwardBy( + ash::features::kFloatingWorkspaceV2PeriodicJobIntervalInSeconds.Get() + + base::Seconds(1)); + user_activity_detector()->set_last_activity_time_for_test( + base::TimeTicks::Now()); + EXPECT_TRUE( + test_floating_workspace_service_v2.GetLatestFloatingWorkspaceTemplate()); + EXPECT_FALSE( + test_floating_workspace_service2_v2.GetLatestFloatingWorkspaceTemplate()); + scoped_feature_list().Reset(); +} + } // namespace ash::floating_workspace
diff --git a/chrome/browser/ash/geolocation/BUILD.gn b/chrome/browser/ash/geolocation/BUILD.gn new file mode 100644 index 0000000..2ec9a7b --- /dev/null +++ b/chrome/browser/ash/geolocation/BUILD.gn
@@ -0,0 +1,21 @@ +# Copyright 2023 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chromeos/ui_mode.gni") + +assert(is_chromeos_ash) + +source_set("browser_tests") { + testonly = true + + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + + sources = [ "system_geolocation_source_browsertest.cc" ] + + deps = [ + "//base", + "//chrome/browser/ash", + "//chrome/test:test_support", + ] +}
diff --git a/chrome/browser/ash/geolocation/system_geolocation_source_browsertest.cc b/chrome/browser/ash/geolocation/system_geolocation_source_browsertest.cc new file mode 100644 index 0000000..073d732 --- /dev/null +++ b/chrome/browser/ash/geolocation/system_geolocation_source_browsertest.cc
@@ -0,0 +1,162 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <utility> + +#include "ash/constants/ash_pref_names.h" +#include "ash/constants/geolocation_access_level.h" +#include "ash/session/session_controller_impl.h" +#include "ash/shell.h" +#include "ash/system/privacy_hub/privacy_hub_controller.h" +#include "ash/test/ash_test_base.h" +#include "base/test/bind.h" +#include "base/test/scoped_feature_list.h" +#include "base/test/test_future.h" +#include "chrome/browser/ash/geolocation/system_geolocation_source.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "components/prefs/pref_service.h" +#include "content/public/test/browser_test.h" +#include "services/device/public/cpp/geolocation/geolocation_manager.h" +#include "services/device/public/cpp/geolocation/location_system_permission_status.h" + +namespace { +class Observer : public device::GeolocationManager::PermissionObserver { + public: + // device::GeolocationManager::PermissionObserver: + void OnSystemPermissionUpdated( + device::LocationSystemPermissionStatus status) override { + status_.GetRepeatingCallback().Run(std::move(status)); + } + base::test::TestFuture<device::LocationSystemPermissionStatus> status_; +}; +} // namespace + +namespace ash { + +class SystemGeolocationSourceBrowserTests : public InProcessBrowserTest { + protected: + SystemGeolocationSourceBrowserTests() : InProcessBrowserTest() {} + + // InProcessBrowserTest: + void SetUp() override { InProcessBrowserTest::SetUp(); } + + void SetUserPref(GeolocationAccessLevel access_level) { + Shell::Get()->session_controller()->GetActivePrefService()->SetInteger( + prefs::kUserGeolocationAccessLevel, static_cast<int>(access_level)); + } + + GeolocationAccessLevel GetUserPref() { + return static_cast<GeolocationAccessLevel>( + Shell::Get()->session_controller()->GetActivePrefService()->GetInteger( + prefs::kUserGeolocationAccessLevel)); + } + + protected: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +class SystemGeolocationSourceTestsGeolocationOn + : public SystemGeolocationSourceBrowserTests { + protected: + SystemGeolocationSourceTestsGeolocationOn() { + scoped_feature_list_.InitWithFeatures( + {features::kCrosPrivacyHubV0, features::kCrosPrivacyHub}, {}); + } +}; + +class SystemGeolocationSourceTestsGeolocationOff + : public SystemGeolocationSourceBrowserTests { + protected: + SystemGeolocationSourceTestsGeolocationOff() { + // Disables the geolocation part of the PrivacyHub + scoped_feature_list_.InitWithFeatures({ash::features::kCrosPrivacyHubV0}, + {ash::features::kCrosPrivacyHub}); + } +}; + +IN_PROC_BROWSER_TEST_F(SystemGeolocationSourceTestsGeolocationOn, + ObservationInBrowser) { + device::GeolocationManager* manager = + device::GeolocationManager::GetInstance(); + ASSERT_TRUE(manager); + + Observer observer; + manager->AddObserver(&observer); + + // Initial value should be to allow. + EXPECT_EQ(GetUserPref(), ash::GeolocationAccessLevel::kAllowed); + EXPECT_EQ(device::LocationSystemPermissionStatus::kAllowed, + manager->GetSystemPermission()); + + // Change the pref value + SetUserPref(ash::GeolocationAccessLevel::kDisallowed); + // Check that the change in pref was registered. + EXPECT_EQ(device::LocationSystemPermissionStatus::kDenied, + manager->GetSystemPermission()); + EXPECT_EQ(device::LocationSystemPermissionStatus::kDenied, + observer.status_.Take()); + + // Change the pref value + SetUserPref(ash::GeolocationAccessLevel::kAllowed); + // Check that the change in pref was registered. + EXPECT_EQ(device::LocationSystemPermissionStatus::kAllowed, + manager->GetSystemPermission()); + EXPECT_EQ(device::LocationSystemPermissionStatus::kAllowed, + observer.status_.Take()); + + // Change the pref value + SetUserPref(ash::GeolocationAccessLevel::kOnlyAllowedForSystem); + // Check that the change in pref was registered. + EXPECT_EQ(device::LocationSystemPermissionStatus::kDenied, + manager->GetSystemPermission()); + EXPECT_EQ(device::LocationSystemPermissionStatus::kDenied, + observer.status_.Take()); + + // Observer needs to be removed here because it is allocated on stack. + manager->RemoveObserver(&observer); +} + +IN_PROC_BROWSER_TEST_F(SystemGeolocationSourceTestsGeolocationOff, + ObservationInBrowser) { + device::GeolocationManager* manager = + device::GeolocationManager::GetInstance(); + ASSERT_TRUE(manager); + + Observer observer; + manager->AddObserver(&observer); + + // Initial value should be to allow. + EXPECT_EQ(GetUserPref(), ash::GeolocationAccessLevel::kAllowed); + EXPECT_EQ(device::LocationSystemPermissionStatus::kAllowed, + manager->GetSystemPermission()); + + // Change the pref value + SetUserPref(ash::GeolocationAccessLevel::kDisallowed); + // Check that the permission is not changed. + EXPECT_EQ(device::LocationSystemPermissionStatus::kAllowed, + manager->GetSystemPermission()); + EXPECT_EQ(device::LocationSystemPermissionStatus::kAllowed, + observer.status_.Take()); + + // Change the pref value + SetUserPref(ash::GeolocationAccessLevel::kAllowed); + // Check that the change in pref was registered. + EXPECT_EQ(device::LocationSystemPermissionStatus::kAllowed, + manager->GetSystemPermission()); + EXPECT_EQ(device::LocationSystemPermissionStatus::kAllowed, + observer.status_.Take()); + + // Change the pref value + SetUserPref(ash::GeolocationAccessLevel::kOnlyAllowedForSystem); + // Check that the change in pref was registered. + EXPECT_EQ(device::LocationSystemPermissionStatus::kAllowed, + manager->GetSystemPermission()); + EXPECT_EQ(device::LocationSystemPermissionStatus::kAllowed, + observer.status_.Take()); + + // Observer needs to be removed here because it is allocated on stack. + manager->RemoveObserver(&observer); +} + +} // namespace ash
diff --git a/chrome/browser/ash/login/debug_overlay_browsertest.cc b/chrome/browser/ash/login/debug_overlay_browsertest.cc index 0712c67d..2ca39f9 100644 --- a/chrome/browser/ash/login/debug_overlay_browsertest.cc +++ b/chrome/browser/ash/login/debug_overlay_browsertest.cc
@@ -21,7 +21,7 @@ constexpr char kDebugOverlay[] = "debuggerOverlay"; constexpr char kScreensPanel[] = "DebuggerPanelScreens"; -constexpr int kCommonScreensCount = 44; +constexpr int kCommonScreensCount = 45; constexpr int kOobeOnlyScreensCount = 11; constexpr int kLoginOnlyScreensCount = 7;
diff --git a/chrome/browser/ash/login/screens/consolidated_consent_screen_browsertest.cc b/chrome/browser/ash/login/screens/consolidated_consent_screen_browsertest.cc index 0c04f46..3fbb796 100644 --- a/chrome/browser/ash/login/screens/consolidated_consent_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/consolidated_consent_screen_browsertest.cc
@@ -8,6 +8,7 @@ #include "ash/constants/ash_switches.h" #include "base/hash/sha1.h" #include "base/test/metrics/histogram_tester.h" +#include "base/test/test_future.h" #include "chrome/browser/ash/arc/session/arc_service_launcher.h" #include "chrome/browser/ash/login/login_pref_names.h" #include "chrome/browser/ash/login/oobe_screen.h" @@ -219,20 +220,17 @@ original_callback_ = screen->get_exit_callback_for_testing(); screen->set_exit_callback_for_testing( - base::BindRepeating(&ConsolidatedConsentScreenTest::HandleScreenExit, - base::Unretained(this))); + screen_result_waiter_.GetRepeatingCallback()); OobeBaseTest::SetUpOnMainThread(); } void LoginAsRegularUser() { login_manager_mixin_.LoginAsNewRegularUser(); } - void WaitForScreenExit() { - if (screen_exited_) - return; - base::RunLoop run_loop; - screen_exit_callback_ = run_loop.QuitClosure(); - run_loop.Run(); + ConsolidatedConsentScreen::Result WaitForScreenExitResult() { + auto result = screen_result_waiter_.Take(); + original_callback_.Run(result); + return result; } absl::optional<ConsolidatedConsentScreen::Result> screen_result_; @@ -244,17 +242,8 @@ } protected: - void HandleScreenExit(ConsolidatedConsentScreen::Result result) { - ASSERT_FALSE(screen_exited_); - screen_exited_ = true; - screen_result_ = result; - original_callback_.Run(result); - if (screen_exit_callback_) - std::move(screen_exit_callback_).Run(); - } - - bool screen_exited_ = false; - base::RepeatingClosure screen_exit_callback_; + base::test::TestFuture<ConsolidatedConsentScreen::Result> + screen_result_waiter_; ConsolidatedConsentScreen::ScreenExitCallback original_callback_; base::test::ScopedFeatureList feature_list_; LoginManagerMixin login_manager_mixin_{&mixin_host_}; @@ -333,8 +322,7 @@ test::OobeJS().CreateVisibilityWaiter(true, kAcceptButton)->Wait(); test::OobeJS().ClickOnPath(kAcceptButton); - WaitForScreenExit(); - EXPECT_EQ(screen_result_.value(), + EXPECT_EQ(WaitForScreenExitResult(), ConsolidatedConsentScreen::Result::ACCEPTED); histogram_tester_.ExpectTotalCount( @@ -583,8 +571,8 @@ AdvanceNextScreenWithExpectations(play_consent, backup_and_restore_consent, location_service_consent); - WaitForScreenExit(); - EXPECT_EQ(screen_result_, ConsolidatedConsentScreen::Result::ACCEPTED); + EXPECT_EQ(WaitForScreenExitResult(), + ConsolidatedConsentScreen::Result::ACCEPTED); histogram_tester_.ExpectTotalCount(kGoogleEulaWebviewFirstLoadResult, 1); histogram_tester_.ExpectTotalCount(kCrosEulaWebviewFirstLoadResult, 1); @@ -723,8 +711,7 @@ IN_PROC_BROWSER_TEST_F(ConsolidatedConsentScreenManagedDeviceTest, DISABLED_Skip) { LoginAsRegularUser(); - WaitForScreenExit(); - EXPECT_EQ(screen_result_.value(), + EXPECT_EQ(WaitForScreenExitResult(), ConsolidatedConsentScreen::Result::NOT_APPLICABLE); }
diff --git a/chrome/browser/ash/login/screens/osauth/enter_old_password_screen.cc b/chrome/browser/ash/login/screens/osauth/enter_old_password_screen.cc new file mode 100644 index 0000000..4a15653 --- /dev/null +++ b/chrome/browser/ash/login/screens/osauth/enter_old_password_screen.cc
@@ -0,0 +1,110 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ash/login/screens/osauth/enter_old_password_screen.h" + +#include "base/logging.h" +#include "chrome/browser/ash/login/wizard_context.h" +#include "chrome/browser/ui/webui/ash/login/enter_old_password_screen_handler.h" +#include "chromeos/ash/components/cryptohome/error_util.h" +#include "chromeos/ash/components/dbus/session_manager/session_manager_client.h" +#include "chromeos/ash/components/dbus/userdataauth/userdataauth_client.h" +#include "chromeos/ash/components/login/auth/auth_performer.h" +#include "chromeos/ash/components/login/auth/public/user_context.h" +#include "chromeos/ash/components/osauth/public/auth_session_storage.h" +#include "chromeos/ash/components/osauth/public/common_types.h" +#include "components/device_event_log/device_event_log.h" +#include "components/user_manager/user_manager.h" + +namespace ash { +namespace { + +constexpr const char kUserActionForgotOldPassword[] = "forgot"; +constexpr const char kUserActionSubmitOldPassword[] = "submit"; + +} // namespace + +// static +std::string EnterOldPasswordScreen::GetResultString(Result result) { + switch (result) { + case Result::kForgotOldPassword: + return "ForgotOldPassword"; + case Result::kCryptohomeError: + return "CryptohomeError"; + case Result::kAuthenticated: + return "Authenticated"; + case Result::kNotApplicable: + return BaseScreen::kNotApplicable; + } +} + +EnterOldPasswordScreen::EnterOldPasswordScreen( + base::WeakPtr<EnterOldPasswordScreenView> view, + const ScreenExitCallback& exit_callback) + : BaseOSAuthSetupScreen(EnterOldPasswordScreenView::kScreenId, + OobeScreenPriority::DEFAULT), + view_(std::move(view)), + exit_callback_(exit_callback), + auth_performer_( + std::make_unique<AuthPerformer>(UserDataAuthClient::Get())) {} + +EnterOldPasswordScreen::~EnterOldPasswordScreen() = default; + +void EnterOldPasswordScreen::ShowImpl() { + view_->Show(); +} + +void EnterOldPasswordScreen::OnUserAction(const base::Value::List& args) { + const std::string& action_id = args[0].GetString(); + if (action_id == kUserActionForgotOldPassword) { + exit_callback_.Run(Result::kForgotOldPassword); + return; + } + + if (action_id == kUserActionSubmitOldPassword) { + const std::string& old_password = args[1].GetString(); + AttemptAuthentication(old_password); + return; + } + + BaseOSAuthSetupScreen::OnUserAction(args); +} + +void EnterOldPasswordScreen::AttemptAuthentication( + const std::string& old_password) { + DCHECK(!context()->user_context->GetAuthSessionId().empty()); + auto* factor = + context()->user_context->GetAuthFactorsConfiguration().FindFactorByType( + cryptohome::AuthFactorType::kPassword); + DCHECK(factor); + auth_performer_->AuthenticateWithPassword( + factor->ref().label().value(), old_password, + std::move(context()->user_context), + base::BindOnce(&EnterOldPasswordScreen::OnPasswordAuthentication, + weak_factory_.GetWeakPtr())); +} + +void EnterOldPasswordScreen::OnPasswordAuthentication( + std::unique_ptr<UserContext> user_context, + absl::optional<AuthenticationError> error) { + if (error.has_value()) { + if (cryptohome::ErrorMatches( + error->get_cryptohome_code(), + user_data_auth::CRYPTOHOME_ERROR_AUTHORIZATION_KEY_FAILED)) { + context()->user_context = std::move(user_context); + view_->ShowWrongPasswordError(); + return; + } + exit_callback_.Run(Result::kCryptohomeError); + return; + } + + AuthProofToken token = + AuthSessionStorage::Get()->Store(std::move(user_context)); + context()->extra_factors_token.emplace(token); + + exit_callback_.Run(Result::kAuthenticated); +} + +} // namespace ash
diff --git a/chrome/browser/ash/login/screens/osauth/enter_old_password_screen.h b/chrome/browser/ash/login/screens/osauth/enter_old_password_screen.h new file mode 100644 index 0000000..62ace90c --- /dev/null +++ b/chrome/browser/ash/login/screens/osauth/enter_old_password_screen.h
@@ -0,0 +1,68 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ASH_LOGIN_SCREENS_OSAUTH_ENTER_OLD_PASSWORD_SCREEN_H_ +#define CHROME_BROWSER_ASH_LOGIN_SCREENS_OSAUTH_ENTER_OLD_PASSWORD_SCREEN_H_ + +#include <string> + +#include "base/functional/callback.h" +#include "base/memory/weak_ptr.h" +#include "base/values.h" +#include "chrome/browser/ash/login/screens/osauth/base_osauth_setup_screen.h" +#include "chromeos/ash/components/login/auth/auth_performer.h" +#include "chromeos/ash/components/login/auth/mount_performer.h" +#include "chromeos/ash/services/auth_factor_config/public/mojom/auth_factor_config.mojom-shared.h" + +namespace ash { + +class EnterOldPasswordScreenView; + +class EnterOldPasswordScreen : public BaseOSAuthSetupScreen { + public: + using TView = EnterOldPasswordScreenView; + + enum class Result { + kForgotOldPassword, + kCryptohomeError, + kAuthenticated, + kNotApplicable, + }; + + static std::string GetResultString(Result result); + + using ScreenExitCallback = base::RepeatingCallback<void(Result result)>; + + EnterOldPasswordScreen(base::WeakPtr<EnterOldPasswordScreenView> view, + const ScreenExitCallback& exit_callback); + + EnterOldPasswordScreen(const EnterOldPasswordScreen&) = delete; + EnterOldPasswordScreen& operator=(const EnterOldPasswordScreen&) = delete; + + ~EnterOldPasswordScreen() override; + + private: + // BaseScreen: + void ShowImpl() override; + void OnUserAction(const base::Value::List& args) override; + + void OnRemovedUserDirectory(std::unique_ptr<UserContext> user_context, + absl::optional<AuthenticationError> error); + + void AttemptAuthentication(const std::string& old_password); + void OnPasswordAuthentication(std::unique_ptr<UserContext> user_context, + absl::optional<AuthenticationError> error); + + base::WeakPtr<EnterOldPasswordScreenView> view_; + + ScreenExitCallback exit_callback_; + + std::unique_ptr<AuthPerformer> auth_performer_; + + base::WeakPtrFactory<EnterOldPasswordScreen> weak_factory_{this}; +}; + +} // namespace ash + +#endif // CHROME_BROWSER_ASH_LOGIN_SCREENS_OSAUTH_ENTER_OLD_PASSWORD_SCREEN_H_
diff --git a/chrome/browser/ash/login/wizard_controller.cc b/chrome/browser/ash/login/wizard_controller.cc index 66054832..1d5beddf 100644 --- a/chrome/browser/ash/login/wizard_controller.cc +++ b/chrome/browser/ash/login/wizard_controller.cc
@@ -94,6 +94,7 @@ #include "chrome/browser/ash/login/screens/osauth/apply_online_password_screen.h" #include "chrome/browser/ash/login/screens/osauth/cryptohome_recovery_screen.h" #include "chrome/browser/ash/login/screens/osauth/cryptohome_recovery_setup_screen.h" +#include "chrome/browser/ash/login/screens/osauth/enter_old_password_screen.h" #include "chrome/browser/ash/login/screens/osauth/factor_setup_success_screen.h" #include "chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen.h" #include "chrome/browser/ash/login/screens/osauth/gaia_password_changed_screen_legacy.h" @@ -163,6 +164,7 @@ #include "chrome/browser/ui/webui/ash/login/enable_debugging_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/encryption_migration_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/enrollment_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/enter_old_password_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/family_link_notice_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/fingerprint_setup_screen_handler.h" @@ -932,6 +934,10 @@ oobe_ui->GetView<LocalDataLossWarningScreenHandler>()->AsWeakPtr(), base::DoNothing())); + append(std::make_unique<EnterOldPasswordScreen>( + oobe_ui->GetView<EnterOldPasswordScreenHandler>()->AsWeakPtr(), + base::DoNothing())); + append(std::make_unique<OSAuthErrorScreen>( oobe_ui->GetView<OSAuthErrorScreenHandler>()->AsWeakPtr(), base::BindRepeating(&WizardController::OnOSAuthErrorScreenExit,
diff --git a/chrome/browser/ash/net/network_portal_detector_impl.cc b/chrome/browser/ash/net/network_portal_detector_impl.cc index c46a801..c63cc5a 100644 --- a/chrome/browser/ash/net/network_portal_detector_impl.cc +++ b/chrome/browser/ash/net/network_portal_detector_impl.cc
@@ -240,7 +240,7 @@ if (!IsEnabled()) return; - if (is_idle()) { + if (!is_idle()) { NET_LOG(EVENT) << "ScheduleAttempt(): Attempt already running, restarting."; }
diff --git a/chrome/browser/ash/policy/dlp/dialogs/files_policy_error_dialog.cc b/chrome/browser/ash/policy/dlp/dialogs/files_policy_error_dialog.cc index bc0c7da..d8e082b2 100644 --- a/chrome/browser/ash/policy/dlp/dialogs/files_policy_error_dialog.cc +++ b/chrome/browser/ash/policy/dlp/dialogs/files_policy_error_dialog.cc
@@ -19,6 +19,8 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/layout/box_layout.h" +#include "ui/views/layout/flex_layout.h" +#include "ui/views/view_class_properties.h" namespace policy { namespace { @@ -124,7 +126,12 @@ // Single error dialog. if (sections_.size() == 1) { - for (const auto& file : sections_.front().files) { + const auto& section = sections_.front(); + for (const auto& url : section.learn_more_urls) { + files_dialog_utils::AddLearnMoreLink( + l10n_util::GetStringUTF16(IDS_LEARN_MORE), url, upper_panel_); + } + for (const auto& file : section.files) { AddConfidentialRow(file.icon, file.title); } return; @@ -237,9 +244,14 @@ DCHECK(scroll_view_container_); views::View* row = scroll_view_container_->AddChildView(std::make_unique<views::View>()); - row->SetLayoutManager(std::make_unique<views::BoxLayout>( - views::BoxLayout::Orientation::kHorizontal, - gfx::Insets::TLBR(10, 16, 10, 16), 0)); + + // Place title_label below into a FlexLayout which handles multi-line labels + // properly. + auto layout_manager = std::make_unique<views::FlexLayout>(); + layout_manager + ->SetDefault(views::kMarginsKey, gfx::Insets::TLBR(10, 16, 10, 16)) + .SetOrientation(views::LayoutOrientation::kVertical); + row->SetLayoutManager(std::move(layout_manager)); views::Label* title_label = AddRowTitle(section.message, row); title_label->SetID(section.view_id);
diff --git a/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_reported_local_id_manager.cc b/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_reported_local_id_manager.cc index eae85fa..1850a5ac 100644 --- a/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_reported_local_id_manager.cc +++ b/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_reported_local_id_manager.cc
@@ -216,14 +216,17 @@ csv_content << local_id << ',' << capture_timestamp_us << '\n'; } - // TODO(b/266018440): Find a way to cancel all tasks on io_task_runner_ that - // has not been executed yet, as later save file writing tasks will always - // override the results of earlier ones. io_task_runner_->PostTask( FROM_HERE, base::BindOnce( [](base::FilePath save_file, base::FilePath save_file_tmp, - std::string content) { + std::string content, uint64_t cur_save_file_writing_task_id, + const std::atomic<uint64_t>* latest_save_file_writing_task_id) { + if (cur_save_file_writing_task_id < + latest_save_file_writing_task_id->load()) { + // Another file writing task has been posted. Skip this one. + return; + } // Write to the temp save file first, then rename it to the official // save file. This would prevent partly written file to be // effective, as renaming within the same partition is atomic on @@ -240,7 +243,15 @@ } // Successfully written the save file. }, - save_file_, save_file_tmp_, std::move(csv_content).str())); + save_file_, save_file_tmp_, std::move(csv_content).str(), + latest_save_file_writing_task_id_->load() + 1u, + latest_save_file_writing_task_id_.get())); + + // Increase the latest task ID only after the latest task has been posted, not + // before. Otherwise, in a rare case that this thread hangs after the latest + // task ID has increased, the IO thread would prematurely skip all file + // writing tasks. + latest_save_file_writing_task_id_->fetch_add(1u); } void FatalCrashEventsObserver::ReportedLocalIdManager::
diff --git a/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_reported_local_id_manager.h b/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_reported_local_id_manager.h index 12841b8..605706a5 100644 --- a/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_reported_local_id_manager.h +++ b/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_reported_local_id_manager.h
@@ -184,6 +184,17 @@ // The task runner that performs IO. const scoped_refptr<base::SequencedTaskRunner> io_task_runner_; + // The counter that keeps track of the number of IO tasks posted. This is + // mostly used to avoid duplicate IO tasks, i.e., a later save file writing + // task is posted and there's no need to executing an earlier file writing + // task that has not started. It is always deleted on the IO thread so that + // when an instance of this class is destroyed, this counter remains + // accessible for all tasks posted to the IO thread. + const std::unique_ptr<std::atomic<uint64_t>, base::OnTaskRunnerDeleter> + latest_save_file_writing_task_id_{ + new std::atomic<uint64_t>(0u), + base::OnTaskRunnerDeleter(io_task_runner_)}; + base::WeakPtrFactory<ReportedLocalIdManager> weak_factory_{this}; };
diff --git a/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_unittest.cc b/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_unittest.cc index f0a4b188..432f4c0 100644 --- a/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_unittest.cc +++ b/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_unittest.cc
@@ -48,8 +48,12 @@ using ::ash::cros_healthd::mojom::CrashUploadInfo; using ::ash::cros_healthd::mojom::EventCategoryEnum; using ::ash::cros_healthd::mojom::EventInfo; +using ::testing::AllOf; using ::testing::Eq; +using ::testing::Field; +using ::testing::FieldsAre; using ::testing::SizeIs; +using ::testing::StrEq; namespace { // RAII class to interrupt after event is observed. @@ -1068,6 +1072,56 @@ 2u); } +TEST_F(FatalCrashEventsObserverReportedLocalIdsTest, + SlowFileWritingSaveFileWritten) { + static constexpr uint64_t kNumOfEvents = 3u; + const auto kMaxLocalId = base::NumberToString(kNumOfEvents - 1); + + const auto io_task_runner = base::ThreadPool::CreateSequencedTaskRunner( + {base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()}); + + // Create and set up the observer object. + auto observer = fatal_crash_test_environment_.CreateFatalCrashEventsObserver( + /*reported_local_id_io_task_runner=*/io_task_runner, + /*uploaded_crash_info_io_task_runner=*/nullptr); + observer->SetReportingEnabled(true); + + // Make sure file loading IO has finished. + FatalCrashEventsObserver::TestEnvironment::FlushIoTasks(*observer); + + // Block the IO thread to simulate slow file writing. + FatalCrashEventsObserver::TestEnvironment::SequenceBlocker sequence_blocker( + io_task_runner); + + // Create a few events. + for (uint64_t i = 0u; i < kNumOfEvents; ++i) { + auto crash_event_info = NewCrashEventInfo(/*is_uploaded=*/false); + crash_event_info->local_id = base::NumberToString(i); + + FakeCrosHealthd::Get()->EmitEventForCategory( + EventCategoryEnum::kCrash, + EventInfo::NewCrashEventInfo(std::move(crash_event_info))); + } + + // Flush current thread so that all file writing IO tasks are posted. + base::RunLoop().RunUntilIdle(); + + // Release the IO thread and flush IO (done when recreating the fatal crash + // events observer). + sequence_blocker.Unblock(); + RecreateAndEnableFatalCrashEventsObserver(observer); + + // Events with duplicate local IDs are skipped, because the save file is + // correctly written. + EXPECT_THAT( + WaitForSkippedFatalCrashEvent(kMaxLocalId, kCaptureTime, *observer), + AllOf(Field(&FatalCrashEventsObserver::LocalIdEntry::local_id, + StrEq(kMaxLocalId)), + Field(&FatalCrashEventsObserver::LocalIdEntry::capture_timestamp_us, + Eq(FatalCrashEventsObserver::ConvertTimeToMicroseconds( + kCaptureTime))))); +} + INSTANTIATE_TEST_SUITE_P( FatalCrashEventsObserverReportedLocalIdsTests, FatalCrashEventsObserverReportedLocalIdsTest, @@ -1455,6 +1509,58 @@ } } +TEST_F(FatalCrashEventsObserverUploadedCrashTest, + SlowFileWritingSaveFileWritten) { + static constexpr uint64_t kNumOfEvents = 3u; + static constexpr auto kCreationTime = base::Time::UnixEpoch(); + + const auto io_task_runner = base::ThreadPool::CreateSequencedTaskRunner( + {base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()}); + + // Create and set up the observer object. + auto observer = fatal_crash_test_environment_.CreateFatalCrashEventsObserver( + /*reported_local_id_io_task_runner=*/nullptr, + /*uploaded_crash_info_io_task_runner=*/io_task_runner); + observer->SetReportingEnabled(true); + + // Make sure file loading IO has finished. + FatalCrashEventsObserver::TestEnvironment::FlushIoTasks(*observer); + + // Block the IO thread to simulate slow file writing. + FatalCrashEventsObserver::TestEnvironment::SequenceBlocker sequence_blocker( + io_task_runner); + + // Create a few events. + for (uint64_t i = 0u; i < kNumOfEvents; ++i) { + auto crash_event_info = NewCrashEventInfo(/*is_uploaded=*/true); + crash_event_info->local_id = base::NumberToString(i); + // Incremental offset, otherwise the later uploaded crashes would not be + // reported. + crash_event_info->upload_info->offset = i; + crash_event_info->upload_info->creation_time = kCreationTime; + + FakeCrosHealthd::Get()->EmitEventForCategory( + EventCategoryEnum::kCrash, + EventInfo::NewCrashEventInfo(std::move(crash_event_info))); + } + + // Flush current thread so that all file writing IO tasks are posted. + base::RunLoop().RunUntilIdle(); + + // Release the IO thread and flush IO (done when recreating the fatal crash + // events observer). + sequence_blocker.Unblock(); + RecreateAndEnableFatalCrashEventsObserver(observer); + + // Events with low offset are skipped, because the save file is correctly + // written. + EXPECT_THAT( + WaitForSkippedFatalCrashEvent(kCrashReportId, kCreationTime, + /*offset=*/kNumOfEvents - 1, *observer), + FieldsAre(StrEq(kCrashReportId), Eq(kCreationTime), + Eq(kNumOfEvents - 1))); +} + INSTANTIATE_TEST_SUITE_P( FatalCrashEventsObserverUploadedCrashTestsForCorrectlyComparingCreationTimeAndOffset, FatalCrashEventsObserverUploadedCrashTest,
diff --git a/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_uploaded_crash_info_manager.cc b/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_uploaded_crash_info_manager.cc index c6d277bd..af58da8 100644 --- a/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_uploaded_crash_info_manager.cc +++ b/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_uploaded_crash_info_manager.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_uploaded_crash_info_manager.h" #include "chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer.h" +#include <atomic> #include <memory> #include <sstream> #include <string> @@ -193,14 +194,17 @@ "Failed to create a JSON string for uploaded crash info"); } - // TODO(b/266018440): Find a way to cancel all tasks on io_task_runner_ that - // has not been executed yet, as later save file writing tasks will always - // override the results of earlier ones. io_task_runner_->PostTask( FROM_HERE, base::BindOnce( [](base::FilePath save_file, base::FilePath save_file_tmp, - std::string content) { + std::string content, uint64_t cur_save_file_writing_task_id, + const std::atomic<uint64_t>* latest_save_file_writing_task_id) { + if (cur_save_file_writing_task_id < + latest_save_file_writing_task_id->load()) { + // Another file writing task has been posted. Skip this one. + return; + } // Write to the temp save file first, then rename it to the official // save file. This would prevent partly written file to be // effective, as renaming within the same partition is atomic on @@ -217,7 +221,15 @@ } // Successfully written the save file. }, - save_file_, save_file_tmp_, std::move(content).value())); + save_file_, save_file_tmp_, std::move(content).value(), + latest_save_file_writing_task_id_->load() + 1u, + latest_save_file_writing_task_id_.get())); + + // Increase the latest task ID only after the latest task has been posted, not + // before. Otherwise, in a rare case that this thread hangs after the latest + // task ID has increased, the IO thread would prematurely skip all file + // writing tasks. + latest_save_file_writing_task_id_->fetch_add(1u); return Status::StatusOK(); }
diff --git a/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_uploaded_crash_info_manager.h b/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_uploaded_crash_info_manager.h index b09f9a0..d8dfc39e 100644 --- a/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_uploaded_crash_info_manager.h +++ b/chrome/browser/ash/policy/reporting/metrics_reporting/fatal_crash/fatal_crash_events_observer_uploaded_crash_info_manager.h
@@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_ASH_POLICY_REPORTING_METRICS_REPORTING_FATAL_CRASH_FATAL_CRASH_EVENTS_OBSERVER_UPLOADED_CRASH_INFO_MANAGER_H_ #define CHROME_BROWSER_ASH_POLICY_REPORTING_METRICS_REPORTING_FATAL_CRASH_FATAL_CRASH_EVENTS_OBSERVER_UPLOADED_CRASH_INFO_MANAGER_H_ +#include <atomic> +#include <cstddef> #include <memory> #include <string_view> @@ -120,6 +122,17 @@ // The task runner that performs IO. const scoped_refptr<base::SequencedTaskRunner> io_task_runner_; + // The counter that keeps track of the number of IO tasks posted. This is + // mostly used to avoid duplicate IO tasks, i.e., a later save file writing + // task is posted and there's no need to executing an earlier file writing + // task that has not started. It is always deleted on the IO thread so that + // when an instance of this class is destroyed, this counter remains + // accessible for all tasks posted to the IO thread. + const std::unique_ptr<std::atomic<uint64_t>, base::OnTaskRunnerDeleter> + latest_save_file_writing_task_id_{ + new std::atomic<uint64_t>(0u), + base::OnTaskRunnerDeleter(io_task_runner_)}; + base::WeakPtrFactory<UploadedCrashInfoManager> weak_factory_{this}; }; } // namespace reporting
diff --git a/chrome/browser/ash/scanning/scan_integration_test.cc b/chrome/browser/ash/scanning/scan_integration_test.cc new file mode 100644 index 0000000..f974199 --- /dev/null +++ b/chrome/browser/ash/scanning/scan_integration_test.cc
@@ -0,0 +1,149 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/check.h" +#include "base/files/file_enumerator.h" +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/path_service.h" +#include "chrome/browser/ash/file_manager/path_util.h" +#include "chrome/browser/ash/login/test/session_manager_state_waiter.h" +#include "chrome/browser/ash/scanning/fake_lorgnette_scanner_manager.h" +#include "chrome/browser/ash/scanning/lorgnette_scanner_manager_factory.h" +#include "chrome/browser/ash/scanning/scan_service.h" +#include "chrome/browser/ash/scanning/scan_service_factory.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/common/chrome_paths.h" +#include "chrome/test/base/chromeos/crosier/chromeos_integration_login_mixin.h" +#include "chrome/test/base/chromeos/crosier/interactive_ash_test.h" +#include "chrome/test/interaction/interactive_browser_test.h" +#include "chromeos/ash/components/browser_context_helper/browser_context_types.h" +#include "chromeos/ash/components/dbus/lorgnette/lorgnette_service.pb.h" +#include "components/keyed_service/core/keyed_service.h" +#include "content/public/browser/browser_context.h" +#include "content/public/test/browser_test.h" +#include "ui/aura/window.h" + +namespace ash { + +namespace { + +constexpr char kScanningUrl[] = "chrome://scanning"; + +// Scan settings. +constexpr char kFirstTestScannerName[] = "Test Scanner 1"; +constexpr char kDocumentSourceName[] = "adf_simplex"; +constexpr uint32_t kFirstResolution = 75; +constexpr uint32_t kSecondResolution = 150; + +// Golden files. +constexpr char kADFGoldenFile[] = "adf_simplex_jpeg_grayscale_max_150_dpi.pdf"; + +// Kombucha helpers. +constexpr char kClickFn[] = "e => e.click()"; + +lorgnette::DocumentSource CreateLorgnetteDocumentSource() { + lorgnette::DocumentSource source; + source.set_type(lorgnette::SOURCE_ADF_SIMPLEX); + source.set_name(kDocumentSourceName); + source.add_color_modes(lorgnette::MODE_GRAYSCALE); + source.add_resolutions(kFirstResolution); + source.add_resolutions(kSecondResolution); + return source; +} + +lorgnette::ScannerCapabilities CreateLorgnetteScannerCapabilities() { + lorgnette::ScannerCapabilities caps; + *caps.add_sources() = CreateLorgnetteDocumentSource(); + return caps; +} + +// Creates a new LorgnetteScannerManager for the given `context`. +std::unique_ptr<KeyedService> BuildLorgnetteScannerManager( + content::BrowserContext* context) { + auto manager = std::make_unique<FakeLorgnetteScannerManager>(); + manager->SetGetScannerNamesResponse({kFirstTestScannerName}); + manager->SetGetScannerCapabilitiesResponse( + CreateLorgnetteScannerCapabilities()); + return manager; +} + +base::FilePath GetScanningTestDataDir() { + base::FilePath base_path; + CHECK(base::PathService::Get(base::DIR_SRC_TEST_DATA_ROOT, &base_path)); + return base_path.Append(base::FilePath("chrome/test/data/scanning")); +} + +class ScanIntegrationTest : public InteractiveAshTest { + public: + ScanIntegrationTest() { + set_exit_when_last_browser_closes(false); + login_mixin().SetMode(ChromeOSIntegrationLoginMixin::Mode::kTestLogin); + } + + const DeepQuery kScanButtonQuery{ + "scanning-app", + "cr-button#scanButton", + }; + + const DeepQuery kScanDoneSectionQuery{ + "scanning-app", + "scan-done-section", + }; + + auto LaunchScanningApp() { + return Do([&]() { CreateBrowserWindow(GURL(kScanningUrl)); }); + } + + base::FilePath GetScannedPdfFilePath() { + base::FileEnumerator e( + file_manager::util::GetMyFilesFolderForProfile(GetActiveUserProfile()), + /*recursive=*/false, base::FileEnumerator::FILES, + FILE_PATH_LITERAL("*.pdf")); + const auto file = e.Next(); + // Only one file should exist in the temp directory. + CHECK(e.Next().empty()); + return file; + } +}; + +// TODO(b:307385730): Add tests that select various scan settings combinations. +IN_PROC_BROWSER_TEST_F(ScanIntegrationTest, ScanWithDefaultSettings) { + // Set up context for element tracking for InteractiveBrowserTest. + SetupContextWidget(); + + login_mixin().Login(); + + // Waits for the primary user session to start. + ash::test::WaitForPrimaryUserSessionStart(); + + // Ensure the Scanning system web app (SWA) is installed. + InstallSystemApps(); + DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE(kScanAppWebContentsId); + base::ScopedAllowBlockingForTesting allow_io; + + LorgnetteScannerManagerFactory::GetInstance()->SetTestingFactory( + GetActiveUserProfile(), + base::BindRepeating(&BuildLorgnetteScannerManager)); + + RunTestSequence( + InstrumentNextTab(kScanAppWebContentsId, AnyBrowser()), + Log("Launching Scanning app"), LaunchScanningApp(), + Log("Waiting for Scanning app to load"), + WaitForWebContentsReady(kScanAppWebContentsId, GURL(kScanningUrl)), + Log("Clicking scan button"), + InAnyContext(EnsurePresent(kScanAppWebContentsId, kScanButtonQuery)), + ExecuteJsAt(kScanAppWebContentsId, kScanButtonQuery, kClickFn), + WaitForElementExists(kScanAppWebContentsId, kScanDoneSectionQuery), + FlushEvents()); + // `adf_simplex_jpeg_grayscale_max_150_dpi.pdf` contains the expected scanned + // PDF using the preconfigured settings for the scanner. + const auto adf_golden_file = + GetScanningTestDataDir().AppendASCII(kADFGoldenFile); + EXPECT_TRUE(base::ContentsEqual(adf_golden_file, GetScannedPdfFilePath())); +} + +} // namespace + +} // namespace ash
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/wallpaper_metrics_provider.cc b/chrome/browser/ash/system_web_apps/apps/personalization_app/wallpaper_metrics_provider.cc new file mode 100644 index 0000000..1cef2175 --- /dev/null +++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/wallpaper_metrics_provider.cc
@@ -0,0 +1,35 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ash/system_web_apps/apps/personalization_app/wallpaper_metrics_provider.h" + +#include "ash/public/cpp/wallpaper/wallpaper_types.h" +#include "ash/shell.h" +#include "ash/wallpaper/wallpaper_controller_impl.h" +#include "base/check.h" +#include "base/metrics/histogram_functions.h" + +WallpaperMetricsProvider::WallpaperMetricsProvider() = default; +WallpaperMetricsProvider::~WallpaperMetricsProvider() = default; + +void WallpaperMetricsProvider::ProvideCurrentSessionData( + metrics::ChromeUserMetricsExtension* uma_proto_unused) { + if (!ash::Shell::HasInstance() || + !ash::Shell::Get()->wallpaper_controller()) { + return; + } + + auto* wallpaper_controller = ash::Shell::Get()->wallpaper_controller(); + auto info = wallpaper_controller->GetActiveUserWallpaperInfo(); + if (!info || !ash::IsOnlineWallpaper(info->type)) { + return; + } + CHECK(info->unit_id); + base::UmaHistogramSparse("Ash.Wallpaper.Image.Settled", + info->unit_id.value()); + CHECK(!info->collection_id.empty()); + const int collection_id_hash = base::PersistentHash(info->collection_id); + base::UmaHistogramSparse("Ash.Wallpaper.Collection.Settled", + collection_id_hash); +}
diff --git a/chrome/browser/ash/system_web_apps/apps/personalization_app/wallpaper_metrics_provider.h b/chrome/browser/ash/system_web_apps/apps/personalization_app/wallpaper_metrics_provider.h new file mode 100644 index 0000000..32e29644 --- /dev/null +++ b/chrome/browser/ash/system_web_apps/apps/personalization_app/wallpaper_metrics_provider.h
@@ -0,0 +1,24 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ASH_SYSTEM_WEB_APPS_APPS_PERSONALIZATION_APP_WALLPAPER_METRICS_PROVIDER_H_ +#define CHROME_BROWSER_ASH_SYSTEM_WEB_APPS_APPS_PERSONALIZATION_APP_WALLPAPER_METRICS_PROVIDER_H_ + +#include "components/metrics/metrics_provider.h" + +class WallpaperMetricsProvider : public metrics::MetricsProvider { + public: + WallpaperMetricsProvider(); + + WallpaperMetricsProvider(const WallpaperMetricsProvider&) = delete; + WallpaperMetricsProvider& operator=(const WallpaperMetricsProvider&) = delete; + + ~WallpaperMetricsProvider() override; + + // metrics::MetricsProvider: + void ProvideCurrentSessionData( + metrics::ChromeUserMetricsExtension* uma_proto_unused) override; +}; + +#endif // CHROME_BROWSER_ASH_SYSTEM_WEB_APPS_APPS_PERSONALIZATION_APP_WALLPAPER_METRICS_PROVIDER_H_
diff --git a/chrome/browser/ash/video_conference/video_conference_integration_browsertest.cc b/chrome/browser/ash/video_conference/video_conference_integration_browsertest.cc index 91ca268..4873f3b 100644 --- a/chrome/browser/ash/video_conference/video_conference_integration_browsertest.cc +++ b/chrome/browser/ash/video_conference/video_conference_integration_browsertest.cc
@@ -122,7 +122,7 @@ VideoConferenceIntegrationTest() { // kOnDeviceSpeechRecognition is to support live caption. scoped_feature_list_.InitWithFeatures( - {ash::features::kVideoConference, + {ash::features::kVideoConference, ash::features::kVcStopAllScreenShare, ash::features::kOnDeviceSpeechRecognition, ash::features::kCameraEffectsSupportedByHardware, ash::features::kShowLiveCaptionInVideoConferenceTray},
diff --git a/chrome/browser/browsing_data/browsing_data_model_browsertest.cc b/chrome/browser/browsing_data/browsing_data_model_browsertest.cc index e2a2d90..5a7ddbc 100644 --- a/chrome/browser/browsing_data/browsing_data_model_browsertest.cc +++ b/chrome/browser/browsing_data/browsing_data_model_browsertest.cc
@@ -248,7 +248,7 @@ class BrowsingDataModelBrowserTest : public MixinBasedInProcessBrowserTest, - public ::testing::WithParamInterface<std::tuple<bool, bool>> { + public ::testing::WithParamInterface<bool> { public: BrowsingDataModelBrowserTest() { auto& field_trial_param = @@ -287,14 +287,6 @@ enabled_features.push_back({media::kExternalClearKeyForTesting, {}}); #endif - if (IsMigrateStorageToBDMEnabled()) { - enabled_features.push_back( - {browsing_data::features::kMigrateStorageToBDM, {}}); - } else { - disabled_features.emplace_back( - browsing_data::features::kMigrateStorageToBDM); - } - if (IsDeprecateCookiesTreeModelEnabled()) { enabled_features.push_back( {browsing_data::features::kDeprecateCookiesTreeModel, {}}); @@ -375,9 +367,7 @@ return https_test_server()->GetURL(kTestHost, replaced_path); } - bool IsMigrateStorageToBDMEnabled() { return std::get<0>(GetParam()); } - - bool IsDeprecateCookiesTreeModelEnabled() { return std::get<1>(GetParam()); } + bool IsDeprecateCookiesTreeModelEnabled() { return GetParam(); } network::test::TrustTokenRequestHandler request_handler_; @@ -819,41 +809,36 @@ // Ensure that quota data is fetched browsing_data_model = BuildBrowsingDataModel(); - if (IsMigrateStorageToBDMEnabled()) { - // Validate that quota data is fetched to browsing data model. - url::Origin testOrigin = https_test_server()->GetOrigin(kTestHost); - auto data_key = blink::StorageKey::CreateFirstParty(testOrigin); - if (data_type == "MediaLicense") { - ValidateBrowsingDataEntries( - browsing_data_model.get(), - {{kTestHost, - data_key, - {{BrowsingDataModel::StorageType::kQuotaStorage}, - /*storage_size=*/0, - /*cookie_count=*/0}}}); - } else { - ValidateBrowsingDataEntriesNonZeroUsage( - browsing_data_model.get(), - {{kTestHost, - data_key, - {{BrowsingDataModel::StorageType::kQuotaStorage}, - /*storage_size=*/0, - /*cookie_count=*/0}}}); - } - - ASSERT_EQ(browsing_data_model->size(), 1u); - - // Remove quota entry. - RemoveBrowsingDataForDataOwner(browsing_data_model.get(), kTestHost); - - // Rebuild Browsing Data Model and verify entries are empty. - browsing_data_model = BuildBrowsingDataModel(); - ValidateBrowsingDataEntries(browsing_data_model.get(), {}); - ASSERT_EQ(browsing_data_model->size(), 0u); + // Validate that quota data is fetched to browsing data model. + url::Origin testOrigin = https_test_server()->GetOrigin(kTestHost); + auto data_key = blink::StorageKey::CreateFirstParty(testOrigin); + if (data_type == "MediaLicense") { + ValidateBrowsingDataEntries( + browsing_data_model.get(), + {{kTestHost, + data_key, + {{BrowsingDataModel::StorageType::kQuotaStorage}, + /*storage_size=*/0, + /*cookie_count=*/0}}}); } else { - ValidateBrowsingDataEntries(browsing_data_model.get(), {}); - ASSERT_EQ(browsing_data_model->size(), 0u); + ValidateBrowsingDataEntriesNonZeroUsage( + browsing_data_model.get(), + {{kTestHost, + data_key, + {{BrowsingDataModel::StorageType::kQuotaStorage}, + /*storage_size=*/0, + /*cookie_count=*/0}}}); } + + ASSERT_EQ(browsing_data_model->size(), 1u); + + // Remove quota entry. + RemoveBrowsingDataForDataOwner(browsing_data_model.get(), kTestHost); + + // Rebuild Browsing Data Model and verify entries are empty. + browsing_data_model = BuildBrowsingDataModel(); + ValidateBrowsingDataEntries(browsing_data_model.get(), {}); + ASSERT_EQ(browsing_data_model->size(), 0u); } } @@ -868,10 +853,6 @@ ValidateBrowsingDataEntries(browsing_data_model.get(), {}); ASSERT_EQ(browsing_data_model->size(), 0u); - if (!IsMigrateStorageToBDMEnabled()) { - return; - } - SetDataForType("LocalStorage", web_contents()); // Flush storage size to disk. @@ -933,24 +914,22 @@ ASSERT_EQ(allowed_browsing_data_model->size(), 0u); SetDataForType("LocalStorage", web_contents()); - if (IsMigrateStorageToBDMEnabled()) { - WaitForModelUpdate(allowed_browsing_data_model, /*expected_size=*/1); + WaitForModelUpdate(allowed_browsing_data_model, /*expected_size=*/1); - // Validate Local Storage is reported. - url::Origin testOrigin = https_test_server()->GetOrigin(kTestHost); - auto data_key = blink::StorageKey::CreateFirstParty(testOrigin); - ValidateBrowsingDataEntries( - allowed_browsing_data_model, - {{kTestHost, - data_key, - {{BrowsingDataModel::StorageType::kLocalStorage}, - /*storage_size=*/0, - /*cookie_count=*/0}}}); - ASSERT_EQ(allowed_browsing_data_model->size(), 1u); + // Validate Local Storage is reported. + url::Origin testOrigin = https_test_server()->GetOrigin(kTestHost); + auto data_key = blink::StorageKey::CreateFirstParty(testOrigin); + ValidateBrowsingDataEntries( + allowed_browsing_data_model, + {{kTestHost, + data_key, + {{BrowsingDataModel::StorageType::kLocalStorage}, + /*storage_size=*/0, + /*cookie_count=*/0}}}); + ASSERT_EQ(allowed_browsing_data_model->size(), 1u); - // Delete Local Storage - RemoveBrowsingDataForDataOwner(allowed_browsing_data_model, kTestHost); - } + // Delete Local Storage + RemoveBrowsingDataForDataOwner(allowed_browsing_data_model, kTestHost); // Validate that the allowed browsing data model is empty. ValidateBrowsingDataEntries(allowed_browsing_data_model, {}); ASSERT_EQ(allowed_browsing_data_model->size(), 0u); @@ -971,9 +950,6 @@ content_settings->allowed_browsing_data_model(); ValidateBrowsingDataEntries(allowed_browsing_data_model, {}); ASSERT_EQ(allowed_browsing_data_model->size(), 0u); - if (!IsMigrateStorageToBDMEnabled()) { - return; - } SetDataForType("SessionStorage", web_contents()); WaitForModelUpdate(allowed_browsing_data_model, /*expected_size=*/1); @@ -1045,10 +1021,6 @@ ValidateBrowsingDataEntries(allowed_browsing_data_model, {}); ASSERT_EQ(allowed_browsing_data_model->size(), 0u); - if (!IsMigrateStorageToBDMEnabled()) { - return; - } - SetDataForType(data_type, web_contents()); WaitForModelUpdate(allowed_browsing_data_model, /*expected_size=*/1); @@ -1090,28 +1062,26 @@ ASSERT_EQ(allowed_browsing_data_model->size(), 0u); SetDataForType("SharedWorker", web_contents()); - if (IsMigrateStorageToBDMEnabled()) { - WaitForModelUpdate(allowed_browsing_data_model, /*expected_size=*/1); + WaitForModelUpdate(allowed_browsing_data_model, /*expected_size=*/1); - // Validate Shared Worker is reported. - url::Origin testOrigin = https_test_server()->GetOrigin(kTestHost); - GURL::Replacements replacements; - replacements.SetPathStr("browsing_data/shared_worker.js"); - GURL worker = testOrigin.GetURL().ReplaceComponents(replacements); - browsing_data::SharedWorkerInfo data_key( - worker, /*name=*/"", blink::StorageKey::CreateFirstParty(testOrigin)); - ValidateBrowsingDataEntries( - allowed_browsing_data_model, - {{kTestHost, - data_key, - {{BrowsingDataModel::StorageType::kSharedWorker}, - /*storage_size=*/0, - /*cookie_count=*/0}}}); - ASSERT_EQ(allowed_browsing_data_model->size(), 1u); + // Validate Shared Worker is reported. + url::Origin testOrigin = https_test_server()->GetOrigin(kTestHost); + GURL::Replacements replacements; + replacements.SetPathStr("browsing_data/shared_worker.js"); + GURL worker = testOrigin.GetURL().ReplaceComponents(replacements); + browsing_data::SharedWorkerInfo data_key( + worker, /*name=*/"", blink::StorageKey::CreateFirstParty(testOrigin)); + ValidateBrowsingDataEntries( + allowed_browsing_data_model, + {{kTestHost, + data_key, + {{BrowsingDataModel::StorageType::kSharedWorker}, + /*storage_size=*/0, + /*cookie_count=*/0}}}); + ASSERT_EQ(allowed_browsing_data_model->size(), 1u); - // Delete Shared Worker - RemoveBrowsingDataForDataOwner(allowed_browsing_data_model, kTestHost); - } + // Delete Shared Worker + RemoveBrowsingDataForDataOwner(allowed_browsing_data_model, kTestHost); // Validate that the allowed browsing data model is empty. ValidateBrowsingDataEntries(allowed_browsing_data_model, {}); ASSERT_EQ(allowed_browsing_data_model->size(), 0u); @@ -1123,9 +1093,6 @@ std::unique_ptr<BrowsingDataModel> browsing_data_model = BuildBrowsingDataModel(); ValidateBrowsingDataEntries(browsing_data_model.get(), {}); - if (!IsMigrateStorageToBDMEnabled()) { - return; - } // Navigate to a.test. ASSERT_TRUE(ui_test_utils::NavigateToURL( @@ -1539,11 +1506,5 @@ ASSERT_FALSE(HasDataForType("Cookie", web_contents())); } -INSTANTIATE_TEST_SUITE_P( - All, - BrowsingDataModelBrowserTest, - ::testing::Combine( - // Enable/disable `kMigrateStorageToBDM` feature. - ::testing::Bool(), - // Enable/disable `kDeprecateCookiesTreeModel` feature. - ::testing::Bool())); +// Enable/disable `kDeprecateCookiesTreeModel` feature. +INSTANTIATE_TEST_SUITE_P(All, BrowsingDataModelBrowserTest, ::testing::Bool());
diff --git a/chrome/browser/browsing_data/local_data_container.cc b/chrome/browser/browsing_data/local_data_container.cc index 0fa9218f..fbfafb6 100644 --- a/chrome/browser/browsing_data/local_data_container.cc +++ b/chrome/browser/browsing_data/local_data_container.cc
@@ -35,66 +35,24 @@ content::StoragePartition* storage_partition, browsing_data::CookieHelper::IsDeletionDisabledCallback is_cookie_deletion_disabled_callback) { - // Migrating storage handling to the `BrowsingDataModel` excludes all related - // helpers that are handled by the model from the `LocalDataContainer` . - // This works independently whether partitioned storage is enabled or not. - if (base::FeatureList::IsEnabled( - browsing_data::features::kMigrateStorageToBDM)) { - return std::make_unique<LocalDataContainer>( - base::FeatureList::IsEnabled( - browsing_data::features::kDeprecateCookiesTreeModel) - ? nullptr - : base::MakeRefCounted<browsing_data::CookieHelper>( - storage_partition, is_cookie_deletion_disabled_callback), - /*database_helper=*/nullptr, - /*local_storage_helper=*/nullptr, - /*session_storage_helper=*/nullptr, - /*indexed_db_helper=*/nullptr, - /*file_system_helper=*/nullptr, - /*quota_helper=*/nullptr, - /*service_worker_helper=*/nullptr, - /*shared_worker_helper=*/nullptr, - /*cache_storage_helper=*/nullptr); - } - - // If partitioned storage is enabled, the quota node is used to represent all - // types of quota managed storage. If not, the quota node type is excluded as - // it is represented by other types. - if (blink::StorageKey::IsThirdPartyStoragePartitioningEnabled()) { - return std::make_unique<LocalDataContainer>( - base::MakeRefCounted<browsing_data::CookieHelper>( - storage_partition, is_cookie_deletion_disabled_callback), - /*database_helper=*/nullptr, - base::MakeRefCounted<browsing_data::LocalStorageHelper>( - storage_partition), - /*session_storage_helper=*/nullptr, - /*indexed_db_helper=*/nullptr, - /*file_system_helper=*/nullptr, - /*quota_helper=*/BrowsingDataQuotaHelper::Create(storage_partition), - /*service_worker_helper=*/nullptr, - base::MakeRefCounted<browsing_data::SharedWorkerHelper>( - storage_partition), - /*cache_storage_helper=*/nullptr); - } - + // TODO(crbug.com/1271155): remove this flag. + CHECK(base::FeatureList::IsEnabled( + browsing_data::features::kMigrateStorageToBDM)); return std::make_unique<LocalDataContainer>( - base::MakeRefCounted<browsing_data::CookieHelper>( - storage_partition, is_cookie_deletion_disabled_callback), - base::MakeRefCounted<browsing_data::DatabaseHelper>(storage_partition), - base::MakeRefCounted<browsing_data::LocalStorageHelper>( - storage_partition), + base::FeatureList::IsEnabled( + browsing_data::features::kDeprecateCookiesTreeModel) + ? nullptr + : base::MakeRefCounted<browsing_data::CookieHelper>( + storage_partition, is_cookie_deletion_disabled_callback), + /*database_helper=*/nullptr, + /*local_storage_helper=*/nullptr, /*session_storage_helper=*/nullptr, - base::MakeRefCounted<browsing_data::IndexedDBHelper>(storage_partition), - base::MakeRefCounted<browsing_data::FileSystemHelper>( - storage_partition->GetFileSystemContext(), - browsing_data_file_system_util::GetAdditionalFileSystemTypes()), + /*indexed_db_helper=*/nullptr, + /*file_system_helper=*/nullptr, /*quota_helper=*/nullptr, - base::MakeRefCounted<browsing_data::ServiceWorkerHelper>( - storage_partition->GetServiceWorkerContext()), - base::MakeRefCounted<browsing_data::SharedWorkerHelper>( - storage_partition), - base::MakeRefCounted<browsing_data::CacheStorageHelper>( - storage_partition)); + /*service_worker_helper=*/nullptr, + /*shared_worker_helper=*/nullptr, + /*cache_storage_helper=*/nullptr); } LocalDataContainer::LocalDataContainer( @@ -102,7 +60,7 @@ scoped_refptr<browsing_data::DatabaseHelper> database_helper, scoped_refptr<browsing_data::LocalStorageHelper> local_storage_helper, scoped_refptr<browsing_data::LocalStorageHelper> session_storage_helper, - scoped_refptr<browsing_data::IndexedDBHelper> indexed_db_helper, + scoped_refptr<browsing_data::CannedIndexedDBHelper> indexed_db_helper, scoped_refptr<browsing_data::FileSystemHelper> file_system_helper, scoped_refptr<BrowsingDataQuotaHelper> quota_helper, scoped_refptr<browsing_data::ServiceWorkerHelper> service_worker_helper,
diff --git a/chrome/browser/browsing_data/local_data_container.h b/chrome/browser/browsing_data/local_data_container.h index 2f26c5f0..e15d5fa 100644 --- a/chrome/browser/browsing_data/local_data_container.h +++ b/chrome/browser/browsing_data/local_data_container.h
@@ -65,7 +65,7 @@ scoped_refptr<browsing_data::DatabaseHelper> database_helper, scoped_refptr<browsing_data::LocalStorageHelper> local_storage_helper, scoped_refptr<browsing_data::LocalStorageHelper> session_storage_helper, - scoped_refptr<browsing_data::IndexedDBHelper> indexed_db_helper, + scoped_refptr<browsing_data::CannedIndexedDBHelper> indexed_db_helper, scoped_refptr<browsing_data::FileSystemHelper> file_system_helper, scoped_refptr<BrowsingDataQuotaHelper> quota_helper, scoped_refptr<browsing_data::ServiceWorkerHelper> service_worker_helper, @@ -118,7 +118,7 @@ scoped_refptr<browsing_data::DatabaseHelper> database_helper_; scoped_refptr<browsing_data::LocalStorageHelper> local_storage_helper_; scoped_refptr<browsing_data::LocalStorageHelper> session_storage_helper_; - scoped_refptr<browsing_data::IndexedDBHelper> indexed_db_helper_; + scoped_refptr<browsing_data::CannedIndexedDBHelper> indexed_db_helper_; scoped_refptr<browsing_data::FileSystemHelper> file_system_helper_; scoped_refptr<BrowsingDataQuotaHelper> quota_helper_; scoped_refptr<browsing_data::ServiceWorkerHelper> service_worker_helper_;
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 4304b468e..457288e 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -5597,7 +5597,7 @@ hash_realtime_selection); return safe_browsing::BrowserURLLoaderThrottle::Create( - base::BindOnce( + base::BindRepeating( &ChromeContentBrowserClient::GetSafeBrowsingUrlCheckerDelegate, base::Unretained(this), safe_browsing::IsSafeBrowsingEnabled(*profile->GetPrefs()),
diff --git a/chrome/browser/chromeos/cros_apps/api/cros_apps_api_info.cc b/chrome/browser/chromeos/cros_apps/api/cros_apps_api_info.cc index 8890c72..c566f73 100644 --- a/chrome/browser/chromeos/cros_apps/api/cros_apps_api_info.cc +++ b/chrome/browser/chromeos/cros_apps/api/cros_apps_api_info.cc
@@ -28,13 +28,16 @@ std::vector<url::Origin> new_origins; new_origins.reserve(additions.size()); - base::ranges::transform( - additions, std::back_inserter(new_origins), [](std::string_view str) { - auto ret = url::Origin::Create(GURL(str)); - CHECK(!ret.opaque()) - << "Matching origin (" << str << ") must be non-opaque."; - return ret; - }); + base::ranges::transform(additions, std::back_inserter(new_origins), + [](std::string_view str) { + auto ret = url::Origin::Create(GURL(str)); + // The provided literal string be the same as the + // parsed origin. It shouldn't contain extra parts + // (e.g. URL path and query) that aren't part of the + // origin. + CHECK_EQ(ret.GetURL().spec(), str); + return ret; + }); AddAllowlistedOrigins(std::move(new_origins)); return *this; @@ -44,7 +47,9 @@ const std::vector<url::Origin>& additions) { for (const auto& origin : additions) { CHECK(!origin.opaque()); + CHECK(IsUrlEligibleForCrosAppsApis(origin.GetURL())); } + // For-loop with insert() is O(N^2) because we use a flat_set. // Instead, merge two vectors then sort. std::vector<url::Origin> merged_origins;
diff --git a/chrome/browser/chromeos/cros_apps/api/cros_apps_api_infos.cc b/chrome/browser/chromeos/cros_apps/api/cros_apps_api_infos.cc index efc1085..53d03eb 100644 --- a/chrome/browser/chromeos/cros_apps/api/cros_apps_api_infos.cc +++ b/chrome/browser/chromeos/cros_apps/api/cros_apps_api_infos.cc
@@ -26,7 +26,7 @@ .SetRequiredFeatures({chromeos::features::kBlinkExtensionDiagnostics}) .AddAllowlistedOrigins({ // Externally visible prototype hosting website. - "https://serve-dot-zipline.appspot.com/" + "https://serve-dot-zipline.appspot.com/", // System info viewer isolated app. "isolated-app://" "uwsszrmaowqmxw4f262x5jozzhe5bc4tefqfa5lado674o462aoaaaic/",
diff --git a/chrome/browser/client_hints/client_hints_browsertest.cc b/chrome/browser/client_hints/client_hints_browsertest.cc index 89f9dd1..4ad28a1c 100644 --- a/chrome/browser/client_hints/client_hints_browsertest.cc +++ b/chrome/browser/client_hints/client_hints_browsertest.cc
@@ -651,7 +651,7 @@ std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); // Force-enable the ClientHintsFormFactor feature, so that the header is // represented in the various header counts. - feature_list->InitializeFromCommandLine( + feature_list->InitFromCommandLine( "UserAgentClientHint,CriticalClientHint,AcceptCHFrame," "ClientHintsFormFactor,ClientHintsPrefersReducedTransparency," "UseAlpsNewCodepoint", @@ -3333,7 +3333,7 @@ ->AssociateFieldTrialParams(kTrialName, kGroupName, params)); std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->InitializeFromCommandLine( + feature_list->InitFromCommandLine( "UserAgentClientHint,ClientHintsFormFactor," "ClientHintsPrefersReducedTransparency", ""); @@ -3441,7 +3441,7 @@ std::make_unique<base::FeatureList>(); // Don't include ClientHintsDPR in the enabled features; we will verify that // sec-ch-dpr is not included. - feature_list->InitializeFromCommandLine( + feature_list->InitFromCommandLine( "UserAgentClientHint,CriticalClientHint,AcceptCHFrame", "ClientHintsDPR,UseAlpsNewCodepoint"); scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); @@ -4189,8 +4189,8 @@ void SetUp() override { std::unique_ptr<base::FeatureList> feature_list = std::make_unique<base::FeatureList>(); - feature_list->InitializeFromCommandLine( - "CriticalClientHint,UACHOverrideBlank", ""); + feature_list->InitFromCommandLine("CriticalClientHint,UACHOverrideBlank", + ""); scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); InProcessBrowserTest::SetUp(); @@ -4822,8 +4822,7 @@ // the new algorithm is attained. std::unique_ptr<base::FeatureList> EnabledFeatures() override { std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->InitializeFromCommandLine( - "GreaseUACH:updated_algorithm/false", ""); + feature_list->InitFromCommandLine("GreaseUACH:updated_algorithm/false", ""); return feature_list; } };
diff --git a/chrome/browser/compose/chrome_compose_client.cc b/chrome/browser/compose/chrome_compose_client.cc index ddc03a3c..037a309 100644 --- a/chrome/browser/compose/chrome_compose_client.cc +++ b/chrome/browser/compose/chrome_compose_client.cc
@@ -24,11 +24,13 @@ #include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/common/compose/type_conversions.h" +#include "chrome/common/pref_names.h" #include "components/autofill/core/common/form_field_data.h" #include "components/compose/core/browser/compose_manager_impl.h" #include "components/compose/core/browser/compose_metrics.h" #include "components/optimization_guide/proto/features/compose.pb.h" #include "components/strings/grit/components_strings.h" +#include "components/unified_consent/pref_names.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/context_menu_params.h" #include "content/public/browser/page.h" @@ -68,6 +70,7 @@ client_page_receiver_(this) { profile_ = Profile::FromBrowserContext(GetWebContents().GetBrowserContext()); opt_guide_ = OptimizationGuideKeyedServiceFactory::GetForProfile(profile_); + pref_service_ = profile_->GetPrefs(); if (GetOptimizationGuide()) { std::vector<optimization_guide::proto::OptimizationType> types; @@ -141,6 +144,11 @@ void ChromeComposeClient::CloseUI(compose::mojom::CloseReason reason) { switch (reason) { + // TODO(b/312295685): Add metrics for consent dialog related close reasons. + case compose::mojom::CloseReason::kConsentCloseButton: + case compose::mojom::CloseReason::kPageContentConsentDeclined: + RemoveActiveSession(); + break; case compose::mojom::CloseReason::kCloseButton: SetSessionCloseReason( compose::ComposeSessionCloseReason::kCloseButtonPressed); @@ -158,6 +166,28 @@ } } +void ChromeComposeClient::ApproveConsent() { + pref_service_->SetBoolean( + unified_consent::prefs::kPageContentCollectionEnabled, true); +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) + pref_service_->SetBoolean(prefs::kPrefHasAcceptedComposeConsent, true); +#endif + UpdateAllSessionsWithConsentApproved(); +} + +void ChromeComposeClient::AcknowledgeConsentDisclaimer() { +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) + pref_service_->SetBoolean(prefs::kPrefHasAcceptedComposeConsent, true); +#endif + UpdateAllSessionsWithConsentApproved(); +} + +void ChromeComposeClient::UpdateAllSessionsWithConsentApproved() { + for (const auto& session : sessions_) { + session.second->set_consent_given_or_acknowledged(); + } +} + void ChromeComposeClient::CreateOrUpdateSession( EntryPoint ui_entry_point, const autofill::FormFieldData& trigger_field, @@ -200,6 +230,12 @@ utf8_chars.has_value() ? utf8_chars.value() : 0); } + // Assume full consent for tests, otherwise compute from prefs. + auto consent_state = skip_show_dialog_for_test_ + ? compose::mojom::ConsentState::kConsented + : GetConsentStateFromPrefs(); + current_session->set_initial_consent_state(consent_state); + // If we are resuming then don't send the selected text - we want to keep the // prior selection and not trigger another Compose. current_session->InitializeWithText(resume_current_session @@ -242,6 +278,26 @@ active_compose_field_id_.reset(); } +compose::mojom::ConsentState ChromeComposeClient::GetConsentStateFromPrefs() { + auto consent_state = compose::mojom::ConsentState::kUnset; + bool page_content_collection_enabled = pref_service_->GetBoolean( + unified_consent::prefs::kPageContentCollectionEnabled); + bool consent_acknowledged_through_compose = false; +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) + consent_acknowledged_through_compose = + pref_service_->GetBoolean(prefs::kPrefHasAcceptedComposeConsent); +#endif + if (page_content_collection_enabled) { + // Page content collection can be enabled from the Compose UI or through + // other UIs. If the latter, then a specific disclaimer dialog should be + // shown for Compose FRE. This is captured by `consent_state`. + consent_state = consent_acknowledged_through_compose + ? compose::mojom::ConsentState::kConsented + : compose::mojom::ConsentState::kExternalConsented; + } + return consent_state; +} + compose::ComposeManager& ChromeComposeClient::GetManager() { return manager_; } @@ -307,8 +363,18 @@ model_quality_uploader_for_test_ = model_quality_uploader; } -void ChromeComposeClient::SetSkipShowDialogForTest() { - skip_show_dialog_for_test_ = true; +void ChromeComposeClient::SetSkipShowDialogForTest(bool should_skip) { + skip_show_dialog_for_test_ = should_skip; +} + +void ChromeComposeClient::SetActiveSessionConsentStateForTest( + compose::mojom::ConsentState consent_state) { + if (active_compose_field_id_.has_value()) { + auto it = sessions_.find(active_compose_field_id_.value()); + if (it != sessions_.end()) { + it->second->set_initial_consent_state(consent_state); + } + } } void ChromeComposeClient::SetSessionIdForTest(base::Token session_id) {
diff --git a/chrome/browser/compose/chrome_compose_client.h b/chrome/browser/compose/chrome_compose_client.h index a06ec9e..eef6cde 100644 --- a/chrome/browser/compose/chrome_compose_client.h +++ b/chrome/browser/compose/chrome_compose_client.h
@@ -58,6 +58,8 @@ popup_screen_location, ComposeCallback callback) override; bool HasSession(const autofill::FieldGlobalId& trigger_field_id) override; + bool ShouldTriggerPopup( + const autofill::FormFieldData& trigger_field) override; // ComposeClientPageHandler // Shows the compose dialog. @@ -65,9 +67,18 @@ // Closes the compose dialog. `reason` describes the user action that // triggered the close. void CloseUI(compose::mojom::CloseReason reason) override; + // Update corresponding prefs and state when consent is given through Compose. + void ApproveConsent() override; + // Update corresponding prefs and state when consent is acknowledged. + void AcknowledgeConsentDisclaimer() override; - bool ShouldTriggerPopup( - const autofill::FormFieldData& trigger_field) override; + // Update session state when the consent has been given/acknowledged. This + // will be used to differentiate sessions involving the consent flow. + // TODO(b/312295685): Add metrics for consent dialog related close reasons. + void UpdateAllSessionsWithConsentApproved(); + + compose::mojom::ConsentState GetConsentStateFromPrefs(); + virtual bool ShouldTriggerContextMenu(content::RenderFrameHost* rfh, content::ContextMenuParams& params); @@ -81,8 +92,12 @@ optimization_guide::ModelQualityLogsUploader* model_quality_uploader); void SetModelExecutorForTest( optimization_guide::OptimizationGuideModelExecutor* model_executor); - void SetSkipShowDialogForTest(); + void SetSkipShowDialogForTest(bool should_skip); void SetSessionIdForTest(base::Token session_id); + // Enable tests for consent and disclaimer dialogs to set the dialog's + // initial consent state accordingly. + void SetActiveSessionConsentStateForTest( + compose::mojom::ConsentState consent_state); // content::WebContentsObserver implementation. // Called when the primary page location changes. This includes reloads. @@ -114,6 +129,7 @@ friend class content::WebContentsUserData<ChromeComposeClient>; raw_ptr<Profile> profile_; + raw_ptr<PrefService> pref_service_; // Creates a session for `trigger_field` and initializes it as necessary. // `callback` is a callback to the renderer to insert the compose response
diff --git a/chrome/browser/compose/chrome_compose_client_unittest.cc b/chrome/browser/compose/chrome_compose_client_unittest.cc index abe3a60..3b00a7c2 100644 --- a/chrome/browser/compose/chrome_compose_client_unittest.cc +++ b/chrome/browser/compose/chrome_compose_client_unittest.cc
@@ -131,7 +131,7 @@ AddTab(browser(), GetPageUrl()); client_ = ChromeComposeClient::FromWebContents(web_contents()); client_->SetModelExecutorForTest(&model_executor_); - client_->SetSkipShowDialogForTest(); + client_->SetSkipShowDialogForTest(true); client_->SetModelQualityLogsUploaderForTest(&model_quality_logs_uploader_); client_->SetSessionIdForTest(base::Token(kSessionIdHigh, kSessionIdLow)); @@ -985,6 +985,25 @@ EXPECT_EQ(bug_url, new_tab_webcontents->GetVisibleURL()); } +TEST_F(ChromeComposeClientTest, SurveyLinkOpensCorrectURL) { + GURL survey_url("https://goto.google.com/ccfsfd"); + + ShowDialogAndBindMojo(); + + ui_test_utils::TabAddedWaiter tab_add_waiter(browser()); + page_handler()->OpenFeedbackSurveyLink(); + + // Wait for the resulting new tab to be created. + tab_add_waiter.Wait(); + // Check that the new foreground tab is opened. + EXPECT_EQ(2, browser()->tab_strip_model()->count()); + EXPECT_EQ(1, browser()->tab_strip_model()->active_index()); + // Check expected URL of the new tab. + content::WebContents* new_tab_webcontents = + browser()->tab_strip_model()->GetWebContentsAt(1); + EXPECT_EQ(survey_url, new_tab_webcontents->GetVisibleURL()); +} + TEST_F(ChromeComposeClientTest, ResetClientOnNavigation) { ShowDialogAndBindMojo(); @@ -1051,6 +1070,45 @@ 1); } +TEST_F(ChromeComposeClientTest, ConsentUICloseReasonHistogramTest) { + // Show the dialog and set unset consent state + ShowDialogAndBindMojo(); + client().SetActiveSessionConsentStateForTest( + compose::mojom::ConsentState::kUnset); + + // Closing the dialog from the consent UI should not log metrics. + // TODO(b/312295685): Add metrics for consent dialog related close reasons. + client().CloseUI(compose::mojom::CloseReason::kConsentCloseButton); + histograms().ExpectTotalCount(compose::kComposeSessionCloseReason, 0); + histograms().ExpectTotalCount( + compose::kComposeSessionDialogShownCount + std::string(".Ignored"), 0); + + // Show the dialog a second time. + ShowDialogAndBindMojo(); + client().SetActiveSessionConsentStateForTest( + compose::mojom::ConsentState::kUnset); + + client().CloseUI(compose::mojom::CloseReason::kPageContentConsentDeclined); + histograms().ExpectTotalCount(compose::kComposeSessionCloseReason, 0); + histograms().ExpectTotalCount( + compose::kComposeSessionDialogShownCount + std::string(".Ignored"), 0); +} + +TEST_F(ChromeComposeClientTest, ConsentUpdatedHistogramTest) { + // Show the dialog and set unset consent state + ShowDialogAndBindMojo(); + client().SetActiveSessionConsentStateForTest( + compose::mojom::ConsentState::kUnset); + + // If consent is given in this session, then session metrics should be logged. + client().UpdateAllSessionsWithConsentApproved(); + client().CloseUI(compose::mojom::CloseReason::kCloseButton); + + histograms().ExpectBucketCount( + compose::kComposeSessionCloseReason, + compose::ComposeSessionCloseReason::kCloseButtonPressed, 1); +} + TEST_F(ChromeComposeClientTest, AcceptSuggestionHistogramTest) { ShowDialogAndBindMojo();
diff --git a/chrome/browser/compose/compose_dialog_browsertest.cc b/chrome/browser/compose/compose_dialog_browsertest.cc index c52e52a0..6f1a25e8 100644 --- a/chrome/browser/compose/compose_dialog_browsertest.cc +++ b/chrome/browser/compose/compose_dialog_browsertest.cc
@@ -10,18 +10,21 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/tabs/tab_enums.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" +#include "chrome/common/pref_names.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" #include "components/compose/core/browser/compose_features.h" #include "components/optimization_guide/core/optimization_guide_features.h" +#include "components/prefs/pref_service.h" +#include "components/unified_consent/pref_names.h" #include "content/public/browser/web_contents.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" #include "ui/gfx/geometry/point_conversions.h" -namespace compose { +using ComposeClientPrefsBrowserTest = InProcessBrowserTest; -// IDC_CONTEXT_COMPOSE +namespace compose { class ComposeSessionBrowserTest : public InProcessBrowserTest { public: @@ -70,4 +73,75 @@ TabCloseTypes::CLOSE_NONE); } +IN_PROC_BROWSER_TEST_F(ComposeClientPrefsBrowserTest, + GetConsentStateFromPrefs) { + auto* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); + ASSERT_NE(nullptr, ChromeComposeClient::FromWebContents(web_contents)); + auto* client = ChromeComposeClient::FromWebContents(web_contents); + PrefService* prefs = browser()->profile()->GetPrefs(); + + // By default both kPageContentCollectionEnabled and + // kPrefHasAcceptedComposeConsent should be false + EXPECT_EQ(client->GetConsentStateFromPrefs(), + compose::mojom::ConsentState::kUnset); + + // Consent enabled but not acknowledged from compose + prefs->SetBoolean(unified_consent::prefs::kPageContentCollectionEnabled, + true); + EXPECT_EQ(client->GetConsentStateFromPrefs(), + compose::mojom::ConsentState::kExternalConsented); + +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) + // Consent enabled and acknowledged from compose + prefs->SetBoolean(prefs::kPrefHasAcceptedComposeConsent, true); + EXPECT_EQ(client->GetConsentStateFromPrefs(), + compose::mojom::ConsentState::kConsented); + + // Consent disabled since being acknowledged from compose + prefs->SetBoolean(unified_consent::prefs::kPageContentCollectionEnabled, + false); + EXPECT_EQ(client->GetConsentStateFromPrefs(), + compose::mojom::ConsentState::kUnset); +#endif +} + +IN_PROC_BROWSER_TEST_F(ComposeClientPrefsBrowserTest, ApproveConsent) { + auto* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); + ASSERT_NE(nullptr, ChromeComposeClient::FromWebContents(web_contents)); + auto* client = ChromeComposeClient::FromWebContents(web_contents); + PrefService* prefs = browser()->profile()->GetPrefs(); + + // By default both kPageContentCollectionEnabled and + // kPrefHasAcceptedComposeConsent should be false + EXPECT_EQ(client->GetConsentStateFromPrefs(), + compose::mojom::ConsentState::kUnset); + + client->ApproveConsent(); + ASSERT_TRUE( + prefs->GetBoolean(unified_consent::prefs::kPageContentCollectionEnabled)); +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) + ASSERT_TRUE(prefs->GetBoolean(prefs::kPrefHasAcceptedComposeConsent)); +#endif +} + +IN_PROC_BROWSER_TEST_F(ComposeClientPrefsBrowserTest, + AcknowledgeConsentDisclaimer) { + auto* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); + ASSERT_NE(nullptr, ChromeComposeClient::FromWebContents(web_contents)); + auto* client = ChromeComposeClient::FromWebContents(web_contents); + PrefService* prefs = browser()->profile()->GetPrefs(); + + // By default both kPageContentCollectionEnabled and + // kPrefHasAcceptedComposeConsent should be false + EXPECT_EQ(client->GetConsentStateFromPrefs(), + compose::mojom::ConsentState::kUnset); + + client->AcknowledgeConsentDisclaimer(); + ASSERT_FALSE( + prefs->GetBoolean(unified_consent::prefs::kPageContentCollectionEnabled)); +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) + ASSERT_TRUE(prefs->GetBoolean(prefs::kPrefHasAcceptedComposeConsent)); +#endif +} + } // namespace compose
diff --git a/chrome/browser/compose/compose_session.cc b/chrome/browser/compose/compose_session.cc index 04f8924..4cbbb88 100644 --- a/chrome/browser/compose/compose_session.cc +++ b/chrome/browser/compose/compose_session.cc
@@ -67,6 +67,7 @@ } const char kComposeBugReportURL[] = "https://goto.google.com/ccbrfd"; +const char kComposeFeedbackSurveyURL[] = "https://goto.google.com/ccfsfd"; void LogComposeResponseStatus(compose::mojom::ComposeStatus status) { UMA_HISTOGRAM_ENUMERATION(compose::kComposeResponseStatus, status); @@ -98,6 +99,14 @@ } ComposeSession::~ComposeSession() { + // Don't log any metrics for sessions that only display consent/disclaimer + // dialogs. + // TODO(b/312295685): Add metrics for consent dialog related close reasons. + if (initial_consent_state_ != compose::mojom::ConsentState::kConsented && + !consent_given_or_acknowledged_) { + return; + } + LogComposeSessionCloseMetrics(close_reason_, compose_count_, dialog_shown_count_, undo_count_); @@ -279,7 +288,7 @@ } auto compose_config = compose::GetComposeConfig(); std::move(callback).Run(compose::mojom::OpenMetadata::New( - initial_input_, current_state_->Clone(), + initial_consent_state_, initial_input_, current_state_->Clone(), compose::mojom::ConfigurableParams::New(compose_config.input_min_words, compose_config.input_max_words, compose_config.input_max_chars))); @@ -340,6 +349,13 @@ /* is_renderer_initiated= */ false)); } +void ComposeSession::OpenFeedbackSurveyLink() { + web_contents_->OpenURL(content::OpenURLParams( + GURL(kComposeFeedbackSurveyURL), content::Referrer(), + WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, + /* is_renderer_initiated= */ false)); +} + void ComposeSession::SetUserFeedback(compose::mojom::UserFeedback feedback) { if (last_ok_state_) { // Add to last_ok_state_ in case of undos.
diff --git a/chrome/browser/compose/compose_session.h b/chrome/browser/compose/compose_session.h index a564002e..36e2651 100644 --- a/chrome/browser/compose/compose_session.h +++ b/chrome/browser/compose/compose_session.h
@@ -91,6 +91,10 @@ // Down button is clicked. This implementation is designed for Fishfood only. void OpenBugReportingLink() override; + // Opens the Compose feedback survey page in a new tab. This implementation is + // designed for Dogfood only. + void OpenFeedbackSurveyLink() override; + // Opens the Compose-related Chrome settings page in a new tab when the // "settings" link is clicked in the consent dialog. void OpenComposeSettings() override; @@ -118,6 +122,17 @@ skip_inner_text_ = skip_inner_text; } + void set_initial_consent_state(compose::mojom::ConsentState consent_state) { + initial_consent_state_ = consent_state; + } + + // Set the first time the user progresses through the consent/disclaimer + // dialog to the main dialog. This can only be set one way as it corresponds + // to completion of the user's FRE. + void set_consent_given_or_acknowledged() { + consent_given_or_acknowledged_ = true; + } + // Refresh the inner text on session resumption. void RefreshInnerText(); @@ -163,6 +178,13 @@ // Renderer provided text selection. std::string initial_input_; + // The state of consent-related prefs when the session is first created. + compose::mojom::ConsentState initial_consent_state_ = + compose::mojom::ConsentState::kUnset; + // True if the user either gave consent or acknowledged given consent in this + // session. + bool consent_given_or_acknowledged_ = false; + // Reason that a compose session was exited, used for metrics. compose::ComposeSessionCloseReason close_reason_; // Reason that a compose session was exited, used for quality logging.
diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc index 9c52b1a..1955cf9 100644 --- a/chrome/browser/download/download_item_model.cc +++ b/chrome/browser/download/download_item_model.cc
@@ -825,13 +825,8 @@ #if BUILDFLAG(FULL_SAFE_BROWSING) CompleteSafeBrowsingScan(); #endif - if (GetDangerType() == download::DOWNLOAD_DANGER_TYPE_ASYNC_SCANNING) { - LogDeepScanEvent(download_, - safe_browsing::DeepScanEvent::kScanCanceled); - } else { - LogDeepScanEvent(download_, - safe_browsing::DeepScanEvent::kPromptBypassed); - } + LogDeepScanEvent(download_, + safe_browsing::DeepScanEvent::kPromptBypassed); [[fallthrough]]; case DownloadCommands::KEEP: #if BUILDFLAG(FULL_SAFE_BROWSING) @@ -857,6 +852,9 @@ #if BUILDFLAG(FULL_SAFE_BROWSING) MaybeSendDownloadReport(GetURL(), GetDangerType(), /*did_proceed=*/false, profile(), download_); + if (GetDangerType() == download::DOWNLOAD_DANGER_TYPE_ASYNC_SCANNING) { + LogDeepScanEvent(download_, safe_browsing::DeepScanEvent::kScanDeleted); + } if (MaybeSubmitDownloadToFeedbackService(command, profile(), download_)) { // Skip Remove because it is handled by download feedback service. break; @@ -907,6 +905,7 @@ ChromeDownloadManagerDelegate* delegate = download_core_service->GetDownloadManagerDelegate(); DCHECK(delegate); + LogDeepScanEvent(download_, safe_browsing::DeepScanEvent::kScanCanceled); delegate->CheckClientDownloadDone( download_->GetId(), safe_browsing::DownloadCheckResult::PROMPT_FOR_SCANNING);
diff --git a/chrome/browser/enterprise/data_controls/BUILD.gn b/chrome/browser/enterprise/data_controls/BUILD.gn index e2a1cf02..cbb5087 100644 --- a/chrome/browser/enterprise/data_controls/BUILD.gn +++ b/chrome/browser/enterprise/data_controls/BUILD.gn
@@ -12,6 +12,8 @@ "chrome_dlp_rules_manager.h", "dlp_reporting_manager.cc", "dlp_reporting_manager.h", + "rules_service.cc", + "rules_service.h", ] public_deps = [ @@ -32,6 +34,7 @@ "//components/reporting/proto:record_constants", "//components/reporting/util:status", "//components/url_matcher", + "//content/public/browser", "//third_party/abseil-cpp:absl", "//url", ] @@ -77,7 +80,10 @@ source_set("unit_tests") { testonly = true - sources = [ "chrome_dlp_rules_manager_unittest.cc" ] + sources = [ + "chrome_dlp_rules_manager_unittest.cc", + "rules_service_unittest.cc", + ] deps = [ ":data_controls", ":test_support",
diff --git a/chrome/browser/enterprise/data_controls/chrome_dlp_rules_manager.cc b/chrome/browser/enterprise/data_controls/chrome_dlp_rules_manager.cc index f7f4f46..3cbc0e8 100644 --- a/chrome/browser/enterprise/data_controls/chrome_dlp_rules_manager.cc +++ b/chrome/browser/enterprise/data_controls/chrome_dlp_rules_manager.cc
@@ -280,7 +280,7 @@ case Rule::Level::kBlock: return Verdict::Block(base::DoNothing()); case Rule::Level::kAllow: - return Verdict::NotSet(); + return Verdict::Allow(); } }
diff --git a/chrome/browser/enterprise/data_controls/chrome_dlp_rules_manager.h b/chrome/browser/enterprise/data_controls/chrome_dlp_rules_manager.h index 8c83e57d..a6daaab6 100644 --- a/chrome/browser/enterprise/data_controls/chrome_dlp_rules_manager.h +++ b/chrome/browser/enterprise/data_controls/chrome_dlp_rules_manager.h
@@ -24,6 +24,8 @@ namespace data_controls { class ChromeDlpRulesManagerTest; +class RulesService; +class RulesServiceFactory; // Implementation of DlpRulesManagerBase common to all desktop platforms. class ChromeDlpRulesManager : public DlpRulesManagerBase { @@ -63,6 +65,8 @@ protected: friend class data_controls::ChromeDlpRulesManagerTest; + friend class data_controls::RulesService; + friend class data_controls::RulesServiceFactory; explicit ChromeDlpRulesManager(Profile* profile);
diff --git a/chrome/browser/enterprise/data_controls/rules_service.cc b/chrome/browser/enterprise/data_controls/rules_service.cc new file mode 100644 index 0000000..f956fae --- /dev/null +++ b/chrome/browser/enterprise/data_controls/rules_service.cc
@@ -0,0 +1,65 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/enterprise/data_controls/rules_service.h" +#include "base/memory/ptr_util.h" +#include "base/no_destructor.h" +#include "chrome/browser/profiles/profile.h" + +namespace data_controls { + +// --------------------------- +// RulesService implementation +// --------------------------- + +RulesService::RulesService(content::BrowserContext* browser_context) + : rules_manager_(Profile::FromBrowserContext(browser_context)) {} + +RulesService::~RulesService() = default; + +Verdict RulesService::GetPrintVerdict(const GURL& printed_page_url) const { + return rules_manager_.GetVerdict(Rule::Restriction::kPrinting, + {.source = { + .url = printed_page_url, + }}); +} + +// ---------------------------------- +// RulesServiceFactory implementation +// ---------------------------------- + +// static +RulesService* RulesServiceFactory::GetForBrowserContext( + content::BrowserContext* context) { + return static_cast<RulesService*>( + GetInstance()->GetServiceForBrowserContext(context, /*create=*/true)); +} + +// static +RulesServiceFactory* RulesServiceFactory::GetInstance() { + static base::NoDestructor<RulesServiceFactory> instance; + return instance.get(); +} + +RulesServiceFactory::RulesServiceFactory() + : ProfileKeyedServiceFactory( + "DataControlsRulesService", + ProfileSelections::Builder() + .WithRegular(ProfileSelection::kOwnInstance) + .WithGuest(ProfileSelection::kOwnInstance) + .WithSystem(ProfileSelection::kOwnInstance) + .WithAshInternals(ProfileSelection::kOwnInstance) + .Build()) { + // TODO: Add DependsOn statements. +} + +RulesServiceFactory::~RulesServiceFactory() = default; + +std::unique_ptr<KeyedService> +RulesServiceFactory::BuildServiceInstanceForBrowserContext( + content::BrowserContext* context) const { + return base::WrapUnique(new RulesService(context)); +} + +} // namespace data_controls
diff --git a/chrome/browser/enterprise/data_controls/rules_service.h b/chrome/browser/enterprise/data_controls/rules_service.h new file mode 100644 index 0000000..783f4bfc4 --- /dev/null +++ b/chrome/browser/enterprise/data_controls/rules_service.h
@@ -0,0 +1,67 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ENTERPRISE_DATA_CONTROLS_RULES_SERVICE_H_ +#define CHROME_BROWSER_ENTERPRISE_DATA_CONTROLS_RULES_SERVICE_H_ + +#include "chrome/browser/enterprise/data_controls/chrome_dlp_rules_manager.h" +#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/enterprise/data_controls/verdict.h" +#include "components/keyed_service/core/keyed_service.h" +#include "content/public/browser/browser_context.h" + +namespace base { +template <typename T> +class NoDestructor; +} + +namespace data_controls { + +// Keyed service that provides an interface to check what restrictions should +// be applied from the DataControlsRules policy. +class RulesService : public KeyedService { + public: + ~RulesService() override; + + Verdict GetPrintVerdict(const GURL& printed_page_url) const; + + // TODO(b/307291932): Once crrev.com/c/5054488 lands, implement this method. + // Verdict GetPasteVerdict( + // const content::ClipboardEndpoint& source, + // const content::ClipboardEndpoint& destination, + // const content::ClipboardMetadata& metadata); + + protected: + friend class RulesServiceFactory; + + explicit RulesService(content::BrowserContext* browser_context); + + private: + // Initialized with the profile passed in the constructor. + ChromeDlpRulesManager rules_manager_; +}; + +class RulesServiceFactory : public ProfileKeyedServiceFactory { + public: + static RulesService* GetForBrowserContext(content::BrowserContext* context); + + static RulesServiceFactory* GetInstance(); + + RulesServiceFactory(const RulesServiceFactory&) = delete; + RulesServiceFactory& operator=(const RulesServiceFactory&) = delete; + + private: + friend base::NoDestructor<RulesServiceFactory>; + + RulesServiceFactory(); + ~RulesServiceFactory() override; + + // BrowserContextKeyedServiceFactory: + std::unique_ptr<KeyedService> BuildServiceInstanceForBrowserContext( + content::BrowserContext* context) const override; +}; + +} // namespace data_controls + +#endif // CHROME_BROWSER_ENTERPRISE_DATA_CONTROLS_RULES_SERVICE_H_
diff --git a/chrome/browser/enterprise/data_controls/rules_service_unittest.cc b/chrome/browser/enterprise/data_controls/rules_service_unittest.cc new file mode 100644 index 0000000..19fc5bd --- /dev/null +++ b/chrome/browser/enterprise/data_controls/rules_service_unittest.cc
@@ -0,0 +1,133 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/enterprise/data_controls/rules_service.h" + +#include "base/test/scoped_feature_list.h" +#include "chrome/browser/enterprise/data_controls/test_utils.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/test/base/testing_browser_process.h" +#include "chrome/test/base/testing_profile_manager.h" +#include "components/enterprise/data_controls/features.h" +#include "content/public/test/browser_task_environment.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace data_controls { + +namespace { + +class DataControlsRulesServiceTest : public testing::Test { + public: + explicit DataControlsRulesServiceTest(bool feature_enabled = true) + : profile_manager_(TestingBrowserProcess::GetGlobal()) { + if (feature_enabled) { + scoped_features_.InitAndEnableFeature(kEnableDesktopDataControls); + } else { + scoped_features_.InitAndDisableFeature(kEnableDesktopDataControls); + } + EXPECT_TRUE(profile_manager_.SetUp()); + profile_ = profile_manager_.CreateTestingProfile("test-user"); + } + + Profile* profile() { return profile_; } + + protected: + content::BrowserTaskEnvironment task_environment_; + base::test::ScopedFeatureList scoped_features_; + TestingProfileManager profile_manager_; + raw_ptr<TestingProfile> profile_; +}; + +class DataControlsRulesServiceFeatureDisabledTest + : public DataControlsRulesServiceTest { + public: + DataControlsRulesServiceFeatureDisabledTest() + : DataControlsRulesServiceTest(false) {} +}; + +} // namespace + +TEST_F(DataControlsRulesServiceFeatureDisabledTest, NoVerdicts) { + SetDataControls(profile()->GetPrefs(), {R"({ + "sources": { + "urls": ["google.com"] + }, + "restrictions": [ + {"class": "PRINTING", "level": "BLOCK"} + ] + })"}); + auto verdict = RulesServiceFactory::GetInstance() + ->GetForBrowserContext(profile()) + ->GetPrintVerdict(GURL("https://google.com")); + ASSERT_EQ(verdict.level(), Rule::Level::kNotSet); + ASSERT_TRUE(verdict.TakeInitialReportClosure().is_null()); + ASSERT_TRUE(verdict.TakeBypassReportClosure().is_null()); +} + +TEST_F(DataControlsRulesServiceTest, GetPrintVerdict_URL) { + GURL google_url = GURL("https://google.com"); + + auto verdict = RulesServiceFactory::GetInstance() + ->GetForBrowserContext(profile()) + ->GetPrintVerdict(google_url); + ASSERT_EQ(verdict.level(), Rule::Level::kNotSet); + ASSERT_TRUE(verdict.TakeInitialReportClosure().is_null()); + ASSERT_TRUE(verdict.TakeBypassReportClosure().is_null()); + + SetDataControls(profile()->GetPrefs(), {R"({ + "sources": { + "urls": ["google.com"] + }, + "restrictions": [ + {"class": "PRINTING", "level": "BLOCK"} + ] + })"}); + verdict = RulesServiceFactory::GetInstance() + ->GetForBrowserContext(profile()) + ->GetPrintVerdict(google_url); + ASSERT_EQ(verdict.level(), Rule::Level::kBlock); + ASSERT_FALSE(verdict.TakeInitialReportClosure().is_null()); + ASSERT_TRUE(verdict.TakeBypassReportClosure().is_null()); + + SetDataControls(profile()->GetPrefs(), {R"({ + "sources": { + "urls": ["google.com"] + }, + "restrictions": [ + {"class": "PRINTING", "level": "WARN"} + ] + })"}); + verdict = RulesServiceFactory::GetInstance() + ->GetForBrowserContext(profile()) + ->GetPrintVerdict(google_url); + ASSERT_EQ(verdict.level(), Rule::Level::kWarn); + ASSERT_FALSE(verdict.TakeInitialReportClosure().is_null()); + ASSERT_FALSE(verdict.TakeBypassReportClosure().is_null()); + + SetDataControls(profile()->GetPrefs(), { + R"({ + "sources": { + "urls": ["google.com"] + }, + "restrictions": [ + {"class": "PRINTING", "level": "ALLOW"} + ] + })", + R"({ + "sources": { + "urls": ["https://*"] + }, + "restrictions": [ + {"class": "PRINTING", "level": "WARN"} + ] + })"}); + verdict = RulesServiceFactory::GetInstance() + ->GetForBrowserContext(profile()) + ->GetPrintVerdict(google_url); + ASSERT_EQ(verdict.level(), Rule::Level::kAllow); + ASSERT_TRUE(verdict.TakeInitialReportClosure().is_null()); + ASSERT_TRUE(verdict.TakeBypassReportClosure().is_null()); +} + +} // namespace data_controls
diff --git a/chrome/browser/extensions/api/commands/command_service_browsertest.cc b/chrome/browser/extensions/api/commands/command_service_browsertest.cc index 903d40a..96037e4 100644 --- a/chrome/browser/extensions/api/commands/command_service_browsertest.cc +++ b/chrome/browser/extensions/api/commands/command_service_browsertest.cc
@@ -411,8 +411,7 @@ // Install v1 of the extension. ASSERT_TRUE(InstallExtension(path_v1, 1)); - EXPECT_TRUE( - registry->GetExtensionById(kExtensionId, ExtensionRegistry::ENABLED)); + EXPECT_TRUE(registry->enabled_extensions().GetByID(kExtensionId)); // Verify it has a command of Alt+Shift+F. ui::Accelerator accelerator = @@ -439,8 +438,7 @@ // Update to version 2. EXPECT_TRUE(UpdateExtension(kExtensionId, path_v2, 0)); - EXPECT_TRUE( - registry->GetExtensionById(kExtensionId, ExtensionRegistry::ENABLED)); + EXPECT_TRUE(registry->enabled_extensions().GetByID(kExtensionId)); // Verify it is still set to nothing. accelerator =
diff --git a/chrome/browser/extensions/api/context_menus/context_menu_apitest.cc b/chrome/browser/extensions/api/context_menus/context_menu_apitest.cc index b4a6af6..93913e6f 100644 --- a/chrome/browser/extensions/api/context_menus/context_menu_apitest.cc +++ b/chrome/browser/extensions/api/context_menus/context_menu_apitest.cc
@@ -7,7 +7,6 @@ #include "base/memory/raw_ptr.h" #include "base/memory/raw_ptr_exclusion.h" #include "base/strings/utf_string_conversions.h" -#include "base/test/metrics/histogram_tester.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/browser/extensions/extension_service.h" @@ -25,7 +24,6 @@ #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" #include "extensions/browser/extension_action.h" -#include "extensions/browser/state_store_test_observer.h" #include "extensions/test/result_catcher.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "ui/base/models/menu_model.h" @@ -81,56 +79,10 @@ ASSERT_TRUE(RunExtensionTest("context_menus/event_page")) << message_; } -class ExtensionContextMenuApiCountTest - : public ExtensionContextMenuApiTestWithContextType { - public: - ExtensionContextMenuApiCountTest() = default; - ~ExtensionContextMenuApiCountTest() override = default; - ExtensionContextMenuApiCountTest& operator=( - const ExtensionContextMenuApiCountTest&) = delete; - ExtensionContextMenuApiCountTest(const ExtensionContextMenuApiCountTest&) = - delete; - - void SetUp() override { - histogram_tester_ = std::make_unique<base::HistogramTester>(); - ExtensionContextMenuApiTestWithContextType::SetUp(); - } - - void TearDown() override { - histogram_tester_.release(); - ExtensionContextMenuApiTestWithContextType::TearDown(); - } - - protected: - std::unique_ptr<base::HistogramTester> histogram_tester_; -}; - -// TODO(crbug.com/1475294): Re-enable on Mac. -#if !BUILDFLAG(IS_MAC) -INSTANTIATE_TEST_SUITE_P(EventPage, - ExtensionContextMenuApiCountTest, - ::testing::Values(ContextType::kEventPage)); -INSTANTIATE_TEST_SUITE_P(ServiceWorker, - ExtensionContextMenuApiCountTest, - ::testing::Values(ContextType::kServiceWorker)); - -IN_PROC_BROWSER_TEST_P(ExtensionContextMenuApiCountTest, PRE_Count) { - StateStoreTestObserver observer(profile()); - // This part of the test creates the menu items for the extension. +IN_PROC_BROWSER_TEST_P(ExtensionContextMenuApiTestWithContextType, Count) { ASSERT_TRUE(RunExtensionTest("context_menus/count")) << message_; - // Wait for the context menu to be stored. - observer.WaitForExtensionAndKey(last_loaded_extension_id(), "context_menus"); } -IN_PROC_BROWSER_TEST_P(ExtensionContextMenuApiCountTest, Count) { - // The histogram will be updated when the extension is loaded during - // startup. This will happen before we enter the test, so just check - // that the update is present. - histogram_tester_->ExpectUniqueSample("Extensions.MenuManager.MenuItemsCount", - 6, 1); -} -#endif - // crbug.com/51436 -- creating context menus from multiple script contexts // should work. IN_PROC_BROWSER_TEST_P(ExtensionContextMenuApiTestWithContextType,
diff --git a/chrome/browser/extensions/api/context_menus/context_menus_api_helpers.cc b/chrome/browser/extensions/api/context_menus/context_menus_api_helpers.cc index d68f424f..d74da60 100644 --- a/chrome/browser/extensions/api/context_menus/context_menus_api_helpers.cc +++ b/chrome/browser/extensions/api/context_menus/context_menus_api_helpers.cc
@@ -30,7 +30,8 @@ "Parent items must have type \"normal\""; const char kTitleNeededError[] = "All menu items except for separators must have a title"; - +const char kTooManyMenuItems[] = + "An extension can create a maximum of * menu items."; std::string GetIDString(const MenuItem::Id& id) { if (id.uid == 0)
diff --git a/chrome/browser/extensions/api/context_menus/context_menus_api_helpers.h b/chrome/browser/extensions/api/context_menus/context_menus_api_helpers.h index f6b0cc7..2754dd7 100644 --- a/chrome/browser/extensions/api/context_menus/context_menus_api_helpers.h +++ b/chrome/browser/extensions/api/context_menus/context_menus_api_helpers.h
@@ -8,6 +8,7 @@ #define CHROME_BROWSER_EXTENSIONS_API_CONTEXT_MENUS_CONTEXT_MENUS_API_HELPERS_H_ #include "base/notreached.h" +#include "base/strings/string_number_conversions.h" #include "base/types/optional_util.h" #include "chrome/browser/extensions/menu_manager.h" #include "chrome/common/extensions/api/context_menus.h" @@ -51,6 +52,7 @@ extern const char kOnclickDisallowedError[]; extern const char kParentsMustBeNormalError[]; extern const char kTitleNeededError[]; +extern const char kTooManyMenuItems[]; std::string GetIDString(const MenuItem::Id& id); @@ -74,6 +76,14 @@ bool is_webview = item_id.extension_key.webview_instance_id != 0; MenuManager* menu_manager = MenuManager::Get(browser_context); + if (menu_manager->MenuItemsSize(item_id.extension_key) >= + MenuManager::kMaxItemsPerExtension) { + *error = ErrorUtils::FormatErrorMessage( + kTooManyMenuItems, + base::NumberToString(MenuManager::kMaxItemsPerExtension)); + return false; + } + if (menu_manager->GetItemById(item_id)) { *error = ErrorUtils::FormatErrorMessage(kDuplicateIDError, GetIDString(item_id));
diff --git a/chrome/browser/extensions/api/document_scan/fake_document_scan_ash.cc b/chrome/browser/extensions/api/document_scan/fake_document_scan_ash.cc index 7230fdc..ddfe5de 100644 --- a/chrome/browser/extensions/api/document_scan/fake_document_scan_ash.cc +++ b/chrome/browser/extensions/api/document_scan/fake_document_scan_ash.cc
@@ -41,6 +41,19 @@ std::move(callback).Run(std::move(response)); } +void FakeDocumentScanAsh::OpenScanner(const std::string& client_id, + const std::string& scanner_id, + OpenScannerCallback callback) { + // TODO(b/297435720): Implement this when adding the extension handler. + NOTIMPLEMENTED(); +} + +void FakeDocumentScanAsh::CloseScanner(const std::string& scanner_handle, + CloseScannerCallback callback) { + // TODO(b/297435720): Implement this when adding the extension handler. + NOTIMPLEMENTED(); +} + void FakeDocumentScanAsh::SetGetScannerNamesResponse( std::vector<std::string> scanner_names) { scanner_names_ = std::move(scanner_names);
diff --git a/chrome/browser/extensions/api/document_scan/fake_document_scan_ash.h b/chrome/browser/extensions/api/document_scan/fake_document_scan_ash.h index 63b1d28..e6a4ec99 100644 --- a/chrome/browser/extensions/api/document_scan/fake_document_scan_ash.h +++ b/chrome/browser/extensions/api/document_scan/fake_document_scan_ash.h
@@ -29,6 +29,11 @@ void GetScannerList(const std::string& client_id, crosapi::mojom::ScannerEnumFilterPtr filter, GetScannerListCallback callback) override; + void OpenScanner(const std::string& client_id, + const std::string& scanner_id, + OpenScannerCallback callback) override; + void CloseScanner(const std::string& scanner_handle, + CloseScannerCallback callback) override; void AddScanner(crosapi::mojom::ScannerInfoPtr scanner); void SetGetScannerNamesResponse(std::vector<std::string> scanner_names);
diff --git a/chrome/browser/extensions/api/management/management_api_non_persistent_apitest.cc b/chrome/browser/extensions/api/management/management_api_non_persistent_apitest.cc index 48b42a44..ca50cf2 100644 --- a/chrome/browser/extensions/api/management/management_api_non_persistent_apitest.cc +++ b/chrome/browser/extensions/api/management/management_api_non_persistent_apitest.cc
@@ -95,8 +95,7 @@ // installed or not (ExtensionRegistry::EVERYTHING) // is enough. But for clarity, we check for enabled-ness // (ExtensionRegistry::ENABLED) here. - EXPECT_TRUE( - registry->GetExtensionById(extension_b_id, ExtensionRegistry::ENABLED)); + EXPECT_TRUE(registry->enabled_extensions().GetByID(extension_b_id)); // Load extension_a and wait for browserAction.onClicked listener // registration.
diff --git a/chrome/browser/extensions/api/tabs/tabs_apitest.cc b/chrome/browser/extensions/api/tabs/tabs_apitest.cc index 62e21c3..b2d3ddb 100644 --- a/chrome/browser/extensions/api/tabs/tabs_apitest.cc +++ b/chrome/browser/extensions/api/tabs/tabs_apitest.cc
@@ -189,6 +189,10 @@ } #endif +IN_PROC_BROWSER_TEST_P(ExtensionApiTabTestWithContextType, LastAccessed) { + ASSERT_TRUE(RunExtensionTest("tabs/basics/last_accessed")) << message_; +} + IN_PROC_BROWSER_TEST_P(ExtensionApiTabTestWithContextType, CrashBrowser) { ASSERT_TRUE(RunExtensionTest("tabs/basics/crash")) << message_; }
diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc index 8ca08228..79d0e2a 100644 --- a/chrome/browser/extensions/extension_tab_util.cc +++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -460,6 +460,13 @@ if (group.has_value()) { tab_object.group_id = tab_groups_util::GetGroupId(group.value()); } + + absl::optional<base::Time> last_accessed = + tab_strip->GetLastAccessed(tab_index); + + if (last_accessed.has_value()) { + tab_object.last_accessed = last_accessed->InMillisecondsFSinceUnixEpoch(); + } } auto* audible_helper = RecentlyAudibleHelper::FromWebContents(contents);
diff --git a/chrome/browser/extensions/menu_manager.cc b/chrome/browser/extensions/menu_manager.cc index 6abaa3e..f0905c0 100644 --- a/chrome/browser/extensions/menu_manager.cc +++ b/chrome/browser/extensions/menu_manager.cc
@@ -12,7 +12,6 @@ #include "base/containers/contains.h" #include "base/functional/bind.h" #include "base/json/json_writer.h" -#include "base/metrics/histogram_functions.h" #include "base/notreached.h" #include "base/observer_list.h" #include "base/ranges/algorithm.h" @@ -26,7 +25,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/api/chrome_web_view_internal.h" #include "chrome/common/extensions/api/context_menus.h" -#include "chrome/common/extensions/api/url_handlers/url_handlers_parser.h" #include "components/guest_view/common/guest_view_constants.h" #include "content/public/browser/child_process_host.h" #include "content/public/browser/context_menu_params.h" @@ -364,7 +362,7 @@ } const MenuItem::OwnedList* MenuManager::MenuItems( - const MenuItem::ExtensionKey& key) { + const MenuItem::ExtensionKey& key) const { auto i = context_items_.find(key); if (i != context_items_.end()) { return &i->second; @@ -889,8 +887,13 @@ return; MenuItem::OwnedList items = MenuItemsFromValue(extension_id, value); - base::UmaHistogramCounts1000("Extensions.MenuManager.MenuItemsCount", - items.size()); + // If the extension created items before we imposed a limit, those + // extra items may have been stored. If so, remove them. This works + // fine with regard to the parent/child relationship, since parent + // items are stored first. + if (items.size() > kMaxItemsPerExtension) { + items.resize(kMaxItemsPerExtension); + } for (auto& item : items) { if (item->parent_id()) { // Parent IDs are stored in the parent_id field for convenience, but
diff --git a/chrome/browser/extensions/menu_manager.h b/chrome/browser/extensions/menu_manager.h index d0e0f69..aaf8f09 100644 --- a/chrome/browser/extensions/menu_manager.h +++ b/chrome/browser/extensions/menu_manager.h
@@ -294,6 +294,7 @@ public: static const char kOnContextMenus[]; static const char kOnWebviewContextMenus[]; + static constexpr MenuItem::OwnedList::size_type kMaxItemsPerExtension = 1000; class TestObserver : public base::CheckedObserver { public: @@ -321,7 +322,15 @@ // top-level items' children. A view can then decide how to display these, // including whether to put them into a submenu if there are more than 1. const MenuItem::OwnedList* MenuItems( - const MenuItem::ExtensionKey& extension_key); + const MenuItem::ExtensionKey& extension_key) const; + + // Returns the number of menu items for extension specified by + // `extension_key`. + MenuItem::OwnedList::size_type MenuItemsSize( + const MenuItem::ExtensionKey& extension_key) const { + const MenuItem::OwnedList* list = MenuItems(extension_key); + return list ? list->size() : 0; + } // Adds a top-level menu item for an extension, requiring the |extension| // pointer so it can load the icon for the extension. Returns a boolean
diff --git a/chrome/browser/extensions/pack_extension_browsertest.cc b/chrome/browser/extensions/pack_extension_browsertest.cc new file mode 100644 index 0000000..a1b4cf5 --- /dev/null +++ b/chrome/browser/extensions/pack_extension_browsertest.cc
@@ -0,0 +1,74 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <memory> + +#include "base/command_line.h" +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "chrome/common/chrome_result_codes.h" +#include "chrome/common/chrome_switches.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "content/public/test/browser_test.h" +#include "extensions/test/test_extension_dir.h" + +namespace extensions { + +class PackExtensionOnStartupBrowserTest : public InProcessBrowserTest { + public: + PackExtensionOnStartupBrowserTest() = default; + ~PackExtensionOnStartupBrowserTest() override = default; + + void SetUpCommandLine(base::CommandLine* command_line) override { + InProcessBrowserTest::SetUpCommandLine(command_line); + + test_extension_dir_ = std::make_unique<TestExtensionDir>(); + // Create an extension with some permissions that are guarded by + // base::Features. + // Note: Unfortunately, this is bound to become out-of-date. Some + // of these features are currently restricted by base::Features, but we'll + // eventually remove those restrictions. There's no good workaround for this + // that *also* allows us to do the early initialization required in this + // test. + static constexpr char kManifest[] = + R"({ + "name": "Test extension", + "version": "0.1", + "manifest_version": 3, + "host_permissions": ["*://example.com/*"], + "permissions": ["storage", "tabs", "userScripts", "debugger"], + "background": {"service_worker": "background.js"} + })"; + test_extension_dir_->WriteManifest(kManifest); + test_extension_dir_->WriteFile(FILE_PATH_LITERAL("background.js"), + "// blank"); + + // Append the switch to pack the extension. + command_line->AppendSwitchASCII( + ::switches::kPackExtension, + test_extension_dir_->UnpackedPath().AsUTF8Unsafe()); + + // Packing extensions has a different exit code. + set_expected_exit_code( + chrome::RESULT_CODE_NORMAL_EXIT_PACK_EXTENSION_SUCCESS); + } + + protected: + std::unique_ptr<TestExtensionDir> test_extension_dir_; +}; + +// Tests that appending the --pack-extension switch on startup succeeds with +// a "real" browser (i.e., outside of unit tests). +// Regression test for https://crbug.com/1498558. +IN_PROC_BROWSER_TEST_F(PackExtensionOnStartupBrowserTest, + PackExtensionOnStartup) { + // Interesting case: because the --pack-extension switch results in Chrome + // immediately exiting, this test is effectively entirely tested between the + // SetUpCommandLine() method and when Chrome starts. This test body is never + // reached. That's okay -- the test still serves its purpose and *does* + // properly exercise this scenario, including checking the exit code from the + // browser -- but it means we can't put any logic here. +} + +} // namespace extensions
diff --git a/chrome/browser/feedback/android/family_info_feedback_source.cc b/chrome/browser/feedback/android/family_info_feedback_source.cc index 65e22e9..d1594f2 100644 --- a/chrome/browser/feedback/android/family_info_feedback_source.cc +++ b/chrome/browser/feedback/android/family_info_feedback_source.cc
@@ -75,7 +75,7 @@ } void FamilyInfoFeedbackSource::OnResponse( - supervised_user::ProtoFetcherStatus status, + const supervised_user::ProtoFetcherStatus& status, std::unique_ptr<kids_chrome_management::ListFamilyMembersResponse> response) { if (!status.IsOk()) { @@ -117,7 +117,7 @@ } void FamilyInfoFeedbackSource::OnFailure( - supervised_user::ProtoFetcherStatus status) { + const supervised_user::ProtoFetcherStatus& status) { DLOG(WARNING) << "ListFamilyMembers failed with status: " << status.ToString(); OnComplete();
diff --git a/chrome/browser/feedback/android/family_info_feedback_source.h b/chrome/browser/feedback/android/family_info_feedback_source.h index dd09273..1211e50 100644 --- a/chrome/browser/feedback/android/family_info_feedback_source.h +++ b/chrome/browser/feedback/android/family_info_feedback_source.h
@@ -43,12 +43,12 @@ friend class FamilyInfoFeedbackSourceForChildFilterBehaviorTest; void OnResponse( - supervised_user::ProtoFetcherStatus status, + const supervised_user::ProtoFetcherStatus& status, std::unique_ptr<kids_chrome_management::ListFamilyMembersResponse> response); void OnSuccess( const kids_chrome_management::ListFamilyMembersResponse& response); - void OnFailure(supervised_user::ProtoFetcherStatus status); + void OnFailure(const supervised_user::ProtoFetcherStatus& status); // Cleans up following the call to ListFamilyMembers void OnComplete();
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 3df772e..9045b03 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -1384,6 +1384,14 @@ "expiry_milestone": 125 }, { + "name": "cros-focus-mode", + "owners": [ + "richui@chromium.org", + "nupurjain@chromium.org" + ], + "expiry_milestone": 135 + }, + { "name": "cros-labs-continuous-overview-animation", "owners": [ "sammiequon@chromium.org", "chromeos-wm-corexp@google.com" ], "expiry_milestone": 125 @@ -2050,6 +2058,11 @@ "expiry_milestone": 130 }, { + "name": "enable-archive-tab-service", + "owners": [ "bjfong@google.com", "ckitagawa@chromium.org", "fredmello@chromium.org" ], + "expiry_milestone": 124 + }, + { "name": "enable-aria-element-reflection", "owners": [ "aleventhal@chromium.org", "//third_party/blink/renderer/modules/accessibility/OWNERS" ], "expiry_milestone": 105 @@ -2182,11 +2195,6 @@ "expiry_milestone":120 }, { - "name": "enable-close-tab-suggestions", - "owners": [ "bjfong@google.com", "ckitagawa@chromium.org", "fredmello@chromium.org" ], - "expiry_milestone": 122 - }, - { "name": "enable-cloud-identifiers", "owners": ["hendrich@chromium.org", "asully@chromium.org"], "expiry_milestone": 135 @@ -2214,11 +2222,6 @@ "expiry_milestone": 108 }, { - "name": "enable-commerce-merchant-viewer", - "owners": [ "chrome-shopping@google.com" ], - "expiry_milestone": 108 - }, - { "name": "enable-commerce-price-tracking", "owners": [ "chrome-shopping@google.com" ], "expiry_milestone": 108 @@ -3325,11 +3328,6 @@ "expiry_milestone": -1 }, { - "name": "enable-reading-list-account-storage", - "owners": [ "mmrashad@google.com", "mastiz@chromium.org", "myuu@google.com", "chrome-signin-team@google.com" ], - "expiry_milestone": 119 - }, - { "name": "enable-reading-list-sign-in-promo", "owners": [ "mmrashad@google.com", "mastiz@chromium.org", "myuu@google.com", "chrome-signin-team@google.com" ], "expiry_milestone": 119 @@ -3341,8 +3339,8 @@ }, { "name": "enable-remove-stale-policy-pinned-apps-from-shelf", - "owners": [ "greengrape@chromium.org" ], - "expiry_milestone": 122 + "owners": [ "greengrape@google.com" ], + "expiry_milestone": 125 }, { "name": "enable-resampling-scroll-events-experimental-prediction", @@ -4639,6 +4637,11 @@ "expiry_milestone": 124 }, { + "name": "hidpi-capture", + "owners": [ "//content/browser/media/capture/OWNERS" ], + "expiry_milestone": 118 + }, + { "name": "history-journeys", "owners": [ "tommycli@chromium.org", "chrome-journeys@google.com" ], "expiry_milestone": 125 @@ -4936,11 +4939,6 @@ "expiry_milestone": 120 }, { - "name": "ios-password-ui-split", - "owners": ["tmartino@chromium.org", "bling-integrations-team@google.com"], - "expiry_milestone": 110 - }, - { "name": "ios-payments-bottom-sheet", "owners": ["veronguyen@chromium.org", "sugoi@chromium.org", "tmartino@chromium.org", "bling-integrations-team@google.com"], "expiry_milestone": 120 @@ -5422,7 +5420,7 @@ { "name": "modern-tab-strip", "owners": [ "bling-flags@google.com" ], - "expiry_milestone": 92 + "expiry_milestone": 125 }, { "name": "mojo-linux-sharedmem", @@ -6636,14 +6634,6 @@ "expiry_milestone": 122 }, { - "name": "privacy-sandbox-settings-4", - "owners": [ - "sauski@chromium.org", - "olesiamarukhno@chromium.org", - "tommasin@chromium.org"], - "expiry_milestone": 120 - }, - { "name": "private-aggregation-developer-mode", "owners": [ "//content/browser/private_aggregation/OWNERS" @@ -6997,12 +6987,6 @@ "expiry_milestone": 126 }, { - "name": "restore-session-from-cache", - "owners": [ "justincohen@chromium.org", "gambard@chromium.org", "bling-flags@google.com" ], - // Needed for testing of native session restore flow on iOS. - "expiry_milestone": -1 - }, - { "name": "restore-synced-placeholder-tabs", "owners": [ "bjfong@google.com", "ckitagawa@chromium.org", "fredmello@chromium.org" ], "expiry_milestone": 123 @@ -7127,6 +7111,11 @@ "expiry_milestone": 92 }, { + "name": "screencast-v2", + "owners": [ "dorianbrandon@google.com","cros-edu-team@google.com"], + "expiry_milestone": 123 + }, + { "name": "screenshots-for-android-v2", "owners": [ "kenok@google.com", "addisonphelps@google.com", "jeffreycohen@chromium.org" ], "expiry_milestone": 115 @@ -7584,12 +7573,6 @@ "expiry_milestone": 125 }, { - "name": "synthesized-restore-session", - "owners": [ "justincohen@chromium.org", "ajuma@chromium.org" ], - // Needed for testing of native session restore flow on iOS. - "expiry_milestone": -1 - }, - { "name": "system-color-chooser", "owners": [ "bur@chromium.org", "chrome-mac-dev@google.com" ], "expiry_milestone": 123
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 2562c17..3065241 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -2953,10 +2953,6 @@ "enrolled and attested into the Privacy Sandbox experiment. See: " "https://developer.chrome.com/en/docs/privacy-sandbox/enroll/"; -const char kPrivacySandboxSettings4Name[] = "Privacy Sandbox Settings V4"; -const char kPrivacySandboxSettings4Description[] = - "Enables updated Privacy Sandbox UI"; - const char kPrivacySandboxProactiveTopicsBlockingName[] = "Privacy Sandbox Proactive Topics Blocking"; const char kPrivacySandboxProactiveTopicsBlockingDescription[] = @@ -3347,10 +3343,6 @@ const char kCommerceDeveloperDescription[] = "Allows users in the allowlist to enter the developer mode"; -const char kCommerceMerchantViewerAndroidName[] = "Merchant Viewer"; -const char kCommerceMerchantViewerAndroidDescription[] = - "Allows users to view merchant trust signals on eligible pages."; - const char kTabGroupsSaveId[] = "tab-groups-save"; const char kTabGroupsSaveName[] = "Tab Groups Save and Sync"; const char kTabGroupsSaveDescription[] = @@ -3639,6 +3631,12 @@ "persistent storage of device permissions and Web Bluetooth features such " "as BluetoothDevice.watchAdvertisements() and Bluetooth.getDevices()"; +const char kWebContentsCaptureHiDpiName[] = "HiDPI Tab Capture"; +const char kWebContentsCaptureHiDpiDescription[] = + "Enables HiDPI rendering for tab capture if the displayed content's " + "resolution is low compared to the capture size. This improves " + "legibility for viewers with higher-resolution screens."; + const char kWebMidiName[] = "Web MIDI"; const char kWebMidiDescription[] = "Enables the implementation of the Web MIDI API. When disabled the " @@ -3914,6 +3912,11 @@ "When enabled, app menu should show 'Mobile site' when showing desktop " "site, instead of showing 'Desktop Site' with checkbox"; +const char kArchiveTabServiceName[] = "Enable archive tab service"; +const char kArchiveTabServiceDescription[] = + "Archives suggested tabs for the user that haven't been used beyond a " + "certain time threshold as specified by the user."; + const char kBackGestureActivityTabProviderName[] = "Back Gesture Refactor (Activity Tab Provider)"; const char kBackGestureActivityTabProviderDescription[] = @@ -4006,12 +4009,6 @@ "Enable Chime SDK to receive push notification."; const char kChimeAndroidSdkName[] = "Use Chime SDK"; -const char kCloseTabSuggestionsName[] = "Enable close tab suggestions"; -const char kCloseTabSuggestionsDescription[] = - "Suggests to the user to close tabs that haven't been used beyond a " - "certain time threshold, if tab duplicates exist or based on tab launch " - "type, among other criteria."; - const char kCriticalPersistedTabDataName[] = "Enable CriticalPersistedTabData"; const char kCriticalPersistedTabDataDescription[] = "A new method of persisting Tab data across restarts has been devised " @@ -6555,6 +6552,10 @@ const char kFocusFollowsCursorDescription[] = "Enable window focusing by moving the cursor."; +const char kFocusModeName[] = "Focus Mode on ChromeOS"; +const char kFocusModeDescription[] = + "Focus mode on the OS with timer and task management functionalities."; + const char kForceReSyncDriveName[] = "Force resync drive"; const char kForceReSyncDriveDescription[] = "Enable Drive to forcibly resync office files."; @@ -7019,6 +7020,9 @@ "Enable jelly colors for the Scanning App. Requires " "jelly-colors flag to be enabled."; +const char kScreencastV2Name[] = "Screencast V2"; +const char kScreencastV2Description[] = "Enable V2 features for Screencast app"; + const char kShelfAutoHideSeparationName[] = "Enable separate shelf auto-hide preferences."; const char kShelfAutoHideSeparationDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 0cf2923..f972c1d 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -1694,9 +1694,6 @@ extern const char kPrivacySandboxEnrollmentOverridesName[]; extern const char kPrivacySandboxEnrollmentOverridesDescription[]; -extern const char kPrivacySandboxSettings4Name[]; -extern const char kPrivacySandboxSettings4Description[]; - extern const char kPrivacySandboxProactiveTopicsBlockingName[]; extern const char kPrivacySandboxProactiveTopicsBlockingDescription[]; @@ -1924,9 +1921,6 @@ extern const char kCommerceDeveloperName[]; extern const char kCommerceDeveloperDescription[]; -extern const char kCommerceMerchantViewerAndroidName[]; -extern const char kCommerceMerchantViewerAndroidDescription[]; - extern const char kTabGroupsSaveId[]; extern const char kTabGroupsSaveName[]; extern const char kTabGroupsSaveDescription[]; @@ -2263,6 +2257,9 @@ extern const char kAndroidHubName[]; extern const char kAndroidHubDescription[]; +extern const char kArchiveTabServiceName[]; +extern const char kArchiveTabServiceDescription[]; + extern const char kAutofillUseMobileLabelDisambiguationName[]; extern const char kAutofillUseMobileLabelDisambiguationDescription[]; @@ -2324,9 +2321,6 @@ extern const char kChimeAndroidSdkDescription[]; extern const char kChimeAndroidSdkName[]; -extern const char kCloseTabSuggestionsName[]; -extern const char kCloseTabSuggestionsDescription[]; - extern const char kCriticalPersistedTabDataName[]; extern const char kCriticalPersistedTabDataDescription[]; @@ -3763,6 +3757,9 @@ extern const char kFocusFollowsCursorName[]; extern const char kFocusFollowsCursorDescription[]; +extern const char kFocusModeName[]; +extern const char kFocusModeDescription[]; + extern const char kForceReSyncDriveName[]; extern const char kForceReSyncDriveDescription[]; @@ -4027,6 +4024,9 @@ extern const char kScanningAppJellyName[]; extern const char kScanningAppJellyDescription[]; +extern const char kScreencastV2Name[]; +extern const char kScreencastV2Description[]; + extern const char kSecondaryGoogleAccountUsageName[]; extern const char kSecondaryGoogleAccountUsageDescription[];
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc index 344b521..b4ba620 100644 --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -175,6 +175,7 @@ &kAndroidVisibleUrlTruncation, &kAnimatedImageDragShadow, &kAppMenuMobileSiteOption, + &kArchiveTabService, &kAuxiliarySearchDonation, &kAvoidSelectedTabFocusOnLayoutDoneShowing, &kBackGestureActivityTabProvider, @@ -187,7 +188,6 @@ &kCacheActivityTaskID, &kCastDeviceFilter, &kClearOmniboxFocusAfterNavigation, - &kCloseTabSuggestions, &kCloseTabSaveTabList, &kCriticalPersistedTabData, &kCreateNewTabInitializeRenderer, @@ -511,6 +511,10 @@ "AppMenuMobileSiteOption", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kArchiveTabService, + "ArchiveTabService", + base::FEATURE_DISABLED_BY_DEFAULT); + BASE_FEATURE(kAuxiliarySearchDonation, "AuxiliarySearchDonation", base::FEATURE_DISABLED_BY_DEFAULT); @@ -544,10 +548,6 @@ "ClearOmniboxFocusAfterNavigation", base::FEATURE_ENABLED_BY_DEFAULT); -BASE_FEATURE(kCloseTabSuggestions, - "CloseTabSuggestions", - base::FEATURE_DISABLED_BY_DEFAULT); - BASE_FEATURE(kCloseTabSaveTabList, "CloseTabSaveTabList", base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h index a8c4521..9de7483 100644 --- a/chrome/browser/flags/android/chrome_feature_list.h +++ b/chrome/browser/flags/android/chrome_feature_list.h
@@ -32,6 +32,7 @@ BASE_DECLARE_FEATURE(kAndroidVisibleUrlTruncation); BASE_DECLARE_FEATURE(kAnimatedImageDragShadow); BASE_DECLARE_FEATURE(kAppMenuMobileSiteOption); +BASE_DECLARE_FEATURE(kArchiveTabService); BASE_DECLARE_FEATURE(kAuxiliarySearchDonation); BASE_DECLARE_FEATURE(kAvoidSelectedTabFocusOnLayoutDoneShowing); BASE_DECLARE_FEATURE(kBackGestureActivityTabProvider); @@ -43,7 +44,6 @@ BASE_DECLARE_FEATURE(kBoardingPassDetector); BASE_DECLARE_FEATURE(kCacheActivityTaskID); BASE_DECLARE_FEATURE(kClearOmniboxFocusAfterNavigation); -BASE_DECLARE_FEATURE(kCloseTabSuggestions); BASE_DECLARE_FEATURE(kCloseTabSaveTabList); BASE_DECLARE_FEATURE(kCreateNewTabInitializeRenderer); BASE_DECLARE_FEATURE(kCriticalPersistedTabData);
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java index d6cc340d..c77997a7 100644 --- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -128,6 +128,7 @@ "AndroidNoVisibleHintForTablets"; public static final String ANIMATED_IMAGE_DRAG_SHADOW = "AnimatedImageDragShadow"; public static final String APP_MENU_MOBILE_SITE_OPTION = "AppMenuMobileSiteOption"; + public static final String ARCHIVE_TAB_SERVICE = "ArchiveTabService"; public static final String AUTOFILL_ADDRESS_PROFILE_SAVE_PROMPT_NICKNAME_SUPPORT = "AutofillAddressProfileSavePromptNicknameSupport"; public static final String AUTOFILL_ALLOW_NON_HTTP_ACTIVATION = @@ -212,7 +213,6 @@ public static final String CHROME_SURVEY_NEXT_ANDROID = "ChromeSurveyNextAndroid"; public static final String CLEAR_OMNIBOX_FOCUS_AFTER_NAVIGATION = "ClearOmniboxFocusAfterNavigation"; - public static final String CLOSE_TAB_SUGGESTIONS = "CloseTabSuggestions"; public static final String CLOSE_TAB_SAVE_TAB_LIST = "CloseTabSaveTabList"; public static final String COLLECT_ANDROID_FRAME_TIMELINE_METRICS = "CollectAndroidFrameTimelineMetrics"; @@ -518,6 +518,7 @@ public static final CachedFlag sAndroidHub = new CachedFlag(ANDROID_HUB, false); public static final CachedFlag sAppMenuMobileSiteOption = new CachedFlag(APP_MENU_MOBILE_SITE_OPTION, false); + public static final CachedFlag sArchiveTabService = new CachedFlag(ARCHIVE_TAB_SERVICE, false); public static final CachedFlag sBackGestureActivityTabProvider = new CachedFlag(BACK_GESTURE_ACTIVITY_TAB_PROVIDER, false); public static final CachedFlag sBackGestureRefactorActivityAndroid = @@ -551,8 +552,6 @@ new CachedFlag(CCT_RESIZABLE_SIDE_SHEET_FOR_THIRD_PARTIES, true); public static final CachedFlag sCctToolbarCustomizations = new CachedFlag(CCT_TOOLBAR_CUSTOMIZATIONS, true); - public static final CachedFlag sCloseTabSuggestions = - new CachedFlag(CLOSE_TAB_SUGGESTIONS, false); public static final CachedFlag sCloseTabSaveTabList = new CachedFlag(CLOSE_TAB_SAVE_TAB_LIST, true); public static final CachedFlag sCollectAndroidFrameTimelineMetrics = @@ -661,6 +660,7 @@ sAndroidAppIntegration, sAndroidHub, sAppMenuMobileSiteOption, + sArchiveTabService, sBackGestureActivityTabProvider, sBackGestureRefactorActivityAndroid, sBackGestureRefactorAndroid, @@ -679,7 +679,6 @@ sCctResizableSideSheet, sCctResizableSideSheetForThirdParties, sCctToolbarCustomizations, - sCloseTabSuggestions, sCloseTabSaveTabList, sCollectAndroidFrameTimelineMetrics, sCommandLineOnNonRooted,
diff --git a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DelegateButtonData.java b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DelegateButtonData.java index 08892a3f..24718bc 100644 --- a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DelegateButtonData.java +++ b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DelegateButtonData.java
@@ -27,6 +27,11 @@ } @Override + public String resolveContentDescription(Context context) { + return mDelegateButtonData.resolveContentDescription(context); + } + + @Override public Drawable resolveIcon(Context context) { return mDelegateButtonData.resolveIcon(context); }
diff --git a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DelegateButtonDataUnitTest.java b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DelegateButtonDataUnitTest.java index 057cc6e..2f86ccf2 100644 --- a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DelegateButtonDataUnitTest.java +++ b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DelegateButtonDataUnitTest.java
@@ -36,11 +36,15 @@ public void testFocusChangesPane() { Context context = ApplicationProvider.getApplicationContext(); String expectedText = "foo"; + String expectedContentDescription = "bar"; when(mDisplayButtonData.resolveText(context)).thenReturn(expectedText); + when(mDisplayButtonData.resolveContentDescription(context)) + .thenReturn(expectedContentDescription); when(mDisplayButtonData.resolveIcon(context)).thenReturn(mExpectedDrawable); FullButtonData buttonData = new DelegateButtonData(mDisplayButtonData, mRunnable); assertEquals(expectedText, buttonData.resolveText(context)); + assertEquals(expectedContentDescription, buttonData.resolveContentDescription(context)); assertEquals(mExpectedDrawable, buttonData.resolveIcon(context)); assertEquals(mRunnable, buttonData.getOnPressRunnable()); }
diff --git a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DisplayButtonData.java b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DisplayButtonData.java index 0ad0d6b..9b60b6e 100644 --- a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DisplayButtonData.java +++ b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DisplayButtonData.java
@@ -8,14 +8,18 @@ import android.graphics.drawable.Drawable; /** - * Combination of text and icon. Either or both may ultimately be used for the actual button. Allows - * implementors to delay resolving the underlying Android resources until bind time. This interface - * should be used directly when implementor is not responsible for handling effect of the button. + * Combination of text, content description, and icon. Any combination of text and icon both may + * ultimately be used for the actual button. Allows implementors to delay resolving the underlying + * Android resources until bind time. This interface should be used directly when implementor is not + * responsible for handling effect of the button. */ public interface DisplayButtonData { /** Returns the text that should be shown for this button. */ String resolveText(Context context); + /** Returns the content description for this button. */ + String resolveContentDescription(Context context); + /** Returns the icon that should be shown for this button. */ Drawable resolveIcon(Context context); }
diff --git a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DrawableButtonData.java b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DrawableButtonData.java index 122e02c..480eb82 100644 --- a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DrawableButtonData.java +++ b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DrawableButtonData.java
@@ -15,14 +15,18 @@ /** Resolves a non-resource drawable's button data. */ public class DrawableButtonData implements DisplayButtonData { private final @StringRes int mTextRes; + private final @StringRes int mContentDescriptionRes; private final Drawable mDrawable; /** * @param textRes The text resource to resolve. + * @param contentDescriptionRes The content description resource to resolve. * @param drawable The non-resource {@link Drawable} to display. */ - public DrawableButtonData(@StringRes int textRes, Drawable drawable) { + public DrawableButtonData( + @StringRes int textRes, @StringRes int contentDescriptionRes, Drawable drawable) { mTextRes = textRes; + mContentDescriptionRes = contentDescriptionRes; mDrawable = drawable; } @@ -32,13 +36,18 @@ } @Override + public String resolveContentDescription(Context context) { + return context.getString(mContentDescriptionRes); + } + + @Override public Drawable resolveIcon(Context context) { return mDrawable; } @Override public int hashCode() { - return Objects.hash(mTextRes, mDrawable); + return Objects.hash(mTextRes, mContentDescriptionRes, mDrawable); } @Override @@ -47,7 +56,9 @@ return true; } if (o instanceof DrawableButtonData that) { - return mTextRes == that.mTextRes && mDrawable.equals(that.mDrawable); + return mTextRes == that.mTextRes + && mContentDescriptionRes == that.mContentDescriptionRes + && mDrawable.equals(that.mDrawable); } return false; }
diff --git a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DrawableButtonDataUnitTest.java b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DrawableButtonDataUnitTest.java index f79e625..919aae4a 100644 --- a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DrawableButtonDataUnitTest.java +++ b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/DrawableButtonDataUnitTest.java
@@ -27,11 +27,14 @@ public class DrawableButtonDataUnitTest { @Test @SmallTest - public void testResolveTextAndIcon() { + public void testResolveTextAndIconAndContentDescription() { Context context = ApplicationProvider.getApplicationContext(); Drawable drawable = createBitmapDrawable(); - DisplayButtonData buttonData = new DrawableButtonData(R.string.button_new_tab, drawable); + DisplayButtonData buttonData = + new DrawableButtonData( + R.string.button_new_tab, R.string.button_new_incognito_tab, drawable); assertNotEquals(0, buttonData.resolveText(context).length()); + assertNotEquals(0, buttonData.resolveContentDescription(context).length()); assertEquals(drawable, buttonData.resolveIcon(context)); } @@ -39,8 +42,12 @@ @SmallTest public void testHashCode() { Drawable drawable = createBitmapDrawable(); - DisplayButtonData buttonData1 = new DrawableButtonData(R.string.button_new_tab, drawable); - DisplayButtonData buttonData2 = new DrawableButtonData(R.string.button_new_tab, drawable); + DisplayButtonData buttonData1 = + new DrawableButtonData( + R.string.button_new_tab, R.string.button_new_incognito_tab, drawable); + DisplayButtonData buttonData2 = + new DrawableButtonData( + R.string.button_new_tab, R.string.button_new_incognito_tab, drawable); // Only test positive case, since we're not guaranteed to get different hash codes for // different values. assertEquals(buttonData1.hashCode(), buttonData2.hashCode()); @@ -50,13 +57,28 @@ @SmallTest public void testEquals() { Drawable drawable = createBitmapDrawable(); - DisplayButtonData buttonData = new DrawableButtonData(R.string.button_new_tab, drawable); + DisplayButtonData buttonData = + new DrawableButtonData( + R.string.button_new_tab, R.string.button_new_incognito_tab, drawable); assertEquals(buttonData, buttonData); - assertEquals(buttonData, new DrawableButtonData(R.string.button_new_tab, drawable)); + assertEquals( + buttonData, + new DrawableButtonData( + R.string.button_new_tab, R.string.button_new_incognito_tab, drawable)); assertNotEquals( - buttonData, new DrawableButtonData(R.string.button_new_incognito_tab, drawable)); + buttonData, + new DrawableButtonData( + R.string.button_new_incognito_tab, + R.string.button_new_incognito_tab, + drawable)); Drawable newDrawable = createBitmapDrawable(); - assertNotEquals(buttonData, new DrawableButtonData(R.string.button_new_tab, newDrawable)); + assertNotEquals( + buttonData, + new DrawableButtonData( + R.string.button_new_tab, R.string.button_new_incognito_tab, newDrawable)); + assertNotEquals( + buttonData, + new DrawableButtonData(R.string.button_new_tab, R.string.button_new_tab, drawable)); // assert*Equals will not invoke #equals on a null object, manually call it instead. assertFalse(buttonData.equals(null));
diff --git a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/ResourceButtonData.java b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/ResourceButtonData.java index b20a61d..aefbf717 100644 --- a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/ResourceButtonData.java +++ b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/ResourceButtonData.java
@@ -17,11 +17,22 @@ /** Resolves data by reading from Android resources on demand. */ public class ResourceButtonData implements DisplayButtonData { private final @StringRes int mTextRes; + private final @StringRes int mContentDescriptionRes; private final @DrawableRes int mIconRes; - /** Stores resource ids until resolution time. */ - public ResourceButtonData(@StringRes int textRes, @DrawableRes int iconRes) { + /** + * Stores resource ids until resolution time. + * + * @param textRes The text resource to resolve. + * @param contentDescriptionRes The content description resource to resolve. + * @param drawableRes The drawable resource to resolve. + */ + public ResourceButtonData( + @StringRes int textRes, + @StringRes int contentDescriptionRes, + @DrawableRes int iconRes) { mTextRes = textRes; + mContentDescriptionRes = contentDescriptionRes; mIconRes = iconRes; } @@ -31,13 +42,18 @@ } @Override + public String resolveContentDescription(Context context) { + return context.getString(mContentDescriptionRes); + } + + @Override public Drawable resolveIcon(Context context) { return AppCompatResources.getDrawable(context, mIconRes); } @Override public int hashCode() { - return Objects.hash(mTextRes, mIconRes); + return Objects.hash(mTextRes, mContentDescriptionRes, mIconRes); } @Override @@ -45,10 +61,11 @@ if (this == o) { return true; } - if (!(o instanceof ResourceButtonData)) { - return false; + if (o instanceof ResourceButtonData that) { + return mTextRes == that.mTextRes + && mContentDescriptionRes == that.mContentDescriptionRes + && mIconRes == that.mIconRes; } - ResourceButtonData that = (ResourceButtonData) o; - return mTextRes == that.mTextRes && mIconRes == that.mIconRes; + return false; } }
diff --git a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/ResourceButtonDataUnitTest.java b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/ResourceButtonDataUnitTest.java index be167c2..f13cd58 100644 --- a/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/ResourceButtonDataUnitTest.java +++ b/chrome/browser/hub/android/java/src/org/chromium/chrome/browser/hub/ResourceButtonDataUnitTest.java
@@ -24,10 +24,13 @@ public class ResourceButtonDataUnitTest { @Test @SmallTest - public void testResolveTextAndIcon() { + public void testResolveTextAndIconAndContentDescription() { Context context = ApplicationProvider.getApplicationContext(); DisplayButtonData buttonData = - new ResourceButtonData(R.string.button_new_tab, R.drawable.ic_add); + new ResourceButtonData( + R.string.button_new_tab, + R.string.button_new_incognito_tab, + R.drawable.ic_add); assertNotEquals(0, buttonData.resolveText(context).length()); assertNotNull(buttonData.resolveIcon(context)); } @@ -36,9 +39,15 @@ @SmallTest public void testHashCode() { DisplayButtonData buttonData1 = - new ResourceButtonData(R.string.button_new_tab, R.drawable.ic_add); + new ResourceButtonData( + R.string.button_new_tab, + R.string.button_new_incognito_tab, + R.drawable.ic_add); DisplayButtonData buttonData2 = - new ResourceButtonData(R.string.button_new_tab, R.drawable.ic_add); + new ResourceButtonData( + R.string.button_new_tab, + R.string.button_new_incognito_tab, + R.drawable.ic_add); // Only test positive case, since we're not guaranteed to get different hash codes for // different values. assertEquals(buttonData1.hashCode(), buttonData2.hashCode()); @@ -48,16 +57,33 @@ @SmallTest public void testEquals() { DisplayButtonData buttonData = - new ResourceButtonData(R.string.button_new_tab, R.drawable.ic_add); + new ResourceButtonData( + R.string.button_new_tab, + R.string.button_new_incognito_tab, + R.drawable.ic_add); assertEquals(buttonData, buttonData); assertEquals( - buttonData, new ResourceButtonData(R.string.button_new_tab, R.drawable.ic_add)); + buttonData, + new ResourceButtonData( + R.string.button_new_tab, + R.string.button_new_incognito_tab, + R.drawable.ic_add)); assertNotEquals( buttonData, - new ResourceButtonData(R.string.button_new_incognito_tab, R.drawable.ic_add)); + new ResourceButtonData( + R.string.button_new_incognito_tab, + R.string.button_new_incognito_tab, + R.drawable.ic_add)); assertNotEquals( buttonData, - new ResourceButtonData(R.string.button_new_tab, R.drawable.ic_history_24dp)); + new ResourceButtonData( + R.string.button_new_tab, + R.string.button_new_incognito_tab, + R.drawable.ic_history_24dp)); + assertNotEquals( + buttonData, + new ResourceButtonData( + R.string.button_new_tab, R.string.button_new_tab, R.drawable.ic_add)); // assert*Equals will not invoke #equals on a null object, manually call it instead. assertFalse(buttonData.equals(null));
diff --git a/chrome/browser/hub/internal/android/java/src/org/chromium/chrome/browser/hub/HubPaneHostViewRenderTest.java b/chrome/browser/hub/internal/android/java/src/org/chromium/chrome/browser/hub/HubPaneHostViewRenderTest.java index 6b64b04c..d00dfff 100644 --- a/chrome/browser/hub/internal/android/java/src/org/chromium/chrome/browser/hub/HubPaneHostViewRenderTest.java +++ b/chrome/browser/hub/internal/android/java/src/org/chromium/chrome/browser/hub/HubPaneHostViewRenderTest.java
@@ -73,7 +73,8 @@ @Feature({"RenderTest"}) public void test() throws Exception { DisplayButtonData displayButtonData = - new ResourceButtonData(R.string.button_new_tab, R.drawable.ic_add); + new ResourceButtonData( + R.string.button_new_tab, R.string.button_new_tab, R.drawable.ic_add); FullButtonData fullButtonData = new DelegateButtonData(displayButtonData, () -> {}); TestThreadUtils.runOnUiThreadBlocking( () -> {
diff --git a/chrome/browser/hub/internal/android/java/src/org/chromium/chrome/browser/hub/HubPaneHostViewUnitTest.java b/chrome/browser/hub/internal/android/java/src/org/chromium/chrome/browser/hub/HubPaneHostViewUnitTest.java index 8cdf044..e9b3257 100644 --- a/chrome/browser/hub/internal/android/java/src/org/chromium/chrome/browser/hub/HubPaneHostViewUnitTest.java +++ b/chrome/browser/hub/internal/android/java/src/org/chromium/chrome/browser/hub/HubPaneHostViewUnitTest.java
@@ -67,7 +67,8 @@ @MediumTest public void testActionButtonVisibility() { DisplayButtonData displayButtonData = - new ResourceButtonData(R.string.button_new_tab, R.drawable.ic_add); + new ResourceButtonData( + R.string.button_new_tab, R.string.button_new_tab, R.drawable.ic_add); FullButtonData fullButtonData = new DelegateButtonData(displayButtonData, mOnActionButton); View button = mPaneHost.findViewById(R.id.action_button); assertEquals(View.GONE, button.getVisibility()); @@ -83,7 +84,8 @@ @MediumTest public void testActionButtonCallback() { DisplayButtonData displayButtonData = - new ResourceButtonData(R.string.button_new_tab, R.drawable.ic_add); + new ResourceButtonData( + R.string.button_new_tab, R.string.button_new_tab, R.drawable.ic_add); FullButtonData fullButtonData = new DelegateButtonData(displayButtonData, mOnActionButton); mPropertyModel.set(ACTION_BUTTON_DATA, fullButtonData);
diff --git a/chrome/browser/interest_group/interest_group_permissions_browsertest.cc b/chrome/browser/interest_group/interest_group_permissions_browsertest.cc index ccf3fe8..6ae463a 100644 --- a/chrome/browser/interest_group/interest_group_permissions_browsertest.cc +++ b/chrome/browser/interest_group/interest_group_permissions_browsertest.cc
@@ -39,7 +39,8 @@ features::kPrivacySandboxAdsAPIsOverride, privacy_sandbox::kPrivacySandboxSettings4}, /*disabled_features=*/ - {blink::features::kFencedFrames}); + {blink::features::kFencedFrames, + blink::features::kFledgeEnforceKAnonymity}); } void SetUpOnMainThread() override {
diff --git a/chrome/browser/internal b/chrome/browser/internal index 0f2c0c1..6f0dc0a 160000 --- a/chrome/browser/internal +++ b/chrome/browser/internal
@@ -1 +1 @@ -Subproject commit 0f2c0c17153168a10ee3206f800580f05aea966f +Subproject commit 6f0dc0a0599614e23371f3b66b671d8b31f42c5b
diff --git a/chrome/browser/media/webrtc/webrtc_getdisplaymedia_browsertest.cc b/chrome/browser/media/webrtc/webrtc_getdisplaymedia_browsertest.cc index 8933fd52..b63ff1b 100644 --- a/chrome/browser/media/webrtc/webrtc_getdisplaymedia_browsertest.cc +++ b/chrome/browser/media/webrtc/webrtc_getdisplaymedia_browsertest.cc
@@ -111,6 +111,7 @@ }; struct TestConfigForHiDpi { + bool enable_hidpi; int constraint_width; int constraint_height; }; @@ -931,11 +932,19 @@ static constexpr int kBrowserWindowWidth = 800; static constexpr int kBrowserWindowHeight = 600; + bool enable_hidpi() const { return test_config_.enable_hidpi; } int constraint_width() const { return test_config_.constraint_width; } int constraint_height() const { return test_config_.constraint_height; } void SetUpInProcessBrowserTestFixture() override { + if (enable_hidpi()) { + feature_list_.InitAndEnableFeature(media::kWebContentsCaptureHiDpi); + } else { + feature_list_.InitAndDisableFeature(media::kWebContentsCaptureHiDpi); + } + WebRtcTestBase::SetUpInProcessBrowserTestFixture(); + DetectErrorsInJavaScript(); } @@ -1002,6 +1011,7 @@ .ExtractString(); } + base::test::ScopedFeatureList feature_list_; const TestConfigForHiDpi test_config_; raw_ptr<content::WebContents, AcrossTasksDanglingUntriaged> tab_ = nullptr; }; @@ -1039,8 +1049,9 @@ // If the video size is higher resolution than the browser window // size, expect that HiDPI mode should be active. This requires // the feature to be enabled. - const bool expect_hidpi = constraint_width() > kBrowserWindowWidth && - constraint_height() > kBrowserWindowHeight; + bool expect_hidpi = enable_hidpi() && + constraint_width() > kBrowserWindowWidth && + constraint_height() > kBrowserWindowHeight; double device_pixel_ratio = GetDevicePixelRatio(); if (expect_hidpi) { @@ -1059,9 +1070,14 @@ // (cf. kBrowserWindowWidth and kBrowserWindowHeight in // GetDisplayMediaHiDpiBrowserTest above), and the large sizes must be // significantly larger than the browser window size. - testing::Values(TestConfigForHiDpi{/*constraint_width=*/640, + testing::Values(TestConfigForHiDpi{/*enable_hidpi=*/false, + /*constraint_width=*/3840, + /*constraint_height=*/2160}, + TestConfigForHiDpi{/*enable_hidpi=*/true, + /*constraint_width=*/640, /*constraint_height=*/480}, - TestConfigForHiDpi{/*constraint_width=*/3840, + TestConfigForHiDpi{/*enable_hidpi=*/true, + /*constraint_width=*/3840, /*constraint_height=*/2160})); #endif
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc index f8894433..1bdf35c2 100644 --- a/chrome/browser/metrics/chrome_metrics_service_client.cc +++ b/chrome/browser/metrics/chrome_metrics_service_client.cc
@@ -159,6 +159,7 @@ #include "chrome/browser/ash/settings/device_settings_service.h" #include "chrome/browser/ash/system_web_apps/apps/personalization_app/keyboard_backlight_color_metrics_provider.h" #include "chrome/browser/ash/system_web_apps/apps/personalization_app/personalization_app_theme_metrics_provider.h" +#include "chrome/browser/ash/system_web_apps/apps/personalization_app/wallpaper_metrics_provider.h" #include "chrome/browser/metrics/ambient_mode_metrics_provider.h" #include "chrome/browser/metrics/assistant_service_metrics_provider.h" #include "chrome/browser/metrics/chromeos_family_link_user_metrics_provider.h" @@ -971,6 +972,8 @@ std::make_unique<PersonalizationAppThemeMetricsProvider>()); metrics_service_->RegisterMetricsProvider( std::make_unique<ash::settings::OsSettingsMetricsProvider>()); + metrics_service_->RegisterMetricsProvider( + std::make_unique<WallpaperMetricsProvider>()); #endif // BUILDFLAG(IS_CHROMEOS_ASH) #if !BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/metrics/chrome_metrics_service_client_unittest.cc b/chrome/browser/metrics/chrome_metrics_service_client_unittest.cc index 49e6e76..2a0468cb 100644 --- a/chrome/browser/metrics/chrome_metrics_service_client_unittest.cc +++ b/chrome/browser/metrics/chrome_metrics_service_client_unittest.cc
@@ -240,8 +240,8 @@ // PersonalizationAppThemeMetricsProvider, PrinterMetricsProvider, // FamilyUserMetricsProvider, FamilyLinkUserMetricsProvider, // UpdateEngineMetricsProvider, OsSettingsMetricsProvider, - // and UserTypeByDeviceTypeMetricsProvider. - expected_providers += 13; + // UserTypeByDeviceTypeMetricsProvider, and WallpaperMetricsProvider. + expected_providers += 14; // StructuredMetricsProvider. if (!base::FeatureList::IsEnabled(
diff --git a/chrome/browser/nearby_sharing/internal b/chrome/browser/nearby_sharing/internal index f7a3a3e9..c7dd8f2 160000 --- a/chrome/browser/nearby_sharing/internal +++ b/chrome/browser/nearby_sharing/internal
@@ -1 +1 @@ -Subproject commit f7a3a3e99e2606d37b8adc16f66dd5803d652d8c +Subproject commit c7dd8f2ba6f41ff0676995239789b84f4e26596d
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc index 74544d1..69630db2 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client.cc +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -655,14 +655,6 @@ #endif // BUILDFLAG(IS_ANDROID) } -void ChromePasswordManagerClient::NotifyKeychainError() { -#if BUILDFLAG(IS_MAC) - PasswordsClientUIDelegate* manage_passwords_ui_controller = - PasswordsClientUIDelegateFromWebContents(web_contents()); - manage_passwords_ui_controller->OnKeychainError(); -#endif -} - void ChromePasswordManagerClient::TriggerReauthForPrimaryAccount( signin_metrics::ReauthAccessPoint access_point, base::OnceCallback<void(ReauthSucceeded)> reauth_callback) {
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.h b/chrome/browser/password_manager/chrome_password_manager_client.h index ec7684f..2860ee8 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client.h +++ b/chrome/browser/password_manager/chrome_password_manager_client.h
@@ -193,7 +193,6 @@ password_manager::CredentialLeakType leak_type, const GURL& url, const std::u16string& username) override; - void NotifyKeychainError() override; void TriggerReauthForPrimaryAccount( signin_metrics::ReauthAccessPoint access_point, base::OnceCallback<void(ReauthSucceeded)> reauth_callback) override;
diff --git a/chrome/browser/password_manager/password_manager_test_base.cc b/chrome/browser/password_manager/password_manager_test_base.cc index 38e226f8..199904b 100644 --- a/chrome/browser/password_manager/password_manager_test_base.cc +++ b/chrome/browser/password_manager/password_manager_test_base.cc
@@ -32,6 +32,7 @@ #include "components/autofill/core/browser/autofill_test_utils.h" #include "components/password_manager/core/browser/features/password_features.h" #include "components/password_manager/core/browser/password_manager_test_utils.h" +#include "components/password_manager/core/browser/password_store/password_store_results_observer.h" #include "components/password_manager/core/browser/password_store/test_password_store.h" #include "components/sync/test/test_sync_service.h" #include "content/public/browser/browser_thread.h" @@ -389,26 +390,6 @@ password_manager::ui::WILL_DELETE_UNSYNCED_ACCOUNT_PASSWORDS_STATE); } -PasswordStoreResultsObserver::PasswordStoreResultsObserver() = default; -PasswordStoreResultsObserver::~PasswordStoreResultsObserver() = default; - -void PasswordStoreResultsObserver::OnGetPasswordStoreResults( - std::vector<std::unique_ptr<password_manager::PasswordForm>> results) { - results_ = std::move(results); - run_loop_.Quit(); -} - -base::WeakPtr<password_manager::PasswordStoreConsumer> -PasswordStoreResultsObserver::GetWeakPtr() { - return weak_ptr_factory_.GetWeakPtr(); -} - -std::vector<std::unique_ptr<password_manager::PasswordForm>> -PasswordStoreResultsObserver::WaitForResults() { - run_loop_.Run(); - return std::move(results_); -} - PasswordManagerBrowserTestBase::PasswordManagerBrowserTestBase() : https_test_server_(net::EmbeddedTestServer::TYPE_HTTPS), web_contents_(nullptr) {} @@ -491,7 +472,7 @@ scoped_refptr<password_manager::PasswordStoreInterface> profile_password_store = ProfilePasswordStoreFactory::GetForProfile( browser->profile(), ServiceAccessType::IMPLICIT_ACCESS); - PasswordStoreResultsObserver profile_syncer; + password_manager::PasswordStoreResultsObserver profile_syncer; profile_password_store->GetAllLoginsWithAffiliationAndBrandingInformation( profile_syncer.GetWeakPtr()); profile_syncer.WaitForResults(); @@ -500,7 +481,7 @@ account_password_store = AccountPasswordStoreFactory::GetForProfile( browser->profile(), ServiceAccessType::IMPLICIT_ACCESS); if (account_password_store) { - PasswordStoreResultsObserver account_syncer; + password_manager::PasswordStoreResultsObserver account_syncer; account_password_store->GetAllLoginsWithAffiliationAndBrandingInformation( account_syncer.GetWeakPtr()); account_syncer.WaitForResults();
diff --git a/chrome/browser/password_manager/password_manager_test_base.h b/chrome/browser/password_manager/password_manager_test_base.h index 197f3e2..202e576 100644 --- a/chrome/browser/password_manager/password_manager_test_base.h +++ b/chrome/browser/password_manager/password_manager_test_base.h
@@ -20,10 +20,6 @@ class ManagePasswordsUIController; -namespace password_manager { -struct PasswordForm; -} // namespace password_manager - // Checks the save password prompt for a specified WebContents and allows // accepting saving passwords through it. class BubbleObserver { @@ -104,34 +100,6 @@ const raw_ptr<ManagePasswordsUIController> passwords_ui_controller_; }; -// A helper class that synchronously waits until the password store handles a -// GetLogins() request. -class PasswordStoreResultsObserver - : public password_manager::PasswordStoreConsumer { - public: - PasswordStoreResultsObserver(); - - PasswordStoreResultsObserver(const PasswordStoreResultsObserver&) = delete; - PasswordStoreResultsObserver& operator=(const PasswordStoreResultsObserver&) = - delete; - - ~PasswordStoreResultsObserver() override; - - // Waits for OnGetPasswordStoreResults() and returns the result. - std::vector<std::unique_ptr<password_manager::PasswordForm>> WaitForResults(); - - base::WeakPtr<PasswordStoreConsumer> GetWeakPtr(); - - private: - void OnGetPasswordStoreResults( - std::vector<std::unique_ptr<password_manager::PasswordForm>> results) - override; - - base::RunLoop run_loop_; - std::vector<std::unique_ptr<password_manager::PasswordForm>> results_; - base::WeakPtrFactory<PasswordStoreResultsObserver> weak_ptr_factory_{this}; -}; - class PasswordManagerBrowserTestBase : public CertVerifierBrowserTest { public: PasswordManagerBrowserTestBase();
diff --git a/chrome/browser/policy/battery_saver_policy_handler.cc b/chrome/browser/policy/battery_saver_policy_handler.cc new file mode 100644 index 0000000..97079d8 --- /dev/null +++ b/chrome/browser/policy/battery_saver_policy_handler.cc
@@ -0,0 +1,60 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/policy/battery_saver_policy_handler.h" + +#include "base/numerics/safe_conversions.h" +#include "components/performance_manager/public/user_tuning/prefs.h" +#include "components/policy/core/common/policy_map.h" +#include "components/policy/policy_constants.h" +#include "components/prefs/pref_value_map.h" + +#if BUILDFLAG(IS_CHROMEOS_ASH) +#include "ash/constants/ash_pref_names.h" +#endif // BUILDFLAG(IS_CHROMEOS_ASH) + +namespace policy { + +using performance_manager::user_tuning::prefs::BatterySaverModeState; + +BatterySaverPolicyHandler::BatterySaverPolicyHandler() + : TypeCheckingPolicyHandler(key::kBatterySaverModeAvailability, + base::Value::Type::INTEGER) {} + +void BatterySaverPolicyHandler::ApplyPolicySettings(const PolicyMap& policies, + PrefValueMap* prefs) { + const base::Value* value = policies.GetValue( + key::kBatterySaverModeAvailability, base::Value::Type::INTEGER); + if (!value) { + return; + } + switch (value->GetInt()) { + case base::strict_cast<int>(BatterySaverModeState::kDisabled): +#if BUILDFLAG(IS_CHROMEOS_ASH) + prefs->SetBoolean(ash::prefs::kPowerBatterySaver, false); +#endif // BUILDFLAG(IS_CHROMEOS_ASH) + + prefs->SetInteger( + performance_manager::user_tuning::prefs::kBatterySaverModeState, + base::strict_cast<int>(BatterySaverModeState::kDisabled)); + break; + + case base::strict_cast<int>(BatterySaverModeState::kEnabledBelowThreshold): + case base::strict_cast<int>(BatterySaverModeState::kEnabledOnBattery): + // kEnabledOnBattery as a policy value is deprecated and treated as + // kEnabledBelowThreshold to unify policy with ChromeOS Battery Saver + // which does not support it. + prefs->SetInteger( + performance_manager::user_tuning::prefs::kBatterySaverModeState, + base::strict_cast<int>( + BatterySaverModeState::kEnabledBelowThreshold)); + + // kEnabledBelowThreshold is the default behavior of ChromeOS Battery + // Saver, so we don't need apply any policy to + // ash::prefs::kPowerBatterySaver. + break; + } +} + +} // namespace policy
diff --git a/chrome/browser/policy/battery_saver_policy_handler.h b/chrome/browser/policy/battery_saver_policy_handler.h new file mode 100644 index 0000000..91eb566c --- /dev/null +++ b/chrome/browser/policy/battery_saver_policy_handler.h
@@ -0,0 +1,33 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_POLICY_BATTERY_SAVER_POLICY_HANDLER_H_ +#define CHROME_BROWSER_POLICY_BATTERY_SAVER_POLICY_HANDLER_H_ + +#include "components/policy/core/browser/configuration_policy_handler.h" + +class PrefValueMap; + +namespace policy { + +class PolicyMap; + +// Maps the BatterySaverModeAvailability policy, to the battery saver +// controlling prefs in both Chroem and ChromeOS. +class BatterySaverPolicyHandler : public TypeCheckingPolicyHandler { + public: + BatterySaverPolicyHandler(); + BatterySaverPolicyHandler(const BatterySaverPolicyHandler&) = delete; + BatterySaverPolicyHandler& operator=(const BatterySaverPolicyHandler&) = + delete; + ~BatterySaverPolicyHandler() override = default; + + // ConfigurationPolicyHandler: + void ApplyPolicySettings(const PolicyMap& policies, + PrefValueMap* prefs) override; +}; + +} // namespace policy + +#endif // CHROME_BROWSER_POLICY_BATTERY_SAVER_POLICY_HANDLER_H_
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc index 1e417964..61c640a 100644 --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -244,6 +244,12 @@ #include "chrome/browser/ash/wallpaper_handlers/wallpaper_prefs.h" #endif +#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ + BUILDFLAG(IS_CHROMEOS_ASH) +#include "chrome/browser/policy/battery_saver_policy_handler.h" +#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS_ASH) + namespace policy { namespace { @@ -2886,16 +2892,9 @@ #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \ BUILDFLAG(IS_CHROMEOS_ASH) - // Clamp the deprecated kEnabled policy value to kEnabledBelowThreshold. - handlers->AddHandler(std::make_unique<IntRangePolicyHandler>( - key::kBatterySaverModeAvailability, - performance_manager::user_tuning::prefs::kBatterySaverModeState, - base::strict_cast<int>(performance_manager::user_tuning::prefs:: - BatterySaverModeState::kDisabled), - base::strict_cast<int>(performance_manager::user_tuning::prefs:: - BatterySaverModeState::kEnabledBelowThreshold), - /*clamp=*/true)); -#endif + handlers->AddHandler(std::make_unique<BatterySaverPolicyHandler>()); +#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS_ASH) return handlers; }
diff --git a/chrome/browser/policy/messaging_layer/upload/configuration_file_controller_unittest.cc b/chrome/browser/policy/messaging_layer/upload/configuration_file_controller_unittest.cc index e9bc0535..52871e2 100644 --- a/chrome/browser/policy/messaging_layer/upload/configuration_file_controller_unittest.cc +++ b/chrome/browser/policy/messaging_layer/upload/configuration_file_controller_unittest.cc
@@ -48,7 +48,7 @@ void EnableSignatureTestFlag() { scoped_feature_list_.Reset(); std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->InitializeFromCommandLine( + feature_list->InitFromCommandLine( "ReportingConfigurationFileTestSignature, " "ShouldRequestConfigurationFile", "");
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index 6b4daf9..2944c8f 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc
@@ -982,6 +982,12 @@ constexpr char kPasswordChangeSuccessTrackerVersion[] = "password_manager.password_change_success_tracker.version"; +// Deprecated 11/2023. +#if BUILDFLAG(IS_CHROMEOS_ASH) +constexpr char kImageSearchPrivacyNotice[] = + "ash.launcher.image_search_privacy_notice"; +#endif // BUILDFLAG(IS_CHROMEOS_ASH) + // Register local state used only for migration (clearing or moving to a new // key). void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) { @@ -1393,6 +1399,11 @@ // Deprecated 11/2023. registry->RegisterListPref(kPasswordChangeSuccessTrackerFlows); registry->RegisterIntegerPref(kPasswordChangeSuccessTrackerVersion, 0); + + // Deprecated 11/2023. +#if BUILDFLAG(IS_CHROMEOS_ASH) + registry->RegisterDictionaryPref(kImageSearchPrivacyNotice); +#endif // BUILDFLAG(IS_CHROMEOS_ASH) } void ClearSyncRequestedPrefAndMaybeMigrate(PrefService* profile_prefs) { @@ -2619,6 +2630,11 @@ profile_prefs->ClearPref(kPasswordChangeSuccessTrackerFlows); profile_prefs->ClearPref(kPasswordChangeSuccessTrackerVersion); +#if BUILDFLAG(IS_CHROMEOS_ASH) + // Deprecated 11/2023 + profile_prefs->ClearPref(kImageSearchPrivacyNotice); +#endif // BUILDFLAG(IS_CHROMEOS_ASH) + // Please don't delete the following line. It is used by PRESUBMIT.py. // END_MIGRATE_OBSOLETE_PROFILE_PREFS
diff --git a/chrome/browser/privacy_sandbox/android/BUILD.gn b/chrome/browser/privacy_sandbox/android/BUILD.gn index f5b83e6b..e48ce78 100644 --- a/chrome/browser/privacy_sandbox/android/BUILD.gn +++ b/chrome/browser/privacy_sandbox/android/BUILD.gn
@@ -14,29 +14,29 @@ android_library("java") { sources = [ - "java/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragmentV4.java", - "java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeAllSitesFragmentV4.java", - "java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeBlockedSitesFragmentV4.java", - "java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragmentV4.java", + "java/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragment.java", + "java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeAllSitesFragment.java", + "java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeBlockedSitesFragment.java", + "java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragment.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeLearnMoreFragment.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/FledgePreference.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/PreferenceCategoryWithClickableSummary.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxBridge.java", - "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogConsentEEAV4.java", + "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogConsentEEA.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogController.java", - "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeEEAV4.java", - "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeROWV4.java", - "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeRestrictedV4.java", + "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeEEA.java", + "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeROW.java", + "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeRestricted.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogUtils.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxHelpers.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxReferrer.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsBaseFragment.java", - "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentV4.java", + "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragment.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSnackbarController.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/Topic.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/TopicPreference.java", - "java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsBlockedFragmentV4.java", - "java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragmentV4.java", + "java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsBlockedFragment.java", + "java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragment.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsLearnMoreFragment.java", "java/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionBridge.java", ] @@ -84,15 +84,15 @@ testonly = true resources_package = "org.chromium.chrome.browser.privacy_sandbox" sources = [ - "javatests/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragmentV4Test.java", + "javatests/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragmentTest.java", "javatests/src/org/chromium/chrome/browser/privacy_sandbox/FakePrivacySandboxBridge.java", "javatests/src/org/chromium/chrome/browser/privacy_sandbox/FakeTrackingProtectionBridge.java", - "javatests/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragmentV4Test.java", + "javatests/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragmentTest.java", "javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxBridgeTest.java", "javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogTest.java", - "javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentV4Test.java", + "javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentTest.java", "javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxTestUtils.java", - "javatests/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragmentV4Test.java", + "javatests/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragmentTest.java", "javatests/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionNoticeTest.java", ] deps = [ @@ -131,8 +131,8 @@ android_resources("java_resources") { sources = [ - "java/res/drawable-night/privacy_sandbox_interests_illustration_v4.xml", - "java/res/drawable-night/privacy_sandbox_notice_eea_illustration_v4.xml", + "java/res/drawable-night/privacy_sandbox_interests_illustration.xml", + "java/res/drawable-night/privacy_sandbox_notice_eea_illustration.xml", "java/res/drawable/ic_arrow_down.xml", "java/res/drawable/ic_auto_delete_24dp.xml", "java/res/drawable/ic_background_replace_24dp.xml", @@ -141,25 +141,25 @@ "java/res/drawable/ic_devices_24dp.xml", "java/res/drawable/ic_filter_list_24dp.xml", "java/res/drawable/ic_interests_24dp.xml", - "java/res/drawable/privacy_sandbox_interests_illustration_v4.xml", - "java/res/drawable/privacy_sandbox_notice_eea_illustration_v4.xml", + "java/res/drawable/privacy_sandbox_interests_illustration.xml", + "java/res/drawable/privacy_sandbox_notice_eea_illustration.xml", "java/res/layout/category_with_clickable_summary_preference.xml", - "java/res/layout/privacy_sandbox_consent_eea_dropdown_v4.xml", - "java/res/layout/privacy_sandbox_consent_eea_v4.xml", - "java/res/layout/privacy_sandbox_notice_eea_dropdown_v4.xml", - "java/res/layout/privacy_sandbox_notice_eea_v4.xml", - "java/res/layout/privacy_sandbox_notice_restricted_v4.xml", - "java/res/layout/privacy_sandbox_notice_row_dropdown_v4.xml", - "java/res/layout/privacy_sandbox_notice_row_v4.xml", + "java/res/layout/privacy_sandbox_consent_eea.xml", + "java/res/layout/privacy_sandbox_consent_eea_dropdown.xml", + "java/res/layout/privacy_sandbox_notice_eea.xml", + "java/res/layout/privacy_sandbox_notice_eea_dropdown.xml", + "java/res/layout/privacy_sandbox_notice_restricted.xml", + "java/res/layout/privacy_sandbox_notice_row.xml", + "java/res/layout/privacy_sandbox_notice_row_dropdown.xml", "java/res/values/dimens.xml", - "java/res/xml/ad_measurement_preference_v4.xml", - "java/res/xml/block_list_preference_v4.xml", + "java/res/xml/ad_measurement_preference.xml", + "java/res/xml/block_list_preference.xml", "java/res/xml/fledge_learn_more_preference.xml", - "java/res/xml/fledge_preference_v4.xml", + "java/res/xml/fledge_preference.xml", "java/res/xml/privacy_sandbox_preferences.xml", "java/res/xml/privacy_sandbox_preferences_restricted.xml", "java/res/xml/topics_learn_more_preference.xml", - "java/res/xml/topics_preference_v4.xml", + "java/res/xml/topics_preference.xml", ] deps = [ "//chrome/browser/ui/android/strings:ui_strings_grd",
diff --git a/chrome/browser/privacy_sandbox/android/java/res/drawable-night/privacy_sandbox_interests_illustration_v4.xml b/chrome/browser/privacy_sandbox/android/java/res/drawable-night/privacy_sandbox_interests_illustration.xml similarity index 100% rename from chrome/browser/privacy_sandbox/android/java/res/drawable-night/privacy_sandbox_interests_illustration_v4.xml rename to chrome/browser/privacy_sandbox/android/java/res/drawable-night/privacy_sandbox_interests_illustration.xml
diff --git a/chrome/browser/privacy_sandbox/android/java/res/drawable-night/privacy_sandbox_notice_eea_illustration_v4.xml b/chrome/browser/privacy_sandbox/android/java/res/drawable-night/privacy_sandbox_notice_eea_illustration.xml similarity index 100% rename from chrome/browser/privacy_sandbox/android/java/res/drawable-night/privacy_sandbox_notice_eea_illustration_v4.xml rename to chrome/browser/privacy_sandbox/android/java/res/drawable-night/privacy_sandbox_notice_eea_illustration.xml
diff --git a/chrome/browser/privacy_sandbox/android/java/res/drawable/privacy_sandbox_interests_illustration_v4.xml b/chrome/browser/privacy_sandbox/android/java/res/drawable/privacy_sandbox_interests_illustration.xml similarity index 100% rename from chrome/browser/privacy_sandbox/android/java/res/drawable/privacy_sandbox_interests_illustration_v4.xml rename to chrome/browser/privacy_sandbox/android/java/res/drawable/privacy_sandbox_interests_illustration.xml
diff --git a/chrome/browser/privacy_sandbox/android/java/res/drawable/privacy_sandbox_notice_eea_illustration_v4.xml b/chrome/browser/privacy_sandbox/android/java/res/drawable/privacy_sandbox_notice_eea_illustration.xml similarity index 100% rename from chrome/browser/privacy_sandbox/android/java/res/drawable/privacy_sandbox_notice_eea_illustration_v4.xml rename to chrome/browser/privacy_sandbox/android/java/res/drawable/privacy_sandbox_notice_eea_illustration.xml
diff --git a/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_consent_eea_v4.xml b/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_consent_eea.xml similarity index 99% rename from chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_consent_eea_v4.xml rename to chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_consent_eea.xml index 3553f32..67fada64 100644 --- a/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_consent_eea_v4.xml +++ b/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_consent_eea.xml
@@ -95,7 +95,7 @@ android:layout_marginVertical="@dimen/privacy_sandbox_dialog_illustration_margin_vertical" android:layout_height="wrap_content" android:layout_width="match_parent" - app:srcCompat="@drawable/privacy_sandbox_interests_illustration_v4" + app:srcCompat="@drawable/privacy_sandbox_interests_illustration" android:adjustViewBounds="true" android:importantForAccessibility="no" />
diff --git a/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_consent_eea_dropdown_v4.xml b/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_consent_eea_dropdown.xml similarity index 100% rename from chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_consent_eea_dropdown_v4.xml rename to chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_consent_eea_dropdown.xml
diff --git a/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_eea_v4.xml b/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_eea.xml similarity index 99% rename from chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_eea_v4.xml rename to chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_eea.xml index cb638f8..1e54062 100644 --- a/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_eea_v4.xml +++ b/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_eea.xml
@@ -66,7 +66,7 @@ android:layout_marginVertical="@dimen/privacy_sandbox_dialog_illustration_margin_vertical" android:layout_height="wrap_content" android:layout_width="match_parent" - app:srcCompat="@drawable/privacy_sandbox_notice_eea_illustration_v4" + app:srcCompat="@drawable/privacy_sandbox_notice_eea_illustration" android:adjustViewBounds="true" android:importantForAccessibility="no" />
diff --git a/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_eea_dropdown_v4.xml b/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_eea_dropdown.xml similarity index 100% rename from chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_eea_dropdown_v4.xml rename to chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_eea_dropdown.xml
diff --git a/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_restricted_v4.xml b/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_restricted.xml similarity index 99% rename from chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_restricted_v4.xml rename to chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_restricted.xml index 9a7f9f0..e4caec09 100644 --- a/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_restricted_v4.xml +++ b/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_restricted.xml
@@ -66,7 +66,7 @@ android:layout_marginVertical="@dimen/privacy_sandbox_dialog_illustration_margin_vertical" android:layout_height="wrap_content" android:layout_width="match_parent" - app:srcCompat="@drawable/privacy_sandbox_notice_eea_illustration_v4" + app:srcCompat="@drawable/privacy_sandbox_notice_eea_illustration" android:adjustViewBounds="true" android:importantForAccessibility="no" />
diff --git a/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_row_v4.xml b/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_row.xml similarity index 99% rename from chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_row_v4.xml rename to chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_row.xml index c4cfae2..6650a32ae 100644 --- a/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_row_v4.xml +++ b/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_row.xml
@@ -74,7 +74,7 @@ android:layout_marginVertical="@dimen/privacy_sandbox_dialog_illustration_margin_vertical" android:layout_height="wrap_content" android:layout_width="match_parent" - app:srcCompat="@drawable/privacy_sandbox_interests_illustration_v4" + app:srcCompat="@drawable/privacy_sandbox_interests_illustration" android:adjustViewBounds="true" android:importantForAccessibility="no" />
diff --git a/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_row_dropdown_v4.xml b/chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_row_dropdown.xml similarity index 100% rename from chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_row_dropdown_v4.xml rename to chrome/browser/privacy_sandbox/android/java/res/layout/privacy_sandbox_notice_row_dropdown.xml
diff --git a/chrome/browser/privacy_sandbox/android/java/res/xml/ad_measurement_preference_v4.xml b/chrome/browser/privacy_sandbox/android/java/res/xml/ad_measurement_preference.xml similarity index 100% rename from chrome/browser/privacy_sandbox/android/java/res/xml/ad_measurement_preference_v4.xml rename to chrome/browser/privacy_sandbox/android/java/res/xml/ad_measurement_preference.xml
diff --git a/chrome/browser/privacy_sandbox/android/java/res/xml/block_list_preference_v4.xml b/chrome/browser/privacy_sandbox/android/java/res/xml/block_list_preference.xml similarity index 100% rename from chrome/browser/privacy_sandbox/android/java/res/xml/block_list_preference_v4.xml rename to chrome/browser/privacy_sandbox/android/java/res/xml/block_list_preference.xml
diff --git a/chrome/browser/privacy_sandbox/android/java/res/xml/fledge_preference_v4.xml b/chrome/browser/privacy_sandbox/android/java/res/xml/fledge_preference.xml similarity index 96% rename from chrome/browser/privacy_sandbox/android/java/res/xml/fledge_preference_v4.xml rename to chrome/browser/privacy_sandbox/android/java/res/xml/fledge_preference.xml index bccbcfde..d9bc40d7 100644 --- a/chrome/browser/privacy_sandbox/android/java/res/xml/fledge_preference_v4.xml +++ b/chrome/browser/privacy_sandbox/android/java/res/xml/fledge_preference.xml
@@ -32,12 +32,12 @@ <org.chromium.components.browser_ui.settings.ChromeBasePreference android:key="fledge_all_sites" android:title="@string/settings_fledge_page_see_all_sites_label" - android:fragment="org.chromium.chrome.browser.privacy_sandbox.FledgeAllSitesFragmentV4" + android:fragment="org.chromium.chrome.browser.privacy_sandbox.FledgeAllSitesFragment" app:userAction="Settings.PrivacySandbox.Fledge.AllSitesOpened"/> <org.chromium.components.browser_ui.settings.ChromeBasePreference android:key="fledge_blocked_sites" - android:fragment="org.chromium.chrome.browser.privacy_sandbox.FledgeBlockedSitesFragmentV4" + android:fragment="org.chromium.chrome.browser.privacy_sandbox.FledgeBlockedSitesFragment" android:title="@string/settings_fledge_page_blocked_sites_heading" app:userAction="Settings.PrivacySandbox.Fledge.BlockedSitesOpened" />
diff --git a/chrome/browser/privacy_sandbox/android/java/res/xml/privacy_sandbox_preferences.xml b/chrome/browser/privacy_sandbox/android/java/res/xml/privacy_sandbox_preferences.xml index 603cde9a..c637fce 100644 --- a/chrome/browser/privacy_sandbox/android/java/res/xml/privacy_sandbox_preferences.xml +++ b/chrome/browser/privacy_sandbox/android/java/res/xml/privacy_sandbox_preferences.xml
@@ -10,21 +10,21 @@ android:key="topics" android:title="@string/ad_privacy_page_topics_link_row_label" android:icon="@drawable/ic_interests_24dp" - android:fragment="org.chromium.chrome.browser.privacy_sandbox.TopicsFragmentV4" + android:fragment="org.chromium.chrome.browser.privacy_sandbox.TopicsFragment" app:iconTint="@macro/default_icon_color" app:userAction="Settings.PrivacySandbox.Topics.Opened" /> <org.chromium.components.browser_ui.settings.ChromeBasePreference android:key="fledge" android:title="@string/ad_privacy_page_fledge_link_row_label" android:icon="@drawable/ic_checklist_24dp" - android:fragment="org.chromium.chrome.browser.privacy_sandbox.FledgeFragmentV4" + android:fragment="org.chromium.chrome.browser.privacy_sandbox.FledgeFragment" app:iconTint="@macro/default_icon_color" app:userAction="Settings.PrivacySandbox.Fledge.Opened" /> <org.chromium.components.browser_ui.settings.ChromeBasePreference android:key="ad_measurement" android:title="@string/ad_privacy_page_ad_measurement_link_row_label" android:icon="@drawable/ic_bar_chart_24dp" - android:fragment="org.chromium.chrome.browser.privacy_sandbox.AdMeasurementFragmentV4" + android:fragment="org.chromium.chrome.browser.privacy_sandbox.AdMeasurementFragment" app:iconTint="@macro/default_icon_color" app:userAction="Settings.PrivacySandbox.AdMeasurement.Opened" app:allowDividerBelow="false" />
diff --git a/chrome/browser/privacy_sandbox/android/java/res/xml/privacy_sandbox_preferences_restricted.xml b/chrome/browser/privacy_sandbox/android/java/res/xml/privacy_sandbox_preferences_restricted.xml index a9fbd73..7ed35f7 100644 --- a/chrome/browser/privacy_sandbox/android/java/res/xml/privacy_sandbox_preferences_restricted.xml +++ b/chrome/browser/privacy_sandbox/android/java/res/xml/privacy_sandbox_preferences_restricted.xml
@@ -11,7 +11,7 @@ android:key="ad_measurement" android:title="@string/ad_privacy_page_ad_measurement_link_row_label" android:icon="@drawable/ic_bar_chart_24dp" - android:fragment="org.chromium.chrome.browser.privacy_sandbox.AdMeasurementFragmentV4" + android:fragment="org.chromium.chrome.browser.privacy_sandbox.AdMeasurementFragment" app:iconTint="@macro/default_icon_color" app:userAction="Settings.PrivacySandbox.AdMeasurement.Opened" app:allowDividerBelow="false" />
diff --git a/chrome/browser/privacy_sandbox/android/java/res/xml/topics_preference_v4.xml b/chrome/browser/privacy_sandbox/android/java/res/xml/topics_preference.xml similarity index 98% rename from chrome/browser/privacy_sandbox/android/java/res/xml/topics_preference_v4.xml rename to chrome/browser/privacy_sandbox/android/java/res/xml/topics_preference.xml index 77ccf3b0..299ced61 100644 --- a/chrome/browser/privacy_sandbox/android/java/res/xml/topics_preference_v4.xml +++ b/chrome/browser/privacy_sandbox/android/java/res/xml/topics_preference.xml
@@ -32,7 +32,7 @@ <org.chromium.components.browser_ui.settings.ChromeBasePreference android:key="blocked_topics" android:title="@string/settings_topics_page_blocked_topics_heading" - android:fragment="org.chromium.chrome.browser.privacy_sandbox.TopicsBlockedFragmentV4" + android:fragment="org.chromium.chrome.browser.privacy_sandbox.TopicsBlockedFragment" app:userAction="Settings.PrivacySandbox.Topics.BlockedTopicsOpened" /> <org.chromium.components.browser_ui.settings.ClickableSpansTextMessagePreference
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragmentV4.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragment.java similarity index 96% rename from chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragmentV4.java rename to chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragment.java index 671a6bb3..13dce6a 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragmentV4.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragment.java
@@ -20,7 +20,7 @@ import org.chromium.components.user_prefs.UserPrefs; /** Fragment for the Privacy Sandbox -> Ad Measurement preferences. */ -public class AdMeasurementFragmentV4 extends PrivacySandboxSettingsBaseFragment +public class AdMeasurementFragment extends PrivacySandboxSettingsBaseFragment implements Preference.OnPreferenceChangeListener { public static final String TOGGLE_PREFERENCE = "ad_measurement_toggle"; @@ -43,7 +43,7 @@ public void onCreatePreferences(@Nullable Bundle bundle, @Nullable String s) { super.onCreatePreferences(bundle, s); getActivity().setTitle(R.string.settings_ad_measurement_page_title); - SettingsUtils.addPreferencesFromResource(this, R.xml.ad_measurement_preference_v4); + SettingsUtils.addPreferencesFromResource(this, R.xml.ad_measurement_preference); ChromeSwitchPreference adMeasurementToggle = findPreference(TOGGLE_PREFERENCE); adMeasurementToggle.setChecked(isAdMeasurementPrefEnabled(getProfile()));
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeAllSitesFragmentV4.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeAllSitesFragment.java similarity index 97% rename from chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeAllSitesFragmentV4.java rename to chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeAllSitesFragment.java index 1eaeb601..be9bb66 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeAllSitesFragmentV4.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeAllSitesFragment.java
@@ -20,7 +20,7 @@ import java.util.List; /** Fragment to display all the allowed Fledge sites. */ -public class FledgeAllSitesFragmentV4 extends PrivacySandboxSettingsBaseFragment +public class FledgeAllSitesFragment extends PrivacySandboxSettingsBaseFragment implements Preference.OnPreferenceClickListener { private PreferenceScreen mPreferenceScreen; private LargeIconBridge mLargeIconBridge;
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeBlockedSitesFragmentV4.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeBlockedSitesFragment.java similarity index 96% rename from chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeBlockedSitesFragmentV4.java rename to chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeBlockedSitesFragment.java index 76b07f6..06fcf98 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeBlockedSitesFragmentV4.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeBlockedSitesFragment.java
@@ -20,7 +20,7 @@ import java.util.List; /** Fragment for the blocked Fledge sites. */ -public class FledgeBlockedSitesFragmentV4 extends PrivacySandboxSettingsBaseFragment +public class FledgeBlockedSitesFragment extends PrivacySandboxSettingsBaseFragment implements Preference.OnPreferenceClickListener { private static final String BLOCKED_SITES_PREFERENCE = "block_list"; @@ -31,7 +31,7 @@ public void onCreatePreferences(@Nullable Bundle bundle, @Nullable String s) { super.onCreatePreferences(bundle, s); getActivity().setTitle(R.string.settings_fledge_page_blocked_sites_sub_page_title); - SettingsUtils.addPreferencesFromResource(this, R.xml.block_list_preference_v4); + SettingsUtils.addPreferencesFromResource(this, R.xml.block_list_preference); mBlockedSitesCategory = findPreference(BLOCKED_SITES_PREFERENCE); }
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragmentV4.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragment.java similarity index 98% rename from chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragmentV4.java rename to chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragment.java index abf5199..0b6d3e3 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragmentV4.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragment.java
@@ -32,7 +32,7 @@ import java.util.List; /** Fragment for the Privacy Sandbox -> Fledge preferences. */ -public class FledgeFragmentV4 extends PrivacySandboxSettingsBaseFragment +public class FledgeFragment extends PrivacySandboxSettingsBaseFragment implements Preference.OnPreferenceChangeListener, Preference.OnPreferenceClickListener { @VisibleForTesting static final int MAX_DISPLAYED_SITES = 15; @@ -73,7 +73,7 @@ public void onCreatePreferences(@Nullable Bundle bundle, @Nullable String s) { super.onCreatePreferences(bundle, s); getActivity().setTitle(R.string.settings_fledge_page_title); - SettingsUtils.addPreferencesFromResource(this, R.xml.fledge_preference_v4); + SettingsUtils.addPreferencesFromResource(this, R.xml.fledge_preference); mFledgeTogglePreference = findPreference(FLEDGE_TOGGLE_PREFERENCE); mHeadingPreference = findPreference(HEADING_PREFERENCE); @@ -119,7 +119,7 @@ } private void onFledgeSettingsLinkClicked(View view) { - launchSettingsActivity(TopicsFragmentV4.class); + launchSettingsActivity(TopicsFragment.class); } private void onCookieSettingsLink(View view) {
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeLearnMoreFragment.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeLearnMoreFragment.java index 141f199f..8893393 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeLearnMoreFragment.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/FledgeLearnMoreFragment.java
@@ -42,7 +42,7 @@ } private void onLearnMoreClicked(View view) { - openUrlInCct(PrivacySandboxSettingsFragmentV4.HELP_CENTER_URL); + openUrlInCct(PrivacySandboxSettingsFragment.HELP_CENTER_URL); } @Override
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogConsentEEAV4.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogConsentEEA.java similarity index 97% rename from chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogConsentEEAV4.java rename to chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogConsentEEA.java index 1860d4f6..132eb58e 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogConsentEEAV4.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogConsentEEA.java
@@ -20,7 +20,7 @@ import org.chromium.ui.widget.CheckableImageView; /** Dialog in the form of a consent shown for the Privacy Sandbox. */ -public class PrivacySandboxDialogConsentEEAV4 extends ChromeDialog +public class PrivacySandboxDialogConsentEEA extends ChromeDialog implements View.OnClickListener, DialogInterface.OnShowListener { private static final int SPINNER_DURATION_MS = 1500; private static final int BACKGROUND_TRANSITION_DURATION_MS = 300; @@ -39,7 +39,7 @@ private boolean mAreAnimationsDisabled; private SettingsLauncher mSettingsLauncher; - public PrivacySandboxDialogConsentEEAV4( + public PrivacySandboxDialogConsentEEA( Context context, @NonNull SettingsLauncher settingsLauncher, boolean disableAnimations) { @@ -47,7 +47,7 @@ mSettingsLauncher = settingsLauncher; mAreAnimationsDisabled = disableAnimations; mContentView = - LayoutInflater.from(context).inflate(R.layout.privacy_sandbox_consent_eea_v4, null); + LayoutInflater.from(context).inflate(R.layout.privacy_sandbox_consent_eea, null); setContentView(mContentView); ButtonCompat ackButton = mContentView.findViewById(R.id.ack_button); @@ -133,7 +133,7 @@ PrivacySandboxBridge.promptActionOccurred(PromptAction.CONSENT_MORE_INFO_OPENED); LayoutInflater.from(getContext()) .inflate( - R.layout.privacy_sandbox_consent_eea_dropdown_v4, + R.layout.privacy_sandbox_consent_eea_dropdown, mDropdownContainer); PrivacySandboxDialogUtils.setBulletTextWithBoldContent(
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogController.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogController.java index 319731a..94c90ac9 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogController.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogController.java
@@ -46,7 +46,7 @@ return false; case PromptType.M1_CONSENT: dialog = - new PrivacySandboxDialogConsentEEAV4( + new PrivacySandboxDialogConsentEEA( context, settingsLauncher, sDisableAnimations); dialog.show(); sDialog = new WeakReference<>(dialog); @@ -55,12 +55,12 @@ showNoticeEEA(context, settingsLauncher); return true; case PromptType.M1_NOTICE_ROW: - dialog = new PrivacySandboxDialogNoticeROWV4(context, settingsLauncher); + dialog = new PrivacySandboxDialogNoticeROW(context, settingsLauncher); dialog.show(); sDialog = new WeakReference<>(dialog); return true; case PromptType.M1_NOTICE_RESTRICTED: - dialog = new PrivacySandboxDialogNoticeRestrictedV4(context, settingsLauncher); + dialog = new PrivacySandboxDialogNoticeRestricted(context, settingsLauncher); dialog.show(); sDialog = new WeakReference<>(dialog); return true; @@ -75,7 +75,7 @@ public static void showNoticeEEA(Context context, SettingsLauncher settingsLauncher) { if (!sDisableEEANoticeForTesting) { Dialog dialog; - dialog = new PrivacySandboxDialogNoticeEEAV4(context, settingsLauncher); + dialog = new PrivacySandboxDialogNoticeEEA(context, settingsLauncher); dialog.show(); sDialog = new WeakReference<>(dialog); }
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeEEAV4.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeEEA.java similarity index 97% rename from chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeEEAV4.java rename to chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeEEA.java index 75e50ddfd..07697ac 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeEEAV4.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeEEA.java
@@ -19,7 +19,7 @@ import org.chromium.ui.widget.CheckableImageView; /** Dialog in the form of a notice shown for the Privacy Sandbox. */ -public class PrivacySandboxDialogNoticeEEAV4 extends ChromeDialog +public class PrivacySandboxDialogNoticeEEA extends ChromeDialog implements View.OnClickListener, DialogInterface.OnShowListener { private SettingsLauncher mSettingsLauncher; private View mContentView; @@ -32,13 +32,13 @@ private final CheckableImageView mExpandArrowView; private LinearLayout mDropdownContainer; - public PrivacySandboxDialogNoticeEEAV4( + public PrivacySandboxDialogNoticeEEA( Context context, @NonNull SettingsLauncher settingsLauncher) { super(context, R.style.ThemeOverlay_BrowserUI_Fullscreen); mSettingsLauncher = settingsLauncher; mContentView = - LayoutInflater.from(context).inflate(R.layout.privacy_sandbox_notice_eea_v4, null); + LayoutInflater.from(context).inflate(R.layout.privacy_sandbox_notice_eea, null); setContentView(mContentView); ButtonCompat ackButton = mContentView.findViewById(R.id.ack_button); @@ -122,7 +122,7 @@ PrivacySandboxBridge.promptActionOccurred(PromptAction.NOTICE_MORE_INFO_OPENED); LayoutInflater.from(getContext()) .inflate( - R.layout.privacy_sandbox_notice_eea_dropdown_v4, + R.layout.privacy_sandbox_notice_eea_dropdown, mDropdownContainer); PrivacySandboxDialogUtils.setBulletTextWithBoldContent(
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeROWV4.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeROW.java similarity index 97% rename from chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeROWV4.java rename to chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeROW.java index e1048fb3..bb48a8b7 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeROWV4.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeROW.java
@@ -19,7 +19,7 @@ import org.chromium.ui.widget.CheckableImageView; /** Dialog in the form of a notice shown for the Privacy Sandbox. */ -public class PrivacySandboxDialogNoticeROWV4 extends ChromeDialog +public class PrivacySandboxDialogNoticeROW extends ChromeDialog implements View.OnClickListener, DialogInterface.OnShowListener { private SettingsLauncher mSettingsLauncher; private View mContentView; @@ -31,12 +31,12 @@ private LinearLayout mActionButtons; private ScrollView mScrollView; - public PrivacySandboxDialogNoticeROWV4( + public PrivacySandboxDialogNoticeROW( Context context, @NonNull SettingsLauncher settingsLauncher) { super(context, R.style.ThemeOverlay_BrowserUI_Fullscreen); mSettingsLauncher = settingsLauncher; mContentView = - LayoutInflater.from(context).inflate(R.layout.privacy_sandbox_notice_row_v4, null); + LayoutInflater.from(context).inflate(R.layout.privacy_sandbox_notice_row, null); setContentView(mContentView); ButtonCompat ackButton = mContentView.findViewById(R.id.ack_button); @@ -118,7 +118,7 @@ PrivacySandboxBridge.promptActionOccurred(PromptAction.NOTICE_MORE_INFO_OPENED); LayoutInflater.from(getContext()) .inflate( - R.layout.privacy_sandbox_notice_row_dropdown_v4, + R.layout.privacy_sandbox_notice_row_dropdown, mDropdownContainer); PrivacySandboxDialogUtils.setBulletText(
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeRestrictedV4.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeRestricted.java similarity index 95% rename from chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeRestrictedV4.java rename to chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeRestricted.java index ffcbb77..cad607a1 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeRestrictedV4.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogNoticeRestricted.java
@@ -18,7 +18,7 @@ import org.chromium.ui.widget.ButtonCompat; /** Dialog in the form of a notice shown for the Privacy Sandbox. */ -public class PrivacySandboxDialogNoticeRestrictedV4 extends ChromeDialog +public class PrivacySandboxDialogNoticeRestricted extends ChromeDialog implements View.OnClickListener, DialogInterface.OnShowListener { private SettingsLauncher mSettingsLauncher; private View mContentView; @@ -27,13 +27,13 @@ private LinearLayout mActionButtons; private ScrollView mScrollView; - public PrivacySandboxDialogNoticeRestrictedV4( + public PrivacySandboxDialogNoticeRestricted( Context context, @NonNull SettingsLauncher settingsLauncher) { super(context, R.style.ThemeOverlay_BrowserUI_Fullscreen); mSettingsLauncher = settingsLauncher; mContentView = LayoutInflater.from(context) - .inflate(R.layout.privacy_sandbox_notice_restricted_v4, null); + .inflate(R.layout.privacy_sandbox_notice_restricted, null); setContentView(mContentView); ButtonCompat ackButton = mContentView.findViewById(R.id.ack_button); @@ -80,7 +80,7 @@ } else if (id == R.id.settings_button) { PrivacySandboxBridge.promptActionOccurred(PromptAction.RESTRICTED_NOTICE_OPEN_SETTINGS); dismiss(); - mSettingsLauncher.launchSettingsActivity(getContext(), AdMeasurementFragmentV4.class); + mSettingsLauncher.launchSettingsActivity(getContext(), AdMeasurementFragment.class); } else if (id == R.id.more_button) { PrivacySandboxBridge.promptActionOccurred( PromptAction.RESTRICTED_NOTICE_MORE_BUTTON_CLICKED);
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsBaseFragment.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsBaseFragment.java index c075cc9..66b624a 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsBaseFragment.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsBaseFragment.java
@@ -53,7 +53,7 @@ Bundle fragmentArgs = new Bundle(); fragmentArgs.putInt(PRIVACY_SANDBOX_REFERRER, referrer); settingsLauncher.launchSettingsActivity( - context, PrivacySandboxSettingsFragmentV4.class, fragmentArgs); + context, PrivacySandboxSettingsFragment.class, fragmentArgs); } public static CharSequence getStatusString(Context context) { @@ -84,7 +84,7 @@ public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.menu_id_targeted_help) { // Action for the question mark button. - openUrlInCct(PrivacySandboxSettingsFragmentV4.HELP_CENTER_URL); + openUrlInCct(PrivacySandboxSettingsFragment.HELP_CENTER_URL); return true; } return false;
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentV4.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragment.java similarity index 89% rename from chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentV4.java rename to chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragment.java index c03fe61..e6bb760b 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentV4.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragment.java
@@ -12,7 +12,7 @@ import org.chromium.components.browser_ui.settings.SettingsUtils; /** Settings fragment for privacy sandbox settings. */ -public class PrivacySandboxSettingsFragmentV4 extends PrivacySandboxSettingsBaseFragment { +public class PrivacySandboxSettingsFragment extends PrivacySandboxSettingsBaseFragment { public static final String TOPICS_PREF = "topics"; public static final String FLEDGE_PREF = "fledge"; public static final String AD_MEASUREMENT_PREF = "ad_measurement"; @@ -60,18 +60,18 @@ private void updatePrefDescription() { if (!showRestrictedView()) { mTopicsPref.setSummary( - TopicsFragmentV4.isTopicsPrefEnabled(getProfile()) + TopicsFragment.isTopicsPrefEnabled(getProfile()) ? R.string.ad_privacy_page_topics_link_row_sub_label_enabled : R.string.ad_privacy_page_topics_link_row_sub_label_disabled); mFledgePref.setSummary( - FledgeFragmentV4.isFledgePrefEnabled(getProfile()) + FledgeFragment.isFledgePrefEnabled(getProfile()) ? R.string.ad_privacy_page_fledge_link_row_sub_label_enabled : R.string.ad_privacy_page_fledge_link_row_sub_label_disabled); } mAdMeasurementPref.setSummary( - AdMeasurementFragmentV4.isAdMeasurementPrefEnabled(getProfile()) + AdMeasurementFragment.isAdMeasurementPrefEnabled(getProfile()) ? R.string.ad_privacy_page_ad_measurement_link_row_sub_label_enabled : R.string.ad_privacy_page_ad_measurement_link_row_sub_label_disabled); }
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsBlockedFragmentV4.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsBlockedFragment.java similarity index 96% rename from chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsBlockedFragmentV4.java rename to chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsBlockedFragment.java index b28650b..a8513d9 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsBlockedFragmentV4.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsBlockedFragment.java
@@ -19,7 +19,7 @@ import java.util.List; /** Fragment for the blocked Topic preferences. */ -public class TopicsBlockedFragmentV4 extends PrivacySandboxSettingsBaseFragment +public class TopicsBlockedFragment extends PrivacySandboxSettingsBaseFragment implements Preference.OnPreferenceClickListener { private static final String BLOCKED_TOPICS_PREFERENCE = "block_list"; @@ -29,7 +29,7 @@ public void onCreatePreferences(@Nullable Bundle bundle, @Nullable String s) { super.onCreatePreferences(bundle, s); getActivity().setTitle(R.string.settings_topics_page_blocked_topics_sub_page_title); - SettingsUtils.addPreferencesFromResource(this, R.xml.block_list_preference_v4); + SettingsUtils.addPreferencesFromResource(this, R.xml.block_list_preference); mBlockedTopicsCategory = findPreference(BLOCKED_TOPICS_PREFERENCE); }
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragmentV4.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragment.java similarity index 98% rename from chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragmentV4.java rename to chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragment.java index 700aef61..8dedb812 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragmentV4.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragment.java
@@ -29,7 +29,7 @@ import java.util.List; /** Fragment for the Privacy Sandbox -> Topic preferences. */ -public class TopicsFragmentV4 extends PrivacySandboxSettingsBaseFragment +public class TopicsFragment extends PrivacySandboxSettingsBaseFragment implements Preference.OnPreferenceChangeListener, Preference.OnPreferenceClickListener { private static final String TOPICS_TOGGLE_PREFERENCE = "topics_toggle"; private static final String TOPICS_HEADING_PREFERENCE = "topics_heading"; @@ -64,7 +64,7 @@ public void onCreatePreferences(@Nullable Bundle bundle, @Nullable String s) { super.onCreatePreferences(bundle, s); getActivity().setTitle(R.string.settings_topics_page_title); - SettingsUtils.addPreferencesFromResource(this, R.xml.topics_preference_v4); + SettingsUtils.addPreferencesFromResource(this, R.xml.topics_preference); mTopicsTogglePreference = findPreference(TOPICS_TOGGLE_PREFERENCE); mTopicsHeadingPreference = findPreference(TOPICS_HEADING_PREFERENCE); @@ -110,7 +110,7 @@ } private void onFledgeSettingsLinkClicked(View view) { - launchSettingsActivity(FledgeFragmentV4.class); + launchSettingsActivity(FledgeFragment.class); } private void onCookieSettingsLink(View view) {
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsLearnMoreFragment.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsLearnMoreFragment.java index be26956..919cd24 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsLearnMoreFragment.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TopicsLearnMoreFragment.java
@@ -42,7 +42,7 @@ } private void onLearnMoreClicked(View view) { - openUrlInCct(PrivacySandboxSettingsFragmentV4.HELP_CENTER_URL); + openUrlInCct(PrivacySandboxSettingsFragment.HELP_CENTER_URL); } @Override
diff --git a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragmentV4Test.java b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragmentTest.java similarity index 95% rename from chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragmentV4Test.java rename to chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragmentTest.java index e46f537..507af9d 100644 --- a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragmentV4Test.java +++ b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/AdMeasurementFragmentTest.java
@@ -52,11 +52,11 @@ import java.io.IOException; -/** Tests {@link AdMeasurementFragmentV4} */ +/** Tests {@link AdMeasurementFragment} */ @RunWith(ChromeJUnit4ClassRunner.class) @Batch(Batch.PER_CLASS) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) -public final class AdMeasurementFragmentV4Test { +public final class AdMeasurementFragmentTest { @Rule public ChromeBrowserTestRule mChromeBrowserTestRule = new ChromeBrowserTestRule(); @Rule @@ -66,8 +66,8 @@ .build(); @Rule - public SettingsActivityTestRule<AdMeasurementFragmentV4> mSettingsActivityTestRule = - new SettingsActivityTestRule<>(AdMeasurementFragmentV4.class); + public SettingsActivityTestRule<AdMeasurementFragment> mSettingsActivityTestRule = + new SettingsActivityTestRule<>(AdMeasurementFragment.class); private UserActionTester mUserActionTester; @@ -116,14 +116,14 @@ private void setAdMeasurementPrefEnabled(boolean isEnabled) { TestThreadUtils.runOnUiThreadBlocking( () -> - AdMeasurementFragmentV4.setAdMeasurementPrefEnabled( + AdMeasurementFragment.setAdMeasurementPrefEnabled( Profile.getLastUsedRegularProfile(), isEnabled)); } private boolean isAdMeasurementPrefEnabled() { return TestThreadUtils.runOnUiThreadBlockingNoException( () -> - AdMeasurementFragmentV4.isAdMeasurementPrefEnabled( + AdMeasurementFragment.isAdMeasurementPrefEnabled( Profile.getLastUsedRegularProfile())); }
diff --git a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragmentV4Test.java b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragmentTest.java similarity index 96% rename from chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragmentV4Test.java rename to chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragmentTest.java index ee48e7c..9df091c 100644 --- a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragmentV4Test.java +++ b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/FledgeFragmentTest.java
@@ -62,11 +62,11 @@ import java.io.IOException; -/** Tests {@link FledgeFragmentV4} */ +/** Tests {@link FledgeFragment} */ @RunWith(ChromeJUnit4ClassRunner.class) @Batch(Batch.PER_CLASS) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) -public final class FledgeFragmentV4Test { +public final class FledgeFragmentTest { private static final String SITE_NAME_1 = "first.com"; private static final String SITE_NAME_2 = "second.com"; @@ -80,8 +80,8 @@ .build(); @Rule - public SettingsActivityTestRule<FledgeFragmentV4> mSettingsActivityTestRule = - new SettingsActivityTestRule<>(FledgeFragmentV4.class); + public SettingsActivityTestRule<FledgeFragment> mSettingsActivityTestRule = + new SettingsActivityTestRule<>(FledgeFragment.class); @Rule public JniMocker mocker = new JniMocker(); @@ -143,13 +143,13 @@ private void setFledgePrefEnabled(boolean isEnabled) { TestThreadUtils.runOnUiThreadBlocking( () -> - FledgeFragmentV4.setFledgePrefEnabled( + FledgeFragment.setFledgePrefEnabled( Profile.getLastUsedRegularProfile(), isEnabled)); } private boolean isFledgePrefEnabled() { return TestThreadUtils.runOnUiThreadBlockingNoException( - () -> FledgeFragmentV4.isFledgePrefEnabled(Profile.getLastUsedRegularProfile())); + () -> FledgeFragment.isFledgePrefEnabled(Profile.getLastUsedRegularProfile())); } private void scrollToSetting(Matcher<View> matcher) { @@ -194,7 +194,7 @@ @Feature({"RenderTest"}) public void testRenderAllSitesPage() throws IOException { setFledgePrefEnabled(true); - for (int i = 0; i < FledgeFragmentV4.MAX_DISPLAYED_SITES + 1; i++) { + for (int i = 0; i < FledgeFragment.MAX_DISPLAYED_SITES + 1; i++) { mFakePrivacySandboxBridge.setFledgeJoiningAllowed(generateSiteFromNr(i), true); } startFledgeSettings(); @@ -328,7 +328,7 @@ @SmallTest public void testMaxDisplayedSites() { setFledgePrefEnabled(true); - for (int i = 0; i < FledgeFragmentV4.MAX_DISPLAYED_SITES + 1; i++) { + for (int i = 0; i < FledgeFragment.MAX_DISPLAYED_SITES + 1; i++) { mFakePrivacySandboxBridge.setFledgeJoiningAllowed(generateSiteFromNr(i), true); } startFledgeSettings(); @@ -336,8 +336,8 @@ // Scroll to pref below last displayed site. scrollToSetting(withText(R.string.settings_fledge_page_see_all_sites_label)); - String lastDisplayedSite = generateSiteFromNr(FledgeFragmentV4.MAX_DISPLAYED_SITES - 1); - String firstNotDisplayedSite = generateSiteFromNr(FledgeFragmentV4.MAX_DISPLAYED_SITES); + String lastDisplayedSite = generateSiteFromNr(FledgeFragment.MAX_DISPLAYED_SITES - 1); + String firstNotDisplayedSite = generateSiteFromNr(FledgeFragment.MAX_DISPLAYED_SITES); // Verify that only MAX_DISPLAY_SITES are shown. onView(withText(lastDisplayedSite)).check(matches(isDisplayed()));
diff --git a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxBridgeTest.java b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxBridgeTest.java index 6a437c4..1daea3f 100644 --- a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxBridgeTest.java +++ b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxBridgeTest.java
@@ -115,7 +115,10 @@ @Nullable private List<String> getFledgeJoiningEtlds() { PayloadCallbackHelper<List<String>> callbackHelper = new PayloadCallbackHelper<>(); - PrivacySandboxBridge.getFledgeJoiningEtldPlusOneForDisplay(callbackHelper::notifyCalled); + TestThreadUtils.runOnUiThreadBlocking( + () -> + PrivacySandboxBridge.getFledgeJoiningEtldPlusOneForDisplay( + callbackHelper::notifyCalled)); return callbackHelper.getOnlyPayloadBlocking(); } @@ -124,7 +127,7 @@ public void testGetFledgeJoiningEtldPlusOneForDisplay() { // Check that this function returns a valid list. We currently can't control from the Java // side what they actually return, so just check that it is not null and there is no crash. - TestThreadUtils.runOnUiThreadBlocking(() -> assertNotNull(getFledgeJoiningEtlds())); + assertNotNull(getFledgeJoiningEtlds()); } @Test
diff --git a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogTest.java b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogTest.java index 15540ea..8b5c1cb76 100644 --- a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogTest.java +++ b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxDialogTest.java
@@ -174,7 +174,7 @@ TestThreadUtils.runOnUiThreadBlocking( () -> { mDialog = - new PrivacySandboxDialogConsentEEAV4( + new PrivacySandboxDialogConsentEEA( sActivityTestRule.getActivity(), mSettingsLauncher, /* animate= */ false); @@ -190,7 +190,7 @@ TestThreadUtils.runOnUiThreadBlocking( () -> { mDialog = - new PrivacySandboxDialogNoticeEEAV4( + new PrivacySandboxDialogNoticeEEA( sActivityTestRule.getActivity(), mSettingsLauncher); mDialog.show(); }); @@ -204,7 +204,7 @@ TestThreadUtils.runOnUiThreadBlocking( () -> { mDialog = - new PrivacySandboxDialogNoticeROWV4( + new PrivacySandboxDialogNoticeROW( sActivityTestRule.getActivity(), mSettingsLauncher); mDialog.show(); }); @@ -218,7 +218,7 @@ TestThreadUtils.runOnUiThreadBlocking( () -> { mDialog = - new PrivacySandboxDialogNoticeRestrictedV4( + new PrivacySandboxDialogNoticeRestricted( sActivityTestRule.getActivity(), mSettingsLauncher); mDialog.show(); }); @@ -387,7 +387,7 @@ Mockito.verify(mSettingsLauncher) .launchSettingsActivity( any(Context.class), - eq(PrivacySandboxSettingsFragmentV4.class), + eq(PrivacySandboxSettingsFragment.class), any(Bundle.class)); } @@ -437,7 +437,7 @@ Mockito.verify(mSettingsLauncher) .launchSettingsActivity( any(Context.class), - eq(PrivacySandboxSettingsFragmentV4.class), + eq(PrivacySandboxSettingsFragment.class), any(Bundle.class)); } @@ -469,6 +469,6 @@ (int) mFakePrivacySandboxBridge.getLastPromptAction()); onView(withId(R.id.privacy_sandbox_notice_title)).check(doesNotExist()); Mockito.verify(mSettingsLauncher) - .launchSettingsActivity(any(Context.class), eq(AdMeasurementFragmentV4.class)); + .launchSettingsActivity(any(Context.class), eq(AdMeasurementFragment.class)); } }
diff --git a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentV4Test.java b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentTest.java similarity index 95% rename from chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentV4Test.java rename to chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentTest.java index 5af9456..0c059d3 100644 --- a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentV4Test.java +++ b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSettingsFragmentTest.java
@@ -13,9 +13,9 @@ import static org.hamcrest.Matchers.hasItems; import static org.chromium.chrome.browser.privacy_sandbox.PrivacySandboxTestUtils.getRootViewSanitized; -import static org.chromium.chrome.browser.privacy_sandbox.AdMeasurementFragmentV4.setAdMeasurementPrefEnabled; -import static org.chromium.chrome.browser.privacy_sandbox.FledgeFragmentV4.setFledgePrefEnabled; -import static org.chromium.chrome.browser.privacy_sandbox.TopicsFragmentV4.setTopicsPrefEnabled; +import static org.chromium.chrome.browser.privacy_sandbox.AdMeasurementFragment.setAdMeasurementPrefEnabled; +import static org.chromium.chrome.browser.privacy_sandbox.FledgeFragment.setFledgePrefEnabled; +import static org.chromium.chrome.browser.privacy_sandbox.TopicsFragment.setTopicsPrefEnabled; import static org.chromium.content_public.browser.test.util.TestThreadUtils.runOnUiThreadBlocking; import static org.chromium.ui.test.util.ViewUtils.onViewWaiting; @@ -46,11 +46,11 @@ import java.io.IOException; -/** Tests {@link PrivacySandboxSettingsFragmentV4} */ +/** Tests {@link PrivacySandboxSettingsFragment} */ @RunWith(ChromeJUnit4ClassRunner.class) @Batch(Batch.PER_CLASS) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) -public final class PrivacySandboxSettingsFragmentV4Test { +public final class PrivacySandboxSettingsFragmentTest { @Rule public ChromeBrowserTestRule mChromeBrowserTestRule = new ChromeBrowserTestRule(); @Rule @@ -60,8 +60,8 @@ .build(); @Rule - public SettingsActivityTestRule<PrivacySandboxSettingsFragmentV4> mSettingsActivityTestRule = - new SettingsActivityTestRule<>(PrivacySandboxSettingsFragmentV4.class); + public SettingsActivityTestRule<PrivacySandboxSettingsFragment> mSettingsActivityTestRule = + new SettingsActivityTestRule<>(PrivacySandboxSettingsFragment.class); public UserActionTester mUserActionTester; @@ -86,7 +86,7 @@ private void startPrivacySandboxSettingsV4() { Bundle fragmentArgs = new Bundle(); fragmentArgs.putInt( - PrivacySandboxSettingsFragmentV4.PRIVACY_SANDBOX_REFERRER, + PrivacySandboxSettingsFragment.PRIVACY_SANDBOX_REFERRER, PrivacySandboxReferrer.PRIVACY_SETTINGS); mSettingsActivityTestRule.startSettingsActivity(fragmentArgs); onViewWaiting(withText(R.string.ad_privacy_page_title));
diff --git a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragmentV4Test.java b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragmentTest.java similarity index 97% rename from chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragmentV4Test.java rename to chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragmentTest.java index bd37131f..06b8ba5 100644 --- a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragmentV4Test.java +++ b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/TopicsFragmentTest.java
@@ -60,11 +60,11 @@ import java.io.IOException; -/** Tests {@link TopicsFragmentV4} */ +/** Tests {@link TopicsFragment} */ @RunWith(ChromeJUnit4ClassRunner.class) @Batch(Batch.PER_CLASS) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) -public final class TopicsFragmentV4Test { +public final class TopicsFragmentTest { private static final String TOPIC_NAME_1 = "Topic 1"; private static final String TOPIC_NAME_2 = "Topic 2"; @@ -78,8 +78,8 @@ .build(); @Rule - public SettingsActivityTestRule<TopicsFragmentV4> mSettingsActivityTestRule = - new SettingsActivityTestRule<>(TopicsFragmentV4.class); + public SettingsActivityTestRule<TopicsFragment> mSettingsActivityTestRule = + new SettingsActivityTestRule<>(TopicsFragment.class); @Rule public JniMocker mocker = new JniMocker(); @@ -137,13 +137,13 @@ private void setTopicsPrefEnabled(boolean isEnabled) { TestThreadUtils.runOnUiThreadBlocking( () -> - TopicsFragmentV4.setTopicsPrefEnabled( + TopicsFragment.setTopicsPrefEnabled( Profile.getLastUsedRegularProfile(), isEnabled)); } private boolean isTopicsPrefEnabled() { return TestThreadUtils.runOnUiThreadBlockingNoException( - () -> TopicsFragmentV4.isTopicsPrefEnabled(Profile.getLastUsedRegularProfile())); + () -> TopicsFragment.isTopicsPrefEnabled(Profile.getLastUsedRegularProfile())); } @Test
diff --git a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/ReadAloudController.java b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/ReadAloudController.java index ed089b19..67a28f7 100644 --- a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/ReadAloudController.java +++ b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/ReadAloudController.java
@@ -341,10 +341,19 @@ mPlaybackHooks.initVoices(); } + String playbackLanguage = getLanguageForNewPlayback(tab); + var voices = mPlaybackHooks.getVoicesFor(playbackLanguage); + // TODO: Don't show entrypoints for unsupported languages + if (voices == null || voices.isEmpty()) { + var promise = new Promise<Playback>(); + promise.reject(new Exception("Unsupported language")); + return promise; + } + PlaybackArgs args = new PlaybackArgs( stripUserData(tab.getUrl()).getSpec(), - getLanguageForNewPlayback(tab), + playbackLanguage, mPlaybackHooks.getPlaybackVoiceList( ReadAloudPrefs.getVoices(getPrefService())), /* dateModifiedMsSinceEpoch= */ 0);
diff --git a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/ReadAloudControllerUnitTest.java b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/ReadAloudControllerUnitTest.java index af68b332..c35cc5e 100644 --- a/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/ReadAloudControllerUnitTest.java +++ b/chrome/browser/readaloud/android/java/src/org/chromium/chrome/browser/readaloud/ReadAloudControllerUnitTest.java
@@ -11,6 +11,7 @@ import static org.mockito.Mockito.any; import static org.mockito.Mockito.anyInt; import static org.mockito.Mockito.anyLong; +import static org.mockito.Mockito.anyString; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.never; @@ -170,6 +171,9 @@ mController.setHighlighterForTests(mHighlighter); doReturn(false).when(mPlaybackHooks).voicesInitialized(); + doReturn(List.of(new PlaybackVoice("en", "voiceA", ""))) + .when(mPlaybackHooks) + .getVoicesFor(anyString()); } @Test @@ -451,6 +455,17 @@ } @Test + public void testPlayTab_unsupportedLanguage() { + doReturn(List.of()).when(mPlaybackHooks).getVoicesFor(anyString()); + mFakeTranslateBridge.setCurrentLanguage("pl-PL"); + mTab.setGurlOverrideForTesting(new GURL("https://en.wikipedia.org/wiki/Google")); + + mController.playTab(mTab); + + verify(mPlaybackHooks, never()).createPlayback(mPlaybackArgsCaptor.capture(), any()); + } + + @Test public void testPlayTab_tabLanguageUnd() { AppLocaleUtils.setAppLanguagePref("fr-FR"); @@ -499,6 +514,9 @@ reset(mPlayback); reset(mPlaybackHooks); + doReturn(List.of(new PlaybackVoice("en", "voiceA", ""))) + .when(mPlaybackHooks) + .getVoicesFor(anyString()); // Subsequent playTab() should play without trying to release anything. mController.playTab(mTab); verify(mPlaybackHooks).createPlayback(any(), any()); @@ -645,6 +663,7 @@ // Set the new voice. var newVoice = new PlaybackVoice("lang", "NEW VOICE ID", "description"); doReturn(List.of(newVoice)).when(mPlaybackHooks).getPlaybackVoiceList(any()); + doReturn(List.of(newVoice)).when(mPlaybackHooks).getVoicesFor(anyString()); var data = Mockito.mock(PlaybackData.class); doReturn(99).when(data).paragraphIndex(); doReturn(PlaybackListener.State.PLAYING).when(data).state(); @@ -656,6 +675,7 @@ // Playback is stopped. verify(mPlayback).release(); + doReturn(List.of(newVoice)).when(mPlaybackHooks).getVoicesFor(anyString()); // Playback starts again with new voice and original paragraph index. verify(mPlaybackHooks, times(1)) @@ -687,6 +707,7 @@ // Change voice setting. var newVoice = new PlaybackVoice("lang", "NEW VOICE ID", "description"); + doReturn(List.of(newVoice)).when(mPlaybackHooks).getVoicesFor(anyString()); doReturn(List.of(newVoice)).when(mPlaybackHooks).getPlaybackVoiceList(any()); mController.setVoiceOverrideAndApplyToPlayback(newVoice); @@ -715,6 +736,7 @@ // Preview a voice. var voice = new PlaybackVoice("en", "asdf", ""); + doReturn(List.of(voice)).when(mPlaybackHooks).getVoicesFor(anyString()); doReturn(List.of(voice)).when(mPlaybackHooks).getPlaybackVoiceList(any()); mController.previewVoice(voice); @@ -764,6 +786,7 @@ // Preview a voice. var voice = new PlaybackVoice("en", "asdf", ""); + doReturn(List.of(voice)).when(mPlaybackHooks).getVoicesFor(anyString()); doReturn(List.of(voice)).when(mPlaybackHooks).getPlaybackVoiceList(any()); mController.previewVoice(voice); @@ -789,6 +812,7 @@ // Preview a voice. var voice = new PlaybackVoice("en", "asdf", ""); doReturn(List.of(voice)).when(mPlaybackHooks).getPlaybackVoiceList(any()); + doReturn(List.of(voice)).when(mPlaybackHooks).getVoicesFor(anyString()); mController.previewVoice(voice); verify(mPlaybackHooks).createPlayback(any(), mPlaybackCallbackCaptor.capture()); @@ -797,6 +821,7 @@ reset(mPlaybackHooks); // Start another preview. + doReturn(List.of(voice)).when(mPlaybackHooks).getVoicesFor(anyString()); mController.previewVoice(new PlaybackVoice("en", "abcd", "")); // Preview playback should be stopped and cleaned up. verify(previewPlayback).release(); @@ -819,6 +844,10 @@ // Set up playback and restorable state. mController.playTab(mTab); reset(mPlaybackHooks); + doReturn(List.of(new PlaybackVoice("en", "voiceA", ""))) + .when(mPlaybackHooks) + .getVoicesFor(anyString()); + var data = Mockito.mock(PlaybackListener.PlaybackData.class); doReturn(PlaybackListener.State.STOPPED).when(data).state(); doReturn(99).when(data).paragraphIndex(); @@ -833,6 +862,9 @@ Playback previewPlayback = Mockito.mock(Playback.class); onPlaybackSuccess(previewPlayback); reset(mPlaybackHooks); + doReturn(List.of(new PlaybackVoice("en", "voiceA", ""))) + .when(mPlaybackHooks) + .getVoicesFor(anyString()); // Closing the voice menu should stop the preview. mController.onVoiceMenuClosed(); @@ -852,7 +884,9 @@ mController.playTab(mTab); verify(mPlaybackHooks).createPlayback(any(), mPlaybackCallbackCaptor.capture()); reset(mPlaybackHooks); - + doReturn(List.of(new PlaybackVoice("en", "voiceA", ""))) + .when(mPlaybackHooks) + .getVoicesFor(anyString()); // User changes voices before the first playback is ready. mController.setVoiceOverrideAndApplyToPlayback(new PlaybackVoice("en", "1234", "")); verify(mPlaybackHooks).createPlayback(any(), mPlaybackCallbackCaptor.capture()); @@ -874,6 +908,9 @@ verify(mPlaybackHooks).createPlayback(any(), mPlaybackCallbackCaptor.capture()); onPlaybackSuccess(mPlayback); reset(mPlaybackHooks); + doReturn(List.of(new PlaybackVoice("en", "voiceA", ""))) + .when(mPlaybackHooks) + .getVoicesFor(anyString()); var data = Mockito.mock(PlaybackListener.PlaybackData.class); doReturn(PlaybackListener.State.PLAYING).when(data).state(); doReturn(99).when(data).paragraphIndex(); @@ -887,6 +924,9 @@ mController.previewVoice(voice); verify(mPlaybackHooks).createPlayback(any(), mPlaybackCallbackCaptor.capture()); reset(mPlaybackHooks); + doReturn(List.of(new PlaybackVoice("en", "voiceA", ""))) + .when(mPlaybackHooks) + .getVoicesFor(anyString()); Playback previewPlayback = Mockito.mock(Playback.class); onPlaybackSuccess(previewPlayback);
diff --git a/chrome/browser/reading_list/reading_list_model_factory.cc b/chrome/browser/reading_list/reading_list_model_factory.cc index 802e834..d644c6a 100644 --- a/chrome/browser/reading_list/reading_list_model_factory.cc +++ b/chrome/browser/reading_list/reading_list_model_factory.cc
@@ -36,17 +36,13 @@ Profile* const profile = Profile::FromBrowserContext(context); syncer::OnceModelTypeStoreFactory store_factory = ModelTypeStoreServiceFactory::GetForProfile(profile)->GetStoreFactory(); - auto storage = + auto local_storage = std::make_unique<ReadingListModelStorageImpl>(std::move(store_factory)); - auto reading_list_model = std::make_unique<ReadingListModelImpl>( - std::move(storage), syncer::StorageType::kUnspecified, - syncer::WipeModelUponSyncDisabledBehavior::kNever, - base::DefaultClock::GetInstance()); - - if (!base::FeatureList::IsEnabled( - syncer::kReadingListEnableDualReadingListModel)) { - return reading_list_model; - } + auto reading_list_model_for_local_storage = + std::make_unique<ReadingListModelImpl>( + std::move(local_storage), syncer::StorageType::kUnspecified, + syncer::WipeModelUponSyncDisabledBehavior::kNever, + base::DefaultClock::GetInstance()); syncer::OnceModelTypeStoreFactory store_factory_for_account_storage = ModelTypeStoreServiceFactory::GetForProfile(profile) @@ -59,7 +55,8 @@ syncer::WipeModelUponSyncDisabledBehavior::kAlways, base::DefaultClock::GetInstance()); return std::make_unique<reading_list::DualReadingListModel>( - /*local_or_syncable_model=*/std::move(reading_list_model), + /*local_or_syncable_model=*/std::move( + reading_list_model_for_local_storage), /*account_model=*/std::move(reading_list_model_for_account_storage)); }
diff --git a/chrome/browser/reduce_accept_language/reduce_accept_language_browsertest.cc b/chrome/browser/reduce_accept_language/reduce_accept_language_browsertest.cc index e6dde05..3c672f7 100644 --- a/chrome/browser/reduce_accept_language/reduce_accept_language_browsertest.cc +++ b/chrome/browser/reduce_accept_language/reduce_accept_language_browsertest.cc
@@ -429,7 +429,7 @@ : public ReduceAcceptLanguageBrowserTest { void EnabledFeatures() override { std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->InitializeFromCommandLine("", "ReduceAcceptLanguage"); + feature_list->InitFromCommandLine("", "ReduceAcceptLanguage"); scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); } }; @@ -476,7 +476,7 @@ protected: void EnabledFeatures() override { std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->InitializeFromCommandLine("ReduceAcceptLanguage", ""); + feature_list->InitFromCommandLine("ReduceAcceptLanguage", ""); scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); } }; @@ -1142,7 +1142,7 @@ protected: void EnabledFeatures() override { std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->InitializeFromCommandLine("ReduceAcceptLanguage", ""); + feature_list->InitFromCommandLine("ReduceAcceptLanguage", ""); scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); } }; @@ -1430,7 +1430,7 @@ protected: void EnabledFeatures() override { std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->InitializeFromCommandLine("ReduceAcceptLanguage", ""); + feature_list->InitFromCommandLine("ReduceAcceptLanguage", ""); scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); } @@ -1602,7 +1602,7 @@ protected: void EnabledFeatures() override { std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->InitializeFromCommandLine("ReduceAcceptLanguage", ""); + feature_list->InitFromCommandLine("ReduceAcceptLanguage", ""); scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); } @@ -1835,8 +1835,8 @@ // Explicit disable feature ReduceAcceptLanguage but enable // ReduceAcceptLanguageOriginTrial. std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->InitializeFromCommandLine("ReduceAcceptLanguageOriginTrial", - "ReduceAcceptLanguage"); + feature_list->InitFromCommandLine("ReduceAcceptLanguageOriginTrial", + "ReduceAcceptLanguage"); scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); } }; @@ -2104,8 +2104,8 @@ // Explicit disable feature ReduceAcceptLanguage but enable // ReduceAcceptLanguageOriginTrial. std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->InitializeFromCommandLine("ReduceAcceptLanguageOriginTrial", - "ReduceAcceptLanguage"); + feature_list->InitFromCommandLine("ReduceAcceptLanguageOriginTrial", + "ReduceAcceptLanguage"); scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); } }; @@ -2389,8 +2389,8 @@ // Explicit disable feature ReduceAcceptLanguage but enable // ReduceAcceptLanguageOriginTrial. std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->InitializeFromCommandLine("ReduceAcceptLanguageOriginTrial", - "ReduceAcceptLanguage"); + feature_list->InitFromCommandLine("ReduceAcceptLanguageOriginTrial", + "ReduceAcceptLanguage"); scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); } }; @@ -2546,8 +2546,8 @@ // Explicit disable feature ReduceAcceptLanguage but enable // ReduceAcceptLanguageOriginTrial. std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->InitializeFromCommandLine("ReduceAcceptLanguageOriginTrial", - "ReduceAcceptLanguage"); + feature_list->InitFromCommandLine("ReduceAcceptLanguageOriginTrial", + "ReduceAcceptLanguage"); scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); } }; @@ -2657,7 +2657,7 @@ // Explicit disable feature ReduceAcceptLanguage and // ReduceAcceptLanguageOriginTrial. std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->InitializeFromCommandLine( + feature_list->InitFromCommandLine( "", "ReduceAcceptLanguageOriginTrial,ReduceAcceptLanguage"); scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); }
diff --git a/chrome/browser/resources/ash/settings/BUILD.gn b/chrome/browser/resources/ash/settings/BUILD.gn index 6c8369e7..26291fe8 100644 --- a/chrome/browser/resources/ash/settings/BUILD.gn +++ b/chrome/browser/resources/ash/settings/BUILD.gn
@@ -80,7 +80,6 @@ "crostini_page/crostini_subpage.ts", "date_time_page/date_time_settings_card.ts", "date_time_page/date_time_page.ts", - "date_time_page/system_geolocation_dialog.ts", "date_time_page/timezone_selector.ts", "date_time_page/timezone_subpage.ts", "device_page/audio.ts", @@ -302,6 +301,8 @@ "os_privacy_page/privacy_hub_app_permission_row.ts", "os_privacy_page/privacy_hub_camera_subpage.ts", "os_privacy_page/privacy_hub_geolocation_subpage.ts", + "os_privacy_page/privacy_hub_geolocation_dialog.ts", + "os_privacy_page/privacy_hub_geolocation_warning_text.ts", "os_privacy_page/privacy_hub_microphone_subpage.ts", "os_privacy_page/privacy_hub_subpage.ts", "os_privacy_page/smart_privacy_subpage.ts",
diff --git a/chrome/browser/resources/ash/settings/date_time_page/system_geolocation_dialog.html b/chrome/browser/resources/ash/settings/date_time_page/system_geolocation_dialog.html deleted file mode 100644 index 0d03c76..0000000 --- a/chrome/browser/resources/ash/settings/date_time_page/system_geolocation_dialog.html +++ /dev/null
@@ -1,33 +0,0 @@ -<style include="settings-shared"> - #dialogBody { - padding-top: 10px; - } - - cr-dialog::part(dialog) { - width: 370px; - } - -</style> - -<cr-dialog id="enableSystemGeolocationDialog" show-on-attach> - <div slot="title"> - $i18n{timeZoneGeolocationDialogTitle} - </div> - <div slot="body" id="dialogBody"> - <localized-link localized-string="$i18n{timeZoneGeolocationDialogBody}" - link-url="$i18n{timeZoneGeolocationDialogLearnMoreUrl}"> - </localized-link> - </div> - <div slot="button-container"> - <cr-button id="cancelButton" - class="cancel-button" - on-click="onCancelClicked_"> - $i18n{timeZoneGeolocationDialogCancelButton} - </cr-button> - <cr-button id="enableConfirmation" - class="action-button" - on-click="onEnableClicked_"> - $i18n{timeZoneGeolocationDialogTurnOnButton} - </cr-button> - </div> -</cr-dialog>
diff --git a/chrome/browser/resources/ash/settings/date_time_page/timezone_subpage.html b/chrome/browser/resources/ash/settings/date_time_page/timezone_subpage.html index 9958204c..51721df 100644 --- a/chrome/browser/resources/ash/settings/date_time_page/timezone_subpage.html +++ b/chrome/browser/resources/ash/settings/date_time_page/timezone_subpage.html
@@ -10,6 +10,12 @@ #timezoneSelector { padding-inline-start: 28px; } + + #warningText { + width: 425px; + padding-inline-start: 28px; + } + </style> <div class="settings-box block first"> <settings-radio-group id="timeZoneRadioGroup" @@ -27,9 +33,16 @@ label="$i18n{selectTimeZoneResolveMethod}" disabled="[[!prefs.generated.resolve_timezone_by_geolocation_on_off.value]]" menu-options="[[getTimeZoneResolveMethodsList_( - prefs.generated.resolve_timezone_by_geolocation_method_short)]]" - on-settings-control-change="onTimeZoneSelectionChanged_"> + prefs.generated.resolve_timezone_by_geolocation_method_short)]]"> </settings-dropdown-menu> + <template is="dom-if" if="[[shouldShowGeolocationWarningText_]]" + restamp> + <settings-privacy-hub-geolocation-warning-text + id="warningText" + warning-text-with-anchor="$i18n{timeZoneGeolocationWarningText}" + on-link-clicked="openGeolocationDialog_"> + </settings-privacy-hub-geolocation-warning-text> + </template> <controlled-radio-button id="timeZoneAutoDetectOff" name="false" @@ -44,8 +57,8 @@ </div> <template is="dom-if" if="[[showEnableSystemGeolocationDialog_]]" restamp> - <settings-system-geolocation-dialog id="geolocationDialog" - on-close="onEnableSystemGeolocationDialogClosed_" + <settings-privacy-hub-geolocation-dialog id="geolocationDialog" + on-close="onGeolocationDialogClose_" prefs="{{prefs}}"> - </settings-system-geolocation-dialog> + </settings-privacy-hub-geolocation-dialog> </template>
diff --git a/chrome/browser/resources/ash/settings/date_time_page/timezone_subpage.ts b/chrome/browser/resources/ash/settings/date_time_page/timezone_subpage.ts index a6d2aa1..010f1b5 100644 --- a/chrome/browser/resources/ash/settings/date_time_page/timezone_subpage.ts +++ b/chrome/browser/resources/ash/settings/date_time_page/timezone_subpage.ts
@@ -12,6 +12,8 @@ import '/shared/settings/controls/settings_radio_group.js'; import '../settings_shared.css.js'; import './timezone_selector.js'; +import '../os_privacy_page/privacy_hub_geolocation_dialog.js'; +import '../os_privacy_page/privacy_hub_geolocation_warning_text.js'; import {SettingsDropdownMenuElement} from '/shared/settings/controls/settings_dropdown_menu.js'; import {PrefsMixin} from 'chrome://resources/cr_components/settings_prefs/prefs_mixin.js'; @@ -23,6 +25,7 @@ import {isChild} from '../common/load_time_booleans.js'; import {RouteObserverMixin} from '../common/route_observer_mixin.js'; import {Setting} from '../mojom-webui/setting.mojom-webui.js'; +import {GeolocationAccessLevel} from '../os_privacy_page/privacy_hub_geolocation_subpage.js'; import {Route, routes} from '../router.js'; import {TimeZoneAutoDetectMethod} from './date_time_types.js'; @@ -67,6 +70,13 @@ value: () => new Set<Setting>([Setting.kChangeTimeZone]), }, + shouldShowGeolocationWarningText_: { + type: Boolean, + computed: 'computeShouldShowGeolocationWarningText_(' + + 'prefs.generated.resolve_timezone_by_geolocation_on_off.value,' + + 'prefs.ash.user.geolocation_access_level.value)', + }, + showEnableSystemGeolocationDialog_: { type: Boolean, value: false, @@ -77,6 +87,7 @@ activeTimeZoneDisplayName: string; private browserProxy_: TimeZoneBrowserProxy; private showEnableSystemGeolocationDialog_: boolean; + private shouldShowGeolocationWarningText_: boolean; constructor() { super(); @@ -109,6 +120,14 @@ this.attemptDeepLink(); } + private computeShouldShowGeolocationWarningText_(): boolean { + return ( + this.prefs.generated.resolve_timezone_by_geolocation_on_off.value === + true && + this.prefs.ash.user.geolocation_access_level.value === + GeolocationAccessLevel.DISALLOWED); + } + /** * Returns value list for timeZoneResolveMethodDropdown menu. */ @@ -176,30 +195,11 @@ } } - private onTimeZoneSelectionChanged_(): void { - const geolocationAllowed = - this.getPref('ash.user.geolocation_allowed').value; - if (geolocationAllowed) { - return; - } - - let selectedTimezoneOption = null; - const dropDown = this.$.timeZoneResolveMethodDropdown; - if (dropDown.pref) { - selectedTimezoneOption = dropDown.pref.value; - } - - // Pop up geolocation dialog, when user wants to enable precise timezone, - // but the system geolocation access is disabled. - if (selectedTimezoneOption === - TimeZoneAutoDetectMethod.SEND_ALL_LOCATION_INFO || - selectedTimezoneOption === - TimeZoneAutoDetectMethod.SEND_WIFI_ACCESS_POINTS) { - this.showEnableSystemGeolocationDialog_ = true; - } + private openGeolocationDialog_(): void { + this.showEnableSystemGeolocationDialog_ = true; } - private onEnableSystemGeolocationDialogClosed_(): void { + private onGeolocationDialogClose_(): void { this.showEnableSystemGeolocationDialog_ = false; } }
diff --git a/chrome/browser/resources/ash/settings/device_page/display_night_light.html b/chrome/browser/resources/ash/settings/device_page/display_night_light.html index 116ae6b3..7283b29 100644 --- a/chrome/browser/resources/ash/settings/device_page/display_night_light.html +++ b/chrome/browser/resources/ash/settings/device_page/display_night_light.html
@@ -11,6 +11,10 @@ pointer-events: none; } + #NightLightLabelDiv { + align-self: start; + } + .text-area { margin: 10px 0; } @@ -20,6 +24,12 @@ margin-top: 20px; } + #nightLightDropDownDiv { + width: 200px; + text-align: right; + margin-top: 8px; + } + iron-collapse { width: 100%; } @@ -53,7 +63,7 @@ </div> <!-- Schedule settings --> <div class="settings-box indented"> - <div class="start text-area" aria-hidden="true"> + <div id="NightLightLabelDiv" class="start text-area" aria-hidden="true"> <div id="nightLightScheduleLabel" class="label"> $i18n{displayNightLightScheduleLabel} </div> @@ -62,14 +72,25 @@ [[nightLightScheduleSubLabel_]] </div> </div> - <settings-dropdown-menu - id="nightLightScheduleTypeDropDown" - class="cr-row-gap" - label="$i18n{displayNightLightScheduleLabel}" - aria-describedby="nightLightScheduleSubLabel" - pref="{{prefs.ash.night_light.schedule_type}}" - menu-options="[[scheduleTypesList_]]"> - </settings-dropdown-menu> + <div id="nightLightDropDownDiv" + class="cr-row-gap"> + <settings-dropdown-menu + id="nightLightScheduleTypeDropDown" + label="$i18n{displayNightLightScheduleLabel}" + aria-describedby="nightLightScheduleSubLabel" + pref="{{prefs.ash.night_light.schedule_type}}" + menu-options="[[scheduleTypesList_]]"> + </settings-dropdown-menu> + <template is="dom-if" if="[[shouldShowGeolocationWarningText_]]" + restamp> + <settings-privacy-hub-geolocation-warning-text + id="warningText" + warning-text-with-anchor= + "$i18n{displayNightLightGeolocationWarningText}" + on-link-clicked="openGeolocationDialog_"> + </settings-privacy-hub-geolocation-warning-text> + </template> + </div> </div> <!-- Custom schedule slider --> <iron-collapse id="nightLightCustomScheduleCollapse" @@ -85,4 +106,12 @@ </div> </div> </iron-collapse> -</div> \ No newline at end of file +</div> + +<!-- System geolocation dialog, letting users enable location permission --> +<template is="dom-if" if="[[shouldShowGeolocationDialog_]]" restamp> + <settings-privacy-hub-geolocation-dialog id="geolocationDialog" + on-close="onGeolocationDialogClose_" + prefs="{{prefs}}"> + </settings-privacy-hub-geolocation-dialog> +</template>
diff --git a/chrome/browser/resources/ash/settings/device_page/display_night_light.ts b/chrome/browser/resources/ash/settings/device_page/display_night_light.ts index 371837e..ebd52c6e 100644 --- a/chrome/browser/resources/ash/settings/device_page/display_night_light.ts +++ b/chrome/browser/resources/ash/settings/device_page/display_night_light.ts
@@ -25,6 +25,7 @@ import {DeepLinkingMixin} from '../common/deep_linking_mixin.js'; import {Setting} from '../mojom-webui/setting.mojom-webui.js'; +import {GeolocationAccessLevel} from '../os_privacy_page/privacy_hub_geolocation_subpage.js'; import {getTemplate} from './display_night_light.html.js'; @@ -100,20 +101,32 @@ ]), }, + shouldShowGeolocationWarningText_: { + type: Boolean, + computed: 'computeShouldShowGeolocationWarningText_(' + + 'prefs.ash.night_light.schedule_type.value, ' + + 'prefs.ash.user.geolocation_access_level.value),', + }, + + shouldShowEnableGeolocationDialog_: { + type: Boolean, + value: false, + }, }; } static get observers() { return [ 'updateNightLightScheduleSettings_(prefs.ash.night_light.schedule_type.*,' + - ' prefs.ash.night_light.enabled.*)', + ' prefs.ash.night_light.enabled.*),', ]; } private nightLightScheduleSubLabel_: string; private scheduleTypesList_: ScheduleType[]; private shouldOpenCustomScheduleCollapse_: boolean; - + private shouldShowGeolocationDialog_: boolean; + private shouldShowGeolocationWarningText_: boolean; /** * Invoked when the status of Night Light or its schedule type are changed, * in order to update the schedule settings, such as whether to show the @@ -133,6 +146,24 @@ this.nightLightScheduleSubLabel_ = ''; } } + + private computeShouldShowGeolocationWarningText_(): boolean { + const scheduleType = this.prefs.ash.night_light.schedule_type.value; + const geolocationAccessLevel = + this.prefs.ash.user.geolocation_access_level.value; + + return ( + scheduleType === NightLightScheduleType.SUNSET_TO_SUNRISE && + geolocationAccessLevel === GeolocationAccessLevel.DISALLOWED); + } + + private openGeolocationDialog_(): void { + this.shouldShowGeolocationDialog_ = true; + } + + private onGeolocationDialogClose_(): void { + this.shouldShowGeolocationDialog_ = false; + } } declare global {
diff --git a/chrome/browser/resources/ash/settings/internet_page/network_summary_item.ts b/chrome/browser/resources/ash/settings/internet_page/network_summary_item.ts index 4bd9710..b7f93c8 100644 --- a/chrome/browser/resources/ash/settings/internet_page/network_summary_item.ts +++ b/chrome/browser/resources/ash/settings/internet_page/network_summary_item.ts
@@ -149,7 +149,7 @@ } if (deviceState.deviceState === DeviceStateType.kEnabling) { - return this.i18n('internetDeviceEnabling'); + return this.i18n('networkDeviceTurningOn'); } } // No device or unknown device state, use 'off'.
diff --git a/chrome/browser/resources/ash/settings/lazy_load.ts b/chrome/browser/resources/ash/settings/lazy_load.ts index 221aaef..2ed63a8 100644 --- a/chrome/browser/resources/ash/settings/lazy_load.ts +++ b/chrome/browser/resources/ash/settings/lazy_load.ts
@@ -20,6 +20,7 @@ import './os_printing_page/os_printing_page.js'; import './os_reset_page/os_reset_page.js'; /** Subpages */ +import './date_time_page/timezone_subpage.js'; import './device_page/customize_mouse_buttons_subpage.js'; import './device_page/customize_pen_buttons_subpage.js'; import './device_page/customize_tablet_buttons_subpage.js'; @@ -73,7 +74,6 @@ import './crostini_page/crostini_port_forwarding_add_port_dialog.js'; import './crostini_page/crostini_shared_usb_devices.js'; import './crostini_page/crostini_subpage.js'; -import './date_time_page/system_geolocation_dialog.js'; import './date_time_page/timezone_selector.js'; import './guest_os/guest_os_container_select.js'; import './guest_os/guest_os_shared_paths.js';
diff --git a/chrome/browser/resources/ash/settings/os_bluetooth_page/os_bluetooth_summary.html b/chrome/browser/resources/ash/settings/os_bluetooth_page/os_bluetooth_summary.html index 884515395..a46a1cda 100644 --- a/chrome/browser/resources/ash/settings/os_bluetooth_page/os_bluetooth_summary.html +++ b/chrome/browser/resources/ash/settings/os_bluetooth_page/os_bluetooth_summary.html
@@ -2,6 +2,10 @@ #pairNewDeviceBtn { margin-inline-end: 20px; } + + :host-context(body.revamp-wayfinding-enabled) #statusIcon { + --iron-icon-fill-color: var(--cros-sys-primary); + } </style> <template is="dom-if" if="[[!isSecondaryUser_]]" > <div id="bluetoothSummary" class="settings-box two-line first no-padding">
diff --git a/chrome/browser/resources/ash/settings/os_people_page/account_manager_settings_card.html b/chrome/browser/resources/ash/settings/os_people_page/account_manager_settings_card.html index deb6701..9ed0255 100644 --- a/chrome/browser/resources/ash/settings/os_people_page/account_manager_settings_card.html +++ b/chrome/browser/resources/ash/settings/os_people_page/account_manager_settings_card.html
@@ -74,6 +74,10 @@ left: auto; right: var(--badge-offset); } + + :host-context(body.revamp-wayfinding-enabled) #managedUserIcon { + --iron-icon-fill-color: var(--cros-sys-secondary); + } </style> <settings-card header-text="$i18n{accountManagerPageTitle}"> @@ -88,7 +92,7 @@ <template is="dom-if" if="[[isDeviceAccountManaged_]]"> <div class="settings-box managed-message"> <template is="dom-if" if="[[!isChildUser_]]"> - <iron-icon icon="cr20:domain"></iron-icon> + <iron-icon id="managedUserIcon" icon="[[managedByIcon_]]"></iron-icon> </template> <template is="dom-if" if="[[isChildUser_]]"> <cr-icon-button iron-icon="cr20:kite"
diff --git a/chrome/browser/resources/ash/settings/os_people_page/account_manager_settings_card.ts b/chrome/browser/resources/ash/settings/os_people_page/account_manager_settings_card.ts index 03f0c6a4..e828bd4 100644 --- a/chrome/browser/resources/ash/settings/os_people_page/account_manager_settings_card.ts +++ b/chrome/browser/resources/ash/settings/os_people_page/account_manager_settings_card.ts
@@ -74,6 +74,16 @@ readOnly: true, }, + /** + * The name of the icon to display in the management row. + * Should only be read if isDeviceAccountManaged_ is true. + */ + managedByIcon_: { + type: String, + value() { + return loadTimeData.getString('managedByIcon'); + }, + }, }; }
diff --git a/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_dialog.html b/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_dialog.html new file mode 100644 index 0000000..ac4edae9 --- /dev/null +++ b/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_dialog.html
@@ -0,0 +1,32 @@ +<style include="settings-shared"> + #dialogBody { + padding-top: 10px; + } + + cr-dialog::part(dialog) { + width: 370px; + } +</style> + +<cr-dialog id="systemGeolocationDialog" show-on-attach> + <div slot="title"> + $i18n{systemGeolocationDialogTitle} + </div> + <div slot="body" id="dialogBody"> + <localized-link localized-string="$i18n{systemGeolocationDialogBody}" + link-url="$i18n{systemGeolocationDialogLearnMoreUrl}"> + </localized-link> + </div> + <div slot="button-container"> + <cr-button id="cancelButton" + class="cancel-button" + on-click="onCancelClicked_"> + $i18n{systemGeolocationDialogCancelButton} + </cr-button> + <cr-button id="confirmButton" + class="action-button" + on-click="onEnableClicked_"> + $i18n{systemGeolocationDialogConfirmButton} + </cr-button> + </div> +</cr-dialog>
diff --git a/chrome/browser/resources/ash/settings/date_time_page/system_geolocation_dialog.ts b/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_dialog.ts similarity index 60% rename from chrome/browser/resources/ash/settings/date_time_page/system_geolocation_dialog.ts rename to chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_dialog.ts index bc8f680..f25a8ac 100644 --- a/chrome/browser/resources/ash/settings/date_time_page/system_geolocation_dialog.ts +++ b/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_dialog.ts
@@ -17,16 +17,16 @@ import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {castExists} from '../assert_extras.js'; +import {GeolocationAccessLevel} from './privacy_hub_geolocation_subpage.js'; -import {TimeZoneAutoDetectMethod} from './date_time_types.js'; -import {getTemplate} from './system_geolocation_dialog.html.js'; +import {getTemplate} from './privacy_hub_geolocation_dialog.html.js'; -const SystemGeolocationDialogElementBase = PrefsMixin(PolymerElement); +const PrivacyHubGeolocationDialogBase = PrefsMixin(PolymerElement); -class SystemGeolocationDialogElement extends - SystemGeolocationDialogElementBase { +class PrivacyHubGeolocationDialog extends + PrivacyHubGeolocationDialogBase { static get is() { - return 'settings-system-geolocation-dialog' as const; + return 'settings-privacy-hub-geolocation-dialog' as const; } static get template() { @@ -38,29 +38,28 @@ */ private onEnableClicked_(): void { // Send the new state immediately, this will also toggle the underlying - // setting-toggle-button associated with this pref. - this.setPrefValue('ash.user.geolocation_allowed', true); - this.getWarningDialog_().close(); + // `setting-dropdown-menu` setting associated with this pref. + this.setPrefValue( + 'ash.user.geolocation_access_level', + GeolocationAccessLevel.ONLY_ALLOWED_FOR_SYSTEM); + this.getDialog_().close(); } private onCancelClicked_(): void { - this.setPrefValue( - 'generated.resolve_timezone_by_geolocation_method_short', - TimeZoneAutoDetectMethod.IP_ONLY); - this.getWarningDialog_().close(); + this.getDialog_().close(); } - private getWarningDialog_(): CrDialogElement { + private getDialog_(): CrDialogElement { return castExists(this.shadowRoot!.querySelector<CrDialogElement>( - '#enableSystemGeolocationDialog')); + '#systemGeolocationDialog')); } } declare global { interface HTMLElementTagNameMap { - [SystemGeolocationDialogElement.is]: SystemGeolocationDialogElement; + [PrivacyHubGeolocationDialog.is]: PrivacyHubGeolocationDialog; } } customElements.define( - SystemGeolocationDialogElement.is, SystemGeolocationDialogElement); + PrivacyHubGeolocationDialog.is, PrivacyHubGeolocationDialog);
diff --git a/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_subpage.ts b/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_subpage.ts index 3709a7f..bb00735 100644 --- a/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_subpage.ts +++ b/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_subpage.ts
@@ -14,8 +14,12 @@ import {getTemplate} from './privacy_hub_geolocation_subpage.html.js'; - -enum GeolocationAccessLevel { +/** + * Geolocation access levels for the ChromeOS system. + * This must be kept in sync with `GeolocationAccessLevel` in + * ash/constants/geolocation_access_level.h + */ +export enum GeolocationAccessLevel { DISALLOWED = 0, ALLOWED = 1, ONLY_ALLOWED_FOR_SYSTEM = 2,
diff --git a/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_warning_text.html b/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_warning_text.html new file mode 100644 index 0000000..beab8d9 --- /dev/null +++ b/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_warning_text.html
@@ -0,0 +1,19 @@ +<style include="settings-shared"> + #container { + display: inline-flex; + width: inherit; + margin-top: 5px; + text-align: left; + } + + #warningIcon { + margin-right: 5px; + } +</style> +<div id="container"> + <iron-icon id="warningIcon" icon="cr20:warning"></iron-icon> + <localized-link + on-link-clicked="launchGeolocationDialog_" + localized-string="[[warningTextWithAnchor]]"> + </localized-link> +</div>
diff --git a/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_warning_text.ts b/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_warning_text.ts new file mode 100644 index 0000000..1571c5f --- /dev/null +++ b/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_geolocation_warning_text.ts
@@ -0,0 +1,46 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import {getTemplate} from './privacy_hub_geolocation_warning_text.html.js'; + +class PrivacyHubGeolocationWarningText extends PolymerElement { + static get is() { + return 'settings-privacy-hub-geolocation-warning-text' as const; + } + + static get template() { + return getTemplate(); + } + + static get properties() { + return { + warningTextWithAnchor: { + type: String, + reflectToAttribute: true, + }, + }; + } + + warningTextWithAnchor: string; + + private launchGeolocationDialog_(e: CustomEvent<{event: Event}>): void { + // A place holder href with the value "#" is used to have a compliant link. + // This prevents the browser from navigating the window to "#". + e.detail.event.preventDefault(); + e.stopPropagation(); + + this.dispatchEvent(new CustomEvent('link-clicked', {bubbles: false})); + } +} + +declare global { + interface HTMLElementTagNameMap { + [PrivacyHubGeolocationWarningText.is]: PrivacyHubGeolocationWarningText; + } +} + +customElements.define( + PrivacyHubGeolocationWarningText.is, PrivacyHubGeolocationWarningText);
diff --git a/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_subpage.html b/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_subpage.html index 1778856..585f155 100644 --- a/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_subpage.html +++ b/chrome/browser/resources/ash/settings/os_privacy_page/privacy_hub_subpage.html
@@ -60,9 +60,9 @@ <div id="microphoneSection"> <template is="dom-if" if="[[!showAppPermissions_]]"> + <div class="hr"></div> <settings-toggle-button id="microphoneToggle" - class="hr" pref="{{prefs.ash.user.microphone_allowed}}" label="$i18n{microphoneToggleTitle}" deep-link-focus-id$="[[Setting.kMicrophoneOnOff]]" @@ -124,8 +124,8 @@ </div> <template is="dom-if" if="[[showSpeakOnMuteDetectionPage_]]" restamp> + <div class="hr"></div> <settings-toggle-button - class="hr" pref="{{prefs.ash.user.speak_on_mute_detection_enabled}}" id="speakonmuteDetectionToggle" label="$i18n{speakOnMuteDetectionToggleTitle}" @@ -136,9 +136,9 @@ </template> <template is="dom-if" if="[[showPrivacyHubLocationControl_]]" restamp> + <div class="hr"></div> <cr-link-row id="geolocationAreaLinkRow" - class="hr" on-click="onGeolocationAreaClick_" deep-link-focus-id$="[[Setting.kGeolocationOnOff]]" using-slotted-label> @@ -153,16 +153,16 @@ </template> <if expr="_google_chrome"> + <div class="hr"></div> <settings-metrics-consent-toggle-button id="metricsConsentToggle" deep-link-focus-id$="[[Setting.kUsageStatsAndCrashReports]]" - prefs="{{prefs}}" - class="hr"> + prefs="{{prefs}}"> </settings-metrics-consent-toggle-button> </if> +<div class="hr"></div> <settings-toggle-button id="contentRecommendationsToggle" - class="hr" pref="{{prefs.settings.suggested_content_enabled}}" label="$i18n{enableSuggestedContent}" sub-label="$i18n{enableSuggestedContentDesc}"
diff --git a/chrome/browser/resources/ash/settings/os_settings.ts b/chrome/browser/resources/ash/settings/os_settings.ts index 74ea8bb..f779a6e 100644 --- a/chrome/browser/resources/ash/settings/os_settings.ts +++ b/chrome/browser/resources/ash/settings/os_settings.ts
@@ -222,6 +222,7 @@ export {OsSettingsPrivacyPageElement} from './os_privacy_page/os_privacy_page.js'; export {DataAccessPolicyState, PeripheralDataAccessBrowserProxy, PeripheralDataAccessBrowserProxyImpl} from './os_privacy_page/peripheral_data_access_browser_proxy.js'; export {SettingsPrivacyHubAppPermissionRow} from './os_privacy_page/privacy_hub_app_permission_row.js'; +export {GeolocationAccessLevel} from './os_privacy_page/privacy_hub_geolocation_subpage.js'; export {OsResetBrowserProxy, OsResetBrowserProxyImpl} from './os_reset_page/os_reset_browser_proxy.js'; export {OsSettingsSearchPageElement} from './os_search_page/os_search_page.js'; export {SearchAndAssistantSettingsCardElement} from './os_search_page/search_and_assistant_settings_card.js';
diff --git a/chrome/browser/resources/ash/settings/os_settings_icons.html b/chrome/browser/resources/ash/settings/os_settings_icons.html index 63bcef4b..a3dafaf5 100644 --- a/chrome/browser/resources/ash/settings/os_settings_icons.html +++ b/chrome/browser/resources/ash/settings/os_settings_icons.html
@@ -17,39 +17,39 @@ <!-- A11y page section --> <g id="accessibility"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 3C12 4.10457 11.1046 5 10 5C8.89543 5 8 4.10457 8 3C8 1.89543 8.89543 1 10 1C11.1046 1 12 1.89543 12 3ZM2 7C2 6.44772 2.44772 6 3 6H17C17.5523 6 18 6.44772 18 7C18 7.55228 17.5523 8 17 8H13V13V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H9V18C9 18.5523 8.55228 19 8 19C7.44772 19 7 18.5523 7 18V13V8H3C2.44772 8 2 7.55228 2 7Z"/></g> <g id="accessibility-revamp" viewBox="0 0 20 20"><path d="M10.03 5.76A1.81 1.81 0 0 1 8.7 5.208 1.81 1.81 0 0 1 8.15 3.88c0-.518.184-.96.552-1.328A1.81 1.81 0 0 1 10.03 2c.518 0 .96.184 1.329.552.367.368.551.81.551 1.328s-.184.96-.551 1.328a1.81 1.81 0 0 1-1.329.552ZM7.372 18V8.62a16.886 16.886 0 0 1-2.187-.306A57.218 57.218 0 0 1 3 7.762l.47-1.675c1.09.3 2.18.524 3.27.674 1.103.15 2.2.225 3.29.225 1.09 0 2.186-.075 3.29-.225a25.937 25.937 0 0 0 3.31-.674l.429 1.675c-.763.191-1.499.368-2.207.532-.695.163-1.417.279-2.166.347V18h-1.819l-.184-4.659H9.396L9.192 18h-1.82Z"/></g> - <g id="a11y-image-description" width="20" height="20" viewBox="0 0 20 20"> + <g id="a11y-image-description"> <path fill-rule="evenodd" d="M5.417 14.063h9.166L11.5 9.896l-2.25 3-1.5-2-2.333 3.166Zm.146-3.5c1.388 0 2.569-.487 3.541-1.459.972-.972 1.459-2.153 1.459-3.541h-1.5c0 .972-.34 1.798-1.021 2.479-.68.68-1.507 1.02-2.48 1.02v1.5Zm0-3c.555 0 1.027-.195 1.416-.584.39-.389.583-.86.583-1.416h-2v2Zm-1 9.604c-.487 0-.896-.167-1.23-.5a1.716 1.716 0 0 1-.5-1.23V4.563c0-.473.167-.875.5-1.209.334-.347.743-.52 1.23-.52h10.875c.486 0 .895.173 1.229.52.333.333.5.736.5 1.209v10.875c0 .472-.167.881-.5 1.229-.334.333-.743.5-1.23.5H4.563Zm0-1.73h10.875V4.563H4.563v10.875Zm0 0V4.563v10.875Z"></path> </g> - <g id="a11y-text-to-speech" width="16" height="16" viewBox="0 0 16 16"> + <g id="a11y-text-to-speech"> <path fill-rule="evenodd" d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0Zm-5.335-3.549a33.45 33.45 0 0 0-.762.79l.039.042c.696.775 1.467 1.633 1.413 2.738.068 1.127-.67 2.053-1.434 2.805.216.286.434.57.653.855 1.258-.839 2.037-2.313 1.937-3.812-.02-1.355-.798-2.58-1.846-3.418Zm3.772 5.35a6.562 6.562 0 0 1-2.562 3.566c-.233-.31-.458-.624-.678-.942l.205-.203c.524-.519 1.054-1.044 1.404-1.694.869-1.564.818-3.568-.099-5.102-.309-.514-.735-.943-1.158-1.37a31.85 31.85 0 0 1-.306-.311c.233-.306.467-.61.704-.914 2.263 1.469 3.192 4.445 2.49 6.97ZM6.768 1.68c-.11-.003-.225-.008-.345-.014-2.921.698-5.09 3.281-5.09 6.361 0 2.658 1.614 4.946 3.934 5.972a23.226 23.226 0 0 1 1.48-.387c.206-1.043.328-2.1.379-3.162-.481-.277-.981-.52-1.481-.763-.228-.11-.456-.221-.682-.335l.557-.104c.652-.12 1.305-.24 1.946-.416l.042-.633c.02-.295.038-.59.061-.886a61.936 61.936 0 0 1 1.548-.978 11.89 11.89 0 0 0-.812-1.77c-.203-.367-.39-.742-.576-1.117-.3-.6-.599-1.2-.96-1.767Z" clip-rule="evenodd"></path> </g> - <g id="a11y-display-and-magnification" width="16" height="16" viewBox="0 0 16 16"> + <g id="a11y-display-and-magnification"> <path fill-rule="evenodd" d="m13.938 15.188-5.021-5.042a5.43 5.43 0 0 1-1.375.729 4.851 4.851 0 0 1-1.584.25c-1.416 0-2.625-.5-3.625-1.5C1.347 8.625.854 7.417.854 6c0-1.417.493-2.625 1.48-3.625 1-1 2.208-1.5 3.624-1.5 1.417 0 2.625.5 3.625 1.5s1.5 2.208 1.5 3.625a5.04 5.04 0 0 1-.25 1.604 5.05 5.05 0 0 1-.687 1.334l5 5.02-1.209 1.23Zm-7.98-5.813c.945 0 1.743-.326 2.396-.98.667-.652 1-1.45 1-2.395 0-.944-.333-1.743-1-2.396-.653-.653-1.451-.979-2.396-.979-.944 0-1.743.326-2.395.98-.653.652-.98 1.45-.98 2.395 0 .944.327 1.743.98 2.396.652.653 1.45.979 2.395.979Zm-.75-1.146V6.75H3.75v-1.5h1.458V3.77h1.5v1.48h1.48v1.5h-1.48v1.48h-1.5Z"></path> </g> - <g id="a11y-keyboard-and-text-input" width="14" height="8" viewBox="0 0 14 8"> + <g id="a11y-keyboard-and-text-input"> <path fill-rule="evenodd" d="M3 7.75v-1.5h8v1.5H3Zm-2.75-3v-1.5h1.5v1.5H.25Zm3 0v-1.5h1.5v1.5h-1.5Zm3 0v-1.5h1.5v1.5h-1.5Zm3 0v-1.5h1.5v1.5h-1.5Zm3 0v-1.5h1.5v1.5h-1.5Zm-12-3V.25h1.5v1.5H.25Zm3 0V.25h1.5v1.5h-1.5Zm3 0V.25h1.5v1.5h-1.5Zm3 0V.25h1.5v1.5h-1.5Zm3 0V.25h1.5v1.5h-1.5Z"></path> </g> - <g id="a11y-cursor-and-touchpad" width="15" height="15" viewBox="0 0 15 15"> + <g id="a11y-cursor-and-touchpad"> <path fill-rule="evenodd" d="M6.042 11.23c-1.459.013-2.702-.487-3.73-1.5C1.286 8.7.772 7.457.772 6c0-1.458.507-2.694 1.52-3.708C3.307 1.278 4.542.77 6 .77c1.458 0 2.694.514 3.708 1.542 1.028 1.027 1.535 2.27 1.521 3.729L9.563 5.5a3.436 3.436 0 0 0-1.209-2.187A3.463 3.463 0 0 0 6 2.417c-.986 0-1.833.354-2.542 1.062A3.434 3.434 0 0 0 2.417 6c0 .889.291 1.674.875 2.354A3.579 3.579 0 0 0 5.5 9.563l.542 1.666Zm7.125 3.416-3.5-3.5-1.125 2.979L6 6l8.125 2.542-2.98 1.104 3.5 3.52-1.478 1.48Z"></path> </g> - <g id="a11y-audio-and-captions" width="16" height="18" viewBox="0 0 16 18"> + <g id="a11y-audio-and-captions"> <path fill-rule="evenodd" d="M12.167 17.146c-.945 0-1.667-.292-2.167-.875a5.825 5.825 0 0 1-1.104-2.042 9.489 9.489 0 0 0-.667-1.604c-.222-.444-.666-.847-1.333-1.208A5.187 5.187 0 0 1 4.77 9.375 5.648 5.648 0 0 1 4 6.5c0-1.556.542-2.875 1.625-3.958C6.722 1.458 8.049.917 9.605.917c1.569 0 2.895.555 3.978 1.666 1.098 1.111 1.646 2.466 1.646 4.063H13.5c0-1.111-.382-2.056-1.146-2.833-.75-.778-1.66-1.167-2.729-1.167-1.083 0-2.007.375-2.77 1.125-.75.75-1.126 1.66-1.126 2.729 0 .722.188 1.396.563 2.02a3.83 3.83 0 0 0 1.52 1.418c.848.444 1.424.923 1.73 1.437.32.514.639 1.264.958 2.25.222.667.465 1.132.73 1.396.277.264.582.396.916.396.375 0 .694-.146.958-.438.264-.291.396-.646.396-1.062h1.73c0 .916-.3 1.687-.897 2.312a2.918 2.918 0 0 1-2.166.917ZM3.313 12.75a9.161 9.161 0 0 1-1.896-2.875A9.003 9.003 0 0 1 .77 6.521c0-1.14.215-2.25.646-3.333A9.096 9.096 0 0 1 3.313.292L4.5 1.52a7.644 7.644 0 0 0-1.48 2.333A7.068 7.068 0 0 0 2.5 6.52c0 .917.174 1.812.52 2.687a7.454 7.454 0 0 0 1.5 2.334L3.314 12.75Zm6.312-4.23a1.929 1.929 0 0 1-1.417-.582 1.929 1.929 0 0 1-.583-1.417c0-.556.194-1.028.583-1.417a1.929 1.929 0 0 1 1.417-.583c.556 0 1.028.194 1.417.583.389.39.583.861.583 1.417a1.93 1.93 0 0 1-.583 1.417 1.929 1.929 0 0 1-1.417.583Z"></path> </g> - <g id="a11y-find-more" width="19" height="17" viewBox="0 0 19 17"> + <g id="a11y-find-more"> <path fill-rule="evenodd" d="M8 3.708c-.5 0-.93-.173-1.292-.52a1.787 1.787 0 0 1-.541-1.313c0-.5.18-.924.541-1.27A1.763 1.763 0 0 1 8 .061c.5 0 .93.181 1.292.542.36.347.541.778.541 1.292 0 .5-.18.93-.541 1.292A1.8 1.8 0 0 1 8 3.707Zm5.104 9.313c.528 0 .972-.18 1.334-.542.374-.36.562-.805.562-1.333a1.78 1.78 0 0 0-.562-1.334 1.778 1.778 0 0 0-1.334-.562c-.528 0-.972.18-1.333.542a1.812 1.812 0 0 0-.542 1.333c0 .528.18.98.542 1.354.36.361.805.542 1.333.542Zm3.938 3.27-2.063-2.062c-.278.18-.576.313-.896.396-.32.083-.646.125-.979.125-1 0-1.854-.347-2.562-1.042C9.847 13 9.5 12.138 9.5 11.125c0-1 .347-1.847 1.042-2.542a3.492 3.492 0 0 1 2.562-1.062c1 0 1.854.354 2.563 1.062.708.695 1.062 1.542 1.062 2.542 0 .333-.048.667-.146 1-.083.32-.208.618-.375.896l2.063 2.041-1.23 1.23Zm-8.105-.229v-1.979c.209.32.452.604.73.854.291.25.597.473.916.667v.459H8.937Zm-3.52 0V6.459c-.764-.07-1.521-.18-2.271-.333a42.886 42.886 0 0 1-2.208-.562l.416-1.521c1.084.291 2.18.52 3.292.687a24.596 24.596 0 0 0 6.708 0 29.184 29.184 0 0 0 3.313-.687l.416 1.52c-.736.237-1.479.424-2.229.563-.75.125-1.507.23-2.27.313v.229A5.157 5.157 0 0 0 8.707 8.5C8.236 9.278 8 10.146 8 11.104v-.041c0-.028-.007-.05-.02-.063h-.918v5.063H5.418Z"></path> </g> <!-- Apps page section --> - <g id="apps-notifications" width="18" height="18" viewBox="0 0 18 18"> + <g id="apps-notifications"> <path fill-rule="evenodd" d="M.833 9c0-1.139.209-2.201.625-3.187a8.327 8.327 0 0 1 1.75-2.584 8.112 8.112 0 0 1 2.605-1.75c1-.43 2.062-.646 3.187-.646.361 0 .715.021 1.063.063.36.041.708.11 1.041.208a3.602 3.602 0 0 0-.583.708 4.43 4.43 0 0 0-.417.855 3.164 3.164 0 0 0-.541-.084A7.9 7.9 0 0 0 9 2.563c-1.792 0-3.312.624-4.562 1.874C3.188 5.688 2.563 7.209 2.563 9c0 1.792.624 3.313 1.874 4.563 1.25 1.25 2.771 1.874 4.563 1.874 1.792 0 3.313-.624 4.563-1.874 1.25-1.25 1.874-2.771 1.874-4.563 0-.18-.006-.368-.02-.562a3.16 3.16 0 0 0-.084-.542c.306-.111.59-.25.854-.417.264-.167.5-.36.709-.583.097.333.166.68.208 1.042.042.347.063.7.063 1.062a7.974 7.974 0 0 1-.646 3.188c-.417.986-1 1.854-1.75 2.604a8.328 8.328 0 0 1-2.584 1.75A8.106 8.106 0 0 1 9 17.167a8.205 8.205 0 0 1-3.187-.625 8.59 8.59 0 0 1-2.605-1.75 8.589 8.589 0 0 1-1.75-2.604A8.204 8.204 0 0 1 .833 9ZM14 6.625a2.53 2.53 0 0 1-1.854-.77A2.528 2.528 0 0 1 11.375 4c0-.722.257-1.34.77-1.854A2.528 2.528 0 0 1 14 1.375c.722 0 1.34.257 1.854.77.514.515.771 1.133.771 1.855s-.257 1.34-.77 1.854A2.528 2.528 0 0 1 14 6.625Z"></path> </g> - <g id="apps-google-play-preferences" width="18" height="20" viewBox="0 0 18 20"> + <g id="apps-google-play-preferences"> <path fill-rule="evenodd" d="M7.063 10.604a.836.836 0 0 0 .229-.583.734.734 0 0 0-.25-.563L2.354 4.771v10.604l4.709-4.77Zm1.145-2.312c.153.166.34.25.563.25.222 0 .41-.084.562-.25l1.75-1.75L4 2.458a1.06 1.06 0 0 0-.77-.125c-.279.042-.494.146-.647.313l5.625 5.646Zm-4.25 9.27 7.105-4.083-1.73-1.708a.765.765 0 0 0-.562-.23.836.836 0 0 0-.584.23l-5.583 5.604c.195.194.403.306.625.333.236.028.48-.02.73-.145Zm8.584-4.895L15.354 11a1.8 1.8 0 0 0 .438-.417.991.991 0 0 0 .166-.562.957.957 0 0 0-.166-.542 1.145 1.145 0 0 0-.438-.416l-2.791-1.667L10.5 9.479a.836.836 0 0 0-.23.584c0 .222.077.41.23.562l2.042 2.042Zm-9.146 6.666c-.778 0-1.43-.264-1.958-.791a2.647 2.647 0 0 1-.771-1.917V3.395c0-.75.257-1.388.77-1.916.529-.542 1.182-.812 1.96-.812.25 0 .493.034.729.104.236.07.465.166.688.292L16.23 7.646c.43.236.771.562 1.021.979.264.417.396.875.396 1.375s-.132.965-.396 1.396a2.73 2.73 0 0 1-1.062 1L4.77 18.958a2.48 2.48 0 0 1-.646.292 3.17 3.17 0 0 1-.73.083Z"></path> </g> - <g id="apps-android-settings" width="20" height="20" viewBox="0 0 20 20"> + <g id="apps-android-settings"> <path fill-rule="evenodd" d="M7.438 12.417a.862.862 0 0 1-.605-.23.823.823 0 0 1-.25-.604c0-.236.077-.437.23-.604a.823.823 0 0 1 .604-.25c.236 0 .444.084.625.25.18.153.27.354.27.604 0 .236-.09.438-.27.604a.862.862 0 0 1-.604.23Zm5.125 0a.94.94 0 0 1-.626-.23.823.823 0 0 1-.25-.604c0-.236.084-.437.25-.604a.848.848 0 0 1 .626-.25c.236 0 .437.084.604.25.166.167.25.368.25.604a.824.824 0 0 1-.25.604.862.862 0 0 1-.604.23Zm-9.355 3.875a1.53 1.53 0 0 1-1.125-.459 1.53 1.53 0 0 1-.458-1.125V5.292c0-.43.153-.799.458-1.104.306-.32.68-.48 1.125-.48h13.584c.43 0 .798.16 1.104.48.32.305.479.673.479 1.104v9.416c0 .445-.16.82-.48 1.125a1.505 1.505 0 0 1-1.103.459H3.208Zm.5-1.584h12.584v-1.146a5.763 5.763 0 0 0-.771-2.937 6.973 6.973 0 0 0-2-2.27L15 6.5a.481.481 0 0 0 .104-.417.535.535 0 0 0-.208-.396.666.666 0 0 0-.438-.104.471.471 0 0 0-.375.209l-1.562 2.02a5.298 5.298 0 0 0-1.23-.395A5.848 5.848 0 0 0 10 7.27a6.1 6.1 0 0 0-2.583.563L5.854 5.791a.535.535 0 0 0-.396-.209.59.59 0 0 0-.416.104.532.532 0 0 0-.23.375.502.502 0 0 0 .146.417l1.48 1.917a7.047 7.047 0 0 0-2 2.25 5.98 5.98 0 0 0-.73 2.916v1.146Z"></path> </g> - <g id="apps-manage-isolated-web-apps" width="20" height="20" viewBox="0 0 20 20"> + <g id="apps-manage-isolated-web-apps"> <path fill-rule="evenodd" d="M3.646 16.396a2.02 2.02 0 0 1-1.458-.584 2.023 2.023 0 0 1-.584-1.458V5.625c0-.57.195-1.049.583-1.437a2.023 2.023 0 0 1 1.459-.584h12.708c.57 0 1.049.202 1.438.604.402.39.604.868.604 1.438v8.729a1.92 1.92 0 0 1-.604 1.438 1.953 1.953 0 0 1-1.438.583H3.646Zm0-2.042h8.208v-2.5H3.646v2.5Zm9.708 0h3v-6.5h-3v6.5Zm-9.708-4h8.208v-2.5H3.646v2.5Z"></path> </g> @@ -86,38 +86,38 @@ <path d="M10.6177 10.0898C10.4368 10.2188 10.2211 10.2832 9.97046 10.2832C9.61596 10.2832 9.34115 10.1462 9.146 9.87231C8.95085 9.59839 8.85327 9.24837 8.85327 8.82227C8.85327 8.39258 8.95353 8.0354 9.15405 7.75073C9.35457 7.46606 9.61059 7.32373 9.92212 7.32373C10.2587 7.32373 10.5273 7.46875 10.7278 7.75879C10.9283 8.04883 11.0286 8.45703 11.0286 8.9834V9.62256C10.9355 9.80518 10.7985 9.96094 10.6177 10.0898Z"></path> <path fill-rule="evenodd" clip-rule="evenodd" d="M10 2C5.584 2 2 5.584 2 10C2 14.416 5.584 18 10 18C14.416 18 18 14.416 18 10C18 5.584 14.416 2 10 2ZM11.0071 10.874C10.6025 11.2715 10.1298 11.4702 9.58911 11.4702C8.89803 11.4702 8.34481 11.233 7.92944 10.7585C7.51408 10.2841 7.3064 9.64405 7.3064 8.83838C7.3064 8.32633 7.41829 7.85637 7.64209 7.42847C7.86589 7.00057 8.1783 6.66756 8.57935 6.42944C8.98039 6.19132 9.43156 6.07227 9.93286 6.07227C10.4485 6.07227 10.9068 6.20117 11.3079 6.45898C11.7089 6.7168 12.0204 7.0874 12.2424 7.5708C12.4644 8.0542 12.5772 8.60742 12.5808 9.23047V9.80518C12.5808 11.1086 12.2568 12.1326 11.6086 12.8774C10.9605 13.6222 10.0421 14.0197 8.85327 14.0698L8.47192 14.0752V12.7808L8.81567 12.7754C10.1656 12.7145 10.8961 12.0807 11.0071 10.874Z"></path> </g> - <g id="about-update-complete" width="16" height="16" viewBox="0 0 16 16"> + <g id="about-update-complete"> <path fill-rule="evenodd" d="M8 15.167a7.012 7.012 0 0 1-2.792-.563 7.165 7.165 0 0 1-2.27-1.52 7.731 7.731 0 0 1-1.542-2.292A7.012 7.012 0 0 1 .833 8c0-.986.188-1.917.563-2.792a7.46 7.46 0 0 1 1.542-2.27 6.996 6.996 0 0 1 2.27-1.542A7.012 7.012 0 0 1 8 .833c1.139 0 2.18.243 3.125.73A7.009 7.009 0 0 1 13.542 3.5V.875h1.583V6H10V4.417h2.083a4.944 4.944 0 0 0-1.791-1.354A5.314 5.314 0 0 0 8 2.563c-1.5 0-2.785.534-3.854 1.604C3.09 5.222 2.563 6.5 2.563 8s.527 2.785 1.583 3.854C5.216 12.91 6.5 13.438 8 13.438s2.778-.528 3.833-1.584c1.07-1.07 1.604-2.354 1.604-3.854h1.73c0 2-.695 3.694-2.084 5.083C11.694 14.473 10 15.167 8 15.167Zm2.042-4.292L7.208 8.042V4h1.584v3.375l2.375 2.375-1.125 1.125Z"></path> </g> - <g id="about-update-warning" width="20" height="20" viewBox="0 0 20 20"> + <g id="about-update-warning"> <path fill-rule="evenodd" d="M.854 17.083 10 1.833l9.146 15.25H.854Zm2.917-1.645h12.458L10 5.063 3.77 15.438ZM10 14.479c.208 0 .389-.07.542-.208a.765.765 0 0 0 .229-.563.74.74 0 0 0-.23-.541.698.698 0 0 0-.541-.23.74.74 0 0 0-.542.23.698.698 0 0 0-.229.541c0 .209.07.39.209.542.152.153.34.23.562.23ZM9.25 12h1.5V8.063h-1.5V12Z"></path> </g> - <g id="about-update-error" width="20" height="20" viewBox="0 0 20 20"> + <g id="about-update-error"> <path fill-rule="evenodd" d="M10 14.167c.25 0 .458-.084.625-.25a.839.839 0 0 0 .27-.646c0-.25-.09-.459-.27-.625a.815.815 0 0 0-.625-.271c-.25 0-.465.09-.646.27a.848.848 0 0 0-.25.626c0 .25.084.465.25.646a.92.92 0 0 0 .646.25ZM9.125 11h1.75V5.896h-1.75V11ZM10 18.167a8.205 8.205 0 0 1-3.187-.625 8.59 8.59 0 0 1-2.605-1.75 8.589 8.589 0 0 1-1.75-2.604A8.204 8.204 0 0 1 1.833 10c0-1.139.209-2.201.625-3.187a8.327 8.327 0 0 1 1.75-2.584 8.112 8.112 0 0 1 2.605-1.75c1-.43 2.062-.646 3.187-.646 1.139 0 2.201.216 3.188.646.986.417 1.847 1 2.583 1.75a7.82 7.82 0 0 1 1.75 2.604c.43.986.646 2.042.646 3.167a7.974 7.974 0 0 1-.646 3.188c-.417.986-1 1.854-1.75 2.604a8.262 8.262 0 0 1-2.604 1.75 8.053 8.053 0 0 1-3.167.625Zm0-1.73c1.792 0 3.313-.625 4.563-1.875 1.25-1.25 1.874-2.77 1.874-4.562 0-1.792-.625-3.312-1.875-4.562-1.25-1.25-2.77-1.875-4.562-1.875-1.792 0-3.312.624-4.562 1.874C4.188 6.688 3.563 8.209 3.563 10c0 1.792.624 3.313 1.874 4.563 1.25 1.25 2.771 1.874 4.563 1.874Z"></path> </g> - <g id="about-release-notes" width="18" height="18" viewBox="0 0 18 18"> + <g id="about-release-notes"> <path fill-rule="evenodd" d="m4.792 13.208 6.041-2.375 2.375-6.041-6.041 2.375-2.375 6.041ZM9 10a.896.896 0 0 1-.708-.27A1.035 1.035 0 0 1 8 9c0-.278.097-.514.292-.708A.964.964 0 0 1 9 8c.278 0 .514.097.708.292.195.194.292.43.292.708a.964.964 0 0 1-.292.708A.964.964 0 0 1 9 10Zm0 7.167a8.205 8.205 0 0 1-3.187-.625 8.59 8.59 0 0 1-2.605-1.75 8.589 8.589 0 0 1-1.75-2.604A8.204 8.204 0 0 1 .833 9c0-1.139.209-2.201.625-3.187a8.327 8.327 0 0 1 1.75-2.584 8.112 8.112 0 0 1 2.605-1.75c1-.43 2.062-.646 3.187-.646 1.139 0 2.201.216 3.188.646.986.417 1.847 1 2.583 1.75a7.82 7.82 0 0 1 1.75 2.604c.43.986.646 2.042.646 3.167a7.974 7.974 0 0 1-.646 3.188c-.417.986-1 1.854-1.75 2.604a8.262 8.262 0 0 1-2.604 1.75A8.053 8.053 0 0 1 9 17.167Zm0-1.73c1.792 0 3.313-.624 4.563-1.874 1.25-1.25 1.874-2.771 1.874-4.563 0-1.792-.624-3.312-1.874-4.562-1.25-1.25-2.771-1.875-4.563-1.875-1.792 0-3.312.624-4.562 1.874C3.188 5.688 2.563 7.209 2.563 9c0 1.792.624 3.313 1.874 4.563 1.25 1.25 2.771 1.874 4.563 1.874Z"></path> </g> - <g id="about-help" width="16" height="16" viewBox="0 0 16 16"> + <g id="about-help"> <path fill-rule="evenodd" d="M7.98 12.5a.897.897 0 0 0 .687-.292.964.964 0 0 0 .291-.708.921.921 0 0 0-.291-.708.931.931 0 0 0-.688-.271c-.278 0-.52.09-.729.27a.922.922 0 0 0-.292.709c0 .278.098.514.292.708a.99.99 0 0 0 .73.292Zm-.75-2.854h1.478c0-.472.042-.806.125-1 .084-.195.299-.452.646-.771.278-.264.521-.549.73-.854.222-.32.333-.708.333-1.167 0-.75-.257-1.326-.771-1.729-.5-.417-1.097-.625-1.792-.625-.68 0-1.25.201-1.708.604-.445.39-.757.833-.938 1.334L6.667 6c.097-.236.236-.48.416-.73.195-.263.493-.395.896-.395s.688.111.854.333c.18.209.271.438.271.688 0 .278-.104.535-.312.77-.209.223-.41.431-.604.626-.445.43-.716.77-.813 1.02-.097.25-.146.695-.146 1.334Zm-4.667 5.52c-.487 0-.896-.166-1.23-.5a1.671 1.671 0 0 1-.5-1.229V2.563c0-.487.167-.896.5-1.23a1.67 1.67 0 0 1 1.23-.5h10.875c.486 0 .895.167 1.229.5.333.334.5.743.5 1.23v10.875c0 .486-.167.895-.5 1.229-.334.333-.743.5-1.23.5H2.563Zm0-1.729h10.875V2.563H2.563v10.875Zm0-10.874v10.875V2.563Z"></path> </g> - <g id="about-feedback" width="18" height="18" viewBox="0 0 18 18"> + <g id="about-feedback"> <path fill-rule="evenodd" d="M9 11.5a.79.79 0 0 0 .583-.23.756.756 0 0 0 .25-.582.756.756 0 0 0-.25-.584.756.756 0 0 0-.583-.25.823.823 0 0 0-.604.25.765.765 0 0 0-.23.563c0 .236.077.437.23.604.166.153.368.229.604.229Zm-.792-2.458h1.584V3.5H8.208v5.542ZM.833 17.167V2.562c0-.486.167-.895.5-1.229a1.67 1.67 0 0 1 1.23-.5h12.875c.486 0 .895.167 1.229.5.333.334.5.743.5 1.23v9.875c0 .486-.167.895-.5 1.229-.334.333-.743.5-1.23.5H3.834l-3 3Zm2.375-4.73h12.23V2.563H2.563v10.52l.645-.646Zm-.646 0V2.563v9.875Z"></path> </g> - <g id="about-diagnostics" width="20" height="14" viewBox="0 0 20 14"> + <g id="about-diagnostics"> <path fill-rule="evenodd" d="M7.542 13.125a1.34 1.34 0 0 1-.792-.25 1.391 1.391 0 0 1-.48-.646L4.5 7.875H.875v-1.75h4.813l1.854 4.625 3.646-9a1.34 1.34 0 0 1 1.27-.875c.292 0 .549.083.771.25.236.167.403.382.5.646L15.5 6.125h3.625v1.75h-4.792L12.458 3.25l-3.645 9a1.36 1.36 0 0 1-.5.625 1.25 1.25 0 0 1-.771.25Z"></path> </g> - <g id="about-firmware-updates" width="18" height="14" viewBox="0 0 18 14"> + <g id="about-firmware-updates"> <path fill-rule="evenodd" d="M2.563 13.167c-.487 0-.896-.167-1.23-.5a1.671 1.671 0 0 1-.5-1.23V2.563c0-.487.167-.896.5-1.23a1.67 1.67 0 0 1 1.23-.5h4.312v1.73H2.563v8.875h12.875V2.563h-4.313V.833h4.313c.486 0 .895.167 1.229.5.333.334.5.743.5 1.23v8.875c0 .486-.167.895-.5 1.229-.334.333-.743.5-1.23.5H2.563Zm6.437-3L4.833 6l1.23-1.208 2.062 2.062V.834h1.75v6.02l2.063-2.062L13.167 6 9 10.167Z"></path> </g> - <g id="about-additional-details" width="16" height="10" viewBox="0 0 16 10"> + <g id="about-additional-details"> <path fill-rule="evenodd" d="M.833 9.833V8.125h5.25v1.708H.833Zm0-3.958v-1.73h9.292v1.73H.833Zm0-3.98V.168h14.334v1.729H.833Z"></path> </g> - <g id="about-linux" width="16" height="16" viewBox="0 0 16 16"> + <g id="about-linux"> <path fill-rule="evenodd" d="M6.345 5.812c0 .47-.37.85-.828.85a.84.84 0 0 1-.827-.85c0-.47.37-.85.827-.85a.84.84 0 0 1 .828.85ZM10.483 6.662a.84.84 0 0 0 .827-.85.84.84 0 0 0-.827-.85.84.84 0 0 0-.828.85c0 .47.37.85.828.85ZM7.832 7.122a.384.384 0 0 1 .318 0l1.136.512a.398.398 0 0 1 .128.63L8.285 9.51a.386.386 0 0 1-.575 0L6.585 8.26a.4.4 0 0 1 .128-.629l1.12-.509Z"></path> <path fill-rule="evenodd" d="M8 15.22c-.068 0-.136.051-.203.102l-.076.055c-.03.325-.274.623-1.652.623-1.693 0-1.674-.352-1.65-.815.004-.058.007-.117.007-.177 0-.082.016-.156.047-.221-1.96-.815-3.215-2.462-3.258-5.33-.198.104-.422.121-.682.024-.741-.278-.575-1.206-.303-2.034.226-.685.995-1.186 1.372-1.29C2.478 2.704 4.536 0 8 0c3.506 0 5.577 2.592 6.43 6.166.385.122 1.12.614 1.34 1.281.272.828.438 1.756-.303 2.034-.26.097-.484.08-.682-.023-.039 2.887-1.296 4.525-3.256 5.334.03.064.045.136.045.216 0 .06.004.12.007.177.024.463.043.815-1.65.815-1.388 0-1.626-.302-1.652-.63-.023-.015-.046-.032-.068-.048-.07-.05-.14-.102-.211-.102Zm0-1.662c3.657 0 4.975-1.602 4.975-5.148 0-2.943-1.199-5.645-3.189-6.097-.324-.073-.598.296-.882.678-.275.37-.558.751-.904.751-.353 0-.657-.398-.946-.775-.285-.373-.555-.725-.84-.654-1.999.504-3.19 3.31-3.19 6.097 0 3.346 1.32 5.149 4.976 5.149Z" clip-rule="evenodd"></path> </g> - <g id="about-manage-develop-environment" width="18" height="16" viewBox="0 0 18 16"> + <g id="about-manage-develop-environment"> <path fill-rule="evenodd" d="M.833 3.917V2.563c0-.487.167-.896.5-1.23.348-.333.757-.5 1.23-.5h12.875c.486 0 .895.167 1.229.5.333.334.5.743.5 1.23v1.354h-1.73V2.563H2.563v1.354H.833Zm5.084 11.25v-2H2.563c-.473 0-.882-.167-1.23-.5a1.671 1.671 0 0 1-.5-1.23v-1.354h1.73v1.354h12.875v-1.354h1.729v1.354c0 .487-.167.896-.5 1.23-.334.333-.743.5-1.23.5h-3.354v2H5.917ZM3.063 7 5 5.063 3.875 3.938.833 7l3.042 3.063L5 8.937 3.063 7Zm11.875 0L13 8.938l1.125 1.104L17.167 7l-3.042-3.062L13 5.062 14.938 7Z"></path> </g> @@ -134,34 +134,34 @@ </g> <!-- Device section --> - <g id="device-pointing-stick" width="20" height="20" viewBox="0 0 20 20"> + <g id="device-pointing-stick"> <path fill-rule="evenodd" d="M10 11.625c-.444 0-.826-.16-1.146-.48-.32-.319-.479-.7-.479-1.145 0-.444.16-.826.48-1.146.319-.32.7-.479 1.145-.479.444 0 .826.16 1.146.48.32.319.479.7.479 1.145 0 .444-.16.826-.48 1.146-.319.32-.7.479-1.145.479Zm-.875-4.75v-5.02h1.75v5.02h-1.75Zm0 11.27v-5.02h1.75v5.02h-1.75Zm4-7.27v-1.75h5.02v1.75h-5.02Zm-11.27 0v-1.75h5.02v1.75h-5.02Z"></path> </g> - <g id="device-mouse" width="20" height="20" viewBox="0 0 20 20"> + <g id="device-mouse"> <path fill-rule="evenodd" d="M10 18.167c-1.708 0-3.167-.598-4.375-1.792C4.431 15.167 3.833 13.708 3.833 12V8c0-1.708.598-3.16 1.792-4.354C6.833 2.438 8.292 1.833 10 1.833c1.708 0 3.16.605 4.354 1.813C15.563 4.84 16.167 6.292 16.167 8v4c0 1.708-.605 3.167-1.813 4.375-1.194 1.194-2.646 1.792-4.354 1.792ZM10.75 7.5h3.646a4.316 4.316 0 0 0-1.167-2.542c-.666-.708-1.493-1.146-2.479-1.312V7.5Zm-5.146 0H9.25V3.646a4.14 4.14 0 0 0-2.48 1.312A4.316 4.316 0 0 0 5.605 7.5ZM10 16.438c1.222 0 2.264-.431 3.125-1.292.875-.875 1.313-1.924 1.313-3.146V9H5.563v3c0 1.222.43 2.27 1.291 3.146.875.86 1.924 1.291 3.146 1.291Z"></path> </g> - <g id="device-touchpad" width="18" height="16" viewBox="0 0 18 16"> + <g id="device-touchpad"> <path fill-rule="evenodd" d="M12.583 13.52c.82 0 1.514-.284 2.084-.853a2.88 2.88 0 0 0 .854-2.084V9.75H9.646v.833c0 .806.285 1.5.854 2.084a2.88 2.88 0 0 0 2.083.854ZM9.688 8.126h2.083V5.75a2.997 2.997 0 0 0-1.396.875 2.775 2.775 0 0 0-.687 1.5Zm3.708 0h2.083a2.906 2.906 0 0 0-.708-1.5 2.866 2.866 0 0 0-1.375-.875v2.375Zm-.813 7.042c-1.291 0-2.382-.438-3.27-1.313C8.437 12.965 8 11.875 8 10.584V8.645c0-1.292.438-2.375 1.313-3.25.888-.89 1.979-1.333 3.27-1.333 1.292 0 2.375.444 3.25 1.333.89.875 1.334 1.958 1.334 3.25v1.937c0 1.292-.445 2.382-1.334 3.271-.875.875-1.958 1.313-3.25 1.313Zm-10.02-3.73V2.563v8.874Zm0 1.73c-.487 0-.896-.167-1.23-.5a1.716 1.716 0 0 1-.5-1.23V2.563c0-.473.167-.876.5-1.209.334-.347.743-.52 1.23-.52h12.875c.486 0 .895.173 1.229.52.333.333.5.736.5 1.209v2.083a5.916 5.916 0 0 0-.813-.75 5.5 5.5 0 0 0-.916-.604v-.73H2.563v8.876h4c.027.305.083.604.166.895.083.292.195.57.333.834h-4.5Z"></path> </g> - <g id="device-keyboard" width="18" height="12" viewBox="0 0 18 12"> + <g id="device-keyboard"> <path fill-rule="evenodd" d="M2.5 11.23c-.472 0-.882-.168-1.23-.5a1.716 1.716 0 0 1-.5-1.23v-7c0-.472.167-.875.5-1.208C1.619.944 2.029.77 2.5.77h13c.472 0 .875.173 1.208.52.348.334.521.737.521 1.209v7c0 .472-.173.882-.52 1.23-.334.332-.737.5-1.209.5h-13Zm0-1.73h13v-7h-13v7ZM6 9h6V7.5H6V9ZM4 6.5h1.5V5H4v1.5Zm2.125 0h1.5V5h-1.5v1.5Zm2.125 0h1.5V5h-1.5v1.5Zm2.125 0h1.5V5h-1.5v1.5Zm2.125 0H14V5h-1.5v1.5ZM4 4.5h1.5V3H4v1.5Zm2.125 0h1.5V3h-1.5v1.5Zm2.125 0h1.5V3h-1.5v1.5Zm2.125 0h1.5V3h-1.5v1.5Zm2.125 0H14V3h-1.5v1.5Zm-10 5v-7 7Z"></path> </g> - <g id="device-stylus" width="16" height="16" viewBox="0 0 16 16"> + <g id="device-stylus"> <path fill-rule="evenodd" d="M1.917 15.125a.83.83 0 0 1-.813-.23.952.952 0 0 1-.229-.832l.77-3.75 4.022 4.041-3.75.771Zm3.75-.77-4.021-4.043 8.958-8.937c.334-.333.736-.5 1.209-.5.472 0 .874.167 1.208.5l1.604 1.583c.333.334.5.743.5 1.23 0 .472-.167.875-.5 1.208l-8.958 8.958Zm6.146-11.75-8.021 8.04 1.562 1.563 8.042-8.02-1.584-1.584Z"></path> </g> - <g id="device-tablet" width="20" height="14" viewBox="0 0 20 14"> + <g id="device-tablet"> <path fill-rule="evenodd" d="M2.583 13.167a1.67 1.67 0 0 1-1.229-.5 1.716 1.716 0 0 1-.5-1.23V2.563c0-.487.167-.896.5-1.23a1.67 1.67 0 0 1 1.23-.5h14.833c.486 0 .895.174 1.229.521.333.333.5.736.5 1.209v8.875c0 .486-.167.895-.5 1.229a1.67 1.67 0 0 1-1.23.5H2.584Zm1-10.604h-1v8.875h1V2.563Zm1.5 8.875h9.834V2.563H5.083v8.875Zm11.334-8.875v8.875h1V2.563h-1Zm0 0h1-1Zm-12.834 0h-1 1Z"></path> </g> - <g id="device-display" width="18" height="16" viewBox="0 0 18 16"> + <g id="device-display"> <path fill-rule="evenodd" d="M5.917 15.167v-2H2.563c-.487 0-.896-.167-1.23-.5a1.671 1.671 0 0 1-.5-1.23V2.563c0-.487.167-.896.5-1.23a1.67 1.67 0 0 1 1.23-.5h12.875c.486 0 .895.167 1.229.5.333.334.5.743.5 1.23v8.875c0 .486-.167.895-.5 1.229-.334.333-.743.5-1.23.5h-3.354v2H5.917Zm-3.354-3.73h12.875V2.563H2.563v8.875Zm0 0V2.563v8.875Z"></path> </g> - <g id="device-audio" width="12" height="17" viewBox="0 0 12 17"> + <g id="device-audio"> <path fill-rule="evenodd" d="M6 11.23c-.75 0-1.389-.258-1.917-.772a2.646 2.646 0 0 1-.77-1.916V3.583c0-.75.256-1.389.77-1.916A2.61 2.61 0 0 1 6 .875c.75 0 1.382.264 1.896.792a2.61 2.61 0 0 1 .792 1.916v4.959a2.61 2.61 0 0 1-.792 1.916c-.514.514-1.146.771-1.896.771Zm-.833 5.083v-2.084c-1.417-.194-2.59-.826-3.521-1.896C.716 11.25.25 9.986.25 8.542h1.646c0 1.139.396 2.11 1.187 2.916.806.792 1.778 1.188 2.917 1.188 1.139 0 2.104-.396 2.896-1.188.805-.805 1.208-1.777 1.208-2.916h1.646c0 1.444-.465 2.708-1.396 3.791-.93 1.07-2.104 1.702-3.52 1.896v2.084H5.166ZM6 9.5c.278 0 .507-.09.688-.27.18-.181.27-.41.27-.688V3.583a.931.931 0 0 0-.27-.687A.932.932 0 0 0 6 2.625a.932.932 0 0 0-.687.27.931.931 0 0 0-.271.688v4.959c0 .277.09.507.27.687.181.18.41.271.688.271Z"></path> </g> - <g id="device-print" width="18" height="16" viewBox="0 0 18 16"> + <g id="device-print"> <path fill-rule="evenodd" d="M14.167 3.833H3.833v-3h10.334v3Zm-.521 4.875c.222 0 .41-.076.562-.229a.756.756 0 0 0 .25-.583.79.79 0 0 0-.229-.583.757.757 0 0 0-.583-.25.823.823 0 0 0-.604.25.765.765 0 0 0-.23.562c0 .236.077.438.23.604.166.153.368.23.604.23Zm-1.209 4.855v-2.626H5.564v2.626h6.875Zm1.73 1.687H3.833v-3.104h-3V7c0-.597.209-1.104.625-1.52.417-.431.924-.647 1.521-.647h12.042c.597 0 1.104.216 1.52.646.417.417.626.924.626 1.521v5.146h-3v3.104Z"></path> </g> - <g id="device-scan" width="16" height="13" viewBox="0 0 16 13"> + <g id="device-scan"> <path fill-rule="evenodd" d="M10.708 5.77 1.167 2.334 1.729.771l12.209 4.416c.43.14.756.382.979.73.236.333.354.701.354 1.104V10.5c0 .472-.174.882-.521 1.23-.333.332-.736.5-1.208.5H2.458c-.472 0-.882-.168-1.229-.5a1.716 1.716 0 0 1-.5-1.23v-3c0-.486.167-.896.5-1.23.347-.332.757-.5 1.23-.5h8.25Zm2.834 4.73v-3H2.458v3h11.084Zm-7.084-.75h6.084v-1.5H6.458v1.5Zm-2.25 0c.209 0 .382-.07.521-.208A.74.74 0 0 0 4.96 9a.707.707 0 0 0-.209-.52.698.698 0 0 0-.542-.23.74.74 0 0 0-.541.23.707.707 0 0 0-.209.52c0 .208.07.389.209.542a.779.779 0 0 0 .541.208Zm-1.75.75v-3 3Z"></path> </g> @@ -223,7 +223,7 @@ <!-- Personalization section --> <g id="paint-brush"><path d="M4.5 11C3 11 2 12 2 13.3c0 1-1 1.6-1.6 1.6.7 1 2 1.5 3.3 1.5 1.7 0 3.2-1.4 3.2-3 0-1.4-1-2.4-2.4-2.4zM12.7 1a2 2 0 0 1 2.8 0L17 2.4c.8.8.8 2 0 2.8l-6.3 6.4a2 2 0 0 1-2.9 0l-1.4-1.4a2 2 0 0 1 0-2.8L12.7 1zM14 2.4L7.7 8.8l1.5 1.4 6.3-6.4-1.4-1.4z"></path></g> <g id="personalization" viewBox="0 0 20 20"><path d="M5.051.808.81 5.05 5.05 9.293l1.414-1.414L3.637 5.05l1.414-1.414L6.465 5.05l-.707.707.707.707.708-.707.707.707L9.294 5.05 5.05.808ZM14.95 10.707l-1.413 1.414 1.414 1.415-.707.707.707.707.707-.707.707.707-1.414 1.414-2.829-2.829-1.414 1.415 4.243 4.242 4.242-4.242-4.242-4.243Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="m17.411 3.935-1.35-1.35c-.78-.78-2.05-.78-2.83 0l-2.83 2.82-8.4 8.41v4.18h4.18l11.23-11.23c.79-.78.79-2.05 0-2.83Zm-13.41 12.06v-1.36l7.82-7.82 1.41 1.41-7.82 7.83-1.41-.06Z"/></g> - <g id="personalization-revamp" width="18" height="18" viewBox="0 0 18 18"> + <g id="personalization-revamp"> <path fill-rule="evenodd" d="M9 17.167a8.205 8.205 0 0 1-3.187-.625 8.59 8.59 0 0 1-2.605-1.75 8.589 8.589 0 0 1-1.75-2.604A8.204 8.204 0 0 1 .833 9c0-1.139.216-2.201.646-3.187A8.152 8.152 0 0 1 3.25 3.229a8.233 8.233 0 0 1 2.667-1.75A8.175 8.175 0 0 1 9.146.833c1.11 0 2.153.195 3.125.584a7.89 7.89 0 0 1 2.541 1.562 7.235 7.235 0 0 1 1.73 2.354 6.69 6.69 0 0 1 .625 2.875c0 1.348-.473 2.514-1.417 3.5-.93.973-2.083 1.459-3.458 1.459H11a.415.415 0 0 0-.27.104.28.28 0 0 0-.126.25c0 .194.09.347.271.458.194.097.292.438.292 1.021 0 .528-.209 1.02-.625 1.48-.403.457-.917.687-1.542.687ZM4.563 9.75c.347 0 .638-.118.875-.354.25-.25.375-.549.375-.896s-.125-.639-.375-.875a1.156 1.156 0 0 0-.875-.375c-.348 0-.646.125-.896.375a1.189 1.189 0 0 0-.354.875c0 .347.118.646.354.896.25.236.548.354.896.354ZM7.02 6.792c.347 0 .639-.118.875-.354.25-.25.375-.55.375-.896 0-.348-.125-.64-.375-.875a1.156 1.156 0 0 0-.875-.375c-.347 0-.646.125-.896.375a1.189 1.189 0 0 0-.354.875c0 .347.118.646.354.896.25.236.549.354.896.354Zm3.958 0c.347 0 .64-.118.875-.354.25-.25.375-.55.375-.896 0-.348-.125-.64-.375-.875a1.156 1.156 0 0 0-.875-.375c-.347 0-.646.125-.896.375a1.189 1.189 0 0 0-.354.875c0 .347.118.646.354.896.25.236.549.354.896.354Zm2.438 2.958c.347 0 .639-.118.875-.354.25-.25.375-.549.375-.896s-.125-.639-.375-.875a1.156 1.156 0 0 0-.875-.375c-.348 0-.646.125-.896.375a1.189 1.189 0 0 0-.354.875c0 .347.118.646.354.896.25.236.548.354.896.354Zm-4.438 5.688c.14 0 .25-.056.334-.167a.532.532 0 0 0 .124-.313c0-.222-.104-.41-.312-.562-.208-.153-.312-.486-.312-1 0-.542.187-1 .562-1.375a1.905 1.905 0 0 1 1.396-.584h1.52c.917 0 1.667-.312 2.25-.937a3.214 3.214 0 0 0 .896-2.27c0-1.598-.61-2.938-1.833-4.022-1.222-1.097-2.708-1.646-4.458-1.646-1.834 0-3.39.626-4.667 1.876C3.201 5.688 2.563 7.208 2.563 9c0 1.792.618 3.313 1.854 4.563 1.25 1.25 2.77 1.874 4.562 1.874Z"></path> </g> @@ -260,31 +260,31 @@ </g> <!-- Privacy section --> - <g id="privacy-controls" width="15" height="20" viewBox="0 0 15 20"> + <g id="privacy-controls"> <path fill-rule="evenodd" d="M6.896 9.792V1.625a.79.79 0 0 1 .229-.583.8.8 0 0 1 .583-.25c.236 0 .43.083.584.25a.79.79 0 0 1 .229.583v8.167H6.896Zm-3.021 0V2.646a.79.79 0 0 1 .23-.583.765.765 0 0 1 .562-.23.79.79 0 0 1 .583.23c.167.152.25.347.25.583v7.146H3.875ZM7.5 19.167c-1.847 0-3.424-.646-4.73-1.938C1.48 15.938.834 14.361.834 12.5V4.646a.79.79 0 0 1 .23-.583.79.79 0 0 1 .583-.23c.222 0 .41.077.562.23.167.152.25.347.25.583V12.5c0 1.403.486 2.597 1.459 3.583.986.973 2.18 1.459 3.583 1.459s2.59-.486 3.563-1.459c.986-.986 1.479-2.18 1.479-3.583V9.563H12.5a.906.906 0 0 0-.667.27.906.906 0 0 0-.27.667v3.188H8.75c-.458 0-.854.166-1.187.5-.334.319-.5.715-.5 1.187v.5H5.438v-.5c0-.93.319-1.715.958-2.354a3.21 3.21 0 0 1 2.354-.98h1.188V3.647a.79.79 0 0 1 .229-.583.79.79 0 0 1 .583-.23c.222 0 .41.077.563.23.166.152.25.347.25.583v4.479a1.61 1.61 0 0 1 .458-.146c.166-.028.326-.042.479-.042h1.667V12.5c0 1.861-.646 3.438-1.938 4.73-1.291 1.29-2.868 1.937-4.729 1.937Z"></path> </g> - <g id="privacy-sync" width="17" height="14" viewBox="0 0 17 14"> + <g id="privacy-sync"> <path fill-rule="evenodd" d="M1.5 13.104v-1.583h1.396a6.354 6.354 0 0 1-1.48-2A5.912 5.912 0 0 1 .876 7c0-1.444.444-2.715 1.333-3.812a6.102 6.102 0 0 1 3.417-2.125v1.791a4.424 4.424 0 0 0-2.167 1.563c-.57.736-.854 1.597-.854 2.583 0 .653.132 1.25.396 1.792a4.708 4.708 0 0 0 1.02 1.396V9h1.584v4.104H1.5Zm8.875.167c-.68 0-1.257-.23-1.73-.688a2.364 2.364 0 0 1-.687-1.708c0-.667.223-1.23.667-1.687a2.321 2.321 0 0 1 1.646-.709 2.57 2.57 0 0 1 .958-1.083 2.639 2.639 0 0 1 1.48-.438c.708 0 1.319.223 1.833.667.514.43.805.965.875 1.604.514.042.951.257 1.312.646.361.375.542.833.542 1.375 0 .556-.202 1.035-.604 1.438a1.953 1.953 0 0 1-1.438.583h-4.854ZM11.292 6a3.932 3.932 0 0 0-.521-1.208 4.22 4.22 0 0 0-.792-.98V5H8.396V.896H12.5v1.583h-1.396c.5.458.917.986 1.25 1.584A5.96 5.96 0 0 1 13.042 6h-1.75Zm-.917 5.625h4.875a.366.366 0 0 0 .27-.104c.07-.07.105-.16.105-.271a.336.336 0 0 0-.125-.27.414.414 0 0 0-.27-.105h-1.418V9.729c0-.305-.11-.562-.333-.77a1.082 1.082 0 0 0-.791-.334.992.992 0 0 0-.75.333 1.048 1.048 0 0 0-.313.771v.396h-1.25a.733.733 0 0 0-.542.208.707.707 0 0 0-.208.521c0 .222.07.41.208.563.14.139.32.208.542.208Z"></path> </g> - <g id="privacy-lock-screen" width="16" height="16" viewBox="0 0 16 16"> + <g id="privacy-lock-screen"> <path fill-rule="evenodd" d="M7.958 15.167v-1.73h5.48V2.563h-5.48V.833h5.48c.486 0 .895.167 1.229.5.333.334.5.743.5 1.23v10.875c0 .486-.167.895-.5 1.229-.334.333-.743.5-1.23.5H7.959Zm-1.646-3.438-1.229-1.208L6.73 8.875H.833v-1.75H6.73L5.083 5.479l1.23-1.208L10.042 8l-3.73 3.73Z"></path> </g> - <g id="privacy-manage-people" width="18" height="15" viewBox="0 0 18 15"> + <g id="privacy-manage-people"> <path fill-rule="evenodd" d="M7 6.917c-.889 0-1.639-.306-2.25-.917a3.104 3.104 0 0 1-.917-2.25c0-.889.306-1.639.917-2.25S6.111.583 7 .583 8.639.89 9.25 1.5s.917 1.361.917 2.25c0 .875-.306 1.625-.917 2.25-.611.611-1.361.917-2.25.917ZM.833 13.25v-2.083c0-.417.098-.785.292-1.104.208-.32.465-.57.77-.75a10.094 10.094 0 0 1 2.46-1.021A9.588 9.588 0 0 1 7 7.917c.153 0 .306.007.458.02.167 0 .334.007.5.021a6.548 6.548 0 0 0-.27.834c-.07.32-.125.61-.167.875l-.5-.021a8.38 8.38 0 0 0-2.188.291 7.683 7.683 0 0 0-2.041.855.338.338 0 0 0-.167.146.477.477 0 0 0-.062.25v.333h5.166c.07.291.174.59.313.896.152.305.312.583.479.833H.833Zm11.563.917-.271-1.188a5.91 5.91 0 0 1-.52-.229 2.764 2.764 0 0 1-.46-.333l-1.166.375-.729-1.25.875-.854a1.9 1.9 0 0 1-.083-.563c.014-.208.041-.403.083-.583l-.875-.834.73-1.27 1.145.333c.139-.125.292-.236.458-.333.18-.112.361-.188.542-.23l.292-1.187h1.458l.27 1.187c.181.056.355.132.522.23.18.097.34.208.479.333l1.146-.313.729 1.25-.854.813c.041.194.055.396.041.604 0 .194-.02.382-.062.563l.875.833-.73 1.25-1.166-.354a2.768 2.768 0 0 1-.458.333 2.48 2.48 0 0 1-.521.23l-.292 1.187h-1.458Zm.75-2.604c.403 0 .743-.146 1.02-.438.292-.292.438-.639.438-1.042 0-.402-.146-.743-.437-1.02a1.423 1.423 0 0 0-1.042-.438c-.389 0-.73.146-1.02.438a1.422 1.422 0 0 0-.438 1.041c0 .39.146.73.437 1.021.292.292.64.438 1.042.438ZM7 5.187c.403 0 .743-.138 1.02-.416a1.43 1.43 0 0 0 .418-1.021c0-.403-.146-.743-.438-1.02a1.364 1.364 0 0 0-1-.417 1.35 1.35 0 0 0-1.02.437 1.364 1.364 0 0 0-.418 1c0 .403.14.743.417 1.02A1.43 1.43 0 0 0 7 5.188Z"></path> </g> - <g id="privacy-smart-privacy" width="20" height="20" viewBox="0 0 20 20"> + <g id="privacy-smart-privacy"> <path fill-rule="evenodd" d="m3.563 8.208 2.645-2.645H3.563v2.645Zm0 5 7.645-7.645H8.667l-5.104 5.104v2.541Zm1.229 1.23h11.646V5.563h-2.771l-8.875 8.875Zm-1.23 1.729c-.486 0-.895-.167-1.229-.5a1.671 1.671 0 0 1-.5-1.23V5.563c0-.487.167-.896.5-1.23a1.67 1.67 0 0 1 1.23-.5h12.875c.486 0 .895.167 1.229.5.333.334.5.743.5 1.23v8.875c0 .486-.167.895-.5 1.229-.334.333-.743.5-1.23.5H3.563Z"></path> </g> - <g id="privacy-suggested-content" width="20" height="20" viewBox="0 0 20 20"> + <g id="privacy-suggested-content"> <path fill-rule="evenodd" d="M8 13.98h3.375a.948.948 0 0 0 .52-.147.935.935 0 0 0 .376-.396l1.625-3.229c.028-.07.048-.139.062-.208A.786.786 0 0 0 14 9.75V9.5a.964.964 0 0 0-.292-.708A.964.964 0 0 0 13 8.5h-2.5l.417-2.042a.832.832 0 0 0-.021-.416.886.886 0 0 0-.23-.375L10 5 7.208 8.73c-.07.096-.125.194-.166.29A1.133 1.133 0 0 0 7 9.334v3.646c0 .278.097.514.292.709.194.194.43.291.708.291Zm2 4.187a8.205 8.205 0 0 1-3.187-.625 8.59 8.59 0 0 1-2.605-1.75 8.589 8.589 0 0 1-1.75-2.604A8.204 8.204 0 0 1 1.833 10c0-1.139.209-2.201.625-3.187a8.327 8.327 0 0 1 1.75-2.584 8.112 8.112 0 0 1 2.605-1.75c1-.43 2.062-.646 3.187-.646 1.139 0 2.201.216 3.188.646a7.88 7.88 0 0 1 2.583 1.75 7.82 7.82 0 0 1 1.75 2.604c.43.986.646 2.042.646 3.167a7.974 7.974 0 0 1-.646 3.188c-.417.986-1 1.854-1.75 2.604a8.262 8.262 0 0 1-2.604 1.75 8.053 8.053 0 0 1-3.167.625Zm0-1.73c1.792 0 3.313-.625 4.563-1.875 1.25-1.25 1.874-2.77 1.874-4.562 0-1.792-.625-3.312-1.875-4.562-1.25-1.25-2.77-1.875-4.562-1.875-1.792 0-3.312.624-4.562 1.874C4.188 6.688 3.563 8.209 3.563 10c0 1.792.624 3.313 1.874 4.563 1.25 1.25 2.771 1.874 4.563 1.874Z"></path> </g> - <g id="privacy-verified-access" width="20" height="20" viewBox="0 0 20 20"> + <g id="privacy-verified-access"> <path fill-rule="evenodd" d="M10 12.167 7.833 10 10 7.833 12.167 10 10 12.167Zm-1.792-5.5L6.104 4.563 10 .667l3.896 3.896-2.104 2.104L10 4.875 8.208 6.667Zm-3.645 7.229L.667 10l3.896-3.896 2.104 2.104L4.875 10l1.792 1.792-2.104 2.104Zm10.875 0-2.105-2.104L15.125 10l-1.792-1.792 2.105-2.104L19.333 10l-3.895 3.896ZM10 19.333l-3.896-3.895 2.104-2.105L10 15.125l1.792-1.792 2.104 2.105L10 19.333Z"></path> </g> - <g id="privacy-data-access-protection" width="14" height="18" viewBox="0 0 14 18"> + <g id="privacy-data-access-protection"> <path fill-rule="evenodd" d="M5.75 11.542h2.5l-.458-2.709c.236-.125.416-.305.541-.541.14-.25.209-.514.209-.792 0-.43-.153-.792-.459-1.083A1.437 1.437 0 0 0 7 5.958c-.43 0-.799.153-1.104.459A1.471 1.471 0 0 0 5.458 7.5c0 .278.063.542.188.792.139.236.326.416.562.541l-.458 2.709ZM7 17.167c-1.93-.459-3.528-1.535-4.792-3.23C.958 12.23.333 10.34.333 8.272V3.375L7 .833l6.667 2.542v4.896c0 2.07-.632 3.958-1.896 5.666-1.25 1.695-2.84 2.771-4.771 3.23Zm0-1.792c1.417-.458 2.59-1.347 3.52-2.667a7.502 7.502 0 0 0 1.418-4.437V4.562L7 2.668 2.063 4.563V8.27a7.58 7.58 0 0 0 1.395 4.437c.945 1.32 2.125 2.209 3.542 2.667Z"></path> </g> - <g id="privacy-secure-dns" width="18" height="18" viewBox="0 0 18 18"> + <g id="privacy-secure-dns"> <path fill-rule="evenodd" d="M9 17.167a8.205 8.205 0 0 1-3.187-.625 8.59 8.59 0 0 1-2.605-1.75 8.589 8.589 0 0 1-1.75-2.604A8.204 8.204 0 0 1 .833 9c0-1.125.223-2.18.667-3.167A8.557 8.557 0 0 1 3.27 3.23a8.112 8.112 0 0 1 2.605-1.75c1-.43 2.042-.646 3.125-.646.306 0 .59.014.854.042.264.028.465.062.604.104V6a30.905 30.905 0 0 0-.708-1.98c-.264-.665-.514-1.13-.75-1.394-.306.292-.562.778-.77 1.458-.195.68-.348 1.327-.46 1.938h2.688v1.5H7.583c-.027.278-.048.535-.062.77V9.73c.014.235.035.485.062.75h2.834c.027-.279.041-.536.041-.772v-.646c0-.194-.007-.423-.02-.687 0-.278-.007-.549-.021-.812h1.52c0 .319.007.61.021.875a11.264 11.264 0 0 1 .001 1.333c0 .236-.008.472-.021.708h3.312A5.462 5.462 0 0 0 15.438 9c0-.236-.021-.48-.063-.73a5.358 5.358 0 0 0-.125-.707h1.792c.041.277.07.527.083.75.028.222.042.45.042.687a7.872 7.872 0 0 1-.646 3.146c-.417.986-1 1.854-1.75 2.604a8.556 8.556 0 0 1-2.604 1.77A7.826 7.826 0 0 1 9 17.168Zm-6.25-6.688h3.313c-.028-.264-.05-.52-.063-.77v-1.48c.014-.236.035-.472.063-.708H2.75A5.466 5.466 0 0 0 2.563 9c0 .236.013.472.041.708.028.236.077.493.146.771Zm4.375 4.688a6.246 6.246 0 0 1-.52-1.396 17.79 17.79 0 0 1-.355-1.792H3.313A6.394 6.394 0 0 0 4.896 14c.667.556 1.41.944 2.229 1.167ZM3.313 6.02H6.25c.097-.653.215-1.25.354-1.792a6.973 6.973 0 0 1 .542-1.396 5.87 5.87 0 0 0-2.25 1.188 6.164 6.164 0 0 0-1.583 2ZM9 15.375c.222-.222.451-.653.688-1.292.236-.652.416-1.354.541-2.104H7.771c.125.75.298 1.452.52 2.104.237.64.473 1.07.709 1.292Zm1.875-.208A5.849 5.849 0 0 0 13.083 14a6.266 6.266 0 0 0 1.604-2.02H11.73c-.083.652-.201 1.25-.354 1.79a7.053 7.053 0 0 1-.5 1.397Zm1.063-9.104V.832h5.229v5.23h-5.23Zm2.687-2.688h1.354V2.021h-1.354v1.354Z"></path> </g>
diff --git a/chrome/browser/resources/ash/settings/parental_controls_page/parental_controls_settings_card.html b/chrome/browser/resources/ash/settings/parental_controls_page/parental_controls_settings_card.html index 2c5c3b6a..eff01ed 100644 --- a/chrome/browser/resources/ash/settings/parental_controls_page/parental_controls_settings_card.html +++ b/chrome/browser/resources/ash/settings/parental_controls_page/parental_controls_settings_card.html
@@ -1,4 +1,8 @@ <style include="settings-shared"> + :host-context(body.revamp-wayfinding-enabled) #parentalControlRowIcon { + --iron-icon-fill-color: var(--cros-sys-primary); + } + cr-link-row { --cr-section-padding: 0; } @@ -15,7 +19,10 @@ </cr-link-row> </template> <template is="dom-if" if="[[!isChild_]]"> - <iron-icon class="start-icon" icon="cr20:kite"></iron-icon> + <iron-icon id="parentalControlRowIcon" + class="start-icon" + icon="cr20:kite"> + </iron-icon> <div class="middle settings-box-text"> <div id="label" aria-hidden="true"> $i18n{parentalControlsPageTitle}
diff --git a/chrome/browser/resources/chromeos/BUILD.gn b/chrome/browser/resources/chromeos/BUILD.gn index a485a08..36488a5 100644 --- a/chrome/browser/resources/chromeos/BUILD.gn +++ b/chrome/browser/resources/chromeos/BUILD.gn
@@ -3,11 +3,13 @@ # found in the LICENSE file. import("//build/config/chromebox_for_meetings/buildflags.gni") +import("//build/config/chromeos/ui_mode.gni") import("//chrome/common/features.gni") import("//third_party/closure_compiler/compile_js.gni") import("//tools/grit/grit_rule.gni") -assert(is_chromeos, "Only Chrome OS resources in //c/b/resources//chromeos.") +assert(is_chromeos_ash, + "Only Chrome OS Ash resources in //c/b/resources//chromeos.") group("resources") { public_deps = [
diff --git a/chrome/browser/resources/chromeos/arc_support/background.js b/chrome/browser/resources/chromeos/arc_support/background.js index d2be7b89..49a0ed7 100644 --- a/chrome/browser/resources/chromeos/arc_support/background.js +++ b/chrome/browser/resources/chromeos/arc_support/background.js
@@ -48,40 +48,6 @@ */ const OUTER_HEIGHT = 640; -/** - * Contains list of possible combination for languages and country codes. If - * match is found then navigate to final document directly. - */ -const PLAYSTORE_TOS_LOCALIZATIONS = [ - 'id_id', 'bs_ba', 'ca_es', 'cs_cz', 'da_dk', 'de_be', - 'de_de', 'de_li', 'de_lu', 'de_at', 'de_ch', 'et_ee', - 'en_as', 'en_ag', 'en_au', 'en_bs', 'en_bh', 'en_bz', - 'en_bw', 'en_kh', 'en_cm', 'en_ca', 'en_cy', 'en_eg', - 'en_fj', 'en_gu', 'en_is', 'en_in', 'en_ie', 'en_il', - 'en_it', 'en_jo', 'en_kw', 'en_lb', 'en_mh', 'en_mu', - 'en_na', 'en_np', 'en_nz', 'en_mp', 'en_om', 'en_pw', - 'en_pg', 'en_ph', 'en_qa', 'en_rw', 'en_sa', 'en_sg', - 'en_za', 'en_lk', 'en_ch', 'en_tz', 'en_tt', 'en_vi', - 'en_ug', 'en_ae', 'en_uk', 'en_us', 'en_zm', 'en_zw', - 'es_es', 'es_us', 'es_gu', 'es_as', 'es-419_ar', 'es-419_bo', - 'es-419_cl', 'es-419_co', 'es-419_cr', 'es-419_cu', 'es-419_ec', 'es-419_sv', - 'es-419_us', 'es-419_gt', 'es-419_hn', 'es-419_mx', 'es-419_ni', 'es-419_pa', - 'es-419_py', 'es-419_pe', 'es-419_pr', 'es-419_do', 'es-419_uy', 'es-419_ve', - 'fr_be', 'fr_bj', 'fr_bf', 'fr_kh', 'fr_cm', 'fr_ca', - 'fr_ci', 'fr_fr', 'fr_ga', 'fr_lu', 'fr_ml', 'fr_mu', - 'fr_ne', 'fr_sn', 'fr_ch', 'fr_tg', 'hl_in', 'hr_hr', - 'it_it', 'it_it', 'lv_lv', 'lt_lt', 'hu_hu', 'mt_mt', - 'nl_aw', 'nl_be', 'nl_nl', 'no_no', 'pl_pl', 'pt-BR_br', - 'pt-PT_ao', 'pt-PT_cv', 'pt-PT_gw', 'pt-PT_mz', 'pt-PT_pt', 'ro_md', - 'ro_ro', 'sq_al', 'sk_sk', 'sl_si', 'fi_fi', 'sv_se', - 'vi_vn', 'tr_cy', 'tr_tr', 'el_gr', 'el_cy', 'be_by', - 'bg_bg', 'mk_mk', 'ru_az', 'ru_am', 'ru_by', 'ru_ba', - 'ru_kz', 'ru_kg', 'ru_ru', 'ru_tj', 'ru_tm', 'ru_uz', - 'sr_rs', 'uk_ua', 'hy_am', 'ar_jo', 'ar_ae', 'ar_bh', - 'ar_kw', 'ar_sa', 'ar_om', 'ar_qa', 'ar_lb', 'ar_eg', - 'hi_in', 'th_th', 'th_la', 'ko_kr', 'zh-CN_cn', 'zh-TW_tw', - 'zh-TW_hk', 'ja_jp', -]; /** * Sends a native message to ArcSupportHost. @@ -475,41 +441,13 @@ this.termsView_.src = defaultLocation; } } else { - // Try fast load first if we know location. - this.fastLocation_ = this.getFastLocation_(); - if (this.fastLocation_) { - this.termsView_.src = 'https://play.google.com/intl/' + - this.fastLocation_ + '/about/play-terms/'; - } else { - this.termsView_.src = defaultLocation; - } + // startTermsViewLoading used to have load time optimization logic + // (b/62540008), but this logic was removed because ToS webpage + // load time had improved. + this.termsView_.src = defaultLocation; } } - /** - * Checks the combination of the current language and country code and tries - * to resolve known terms location. This location is used to load terms - * directly in required language and zone. This prevents extra navigation to - * default terms page to determine this target location. - * Returns undefined in case the fast location cannot be found. - */ - getFastLocation_() { - const matchByLangZone = locale + '_' + this.countryCode; - if (PLAYSTORE_TOS_LOCALIZATIONS.indexOf(matchByLangZone) >= 0) { - return matchByLangZone; - } - - const langSegments = locale.split('-'); - if (langSegments.length == 2) { - const matchByShortLangZone = langSegments[0] + '_' + this.countryCode; - if (PLAYSTORE_TOS_LOCALIZATIONS.indexOf(matchByShortLangZone) >= 0) { - return matchByShortLangZone; - } - } - - return undefined; - } - /** Returns user choices and page configuration for processing. */ getPageResults_() { return {
diff --git a/chrome/browser/resources/chromeos/login/BUILD.gn b/chrome/browser/resources/chromeos/login/BUILD.gn index 6cb2bda..53759e97 100644 --- a/chrome/browser/resources/chromeos/login/BUILD.gn +++ b/chrome/browser/resources/chromeos/login/BUILD.gn
@@ -325,6 +325,7 @@ "screens/osauth/gaia_password_changed.js", "screens/osauth/local_password_setup.js", "screens/osauth/local_data_loss_warning.js", + "screens/osauth/enter_old_password.js", "screens/osauth/osauth_error.js", "screens/osauth/password_selection.js", "screens/osauth/pin_setup.js",
diff --git a/chrome/browser/resources/chromeos/login/debug/debug.js b/chrome/browser/resources/chromeos/login/debug/debug.js index 175a11d7..5c9cbab 100644 --- a/chrome/browser/resources/chromeos/login/debug/debug.js +++ b/chrome/browser/resources/chromeos/login/debug/debug.js
@@ -884,6 +884,28 @@ ], }, { + id: 'enter-old-password', + kind: ScreenKind.NORMAL, + states: [ + { + id: 'no-error', + trigger: (screen) => { + screen.onBeforeShow({ + passwordInvalid: false, + }); + }, + }, + { + id: 'wrong-password', + trigger: (screen) => { + screen.onBeforeShow({ + passwordInvalid: true, + }); + }, + }, + ], + }, + { id: 'local-password-setup', kind: ScreenKind.NORMAL, states: [
diff --git a/chrome/browser/resources/chromeos/login/screens.js b/chrome/browser/resources/chromeos/login/screens.js index 605fd11..b724ced 100644 --- a/chrome/browser/resources/chromeos/login/screens.js +++ b/chrome/browser/resources/chromeos/login/screens.js
@@ -53,6 +53,7 @@ import './screens/osauth/fingerprint_setup.js'; import './screens/osauth/local_password_setup.js'; import './screens/osauth/local_data_loss_warning.js'; +import './screens/osauth/enter_old_password.js'; import './screens/osauth/osauth_error.js'; import './screens/osauth/password_selection.js'; import './screens/osauth/pin_setup.js'; @@ -119,6 +120,10 @@ condition: 'isDrivePinningEnabled', }, {tag: 'enable-kiosk-element', id: 'kiosk-enable'}, + { + tag: 'enter-old-password-element', + id: 'enter-old-password', + }, {tag: 'error-message-element', id: 'error-message'}, {tag: 'family-link-notice-element', id: 'family-link-notice'}, {tag: 'fingerprint-setup-element', id: 'fingerprint-setup'},
diff --git a/chrome/browser/resources/chromeos/login/screens/osauth/BUILD.gn b/chrome/browser/resources/chromeos/login/screens/osauth/BUILD.gn index 9ed3a46..7dc502df 100644 --- a/chrome/browser/resources/chromeos/login/screens/osauth/BUILD.gn +++ b/chrome/browser/resources/chromeos/login/screens/osauth/BUILD.gn
@@ -13,6 +13,7 @@ ":apply_online_password", ":cryptohome_recovery", ":cryptohome_recovery_setup", + ":enter_old_password", ":factor_setup_success", ":fingerprint_setup", ":gaia_password_changed", @@ -149,6 +150,21 @@ extra_deps = [ ":web_components" ] } +js_library("enter_old_password") { + sources = [ "$root_gen_dir/chrome/browser/resources/chromeos/login/screens/osauth/enter_old_password.js" ] + deps = [ + "../../components/behaviors:login_screen_behavior", + "../../components/behaviors:multi_step_behavior", + "../../components/behaviors:oobe_dialog_host_behavior", + "../../components/behaviors:oobe_i18n_behavior", + "../../components/buttons:oobe_back_button", + "../../components/buttons:oobe_next_button", + "../../components/dialogs:oobe_adaptive_dialog", + "../../components/dialogs:oobe_loading_dialog", + ] + extra_deps = [ ":web_components" ] +} + js_library("password_selection") { sources = [ "$root_gen_dir/chrome/browser/resources/chromeos/login/screens/osauth/password_selection.js" ] deps = [ @@ -198,6 +214,7 @@ "fingerprint_setup.js", "gaia_password_changed.js", "local_data_loss_warning.js", + "enter_old_password.js", "local_password_setup.js", "osauth_error.js", "password_selection.js",
diff --git a/chrome/browser/resources/chromeos/login/screens/osauth/enter_old_password.html b/chrome/browser/resources/chromeos/login/screens/osauth/enter_old_password.html new file mode 100644 index 0000000..085beb0 --- /dev/null +++ b/chrome/browser/resources/chromeos/login/screens/osauth/enter_old_password.html
@@ -0,0 +1,53 @@ +<!-- +Copyright 2023 The Chromium Authors +Use of this source code is governed by a BSD-style license that can be +found in the LICENSE file. +--> + +<style include="oobe-dialog-host-styles cros-color-overrides"> + #oldPasswordInput { + padding-top: 16px; + } + + :host-context([orientation=vertical]) #oldPasswordInput { + padding-top: 24px; + text-align: initial; + width: calc(var(--oobe-adaptive-dialog-width) - 48px + - 2 * var(--oobe-adaptive-dialog-content-padding)); + } + + :host-context(.jelly-enabled) + cr-input#oldPasswordInput { + --cr-input-background-color: var(--cros-sys-input_field_on_shaded); + } +</style> + +<oobe-adaptive-dialog role="dialog" for-step="password" id="passwordStep" + single-column> + <iron-icon slot="icon" icon="oobe-32:lock"></iron-icon> + <h1 slot="title"> + [[i18nDynamic(locale,'recoverLocalDataTitle')]] + </h1> + <div slot="subtitle"> + [[i18nDynamic(locale, 'recoverLocalDataSubtitle')]] + </div> + <cr-input slot="subtitle" type="password" id="oldPasswordInput" + value="{{password_}}" invalid="{{passwordInvalid}}" + required class="focus-on-show" + placeholder="[[i18nDynamic(locale, 'oldPasswordHint')]]" + error-message="[[i18nDynamic(locale, 'oldPasswordIncorrect')]]"> + </cr-input> + <div slot="bottom-buttons"> + <oobe-text-button id="forgotPasswordButton" + on-click="onForgotPasswordClicked_" + text-key="forgotOldPasswordButton"> + </oobe-text-button> + <oobe-next-button id="next" on-click="submit_" inverse> + </oobe-next-button> + </div> +</oobe-adaptive-dialog> + +<oobe-loading-dialog id="progress" role="dialog" for-step="progress" + title-key="gaiaLoading"> + <iron-icon slot="icon" icon="oobe-32:googleg"></iron-icon> +</oobe-loading-dialog>
diff --git a/chrome/browser/resources/chromeos/login/screens/osauth/enter_old_password.js b/chrome/browser/resources/chromeos/login/screens/osauth/enter_old_password.js new file mode 100644 index 0000000..2ccbc991 --- /dev/null +++ b/chrome/browser/resources/chromeos/login/screens/osauth/enter_old_password.js
@@ -0,0 +1,178 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import '//resources/cr_elements/chromeos/cros_color_overrides.css.js'; +import '//resources/cr_elements/cr_input/cr_input.js'; +import '//resources/polymer/v3_0/iron-icon/iron-icon.js'; +import '//resources/polymer/v3_0/iron-media-query/iron-media-query.js'; +import '../../components/oobe_icons.html.js'; +import '../../components/buttons/oobe_next_button.js'; +import '../../components/common_styles/oobe_common_styles.css.js'; +import '../../components/common_styles/oobe_dialog_host_styles.css.js'; +import '../../components/dialogs/oobe_adaptive_dialog.js'; +import '../../components/dialogs/oobe_loading_dialog.js'; + +import {loadTimeData} from '//resources/ash/common/load_time_data.m.js'; +import {html, mixinBehaviors, PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import {LoginScreenBehavior, LoginScreenBehaviorInterface} from '../../components/behaviors/login_screen_behavior.js'; +import {MultiStepBehavior, MultiStepBehaviorInterface} from '../../components/behaviors/multi_step_behavior.js'; +import {OobeI18nBehavior, OobeI18nBehaviorInterface} from '../../components/behaviors/oobe_i18n_behavior.js'; +import {OobeTextButton} from '../../components/buttons/oobe_text_button.js'; +import {OOBE_UI_STATE} from '../../components/display_manager_types.js'; +import {addSubmitListener} from '../../login_ui_tools.js'; + + +/** + * UI mode for the dialog. + * @enum {string} + */ +const EnterOldPasswordUIState = { + PASSWORD: 'password', + PROGRESS: 'progress', +}; + +/** + * @constructor + * @extends {PolymerElement} + * @implements {LoginScreenBehaviorInterface} + * @implements {OobeI18nBehaviorInterface} + * @implements {MultiStepBehaviorInterface} + */ +const EnterOldPasswordBase = mixinBehaviors( + [OobeI18nBehavior, LoginScreenBehavior, MultiStepBehavior], PolymerElement); + +/** + * @typedef {{ + * oldPasswordInput: CrInputElement, + * proceedAnyway: OobeTextButton, + * }} + */ +EnterOldPasswordBase.$; + +/** + * @polymer + */ +class EnterOldPassword extends EnterOldPasswordBase { + static get is() { + return 'enter-old-password-element'; + } + + static get template() { + return html`{__html_template__}`; + } + + static get properties() { + return { + password_: { + type: String, + value: '', + }, + + passwordInvalid: { + type: Boolean, + value: false, + }, + + disabled: { + type: Boolean, + value: false, + }, + + passwordInput_: Object, + }; + } + + defaultUIStep() { + return EnterOldPasswordUIState.PASSWORD; + } + + get UI_STEPS() { + return EnterOldPasswordUIState; + } + + /** Overridden from LoginScreenBehavior. */ + // clang-format off + get EXTERNAL_API() { + return [ + 'showWrongPasswordError', + ]; + } + // clang-format on + + /** + * @override + */ + ready() { + super.ready(); + this.initializeLoginScreen('EnterOldPasswordScreen'); + + this.passwordInput_ = this.$.oldPasswordInput; + addSubmitListener(this.passwordInput_, this.submit_.bind(this)); + } + + /** Initial UI State for screen */ + getOobeUIInitialState() { + return OOBE_UI_STATE.PASSWORD_CHANGED; + } + + /** + * Invoked just before being shown. Contains all the data for the screen. + */ + onBeforeShow(data) { + this.reset(); + } + + reset() { + this.setUIStep(EnterOldPasswordUIState.PASSWORD); + this.clearPassword(); + this.disabled = false; + } + + /** + * Called when Screen fails to authenticate with + * provided password. + */ + showWrongPasswordError() { + this.clearPassword(); + this.disabled = false; + this.passwordInvalid = true; + this.setUIStep(EnterOldPasswordUIState.PASSWORD); + } + + /** + * @private + */ + submit_() { + if (this.disabled) { + return; + } + if (!this.passwordInput_.validate()) { + return; + } + this.setUIStep(EnterOldPasswordUIState.PROGRESS); + this.disabled = true; + this.userActed(['submit', this.passwordInput_.value]); + } + + /** @private */ + onForgotPasswordClicked_() { + if (this.disabled) { + return; + } + this.userActed('forgot'); + } + + /** @private */ + onAnimationFinish_() { + this.focus(); + } + + clearPassword() { + this.password_ = ''; + this.passwordInvalid = false; + } +} + +customElements.define(EnterOldPassword.is, EnterOldPassword);
diff --git a/chrome/browser/resources/compose/app.html b/chrome/browser/resources/compose/app.html index 8c7f6c2d..cbcea454 100644 --- a/chrome/browser/resources/compose/app.html +++ b/chrome/browser/resources/compose/app.html
@@ -285,7 +285,7 @@ } </style> -<div id="consentDialog" class="dialog" hidden> +<div id="consentDialog" class="dialog" hidden="[[showMainAppDialog_]]"> <div id="consentHeading"> <div id="consentIconContainer"> <iron-icon icon="compose:refresh"></iron-icon> @@ -305,17 +305,26 @@ </div> </div> - <div id="consentFooter" class="footer"> - <cr-button id="noThanksButton" class="tonal-button"> + <div id="consentFooter" class="footer" hidden="[[showDisclaimerFooter_]]"> + <cr-button id="consentNoThanksButton" class="tonal-button" + on-click="onConsentNoThanksButtonClick_"> $i18n{consentNoButton} </cr-button> - <cr-button id="yesButton" class="action-button"> + <cr-button id="consentYesButton" class="action-button" + on-click="onConsentYesButtonClick_"> $i18n{consentYesButton} </cr-button> </div> + <div id="disclaimerFooter" class="footer" + hidden="[[!showDisclaimerFooter_]]"> + <cr-button id="disclaimerLetsGoButton" class="action-button" + on-click="onDisclaimerLetsGoButtonClick_"> + $i18n{disclaimerLetsGoButton} + </cr-button> + </div> </div> -<div id="appDialog" class="dialog"> +<div id="appDialog" class="dialog" hidden="[[!showMainAppDialog_]]"> <div id="heading"> <h1>$i18n{dialogTitle}</h1> <cr-icon-button id="closeButton" iron-icon="cr:close" on-click="onClose_"> @@ -377,11 +386,8 @@ <div id="submitFooter" class="footer" hidden$="[[submitted_]]"> <div class="footer-text"> - <div> + <div on-click="onFooterClick_"> $i18nRaw{inputFooter} - <a href="#" role="button" on-click="onFileBugClick_"> - $i18nRaw{fileBugText} - </a> </div> </div> <cr-button id="submitButton" class="action-button" on-click="onSubmit_" @@ -394,11 +400,8 @@ <div id="resultFooter" class="footer" hidden="[[!hasSuccessfulResponse_(response_)]]"> <div class="footer-text"> - <div> + <div on-click="onFooterClick_"> $i18nRaw{resultFooter} - <a href="#" role="button" on-click="onFileBugClick_"> - $i18nRaw{fileBugText} - </a> </div> <cr-feedback-buttons on-selected-option-changed="onFeedbackSelectedOptionChanged_"
diff --git a/chrome/browser/resources/compose/app.ts b/chrome/browser/resources/compose/app.ts index 6299d6f..03c07434 100644 --- a/chrome/browser/resources/compose/app.ts +++ b/chrome/browser/resources/compose/app.ts
@@ -24,7 +24,7 @@ import {Debouncer, microTask, PolymerElement} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {getTemplate} from './app.html.js'; -import {CloseReason, ComposeDialogCallbackRouter, ComposeResponse, ComposeStatus, ConfigurableParams, Length, StyleModifiers, Tone, UserFeedback} from './compose.mojom-webui.js'; +import {CloseReason, ComposeDialogCallbackRouter, ComposeResponse, ComposeStatus, ConfigurableParams, ConsentState, Length, StyleModifiers, Tone, UserFeedback} from './compose.mojom-webui.js'; import {ComposeApiProxy, ComposeApiProxyImpl} from './compose_api_proxy.js'; import {ComposeTextareaElement} from './textarea.js'; @@ -40,6 +40,13 @@ export interface ComposeAppElement { $: { + consentDialog: HTMLElement, + consentFooter: HTMLElement, + consentNoThanksButton: CrButtonElement, + consentYesButton: CrButtonElement, + disclaimerFooter: HTMLElement, + disclaimerLetsGoButton: CrButtonElement, + appDialog: HTMLElement, body: HTMLElement, cancelEditButton: CrButtonElement, closeButton: HTMLElement, @@ -114,6 +121,14 @@ type: Number, value: Tone.kUnset, }, + showMainAppDialog_: { + type: Boolean, + value: false, + }, + showDisclaimerFooter_: { + type: Boolean, + value: false, + }, submitted_: { type: Boolean, value: false, @@ -175,6 +190,8 @@ private apiProxy_: ComposeApiProxy = ComposeApiProxyImpl.getInstance(); private eventTracker_: EventTracker = new EventTracker(); private router_: ComposeDialogCallbackRouter = this.apiProxy_.getRouter(); + private showMainAppDialog_: boolean; + private showDisclaimerFooter_: boolean; private editedInput_: string; private feedbackState_: CrFeedbackOption; private input_: string; @@ -224,6 +241,16 @@ private getInitialState_() { this.apiProxy_.requestInitialState().then(initialState => { this.inputParams_ = initialState.configurableParams; + // The dialog can initially be in one of three view states. The consent + // view is shown if consent is not currently granted. If consent was + // granted but not through Compose use, the disclaimer view is shown. + // Otherwise, full consent causes the dialog to show at the main app + // state. + this.showMainAppDialog_ = + initialState.consentState === ConsentState.kConsented; + this.showDisclaimerFooter_ = + initialState.consentState === ConsentState.kExternalConsented; + if (initialState.initialInput) { this.input_ = initialState.initialInput; } @@ -256,12 +283,30 @@ }); } + private onConsentNoThanksButtonClick_() { + this.apiProxy_.closeUi(CloseReason.kPageContentConsentDeclined); + } + + private onConsentYesButtonClick_() { + this.apiProxy_.approveConsent(); + this.showMainAppDialog_ = true; + } + + private onDisclaimerLetsGoButtonClick_() { + this.apiProxy_.acknowledgeConsentDisclaimer(); + this.showDisclaimerFooter_ = false; + this.showMainAppDialog_ = true; + } + private onCancelEditClick_() { this.isEditingSubmittedInput_ = false; } - private onClose_() { - this.apiProxy_.closeUi(CloseReason.kCloseButton); + private onClose_(e: Event) { + const closeReason = (e.target as HTMLElement).id === 'closeButtonConsent' ? + CloseReason.kConsentCloseButton : + CloseReason.kCloseButton; + this.apiProxy_.closeUi(closeReason); } private onEditedInputChanged_() { @@ -330,9 +375,19 @@ this.rewrite_(/*style=*/ {tone: this.selectedTone_}); } - private onFileBugClick_(e: Event) { + private onFooterClick_(e: Event) { e.preventDefault(); - this.apiProxy_.openBugReportingLink(); + // The "File a bug" and "survey" links are embedded into the string. + // Embededd links do not work in WebUI so handle each click in the parent + // event listener. + switch ((e.target as HTMLElement).id) { + case 'bugLink': + this.apiProxy_.openBugReportingLink(); + break; + case 'surveyLink': + this.apiProxy_.openFeedbackSurveyLink(); + break; + } } private onConsentTopTextClick_(e: Event) {
diff --git a/chrome/browser/resources/compose/compose_api_proxy.ts b/chrome/browser/resources/compose/compose_api_proxy.ts index 36112ba..323c660 100644 --- a/chrome/browser/resources/compose/compose_api_proxy.ts +++ b/chrome/browser/resources/compose/compose_api_proxy.ts
@@ -7,11 +7,14 @@ /** @interface */ export interface ComposeApiProxy { acceptComposeResult(): Promise<boolean>; + acknowledgeConsentDisclaimer(): void; + approveConsent(): void; closeUi(reason: CloseReason): void; compose(input: string): void; rewrite(style: StyleModifiers): void; getRouter(): ComposeDialogCallbackRouter; openBugReportingLink(): void; + openFeedbackSurveyLink(): void; openComposeSettings(): void; setUserFeedback(reason: UserFeedback): void; requestInitialState(): Promise<OpenMetadata>; @@ -49,6 +52,14 @@ res => res.success); } + acknowledgeConsentDisclaimer(): void { + this.composeClientPageHandler.acknowledgeConsentDisclaimer(); + } + + approveConsent(): void { + this.composeClientPageHandler.approveConsent(); + } + closeUi(reason: CloseReason): void { this.composeClientPageHandler.closeUI(reason); } @@ -69,6 +80,10 @@ this.composeSessionPageHandler.openBugReportingLink(); } + openFeedbackSurveyLink() { + this.composeSessionPageHandler.openFeedbackSurveyLink(); + } + openComposeSettings() { this.composeSessionPageHandler.openComposeSettings(); }
diff --git a/chrome/browser/resources/dlp_internals/dlp_internals_ui.html b/chrome/browser/resources/dlp_internals/dlp_internals_ui.html index 87f447d..97ecf3e 100644 --- a/chrome/browser/resources/dlp_internals/dlp_internals_ui.html +++ b/chrome/browser/resources/dlp_internals/dlp_internals_ui.html
@@ -91,8 +91,7 @@ <th>Level</th> <th>URL</th> </tr> - <template is="dom-repeat" - items="[[item.restrictionsInfo]]"> + <template is="dom-repeat" items="[[item.restrictionsInfo]]"> <tr> <td> [[contentRestrictionToString(item.restriction)]] @@ -111,22 +110,30 @@ </div> <div class="tabpanel" id="files"> - <table> - <tr> - <th>inode</th> - <th>Creation Time</th> - <th>Source URL</th> - <th>Referrer URL</th> - </tr> - <template is="dom-repeat" items="[[filesEntries_]]"> + <table> <tr> - <td>[[item.inode]]</td> - <td>[[creationTimeToString(item.crtime)]]</td> - <td>[[item.sourceUrl]]</td> - <td>[[item.referrerUrl]]</td> + <th>inode</th> + <th>Creation Time</th> + <th>Source URL</th> + <th>Referrer URL</th> </tr> - </template> - </table> + <template is="dom-repeat" items="[[filesEntries_]]"> + <tr> + <td>[[item.inode]]</td> + <td>[[creationTimeToString(item.crtime)]]</td> + <td>[[item.sourceUrl]]</td> + <td>[[item.referrerUrl]]</td> + </tr> + </template> + </table> + <div> + <p>Select a file from Downloads to calculate its inode number</p> + <label> + <input type="file" accept="any" on-input="onFileSelected"> + </label> + <p>inode number: [[selectedFileInode_]]</p> + <span></span> + </div> </div> <div class="tabpanel" id="reporting">
diff --git a/chrome/browser/resources/dlp_internals/dlp_internals_ui.ts b/chrome/browser/resources/dlp_internals/dlp_internals_ui.ts index 1abb309b5..f371b30 100644 --- a/chrome/browser/resources/dlp_internals/dlp_internals_ui.ts +++ b/chrome/browser/resources/dlp_internals/dlp_internals_ui.ts
@@ -82,6 +82,9 @@ // Files Database Entries. private filesEntries_: FileDatabaseEntry[] = []; + // Selected file inode number. + private selectedFileInode_: bigint; + private readonly pageHandler_: PageHandlerInterface; private readonly reportingObserver_: ReportingObserverReceiver; @@ -255,6 +258,21 @@ } return 'undefined'; } + + private onFileSelected(e: Event) { + const selectedFile = (e.target as HTMLInputElement).value; + this.pageHandler_.getFileInode(selectedFile.replace('C:\\fakepath\\', '')) + .then((value: {inode: bigint|null}) => { + if (value.inode) { + this.selectedFileInode_ = value.inode; + } else { + this.selectedFileInode_ = BigInt(0); + } + }) + .catch((e: object) => { + console.warn(`getFileInode failed: ${JSON.stringify(e)}`); + }); + } } customElements.define(DlpInternalsUi.is, DlpInternalsUi);
diff --git a/chrome/browser/resources/net_internals/domain_security_policy_view.js b/chrome/browser/resources/net_internals/domain_security_policy_view.js index 9929ebf..9313f2f 100644 --- a/chrome/browser/resources/net_internals/domain_security_policy_view.js +++ b/chrome/browser/resources/net_internals/domain_security_policy_view.js
@@ -51,14 +51,15 @@ } onSubmitDelete_(event) { - this.browserBridge_.sendDomainSecurityPolicyDelete(this.deleteInput_.value); + this.browserBridge_.sendDomainSecurityPolicyDelete( + this.deleteInput_.value.trim()); this.deleteInput_.value = ''; event.preventDefault(); } onSubmitHSTSAdd_(event) { this.browserBridge_.sendHSTSAdd( - this.addStsInput_.value, this.addStsCheck_.checked); + this.addStsInput_.value.trim(), this.addStsCheck_.checked); this.browserBridge_.sendHSTSQuery(this.addStsInput_.value).then(result => { this.onHSTSQueryResult_(result); }); @@ -68,14 +69,8 @@ event.preventDefault(); } - onSubmitDelete_(event) { - this.browserBridge_.sendDomainSecurityPolicyDelete(this.deleteInput_.value); - this.deleteInput_.value = ''; - event.preventDefault(); - } - onSubmitHSTSQuery_(event) { - this.browserBridge_.sendHSTSQuery(this.queryStsInput_.value) + this.browserBridge_.sendHSTSQuery(this.queryStsInput_.value.trim()) .then(result => { this.onHSTSQueryResult_(result); });
diff --git a/chrome/browser/resources/side_panel/performance_controls/BUILD.gn b/chrome/browser/resources/side_panel/performance_controls/BUILD.gn index 7d93605f..8b0fdc2 100644 --- a/chrome/browser/resources/side_panel/performance_controls/BUILD.gn +++ b/chrome/browser/resources/side_panel/performance_controls/BUILD.gn
@@ -14,6 +14,7 @@ web_component_files = [ "app.ts", "battery_saver_card.ts", + "browser_health_card.ts", "memory_saver_card.ts", ]
diff --git a/chrome/browser/resources/side_panel/performance_controls/app.html b/chrome/browser/resources/side_panel/performance_controls/app.html index b5bc94b8..afad3cd 100644 --- a/chrome/browser/resources/side_panel/performance_controls/app.html +++ b/chrome/browser/resources/side_panel/performance_controls/app.html
@@ -8,6 +8,7 @@ } </style> <div class="cards"> + <browser-health-card></browser-health-card> <memory-saver-card></memory-saver-card> <battery-saver-card></battery-saver-card> </div> \ No newline at end of file
diff --git a/chrome/browser/resources/side_panel/performance_controls/app.ts b/chrome/browser/resources/side_panel/performance_controls/app.ts index f23a0c1..8e42a23e 100644 --- a/chrome/browser/resources/side_panel/performance_controls/app.ts +++ b/chrome/browser/resources/side_panel/performance_controls/app.ts
@@ -4,6 +4,7 @@ import 'chrome://performance-side-panel.top-chrome/shared/sp_shared_style.css.js'; import './battery_saver_card.js'; +import './browser_health_card.js'; import './memory_saver_card.js'; import {ColorChangeUpdater} from 'chrome://resources/cr_components/color_change_listener/colors_css_updater.js';
diff --git a/chrome/browser/resources/side_panel/performance_controls/browser_health_card.html b/chrome/browser/resources/side_panel/performance_controls/browser_health_card.html new file mode 100644 index 0000000..2b8352d7 --- /dev/null +++ b/chrome/browser/resources/side_panel/performance_controls/browser_health_card.html
@@ -0,0 +1,13 @@ +<style include="sp-shared-style"> +</style> +<div class="sp-card"> + <sp-heading hide-back-button> + <h1 slot="heading"> + <!-- + TODO(crbug.com/1502321): Replace with translated string once i18n is + setup + --> + Browser Health + </h1> + </sp-heading> +</div> \ No newline at end of file
diff --git a/chrome/browser/resources/side_panel/performance_controls/browser_health_card.ts b/chrome/browser/resources/side_panel/performance_controls/browser_health_card.ts new file mode 100644 index 0000000..6bbce465 --- /dev/null +++ b/chrome/browser/resources/side_panel/performance_controls/browser_health_card.ts
@@ -0,0 +1,63 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'chrome://performance-side-panel.top-chrome/shared/sp_heading.js'; +import 'chrome://performance-side-panel.top-chrome/shared/sp_shared_style.css.js'; +import '../strings.m.js'; + +import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; +import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import {getTemplate} from './browser_health_card.html.js'; + +export interface BrowserHealthCardElement { + $: {}; +} + +export class BrowserHealthCardElement extends PolymerElement { + static get is() { + return 'browser-health-card'; + } + + static get template() { + return getTemplate(); + } + + static get properties() { + return { + isPerformanceCPUInterventionEnabled: { + readOnly: true, + type: Boolean, + value: () => + loadTimeData.getBoolean('isPerformanceCPUInterventionEnabled'), + }, + isPerformanceMemoryInterventionEnabled: { + readOnly: true, + type: Boolean, + value: () => + loadTimeData.getBoolean('isPerformanceMemoryInterventionEnabled'), + }, + hidden: { + type: Boolean, + reflectToAttribute: true, + computed: 'computeHidden()', + }, + }; + } + + private isPerformanceCPUInterventionEnabled: boolean; + private isPerformanceMemoryInterventionEnabled: boolean; + + private computeHidden() { + return !this.isPerformanceCPUInterventionEnabled && + !this.isPerformanceMemoryInterventionEnabled; + } +} + +declare global { + interface HTMLElementTagNameMap { + 'browser-health-card': BrowserHealthCardElement; + } +} +customElements.define(BrowserHealthCardElement.is, BrowserHealthCardElement);
diff --git a/chrome/browser/resources/side_panel/read_anything/app.ts b/chrome/browser/resources/side_panel/read_anything/app.ts index 3a948ef..f34ae1cb 100644 --- a/chrome/browser/resources/side_panel/read_anything/app.ts +++ b/chrome/browser/resources/side_panel/read_anything/app.ts
@@ -187,6 +187,9 @@ private previousHighlight_: HTMLElement|null; private currentColorSuffix_: string; + private chromeRefresh2023Enabled_ = + document.documentElement.hasAttribute('chrome-refresh-2023'); + // If the WebUI toolbar should be shown. This happens when the WebUI feature // flag is enabled. private isWebUIToolbarVisible_: boolean; @@ -960,10 +963,16 @@ } getBackgroundColorVar(colorSuffix: string) { + if (this.chromeRefresh2023Enabled_ && (colorSuffix === '')) { + return 'var(--color-sys-base-container-elevated)'; + } return `var(--color-read-anything-background${colorSuffix})`; } getForegroundColorVar(colorSuffix: string) { + if (this.chromeRefresh2023Enabled_ && (colorSuffix === '')) { + return 'var(--color-sys-on-surface)'; + } return `var(--color-read-anything-foreground${colorSuffix})`; } @@ -974,6 +983,8 @@ SkColor = {value: chrome.readingMode.backgroundColor}; const linkColor = this.getLinkColor_(backgroundColor); + // TODO(crbug.com/1465029): Use color tokens for previous highlight and + // selection. this.updateStyles({ '--background-color': skColorToRgba(backgroundColor), '--font-family': this.validatedFontName_(),
diff --git a/chrome/browser/resources/signin/dice_web_signin_intercept/chrome_signin/chrome_signin_app.html b/chrome/browser/resources/signin/dice_web_signin_intercept/chrome_signin/chrome_signin_app.html index e7b7293e..7f319dbcd 100644 --- a/chrome/browser/resources/signin/dice_web_signin_intercept/chrome_signin/chrome_signin_app.html +++ b/chrome/browser/resources/signin/dice_web_signin_intercept/chrome_signin/chrome_signin_app.html
@@ -1,13 +1,17 @@ <style include="signin-shared"> #interceptDialog { - padding: 20px; + padding: 12px 4px 4px; display: flex; flex-direction: column; text-align: center; overflow-wrap: break-word; /* For very long names/emails/strings*/ } +:host-context([chrome-refresh-2023]) #interceptDialog { + padding: 12px 0px 4px; +} + #product-logo { width: 24px; height: 24px;
diff --git a/chrome/browser/resources/tab_search/tab_organization_results.html b/chrome/browser/resources/tab_search/tab_organization_results.html index c906b7d..b34abd1 100644 --- a/chrome/browser/resources/tab_search/tab_organization_results.html +++ b/chrome/browser/resources/tab_search/tab_organization_results.html
@@ -29,10 +29,15 @@ --cr-input-padding-top: 8px; } + .button-row { + display: flex; + gap: 4px; + } + .feedback { align-items: center; display: flex; - gap: 4px; + justify-content: space-between; } iron-selector > .mwb-list-item:focus { @@ -59,10 +64,6 @@ overflow-y: auto; padding: 16px 0; } - - .tab-organization-link { - flex: 1; - } </style> <div class="tab-organization-container"> @@ -78,6 +79,7 @@ on-iron-select="onSelectedChanged_"> <template is="dom-repeat" items="[[tabDatas_]]"> <tab-search-item class="mwb-list-item" data="[[item]]" + tabindex$="[[getTabIndex_(index, lastFocusedIndex_)]]" on-close="onTabRemove_" on-focus="onTabFocus_" hide-timestamp> @@ -90,12 +92,17 @@ </div> </div> <div class="feedback"> - <div class="tab-organization-link" on-click="onLearnMoreClick_"> + <div class="tab-organization-link" + on-click="onLearnMoreClick_" + role="link" + tabindex="0"> $i18n{learnMore} </div> - <cr-icon-button iron-icon="cr:thumbs-up" on-click="onThumbsUpClick_"> - </cr-icon-button> - <cr-icon-button iron-icon="cr:thumbs-down" on-click="onThumbsDownClick_"> - </cr-icon-button> + <div class="button-row"> + <cr-icon-button iron-icon="cr:thumbs-up" on-click="onThumbsUpClick_"> + </cr-icon-button> + <cr-icon-button iron-icon="cr:thumbs-down" on-click="onThumbsDownClick_"> + </cr-icon-button> + </div> </div> </div>
diff --git a/chrome/browser/resources/tab_search/tab_organization_results.ts b/chrome/browser/resources/tab_search/tab_organization_results.ts index 3b0a1f4b..37bca5c 100644 --- a/chrome/browser/resources/tab_search/tab_organization_results.ts +++ b/chrome/browser/resources/tab_search/tab_organization_results.ts
@@ -38,7 +38,11 @@ static get properties() { return { - tabs: Array, + tabs: { + type: Array, + observer: 'onTabsChange_', + }, + name: String, availableHeight: { @@ -46,6 +50,11 @@ observer: 'onAvailableHeightChange_', }, + lastFocusedIndex_: { + type: Number, + value: 0, + }, + tabDatas_: { type: Array, value: () => [], @@ -58,6 +67,7 @@ name: string; availableHeight: number; + private lastFocusedIndex_: number; private tabDatas_: TabData[]; static get template() { @@ -70,6 +80,14 @@ tab, TabItemType.OPEN_TAB, new URL(tab.url.url).hostname)); } + private onTabsChange_() { + this.lastFocusedIndex_ = 0; + } + + private getTabIndex_(index: number): number { + return index === this.lastFocusedIndex_ ? 0 : -1; + } + private onAvailableHeightChange_() { const maxHeight = Math.max( MINIMUM_SCROLLABLE_MAX_HEIGHT, @@ -115,6 +133,7 @@ const selectedItemCloseButton = selectedItem.shadowRoot!.querySelector(`cr-icon-button`)!; selectedItemCloseButton.focus(); + this.lastFocusedIndex_ = this.$.selector.indexOf(selectedItem); } }
diff --git a/chrome/browser/resources/tab_search/tab_organization_shared_style.css b/chrome/browser/resources/tab_search/tab_organization_shared_style.css index 867eddf2..43a02e08 100644 --- a/chrome/browser/resources/tab_search/tab_organization_shared_style.css +++ b/chrome/browser/resources/tab_search/tab_organization_shared_style.css
@@ -30,6 +30,8 @@ cursor: pointer; font-size: 13px; font-weight: 400; + outline-color: var(--color-button-foreground); + outline-offset: 2px; text-decoration: underline; }
diff --git a/chrome/browser/safe_browsing/BUILD.gn b/chrome/browser/safe_browsing/BUILD.gn index 4118ac2..e317e16 100644 --- a/chrome/browser/safe_browsing/BUILD.gn +++ b/chrome/browser/safe_browsing/BUILD.gn
@@ -43,6 +43,7 @@ "//components/resources:components_resources_grit", "//components/safe_browsing:buildflags", "//components/safe_browsing/content/browser", + "//components/safe_browsing/content/browser:client_report_util", "//components/safe_browsing/content/browser:client_side_detection", "//components/safe_browsing/content/browser:client_side_detection_service", "//components/safe_browsing/content/browser/triggers:suspicious_site_trigger",
diff --git a/chrome/browser/safe_browsing/download_protection/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection/download_protection_service.cc index 560e5229..f256a9f 100644 --- a/chrome/browser/safe_browsing/download_protection/download_protection_service.cc +++ b/chrome/browser/safe_browsing/download_protection/download_protection_service.cc
@@ -852,7 +852,6 @@ TRIGGER_CONSUMER_PROMPT, safe_browsing::DownloadCheckResult::UNKNOWN, std::move(settings), password); - LogDeepScanEvent(item, safe_browsing::DeepScanEvent::kPromptAccepted); } // static
diff --git a/chrome/browser/safe_browsing/download_protection/download_protection_util.h b/chrome/browser/safe_browsing/download_protection/download_protection_util.h index e83ba60..aebc434 100644 --- a/chrome/browser/safe_browsing/download_protection/download_protection_util.h +++ b/chrome/browser/safe_browsing/download_protection/download_protection_util.h
@@ -96,7 +96,9 @@ kScanCanceled = 3, kScanCompleted = 4, kScanFailed = 5, - kMaxValue = kScanFailed, + kScanDeleted = 6, + kPromptAcceptedFromWebUI = 7, + kMaxValue = kPromptAcceptedFromWebUI, }; void LogDeepScanEvent(download::DownloadItem* item, DeepScanEvent event);
diff --git a/chrome/browser/safe_browsing/download_protection/download_url_sb_client.cc b/chrome/browser/safe_browsing/download_protection/download_url_sb_client.cc index 3e499c6f..a2a66f62 100644 --- a/chrome/browser/safe_browsing/download_protection/download_url_sb_client.cc +++ b/chrome/browser/safe_browsing/download_protection/download_url_sb_client.cc
@@ -9,6 +9,7 @@ #include "base/strings/string_number_conversions.h" #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" #include "chrome/browser/safe_browsing/download_protection/download_protection_service.h" +#include "components/safe_browsing/content/browser/client_report_util.h" #include "components/safe_browsing/content/browser/safe_browsing_navigation_observer_manager.h" #include "components/safe_browsing/content/browser/ui_manager.h" #include "components/safe_browsing/core/common/features.h" @@ -133,6 +134,11 @@ ui_manager_->MaybeReportSafeBrowsingHit( std::move(hit_report), content::DownloadItemUtils::GetWebContents(item_)); + + if (base::FeatureList::IsEnabled( + safe_browsing::kCreateWarningShownClientSafeBrowsingReports)) { + CreateAndMaybeSendClientSafeBrowsingWarningShownReport(post_data); + } } void DownloadUrlSBClient::IdentifyReferrerChain() { @@ -149,4 +155,26 @@ DOWNLOAD_CHECKS_MAX); } +void DownloadUrlSBClient:: + CreateAndMaybeSendClientSafeBrowsingWarningShownReport( + std::string post_data) { + std::unique_ptr<ClientSafeBrowsingReportRequest> report = + std::make_unique<ClientSafeBrowsingReportRequest>(); + report->set_url(url_chain_.back().spec()); + report->set_page_url(url_chain_.front().spec()); + report->set_referrer_url(referrer_url_.spec()); + report->set_type(ClientSafeBrowsingReportRequest::WARNING_SHOWN); + report->mutable_client_properties()->set_url_api_type( + client_report_utils::GetUrlApiTypeForThreatSource( + database_manager_->GetNonBrowseUrlThreatSource())); + report->set_warning_shown_timestamp_msec( + base::Time::Now().InMillisecondsSinceUnixEpoch()); + report->mutable_warning_shown_info()->set_warning_type( + ClientSafeBrowsingReportRequest::WarningShownInfo:: + BINARY_MALWARE_DOWNLOAD_WARNING); + report->mutable_warning_shown_info()->set_post_data(post_data); + ui_manager_->MaybeSendClientSafeBrowsingWarningShownReport( + std::move(report), content::DownloadItemUtils::GetWebContents(item_)); +} + } // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/download_protection/download_url_sb_client.h b/chrome/browser/safe_browsing/download_protection/download_url_sb_client.h index 79ac2b4..b9b961f 100644 --- a/chrome/browser/safe_browsing/download_protection/download_url_sb_client.h +++ b/chrome/browser/safe_browsing/download_protection/download_url_sb_client.h
@@ -67,6 +67,9 @@ void UpdateDownloadCheckStats(SBStatsType stat_type); + void CreateAndMaybeSendClientSafeBrowsingWarningShownReport( + std::string post_data); + // The DownloadItem we are checking. Must be accessed only on UI thread. raw_ptr<download::DownloadItem> item_;
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc index cbf0cfa..56475b85 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
@@ -364,7 +364,17 @@ } } + void MaybeSendClientSafeBrowsingWarningShownReport( + std::unique_ptr<ClientSafeBrowsingReportRequest> report, + WebContents* web_contents) override { + if (SafeBrowsingUIManager::ShouldSendClientSafeBrowsingWarningShownReport( + report.get(), web_contents)) { + report_sent_ = true; + } + } + bool hit_report_sent() { return hit_report_sent_; } + bool report_sent() { return report_sent_; } absl::optional<ThreatSource> hit_report_sent_threat_source() { return hit_report_sent_threat_source_; } @@ -401,6 +411,7 @@ base::OnceClosure threat_details_done_callback_; bool threat_details_done_ = false; bool hit_report_sent_ = false; + bool report_sent_ = false; bool expect_empty_report_for_hats_ = true; bool expect_report_url_for_hats_ = false; bool expect_interstitial_interactions_ = false; @@ -610,8 +621,12 @@ safe_browsing::kThreatDomDetailsTagAndAttributeFeature, parameters); base::test::FeatureRefAndParams add_warning_shown_timestamp_csbrrs( safe_browsing::kAddWarningShownTSToClientSafeBrowsingReport, {}); + base::test::FeatureRefAndParams create_warning_shown_csbrrs( + safe_browsing::kCreateWarningShownClientSafeBrowsingReports, {}); scoped_feature_list_.InitWithFeaturesAndParameters( - {tag_and_attribute, add_warning_shown_timestamp_csbrrs}, {}); + {tag_and_attribute, add_warning_shown_timestamp_csbrrs, + create_warning_shown_csbrrs}, + {}); } SafeBrowsingBlockingPageBrowserTest( @@ -970,6 +985,12 @@ ->hit_report_sent(); } + bool report_sent() { + return static_cast<FakeSafeBrowsingUIManager*>( + factory_.test_safe_browsing_service()->ui_manager().get()) + ->report_sent(); + } + // Helper method for LearnMore test below. Implemented as a test fixture // method instead of in the test below because the whole test fixture class // is friended by SafeBrowsingBlockingPage. @@ -1909,6 +1930,7 @@ prefs::kSafeBrowsingScoutReportingEnabled, true); GURL url = SetupWarningAndNavigate(browser()); // not incognito EXPECT_TRUE(hit_report_sent()); + EXPECT_TRUE(report_sent()); } IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest, @@ -1933,6 +1955,7 @@ incognito_browser, "enhanced-protection-message")); EXPECT_FALSE(hit_report_sent()); + EXPECT_FALSE(report_sent()); } IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest, @@ -1950,6 +1973,7 @@ prefs::kSafeBrowsingScoutReportingEnabled, false); // set up SBER GURL url = SetupWarningAndNavigate(browser()); // not incognito EXPECT_FALSE(hit_report_sent()); + EXPECT_FALSE(report_sent()); } namespace { @@ -3542,7 +3566,6 @@ PasswordManagerBrowserTestBase::GetNewTab(browser(), &contents); // Navigate to the page. - contents = browser()->tab_strip_model()->GetActiveWebContents(); content::TestNavigationObserver observer1(contents); const GURL url = embedded_test_server()->GetURL("/password/password_form.html");
diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc index 5068cb82..5b1bb37 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
@@ -285,8 +285,20 @@ web_contents); } + void MaybeSendClientSafeBrowsingWarningShownReport( + std::unique_ptr<safe_browsing::ClientSafeBrowsingReportRequest> report, + content::WebContents* web_contents) override { + EXPECT_FALSE(got_warning_shown_report_); + got_warning_shown_report_ = true; + warning_shown_report_ = *(report.get()); + SafeBrowsingUIManager::MaybeSendClientSafeBrowsingWarningShownReport( + std::move(report), web_contents); + } + bool got_hit_report_ = false; safe_browsing::HitReport hit_report_; + bool got_warning_shown_report_ = false; + safe_browsing::ClientSafeBrowsingReportRequest warning_shown_report_; private: ~FakeSafeBrowsingUIManager() override {} @@ -456,7 +468,10 @@ // Tests the safe browsing blocking page in a browser. class V4SafeBrowsingServiceTest : public InProcessBrowserTest { public: - V4SafeBrowsingServiceTest() {} + V4SafeBrowsingServiceTest() { + scoped_feature_list_.InitAndEnableFeature( + safe_browsing::kCreateWarningShownClientSafeBrowsingReports); + } V4SafeBrowsingServiceTest(const V4SafeBrowsingServiceTest&) = delete; V4SafeBrowsingServiceTest& operator=(const V4SafeBrowsingServiceTest&) = @@ -599,6 +614,12 @@ const safe_browsing::HitReport& hit_report() { return ui_manager()->hit_report_; } + bool got_warning_shown_report() { + return ui_manager()->got_warning_shown_report_; + } + const safe_browsing::ClientSafeBrowsingReportRequest& report() { + return ui_manager()->warning_shown_report_; + } protected: StrictMock<MockObserver> observer_; @@ -612,6 +633,7 @@ v4_get_hash_factory_; // Owned by the V4Database. raw_ptr<TestV4StoreFactory, AcrossTasksDanglingUntriaged> store_factory_; + base::test::ScopedFeatureList scoped_feature_list_; #if defined(ADDRESS_SANITIZER) // TODO(lukasza): https://crbug.com/971820: Disallow renderer crashes once the @@ -634,6 +656,7 @@ EXPECT_FALSE(ShowingInterstitialPage()); EXPECT_FALSE(got_hit_report()); + EXPECT_FALSE(got_warning_shown_report()); } // Proceeding through an interstitial should cause it to get allowlisted for @@ -684,6 +707,7 @@ ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url)); EXPECT_FALSE(ShowingInterstitialPage()); EXPECT_FALSE(got_hit_report()); + EXPECT_FALSE(got_warning_shown_report()); Mock::VerifyAndClear(&observer_); // However, when we navigate to the malware page, we should still get @@ -693,6 +717,7 @@ ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), malware_url)); EXPECT_TRUE(ShowingInterstitialPage()); EXPECT_TRUE(got_hit_report()); + EXPECT_TRUE(got_warning_shown_report()); Mock::VerifyAndClear(&observer_); } @@ -707,6 +732,7 @@ ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), first_url)); EXPECT_FALSE(ShowingInterstitialPage()); EXPECT_FALSE(got_hit_report()); + EXPECT_FALSE(got_warning_shown_report()); Mock::VerifyAndClear(&observer_); // Navigate to malware page, should show interstitial and have first page in @@ -724,6 +750,10 @@ EXPECT_EQ(bad_url, hit_report().page_url); EXPECT_EQ(first_url, hit_report().referrer_url); EXPECT_FALSE(hit_report().is_subresource); + EXPECT_TRUE(got_warning_shown_report()); + EXPECT_EQ(bad_url, report().url()); + EXPECT_EQ(bad_url, report().page_url()); + EXPECT_EQ(first_url, report().referrer_url()); } // TODO(https://crbug.com/1399454): Test is flaky. @@ -746,6 +776,7 @@ ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), first_url)); EXPECT_FALSE(ShowingInterstitialPage()); EXPECT_FALSE(got_hit_report()); + EXPECT_FALSE(got_warning_shown_report()); Mock::VerifyAndClear(&observer_); // Navigate to page which has malware subresource, should show interstitial @@ -767,9 +798,14 @@ EXPECT_EQ(second_url, hit_report().page_url); EXPECT_EQ(first_url, hit_report().referrer_url); EXPECT_TRUE(hit_report().is_subresource); + EXPECT_TRUE(got_warning_shown_report()); + EXPECT_EQ(bad_url, report().url()); + EXPECT_EQ(second_url, report().page_url()); + EXPECT_EQ(first_url, report().referrer_url()); } else { EXPECT_FALSE(ShowingInterstitialPage()); EXPECT_FALSE(got_hit_report()); + EXPECT_FALSE(got_warning_shown_report()); } } @@ -792,6 +828,7 @@ ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), first_url)); EXPECT_FALSE(ShowingInterstitialPage()); EXPECT_FALSE(got_hit_report()); + EXPECT_FALSE(got_warning_shown_report()); Mock::VerifyAndClear(&observer_); // Navigate to malware page. The malware subresources haven't loaded yet, so @@ -802,6 +839,7 @@ EXPECT_FALSE(ShowingInterstitialPage()); EXPECT_FALSE(got_hit_report()); + EXPECT_FALSE(got_warning_shown_report()); Mock::VerifyAndClear(&observer_); EXPECT_CALL(observer_, OnSafeBrowsingHit(IsUnsafeResourceFor(bad_url))) @@ -824,6 +862,10 @@ EXPECT_EQ(second_url, hit_report().page_url); EXPECT_EQ(first_url, hit_report().referrer_url); EXPECT_TRUE(hit_report().is_subresource); + EXPECT_TRUE(got_warning_shown_report()); + EXPECT_EQ(bad_url, report().url()); + EXPECT_EQ(second_url, report().page_url()); + EXPECT_EQ(first_url, report().referrer_url()); } IN_PROC_BROWSER_TEST_F(V4SafeBrowsingServiceTest, @@ -845,6 +887,7 @@ ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), first_url)); EXPECT_FALSE(ShowingInterstitialPage()); EXPECT_FALSE(got_hit_report()); + EXPECT_FALSE(got_warning_shown_report()); Mock::VerifyAndClear(&observer_); // Navigate to malware page. The malware subresources haven't loaded yet, so @@ -855,6 +898,7 @@ EXPECT_FALSE(ShowingInterstitialPage()); EXPECT_FALSE(got_hit_report()); + EXPECT_FALSE(got_warning_shown_report()); Mock::VerifyAndClear(&observer_); EXPECT_CALL(observer_, OnSafeBrowsingHit(IsUnsafeResourceFor(bad_url))) @@ -883,6 +927,10 @@ EXPECT_EQ(second_url, hit_report().page_url); EXPECT_EQ(first_url, hit_report().referrer_url); EXPECT_TRUE(hit_report().is_subresource); + EXPECT_TRUE(got_warning_shown_report()); + EXPECT_EQ(bad_url, report().url()); + EXPECT_EQ(second_url, report().page_url()); + EXPECT_EQ(first_url, report().referrer_url()); } #if (BUILDFLAG(IS_LINUX)) @@ -950,6 +998,10 @@ // the synchronous about:blank commit. EXPECT_EQ(GURL(url::kAboutBlankURL), hit_report().page_url); EXPECT_EQ(GURL(url::kAboutBlankURL), hit_report().referrer_url); + EXPECT_TRUE(got_warning_shown_report()); + EXPECT_EQ(img_url, report().url()); + EXPECT_EQ(GURL(url::kAboutBlankURL), report().page_url()); + EXPECT_EQ(GURL(url::kAboutBlankURL), report().referrer_url()); // Proceed through it. security_interstitials::SecurityInterstitialTabHelper* helper = @@ -1112,6 +1164,32 @@ EXPECT_EQ(absl::nullopt, timer); } +class V4SafeBrowsingServiceWarningShownCSBRRsDisabled + : public V4SafeBrowsingServiceTest { + public: + V4SafeBrowsingServiceWarningShownCSBRRsDisabled() { + scoped_feature_list_.InitAndDisableFeature( + safe_browsing::kCreateWarningShownClientSafeBrowsingReports); + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +IN_PROC_BROWSER_TEST_F(V4SafeBrowsingServiceWarningShownCSBRRsDisabled, + CheckWarningShownReportNotSent) { + GURL bad_url = embedded_test_server()->GetURL(kMalwarePage); + MarkUrlForMalwareUnexpired(bad_url); + + EXPECT_CALL(observer_, OnSafeBrowsingHit(IsUnsafeResourceFor(bad_url))) + .Times(1); + + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), bad_url)); + EXPECT_TRUE(ShowingInterstitialPage()); + + EXPECT_FALSE(got_warning_shown_report()); +} + // Parameterised fixture to permit running the same test for Window and Worker // scopes. class V4SafeBrowsingServiceJsRequestTest @@ -1152,6 +1230,9 @@ EXPECT_EQ(js_request_url, hit_report().malicious_url); EXPECT_EQ(page_url, hit_report().page_url); EXPECT_TRUE(hit_report().is_subresource); + EXPECT_TRUE(got_warning_shown_report()); + EXPECT_EQ(js_request_url, report().url()); + EXPECT_EQ(page_url, report().page_url()); } INSTANTIATE_TEST_SUITE_P( @@ -1188,12 +1269,14 @@ EXPECT_EQ("NOT BLOCKED", new_title); EXPECT_FALSE(ShowingInterstitialPage()); EXPECT_FALSE(got_hit_report()); + EXPECT_FALSE(got_warning_shown_report()); } else { EXPECT_EQ("ERROR", new_title); EXPECT_FALSE(ShowingInterstitialPage()); // got_hit_report() is only set when an interstitial is shown. EXPECT_FALSE(got_hit_report()); + EXPECT_FALSE(got_warning_shown_report()); } } @@ -1223,6 +1306,7 @@ EXPECT_EQ("NOT BLOCKED", new_title); EXPECT_FALSE(ShowingInterstitialPage()); EXPECT_FALSE(got_hit_report()); + EXPECT_FALSE(got_warning_shown_report()); } INSTANTIATE_TEST_SUITE_P( @@ -1310,12 +1394,18 @@ : public V4SafeBrowsingServiceTest, public ::testing::WithParamInterface<ThreatPatternType> { public: - V4SafeBrowsingServiceMetadataTest() {} + V4SafeBrowsingServiceMetadataTest() { + scoped_feature_list_.InitAndEnableFeature( + safe_browsing::kCreateWarningShownClientSafeBrowsingReports); + } V4SafeBrowsingServiceMetadataTest(const V4SafeBrowsingServiceMetadataTest&) = delete; V4SafeBrowsingServiceMetadataTest& operator=( const V4SafeBrowsingServiceMetadataTest&) = delete; + + private: + base::test::ScopedFeatureList scoped_feature_list_; }; // Irrespective of the threat_type classification, if the main frame URL is @@ -1335,6 +1425,10 @@ EXPECT_EQ(url, hit_report().page_url); EXPECT_EQ(GURL(), hit_report().referrer_url); EXPECT_FALSE(hit_report().is_subresource); + EXPECT_TRUE(got_warning_shown_report()); + EXPECT_EQ(url, report().url()); + EXPECT_EQ(url, report().page_url()); + EXPECT_EQ(GURL(), report().referrer_url()); } // Irrespective of the threat_type classification, if the iframe URL is marked @@ -1361,9 +1455,14 @@ EXPECT_EQ(main_url, hit_report().page_url); EXPECT_EQ(GURL(), hit_report().referrer_url); EXPECT_TRUE(hit_report().is_subresource); + EXPECT_TRUE(got_warning_shown_report()); + EXPECT_EQ(iframe_url, report().url()); + EXPECT_EQ(main_url, report().page_url()); + EXPECT_EQ(GURL(), report().referrer_url()); } else { EXPECT_FALSE(ShowingInterstitialPage()); EXPECT_FALSE(got_hit_report()); + EXPECT_FALSE(got_warning_shown_report()); } } @@ -1403,10 +1502,15 @@ EXPECT_EQ(main_url, hit_report().page_url); EXPECT_EQ(GURL(), hit_report().referrer_url); EXPECT_TRUE(hit_report().is_subresource); + EXPECT_TRUE(got_warning_shown_report()); + EXPECT_EQ(img_url, report().url()); + EXPECT_EQ(main_url, report().page_url()); + EXPECT_EQ(GURL(), report().referrer_url()); break; case ThreatPatternType::MALWARE_LANDING: EXPECT_FALSE(ShowingInterstitialPage()); EXPECT_FALSE(got_hit_report()); + EXPECT_FALSE(got_warning_shown_report()); break; default: break;
diff --git a/chrome/browser/search/background/wallpaper_search/wallpaper_search_service.cc b/chrome/browser/search/background/wallpaper_search/wallpaper_search_service.cc index a9f9e04..5f99615 100644 --- a/chrome/browser/search/background/wallpaper_search/wallpaper_search_service.cc +++ b/chrome/browser/search/background/wallpaper_search/wallpaper_search_service.cc
@@ -80,8 +80,7 @@ // Bypass possible incognito profile same as chrome://flags does. Profile* original_profile = profile_->GetOriginalProfile(); // Chrome OS builds sometimes run on non-Chrome OS environments. - if ((base::SysInfo::IsRunningOnChromeOS() || - skip_chrome_os_device_check_for_testing_) && + if (base::SysInfo::IsRunningOnChromeOS() && ash::OwnerSettingsServiceAshFactory::GetForBrowserContext( original_profile)) { // Ash-chrome uses a different FlagsStorage if the user is the owner.
diff --git a/chrome/browser/search/background/wallpaper_search/wallpaper_search_service.h b/chrome/browser/search/background/wallpaper_search/wallpaper_search_service.h index 1377f6b..9cdd83da 100644 --- a/chrome/browser/search/background/wallpaper_search/wallpaper_search_service.h +++ b/chrome/browser/search/background/wallpaper_search/wallpaper_search_service.h
@@ -27,12 +27,6 @@ ~WallpaperSearchService() override; -#if BUILDFLAG(IS_CHROMEOS_ASH) - void SkipChromeOSDeviceCheckForTesting(bool should_skip_check) { - skip_chrome_os_device_check_for_testing_ = should_skip_check; - } -#endif // BUILDFLAG(IS_CHROMEOS_ASH) - private: // KeyedService implementation: void Shutdown() override;
diff --git a/chrome/browser/search/background/wallpaper_search/wallpaper_search_service_browsertest.cc b/chrome/browser/search/background/wallpaper_search/wallpaper_search_service_browsertest.cc index 5235b19..8ea9bc9 100644 --- a/chrome/browser/search/background/wallpaper_search/wallpaper_search_service_browsertest.cc +++ b/chrome/browser/search/background/wallpaper_search/wallpaper_search_service_browsertest.cc
@@ -74,25 +74,20 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) class WallpaperSearchServiceBrowserChromeAshTest : public WallpaperSearchServiceBrowserTest, - public ::testing::WithParamInterface<std::tuple<bool, bool>> { + public ::testing::WithParamInterface<bool> { public: - bool IsDeviceOwner() const { return std::get<0>(GetParam()); } - // Chrome OS builds sometimes run on non-Chrome OS environments. - bool IsRunningOnChromeOS() const { return std::get<1>(GetParam()); } + bool IsDeviceOwner() const { return GetParam(); } }; INSTANTIATE_TEST_SUITE_P(All, WallpaperSearchServiceBrowserChromeAshTest, - ::testing::Combine(::testing::Bool(), - ::testing::Bool())); + ::testing::Bool()); IN_PROC_BROWSER_TEST_P(WallpaperSearchServiceBrowserChromeAshTest, PRE_EnablingWallpaperSearchEnablesGM3) { signin::MakePrimaryAccountAvailable( IdentityManagerFactory::GetForProfile(browser()->profile()), "test@example.com", signin::ConsentLevel::kSync); - WallpaperSearchServiceFactory::GetForProfile(browser()->profile()) - ->SkipChromeOSDeviceCheckForTesting(IsRunningOnChromeOS()); // Enable Wallpaper Search via Optimization Guide Prefs. // GM3 should enable itself when the browser restarts. @@ -110,8 +105,12 @@ IN_PROC_BROWSER_TEST_P(WallpaperSearchServiceBrowserChromeAshTest, EnablingWallpaperSearchEnablesGM3) { + EXPECT_TRUE(base::FeatureList::IsEnabled(features::kChromeRefresh2023)); +#if BUILDFLAG(IS_CHROMEOS_DEVICE) // TODO(b/311263522): Figure out why features::kChromeWebuiRefresh2023 doesn't // enable on linux-chromeos-rel bot. - EXPECT_TRUE(base::FeatureList::IsEnabled(features::kChromeRefresh2023)); + EXPECT_TRUE(base::FeatureList::IsEnabled(features::kChromeWebuiRefresh2023)); + EXPECT_TRUE(features::IsChromeWebuiRefresh2023()); +#endif // BUILDFLAG(IS_CHROMEOS_DEVICE) } #endif // !BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc index e0ed6df..3e0db18 100644 --- a/chrome/browser/search/search.cc +++ b/chrome/browser/search/search.cc
@@ -102,21 +102,24 @@ if (profile) { TemplateURLService* template_url_service = TemplateURLServiceFactory::GetForProfile(profile); - if (template_url_service) + if (template_url_service) { return template_url_service->GetDefaultSearchProvider(); + } } return nullptr; } bool IsMatchingServiceWorker(const GURL& my_url, const GURL& document_url) { // The origin should match. - if (!MatchesOrigin(my_url, document_url)) + if (!MatchesOrigin(my_url, document_url)) { return false; + } // The url filename should be the new tab page ServiceWorker. std::string my_filename = my_url.ExtractFileName(); - if (my_filename != kServiceWorkerFileName) + if (my_filename != kServiceWorkerFileName) { return false; + } // The paths up to the filenames should be the same. std::string my_path_without_filename = my_url.path(); @@ -133,8 +136,9 @@ // Returns true if |url| matches the NTP URL or the URL of the NTP's associated // service worker. bool IsNTPOrRelatedURLHelper(const GURL& url, Profile* profile) { - if (!url.is_valid()) + if (!url.is_valid()) { return false; + } const GURL new_tab_url(GetNewTabPageURL(profile)); return new_tab_url.is_valid() && (MatchesOriginAndPath(url, new_tab_url) || @@ -169,8 +173,9 @@ // This function may also be called by other off-the-record profiles that // can exceptionally open a browser window. // See OTRProfileID::AllowsBrowserWindows() for more context. - if (profile->IsOffTheRecord()) + if (profile->IsOffTheRecord()) { return NewTabURLDetails(GURL(), NEW_TAB_URL_INCOGNITO); + } #if BUILDFLAG(IS_ANDROID) const GURL local_url; @@ -186,17 +191,20 @@ const TemplateURL* template_url = GetDefaultSearchProviderTemplateURL(profile); - if (!profile || !template_url) + if (!profile || !template_url) { return NewTabURLDetails(local_url, NEW_TAB_URL_BAD); + } GURL search_provider_url(template_url->new_tab_url_ref().ReplaceSearchTerms( TemplateURLRef::SearchTermsArgs(std::u16string()), UIThreadSearchTermsData())); - if (!search_provider_url.is_valid()) + if (!search_provider_url.is_valid()) { return NewTabURLDetails(local_url, NEW_TAB_URL_NOT_SET); - if (!search_provider_url.SchemeIsCryptographic()) + } + if (!search_provider_url.SchemeIsCryptographic()) { return NewTabURLDetails(local_url, NEW_TAB_URL_INSECURE); + } if (!IsURLAllowedForSupervisedUser(search_provider_url, CHECK_DEREF(profile))) { return NewTabURLDetails(local_url, NEW_TAB_URL_BLOCKED); @@ -216,13 +224,15 @@ #else content::RenderProcessHost* process_host = contents->GetPrimaryMainFrame()->GetProcess(); - if (!process_host) + if (!process_host) { return false; + } const InstantService* instant_service = InstantServiceFactory::GetForProfile(profile); - if (!instant_service) + if (!instant_service) { return false; + } return instant_service->IsInstantProcess(process_host->GetID()); #endif @@ -236,11 +246,13 @@ } bool IsNTPOrRelatedURL(const GURL& url, Profile* profile) { - if (!url.is_valid()) + if (!url.is_valid()) { return false; + } - if (!IsInstantExtendedAPIEnabled()) + if (!IsInstantExtendedAPIEnabled()) { return url == chrome::kChromeUINewTabURL; + } return profile && IsNTPOrRelatedURLHelper(url, profile); } @@ -259,34 +271,40 @@ } bool IsInstantNTP(content::WebContents* contents) { - if (!contents) + if (!contents) { return false; + } content::NavigationEntry* entry = contents->GetController().GetLastCommittedEntry(); - if (!entry) + if (!entry) { entry = contents->GetController().GetVisibleEntry(); + } return NavEntryIsInstantNTP(contents, entry); } bool NavEntryIsInstantNTP(content::WebContents* contents, content::NavigationEntry* entry) { - if (!contents || !entry || !IsInstantExtendedAPIEnabled()) + if (!contents || !entry || !IsInstantExtendedAPIEnabled()) { return false; + } Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); - if (!IsRenderedInInstantProcess(contents, profile)) + if (!IsRenderedInInstantProcess(contents, profile)) { return false; + } return IsInstantNTPURL(entry->GetURL(), profile); } bool IsInstantNTPURL(const GURL& url, Profile* profile) { - if (MatchesOrigin(url, GURL(chrome::kChromeUINewTabPageURL))) + if (MatchesOrigin(url, GURL(chrome::kChromeUINewTabPageURL))) { return true; + } - if (!IsInstantExtendedAPIEnabled()) + if (!IsInstantExtendedAPIEnabled()) { return false; + } GURL new_tab_url(GetNewTabPageURL(profile)); return new_tab_url.is_valid() && MatchesOriginAndPath(url, new_tab_url); @@ -318,8 +336,9 @@ CHECK(ShouldAssignURLToInstantRenderer(url, profile)) << "Error granting Instant access."; - if (url.SchemeIs(chrome::kChromeSearchScheme)) + if (url.SchemeIs(chrome::kChromeSearchScheme)) { return url; + } // Replace the scheme with "chrome-search:", and clear the port, since // chrome-search is a scheme without port. @@ -342,8 +361,9 @@ bool HandleNewTabURLRewrite(GURL* url, content::BrowserContext* browser_context) { - if (!IsInstantExtendedAPIEnabled()) + if (!IsInstantExtendedAPIEnabled()) { return false; + } if (!(url->SchemeIs(content::kChromeUIScheme) && url->host() == chrome::kChromeUINewTabHost) && @@ -354,8 +374,8 @@ Profile* profile = Profile::FromBrowserContext(browser_context); NewTabURLDetails details(NewTabURLDetails::ForProfile(profile)); - UMA_HISTOGRAM_ENUMERATION("NewTabPage.URLState", - details.state, NEW_TAB_URL_MAX); + UMA_HISTOGRAM_ENUMERATION("NewTabPage.URLState", details.state, + NEW_TAB_URL_MAX); if (details.url.is_valid()) { *url = details.url; return true; @@ -365,14 +385,16 @@ bool HandleNewTabURLReverseRewrite(GURL* url, content::BrowserContext* browser_context) { - if (!IsInstantExtendedAPIEnabled()) + if (!IsInstantExtendedAPIEnabled()) { return false; + } // Do nothing in incognito. Profile* profile = Profile::FromBrowserContext(browser_context); DCHECK(profile); - if (profile->IsOffTheRecord()) + if (profile->IsOffTheRecord()) { return false; + } if (IsInstantNTPURL(*url, profile)) { *url = GURL(chrome::kChromeUINewTabURL);
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc index 6f4b7c1..d96786a 100644 --- a/chrome/browser/sessions/session_restore.cc +++ b/chrome/browser/sessions/session_restore.cc
@@ -93,6 +93,11 @@ #include "extensions/browser/extension_registry.h" #include "extensions/common/extension_set.h" +#if BUILDFLAG(IS_CHROMEOS) +#include "chrome/browser/web_applications/web_app_helpers.h" +#include "chrome/browser/web_applications/web_app_registrar.h" +#endif // BUILDFLAG(IS_CHROMEOS) + #if BUILDFLAG(IS_CHROMEOS_ASH) #include "ash/metrics/login_unlock_throughput_recorder.h" #include "ash/shell.h" @@ -567,6 +572,32 @@ return result; } + void PruneWindows( + std::vector<std::unique_ptr<sessions::SessionWindow>>* windows) { +#if BUILDFLAG(IS_CHROMEOS) + web_app::WebAppProvider* provider = + web_app::WebAppProvider::GetForWebApps(profile_); + if (!provider) { + return; + } + + windows->erase( + base::ranges::remove_if( + *windows, + [provider](const std::unique_ptr<sessions::SessionWindow>& window) + -> bool { + // Windows that are auto-started and prevented from closing are + // exempted from session restore. + webapps::AppId app_id = + web_app::GetAppIdFromApplicationName(window->app_name); + // Checking for close prevention does not require an `AppLock` + // and therefore `registrar_unsafe()` is safe to use. + return provider->registrar_unsafe().IsPreventCloseEnabled(app_id); + }), + windows->end()); +#endif // BUIDLFLAG(IS_CHROMEOS) + } + Browser* ProcessSessionWindows( std::vector<std::unique_ptr<sessions::SessionWindow>>* windows, SessionID active_window_id, @@ -575,6 +606,8 @@ int* tab_count) { DVLOG(1) << "ProcessSessionWindows " << windows->size(); + PruneWindows(windows); + if (windows->empty()) { // Restore was unsuccessful. The DOM storage system can also delete its // data, since no session restore will happen at a later point in time.
diff --git a/chrome/browser/sessions/session_restore_browsertest.cc b/chrome/browser/sessions/session_restore_browsertest.cc index 1790e15a..a22bb91 100644 --- a/chrome/browser/sessions/session_restore_browsertest.cc +++ b/chrome/browser/sessions/session_restore_browsertest.cc
@@ -125,6 +125,10 @@ #include "ui/aura/window.h" #endif +#if BUILDFLAG(IS_CHROMEOS) +#include "base/json/json_reader.h" +#endif // BUILDFLAG(IS_CHROMEOS) + using sessions::ContentTestHelper; using sessions::SerializedNavigationEntry; using sessions::SerializedNavigationEntryTestHelper; @@ -3478,6 +3482,127 @@ EXPECT_EQ(apps, 2); } +// This feature is only available on ChromeOS. +// This test opens an unclosable app and ensures that it is not restored. +#if BUILDFLAG(IS_CHROMEOS) +IN_PROC_BROWSER_TEST_F(AppSessionRestoreTest, DontTrackUnclosableApp) { + Profile* profile = browser()->profile(); + auto example_url = GURL("http://www.example.com"); + + // Open a PWA. + webapps::AppId app_id = InstallPWA(profile, example_url); + + // Make sure the app is unclosable when before it is launched to influence the + // tracking for session restore. + base::Value::List web_app_settings = base::JSONReader::Read(R"([ + { + "manifest_id": "http://www.example.com", + "run_on_os_login": "run_windowed", + "prevent_close_after_run_on_os_login": true + } + ])") + ->GetList() + .Clone(); + profile->GetPrefs()->SetList(prefs::kWebAppSettings, + std::move(web_app_settings)); + + Browser* app_browser = web_app::LaunchWebAppBrowserAndWait(profile, app_id); + + // Pretend to 'close the browser'. + // Just shutdown the services as we would if the browser is shutting down for + // real. + ShutdownServices(profile); + + auto keep_alive = std::make_unique<ScopedKeepAlive>( + KeepAliveOrigin::SESSION_RESTORE, KeepAliveRestartOption::DISABLED); + auto profile_keep_alive = std::make_unique<ScopedProfileKeepAlive>( + profile, ProfileKeepAliveOrigin::kBrowserWindow); + + // Remove unclosability setting. The browser should still not be restored + // because the app window was not tracked when the browser was closed. + profile->GetPrefs()->SetList(prefs::kWebAppSettings, base::Value::List()); + + // Now that SessionServices are off, we can close stuff to simulate a closure. + CloseBrowserSynchronously(app_browser); + CloseBrowserSynchronously(browser()); + + ASSERT_EQ(0u, BrowserList::GetInstance()->size()); + + // Now trigger a restore. + // We need to start up the services again before restoring. + StartupServices(profile); + + SessionRestore::RestoreSession(profile, nullptr, + SessionRestore::SYNCHRONOUS | + SessionRestore::RESTORE_APPS | + SessionRestore::RESTORE_BROWSER, + {}); + + for (Browser* browser : *(BrowserList::GetInstance())) { + EXPECT_NE(browser->type(), Browser::Type::TYPE_APP); + } + EXPECT_EQ(1u, BrowserList::GetInstance()->size()); + + keep_alive.reset(); + profile_keep_alive.reset(); +} + +IN_PROC_BROWSER_TEST_F(AppSessionRestoreTest, DontRestoreUnclosableApp) { + Profile* profile = browser()->profile(); + auto example_url = GURL("http://www.example.com"); + + // Open a PWA. + webapps::AppId app_id = InstallPWA(profile, example_url); + Browser* app_browser = web_app::LaunchWebAppBrowserAndWait(profile, app_id); + + // Pretend to 'close the browser'. + // Just shutdown the services as we would if the browser is shutting down for + // real. + ShutdownServices(profile); + + auto keep_alive = std::make_unique<ScopedKeepAlive>( + KeepAliveOrigin::SESSION_RESTORE, KeepAliveRestartOption::DISABLED); + auto profile_keep_alive = std::make_unique<ScopedProfileKeepAlive>( + profile, ProfileKeepAliveOrigin::kBrowserWindow); + + // Now that SessionServices are off, we can close stuff to simulate a closure. + CloseBrowserSynchronously(app_browser); + CloseBrowserSynchronously(browser()); + + ASSERT_EQ(0u, BrowserList::GetInstance()->size()); + + // Now trigger a restore. + // We need to start up the services again before restoring. + StartupServices(profile); + + base::Value::List web_app_settings = base::JSONReader::Read(R"([ + { + "manifest_id": "http://www.example.com", + "run_on_os_login": "run_windowed", + "prevent_close_after_run_on_os_login": true + } + ])") + ->GetList() + .Clone(); + profile->GetPrefs()->SetList(prefs::kWebAppSettings, + std::move(web_app_settings)); + + SessionRestore::RestoreSession(profile, nullptr, + SessionRestore::SYNCHRONOUS | + SessionRestore::RESTORE_APPS | + SessionRestore::RESTORE_BROWSER, + {}); + + for (Browser* browser : *(BrowserList::GetInstance())) { + EXPECT_NE(browser->type(), Browser::Type::TYPE_APP); + } + EXPECT_EQ(1u, BrowserList::GetInstance()->size()); + + keep_alive.reset(); + profile_keep_alive.reset(); +} +#endif // BUILDFLAG(IS_CHROMEOS) + // This is disabled on mac pending http://crbug.com/1194201 #if BUILDFLAG(IS_MAC) #define MAYBE_IsolatedFromBrowserRestore DISABLED_IsolatedFromBrowserRestore
diff --git a/chrome/browser/sessions/session_service_base.cc b/chrome/browser/sessions/session_service_base.cc index af02b80..c025054 100644 --- a/chrome/browser/sessions/session_service_base.cc +++ b/chrome/browser/sessions/session_service_base.cc
@@ -45,6 +45,12 @@ #include "chrome/browser/app_controller_mac.h" #endif +#if BUILDFLAG(IS_CHROMEOS) +#include "chrome/browser/ui/web_applications/app_browser_controller.h" +#include "chrome/browser/web_applications/web_app_provider.h" +#include "chrome/browser/web_applications/web_app_registrar.h" +#endif // BUILDFLAG(IS_CHROMEOS) + using base::Time; using content::NavigationEntry; using content::WebContents; @@ -718,6 +724,22 @@ return false; } +#if BUILDFLAG(IS_CHROMEOS) + // Windows that are auto-started and prevented from closing are exempted from + // tracking for session restore to prevent multiple unclosable open instances + // of the same app. + web_app::AppBrowserController* app_controller = browser->app_controller(); + web_app::WebAppProvider* provider = + web_app::WebAppProvider::GetForWebApps(profile()); + // Checking for close prevention does not require an `AppLock` and + // therefore `registrar_unsafe()` is safe to use. + if (app_controller && provider && + provider->registrar_unsafe().IsPreventCloseEnabled( + app_controller->app_id())) { + return false; + } +#endif // #if BUILDFLAG(IS_CHROMEOS) + return ShouldRestoreWindowOfType(WindowTypeForBrowserType(browser->type())); }
diff --git a/chrome/browser/sync/test/integration/password_manager_sync_test.cc b/chrome/browser/sync/test/integration/password_manager_sync_test.cc index 6f1ff82..ebc7675 100644 --- a/chrome/browser/sync/test/integration/password_manager_sync_test.cc +++ b/chrome/browser/sync/test/integration/password_manager_sync_test.cc
@@ -41,6 +41,7 @@ #include "components/password_manager/core/browser/password_form.h" #include "components/password_manager/core/browser/password_manager_test_utils.h" #include "components/password_manager/core/browser/password_store/password_store_interface.h" +#include "components/password_manager/core/browser/password_store/password_store_results_observer.h" #include "components/password_manager/core/browser/password_sync_util.h" #include "components/password_manager/core/browser/ui/saved_passwords_presenter.h" #include "components/password_manager/core/common/password_manager_features.h" @@ -337,7 +338,7 @@ GetAllLoginsFromProfilePasswordStore() { scoped_refptr<password_manager::PasswordStoreInterface> password_store = passwords_helper::GetProfilePasswordStoreInterface(0); - PasswordStoreResultsObserver syncer; + password_manager::PasswordStoreResultsObserver syncer; password_store->GetAllLoginsWithAffiliationAndBrandingInformation( syncer.GetWeakPtr()); return syncer.WaitForResults(); @@ -349,7 +350,7 @@ GetAllLoginsFromAccountPasswordStore() { scoped_refptr<password_manager::PasswordStoreInterface> password_store = passwords_helper::GetAccountPasswordStoreInterface(0); - PasswordStoreResultsObserver syncer; + password_manager::PasswordStoreResultsObserver syncer; password_store->GetAllLoginsWithAffiliationAndBrandingInformation( syncer.GetWeakPtr()); return syncer.WaitForResults();
diff --git a/chrome/browser/sync/test/integration/single_client_common_sync_test.cc b/chrome/browser/sync/test/integration/single_client_common_sync_test.cc index c4fde73..cca09b6 100644 --- a/chrome/browser/sync/test/integration/single_client_common_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_common_sync_test.cc
@@ -12,10 +12,12 @@ #include "chrome/browser/sync/local_or_syncable_bookmark_sync_service_factory.h" #include "chrome/browser/sync/test/integration/bookmarks_helper.h" #include "chrome/browser/sync/test/integration/committed_all_nudged_changes_checker.h" -#include "chrome/browser/sync/test/integration/sync_integration_test_util.h" +#include "chrome/browser/sync/test/integration/preferences_helper.h" #include "chrome/browser/sync/test/integration/sync_service_impl_harness.h" #include "chrome/browser/sync/test/integration/sync_test.h" +#include "chrome/common/pref_names.h" #include "components/password_manager/core/browser/features/password_features.h" +#include "components/prefs/pref_service.h" #include "components/reading_list/core/dual_reading_list_model.h" #include "components/reading_list/core/mock_reading_list_model_observer.h" #include "components/signin/public/base/signin_pref_names.h" @@ -95,20 +97,6 @@ SingleClientCommonSyncTest& operator=(const SingleClientCommonSyncTest&) = delete; - protected: - syncer::ModelTypeSet GetTypesWithUnsyncedData(syncer::ModelTypeSet types) { - syncer::ModelTypeSet types_with_unsynced_data; - base::RunLoop loop; - base::MockOnceCallback<void(syncer::ModelTypeSet)> callback; - ON_CALL(callback, Run).WillByDefault([&](syncer::ModelTypeSet types) { - types_with_unsynced_data = types; - loop.Quit(); - }); - GetSyncService(0)->GetTypesWithUnsyncedData(types, callback.Get()); - loop.Run(); - return types_with_unsynced_data; - } - private: base::test::ScopedFeatureList override_features_; }; @@ -152,34 +140,97 @@ } #endif // !BUILDFLAG(IS_ANDROID) +#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) +// TODO(crbug.com/1465272): Deflake and reenable the test. +#define MAYBE_ShouldGetTypesWithUnsyncedDataFromSyncService \ + DISABLED_ShouldGetTypesWithUnsyncedDataFromSyncService +#else +#define MAYBE_ShouldGetTypesWithUnsyncedDataFromSyncService \ + ShouldGetTypesWithUnsyncedDataFromSyncService +#endif IN_PROC_BROWSER_TEST_F(SingleClientCommonSyncTest, - ShouldGetTypesWithUnsyncedDataFromSyncService) { - const syncer::ModelTypeSet kTestTypes = {syncer::BOOKMARKS}; + MAYBE_ShouldGetTypesWithUnsyncedDataFromSyncService) { + const std::string kBookmarkFolderTitle = "title1"; + const syncer::ModelTypeSet kInterestingDataTypes{syncer::BOOKMARKS, + syncer::PREFERENCES}; - // Sign in and enable Sync. - ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; - ASSERT_TRUE(GetSyncService(0)->IsSyncFeatureEnabled()); - ASSERT_TRUE(GetSyncService(0)->GetActiveDataTypes().HasAll(kTestTypes)); + ASSERT_TRUE(SetupClients()); - // No types have unsynced data. - EXPECT_EQ(GetTypesWithUnsyncedData(kTestTypes), syncer::ModelTypeSet{}); + // Set the preference to false initially which should get synced. + GetProfile(0)->GetPrefs()->SetBoolean(prefs::kHomePageIsNewTabPage, false); + ASSERT_TRUE(SetupSync()); + absl::optional<sync_pb::PreferenceSpecifics> server_value = + preferences_helper::GetPreferenceInFakeServer( + syncer::ModelType::PREFERENCES, prefs::kHomePageIsNewTabPage, + GetFakeServer()); + ASSERT_TRUE(server_value.has_value()); + ASSERT_EQ(server_value->value(), "false"); - // Force bookmark saved to the account to be unsynced. - GetFakeServer()->SetHttpError(net::HTTP_BAD_REQUEST); + { + // No types have unsynced data. + base::RunLoop loop; + base::MockOnceCallback<void(syncer::ModelTypeSet)> callback; + EXPECT_CALL(callback, Run(ModelTypeSet())).WillOnce([&]() { loop.Quit(); }); + GetSyncService(0)->GetTypesWithUnsyncedData(kInterestingDataTypes, + callback.Get()); + loop.Run(); + } - bookmarks_helper::AddURL(/*profile=*/0, "title1", - GURL("https://example.com")); + // Start throttling PREFERENCES so further commits will be rejected by the + // server. + GetFakeServer()->SetThrottledTypes({syncer::PREFERENCES}); - // BOOKMARKS now has local changes not yet synced with the server. - EXPECT_EQ(GetTypesWithUnsyncedData(kTestTypes), - syncer::ModelTypeSet{syncer::BOOKMARKS}); + // Make local changes for PREFERENCES and BOOKMARKS, but the first is + // throttled. + GetProfile(0)->GetPrefs()->SetBoolean(prefs::kHomePageIsNewTabPage, true); + bookmarks_helper::AddFolder(0, 0, kBookmarkFolderTitle); - // Clear the error and wait for the local changes to be committed. - GetFakeServer()->ClearHttpError(); - ASSERT_TRUE(ServerCountMatchStatusChecker(syncer::BOOKMARKS, 1).Wait()); + ASSERT_TRUE(AwaitQuiescence()); - // No types have unsynced data. - EXPECT_EQ(GetTypesWithUnsyncedData(kTestTypes), syncer::ModelTypeSet{}); + // The bookmark should get committed successfully. + ASSERT_TRUE(bookmarks_helper::ServerBookmarksEqualityChecker( + {{kBookmarkFolderTitle, GURL()}}, + /*cryptographer=*/nullptr) + .Wait()); + + // The preference should remain unsynced (still set to the previous value). + ASSERT_EQ(preferences_helper::GetPreferenceInFakeServer( + syncer::ModelType::PREFERENCES, prefs::kHomePageIsNewTabPage, + GetFakeServer()) + ->value(), + "false"); + + { + // PREFERENCES now has local changes not yet synced with the server. + base::RunLoop loop; + base::MockOnceCallback<void(syncer::ModelTypeSet)> callback; + EXPECT_CALL(callback, Run(ModelTypeSet({syncer::PREFERENCES}))) + .WillOnce([&]() { loop.Quit(); }); + GetSyncService(0)->GetTypesWithUnsyncedData(kInterestingDataTypes, + callback.Get()); + loop.Run(); + } + + // Unthrottle PREFERENCES to verify that sync can resume. + GetFakeServer()->SetThrottledTypes(syncer::ModelTypeSet()); + + // Wait for PREFERENCES to be de-throttled and commit local changes. + ASSERT_TRUE(CommittedAllNudgedChangesChecker(GetSyncService(0)).Wait()); + ASSERT_EQ(preferences_helper::GetPreferenceInFakeServer( + syncer::ModelType::PREFERENCES, prefs::kHomePageIsNewTabPage, + GetFakeServer()) + ->value(), + "true"); + + { + // No types have unsynced data. + base::RunLoop loop; + base::MockOnceCallback<void(syncer::ModelTypeSet)> callback; + EXPECT_CALL(callback, Run(ModelTypeSet())).WillOnce([&]() { loop.Quit(); }); + GetSyncService(0)->GetTypesWithUnsyncedData(kInterestingDataTypes, + callback.Get()); + loop.Run(); + } } // Android doesn't currently support PRE_ tests, see crbug.com/1117345. @@ -214,8 +265,7 @@ SingleClientFeatureToTransportSyncTest() : SyncTest(SINGLE_CLIENT) { scoped_feature_list_.InitWithFeatures( /*enabled_features=*/ - {syncer::kReadingListEnableDualReadingListModel, - syncer::kReadingListEnableSyncTransportModeUponSignIn}, + {syncer::kReadingListEnableSyncTransportModeUponSignIn}, /*disabled_features=*/{}); }
diff --git a/chrome/browser/sync/test/integration/single_client_reading_list_sync_test.cc b/chrome/browser/sync/test/integration/single_client_reading_list_sync_test.cc index d002da9..c82f761 100644 --- a/chrome/browser/sync/test/integration/single_client_reading_list_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_reading_list_sync_test.cc
@@ -170,8 +170,7 @@ SingleClientReadingListSyncTest() : SyncTest(SINGLE_CLIENT) { scoped_feature_list_.InitWithFeatures( /*enabled_features=*/ - {syncer::kReadingListEnableDualReadingListModel, - syncer::kReadingListEnableSyncTransportModeUponSignIn}, + {syncer::kReadingListEnableSyncTransportModeUponSignIn}, /*disabled_features=*/{}); }
diff --git a/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc b/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc index 713decd..5622911 100644 --- a/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_standalone_transport_sync_test.cc
@@ -520,8 +520,7 @@ // `syncer::kEnableBookmarksAccountStorage` when possible. default_features_.InitWithFeatures( /*enabled_features=*/ - {syncer::kReadingListEnableDualReadingListModel, - syncer::kReadingListEnableSyncTransportModeUponSignIn, + {syncer::kReadingListEnableSyncTransportModeUponSignIn, password_manager::features::kEnablePasswordsAccountStorage, syncer::kSyncEnableContactInfoDataTypeInTransportMode, syncer::kEnablePreferencesAccountStorage},
diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index 4cdd674..087caab 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -1157,8 +1157,6 @@ allowed_types.Put(syncer::PRIORITY_PREFERENCES); } if (base::FeatureList::IsEnabled( - syncer::kReadingListEnableDualReadingListModel) && - base::FeatureList::IsEnabled( syncer::kReadingListEnableSyncTransportModeUponSignIn)) { allowed_types.Put(syncer::READING_LIST); }
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 7b6f70ee..a7cb620 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -3131,6 +3131,8 @@ "webui/ash/login/encryption_migration_screen_handler.h", "webui/ash/login/enrollment_screen_handler.cc", "webui/ash/login/enrollment_screen_handler.h", + "webui/ash/login/enter_old_password_screen_handler.cc", + "webui/ash/login/enter_old_password_screen_handler.h", "webui/ash/login/error_screen_handler.cc", "webui/ash/login/error_screen_handler.h", "webui/ash/login/family_link_notice_screen_handler.cc", @@ -6532,6 +6534,8 @@ deps += [ "//chromeos/components/kiosk" ] sources += [ + "web_applications/web_app_relaunch_notification.cc", + "web_applications/web_app_relaunch_notification.h", "web_applications/web_app_run_on_os_login_notification.cc", "web_applications/web_app_run_on_os_login_notification.h", ] @@ -6904,6 +6908,7 @@ "//chrome/browser/ash:ash", "//chromeos/ash/components/dbus", "//chromeos/ui/base", + "//ui/events:test_support", ] }
diff --git a/chrome/browser/ui/android/layouts/java/src/org/chromium/chrome/browser/layouts/FilterLayoutStateObserver.java b/chrome/browser/ui/android/layouts/java/src/org/chromium/chrome/browser/layouts/FilterLayoutStateObserver.java index 247c512..3fb89659 100644 --- a/chrome/browser/ui/android/layouts/java/src/org/chromium/chrome/browser/layouts/FilterLayoutStateObserver.java +++ b/chrome/browser/ui/android/layouts/java/src/org/chromium/chrome/browser/layouts/FilterLayoutStateObserver.java
@@ -9,8 +9,7 @@ /** * A {@link LayoutStateObserver} that filters events based on a specified layout ID. This utility is * helpful if a feature wishes to exclusively listen to events on a specific layout without the need - * for many conditionals. The only event that is not affected by the filter is {@link - * LayoutStateObserver#onTabSelectionHinted(int)}. + * for many conditionals. */ public final class FilterLayoutStateObserver implements LayoutStateObserver { /** The observer that will receive the filtered events. */ @@ -52,9 +51,4 @@ if (layoutType != mType) return; mObserver.onFinishedHiding(layoutType); } - - @Override - public void onTabSelectionHinted(int tabId) { - mObserver.onTabSelectionHinted(tabId); - } }
diff --git a/chrome/browser/ui/android/layouts/java/src/org/chromium/chrome/browser/layouts/FilterLayoutStateObserverTest.java b/chrome/browser/ui/android/layouts/java/src/org/chromium/chrome/browser/layouts/FilterLayoutStateObserverTest.java index b93fa7ef..1b00b18 100644 --- a/chrome/browser/ui/android/layouts/java/src/org/chromium/chrome/browser/layouts/FilterLayoutStateObserverTest.java +++ b/chrome/browser/ui/android/layouts/java/src/org/chromium/chrome/browser/layouts/FilterLayoutStateObserverTest.java
@@ -24,7 +24,6 @@ private final CallbackHelper mStartedHidingCallbackHelper = new CallbackHelper(); private final CallbackHelper mFinishedShowingCallbackHelper = new CallbackHelper(); private final CallbackHelper mFinishedHidingCallbackHelper = new CallbackHelper(); - private final CallbackHelper mSelectionHintedCallbackHelper = new CallbackHelper(); private LayoutStateObserver mBaseObserver; @@ -53,11 +52,6 @@ public void onFinishedHiding(int layoutType) { mFinishedHidingCallbackHelper.notifyCalled(); } - - @Override - public void onTabSelectionHinted(int tabId) { - mSelectionHintedCallbackHelper.notifyCalled(); - } }; } @@ -98,22 +92,4 @@ initialCount + 1, mFinishedShowingCallbackHelper.getCallCount()); } - - @Test - public void testOnTabSelectionHintedAlwaysTriggers() { - FilterLayoutStateObserver observer = - new FilterLayoutStateObserver(LayoutType.TAB_SWITCHER, mBaseObserver); - - int initialCount = mSelectionHintedCallbackHelper.getCallCount(); - assertEquals( - "Event should not have triggered.", - initialCount, - mSelectionHintedCallbackHelper.getCallCount()); - - observer.onTabSelectionHinted(0); - assertEquals( - "Event should have triggered.", - initialCount + 1, - mSelectionHintedCallbackHelper.getCallCount()); - } }
diff --git a/chrome/browser/ui/android/layouts/java/src/org/chromium/chrome/browser/layouts/LayoutStateProvider.java b/chrome/browser/ui/android/layouts/java/src/org/chromium/chrome/browser/layouts/LayoutStateProvider.java index fffd292b..9a6af87 100644 --- a/chrome/browser/ui/android/layouts/java/src/org/chromium/chrome/browser/layouts/LayoutStateProvider.java +++ b/chrome/browser/ui/android/layouts/java/src/org/chromium/chrome/browser/layouts/LayoutStateProvider.java
@@ -37,13 +37,6 @@ * @param layoutType LayoutType of the finished hiding Layout. */ default void onFinishedHiding(@LayoutType int layoutType) {} - - /** - * Called when a layout wants to hint that a new tab might be selected soon. This is not - * called every time a tab is selected. - * @param tabId The id of the tab that might be selected soon. - */ - default void onTabSelectionHinted(int tabId) {} } /**
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteController.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteController.java index eb245086..04f7f2b 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteController.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/AutocompleteController.java
@@ -81,9 +81,15 @@ assert mNativeController != 0 : "Failed to instantiate native AutocompleteController"; } + @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) + @CalledByNative + void notifyNativeDestroyed() { + mNativeController = 0; + } + /** - * @param listener The listener to be notified when new suggestions are available. - */ + * @param listener The listener to be notified when new suggestions are available. + */ public void addOnSuggestionsReceivedListener(@NonNull OnSuggestionsReceivedListener listener) { mListeners.add(listener); }
diff --git a/chrome/browser/ui/android/plus_addresses/java/src/org/chromium/chrome/browser/ui/plus_addresses/PlusAddressCreationBottomSheetContent.java b/chrome/browser/ui/android/plus_addresses/java/src/org/chromium/chrome/browser/ui/plus_addresses/PlusAddressCreationBottomSheetContent.java index 9e776de..7e2da623 100644 --- a/chrome/browser/ui/android/plus_addresses/java/src/org/chromium/chrome/browser/ui/plus_addresses/PlusAddressCreationBottomSheetContent.java +++ b/chrome/browser/ui/android/plus_addresses/java/src/org/chromium/chrome/browser/ui/plus_addresses/PlusAddressCreationBottomSheetContent.java
@@ -9,6 +9,7 @@ import android.text.style.TextAppearanceSpan; import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; @@ -17,10 +18,13 @@ import org.chromium.components.browser_ui.bottomsheet.BottomSheetContent; import org.chromium.ui.text.NoUnderlineClickableSpan; import org.chromium.ui.text.SpanApplier; +import org.chromium.ui.widget.LoadingView; /** Implements the content for the plus address creation bottom sheet. */ public class PlusAddressCreationBottomSheetContent implements BottomSheetContent { - private final View mView; + private final ViewGroup mContentView; + private final LoadingView mLoadingView; + private boolean mShowingLoadingView; private PlusAddressCreationDelegate mDelegate; /** @@ -36,13 +40,18 @@ String proposedPlusAddressPlaceholder, String plusAddressModalOkText, String plusAddressModalCancelText) { - mView = + View layout = LayoutInflater.from(activity) .inflate(R.layout.plus_address_creation_prompt, /* root= */ null); + assert (layout instanceof ViewGroup) : "layout is not a ViewGroup!"; + mContentView = (ViewGroup) layout; + mLoadingView = new LoadingView(activity); + mLoadingView.setVisibility(View.GONE); + mContentView.addView(mLoadingView); // TODO(b/303054310): Once project exigencies allow for it, convert all of // these back to the android view XML. - TextView modalTitleView = mView.findViewById(R.id.plus_address_notice_title); + TextView modalTitleView = mContentView.findViewById(R.id.plus_address_notice_title); modalTitleView.setText(modalTitle); // TODO(crbug.com/1467623): Link to Plus Address account settings @@ -55,39 +64,47 @@ new SpanApplier.SpanInfo("<link>", "</link>", settingsLink), new SpanApplier.SpanInfo("<b>", "</b>", boldText)); TextView plusAddressDescriptionView = - mView.findViewById(R.id.plus_address_modal_explanation); + mContentView.findViewById(R.id.plus_address_modal_explanation); plusAddressDescriptionView.setText(spannableString); - TextView proposedPlusAddressView = mView.findViewById(R.id.proposed_plus_address); + TextView proposedPlusAddressView = mContentView.findViewById(R.id.proposed_plus_address); proposedPlusAddressView.setText(proposedPlusAddressPlaceholder); - Button plusAddressConfirmButton = mView.findViewById(R.id.plus_address_confirm_button); + Button plusAddressConfirmButton = + mContentView.findViewById(R.id.plus_address_confirm_button); plusAddressConfirmButton.setText(plusAddressModalOkText); - plusAddressConfirmButton.setOnClickListener((View _view) -> mDelegate.onConfirmRequested()); + plusAddressConfirmButton.setOnClickListener( + (View _view) -> { + showLoadingIndicator(); + mDelegate.onConfirmRequested(); + }); - Button plusAddressCancelButton = mView.findViewById(R.id.plus_address_cancel_button); + Button plusAddressCancelButton = mContentView.findViewById(R.id.plus_address_cancel_button); plusAddressCancelButton.setText(plusAddressModalCancelText); plusAddressCancelButton.setOnClickListener((View _view) -> mDelegate.onCanceled()); } public void setProposedPlusAddress(String proposedPlusAddress) { - TextView proposedPlusAddressView = mView.findViewById(R.id.proposed_plus_address); + TextView proposedPlusAddressView = mContentView.findViewById(R.id.proposed_plus_address); proposedPlusAddressView.setText(proposedPlusAddress); // Enable Confirm button if modal use was blocked up until now. - Button plusAddressConfirmButton = mView.findViewById(R.id.plus_address_confirm_button); + Button plusAddressConfirmButton = + mContentView.findViewById(R.id.plus_address_confirm_button); if (!plusAddressConfirmButton.isEnabled()) { plusAddressConfirmButton.setEnabled(true); } } public void showError(String errorMessage) { - TextView proposedPlusAddressView = mView.findViewById(R.id.proposed_plus_address); + TextView proposedPlusAddressView = mContentView.findViewById(R.id.proposed_plus_address); proposedPlusAddressView.setText(errorMessage); // Disable Confirm button if attempts to Confirm() fail. - Button plusAddressConfirmButton = mView.findViewById(R.id.plus_address_confirm_button); + Button plusAddressConfirmButton = + mContentView.findViewById(R.id.plus_address_confirm_button); if (plusAddressConfirmButton.isEnabled()) { plusAddressConfirmButton.setEnabled(false); } + hideLoadingIndicator(); } /** Sets the delegate listening for actions the user performs on this bottom sheet. */ @@ -98,7 +115,7 @@ // BottomSheetContent implementation follows: @Override public View getContentView() { - return mView; + return mContentView; } @Nullable @@ -109,12 +126,14 @@ @Override public int getVerticalScrollOffset() { - return mView.getScrollY(); + return mContentView.getScrollY(); } @Override public void destroy() { - // Cleanup is handled by PlusAddressCreationViewBridge.onSheetClosed + // Some cleanup is handled by PlusAddressCreationMediator.onSheetClosed + // TODO: crbug.com/1467623 - Consolidate cleanup behavior. + mLoadingView.destroy(); } @Override @@ -165,4 +184,18 @@ // TODO(crbug.com/1467623): Replace with final version. return R.string.plus_address_bottom_sheet_content_description; } + + public boolean showsLoadingIndicatorForTesting() { + return mShowingLoadingView; + } + + private void showLoadingIndicator() { + mLoadingView.showLoadingUI(); + mShowingLoadingView = true; + } + + private void hideLoadingIndicator() { + mLoadingView.hideLoadingUI(); + mShowingLoadingView = false; + } }
diff --git a/chrome/browser/ui/android/plus_addresses/java/src/org/chromium/chrome/browser/ui/plus_addresses/PlusAddressCreationMediator.java b/chrome/browser/ui/android/plus_addresses/java/src/org/chromium/chrome/browser/ui/plus_addresses/PlusAddressCreationMediator.java index 201396f..f186dd4 100644 --- a/chrome/browser/ui/android/plus_addresses/java/src/org/chromium/chrome/browser/ui/plus_addresses/PlusAddressCreationMediator.java +++ b/chrome/browser/ui/android/plus_addresses/java/src/org/chromium/chrome/browser/ui/plus_addresses/PlusAddressCreationMediator.java
@@ -86,7 +86,6 @@ // PlusAddressCreationDelegate implementation: @Override public void onConfirmRequested() { - // TODO(crbug.com/1467623): Show a loading icon here? mBridge.onConfirmRequested(); }
diff --git a/chrome/browser/ui/android/plus_addresses/junit/src/org/chromium/chrome/browser/ui/plus_addresses/PlusAddressCreationBottomSheetContentTest.java b/chrome/browser/ui/android/plus_addresses/junit/src/org/chromium/chrome/browser/ui/plus_addresses/PlusAddressCreationBottomSheetContentTest.java index e06e8ca6..0ea1a5a 100644 --- a/chrome/browser/ui/android/plus_addresses/junit/src/org/chromium/chrome/browser/ui/plus_addresses/PlusAddressCreationBottomSheetContentTest.java +++ b/chrome/browser/ui/android/plus_addresses/junit/src/org/chromium/chrome/browser/ui/plus_addresses/PlusAddressCreationBottomSheetContentTest.java
@@ -150,6 +150,20 @@ @Test @SmallTest + public void testOnConfirmButtonClicked_showsLoadingIndicator() { + Assert.assertFalse(mBottomSheetContent.showsLoadingIndicatorForTesting()); + // Show the loading indicator once we click the Confirm button. + Button modalConfirmButton = + mBottomSheetContent.getContentView().findViewById(R.id.plus_address_confirm_button); + modalConfirmButton.callOnClick(); + Assert.assertTrue(mBottomSheetContent.showsLoadingIndicatorForTesting()); + // Hide the loading indicator if we show an error. + mBottomSheetContent.showError(MODAL_ERROR_MESSAGE); + Assert.assertFalse(mBottomSheetContent.showsLoadingIndicatorForTesting()); + } + + @Test + @SmallTest public void testOnCancelButtonClicked_callsDelegateOnCanceled() { Button modalCancelButton = mBottomSheetContent.getContentView().findViewById(R.id.plus_address_cancel_button);
diff --git a/chrome/browser/ui/ash/app_icon_color_cache.cc b/chrome/browser/ui/ash/app_icon_color_cache.cc index 0e39005ed..c046c9b 100644 --- a/chrome/browser/ui/ash/app_icon_color_cache.cc +++ b/chrome/browser/ui/ash/app_icon_color_cache.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/ash/app_icon_color_cache.h" +#include "ash/public/cpp/app_list/app_list_types.h" #include "base/functional/callback.h" #include "base/no_destructor.h" #include "base/trace_event/trace_event.h" @@ -11,8 +12,33 @@ #include "ui/gfx/color_analysis.h" #include "ui/gfx/image/image_skia.h" +namespace ash { + namespace { +// Constants ---------------------------------------------------------- + +// An hsv color with a value less than this cutoff will be categorized as black. +constexpr float kBlackValueCutoff = 0.35f; + +// When an hsv color has a saturation below 'kBlackWhiteSaturationCutoff' then +// if its value is below this cutoff it will be categorized as white and with a +// value above this cutoff is will be categorized as black. +constexpr float kBlackWhiteLowSaturatonValueCutoff = 0.9f; + +// An hsv color with saturation below this cutoff will be categorized as either +// black or white. +constexpr float kBlackWhiteSaturationCutoff = 0.1f; + +// A default return value for the GetLightVibrantColorForApp(). +constexpr SkColor kDefaultLightVibrantColor = SK_ColorWHITE; + +// On the 360 degree hue color spectrum, this value is used as a cutuff to +// indicate that any value equal to or higher than this is considered red. +constexpr float kRedHueCutoff = 315.0f; + +// Color Utilities ------------------------------------------------------ + // Uses the icon image to calculate the light vibrant color. absl::optional<SkColor> CalculateLightVibrantColor(gfx::ImageSkia image) { TRACE_EVENT0("ui", @@ -38,12 +64,197 @@ return best_swatches[0].color; } -constexpr SkColor kDefaultLightVibrantColor = SK_ColorWHITE; +// Categorizes `color` into one color group. +sync_pb::AppListSpecifics::ColorGroup ColorToColorGroup(SkColor color) { + TRACE_EVENT0("ui", "app_icon_color_cache::ColorToColorGroup"); + SkScalar hsv[3]; + SkColorToHSV(color, hsv); + + const float h = hsv[0]; + const float s = hsv[1]; + const float v = hsv[2]; + + sync_pb::AppListSpecifics::ColorGroup group; + + // Assign the ColorGroup based on the hue of `color`. Each if statement checks + // the value of the hue and groups the color based on it. These values are + // approximations for grouping like colors together. + if (h < 15) { + group = sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_RED; + } else if (h < 45) { + group = sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_ORANGE; + } else if (h < 75) { + group = sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_YELLOW; + } else if (h < 182) { + group = sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_GREEN; + } else if (h < 255) { + group = sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_BLUE; + } else if (h < kRedHueCutoff) { + group = sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_MAGENTA; + } else { + group = sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_RED; + } + + if (s < kBlackWhiteSaturationCutoff) { + if (v < kBlackWhiteLowSaturatonValueCutoff) { + group = sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_BLACK; + } else { + group = sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_WHITE; + } + } else if (v < kBlackValueCutoff) { + group = sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_BLACK; + } + + return group; +} + +// Calculates the color group of the background of `source`. +// Samples color from the left, right, and top edge of the icon image and +// determines the color group for each. Returns the most common grouping from +// the samples. If all three sampled groups are different, then returns +// 'light_vibrant_group' which is the color group for the light vibrant color of +// the whole icon image. +sync_pb::AppListSpecifics::ColorGroup CalculateBackgroundColorGroup( + const SkBitmap& source, + sync_pb::AppListSpecifics::ColorGroup light_vibrant_group) { + TRACE_EVENT0("ui", "app_icon_color_cache::CalculateBackgroundColorGroup"); + if (source.empty()) { + return sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_WHITE; + } + + DCHECK_EQ(kN32_SkColorType, source.info().colorType()); + + const int width = source.width(); + const int height = source.height(); + + sync_pb::AppListSpecifics::ColorGroup left_group = sync_pb::AppListSpecifics:: + ColorGroup::AppListSpecifics_ColorGroup_COLOR_BLACK; + sync_pb::AppListSpecifics::ColorGroup right_group = sync_pb:: + AppListSpecifics::ColorGroup::AppListSpecifics_ColorGroup_COLOR_BLACK; + + // Find the color group for the first opaque pixel on the left edge of the + // icon. + const SkColor* current = + reinterpret_cast<SkColor*>(source.getAddr32(0, height / 2)); + for (int x = 0; x < width; ++x, ++current) { + if (SkColorGetA(*current) < SK_AlphaOPAQUE) { + continue; + } + left_group = ColorToColorGroup(*current); + break; + } + + // Find the color group for the first opaque pixel on the right edge of the + // icon. + current = reinterpret_cast<SkColor*>(source.getAddr32(width - 1, height / 2)); + for (int x = width - 1; x >= 0; --x, --current) { + if (SkColorGetA(*current) < SK_AlphaOPAQUE) { + continue; + } + right_group = ColorToColorGroup(*current); + break; + } + + // If the left and right edge have the same color grouping, then return that + // group as the calculated background color group. + if (left_group == right_group) { + return left_group; + } + + // Find the color group for the first opaque pixel on the top edge of the + // icon. + sync_pb::AppListSpecifics::ColorGroup top_group = sync_pb::AppListSpecifics:: + ColorGroup::AppListSpecifics_ColorGroup_COLOR_BLACK; + current = reinterpret_cast<SkColor*>(source.getAddr32(width / 2, 0)); + for (int y = 0; y < height; ++y, current += width) { + if (SkColorGetA(*current) < SK_AlphaOPAQUE) { + continue; + } + top_group = ColorToColorGroup(*current); + break; + } + + // If the top edge has a matching color group with the left or right group, + // then return that group. + if (top_group == right_group || top_group == left_group) { + return top_group; + } + + // When all three sampled color groups are different, then there is no + // conclusive color group for the icon's background. Return the group + // corresponding to the app icon's light vibrant color. + return light_vibrant_group; +} + +// Returns a `IconColor` which can be used to sort icons by their +// background color and light vibrant color. +IconColor CalculateIconColorForApp(const std::string& id, + const gfx::ImageSkia& image) { + TRACE_EVENT0("ui", "app_icon_color_cache::CalculateIconColorForApp"); + const SkColor extracted_light_vibrant_color = + AppIconColorCache::GetInstance().GetLightVibrantColorForApp(id, image); + + const sync_pb::AppListSpecifics::ColorGroup light_vibrant_color_group = + ColorToColorGroup(extracted_light_vibrant_color); + + // `hue` represents the hue of the extracted light vibrant color and can be + // defined by the interval [-1, 360], where -1 (kHueMin) denotes that the hue + // should come before all other hue values, and 360 (kHueMax) denotes that the + // hue should come after all other hue values. + int hue; + + if (light_vibrant_color_group == + sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_BLACK) { + // If `light_vibrant_color_group` is black it should be ordered after all + // other hues. + hue = IconColor::kHueMax; + } else if (light_vibrant_color_group == + sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_WHITE) { + // If 'light_vibrant_color_group' is white, then the hue should be ordered + // before all other hues. + hue = IconColor::kHueMin; + + } else { + SkScalar hsv[3]; + SkColorToHSV(extracted_light_vibrant_color, hsv); + hue = hsv[0]; + + // If the hue is a red on the high end of the hsv color spectrum, then + // subtract the maximum possible hue so that reds on the high end of the hsv + // color spectrum are ordered next to reds on the low end of the hsv color + // spectrum. + if (hue >= kRedHueCutoff) { + hue -= IconColor::kHueMax; + } + + // Shift up the hue value so that the returned hue value always remains + // within the interval [0, 360]. + hue += (IconColor::kHueMax - kRedHueCutoff); + + DCHECK_GE(hue, 0); + DCHECK_LE(hue, IconColor::kHueMax); + } + + return IconColor( + CalculateBackgroundColorGroup(*image.bitmap(), light_vibrant_color_group), + hue); +} } // namespace -namespace ash { - AppIconColorCache& AppIconColorCache::GetInstance() { static base::NoDestructor<AppIconColorCache> color_cache; return *color_cache; @@ -57,8 +268,9 @@ gfx::ImageSkia icon) { AppIdLightVibrantColor::const_iterator it = app_id_light_vibrant_color_map_.find(app_id); - if (it != app_id_light_vibrant_color_map_.end()) + if (it != app_id_light_vibrant_color_map_.end()) { return it->second; + } SkColor light_vibrant_color = CalculateLightVibrantColor(icon).value_or(kDefaultLightVibrantColor); @@ -68,4 +280,9 @@ return light_vibrant_color; } +IconColor AppIconColorCache::GetIconColorForApp(const std::string& app_id, + const gfx::ImageSkia& image) { + return CalculateIconColorForApp(app_id, image); +} + } // namespace ash
diff --git a/chrome/browser/ui/ash/app_icon_color_cache.h b/chrome/browser/ui/ash/app_icon_color_cache.h index 5f99710..08faa186 100644 --- a/chrome/browser/ui/ash/app_icon_color_cache.h +++ b/chrome/browser/ui/ash/app_icon_color_cache.h
@@ -17,6 +17,8 @@ namespace ash { +class IconColor; + class AppIconColorCache { public: // Returns a reference to a singleton instance of AppIconColorCache. @@ -31,6 +33,12 @@ SkColor GetLightVibrantColorForApp(const std::string& app_id, gfx::ImageSkia icon); + // Returns the cached color of the app icon specified by `app_id`, or + // calculates and caches the color if it is not cached yet. The returned + // color can be used to sort icons. + IconColor GetIconColorForApp(const std::string& app_id, + const gfx::ImageSkia& icon); + private: friend class base::NoDestructor<AppIconColorCache>; AppIconColorCache();
diff --git a/chrome/browser/ui/ash/app_icon_color_cache_unittest.cc b/chrome/browser/ui/ash/app_icon_color_cache_unittest.cc index 1a863f1..b1fa9fa8 100644 --- a/chrome/browser/ui/ash/app_icon_color_cache_unittest.cc +++ b/chrome/browser/ui/ash/app_icon_color_cache_unittest.cc
@@ -4,6 +4,7 @@ #include <memory> +#include "ash/public/cpp/app_list/app_list_types.h" #include "chrome/browser/ui/ash/app_icon_color_cache.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -44,4 +45,78 @@ EXPECT_EQ(gfx::kGoogleRed300, test_color); } +gfx::ImageSkia GetRedIconWithBackgroundColorOf(SkColor color) { + const int width = 64; + const int height = 64; + + SkBitmap icon; + icon.allocN32Pixels(width, height); + icon.eraseColor(color); + + icon.erase(gfx::kGoogleRed300, + {width / 4, height / 4, width / 2, height / 2}); + + return gfx::ImageSkia::CreateFrom1xBitmap(icon); +} + +TEST_F(AppIconColorCacheTestTest, SortableIconColorTest) { + const int red_hue = 49; + + // Test a red icon with a black background color. + IconColor group = AppIconColorCache::GetInstance().GetIconColorForApp( + "test_app1", GetRedIconWithBackgroundColorOf(SK_ColorBLACK)); + EXPECT_EQ(group.background_color(), + sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_BLACK); + EXPECT_EQ(group.hue(), red_hue); + + // Test a red icon with a white background color. + group = AppIconColorCache::GetInstance().GetIconColorForApp( + "test_app2", GetRedIconWithBackgroundColorOf(SK_ColorWHITE)); + EXPECT_EQ(group.background_color(), + sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_WHITE); + EXPECT_EQ(group.hue(), red_hue); + + // Test a red icon with a red background color. + group = AppIconColorCache::GetInstance().GetIconColorForApp( + "test_app3", GetRedIconWithBackgroundColorOf(SK_ColorRED)); + EXPECT_EQ(group.background_color(), + sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_RED); + EXPECT_EQ(group.hue(), red_hue); + + // Test a red icon with a yellow background color. + group = AppIconColorCache::GetInstance().GetIconColorForApp( + "test_app4", GetRedIconWithBackgroundColorOf(SK_ColorYELLOW)); + EXPECT_EQ(group.background_color(), + sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_YELLOW); + EXPECT_EQ(group.hue(), red_hue); + + // Test a red icon with a green background color. + group = AppIconColorCache::GetInstance().GetIconColorForApp( + "test_app5", GetRedIconWithBackgroundColorOf(SK_ColorGREEN)); + EXPECT_EQ(group.background_color(), + sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_GREEN); + EXPECT_EQ(group.hue(), red_hue); + + // Test a red icon with a blue background color. + group = AppIconColorCache::GetInstance().GetIconColorForApp( + "test_app6", GetRedIconWithBackgroundColorOf(SK_ColorBLUE)); + EXPECT_EQ(group.background_color(), + sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_BLUE); + EXPECT_EQ(group.hue(), red_hue); + + // Test a red icon with a magenta background color. + group = AppIconColorCache::GetInstance().GetIconColorForApp( + "test_app7", GetRedIconWithBackgroundColorOf(SK_ColorMAGENTA)); + EXPECT_EQ(group.background_color(), + sync_pb::AppListSpecifics::ColorGroup:: + AppListSpecifics_ColorGroup_COLOR_MAGENTA); + EXPECT_EQ(group.hue(), red_hue); +} + } // namespace ash
diff --git a/chrome/browser/ui/ash/ash_test_util.cc b/chrome/browser/ui/ash/ash_test_util.cc index 4b30b22f..1a9ec7aa 100644 --- a/chrome/browser/ui/ash/ash_test_util.cc +++ b/chrome/browser/ui/ash/ash_test_util.cc
@@ -12,6 +12,11 @@ #include "chrome/browser/ash/file_manager/path_util.h" #include "storage/browser/file_system/external_mount_points.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/aura/window.h" +#include "ui/events/test/event_generator.h" +#include "ui/gfx/geometry/rect.h" +#include "ui/views/view.h" +#include "ui/views/widget/widget.h" namespace ash::test { @@ -26,8 +31,19 @@ return result; } +aura::Window* GetRootWindow(const views::View* view) { + return view->GetWidget()->GetNativeWindow()->GetRootWindow(); +} + } // namespace +void Click(const views::View* view, int flags) { + ui::test::EventGenerator event_generator(GetRootWindow(view)); + event_generator.set_flags(flags); + event_generator.MoveMouseTo(view->GetBoundsInScreen().CenterPoint()); + event_generator.ClickLeftButton(); +} + base::FilePath CreateFile(Profile* profile, const std::string& extension) { const base::FilePath file_path = GetDownloadsPath(profile).Append(base::StrCat( @@ -48,4 +64,9 @@ return file_path; } +void MoveMouseTo(const views::View* view, size_t count) { + ui::test::EventGenerator(GetRootWindow(view)) + .MoveMouseTo(view->GetBoundsInScreen().CenterPoint(), count); +} + } // namespace ash::test
diff --git a/chrome/browser/ui/ash/ash_test_util.h b/chrome/browser/ui/ash/ash_test_util.h index da9d1a1..e6d9d597 100644 --- a/chrome/browser/ui/ash/ash_test_util.h +++ b/chrome/browser/ui/ash/ash_test_util.h
@@ -7,20 +7,32 @@ #include <string> +#include "ui/events/event_constants.h" + class Profile; namespace base { class FilePath; } // namespace base +namespace views { +class View; +} // namespace views + namespace ash::test { +// Performs a click on `view` with optional `flags`. +void Click(const views::View* view, int flags = ui::EF_NONE); + // Creates a file at the root of the downloads mount point with the specified // `extension`. The default extension is "txt". Returns the path of the created // file. base::FilePath CreateFile(Profile* profile, const std::string& extension = "txt"); +// Moves mouse to `view` over `count` number of events. `count` is 1 by default. +void MoveMouseTo(const views::View* view, size_t count = 1u); + } // namespace ash::test #endif // CHROME_BROWSER_UI_ASH_ASH_TEST_UTIL_H_
diff --git a/chrome/browser/ui/ash/capture_mode/capture_mode_browsertest.cc b/chrome/browser/ui/ash/capture_mode/capture_mode_browsertest.cc index 9831ce93..2b66eb0 100644 --- a/chrome/browser/ui/ash/capture_mode/capture_mode_browsertest.cc +++ b/chrome/browser/ui/ash/capture_mode/capture_mode_browsertest.cc
@@ -912,13 +912,25 @@ } class CaptureModeVideoConferenceBrowserTests - : public CaptureModeCameraBrowserTests { + : public testing::WithParamInterface<bool>, + public CaptureModeCameraBrowserTests { public: - CaptureModeVideoConferenceBrowserTests() { - scoped_feature_list_.InitWithFeatures( - /*enabled_features=*/{ash::features::kVideoConference, - ash::features::kCameraEffectsSupportedByHardware}, - /*disabled_features=*/{}); + CaptureModeVideoConferenceBrowserTests() + : is_share_screen_icon_enabled_(GetParam()) { + if (is_share_screen_icon_enabled_) { + scoped_feature_list_.InitWithFeatures( + /*enabled_features=*/{ash::features::kVideoConference, + ash::features::kVcStopAllScreenShare, + ash::features:: + kCameraEffectsSupportedByHardware}, + /*disabled_features=*/{}); + } else { + scoped_feature_list_.InitWithFeatures( + /*enabled_features=*/{ash::features::kVideoConference, + ash::features:: + kCameraEffectsSupportedByHardware}, + /*disabled_features=*/{}); + } } CaptureModeVideoConferenceBrowserTests( const CaptureModeVideoConferenceBrowserTests&) = delete; @@ -957,11 +969,18 @@ ->GetAggregatedState(); } + protected: + const bool is_share_screen_icon_enabled_; + private: base::test::ScopedFeatureList scoped_feature_list_; }; -IN_PROC_BROWSER_TEST_F(CaptureModeVideoConferenceBrowserTests, +INSTANTIATE_TEST_SUITE_P(, // Empty to simplify gtest output + CaptureModeVideoConferenceBrowserTests, + testing::Bool()); + +IN_PROC_BROWSER_TEST_P(CaptureModeVideoConferenceBrowserTests, ManagerGetsUpdated) { // Test the initial state. ash::VideoConferenceMediaState state = @@ -992,7 +1011,8 @@ EXPECT_TRUE(video_conference_tray()->GetVisible()); EXPECT_TRUE(vc_tray_audio_icon()->GetVisible()); EXPECT_TRUE(vc_tray_camera_icon()->GetVisible()); - EXPECT_FALSE(vc_tray_screen_share_icon()->GetVisible()); + EXPECT_TRUE(!is_share_screen_icon_enabled_ || + !vc_tray_screen_share_icon()->GetVisible()); // Stop recording and expect the state to return back to the initial state, // and the VC tray buttons should be hidden. @@ -1012,5 +1032,6 @@ EXPECT_FALSE(video_conference_tray()->GetVisible()); EXPECT_FALSE(vc_tray_audio_icon()->GetVisible()); EXPECT_FALSE(vc_tray_camera_icon()->GetVisible()); - EXPECT_FALSE(vc_tray_screen_share_icon()->GetVisible()); + EXPECT_TRUE(!is_share_screen_icon_enabled_ || + !vc_tray_screen_share_icon()->GetVisible()); }
diff --git a/chrome/browser/ui/ash/download_status/DEPS b/chrome/browser/ui/ash/download_status/DEPS new file mode 100644 index 0000000..e654282 --- /dev/null +++ b/chrome/browser/ui/ash/download_status/DEPS
@@ -0,0 +1,5 @@ +specific_include_rules = { + "notification_display_client_browsertest\.cc": [ + "+ui/message_center/views", + ], +}
diff --git a/chrome/browser/ui/ash/download_status/holding_space_display_client_browsertest.cc b/chrome/browser/ui/ash/download_status/holding_space_display_client_browsertest.cc index 6611c070..10d2106 100644 --- a/chrome/browser/ui/ash/download_status/holding_space_display_client_browsertest.cc +++ b/chrome/browser/ui/ash/download_status/holding_space_display_client_browsertest.cc
@@ -15,6 +15,7 @@ #include "chrome/browser/ash/crosapi/crosapi_ash.h" #include "chrome/browser/ash/crosapi/crosapi_manager.h" #include "chrome/browser/ash/crosapi/download_status_updater_ash.h" +#include "chrome/browser/ui/ash/ash_test_util.h" #include "chrome/browser/ui/ash/download_status/display_test_util.h" #include "chrome/browser/ui/ash/holding_space/holding_space_browsertest_base.h" #include "chrome/browser/ui/ash/holding_space/holding_space_test_util.h" @@ -155,12 +156,12 @@ EXPECT_FALSE(secondary_label->GetVisible()); // Remove the download chip. - Click(download_chips[0]); + test::Click(download_chips[0]); RightClick(download_chips[0]); const views::MenuItemView* const menu_item = SelectMenuItemWithCommandId(HoldingSpaceCommandId::kRemoveItem); ASSERT_TRUE(menu_item); - Click(menu_item); + test::Click(menu_item); ASSERT_TRUE(test_api().GetDownloadChips().empty()); // Add a new in-progress download with the duplicate download guid.
diff --git a/chrome/browser/ui/ash/download_status/notification_display_client.cc b/chrome/browser/ui/ash/download_status/notification_display_client.cc index 71c07eb5..a86effe 100644 --- a/chrome/browser/ui/ash/download_status/notification_display_client.cc +++ b/chrome/browser/ui/ash/download_status/notification_display_client.cc
@@ -7,6 +7,8 @@ #include "ash/constants/ash_features.h" #include "ash/constants/notifier_catalogs.h" #include "base/check.h" +#include "base/containers/contains.h" +#include "base/functional/callback.h" #include "base/memory/scoped_refptr.h" #include "base/strings/strcat.h" #include "chrome/app/vector_icons/vector_icons.h" @@ -32,6 +34,31 @@ constexpr char kNotificationOrigin[] = "chrome://downloads"; +// DownloadNotificationDelegate ------------------------------------------------ + +class DownloadNotificationDelegate + : public message_center::NotificationDelegate { + public: + explicit DownloadNotificationDelegate( + base::RepeatingClosure on_closed_by_user_closure) + : on_closed_by_user_closure_(std::move(on_closed_by_user_closure)) {} + DownloadNotificationDelegate(const DownloadNotificationDelegate&) = delete; + DownloadNotificationDelegate& operator=(const DownloadNotificationDelegate&) = + delete; + + private: + // message_center::NotificationDelegate: + ~DownloadNotificationDelegate() override = default; + void Close(bool by_user) override { + if (by_user) { + on_closed_by_user_closure_.Run(); + } + } + + // Runs when the observed notification is closed by user. + base::RepeatingClosure on_closed_by_user_closure_; +}; + // Helpers --------------------------------------------------------------------- // NOTE: This function returns a non-empty string indicating the notification @@ -52,8 +79,10 @@ void NotificationDisplayClient::AddOrUpdate( const std::string& guid, const DisplayMetadata& display_metadata) { - // TODO(http://b/310691284): Avoid showing a notification if it has been - // closed. + // Do not show the notification if it has been closed by user. + if (base::Contains(notifications_closed_by_user_guids_, guid)) { + return; + } message_center::RichNotificationData rich_notification_data; rich_notification_data.should_make_spoken_feedback_for_popup_updates = false; @@ -75,18 +104,39 @@ kNotificationNotifierId, NotificationCatalogName::kDownloadNotification), rich_notification_data, - base::MakeRefCounted<message_center::NotificationDelegate>()); + base::MakeRefCounted<DownloadNotificationDelegate>(base::BindRepeating( + &NotificationDisplayClient::OnNotificationClosedByUser, + weak_ptr_factory_.GetWeakPtr(), guid))); notification.set_fullscreen_visibility( message_center::FullscreenVisibility::OVER_USER); NotificationDisplayService::GetForProfile(profile())->Display( NotificationHandler::Type::TRANSIENT, notification, /*metadata=*/nullptr); + + // TODO(http://b/306459683): Change this code after `DisplayMetadata` uses a + // data structure to represent download progress. + if (const absl::optional<int64_t>& received_bytes = + display_metadata.received_bytes; + received_bytes > 0 && received_bytes == display_metadata.total_bytes) { + // The download associated with `guid` completes. We no longer anticipate + // receiving download updates. Therefore, remove `guid` from the collection. + notifications_closed_by_user_guids_.erase(guid); + } } void NotificationDisplayClient::Remove(const std::string& guid) { + // The download associated with `guid` is removed. We no longer anticipate + // receiving download updates. Therefore, remove `guid` from the collection. + notifications_closed_by_user_guids_.erase(guid); + NotificationDisplayService::GetForProfile(profile())->Close( NotificationHandler::Type::TRANSIENT, GetNotificationIdFromGuid(guid)); } +void NotificationDisplayClient::OnNotificationClosedByUser( + const std::string& guid) { + notifications_closed_by_user_guids_.insert(guid); +} + } // namespace ash::download_status
diff --git a/chrome/browser/ui/ash/download_status/notification_display_client.h b/chrome/browser/ui/ash/download_status/notification_display_client.h index d8cd8598..5fccd2c 100644 --- a/chrome/browser/ui/ash/download_status/notification_display_client.h +++ b/chrome/browser/ui/ash/download_status/notification_display_client.h
@@ -5,8 +5,10 @@ #ifndef CHROME_BROWSER_UI_ASH_DOWNLOAD_STATUS_NOTIFICATION_DISPLAY_CLIENT_H_ #define CHROME_BROWSER_UI_ASH_DOWNLOAD_STATUS_NOTIFICATION_DISPLAY_CLIENT_H_ +#include <set> #include <string> +#include "base/memory/weak_ptr.h" #include "chrome/browser/ui/ash/download_status/display_client.h" class Profile; @@ -30,6 +32,17 @@ void AddOrUpdate(const std::string& guid, const DisplayMetadata& display_metadata) override; void Remove(const std::string& guid) override; + + // Called when the notification associated with `guid` is closed by user. + void OnNotificationClosedByUser(const std::string& guid); + + // A collection of the guids associated with the notifications closed by user. + // Used to prevent a notification closed by user from showing again. + // Add a new guid to this collection when a notification is closed by user. + // Remove a guid from this collection when the associated download ends. + std::set<std::string> notifications_closed_by_user_guids_; + + base::WeakPtrFactory<NotificationDisplayClient> weak_ptr_factory_{this}; }; } // namespace ash::download_status
diff --git a/chrome/browser/ui/ash/download_status/notification_display_client_browsertest.cc b/chrome/browser/ui/ash/download_status/notification_display_client_browsertest.cc index afc4e32..937a587c 100644 --- a/chrome/browser/ui/ash/download_status/notification_display_client_browsertest.cc +++ b/chrome/browser/ui/ash/download_status/notification_display_client_browsertest.cc
@@ -7,6 +7,14 @@ #include <utility> #include "ash/constants/ash_features.h" +#include "ash/root_window_controller.h" +#include "ash/shelf/shelf.h" +#include "ash/shell.h" +#include "ash/system/message_center/ash_message_popup_collection.h" +#include "ash/system/message_center/ash_notification_view.h" +#include "ash/system/notification_center/notification_center_tray.h" +#include "ash/system/status_area_widget.h" +#include "ash/test/view_drawn_waiter.h" #include "base/scoped_observation.h" #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" @@ -15,7 +23,10 @@ #include "chrome/browser/ash/crosapi/crosapi_manager.h" #include "chrome/browser/notifications/notification_display_service.h" #include "chrome/browser/notifications/notification_display_service_factory.h" +#include "chrome/browser/notifications/profile_notification.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" +#include "chrome/browser/ui/ash/ash_test_util.h" #include "chrome/browser/ui/ash/download_status/display_test_util.h" #include "chrome/test/base/in_process_browser_test.h" #include "chromeos/crosapi/mojom/download_status_updater.mojom.h" @@ -23,6 +34,8 @@ #include "mojo/public/cpp/bindings/remote.h" #include "testing/gmock/include/gmock/gmock.h" #include "ui/message_center/public/cpp/notification.h" +#include "ui/message_center/views/message_popup_view.h" +#include "ui/message_center/views/notification_control_buttons_view.h" namespace ash::download_status { @@ -154,6 +167,64 @@ EXPECT_THAT(GetDisplayedNotificationIds(), Contains(notification_id)); } +// Verifies that a download notification should not show again if it has been +// closed by user. +IN_PROC_BROWSER_TEST_F(NotificationDisplayClientBrowserTest, + DoNotShowAfterCloseByUser) { + std::string notification_id; + EXPECT_CALL(service_observer(), OnNotificationDisplayed) + .WillOnce(WithArg<0>( + [¬ification_id](const message_center::Notification& notification) { + notification_id = notification.id(); + })); + Profile* const profile = ProfileManager::GetActiveUserProfile(); + crosapi::mojom::DownloadStatusPtr download = + CreateInProgressDownloadStatus(profile, /*received_bytes=*/0, + /*target_bytes=*/1024); + Update(download->Clone()); + Mock::VerifyAndClearExpectations(&service_observer()); + + // Wait until `popup_collection` becomes idle. + AshMessagePopupCollection* const popup_collection = + Shell::GetPrimaryRootWindowController() + ->shelf() + ->GetStatusAreaWidget() + ->notification_center_tray() + ->popup_collection(); + base::test::TestFuture<void> future; + popup_collection->SetAnimationIdleClosureForTest(future.GetCallback()); + future.Get(); + + // NOTE: The notification ID associated with the view differs from + // `notification_id` as it incorporates the profile ID. + message_center::MessagePopupView* const popup_view = + popup_collection->GetPopupViewForNotificationID( + ProfileNotification::GetProfileNotificationId( + notification_id, ProfileNotification::GetProfileID(profile))); + ASSERT_TRUE(popup_view); + message_center::MessageView* const message_view = popup_view->message_view(); + ASSERT_TRUE(message_view); + + // Move mouse to `message_view` until `close_button` shows and then click + // `close_button` to remove the notification associated with + // `notification_id`. + test::MoveMouseTo(message_view); + views::View* const close_button = + views::AsViewClass<AshNotificationView>(message_view) + ->control_buttons_view_for_test() + ->close_button(); + ViewDrawnWaiter().Wait(close_button); + test::Click(close_button, ui::EF_NONE); + + // The notification associated with `notification_id` should not display. + EXPECT_THAT(GetDisplayedNotificationIds(), Not(Contains(notification_id))); + + // Update the same notification after closing. The closed notification should + // not show again. + Update(download->Clone()); + EXPECT_THAT(GetDisplayedNotificationIds(), Not(Contains(notification_id))); +} + // Verifies that when an in-progress download is interrupted, its notification // should be removed. IN_PROC_BROWSER_TEST_F(NotificationDisplayClientBrowserTest,
diff --git a/chrome/browser/ui/ash/holding_space/holding_space_test_util.cc b/chrome/browser/ui/ash/holding_space/holding_space_test_util.cc index 48e635c..faebea1 100644 --- a/chrome/browser/ui/ash/holding_space/holding_space_test_util.cc +++ b/chrome/browser/ui/ash/holding_space/holding_space_test_util.cc
@@ -21,14 +21,6 @@ namespace ash { -void Click(const views::View* view, int flags) { - ui::test::EventGenerator event_generator( - view->GetWidget()->GetNativeWindow()->GetRootWindow()); - event_generator.set_flags(flags); - event_generator.MoveMouseTo(view->GetBoundsInScreen().CenterPoint()); - event_generator.ClickLeftButton(); -} - std::vector<std::pair<HoldingSpaceItem::Type, base::FilePath>> GetSuggestionsInModel(const HoldingSpaceModel& model) { std::vector<std::pair<HoldingSpaceItem::Type, base::FilePath>>
diff --git a/chrome/browser/ui/ash/holding_space/holding_space_test_util.h b/chrome/browser/ui/ash/holding_space/holding_space_test_util.h index a025d63..5bd302a 100644 --- a/chrome/browser/ui/ash/holding_space/holding_space_test_util.h +++ b/chrome/browser/ui/ash/holding_space/holding_space_test_util.h
@@ -23,9 +23,6 @@ enum class HoldingSpaceCommandId; class HoldingSpaceModel; -// Performs a click on `view` with optional `flags`. -void Click(const views::View* view, int flags = ui::EF_NONE); - // Returns the suggestion items in `model`. std::vector<std::pair<HoldingSpaceItem::Type, base::FilePath>> GetSuggestionsInModel(const HoldingSpaceModel& model);
diff --git a/chrome/browser/ui/ash/holding_space/holding_space_ui_browsertest.cc b/chrome/browser/ui/ash/holding_space/holding_space_ui_browsertest.cc index 09b2aff..5cec145 100644 --- a/chrome/browser/ui/ash/holding_space/holding_space_ui_browsertest.cc +++ b/chrome/browser/ui/ash/holding_space/holding_space_ui_browsertest.cc
@@ -56,6 +56,7 @@ #include "chrome/browser/download/download_core_service.h" #include "chrome/browser/download/download_core_service_factory.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/ash/ash_test_util.h" #include "chrome/browser/ui/ash/holding_space/holding_space_browsertest_base.h" #include "chrome/browser/ui/ash/holding_space/holding_space_downloads_delegate.h" #include "chrome/browser/ui/ash/holding_space/holding_space_keyed_service_factory.h" @@ -234,13 +235,6 @@ std::move(after_release_callback).Run(); } -// Moves mouse to `view` over `count` number of events. -void MoveMouseToView(const views::View* view, size_t count = 1u) { - auto* root_window = HoldingSpaceBrowserTestBase::GetRootWindowForNewWindows(); - ui::test::EventGenerator event_generator(root_window); - event_generator.MoveMouseTo(view->GetBoundsInScreen().CenterPoint(), count); -} - // Waits for the specified `label` to have the desired `text`. void WaitForText(views::Label* label, const std::u16string& text) { if (label->GetText() == text) @@ -966,7 +960,7 @@ // context menu, still without de-selecting the in-progress download. Because // the selection contains items which are not in-progress and at least one of // those items are unpinned, the selection should be pin-able. - Click(pinned_file_chips.front(), ui::EF_CONTROL_DOWN); + test::Click(pinned_file_chips.front(), ui::EF_CONTROL_DOWN); RightClick(download_chips.front()); ASSERT_TRUE(SelectMenuItemWithCommandId(HoldingSpaceCommandId::kPinItem)); PressAndReleaseKey(ui::KeyboardCode::VKEY_RETURN); @@ -1070,7 +1064,7 @@ // Add a download item to the selection and show the context menu. ViewDrawnWaiter().Wait(download_chips.front()); - Click(download_chips.front(), ui::EF_CONTROL_DOWN); + test::Click(download_chips.front(), ui::EF_CONTROL_DOWN); RightClick(download_chips.front()); ASSERT_TRUE(views::MenuController::GetActiveInstance()); @@ -1082,7 +1076,7 @@ ASSERT_FALSE(views::MenuController::GetActiveInstance()); // Unselect the pinned item and right click show the context menu. - Click(pinned_file_chips.front(), ui::EF_CONTROL_DOWN); + test::Click(pinned_file_chips.front(), ui::EF_CONTROL_DOWN); RightClick(download_chips.front()); ASSERT_TRUE(views::MenuController::GetActiveInstance()); @@ -1125,7 +1119,7 @@ // Select a screen capture item and show the context menu. ViewDrawnWaiter().Wait(screen_capture_views.front()); - Click(screen_capture_views.front()); + test::Click(screen_capture_views.front()); RightClick(screen_capture_views.front()); ASSERT_TRUE(views::MenuController::GetActiveInstance()); @@ -1164,13 +1158,13 @@ // Select all visible download items. for (views::View* download_chip : download_chips) { ViewDrawnWaiter().Wait(download_chip); - Click(download_chip, ui::EF_CONTROL_DOWN); + test::Click(download_chip, ui::EF_CONTROL_DOWN); } // Select all visible screen capture items. for (views::View* screen_capture_view : screen_capture_views) { ViewDrawnWaiter().Wait(screen_capture_view); - Click(screen_capture_view, ui::EF_CONTROL_DOWN); + test::Click(screen_capture_view, ui::EF_CONTROL_DOWN); } // Show the context menu. There should be a `kRemoveItem` command. @@ -1252,11 +1246,11 @@ // so move the mouse and wait for the pin button to be drawn. Note that the // mouse is moved over multiple events to ensure that the appropriate mouse // enter event is also generated. - MoveMouseToView(pinned_file_chip, /*count=*/10); + test::MoveMouseTo(pinned_file_chip, /*count=*/10); auto* pin_btn = pinned_file_chip->GetViewByID(kHoldingSpaceItemPinButtonId); ViewDrawnWaiter().Wait(pin_btn); - Click(pin_btn); + test::Click(pin_btn); pinned_file_chips = test_api().GetPinnedFileChips(); ASSERT_EQ(kNumPinnedItems - 1, pinned_file_chips.size()); @@ -2472,7 +2466,7 @@ // selected and its underlying download is in-progress, the context menu // should contain a "Cancel" command. PressAndReleaseKey(ui::KeyboardCode::VKEY_ESCAPE); - Click(in_progress_download_chip); + test::Click(in_progress_download_chip); RightClick(in_progress_download_chip); ASSERT_TRUE(SelectMenuItemWithCommandId(HoldingSpaceCommandId::kCancelItem)); @@ -2537,7 +2531,7 @@ // Hover over the `completed_download_chip`. Because the underlying download // is completed, the chip should contain a visible primary action for "Pin". - MoveMouseToView(completed_download_chip, /*count=*/10); + test::MoveMouseTo(completed_download_chip, /*count=*/10); auto* primary_action_container = completed_download_chip->GetViewByID( kHoldingSpaceItemPrimaryActionContainerId); auto* primary_action_cancel = @@ -2551,7 +2545,7 @@ // Hover over the `in_progress_download_chip`. Because the underlying download // is in-progress, the chip should contain a visible primary action for // "Cancel". - MoveMouseToView(in_progress_download_chip, /*count=*/10); + test::MoveMouseTo(in_progress_download_chip, /*count=*/10); primary_action_container = in_progress_download_chip->GetViewByID( kHoldingSpaceItemPrimaryActionContainerId); primary_action_cancel = @@ -2584,7 +2578,7 @@ ASSERT_EQ(items[0]->id(), in_progress_download_id); run_loop.Quit(); }); - Click(primary_action_container); + test::Click(primary_action_container); run_loop.Run(); // Verify that there is now only a single download chip. @@ -2712,7 +2706,7 @@ // selected and its underlying download is completed, the context menu should // contain a "Remove" command. PressAndReleaseKey(ui::KeyboardCode::VKEY_ESCAPE); - Click(completed_download_chip); + test::Click(completed_download_chip); RightClick(completed_download_chip); ASSERT_TRUE(SelectMenuItemWithCommandId(HoldingSpaceCommandId::kRemoveItem)); @@ -2838,7 +2832,7 @@ // selected and its underlying download is in-progress, the context menu // should contain a "Pause" or "Resume" command. PressAndReleaseKey(ui::KeyboardCode::VKEY_ESCAPE); - Click(in_progress_download_chip); + test::Click(in_progress_download_chip); RightClick(in_progress_download_chip); ASSERT_TRUE(SelectMenuItemWithCommandId(GetPauseOrResumeCommandId())); @@ -2906,7 +2900,7 @@ // Hover over the `completed_download_chip`. Because the underlying download // is completed, the chip should not contain a visible secondary action. - MoveMouseToView(completed_download_chip, /*count=*/10); + test::MoveMouseTo(completed_download_chip, /*count=*/10); ASSERT_FALSE(completed_download_chip ->GetViewByID(kHoldingSpaceItemSecondaryActionContainerId) ->GetVisible()); @@ -2914,7 +2908,7 @@ // Hover over the `in_progress_download_chip`. Because the underlying download // is in-progress, the chip should contain a visible secondary action for // either "Pause" or "Resume", depending on test parameterization. - MoveMouseToView(in_progress_download_chip, /*count=*/10); + test::MoveMouseTo(in_progress_download_chip, /*count=*/10); auto* secondary_action_container = in_progress_download_chip->GetViewByID( kHoldingSpaceItemSecondaryActionContainerId); auto* secondary_action_pause = @@ -2946,7 +2940,7 @@ HoldingSpaceModelObserver::UpdatedField::kInProgressCommands); run_loop.Quit(); }); - Click(secondary_action_container); + test::Click(secondary_action_container); run_loop.Run(); // Verify that there are still two download chips. @@ -3163,7 +3157,7 @@ // Select two suggestion chips and open context menu. ASSERT_FALSE(views::MenuController::GetActiveInstance()); - Click(suggestion_chips.front(), ui::EF_CONTROL_DOWN); + test::Click(suggestion_chips.front(), ui::EF_CONTROL_DOWN); RightClick(suggestion_chips[1], ui::EF_CONTROL_DOWN); ASSERT_TRUE(views::MenuController::GetActiveInstance()); @@ -3171,7 +3165,7 @@ auto* menu_item = SelectMenuItemWithCommandId(HoldingSpaceCommandId::kRemoveItem); ASSERT_TRUE(menu_item); - Click(menu_item); + test::Click(menu_item); WaitForSuggestionsInModel( model, /*expected_suggestions=*/{ {HoldingSpaceItem::Type::kLocalSuggestion, file_paths[0]}}); @@ -3184,7 +3178,7 @@ ASSERT_TRUE(views::MenuController::GetActiveInstance()); menu_item = SelectMenuItemWithCommandId(HoldingSpaceCommandId::kRemoveItem); ASSERT_TRUE(menu_item); - Click(menu_item); + test::Click(menu_item); // There should not be any suggestion item view left. EXPECT_EQ(test_api().GetSuggestionChips().size(), 0u);
diff --git a/chrome/browser/ui/ash/network/network_portal_notification_controller.cc b/chrome/browser/ui/ash/network/network_portal_notification_controller.cc index c45b518..eb303c3 100644 --- a/chrome/browser/ui/ash/network/network_portal_notification_controller.cc +++ b/chrome/browser/ui/ash/network/network_portal_notification_controller.cc
@@ -27,6 +27,7 @@ #include "chrome/browser/notifications/system_notification_helper.h" #include "chrome/browser/ui/ash/network/network_portal_signin_controller.h" #include "chrome/grit/generated_resources.h" +#include "chromeos/ash/components/network/network_event_log.h" #include "chromeos/ash/components/network/network_handler.h" #include "chromeos/ash/components/network/network_state.h" #include "chromeos/ash/components/network/network_state_handler.h" @@ -44,6 +45,12 @@ const char kNotifierNetworkPortalDetector[] = "ash.network.portal-detector"; +bool IsPortalState(NetworkState::PortalState portal_state) { + return portal_state == NetworkState::PortalState::kPortal || + portal_state == NetworkState::PortalState::kPortalSuspected || + portal_state == NetworkState::PortalState::kProxyAuthRequired; +} + std::unique_ptr<message_center::Notification> CreateNotification( const NetworkState* network, scoped_refptr<message_center::NotificationDelegate> delegate, @@ -119,6 +126,7 @@ void NotificationDelegateImpl::Click( const absl::optional<int>& button_index, const absl::optional<std::u16string>& reply) { + NET_LOG(USER) << "Captive Portal notification: Click"; NetworkPortalSigninController::Get()->ShowSignin( NetworkPortalSigninController::SigninSource::kNotification); CloseNotification(); @@ -146,10 +154,11 @@ void NetworkPortalNotificationController::PortalStateChanged( const NetworkState* network, NetworkState::PortalState portal_state) { - if (!network || - (portal_state != NetworkState::PortalState::kPortal && - portal_state != NetworkState::PortalState::kPortalSuspected && - portal_state != NetworkState::PortalState::kProxyAuthRequired)) { + if (!network || !IsPortalState(portal_state)) { + if (!last_network_guid_.empty() && IsPortalState(last_portal_state_)) { + NET_LOG(EVENT) << "Captive Portal notification: Close for " + << last_network_guid_; + } last_network_guid_.clear(); last_portal_state_ = portal_state; @@ -166,8 +175,10 @@ } // Don't do anything if we're currently activating the device. - if (MobileActivator::GetInstance()->RunningActivation()) + if (MobileActivator::GetInstance()->RunningActivation()) { + NET_LOG(EVENT) << "Captive Portal notification: Skip (mobile activation)"; return; + } // Don't do anything if notification for |network| already was // displayed with the same portal_state. @@ -178,6 +189,8 @@ last_network_guid_ = network->guid(); last_portal_state_ = portal_state; + NET_LOG(EVENT) << "Captive Portal notification: Show for " + << NetworkId(network) << " PortalState: " << portal_state; base::UmaHistogramEnumeration("Network.NetworkPortalNotificationState", portal_state);
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc index 1c0bbb95..3e4f480 100644 --- a/chrome/browser/ui/browser_navigator.cc +++ b/chrome/browser/ui/browser_navigator.cc
@@ -41,6 +41,7 @@ #include "chrome/browser/web_applications/web_app_helpers.h" #include "chrome/common/url_constants.h" #include "components/captive_portal/core/buildflags.h" +#include "components/constrained_window/constrained_window_views.h" #include "components/no_state_prefetch/browser/no_state_prefetch_manager.h" #include "components/password_manager/content/common/web_ui_constants.h" #include "components/policy/core/common/policy_pref_names.h" @@ -503,9 +504,19 @@ ~ScopedBrowserShower() { BrowserWindow* window = params_->browser->window(); if (params_->window_action == NavigateParams::SHOW_WINDOW_INACTIVE) { + // TODO(crbug.com/1490267): investigate if SHOW_WINDOW_INACTIVE needs to + // be supported for tab modal popups. + CHECK_EQ(params_->is_tab_modal_popup, false); window->ShowInactive(); } else if (params_->window_action == NavigateParams::SHOW_WINDOW) { - window->Show(); + if (params_->is_tab_modal_popup) { + CHECK_EQ(params_->disposition, WindowOpenDisposition::NEW_POPUP); + CHECK_NE(source_contents_, nullptr); + constrained_window::ShowModalDialog(window->GetNativeWindow(), + source_contents_); + } else { + window->Show(); + } // If a user gesture opened a popup window, focus the contents. if (params_->user_gesture && (params_->disposition == WindowOpenDisposition::NEW_POPUP || @@ -518,9 +529,14 @@ } } + void set_source_contents(content::WebContents* source_contents) { + source_contents_ = source_contents; + } + private: raw_ptr<NavigateParams> params_; raw_ptr<content::WebContents*> contents_; + raw_ptr<content::WebContents> source_contents_; }; std::unique_ptr<content::WebContents> CreateTargetContents( @@ -795,6 +811,9 @@ // Make sure the Browser is shown if params call for it. ScopedBrowserShower shower(params, &contents_to_navigate_or_insert); + if (params->is_tab_modal_popup) { + shower.set_source_contents(params->source_contents); + } // Makes sure any WebContents created by this function is destroyed if // not properly added to a tab strip.
diff --git a/chrome/browser/ui/browser_navigator_browsertest.cc b/chrome/browser/ui/browser_navigator_browsertest.cc index 2229ce4f..4e186ea 100644 --- a/chrome/browser/ui/browser_navigator_browsertest.cc +++ b/chrome/browser/ui/browser_navigator_browsertest.cc
@@ -646,6 +646,33 @@ } #endif +// This test verifies that navigating with WindowOpenDisposition = NEW_POPUP +// and is_tab_modal_popup = true results in a new WebContents that is a popup +// and behaves like a tab modal. +IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, Disposition_NewPopupTabModal) { + NavigateParams params(MakeNavigateParams()); + params.disposition = WindowOpenDisposition::NEW_POPUP; + params.is_tab_modal_popup = true; + params.window_features.bounds = gfx::Rect(0, 0, 200, 200); + // Wait for new popup to to load and gain focus. + ui_test_utils::NavigateToURL(¶ms); + + // Add a new tab. + chrome::AddTabAt(browser(), GURL("about:blank"), -1, true); + + // Switch to the new tab. + browser()->tab_strip_model()->ActivateTabAt(1); + + // Verify the popup window is hidden. + EXPECT_FALSE(params.browser->window()->IsVisible()); + + // Switch back to the original tab. + browser()->tab_strip_model()->ActivateTabAt(0); + + // Verify the popup window is visible again. + EXPECT_TRUE(params.browser->window()->IsVisible()); +} + // This test verifies that navigating with WindowOpenDisposition = NEW_WINDOW // always opens a new window. IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, Disposition_NewWindow) {
diff --git a/chrome/browser/ui/browser_navigator_params.h b/chrome/browser/ui/browser_navigator_params.h index 40c7d61..22530b9 100644 --- a/chrome/browser/ui/browser_navigator_params.h +++ b/chrome/browser/ui/browser_navigator_params.h
@@ -238,6 +238,10 @@ // true, |disposition| should be NEW_POPUP. bool is_captive_portal_popup = false; + // Whether the browser popup is being created as a tab modal. If true, + // `disposition` should be NEW_POPUP. + bool is_tab_modal_popup = false; + // If false then the navigation was not initiated by a user gesture. bool user_gesture = true;
diff --git a/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm b/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm index 0b186fd9a..7139810 100644 --- a/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm +++ b/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm
@@ -134,8 +134,7 @@ if (profile) *profile = browser->profile(); ExtensionRegistry* registry = ExtensionRegistry::Get(browser->profile()); - const Extension* extension = - registry->GetExtensionById(app_id, ExtensionRegistry::ENABLED); + const Extension* extension = registry->enabled_extensions().GetByID(app_id); if (extension && (extension->is_platform_app() || extension->is_hosted_app())) { return extension;
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc index aa744d2..c3caee23 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -278,6 +278,7 @@ {ContentSettingsType::SOUND, IDS_BLOCKED_SOUND_TITLE}, {ContentSettingsType::CLIPBOARD_READ_WRITE, IDS_BLOCKED_CLIPBOARD_TITLE}, {ContentSettingsType::GEOLOCATION, IDS_BLOCKED_GEOLOCATION_TITLE}, + {ContentSettingsType::MIDI, IDS_BLOCKED_MIDI_TITLE}, {ContentSettingsType::MIDI_SYSEX, IDS_BLOCKED_MIDI_SYSEX_TITLE}, {ContentSettingsType::SENSORS, IDS_BLOCKED_SENSORS_TITLE}, }; @@ -286,6 +287,7 @@ {ContentSettingsType::COOKIES, IDS_ACCESSED_ON_DEVICE_SITE_DATA_TITLE}, {ContentSettingsType::CLIPBOARD_READ_WRITE, IDS_ALLOWED_CLIPBOARD_TITLE}, {ContentSettingsType::GEOLOCATION, IDS_ALLOWED_GEOLOCATION_TITLE}, + {ContentSettingsType::MIDI, IDS_ALLOWED_MIDI_TITLE}, {ContentSettingsType::MIDI_SYSEX, IDS_ALLOWED_MIDI_SYSEX_TITLE}, {ContentSettingsType::SENSORS, IDS_ALLOWED_SENSORS_TITLE}, }; @@ -315,6 +317,7 @@ {ContentSettingsType::MIXEDSCRIPT, IDS_BLOCKED_DISPLAYING_INSECURE_CONTENT}, {ContentSettingsType::GEOLOCATION, IDS_BLOCKED_GEOLOCATION_MESSAGE}, + {ContentSettingsType::MIDI, IDS_BLOCKED_MIDI_MESSAGE}, {ContentSettingsType::MIDI_SYSEX, IDS_BLOCKED_MIDI_SYSEX_MESSAGE}, {ContentSettingsType::CLIPBOARD_READ_WRITE, IDS_BLOCKED_CLIPBOARD_MESSAGE}, @@ -327,6 +330,7 @@ const ContentSettingsTypeIdEntry kAccessedMessageIDs[] = { {ContentSettingsType::COOKIES, IDS_ACCESSED_ON_DEVICE_SITE_DATA_MESSAGE}, {ContentSettingsType::GEOLOCATION, IDS_ALLOWED_GEOLOCATION_MESSAGE}, + {ContentSettingsType::MIDI, IDS_ALLOWED_MIDI_MESSAGE}, {ContentSettingsType::MIDI_SYSEX, IDS_ALLOWED_MIDI_SYSEX_MESSAGE}, {ContentSettingsType::CLIPBOARD_READ_WRITE, IDS_ALLOWED_CLIPBOARD_MESSAGE}, @@ -627,6 +631,7 @@ {ContentSettingsType::POPUPS, IDS_BLOCKED_POPUPS_REDIRECTS_UNBLOCK}, {ContentSettingsType::SOUND, IDS_BLOCKED_SOUND_UNBLOCK}, {ContentSettingsType::GEOLOCATION, IDS_BLOCKED_GEOLOCATION_UNBLOCK}, + {ContentSettingsType::MIDI, IDS_BLOCKED_MIDI_UNBLOCK}, {ContentSettingsType::MIDI_SYSEX, IDS_BLOCKED_MIDI_SYSEX_UNBLOCK}, {ContentSettingsType::CLIPBOARD_READ_WRITE, IDS_BLOCKED_CLIPBOARD_UNBLOCK}, @@ -636,6 +641,7 @@ static const ContentSettingsTypeIdEntry kAllowedAllowIDs[] = { {ContentSettingsType::COOKIES, IDS_ALLOWED_ON_DEVICE_SITE_DATA_NO_ACTION}, {ContentSettingsType::GEOLOCATION, IDS_ALLOWED_GEOLOCATION_NO_ACTION}, + {ContentSettingsType::MIDI, IDS_ALLOWED_MIDI_NO_ACTION}, {ContentSettingsType::MIDI_SYSEX, IDS_ALLOWED_MIDI_SYSEX_NO_ACTION}, {ContentSettingsType::CLIPBOARD_READ_WRITE, IDS_ALLOWED_CLIPBOARD_NO_ACTION}, @@ -664,6 +670,7 @@ {ContentSettingsType::POPUPS, IDS_BLOCKED_POPUPS_REDIRECTS_NO_ACTION}, {ContentSettingsType::SOUND, IDS_BLOCKED_SOUND_NO_ACTION}, {ContentSettingsType::GEOLOCATION, IDS_BLOCKED_GEOLOCATION_NO_ACTION}, + {ContentSettingsType::MIDI, IDS_BLOCKED_MIDI_NO_ACTION}, {ContentSettingsType::MIDI_SYSEX, IDS_BLOCKED_MIDI_SYSEX_NO_ACTION}, {ContentSettingsType::CLIPBOARD_READ_WRITE, IDS_BLOCKED_CLIPBOARD_NO_ACTION}, @@ -672,6 +679,7 @@ static const ContentSettingsTypeIdEntry kAllowedBlockIDs[] = { {ContentSettingsType::COOKIES, IDS_ALLOWED_ON_DEVICE_SITE_DATA_BLOCK}, {ContentSettingsType::GEOLOCATION, IDS_ALLOWED_GEOLOCATION_BLOCK}, + {ContentSettingsType::MIDI, IDS_ALLOWED_MIDI_BLOCK}, {ContentSettingsType::MIDI_SYSEX, IDS_ALLOWED_MIDI_SYSEX_BLOCK}, {ContentSettingsType::CLIPBOARD_READ_WRITE, IDS_ALLOWED_CLIPBOARD_BLOCK}, {ContentSettingsType::SENSORS, IDS_ALLOWED_SENSORS_BLOCK}, @@ -1855,6 +1863,7 @@ case ContentSettingsType::JAVASCRIPT: case ContentSettingsType::SOUND: case ContentSettingsType::CLIPBOARD_READ_WRITE: + case ContentSettingsType::MIDI: case ContentSettingsType::MIDI_SYSEX: case ContentSettingsType::SENSORS: return std::make_unique<ContentSettingSingleRadioGroup>(
diff --git a/chrome/browser/ui/content_settings/content_setting_image_model.cc b/chrome/browser/ui/content_settings/content_setting_image_model.cc index 3c59ba4..76a4111 100644 --- a/chrome/browser/ui/content_settings/content_setting_image_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_image_model.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/content_settings/content_setting_image_model.h" +#include <optional> #include <string> #include <utility> @@ -36,6 +37,7 @@ #include "components/content_settings/browser/page_specific_content_settings.h" #include "components/content_settings/core/browser/cookie_settings.h" #include "components/content_settings/core/browser/host_content_settings_map.h" +#include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings_types.h" #include "components/content_settings/core/common/features.h" #include "components/no_state_prefetch/browser/no_state_prefetch_manager.h" @@ -45,6 +47,7 @@ #include "components/strings/grit/components_strings.h" #include "components/vector_icons/vector_icons.h" #include "content/public/browser/web_contents.h" +#include "content/public/common/content_features.h" #include "net/base/schemeful_site.h" #include "services/device/public/cpp/device_features.h" #include "services/device/public/cpp/geolocation/geolocation_manager.h" @@ -133,6 +136,17 @@ bool UpdateAndGetVisibility(WebContents* web_contents) override; }; +class ContentSettingMIDIImageModel : public ContentSettingSimpleImageModel { + public: + ContentSettingMIDIImageModel(); + + ContentSettingMIDIImageModel(const ContentSettingMIDIImageModel&) = delete; + ContentSettingMIDIImageModel& operator=(const ContentSettingMIDIImageModel&) = + delete; + + bool UpdateAndGetVisibility(WebContents* web_contents) override; +}; + class ContentSettingMIDISysExImageModel : public ContentSettingSimpleImageModel { public: @@ -331,6 +345,7 @@ *icon = blocked ? &vector_icons::kProtocolHandlerOffChromeRefreshIcon : &vector_icons::kProtocolHandlerChromeRefreshIcon; return; + case ContentSettingsType::MIDI: case ContentSettingsType::MIDI_SYSEX: *icon = blocked ? &vector_icons::kMidiOffChromeRefreshIcon : &vector_icons::kMidiChromeRefreshIcon; @@ -416,6 +431,7 @@ case ContentSettingsType::PROTOCOL_HANDLERS: *icon = &vector_icons::kProtocolHandlerIcon; return; + case ContentSettingsType::MIDI: case ContentSettingsType::MIDI_SYSEX: *icon = &vector_icons::kMidiIcon; return; @@ -449,6 +465,41 @@ } } +std::optional<ContentSettingsType> WhichMidiShouldDisplay( + PageSpecificContentSettings* content_settings) { + // MIDI and MIDI-SysEx should be mutually exclusive in their display. + // The precedence logic: + // * Always show the allowed permission over the blocked one. + // * Always show the more dangerous permission (MIDI-SysEx) over the less + // dangerous permission (MIDI). + const bool is_midi_allowed = + content_settings->IsContentAllowed(ContentSettingsType::MIDI); + const bool is_midi_blocked = + content_settings->IsContentBlocked(ContentSettingsType::MIDI); + const bool is_sysex_allowed = + content_settings->IsContentAllowed(ContentSettingsType::MIDI_SYSEX); + const bool is_sysex_blocked = + content_settings->IsContentBlocked(ContentSettingsType::MIDI_SYSEX); + + if (is_sysex_allowed) { + return ContentSettingsType::MIDI_SYSEX; + } + + if (is_midi_allowed) { + return ContentSettingsType::MIDI; + } + + if (is_midi_blocked) { + return ContentSettingsType::MIDI; + } + + if (is_sysex_blocked) { + return ContentSettingsType::MIDI_SYSEX; + } + + return std::nullopt; +} + } // namespace // Single content setting ------------------------------------------------------ @@ -513,6 +564,8 @@ return std::make_unique<ContentSettingNotificationsImageModel>(); case ImageType::STORAGE_ACCESS: return std::make_unique<ContentSettingStorageAccessImageModel>(); + case ImageType::MIDI: + return std::make_unique<ContentSettingMIDIImageModel>(); case ImageType::NUM_IMAGE_TYPES: break; @@ -851,6 +904,37 @@ return true; } +// MIDI ------------------------------------------------------------------------ + +ContentSettingMIDIImageModel::ContentSettingMIDIImageModel() + : ContentSettingSimpleImageModel(ImageType::MIDI, + ContentSettingsType::MIDI) {} + +bool ContentSettingMIDIImageModel::UpdateAndGetVisibility( + WebContents* web_contents) { + if (!base::FeatureList::IsEnabled(features::kBlockMidiByDefault)) { + return false; + } + + PageSpecificContentSettings* content_settings = + PageSpecificContentSettings::GetForFrame( + web_contents->GetPrimaryMainFrame()); + if (!content_settings) { + return false; + } + + if (WhichMidiShouldDisplay(content_settings) != ContentSettingsType::MIDI) { + return false; + } + + const bool is_allowed = + content_settings->IsContentAllowed(ContentSettingsType::MIDI); + SetIcon(ContentSettingsType::MIDI, /*blocked=*/!is_allowed); + set_tooltip(l10n_util::GetStringUTF16(is_allowed ? IDS_ALLOWED_MIDI_MESSAGE + : IDS_BLOCKED_MIDI_MESSAGE)); + return true; +} + // MIDI SysEx ------------------------------------------------------------------ ContentSettingMIDISysExImageModel::ContentSettingMIDISysExImageModel() @@ -865,13 +949,21 @@ if (!content_settings) return false; - bool is_allowed = + const bool is_allowed = content_settings->IsContentAllowed(ContentSettingsType::MIDI_SYSEX); - bool is_blocked = + const bool is_blocked = content_settings->IsContentBlocked(ContentSettingsType::MIDI_SYSEX); - if (!is_allowed && !is_blocked) - return false; + if (base::FeatureList::IsEnabled(features::kBlockMidiByDefault)) { + if (WhichMidiShouldDisplay(content_settings) != + ContentSettingsType::MIDI_SYSEX) { + return false; + } + } else { + if (!is_allowed && !is_blocked) { + return false; + } + } SetIcon(ContentSettingsType::MIDI_SYSEX, /*blocked=*/!is_allowed); set_tooltip(l10n_util::GetStringUTF16(is_allowed @@ -1357,6 +1449,7 @@ ImageType::SENSORS, ImageType::ADS, ImageType::AUTOMATIC_DOWNLOADS, + ImageType::MIDI, ImageType::MIDI_SYSEX, ImageType::SOUND, ImageType::FRAMEBUST, @@ -1366,8 +1459,13 @@ }; std::vector<std::unique_ptr<ContentSettingImageModel>> result; - for (auto type : kContentSettingImageOrder) + for (auto type : kContentSettingImageOrder) { + if (!base::FeatureList::IsEnabled(features::kBlockMidiByDefault) && + type == ImageType::MIDI) { + continue; + } result.push_back(CreateForContentType(type)); + } return result; }
diff --git a/chrome/browser/ui/content_settings/content_setting_image_model.h b/chrome/browser/ui/content_settings/content_setting_image_model.h index bd257366..d88910e 100644 --- a/chrome/browser/ui/content_settings/content_setting_image_model.h +++ b/chrome/browser/ui/content_settings/content_setting_image_model.h
@@ -51,6 +51,7 @@ NOTIFICATIONS_QUIET_PROMPT = 17, CLIPBOARD_READ_WRITE = 18, STORAGE_ACCESS = 19, + MIDI = 20, NUM_IMAGE_TYPES };
diff --git a/chrome/browser/ui/extensions/application_launch.cc b/chrome/browser/ui/extensions/application_launch.cc index b840910..b440fe66 100644 --- a/chrome/browser/ui/extensions/application_launch.cc +++ b/chrome/browser/ui/extensions/application_launch.cc
@@ -100,7 +100,7 @@ // ExtensionEnableFlowDelegate overrides. void ExtensionEnableFlowFinished() override { const Extension* extension = - registry_->GetExtensionById(extension_id_, ExtensionRegistry::ENABLED); + registry_->enabled_extensions().GetByID(extension_id_); if (!extension) return; std::move(callback_).Run();
diff --git a/chrome/browser/ui/passwords/manage_passwords_state.cc b/chrome/browser/ui/passwords/manage_passwords_state.cc index c053bc0..a068ac15 100644 --- a/chrome/browser/ui/passwords/manage_passwords_state.cc +++ b/chrome/browser/ui/passwords/manage_passwords_state.cc
@@ -214,11 +214,6 @@ SetState(password_manager::ui::CAN_MOVE_PASSWORD_TO_ACCOUNT_STATE); } -void ManagePasswordsState::OnKeychainError() { - ClearData(); - SetState(password_manager::ui::KEYCHAIN_ERROR_STATE); -} - void ManagePasswordsState::TransitionToState( password_manager::ui::State state) { CHECK_NE(password_manager::ui::INACTIVE_STATE, state_);
diff --git a/chrome/browser/ui/passwords/manage_passwords_state.h b/chrome/browser/ui/passwords/manage_passwords_state.h index f9e4dec..848aaf3 100644 --- a/chrome/browser/ui/passwords/manage_passwords_state.h +++ b/chrome/browser/ui/passwords/manage_passwords_state.h
@@ -88,9 +88,6 @@ // Move to INACTIVE_STATE. void OnInactive(); - // Move to KEYCHAIN_ERROR_STATE. - void OnKeychainError(); - // Move to CAN_MOVE_PASSWORD_TO_ACCOUNT_STATE. Triggers a bubble to move the // just submitted form to the user's account store. void OnPasswordMovable(
diff --git a/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc b/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc index e52b731d..c7ca780 100644 --- a/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc +++ b/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc
@@ -670,10 +670,4 @@ TestAllUpdates(); } -TEST_F(ManagePasswordsStateTest, OnKeychainError) { - passwords_data().OnKeychainError(); - EXPECT_EQ(password_manager::ui::KEYCHAIN_ERROR_STATE, - passwords_data().state()); -} - } // namespace
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc index c0fff171..e934c8a 100644 --- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc +++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
@@ -83,12 +83,6 @@ namespace { -#if BUILDFLAG(IS_MAC) -// Should be kept in sync with constant declared in -// bubble_controllers/relaunch_chrome_bubble_controller.cc. -constexpr int kMaxNumberOfTimesKeychainErrorBubbleIsShown = 3; -#endif - password_manager::PasswordStoreInterface* GetProfilePasswordStore( content::WebContents* web_contents) { return ProfilePasswordStoreFactory::GetForProfile( @@ -438,24 +432,6 @@ UpdateBubbleAndIconVisibility(); } -void ManagePasswordsUIController::OnKeychainError() { -#if BUILDFLAG(IS_MAC) - CHECK(!dialog_controller_); - PrefService* prefs = - Profile::FromBrowserContext(web_contents()->GetBrowserContext()) - ->GetPrefs(); - if (base::FeatureList::IsEnabled( - password_manager::features::kRestartToGainAccessToKeychain) && - prefs->GetInteger( - password_manager::prefs::kRelaunchChromeBubbleDismissedCounter) <= - kMaxNumberOfTimesKeychainErrorBubbleIsShown) { - passwords_data_.OnKeychainError(); - bubble_status_ = BubbleStatus::SHOULD_POP_UP; - UpdateBubbleAndIconVisibility(); - } -#endif -} - void ManagePasswordsUIController::OnAddUsernameSaveClicked( const std::u16string& username) { CHECK(!dialog_controller_);
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.h b/chrome/browser/ui/passwords/manage_passwords_ui_controller.h index a4d5ec9e..75f01c0 100644 --- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.h +++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
@@ -112,7 +112,6 @@ void ShowBiometricActivationConfirmation() override; void OnBiometricAuthBeforeFillingDeclined() override; void OnAddUsernameSaveClicked(const std::u16string& username) override; - void OnKeychainError() override; virtual void NotifyUnsyncedCredentialsWillBeDeleted( std::vector<password_manager::PasswordForm> unsynced_credentials);
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc index af16c3d..bf7ebbd20 100644 --- a/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc +++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc
@@ -2062,31 +2062,6 @@ #endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) -#if BUILDFLAG(IS_MAC) -TEST_F(ManagePasswordsUIControllerTest, OnKeychainErrorShouldShowBubble) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndEnableFeature( - password_manager::features::kRestartToGainAccessToKeychain); - profile()->GetPrefs()->SetInteger( - password_manager::prefs::kRelaunchChromeBubbleDismissedCounter, 0); - EXPECT_CALL(*controller(), OnUpdateBubbleAndIconVisibility()); - controller()->OnKeychainError(); - EXPECT_EQ(password_manager::ui::KEYCHAIN_ERROR_STATE, - controller()->GetState()); -} - -TEST_F(ManagePasswordsUIControllerTest, OnKeychainErrorShouldNotShowBubble) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndEnableFeature( - password_manager::features::kRestartToGainAccessToKeychain); - profile()->GetPrefs()->SetInteger( - password_manager::prefs::kRelaunchChromeBubbleDismissedCounter, 4); - EXPECT_CALL(*controller(), OnUpdateBubbleAndIconVisibility()).Times(0); - controller()->OnKeychainError(); - EXPECT_EQ(password_manager::ui::INACTIVE_STATE, controller()->GetState()); -} -#endif - class ManagePasswordsUIControllerWithBrowserTest : public BrowserWithTestWindowTest { public:
diff --git a/chrome/browser/ui/passwords/passwords_client_ui_delegate.h b/chrome/browser/ui/passwords/passwords_client_ui_delegate.h index fb6e822..11db50d8 100644 --- a/chrome/browser/ui/passwords/passwords_client_ui_delegate.h +++ b/chrome/browser/ui/passwords/passwords_client_ui_delegate.h
@@ -113,10 +113,6 @@ virtual void OnBiometricAuthenticationForFilling( PrefService* pref_service) = 0; - // Called when trying to access saved passwords when keychain is not - // available. - virtual void OnKeychainError() = 0; - protected: virtual ~PasswordsClientUIDelegate() = default; };
diff --git a/chrome/browser/ui/tabs/organization/tab_organization_service.cc b/chrome/browser/ui/tabs/organization/tab_organization_service.cc index 881b12db..5f5bbf1 100644 --- a/chrome/browser/ui/tabs/organization/tab_organization_service.cc +++ b/chrome/browser/ui/tabs/organization/tab_organization_service.cc
@@ -83,7 +83,7 @@ void TabOrganizationService::StartRequest(const Browser* browser) { TabOrganizationSession* session = GetSessionForBrowser(browser); if (!session || session->IsComplete()) { - session = CreateSessionForBrowser(browser); + session = ResetSessionForBrowser(browser); } if (session->request()->state() == TabOrganizationRequest::State::NOT_STARTED) {
diff --git a/chrome/browser/ui/tabs/organization/tab_organization_service_unittest.cc b/chrome/browser/ui/tabs/organization/tab_organization_service_unittest.cc index d821b58..4c20831 100644 --- a/chrome/browser/ui/tabs/organization/tab_organization_service_unittest.cc +++ b/chrome/browser/ui/tabs/organization/tab_organization_service_unittest.cc
@@ -230,3 +230,32 @@ service()->ResetSessionForBrowser(browser1)->session_id(); EXPECT_NE(session_id_1, session_id_2); } + +TEST_F(TabOrganizationServiceTest, SecondRequestAfterCompletionDoesntCrash) { + Browser* browser1 = AddBrowser(); + for (int i = 0; i < 4; i++) { + AddValidTabToBrowser(browser1, 0); + } + + service()->StartRequest(browser1); + auto* const session = service()->GetSessionForBrowser(browser1); + ASSERT_EQ(session->tab_organizations().size(), 1u); + session->GetNextTabOrganization()->Accept(); + ASSERT_TRUE(session->IsComplete()); + + service()->StartRequest(browser1); +} + +TEST_F(TabOrganizationServiceTest, SecondRequestAfterStartingDoesntCrash) { + Browser* browser1 = AddBrowser(); + for (int i = 0; i < 4; i++) { + AddValidTabToBrowser(browser1, 0); + } + + service()->StartRequest(browser1); + auto* const session = service()->GetSessionForBrowser(browser1); + ASSERT_EQ(session->tab_organizations().size(), 1u); + ASSERT_FALSE(session->IsComplete()); + + service()->StartRequest(browser1); +}
diff --git a/chrome/browser/ui/tabs/organization/trigger.cc b/chrome/browser/ui/tabs/organization/trigger.cc index 7210e691..a8b6513 100644 --- a/chrome/browser/ui/tabs/organization/trigger.cc +++ b/chrome/browser/ui/tabs/organization/trigger.cc
@@ -6,6 +6,7 @@ #include "base/time/default_tick_clock.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/tabs/organization/tab_data.h" #include "chrome/browser/ui/tabs/organization/trigger_policies.h" #include "chrome/browser/ui/tabs/tab_group_model.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" @@ -14,14 +15,14 @@ namespace { // Just counts the number of tabs in the browser. -float MVPScoringFunction(const TabStripModel* const model) { - int num_tabs_not_in_group = 0; +float MVPScoringFunction(TabStripModel* const model) { + int num_eligible_tabs = 0; for (int i = 0; i < model->count(); i++) { - if (model->GetTabGroupForTab(i) == absl::nullopt) { - num_tabs_not_in_group++; + if (TabData(model, model->GetWebContentsAt(i)).IsValidForOrganizing()) { + num_eligible_tabs++; } } - return num_tabs_not_in_group; + return num_eligible_tabs; } } // namespace @@ -36,7 +37,7 @@ TabOrganizationTrigger::~TabOrganizationTrigger() = default; bool TabOrganizationTrigger::ShouldTrigger( - const TabStripModel* const tab_strip_model) const { + TabStripModel* const tab_strip_model) const { const float score = scoring_function_.Run(tab_strip_model); if (score < score_threshold_) { return false;
diff --git a/chrome/browser/ui/tabs/organization/trigger.h b/chrome/browser/ui/tabs/organization/trigger.h index 51ba812..0b53836 100644 --- a/chrome/browser/ui/tabs/organization/trigger.h +++ b/chrome/browser/ui/tabs/organization/trigger.h
@@ -21,8 +21,7 @@ virtual bool ShouldTrigger(float score) = 0; }; -using TriggerScoringFunction = - base::RepeatingCallback<float(const TabStripModel*)>; +using TriggerScoringFunction = base::RepeatingCallback<float(TabStripModel*)>; // Decides when to trigger the tab organization proactive nudge UI by scoring // potential trigger moments and picking the best one based on a score threshold @@ -38,7 +37,7 @@ std::unique_ptr<TriggerPolicy> policy); ~TabOrganizationTrigger(); - bool ShouldTrigger(const TabStripModel* inputs) const; + bool ShouldTrigger(TabStripModel* inputs) const; private: TriggerScoringFunction scoring_function_;
diff --git a/chrome/browser/ui/tabs/organization/trigger_observer_unittest.cc b/chrome/browser/ui/tabs/organization/trigger_observer_unittest.cc index c165b0a..4de1d814 100644 --- a/chrome/browser/ui/tabs/organization/trigger_observer_unittest.cc +++ b/chrome/browser/ui/tabs/organization/trigger_observer_unittest.cc
@@ -26,10 +26,9 @@ std::unique_ptr<TabOrganizationTrigger> MakeTestTrigger() { return std::make_unique<TabOrganizationTrigger>( - base::BindLambdaForTesting( - [](const TabStripModel* tab_strip_model) -> float { - return tab_strip_model->count(); - }), + base::BindLambdaForTesting([](TabStripModel* tab_strip_model) -> float { + return tab_strip_model->count(); + }), 2.0f, std::make_unique<AlwaysTrigger>()); } } // namespace
diff --git a/chrome/browser/ui/tabs/organization/trigger_unittest.cc b/chrome/browser/ui/tabs/organization/trigger_unittest.cc index 751f24f..0fd9efe 100644 --- a/chrome/browser/ui/tabs/organization/trigger_unittest.cc +++ b/chrome/browser/ui/tabs/organization/trigger_unittest.cc
@@ -32,10 +32,12 @@ nullptr); } - content::WebContents* AddTab() { + content::WebContents* AddTab(GURL url) { std::unique_ptr<content::WebContents> contents_unique_ptr = CreateWebContents(); content::WebContents* content_ptr = contents_unique_ptr.get(); + content::WebContentsTester::For(contents_unique_ptr.get()) + ->NavigateAndCommit(url); tab_strip_model()->AppendWebContents(std::move(contents_unique_ptr), true); return content_ptr; @@ -60,7 +62,7 @@ // Should trigger the first time over the score threshold. for (int i = 0; i < 10; i++) { - AddTab(); + AddTab(GURL("https://www.example.com")); } EXPECT_TRUE(trigger->ShouldTrigger(tab_strip_model()));
diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc index bd9693f..e9dc0ae 100644 --- a/chrome/browser/ui/tabs/tab_strip_model.cc +++ b/chrome/browser/ui/tabs/tab_strip_model.cc
@@ -899,6 +899,13 @@ return selection_model_.IsSelected(index); } +absl::optional<base::Time> TabStripModel::GetLastAccessed(int index) const { + if (ContainsIndex(index)) { + return selection_model_.GetLastAccessed(index); + } + return absl::nullopt; +} + void TabStripModel::SetSelectionFromModel(ui::ListSelectionModel source) { CHECK(source.active().has_value()); SetSelection(std::move(source), TabStripModelObserver::CHANGE_REASON_NONE,
diff --git a/chrome/browser/ui/tabs/tab_strip_model.h b/chrome/browser/ui/tabs/tab_strip_model.h index 5f7e5a4..477e0c1d 100644 --- a/chrome/browser/ui/tabs/tab_strip_model.h +++ b/chrome/browser/ui/tabs/tab_strip_model.h
@@ -382,6 +382,9 @@ // Returns true if the tab at |index| is selected. bool IsTabSelected(int index) const; + // Returns the timestamp at which the tab was last accessed. + absl::optional<base::Time> GetLastAccessed(int index) const; + // Sets the selection to match that of |source|. void SetSelectionFromModel(ui::ListSelectionModel source);
diff --git a/chrome/browser/ui/toolbar/pinned_toolbar_actions_model_factory.cc b/chrome/browser/ui/toolbar/pinned_toolbar_actions_model_factory.cc index 0f151fad..6a6ee6a 100644 --- a/chrome/browser/ui/toolbar/pinned_toolbar_actions_model_factory.cc +++ b/chrome/browser/ui/toolbar/pinned_toolbar_actions_model_factory.cc
@@ -25,7 +25,7 @@ : ProfileKeyedServiceFactory( "PinnedToolbarActionsModel", ProfileSelections::Builder() - .WithRegular(ProfileSelection::kOwnInstance) + .WithRegular(ProfileSelection::kRedirectedToOriginal) .WithGuest(ProfileSelection::kOwnInstance) .Build()) {}
diff --git a/chrome/browser/ui/views/download/bubble/download_bubble_contents_view.cc b/chrome/browser/ui/views/download/bubble/download_bubble_contents_view.cc index 39d019d2..e5fc57e 100644 --- a/chrome/browser/ui/views/download/bubble/download_bubble_contents_view.cc +++ b/chrome/browser/ui/views/download/bubble/download_bubble_contents_view.cc
@@ -158,6 +158,8 @@ const ContentId& id, base::optional_ref<const std::string> password) { if (DownloadUIModel* model = GetDownloadModel(id); model) { + LogDeepScanEvent(model->GetDownloadItem(), + safe_browsing::DeepScanEvent::kPromptAccepted); safe_browsing::DownloadProtectionService::UploadForConsumerDeepScanning( model->GetDownloadItem(), password); }
diff --git a/chrome/browser/ui/views/file_system_access/file_system_access_browsertest.cc b/chrome/browser/ui/views/file_system_access/file_system_access_browsertest.cc index 434fbea..8553a06 100644 --- a/chrome/browser/ui/views/file_system_access/file_system_access_browsertest.cc +++ b/chrome/browser/ui/views/file_system_access/file_system_access_browsertest.cc
@@ -32,6 +32,7 @@ #include "components/network_session_configurator/common/network_switches.h" #include "components/permissions/permission_util.h" #include "components/safe_browsing/buildflags.h" +#include "components/safe_browsing/content/common/file_type_policies_test_util.h" #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "content/public/test/back_forward_cache_util.h" @@ -373,6 +374,19 @@ #if BUILDFLAG(FULL_SAFE_BROWSING) IN_PROC_BROWSER_TEST_F(FileSystemAccessBrowserTest, SafeBrowsing) { + safe_browsing::FileTypePoliciesTestOverlay policies; + std::unique_ptr<safe_browsing::DownloadFileTypeConfig> file_type_config = + std::make_unique<safe_browsing::DownloadFileTypeConfig>(); + auto* file_type = file_type_config->mutable_default_file_type(); + file_type->set_uma_value(-1); + file_type->set_ping_setting(safe_browsing::DownloadFileType::FULL_PING); + auto* platform_settings = file_type->add_platform_settings(); + platform_settings->set_danger_level( + safe_browsing::DownloadFileType::NOT_DANGEROUS); + platform_settings->set_auto_open_hint( + safe_browsing::DownloadFileType::ALLOW_AUTO_OPEN); + policies.SwapConfig(file_type_config); + const std::string file_name("test.pdf"); const base::FilePath test_file = temp_dir_.GetPath().AppendASCII(file_name);
diff --git a/chrome/browser/ui/views/frame/browser_root_view.cc b/chrome/browser/ui/views/frame/browser_root_view.cc index 5f863b8..142803e6 100644 --- a/chrome/browser/ui/views/frame/browser_root_view.cc +++ b/chrome/browser/ui/views/frame/browser_root_view.cc
@@ -315,6 +315,10 @@ RootView::OnMouseExited(event); } +gfx::Size BrowserRootView::CalculatePreferredSize() const { + return browser_view_->GetRestoredBounds().size(); +} + void BrowserRootView::PaintChildren(const views::PaintInfo& paint_info) { views::internal::RootView::PaintChildren(paint_info);
diff --git a/chrome/browser/ui/views/frame/browser_root_view.h b/chrome/browser/ui/views/frame/browser_root_view.h index 1ef009f..29d5c72 100644 --- a/chrome/browser/ui/views/frame/browser_root_view.h +++ b/chrome/browser/ui/views/frame/browser_root_view.h
@@ -82,6 +82,7 @@ DropCallback GetDropCallback(const ui::DropTargetEvent& event) override; bool OnMouseWheel(const ui::MouseWheelEvent& event) override; void OnMouseExited(const ui::MouseEvent& event) override; + gfx::Size CalculatePreferredSize() const override; protected: // views::View:
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_chromeos.cc b/chrome/browser/ui/views/frame/immersive_mode_controller_chromeos.cc index 34637c7..2710091 100644 --- a/chrome/browser/ui/views/frame/immersive_mode_controller_chromeos.cc +++ b/chrome/browser/ui/views/frame/immersive_mode_controller_chromeos.cc
@@ -78,8 +78,12 @@ } void ImmersiveModeControllerChromeos::SetEnabled(bool enabled) { - if (controller_.IsEnabled() == enabled) - return; + if (controller_.IsEnabled() == enabled) { + // TODO(crbug.com/1505996): Remove this comments when the performance check + // has completed. + LOG(WARNING) << "Sending immersive again while the state is the same: " + << (enabled ? "enabled." : "disabled."); + } if (!fullscreen_observer_.IsObserving()) { fullscreen_observer_.Observe(browser_view_->browser()
diff --git a/chrome/browser/ui/views/frame/webui_tab_strip_field_trial_browsertest.cc b/chrome/browser/ui/views/frame/webui_tab_strip_field_trial_browsertest.cc index 3a52af5..0464466 100644 --- a/chrome/browser/ui/views/frame/webui_tab_strip_field_trial_browsertest.cc +++ b/chrome/browser/ui/views/frame/webui_tab_strip_field_trial_browsertest.cc
@@ -176,7 +176,7 @@ : public WebUITabStripFieldTrialWithTabletModeBrowserTest { public: WebUITabStripFieldTrialCommandLineOverrideBrowserTest() { - feature_list()->InitializeFromCommandLine("WebUITabStrip", ""); + feature_list()->InitFromCommandLine("WebUITabStrip", ""); InitFeatureList(); EXPECT_TRUE(base::FeatureList::IsEnabled(features::kWebUITabStrip)); }
diff --git a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc index 40b41580..7fbb3b08 100644 --- a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc +++ b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
@@ -65,6 +65,7 @@ case ImageType::SENSORS: case ImageType::NOTIFICATIONS_QUIET_PROMPT: case ImageType::STORAGE_ACCESS: + case ImageType::MIDI: return absl::nullopt; case ImageType::NUM_IMAGE_TYPES:
diff --git a/chrome/browser/ui/views/media_preview/camera_preview/camera_coordinator.cc b/chrome/browser/ui/views/media_preview/camera_preview/camera_coordinator.cc index f1adba40..e178c2e7 100644 --- a/chrome/browser/ui/views/media_preview/camera_preview/camera_coordinator.cc +++ b/chrome/browser/ui/views/media_preview/camera_preview/camera_coordinator.cc
@@ -18,8 +18,7 @@ : camera_mediator_( base::BindRepeating(&CameraCoordinator::OnVideoSourceInfosReceived, base::Unretained(this))) { - auto* camera_view = parent_view.AddChildView( - std::make_unique<MediaView>(/*is_subsection=*/false)); + auto* camera_view = parent_view.AddChildView(std::make_unique<MediaView>()); camera_view_tracker_.SetView(camera_view); // Safe to use base::Unretained() because `this` owns / outlives // `camera_view_tracker_`. @@ -34,7 +33,7 @@ base::Unretained(this))); video_stream_coordinator_.emplace( - camera_view_controller_->GetLiveFeedContainer(), /*index=*/0); + camera_view_controller_->GetLiveFeedContainer()); } CameraCoordinator::~CameraCoordinator() { @@ -50,8 +49,6 @@ return; } - video_stream_coordinator_->SetPreviewVisibility(!device_infos.empty()); - std::vector<VideoSourceInfo> relevant_device_infos; relevant_device_infos.reserve(device_infos.size()); for (const auto& device_info : device_infos) {
diff --git a/chrome/browser/ui/views/media_preview/camera_preview/camera_coordinator_unittest.cc b/chrome/browser/ui/views/media_preview/camera_preview/camera_coordinator_unittest.cc index 661e85c..a282ef4 100644 --- a/chrome/browser/ui/views/media_preview/camera_preview/camera_coordinator_unittest.cc +++ b/chrome/browser/ui/views/media_preview/camera_preview/camera_coordinator_unittest.cc
@@ -38,12 +38,6 @@ protected: void SetUp() override { TestWithBrowserView::SetUp(); - - // TODO: The string resource is getting stripped out because the code isn't - // used in Chrome. Remove once CameraCoordinator is hooked up. -#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && BUILDFLAG(IS_WIN) - GTEST_SKIP() << "Skip until CameraViewController is used on Windows"; -#else content::OverrideVideoCaptureServiceForTesting( &fake_video_capture_service_); fake_video_capture_service_.SetOnGetVideoSourceCallback( @@ -51,7 +45,6 @@ parent_view_ = std::make_unique<views::View>(); coordinator_ = std::make_unique<CameraCoordinator>(*parent_view_, /*needs_borders=*/true); -#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) && BUILDFLAG(IS_WIN) } void TearDown() override {
diff --git a/chrome/browser/ui/views/media_preview/camera_preview/video_stream_coordinator.cc b/chrome/browser/ui/views/media_preview/camera_preview/video_stream_coordinator.cc index e37ab54..dbe44de5 100644 --- a/chrome/browser/ui/views/media_preview/camera_preview/video_stream_coordinator.cc +++ b/chrome/browser/ui/views/media_preview/camera_preview/video_stream_coordinator.cc
@@ -91,13 +91,10 @@ } // namespace -VideoStreamCoordinator::VideoStreamCoordinator(views::View& parent_view, - absl::optional<size_t> index) { - auto* video_stream_view = parent_view.AddChildViewAt( - std::make_unique<VideoStreamView>(kDefaultAspectRatio), - index.value_or(parent_view.children().size())); +VideoStreamCoordinator::VideoStreamCoordinator(views::View& parent_view) { + auto* video_stream_view = parent_view.AddChildView( + std::make_unique<VideoStreamView>(kDefaultAspectRatio)); - video_stream_view->SetVisible(false); video_stream_view->SetRasterContextProvider( content::GetContextFactory()->SharedMainThreadRasterContextProvider()); @@ -171,12 +168,6 @@ } } -void VideoStreamCoordinator::SetPreviewVisibility(bool is_visible) { - if (auto* view = GetVideoStreamView(); view) { - view->SetVisible(is_visible); - } -} - VideoStreamView* VideoStreamCoordinator::GetVideoStreamView() { auto* view = video_stream_view_tracker_.view(); return view ? static_cast<VideoStreamView*>(view) : nullptr;
diff --git a/chrome/browser/ui/views/media_preview/camera_preview/video_stream_coordinator.h b/chrome/browser/ui/views/media_preview/camera_preview/video_stream_coordinator.h index ba2ea45..a9335d58 100644 --- a/chrome/browser/ui/views/media_preview/camera_preview/video_stream_coordinator.h +++ b/chrome/browser/ui/views/media_preview/camera_preview/video_stream_coordinator.h
@@ -8,7 +8,6 @@ #include <stddef.h> #include <memory> -#include <optional> #include <utility> #include <vector> @@ -28,9 +27,8 @@ class VideoStreamCoordinator : public capture_mode::CameraVideoFrameHandler::Delegate { public: - // VideoStreamView is added to `parent_view` children list at `index`. - // If `index` is `nullopt`, then the view is added to the end of the list. - VideoStreamCoordinator(views::View& parent_view, std::optional<size_t> index); + // VideoStreamView is added to `parent_view` children list. + explicit VideoStreamCoordinator(views::View& parent_view); VideoStreamCoordinator(const VideoStreamCoordinator&) = delete; VideoStreamCoordinator& operator=(const VideoStreamCoordinator&) = delete; ~VideoStreamCoordinator() override; @@ -49,10 +47,6 @@ void StopAndCleanup(mojo::Remote<video_capture::mojom::VideoSourceProvider> video_source_provider); - // Shows/Hides video stream preview. It does nothing if the view has already - // been closed. - void SetPreviewVisibility(bool is_visible); - // capture_mode::CameraVideoFrameHandler::Delegate implementation. void OnCameraVideoFrame(scoped_refptr<media::VideoFrame> frame) override; void OnFatalErrorOrDisconnection() override;
diff --git a/chrome/browser/ui/views/media_preview/camera_preview/video_stream_coordinator_unittest.cc b/chrome/browser/ui/views/media_preview/camera_preview/video_stream_coordinator_unittest.cc index d8e0af15..970dea9 100644 --- a/chrome/browser/ui/views/media_preview/camera_preview/video_stream_coordinator_unittest.cc +++ b/chrome/browser/ui/views/media_preview/camera_preview/video_stream_coordinator_unittest.cc
@@ -46,8 +46,7 @@ void SetUp() override { TestWithBrowserView::SetUp(); parent_view_ = std::make_unique<views::View>(); - coordinator_ = - std::make_unique<VideoStreamCoordinator>(*parent_view_, /*index=*/0); + coordinator_ = std::make_unique<VideoStreamCoordinator>(*parent_view_); } void TearDown() override {
diff --git a/chrome/browser/ui/views/media_preview/camera_preview/video_stream_view.cc b/chrome/browser/ui/views/media_preview/camera_preview/video_stream_view.cc index f75af0c..26910e1 100644 --- a/chrome/browser/ui/views/media_preview/camera_preview/video_stream_view.cc +++ b/chrome/browser/ui/views/media_preview/camera_preview/video_stream_view.cc
@@ -55,7 +55,7 @@ } void VideoStreamView::OnPaint(gfx::Canvas* canvas) { - if (!latest_frame_ || !raster_context_provider_) { + if (!latest_frame_) { gfx::RectF base_rect(width(), height()); canvas->DrawRoundRect(base_rect, rounded_radius_, cc::PaintFlags()); return;
diff --git a/chrome/browser/ui/views/media_preview/media_view.cc b/chrome/browser/ui/views/media_preview/media_view.cc index 32e6cd05..0f4ffd6 100644 --- a/chrome/browser/ui/views/media_preview/media_view.cc +++ b/chrome/browser/ui/views/media_preview/media_view.cc
@@ -31,5 +31,5 @@ MediaView::~MediaView() = default; -BEGIN_METADATA(MediaView, views::BoxLayoutView) +BEGIN_METADATA(MediaView) END_METADATA
diff --git a/chrome/browser/ui/views/media_preview/media_view.h b/chrome/browser/ui/views/media_preview/media_view.h index dd0dca8..180c796 100644 --- a/chrome/browser/ui/views/media_preview/media_view.h +++ b/chrome/browser/ui/views/media_preview/media_view.h
@@ -10,9 +10,10 @@ // The base view for both camera and mic views. class MediaView : public views::BoxLayoutView { + METADATA_HEADER(MediaView, views::BoxLayoutView) + public: - METADATA_HEADER(MediaView); - explicit MediaView(bool is_subsection); + explicit MediaView(bool is_subsection = false); MediaView(const MediaView&) = delete; MediaView& operator=(const MediaView&) = delete; ~MediaView() override;
diff --git a/chrome/browser/ui/views/media_preview/media_view_controller_base.cc b/chrome/browser/ui/views/media_preview/media_view_controller_base.cc index 31b9f5d7..5fcd45f 100644 --- a/chrome/browser/ui/views/media_preview/media_view_controller_base.cc +++ b/chrome/browser/ui/views/media_preview/media_view_controller_base.cc
@@ -24,6 +24,8 @@ const std::u16string& combobox_accessible_name, const std::u16string& no_device_connected_label_text) : base_view_(base_view), + live_feed_container_(raw_ref<MediaView>::from_ptr( + base_view_->AddChildView(std::make_unique<MediaView>()))), no_device_connected_label_(raw_ref<views::Label>::from_ptr( base_view_->AddChildView(std::make_unique<views::Label>()))), device_selector_combobox_(raw_ref<views::Combobox>::from_ptr( @@ -47,6 +49,8 @@ ui::kColorMenuBackground, kRoundedRadius)); } + live_feed_container_->SetVisible(false); + no_device_connected_label_->SetText(no_device_connected_label_text); no_device_connected_label_->SetTextContext( views::style::CONTEXT_DIALOG_BODY_TEXT); @@ -65,11 +69,8 @@ device_selector_combobox_->SetCallback({}); } -MediaView& MediaViewControllerBase::GetLiveFeedContainer() { - return *base_view_; -} - void MediaViewControllerBase::AdjustComboboxEnabledState(bool has_devices) { + live_feed_container_->SetVisible(has_devices); no_device_connected_label_->SetVisible(!has_devices); device_selector_combobox_->SetEnabled(has_devices); if (has_devices) {
diff --git a/chrome/browser/ui/views/media_preview/media_view_controller_base.h b/chrome/browser/ui/views/media_preview/media_view_controller_base.h index d148a0d..3525e06 100644 --- a/chrome/browser/ui/views/media_preview/media_view_controller_base.h +++ b/chrome/browser/ui/views/media_preview/media_view_controller_base.h
@@ -44,7 +44,7 @@ ~MediaViewControllerBase(); // Returns the immediate parent view of the live camera/mic feeds. - MediaView& GetLiveFeedContainer(); + MediaView& GetLiveFeedContainer() { return live_feed_container_.get(); } // Enables the combobox if there are connected devices (e.g.`has_devices` is // true). @@ -56,6 +56,7 @@ void OnComboboxSelection(); const raw_ref<MediaView> base_view_; + const raw_ref<MediaView> live_feed_container_; const raw_ref<views::Label> no_device_connected_label_; const raw_ref<views::Combobox> device_selector_combobox_;
diff --git a/chrome/browser/ui/views/media_preview/media_view_controller_base_unittest.cc b/chrome/browser/ui/views/media_preview/media_view_controller_base_unittest.cc index 6da61a62..bd6c937 100644 --- a/chrome/browser/ui/views/media_preview/media_view_controller_base_unittest.cc +++ b/chrome/browser/ui/views/media_preview/media_view_controller_base_unittest.cc
@@ -20,7 +20,7 @@ protected: void SetUp() override { TestWithBrowserView::SetUp(); - media_view_ = std::make_unique<MediaView>(/*is_subsection=*/false); + media_view_ = std::make_unique<MediaView>(); controller_ = std::make_unique<MediaViewControllerBase>( *media_view_, /*needs_borders=*/true, /*model=*/nullptr, source_change_callback_.Get(), std::u16string(), std::u16string());
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc b/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc index 6a1e316..681e48eb 100644 --- a/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc +++ b/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc
@@ -109,12 +109,10 @@ case password_manager::ui::BIOMETRIC_AUTHENTICATION_FOR_FILLING_STATE: case password_manager::ui::BIOMETRIC_AUTHENTICATION_CONFIRMATION_STATE: return l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_TOOLTIP_PROTECT); - case password_manager::ui::NOTIFY_RECEIVED_SHARED_CREDENTIALS: + case password_manager::ui::NOTIFY_RECEIVED_SHARED_CREDENTIALS: { return l10n_util::GetStringUTF16( IDS_PASSWORD_MANAGER_TOOLTIP_SHARED_NOTIFICATION); - case password_manager::ui::KEYCHAIN_ERROR_STATE: - return l10n_util::GetStringUTF16( - IDS_PASSWORD_MANAGER_TOOLTIP_KEYCHAIN_ERROR); + } } NOTREACHED_NORETURN(); }
diff --git a/chrome/browser/ui/views/passwords/password_bubble_view_base.cc b/chrome/browser/ui/views/passwords/password_bubble_view_base.cc index 0ef6b625..52b900b 100644 --- a/chrome/browser/ui/views/passwords/password_bubble_view_base.cc +++ b/chrome/browser/ui/views/passwords/password_bubble_view_base.cc
@@ -32,10 +32,6 @@ #include "components/password_manager/core/common/password_manager_ui.h" #include "ui/views/controls/button/button.h" -#if BUILDFLAG(IS_MAC) -#include "chrome/browser/ui/views/passwords/password_relaunch_chrome_view.h" -#endif - #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) #include "chrome/browser/ui/views/passwords/biometric_authentication_confirmation_bubble_view.h" #include "chrome/browser/ui/views/passwords/biometric_authentication_for_filling_bubble_view.h" @@ -135,13 +131,6 @@ } else if (model_state == password_manager::ui::NOTIFY_RECEIVED_SHARED_CREDENTIALS) { view = new SharedPasswordsNotificationView(web_contents, anchor_view); -#if BUILDFLAG(IS_MAC) - } else if (model_state == password_manager::ui::KEYCHAIN_ERROR_STATE) { - view = new RelaunchChromeView( - web_contents, anchor_view, - Profile::FromBrowserContext(web_contents->GetBrowserContext()) - ->GetPrefs()); -#endif } else { NOTREACHED_NORETURN(); }
diff --git a/chrome/browser/ui/views/passwords/password_relaunch_chrome_view.cc b/chrome/browser/ui/views/passwords/password_relaunch_chrome_view.cc index 7993bd76..c156364 100644 --- a/chrome/browser/ui/views/passwords/password_relaunch_chrome_view.cc +++ b/chrome/browser/ui/views/passwords/password_relaunch_chrome_view.cc
@@ -13,7 +13,6 @@ #include "chrome/browser/ui/views/passwords/views_utils.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_utils.h" -#include "ui/gfx/text_constants.h" #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/controls/styled_label.h" #include "ui/views/layout/fill_layout.h" @@ -36,7 +35,6 @@ auto label = std::make_unique<views::Label>(); label->SetText(controller_.GetBody()); label->SetMultiLine(/*multi_line=*/true); - label->SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_LEFT); AddChildView(std::move(label)); SetAcceptCallback(base::BindOnce(&RelaunchChromeBubbleController::OnAccepted,
diff --git a/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view.cc b/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view.cc index 641a3f9d..f014a89 100644 --- a/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view.cc +++ b/chrome/browser/ui/views/profiles/dice_web_signin_interception_bubble_view.cc
@@ -31,6 +31,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" #include "ui/base/metadata/metadata_impl_macros.h" +#include "ui/base/ui_base_features.h" #include "ui/views/bubble/bubble_border.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/layout/fill_layout.h" @@ -42,7 +43,18 @@ // SetHeightAndShowWidget(). constexpr int kInterceptionBubbleBaseHeight = 500; constexpr int kInterceptionBubbleWidth = 290; -constexpr int kInterceptionChromeSigninBubbleWidth = 320; + +// The Chrome Signin bubble width is expected to be 320px; since the default +// x-margins are different with CR2023, then the fixed width must be adapted in +// order to have the same bubble total size. The padding is also adapted in the +// web UI in order to have the same spacing with the border elements. +// +// Total width = bubble_margin + fixed_width +// 320 = 20 * 2 + 280 +constexpr int kInterceptionChromeSigninBubbleWidthCR2023 = 280; +// Total width = bubble_margin + fixed_width +// 320 = 16 * 2 + 288 +constexpr int kInterceptionChromeSigninBubbleWidth = 288; AvatarToolbarButton* GetAvatarToolbarButton(const Browser& browser) { return BrowserView::GetBrowserViewForBrowser(&browser) @@ -62,7 +74,9 @@ WebSigninInterceptor::SigninInterceptionType interception_type) { return interception_type == WebSigninInterceptor::SigninInterceptionType::kChromeSignin - ? kInterceptionChromeSigninBubbleWidth + ? features::IsChromeRefresh2023() + ? kInterceptionChromeSigninBubbleWidthCR2023 + : kInterceptionChromeSigninBubbleWidth : kInterceptionBubbleWidth; } @@ -228,7 +242,12 @@ web_view_ = web_view.get(); AddChildView(std::move(web_view)); - set_margins(gfx::Insets()); + // Keep the default margin, so that the rounded corners take proper effect. + // Currently only affects Chrome Signin intercept as it's padding got adapted. + if (bubble_parameters.interception_type != + WebSigninInterceptor::SigninInterceptionType::kChromeSignin) { + set_margins(gfx::Insets()); + } SetButtons(ui::DIALOG_BUTTON_NONE); SetLayoutManager(std::make_unique<views::FillLayout>()); }
diff --git a/chrome/browser/ui/views/profiles/profile_picker_view_browsertest.cc b/chrome/browser/ui/views/profiles/profile_picker_view_browsertest.cc index 95082bb..482df3e 100644 --- a/chrome/browser/ui/views/profiles/profile_picker_view_browsertest.cc +++ b/chrome/browser/ui/views/profiles/profile_picker_view_browsertest.cc
@@ -2993,10 +2993,6 @@ EXPECT_EQ(1, user_action_tester().GetActionCount( "Signin_EnterpriseAccountPrompt_ImportData")); - // TODO(crbug.com/1324886): Workaround for Sync startup attempting a real - // connection. - SyncServiceFactory::GetForProfile(profile)->StopAndClear(); - GoThroughFirstRunFlow( /*quit_on_welcome=*/true, /*quit_on_sync=*/absl::nullopt); @@ -3023,10 +3019,6 @@ EXPECT_EQ(0, user_action_tester().GetActionCount( "Signin_EnterpriseAccountPrompt_ImportData")); - // TODO(crbug.com/1324886): Workaround for Sync startup attempting a real - // connection. - SyncServiceFactory::GetForProfile(profile)->StopAndClear(); - // On the second run, the FRE is still not marked finished and we should // reopen it. GoThroughFirstRunFlow(
diff --git a/chrome/browser/ui/web_applications/BUILD.gn b/chrome/browser/ui/web_applications/BUILD.gn index 4fe45cb..eaac2a8 100644 --- a/chrome/browser/ui/web_applications/BUILD.gn +++ b/chrome/browser/ui/web_applications/BUILD.gn
@@ -135,6 +135,7 @@ if (is_chromeos) { sources += [ "share_to_target_browsertest.cc", + "web_app_relaunch_notification_browsertest.cc", "web_share_target_browsertest.cc", ] }
diff --git a/chrome/browser/ui/web_applications/web_app_relaunch_notification.cc b/chrome/browser/ui/web_applications/web_app_relaunch_notification.cc new file mode 100644 index 0000000..1e0d854 --- /dev/null +++ b/chrome/browser/ui/web_applications/web_app_relaunch_notification.cc
@@ -0,0 +1,104 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/web_applications/web_app_relaunch_notification.h" + +#include "base/functional/callback_forward.h" +#include "base/memory/weak_ptr.h" +#include "base/notreached.h" +#include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" +#include "chrome/browser/notifications/notification_display_service.h" +#include "chrome/browser/notifications/notification_handler.h" +#include "chrome/browser/notifications/system_notification_helper.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/browser_navigator.h" +#include "chrome/browser/ui/browser_navigator_params.h" +#include "chrome/browser/web_applications/web_app_ui_manager.h" +#include "chrome/browser/web_applications/web_app_utils.h" +#include "chrome/common/webui_url_constants.h" +#include "chromeos/strings/grit/chromeos_strings.h" +#include "components/webapps/common/web_app_id.h" +#include "ui/base/l10n/l10n_util.h" + +#if BUILDFLAG(IS_CHROMEOS_ASH) +#include "ash/constants/notifier_catalogs.h" +#endif + +namespace { + +constexpr char kWebAppRelaunchId[] = "web_app_relaunch"; +constexpr char kWebAppRelaunchNotifierIdPrefix[] = "web_app_relaunch_notifier"; + +std::string CreateNotificationId(const webapps::AppId& placeholder_app_id) { + return base::StrCat( + {kWebAppRelaunchNotifierIdPrefix, ":", placeholder_app_id}); +} + +message_center::Notification CreateNotification( + const webapps::AppId& placeholder_app_id, + const webapps::AppId& final_app_id, + const std::u16string& final_app_name) { +#if (BUILDFLAG(IS_CHROMEOS_ASH)) + message_center::NotifierId notifier_id = message_center::NotifierId( + message_center::NotifierType::SYSTEM_COMPONENT, kWebAppRelaunchId, + ash::NotificationCatalogName::kWebAppSettings); +#else + message_center::NotifierId notifier_id = message_center::NotifierId( + message_center::NotifierType::SYSTEM_COMPONENT, kWebAppRelaunchId); +#endif // (BUILDFLAG(IS_CHROMEOS_ASH)) + + message_center::Notification notification( + message_center::NOTIFICATION_TYPE_SIMPLE, + CreateNotificationId(placeholder_app_id), + l10n_util::GetStringFUTF16(IDS_WEB_APP_RELAUNCH_NOTIFICATION_TITLE, + final_app_name), + l10n_util::GetStringUTF16(IDS_WEB_APP_RELAUNCH_NOTIFICATION_MESSAGE), + ui::ImageModel(), + /* display_source= */ std::u16string(), + /* origin_url */ GURL(), std::move(notifier_id), + message_center::RichNotificationData(), + base::MakeRefCounted<message_center::HandleNotificationClickDelegate>( + message_center::HandleNotificationClickDelegate::ButtonClickCallback( + base::DoNothing()))); + notification.SetSystemPriority(); + return notification; +} + +} // namespace + +namespace web_app { + +void NotifyAppRelaunchState(const webapps::AppId& placeholder_app_id, + const webapps::AppId& final_app_id, + const std::u16string& final_app_name, + base::WeakPtr<Profile> profile, + AppRelaunchState relaunch_state) { + if (!profile) { + return; + } + + switch (relaunch_state) { + case web_app::AppRelaunchState::kAppClosingForRelaunch: + NotificationDisplayService::GetForProfile(profile.get()) + ->Display(NotificationHandler::Type::TRANSIENT, + std::move(CreateNotification(placeholder_app_id, + final_app_id, final_app_name)), + /*metadata=*/nullptr); + break; + case web_app::AppRelaunchState::kAppAboutToRelaunch: + // TODO(b/311711416): Implement progress bar. + break; + case web_app::AppRelaunchState::kAppRelaunched: + // TODO(b/311711416): Implement minimum showing duration. + // The `NotificationDisplayService::Close` function can be called even if + // the notification is not shown anymore. + NotificationDisplayService::GetForProfile(profile.get()) + ->Close(NotificationHandler::Type::TRANSIENT, + CreateNotificationId(placeholder_app_id)); + break; + } +} + +} // namespace web_app
diff --git a/chrome/browser/ui/web_applications/web_app_relaunch_notification.h b/chrome/browser/ui/web_applications/web_app_relaunch_notification.h new file mode 100644 index 0000000..290c7003 --- /dev/null +++ b/chrome/browser/ui/web_applications/web_app_relaunch_notification.h
@@ -0,0 +1,27 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEB_APPLICATIONS_WEB_APP_RELAUNCH_NOTIFICATION_H_ +#define CHROME_BROWSER_UI_WEB_APPLICATIONS_WEB_APP_RELAUNCH_NOTIFICATION_H_ + +#include <string> + +#include "base/memory/weak_ptr.h" +#include "components/webapps/common/web_app_id.h" + +class Profile; + +namespace web_app { + +enum class AppRelaunchState; + +void NotifyAppRelaunchState(const webapps::AppId& placeholder_app_id, + const webapps::AppId& final_app_id, + const std::u16string& final_app_name, + base::WeakPtr<Profile> profile, + AppRelaunchState relaunch_state); + +} // namespace web_app + +#endif // CHROME_BROWSER_UI_WEB_APPLICATIONS_WEB_APP_RELAUNCH_NOTIFICATION_H_
diff --git a/chrome/browser/ui/web_applications/web_app_relaunch_notification_browsertest.cc b/chrome/browser/ui/web_applications/web_app_relaunch_notification_browsertest.cc new file mode 100644 index 0000000..35f78b16 --- /dev/null +++ b/chrome/browser/ui/web_applications/web_app_relaunch_notification_browsertest.cc
@@ -0,0 +1,209 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/web_applications/web_app_relaunch_notification.h" + +#include <set> + +#include "base/run_loop.h" +#include "base/scoped_observation.h" +#include "base/test/run_until.h" +#include "base/test/test_future.h" +#include "chrome/browser/notifications/notification_display_service.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/web_applications/web_app_provider.h" +#include "chrome/browser/web_applications/web_app_ui_manager.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "content/public/test/browser_test.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "ui/message_center/public/cpp/notification.h" + +#if BUILDFLAG(IS_CHROMEOS_LACROS) +#include "chromeos/crosapi/mojom/message_center.mojom-test-utils.h" +#include "chromeos/crosapi/mojom/message_center.mojom.h" +#include "chromeos/crosapi/mojom/notification.mojom.h" +#include "chromeos/lacros/lacros_service.h" +#endif // BUILDFLAG(IS_CHROMEOS_LACROS) + +using testing::_; +using testing::AllOf; +using testing::Eq; +using testing::Field; +using testing::Property; + +namespace web_app { + +class WebAppRelaunchNotificationBrowserTest + : public InProcessBrowserTest, + public NotificationDisplayService::Observer { + public: + // NotificationDisplayService::Observer: + MOCK_METHOD(void, + OnNotificationDisplayed, + (const message_center::Notification&, + const NotificationCommon::Metadata* const), + (override)); + MOCK_METHOD(void, + OnNotificationClosed, + (const std::string& notification_id), + (override)); + + void OnNotificationDisplayServiceDestroyed( + NotificationDisplayService* service) override { + notification_observation_.Reset(); + } + + Profile* profile() { return browser()->profile(); } + + auto GetAllNotifications() { +#if BUILDFLAG(IS_CHROMEOS_ASH) + base::test::TestFuture<std::set<std::string>, bool> get_displayed_future; + NotificationDisplayService::GetForProfile(profile())->GetDisplayed( + get_displayed_future.GetCallback()); +#else + base::test::TestFuture<const std::vector<std::string>&> + get_displayed_future; + auto& remote = chromeos::LacrosService::Get() + ->GetRemote<crosapi::mojom::MessageCenter>(); + EXPECT_TRUE(remote.get()); + remote->GetDisplayedNotifications(get_displayed_future.GetCallback()); +#endif + const auto& notification_ids = get_displayed_future.Get<0>(); + EXPECT_TRUE(get_displayed_future.Wait()); + return notification_ids; + } + + void ClearAllNotifications() { +#if BUILDFLAG(IS_CHROMEOS_ASH) + NotificationDisplayService* service = + NotificationDisplayService::GetForProfile(profile()); +#else + base::test::TestFuture<const std::vector<std::string>&> + get_displayed_future; + auto& service = chromeos::LacrosService::Get() + ->GetRemote<crosapi::mojom::MessageCenter>(); + EXPECT_TRUE(service.get()); +#endif + for (const std::string& notification_id : GetAllNotifications()) { +#if BUILDFLAG(IS_CHROMEOS_ASH) + service->Close(NotificationHandler::Type::TRANSIENT, notification_id); +#else + service->CloseNotification(notification_id); +#endif + } + } + + size_t GetDisplayedNotificationsCount() { + return GetAllNotifications().size(); + } + + void WaitUntilDisplayNotificationCount(size_t display_count) { + ASSERT_TRUE(base::test::RunUntil([&]() -> bool { + return GetDisplayedNotificationsCount() == display_count; + })); + } + + protected: + base::ScopedObservation<NotificationDisplayService, + WebAppRelaunchNotificationBrowserTest> + notification_observation_{this}; +}; + +IN_PROC_BROWSER_TEST_F(WebAppRelaunchNotificationBrowserTest, + ShowNotificationOnRelaunch) { + ClearAllNotifications(); + notification_observation_.Observe( + NotificationDisplayService::GetForProfile(profile())); + + EXPECT_CALL( + *this, + OnNotificationDisplayed( + AllOf( + Property(&message_center::Notification::id, + Eq("web_app_relaunch_notifier:placeholder_app_id")), + Property(&message_center::Notification::notifier_id, + Field(&message_center::NotifierId::id, + Eq("web_app_relaunch"))), + Property(&message_center::Notification::title, + Eq(u"Restarting and updating final app title")), + Property( + &message_center::Notification::message, + Eq(u"Please wait while this application is being updated"))), + _)) + .Times(1); + + NotifyAppRelaunchState("placeholder_app_id", "final_app_id", + u"final app title", profile()->GetWeakPtr(), + AppRelaunchState::kAppClosingForRelaunch); + EXPECT_EQ(1u, GetDisplayedNotificationsCount()); + + NotifyAppRelaunchState("placeholder_app_id", "final_app_id", + u"finall app title", profile()->GetWeakPtr(), + AppRelaunchState::kAppRelaunched); + EXPECT_EQ(0u, GetDisplayedNotificationsCount()); +} + +IN_PROC_BROWSER_TEST_F(WebAppRelaunchNotificationBrowserTest, + TwoAppsInParallelShowNotificationsOnRelaunch) { + ClearAllNotifications(); + notification_observation_.Observe( + NotificationDisplayService::GetForProfile(profile())); + + EXPECT_CALL( + *this, + OnNotificationDisplayed( + AllOf( + Property(&message_center::Notification::id, + Eq("web_app_relaunch_notifier:placeholder_app_id_1")), + Property(&message_center::Notification::notifier_id, + Field(&message_center::NotifierId::id, + Eq("web_app_relaunch"))), + Property(&message_center::Notification::title, + Eq(u"Restarting and updating final app title 1")), + Property( + &message_center::Notification::message, + Eq(u"Please wait while this application is being updated"))), + _)) + .Times(1); + + EXPECT_CALL( + *this, + OnNotificationDisplayed( + AllOf( + Property(&message_center::Notification::id, + Eq("web_app_relaunch_notifier:placeholder_app_id_2")), + Property(&message_center::Notification::notifier_id, + Field(&message_center::NotifierId::id, + Eq("web_app_relaunch"))), + Property(&message_center::Notification::title, + Eq(u"Restarting and updating final app title 2")), + Property( + &message_center::Notification::message, + Eq(u"Please wait while this application is being updated"))), + _)) + .Times(1); + + NotifyAppRelaunchState("placeholder_app_id_1", "final_app_id_1", + u"final app title 1", profile()->GetWeakPtr(), + AppRelaunchState::kAppClosingForRelaunch); + EXPECT_EQ(1u, GetDisplayedNotificationsCount()); + + NotifyAppRelaunchState("placeholder_app_id_2", "final_app_id_2", + u"final app title 2", profile()->GetWeakPtr(), + AppRelaunchState::kAppClosingForRelaunch); + EXPECT_EQ(2u, GetDisplayedNotificationsCount()); + + NotifyAppRelaunchState("placeholder_app_id_1", "final_app_id_1", + u"finall app title 1", profile()->GetWeakPtr(), + AppRelaunchState::kAppRelaunched); + EXPECT_EQ(1u, GetDisplayedNotificationsCount()); + + NotifyAppRelaunchState("placeholder_app_id_2", "final_app_id_2", + u"finall app title 2", profile()->GetWeakPtr(), + AppRelaunchState::kAppRelaunched); + EXPECT_EQ(0u, GetDisplayedNotificationsCount()); +} + +} // namespace web_app
diff --git a/chrome/browser/ui/web_applications/web_app_ui_manager_impl.cc b/chrome/browser/ui/web_applications/web_app_ui_manager_impl.cc index d6c8734..d24a327 100644 --- a/chrome/browser/ui/web_applications/web_app_ui_manager_impl.cc +++ b/chrome/browser/ui/web_applications/web_app_ui_manager_impl.cc
@@ -48,6 +48,7 @@ #include "chrome/browser/web_applications/web_app_uninstall_dialog_user_options.h" #include "components/webapps/browser/installable/installable_metrics.h" #include "components/webapps/browser/uninstall_result_code.h" +#include "components/webapps/common/web_app_id.h" #include "content/public/browser/clear_site_data_utils.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" @@ -66,6 +67,8 @@ #include "chrome/browser/infobars/confirm_infobar_creator.h" #include "components/infobars/content/content_infobar_manager.h" #include "components/infobars/core/infobar.h" +#else +#include "chrome/browser/ui/web_applications/web_app_relaunch_notification.h" #endif // !BUILDFLAG(IS_CHROMEOS) #if !BUILDFLAG(IS_MAC) @@ -418,11 +421,16 @@ #endif // BUILDFLAG(IS_CHROMEOS) void WebAppUiManagerImpl::NotifyAppRelaunchState( - std::string placeholder_app_id, - std::string final_app_id, + const webapps::AppId& placeholder_app_id, + const webapps::AppId& final_app_id, + const std::u16string& final_app_name, base::WeakPtr<Profile> profile, AppRelaunchState relaunch_state) { - // TODO(b/311711416): Implement notification. +#if BUILDFLAG(IS_CHROMEOS) + web_app::NotifyAppRelaunchState(placeholder_app_id, final_app_id, + final_app_name, std::move(profile), + relaunch_state); +#endif // BUILDFLAG(IS_CHROMEOS) } content::WebContents* WebAppUiManagerImpl::CreateNewTab() {
diff --git a/chrome/browser/ui/web_applications/web_app_ui_manager_impl.h b/chrome/browser/ui/web_applications/web_app_ui_manager_impl.h index e24762e..fbd6eb9 100644 --- a/chrome/browser/ui/web_applications/web_app_ui_manager_impl.h +++ b/chrome/browser/ui/web_applications/web_app_ui_manager_impl.h
@@ -118,8 +118,9 @@ base::WeakPtr<Profile> profile) override; #endif - void NotifyAppRelaunchState(std::string placeholder_app_id, - std::string final_app_id, + void NotifyAppRelaunchState(const webapps::AppId& placeholder_app_id, + const webapps::AppId& final_app_id, + const std::u16string& final_app_name, base::WeakPtr<Profile> profile, AppRelaunchState relaunch_state) override;
diff --git a/chrome/browser/ui/webui/ash/bluetooth_pairing_dialog_browsertest-inl.h b/chrome/browser/ui/webui/ash/bluetooth_pairing_dialog_browsertest-inl.h deleted file mode 100644 index 7dce92b..0000000 --- a/chrome/browser/ui/webui/ash/bluetooth_pairing_dialog_browsertest-inl.h +++ /dev/null
@@ -1,72 +0,0 @@ -// Copyright 2015 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ash/public/cpp/shell_window_ids.h" -#include "base/auto_reset.h" -#include "chrome/browser/ui/webui/ash/bluetooth_pairing_dialog.h" -#include "chrome/test/base/ash/web_ui_browser_test.h" -#include "content/public/browser/web_ui.h" -#include "content/public/test/browser_test.h" -#include "content/public/test/browser_test_utils.h" -#include "device/bluetooth/bluetooth_adapter_factory.h" -#include "device/bluetooth/test/mock_bluetooth_adapter.h" -#include "device/bluetooth/test/mock_bluetooth_device.h" -#include "extensions/browser/extension_function.h" -#include "testing/gmock/include/gmock/gmock.h" - -class BluetoothPairingDialogTest : public WebUIBrowserTest { - public: - BluetoothPairingDialogTest(); - ~BluetoothPairingDialogTest() override; - - void ShowDialog(); - - private: - scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> mock_adapter_; - std::unique_ptr<device::MockBluetoothDevice> mock_device_; - - // In the course of running ShowDialog(), - // BluetoothPrivateConnectFunction::DoWork() is invoked. In this particular - // test, ExtensionFunction::Respond() is not immediately called because - // device::BluetoothDevice::Connect() first expects its callbacks to be - // completed. BluetoothPrivateConnectFunction has no way of invoking those - // callbacks before ShowDialog() finishes. Until it does, the simplest thing - // to do is set - // ExtensionFunction::ignore_all_did_respond_for_testing_do_not_use to true - // for the duration of the test. - base::AutoReset<bool> ignore_did_respond; -}; - -BluetoothPairingDialogTest::BluetoothPairingDialogTest() - : ignore_did_respond( - &ExtensionFunction::ignore_all_did_respond_for_testing_do_not_use, - true) {} - -BluetoothPairingDialogTest::~BluetoothPairingDialogTest() {} - -void BluetoothPairingDialogTest::ShowDialog() { - mock_adapter_ = new testing::NiceMock<device::MockBluetoothAdapter>(); - device::BluetoothAdapterFactory::SetAdapterForTesting(mock_adapter_); - EXPECT_CALL(*mock_adapter_, IsPresent()) - .WillRepeatedly(testing::Return(true)); - EXPECT_CALL(*mock_adapter_, IsPowered()) - .WillRepeatedly(testing::Return(true)); - - const bool kNotPaired = false; - const bool kNotConnected = false; - mock_device_ = - std::make_unique<testing::NiceMock<device::MockBluetoothDevice>>( - nullptr, 0, "Bluetooth 2.0 Mouse", "28:CF:DA:00:00:00", kNotPaired, - kNotConnected); - - EXPECT_CALL(*mock_adapter_, GetDevice(testing::_)) - .WillRepeatedly(testing::Return(mock_device_.get())); - - ash::SystemWebDialogDelegate* dialog = - ash::BluetoothPairingDialog::ShowDialog(mock_device_->GetAddress()); - content::WebUI* webui = dialog->GetWebUIForTest(); - content::WebContents* webui_webcontents = webui->GetWebContents(); - EXPECT_TRUE(content::WaitForLoadStop(webui_webcontents)); - SetWebUIInstance(webui); -}
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc index 235b50a4..4059f3e 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc +++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc
@@ -617,21 +617,6 @@ !(IsODFSMounted(profile) && IsOfficeWebAppInstalled(profile)); } -bool UrlIsOnODFS(Profile* profile, const FileSystemURL& url) { - ash::file_system_provider::util::FileSystemURLParser parser(url); - if (!parser.Parse()) { - return false; - } - - file_system_provider::ProviderId provider_id = - file_system_provider::ProviderId::CreateFromExtensionId( - extension_misc::kODFSExtensionId); - if (parser.file_system()->GetFileSystemInfo().provider_id() != provider_id) { - return false; - } - return true; -} - bool UrlIsOnAndroidOneDrive(Profile* profile, const FileSystemURL& url) { std::string authority; std::string root_document_id; @@ -804,21 +789,18 @@ } } -void CloudOpenTask::FinishedDriveUpload(absl::optional<GURL> url, +void CloudOpenTask::FinishedDriveUpload(OfficeTaskResult task_result, + absl::optional<GURL> url, int64_t size) { DCHECK_GT(pending_uploads_, 0UL); if (url.has_value()) { upload_total_size_ += size; fm_tasks::SetOfficeFileMovedToGoogleDrive(profile_, base::Time::Now()); - // Open the URL. - const OfficeTaskResult task_result_uma = - transfer_required_ == OfficeFilesTransferRequired::kCopy - ? OfficeTaskResult::kCopied - : OfficeTaskResult::kMoved; - OpenUploadedDriveUrl(url.value(), task_result_uma); + // Log TaskResult after open is tried. + OpenUploadedDriveUrl(url.value(), task_result); } else { - has_upload_errors_ = true; - cloud_open_metrics_->LogTaskResult(OfficeTaskResult::kFailedToUpload); + cloud_open_metrics_->LogTaskResult(task_result); + has_upload_errors_ = task_result == OfficeTaskResult::kFailedToUpload; } if (--pending_uploads_) { return;
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.h b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.h index cceb7ae..b6d06667 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.h +++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.h
@@ -173,7 +173,9 @@ // Callbacks from `DriveUploadHandler` and `OneDriveUploadHandler`. URL passed // to these callbacks will be `absl::nullopt` and size will be 0 if upload // fails. - void FinishedDriveUpload(absl::optional<GURL> url, int64_t size); + void FinishedDriveUpload(OfficeTaskResult task_result, + absl::optional<GURL> url, + int64_t size); void FinishedOneDriveUpload(base::WeakPtr<Profile> profile_weak_ptr, OfficeTaskResult task_result, absl::optional<storage::FileSystemURL> url, @@ -233,9 +235,6 @@ // is not mounted or the Office PWA is not installed. Returns False otherwise. bool ShouldFixUpOffice(Profile* profile, const CloudProvider cloud_provider); -// Returns True if the url is on ODFS. -bool UrlIsOnODFS(Profile* profile, const FileSystemURL& url); - // Returns True if the url is on the Android OneDrive DocumentsProvider. bool UrlIsOnAndroidOneDrive(Profile* profile, const FileSystemURL& url);
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.cc b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.cc index 8f4d196..4226a92 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.cc +++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.cc
@@ -236,6 +236,21 @@ return installed; } +bool UrlIsOnODFS(Profile* profile, const FileSystemURL& url) { + ash::file_system_provider::util::FileSystemURLParser parser(url); + if (!parser.Parse()) { + return false; + } + + file_system_provider::ProviderId provider_id = + file_system_provider::ProviderId::CreateFromExtensionId( + extension_misc::kODFSExtensionId); + if (parser.file_system()->GetFileSystemInfo().provider_id() != provider_id) { + return false; + } + return true; +} + // Convert |actions| to |ODFSMetadata| and pass the result to |callback|. // The action id's for the metadata are HIDDEN_ONEDRIVE_USER_EMAIL and // HIDDEN_ONEDRIVE_REAUTHENTICATION_REQUIRED.
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h index 85b632d6..8764780d 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h +++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h
@@ -327,6 +327,10 @@ bool IsODFSInstalled(Profile* profile); bool IsOfficeWebAppInstalled(Profile* profile); +// Returns true if url refers to an entry on any current mount provided by the +// ODFS file system provider. +bool UrlIsOnODFS(Profile* profile, const storage::FileSystemURL& url); + // Get ODFS metadata as actions by doing a special GetActions request (for the // root directory) and return the actions to |OnODFSMetadataActions| which will // be converted to |ODFSMetadata| and passed to |callback|.
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_handler.cc b/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_handler.cc index 56266409..afbfc620 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_handler.cc +++ b/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_handler.cc
@@ -44,9 +44,10 @@ // Runs the callback provided to `DriveUploadHandler::Upload`. void OnUploadDone(scoped_refptr<DriveUploadHandler> drive_upload_handler, DriveUploadHandler::UploadCallback callback, + OfficeTaskResult task_result, absl::optional<GURL> hosted_url, int64_t upload_size) { - std::move(callback).Run(std::move(hosted_url), upload_size); + std::move(callback).Run(task_result, std::move(hosted_url), upload_size); } std::string GetTargetAppName(base::FilePath file_path) { @@ -260,8 +261,11 @@ if (notification_manager_) { notification_manager_->MarkUploadComplete(); } + const OfficeTaskResult task_result = upload_type_ == UploadType::kCopy + ? OfficeTaskResult::kCopied + : OfficeTaskResult::kMoved; if (callback_) { - std::move(callback_).Run(hosted_url, upload_size_); + std::move(callback_).Run(task_result, hosted_url, upload_size_); } } @@ -278,7 +282,8 @@ notification_manager_->ShowUploadError(error_message); } if (callback_) { - std::move(callback_).Run(absl::nullopt, 0); + std::move(callback_).Run(OfficeTaskResult::kFailedToUpload, absl::nullopt, + 0); } }
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_handler.h b/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_handler.h index ea2bf81..a700593 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_handler.h +++ b/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_handler.h
@@ -42,7 +42,7 @@ drive::DriveIntegrationService::Observer { public: using UploadCallback = - base::OnceCallback<void(absl::optional<GURL>, int64_t)>; + base::OnceCallback<void(OfficeTaskResult, absl::optional<GURL>, int64_t)>; // Starts the upload workflow for the file specified at construct time. static void Upload(Profile* profile,
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_handler_browsertest.cc b/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_handler_browsertest.cc index baf5be8..e6f26b7 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_handler_browsertest.cc +++ b/chrome/browser/ui/webui/ash/cloud_upload/drive_upload_handler_browsertest.cc
@@ -249,12 +249,15 @@ } // `Wait` will not complete until this is called. - void OnUploadDone(absl::optional<GURL> url, int64_t size) { + void OnUploadDone(OfficeTaskResult task_result, + absl::optional<GURL> url, + int64_t size) { if (fail_sync_) { ASSERT_FALSE(url); } else { ASSERT_TRUE(url); } + observed_task_result_ = task_result; EndWait(); } @@ -298,6 +301,7 @@ base::SafeRef<CloudOpenMetrics> cloud_open_metrics_ref_ = cloud_open_metrics_->GetSafeRef(); + OfficeTaskResult observed_task_result_; base::HistogramTester histogram_; private: @@ -420,6 +424,7 @@ histogram_.ExpectUniqueSample(kGoogleDriveUploadResultMetricName, OfficeFilesUploadResult::kSuccess, 1); + ASSERT_EQ(observed_task_result_, OfficeTaskResult::kMoved); } IN_PROC_BROWSER_TEST_F(DriveUploadHandlerTest, UploadFromReadOnlyFileSystem) { @@ -450,6 +455,7 @@ histogram_.ExpectUniqueSample(kGoogleDriveUploadResultMetricName, OfficeFilesUploadResult::kSuccess, 1); + ASSERT_EQ(observed_task_result_, OfficeTaskResult::kCopied); } // Test that when the sync to Drive fails, the file is not moved to Drive. @@ -482,6 +488,7 @@ histogram_.ExpectUniqueSample(kGoogleDriveUploadResultMetricName, OfficeFilesUploadResult::kSyncError, 1); + ASSERT_EQ(observed_task_result_, OfficeTaskResult::kFailedToUpload); } IN_PROC_BROWSER_TEST_F(DriveUploadHandlerTest, UploadFromMyFilesNoConnection) { @@ -499,7 +506,8 @@ base::RunLoop run_loop; base::MockCallback<DriveUploadHandler::UploadCallback> upload_callback; - EXPECT_CALL(upload_callback, Run(absl::optional<GURL>(absl::nullopt), _)) + EXPECT_CALL(upload_callback, Run(OfficeTaskResult::kFailedToUpload, + absl::optional<GURL>(absl::nullopt), _)) .WillOnce(RunClosure(run_loop.QuitClosure())); DriveUploadHandler::Upload(profile(), source_file_url, upload_callback.Get(), cloud_open_metrics_ref_); @@ -534,7 +542,8 @@ base::RunLoop run_loop; base::MockCallback<DriveUploadHandler::UploadCallback> upload_callback; - EXPECT_CALL(upload_callback, Run(absl::optional<GURL>(absl::nullopt), _)) + EXPECT_CALL(upload_callback, Run(OfficeTaskResult::kFailedToUpload, + absl::optional<GURL>(absl::nullopt), _)) .WillOnce(RunClosure(run_loop.QuitClosure())); DriveUploadHandler::Upload(profile(), source_file_url, upload_callback.Get(), cloud_open_metrics_ref_);
diff --git a/chrome/browser/ui/webui/ash/edu_account_login_handler.cc b/chrome/browser/ui/webui/ash/edu_account_login_handler.cc index e52bac7..93b6487 100644 --- a/chrome/browser/ui/webui/ash/edu_account_login_handler.cc +++ b/chrome/browser/ui/webui/ash/edu_account_login_handler.cc
@@ -249,7 +249,7 @@ } void EduAccountLoginHandler::OnListFamilyMembersResponse( - supervised_user::ProtoFetcherStatus status, + const supervised_user::ProtoFetcherStatus& status, std::unique_ptr<kids_chrome_management::ListFamilyMembersResponse> response) { if (!status.IsOk()) { @@ -286,7 +286,7 @@ } void EduAccountLoginHandler::OnListFamilyMembersFailure( - supervised_user::ProtoFetcherStatus status) { + const supervised_user::ProtoFetcherStatus& status) { list_family_members_fetcher_.reset(); RejectJavascriptCallback(base::Value(get_parents_callback_id_), base::Value::List());
diff --git a/chrome/browser/ui/webui/ash/edu_account_login_handler.h b/chrome/browser/ui/webui/ash/edu_account_login_handler.h index b020bebc..a447e3af 100644 --- a/chrome/browser/ui/webui/ash/edu_account_login_handler.h +++ b/chrome/browser/ui/webui/ash/edu_account_login_handler.h
@@ -118,12 +118,13 @@ // ListFamilyMembers fetch handlers. void OnListFamilyMembersResponse( - supervised_user::ProtoFetcherStatus status, + const supervised_user::ProtoFetcherStatus& status, std::unique_ptr<kids_chrome_management::ListFamilyMembersResponse> response); void OnListFamilyMembersSuccess( const kids_chrome_management::ListFamilyMembersResponse& response); - void OnListFamilyMembersFailure(supervised_user::ProtoFetcherStatus status); + void OnListFamilyMembersFailure( + const supervised_user::ProtoFetcherStatus& status); // ProfileImageFetcher callback void OnParentProfileImagesFetched(
diff --git a/chrome/browser/ui/webui/ash/login/enter_old_password_screen_handler.cc b/chrome/browser/ui/webui/ash/login/enter_old_password_screen_handler.cc new file mode 100644 index 0000000..6443b58 --- /dev/null +++ b/chrome/browser/ui/webui/ash/login/enter_old_password_screen_handler.cc
@@ -0,0 +1,41 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/webui/ash/login/enter_old_password_screen_handler.h" + +#include "chrome/browser/ui/webui/ash/login/base_screen_handler.h" +#include "chrome/grit/generated_resources.h" +#include "components/login/localized_values_builder.h" +#include "ui/chromeos/devicetype_utils.h" + +namespace ash { + +EnterOldPasswordScreenHandler::EnterOldPasswordScreenHandler() + : BaseScreenHandler(kScreenId) {} + +EnterOldPasswordScreenHandler::~EnterOldPasswordScreenHandler() = default; + +void EnterOldPasswordScreenHandler::Show() { + ShowInWebUI(); +} + +void EnterOldPasswordScreenHandler::DeclareLocalizedValues( + ::login::LocalizedValuesBuilder* builder) { + builder->Add("nextButtonText", IDS_OFFLINE_LOGIN_NEXT_BUTTON_TEXT); + builder->Add("oldPasswordHint", IDS_LOGIN_PASSWORD_CHANGED_OLD_PASSWORD_HINT); + builder->Add("oldPasswordIncorrect", + IDS_LOGIN_PASSWORD_CHANGED_INCORRECT_OLD_PASSWORD); + builder->Add("recoverLocalDataTitle", + IDS_LOGIN_PASSWORD_CHANGED_RECOVER_DATA_TITLE); + builder->Add("recoverLocalDataSubtitle", + IDS_LOGIN_PASSWORD_CHANGED_RECOVER_DATA_SUBTITLE); + builder->Add("forgotOldPasswordButton", + IDS_LOGIN_PASSWORD_CHANGED_FORGOT_OLD_PASSWORD_BUTTON); +} + +void EnterOldPasswordScreenHandler::ShowWrongPasswordError() { + CallExternalAPI("showWrongPasswordError"); +} + +} // namespace ash
diff --git a/chrome/browser/ui/webui/ash/login/enter_old_password_screen_handler.h b/chrome/browser/ui/webui/ash/login/enter_old_password_screen_handler.h new file mode 100644 index 0000000..aa2a0695 --- /dev/null +++ b/chrome/browser/ui/webui/ash/login/enter_old_password_screen_handler.h
@@ -0,0 +1,54 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_ENTER_OLD_PASSWORD_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_ENTER_OLD_PASSWORD_SCREEN_HANDLER_H_ + +#include "chrome/browser/ash/login/oobe_screen.h" +#include "chrome/browser/ui/webui/ash/login/base_screen_handler.h" + +namespace ash { + +class EnterOldPasswordScreenView + : public base::SupportsWeakPtr<EnterOldPasswordScreenView> { + public: + inline constexpr static StaticOobeScreenId kScreenId{ + "enter-old-password", "EnterOldPasswordScreen"}; + + EnterOldPasswordScreenView() = default; + + EnterOldPasswordScreenView(const EnterOldPasswordScreenView&) = delete; + EnterOldPasswordScreenView& operator=(const EnterOldPasswordScreenView&) = + delete; + + virtual void Show() = 0; + virtual void ShowWrongPasswordError() = 0; +}; + +// A class that handles WebUI hooks in Gaia screen. +class EnterOldPasswordScreenHandler : public BaseScreenHandler, + public EnterOldPasswordScreenView { + public: + using TView = EnterOldPasswordScreenView; + + EnterOldPasswordScreenHandler(); + + EnterOldPasswordScreenHandler(const EnterOldPasswordScreenHandler&) = delete; + EnterOldPasswordScreenHandler& operator=( + const EnterOldPasswordScreenHandler&) = delete; + + ~EnterOldPasswordScreenHandler() override; + + private: + // EnterOldPasswordView: + void Show() override; + void ShowWrongPasswordError() override; + + // BaseScreenHandler: + void DeclareLocalizedValues(::login::LocalizedValuesBuilder* builder) final; +}; + +} // namespace ash + +#endif // CHROME_BROWSER_UI_WEBUI_ASH_LOGIN_ENTER_OLD_PASSWORD_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/ash/login/oobe_ui.cc b/chrome/browser/ui/webui/ash/login/oobe_ui.cc index 852586a..5706b5c 100644 --- a/chrome/browser/ui/webui/ash/login/oobe_ui.cc +++ b/chrome/browser/ui/webui/ash/login/oobe_ui.cc
@@ -68,6 +68,7 @@ #include "chrome/browser/ui/webui/ash/login/enable_debugging_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/encryption_migration_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/enrollment_screen_handler.h" +#include "chrome/browser/ui/webui/ash/login/enter_old_password_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/error_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/family_link_notice_screen_handler.h" #include "chrome/browser/ui/webui/ash/login/fingerprint_setup_screen_handler.h" @@ -486,7 +487,9 @@ AddScreenHandler(std::make_unique<LocalPasswordSetupHandler>()); AddScreenHandler(std::make_unique<ApplyOnlinePasswordScreenHandler>()); } + AddScreenHandler(std::make_unique<LocalDataLossWarningScreenHandler>()); + AddScreenHandler(std::make_unique<EnterOldPasswordScreenHandler>()); AddScreenHandler(std::make_unique<OSAuthErrorScreenHandler>()); AddScreenHandler(std::make_unique<FactorSetupSuccessScreenHandler>());
diff --git a/chrome/browser/ui/webui/ash/settings/pages/date_time/date_time_section.cc b/chrome/browser/ui/webui/ash/settings/pages/date_time/date_time_section.cc index c51bf020..ccc1b6bf 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/date_time/date_time_section.cc +++ b/chrome/browser/ui/webui/ash/settings/pages/date_time/date_time_section.cc
@@ -132,19 +132,15 @@ IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_SEND_WIFI_AP}, {"setTimeZoneAutomaticallyWithAllLocationInfo", IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_SEND_ALL_INFO}, + {"timeZoneGeolocationWarningText", + IDS_SETTINGS_TIME_ZONE_DETECTION_GEOLOCATION_WARNING_TEXT}, {"use24HourClock", IDS_SETTINGS_USE_24_HOUR_CLOCK}, {"setDateTime", IDS_SETTINGS_SET_DATE_TIME}, - {"timeZoneGeolocationDialogTitle", - IDS_SETTINGS_TIME_ZONE_GEOLOCATION_DIALOG_TITLE}, - {"timeZoneGeolocationDialogBody", - IDS_SETTINGS_TIME_ZONE_GEOLOCATION_DIALOG_BODY}, - {"timeZoneGeolocationDialogCancelButton", - IDS_SETTINGS_TIME_ZONE_GEOLOCATION_DIALOG_CANCEL_BUTTON}, - {"timeZoneGeolocationDialogTurnOnButton", IDS_SETTINGS_TURN_ON}}; + }; html_source->AddLocalizedStrings(kLocalizedStrings); html_source->AddString( - "timeZoneGeolocationDialogLearnMoreUrl", + "systemGeolocationDialogLearnMoreUrl", base::ASCIIToUTF16(base::StringPrintf( chrome::kTimeZoneSettingsLearnMoreURL, g_browser_process->GetApplicationLocale().c_str())));
diff --git a/chrome/browser/ui/webui/ash/settings/pages/device/device_section.cc b/chrome/browser/ui/webui/ash/settings/pages/device/device_section.cc index 056fbbb..b45c84b 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/device/device_section.cc +++ b/chrome/browser/ui/webui/ash/settings/pages/device/device_section.cc
@@ -1767,6 +1767,8 @@ IDS_SETTINGS_DISPLAY_NIGHT_LIGHT_SCHEDULE_NEVER}, {"displayNightLightScheduleSunsetToSunRise", IDS_SETTINGS_DISPLAY_NIGHT_LIGHT_SCHEDULE_SUNSET_TO_SUNRISE}, + {"displayNightLightGeolocationWarningText", + IDS_SETTINGS_DISPLAY_NIGHT_LIGHT_GEOLOCATION_WARNING_TEXT}, {"displayNightLightTemperatureLabel", IDS_SETTINGS_DISPLAY_NIGHT_LIGHT_TEMPERATURE_LABEL}, {"displayNightLightTempSliderMaxLabel",
diff --git a/chrome/browser/ui/webui/ash/settings/pages/internet/internet_section.cc b/chrome/browser/ui/webui/ash/settings/pages/internet/internet_section.cc index 774d2c2..d48c2c7 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/internet/internet_section.cc +++ b/chrome/browser/ui/webui/ash/settings/pages/internet/internet_section.cc
@@ -788,7 +788,6 @@ {"internetAddWiFi", IDS_SETTINGS_INTERNET_ADD_WIFI}, {"internetConfigName", IDS_SETTINGS_INTERNET_CONFIG_NAME}, {"internetDetailPageTitle", IDS_SETTINGS_INTERNET_DETAIL}, - {"internetDeviceEnabling", IDS_SETTINGS_INTERNET_DEVICE_ENABLING}, {"internetDeviceBusy", IDS_SETTINGS_INTERNET_DEVICE_BUSY}, {"internetJoinType", IDS_SETTINGS_INTERNET_JOIN_TYPE}, {"internetKnownNetworksPageTitle", IDS_SETTINGS_INTERNET_KNOWN_NETWORKS}, @@ -831,6 +830,7 @@ IDS_SETTINGS_SETTINGS_NETWORK_ALLOW_DATA_ROAMING_ENABLED_ROAMING}, {"networkAllowDataRoamingDisabled", IDS_SETTINGS_SETTINGS_NETWORK_ALLOW_DATA_ROAMING_DISABLED}, + {"networkDeviceTurningOn", IDS_SETTINGS_NETWORK_DEVICE_TURNING_ON}, {"networkVpnPreferences", IDS_SETTINGS_INTERNET_NETWORK_VPN_PREFERENCES}, {"networkAlwaysOnVpn", IDS_SETTINGS_INTERNET_NETWORK_ALWAYS_ON_VPN}, {"networkAlwaysOnVpnEnableSublabel",
diff --git a/chrome/browser/ui/webui/ash/settings/pages/privacy/privacy_section.cc b/chrome/browser/ui/webui/ash/settings/pages/privacy/privacy_section.cc index 8088f08c..a10d4b8 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/privacy/privacy_section.cc +++ b/chrome/browser/ui/webui/ash/settings/pages/privacy/privacy_section.cc
@@ -493,6 +493,14 @@ IDS_OS_SETTINGS_PRIVACY_HUB_GEOLOCATION_ACCESS_LEVEL_ONLY_ALLOWED_FOR_SYSTEM}, {"geolocationAccessLevelDisallowed", IDS_OS_SETTINGS_PRIVACY_HUB_GEOLOCATION_ACCESS_LEVEL_DISALLOWED}, + {"systemGeolocationDialogTitle", + IDS_SETTINGS_PRIVACY_HUB_GEOLOCATION_DIALOG_TITLE}, + {"systemGeolocationDialogBody", + IDS_SETTINGS_PRIVACY_HUB_GEOLOCATION_DIALOG_BODY}, + {"systemGeolocationDialogConfirmButton", + IDS_SETTINGS_PRIVACY_HUB_GEOLOCATION_DIALOG_CONFIRM_BUTTON}, + {"systemGeolocationDialogCancelButton", + IDS_SETTINGS_PRIVACY_HUB_GEOLOCATION_DIALOG_CANCEL_BUTTON}, {"microphoneHwToggleTooltip", IDS_OS_SETTINGS_PRIVACY_HUB_HW_MICROPHONE_TOGGLE_TOOLTIP}, {"websitesSectionTitle",
diff --git a/chrome/browser/ui/webui/compose/compose_ui.cc b/chrome/browser/ui/webui/compose/compose_ui.cc index 6c2227b1..84f09f7 100644 --- a/chrome/browser/ui/webui/compose/compose_ui.cc +++ b/chrome/browser/ui/webui/compose/compose_ui.cc
@@ -43,6 +43,7 @@ {"consentYesButton", IDS_COMPOSE_CONSENT_YES_BUTTON}, {"consentLearnMore", IDS_COMPOSE_CONSENT_LEARN_LINK}, {"dialogTitle", IDS_COMPOSE_DIALOG_TITLE}, + {"disclaimerLetsGoButton", IDS_COMPOSE_DISCLAIMER_BUTTON}, {"inputPlaceholder", IDS_COMPOSE_INPUT_PLACEHOLDER}, {"inputFooter", IDS_COMPOSE_FOOTER_FISHFOOD}, {"submitButton", IDS_COMPOSE_SUBMIT_BUTTON}, @@ -63,7 +64,6 @@ {"editButton", IDS_EDIT}, {"editCancelButton", IDS_CANCEL}, {"editUpdateButton", IDS_COMPOSE_EDIT_UPDATE_BUTTON}, - {"fileBugText", IDS_COMPOSE_FILE_BUG}, {"thumbsDown", IDS_THUMBS_DOWN}, {"thumbsUp", IDS_THUMBS_UP}, };
diff --git a/chrome/browser/ui/webui/dlp_internals/dlp_internals.mojom b/chrome/browser/ui/webui/dlp_internals/dlp_internals.mojom index d6f0277..f51c809 100644 --- a/chrome/browser/ui/webui/dlp_internals/dlp_internals.mojom +++ b/chrome/browser/ui/webui/dlp_internals/dlp_internals.mojom
@@ -168,4 +168,8 @@ // Returns files' database entries. GetFilesDatabaseEntries() => (array<FileDatabaseEntry> db_entries); + + // Returns the inode number of the requested file only if the file is in + // "My Files/Downloads" directory. + GetFileInode(string file_name) => (uint64 inode); }; \ No newline at end of file
diff --git a/chrome/browser/ui/webui/dlp_internals/dlp_internals_page_handler.cc b/chrome/browser/ui/webui/dlp_internals/dlp_internals_page_handler.cc index a318889..697a8d4 100644 --- a/chrome/browser/ui/webui/dlp_internals/dlp_internals_page_handler.cc +++ b/chrome/browser/ui/webui/dlp_internals/dlp_internals_page_handler.cc
@@ -4,13 +4,18 @@ #include "chrome/browser/ui/webui/dlp_internals/dlp_internals_page_handler.h" +#include <sys/stat.h> + #include "base/check.h" +#include "base/files/file_path.h" +#include "base/path_service.h" #include "chrome/browser/chromeos/policy/dlp/dlp_content_manager.h" #include "chrome/browser/chromeos/policy/dlp/dlp_content_restriction_set.h" #include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager.h" #include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/dlp_internals/dlp_internals.mojom.h" +#include "chrome/common/chrome_paths.h" #include "chromeos/dbus/dlp/dlp_client.h" #include "components/enterprise/data_controls/dlp_policy_event.pb.h" #include "components/enterprise/data_controls/rule.h" @@ -279,6 +284,21 @@ weak_ptr_factory_.GetWeakPtr(), std::move(callback))); } +void DlpInternalsPageHandler::GetFileInode(const std::string& file_name, + GetFileInodeCallback callback) { + base::FilePath downloads_path; + base::PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS_SAFE, &downloads_path); + auto file_path = downloads_path.Append(file_name); + + struct stat file_stats; + if (stat(file_path.value().c_str(), &file_stats) != 0) { + std::move(callback).Run(0); + return; + } + + std::move(callback).Run(file_stats.st_ino); +} + void DlpInternalsPageHandler::OnReportEvent(DlpPolicyEvent event) { dlp_internals::mojom::DlpEventPtr event_mojo = dlp_internals::mojom::DlpEvent::New();
diff --git a/chrome/browser/ui/webui/dlp_internals/dlp_internals_page_handler.h b/chrome/browser/ui/webui/dlp_internals/dlp_internals_page_handler.h index badd5f2..a7c5e0f 100644 --- a/chrome/browser/ui/webui/dlp_internals/dlp_internals_page_handler.h +++ b/chrome/browser/ui/webui/dlp_internals/dlp_internals_page_handler.h
@@ -43,6 +43,8 @@ override; void GetFilesDatabaseEntries( GetFilesDatabaseEntriesCallback callback) override; + void GetFileInode(const std::string& file_name, + GetFileInodeCallback callback) override; // DlpReportingManager::Observer void OnReportEvent(DlpPolicyEvent event) override;
diff --git a/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc index 7da9b7c..be26d5d4 100644 --- a/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc +++ b/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc
@@ -34,6 +34,7 @@ #include "chrome/browser/download/offline_item_utils.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/safe_browsing/download_protection/download_protection_util.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_window.h" @@ -475,6 +476,8 @@ return; } + LogDeepScanEvent(download, + safe_browsing::DeepScanEvent::kPromptAcceptedFromWebUI); DownloadItemModel model(download); DownloadCommands commands(model.GetWeakPtr()); commands.ExecuteCommand(DownloadCommands::DEEP_SCAN);
diff --git a/chrome/browser/ui/webui/new_tab_page/new_tab_page.mojom b/chrome/browser/ui/webui/new_tab_page/new_tab_page.mojom index df27754d..834bd505 100644 --- a/chrome/browser/ui/webui/new_tab_page/new_tab_page.mojom +++ b/chrome/browser/ui/webui/new_tab_page/new_tab_page.mojom
@@ -44,6 +44,7 @@ kFirstPartyThemeWithDailyRefresh, kThirdPartyTheme, kUploadedImage, + kWallpaperSearch, }; // Enum representing the in product help promo to trigger.
diff --git a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc index 9410aa7..7decec9 100644 --- a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc +++ b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc
@@ -244,6 +244,9 @@ if (custom_background->daily_refresh_enabled) { image_source = new_tab_page::mojom::NtpBackgroundImageSource:: kFirstPartyThemeWithDailyRefresh; + } else if (custom_background->local_background_id.has_value()) { + image_source = + new_tab_page::mojom::NtpBackgroundImageSource::kWallpaperSearch; } else if (custom_background->is_uploaded_image) { image_source = new_tab_page::mojom::NtpBackgroundImageSource::kUploadedImage;
diff --git a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler_unittest.cc b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler_unittest.cc index 45b419a..745a7ac 100644 --- a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler_unittest.cc +++ b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler_unittest.cc
@@ -14,6 +14,7 @@ #include "base/test/metrics/histogram_tester.h" #include "base/test/mock_callback.h" #include "base/test/scoped_feature_list.h" +#include "base/token.h" #include "chrome/browser/new_tab_page/feature_promo_helper/new_tab_page_feature_promo_helper.h" #include "chrome/browser/new_tab_page/promos/promo_data.h" #include "chrome/browser/new_tab_page/promos/promo_service.h" @@ -622,6 +623,31 @@ theme->background_image->image_source); } +TEST_P(NewTabPageHandlerThemeTest, SetWallpaperSearchImage) { + new_tab_page::mojom::ThemePtr theme; + EXPECT_CALL(mock_page_, SetTheme) + .Times(1) + .WillOnce(testing::Invoke([&theme](new_tab_page::mojom::ThemePtr arg) { + theme = std::move(arg); + })); + CustomBackground custom_background; + custom_background.is_uploaded_image = true; + custom_background.local_background_id = base::Token::CreateRandom(); + custom_background.daily_refresh_enabled = false; + ON_CALL(mock_ntp_custom_background_service_, GetCustomBackground()) + .WillByDefault(testing::Return(absl::make_optional(custom_background))); + ON_CALL(mock_theme_service_, UsingDefaultTheme()) + .WillByDefault(testing::Return(false)); + + ntp_custom_background_service_observer_->OnCustomBackgroundImageUpdated(); + mock_page_.FlushForTesting(); + + ASSERT_TRUE(theme); + ASSERT_TRUE(theme->background_image); + EXPECT_EQ(new_tab_page::mojom::NtpBackgroundImageSource::kWallpaperSearch, + theme->background_image->image_source); +} + TEST_P(NewTabPageHandlerThemeTest, SetThirdPartyTheme) { new_tab_page::mojom::ThemePtr theme; EXPECT_CALL(mock_page_, SetTheme)
diff --git a/chrome/browser/ui/webui/side_panel/performance_controls/performance_side_panel_ui.cc b/chrome/browser/ui/webui/side_panel/performance_controls/performance_side_panel_ui.cc index 1077324..084a71f 100644 --- a/chrome/browser/ui/webui/side_panel/performance_controls/performance_side_panel_ui.cc +++ b/chrome/browser/ui/webui/side_panel/performance_controls/performance_side_panel_ui.cc
@@ -19,6 +19,7 @@ #include "chrome/grit/side_panel_performance_resources_map.h" #include "chrome/grit/side_panel_shared_resources.h" #include "chrome/grit/side_panel_shared_resources_map.h" +#include "components/performance_manager/public/features.h" #include "components/strings/grit/components_strings.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" @@ -43,6 +44,15 @@ IDR_SIDE_PANEL_PERFORMANCE_PERFORMANCE_HTML); source->AddResourcePaths(base::make_span(kSidePanelSharedResources, kSidePanelSharedResourcesSize)); + + source->AddBoolean( + "isPerformanceCPUInterventionEnabled", + base::FeatureList::IsEnabled( + performance_manager::features::kPerformanceCPUIntervention)); + source->AddBoolean( + "isPerformanceMemoryInterventionEnabled", + base::FeatureList::IsEnabled( + performance_manager::features::kPerformanceMemoryIntervention)); } PerformanceSidePanelUI::~PerformanceSidePanelUI() = default;
diff --git a/chrome/browser/user_agent/user_agent_browsertest.cc b/chrome/browser/user_agent/user_agent_browsertest.cc index 3224561f..0e7d032 100644 --- a/chrome/browser/user_agent/user_agent_browsertest.cc +++ b/chrome/browser/user_agent/user_agent_browsertest.cc
@@ -84,7 +84,7 @@ void SetUp() override { std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->InitializeFromCommandLine( + feature_list->InitFromCommandLine( "ReduceUserAgentMinorVersion,ReduceUserAgentPlatformOsCpu", ""); scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); InProcessBrowserTest::SetUp();
diff --git a/chrome/browser/web_applications/app_service/browser_shortcuts_unittest.cc b/chrome/browser/web_applications/app_service/browser_shortcuts_unittest.cc index 8e842886..3a941b2 100644 --- a/chrome/browser/web_applications/app_service/browser_shortcuts_unittest.cc +++ b/chrome/browser/web_applications/app_service/browser_shortcuts_unittest.cc
@@ -19,6 +19,7 @@ #include "chrome/browser/web_applications/test/web_app_icon_test_utils.h" #include "chrome/browser/web_applications/test/web_app_install_test_utils.h" #include "chrome/browser/web_applications/web_app.h" +#include "chrome/browser/web_applications/web_app_icon_generator.h" #include "chrome/browser/web_applications/web_app_icon_manager.h" #include "chrome/browser/web_applications/web_app_ui_manager.h" #include "chrome/test/base/testing_profile.h" @@ -33,6 +34,7 @@ namespace { const char kUrl[] = "https://example.com/"; +const char kIconUrl[] = "https://example.com/icon"; } namespace web_app { @@ -48,7 +50,8 @@ test::AwaitStartWebAppProviderAndSubsystems(profile()); } - std::string CreateShortcut(const std::string& shortcut_name) { + std::string CreateShortcut(const std::string& shortcut_name, + bool with_icon = false) { const GURL kAppUrl(kUrl); // Create a web app entry without scope, which would be recognised @@ -57,6 +60,13 @@ web_app_info->title = base::UTF8ToUTF16(shortcut_name); web_app_info->start_url = kAppUrl; + if (with_icon) { + const GeneratedIconsInfo icon_info( + IconPurpose::ANY, {web_app::icon_size::k32}, {SK_ColorBLACK}); + web_app::AddIconsToWebAppInstallInfo(web_app_info.get(), GURL(kIconUrl), + {icon_info}); + } + std::string app_id = test::InstallWebApp(profile(), std::move(web_app_info), /*overwrite_existing_manifest_fields=*/true); @@ -187,7 +197,7 @@ const std::string kShortcutName = "Shortcut"; - auto local_shortcut_id = CreateShortcut(kShortcutName); + auto local_shortcut_id = CreateShortcut(kShortcutName, /*with_icon = */ true); apps::ShortcutId expected_shortcut_id = apps::GenerateShortcutId(app_constants::kChromeAppId, local_shortcut_id); @@ -210,7 +220,7 @@ EXPECT_TRUE(stored_shortcut->icon_key.has_value()); EXPECT_EQ( stored_shortcut->icon_key->icon_effects, - apps::IconEffects::kRoundCorners | apps::IconEffects::kCrOsStandardMask); + apps::IconEffects::kRoundCorners | apps::IconEffects::kCrOsStandardIcon); } TEST_F(BrowserShortcutsTest, LaunchShortcut) {
diff --git a/chrome/browser/web_applications/app_service/lacros_browser_shortcuts_controller_unittest.cc b/chrome/browser/web_applications/app_service/lacros_browser_shortcuts_controller_unittest.cc index ef39ffc..39e3317 100644 --- a/chrome/browser/web_applications/app_service/lacros_browser_shortcuts_controller_unittest.cc +++ b/chrome/browser/web_applications/app_service/lacros_browser_shortcuts_controller_unittest.cc
@@ -12,7 +12,9 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/web_applications/app_service/web_apps_with_shortcuts_test.h" #include "chrome/browser/web_applications/test/fake_web_app_provider.h" +#include "chrome/browser/web_applications/test/web_app_icon_test_utils.h" #include "chrome/browser/web_applications/test/web_app_install_test_utils.h" +#include "chrome/browser/web_applications/web_app_icon_generator.h" #include "chrome/browser/web_applications/web_app_icon_manager.h" #include "chrome/browser/web_applications/web_app_registrar.h" #include "chrome/test/base/testing_profile.h" @@ -92,11 +94,20 @@ } std::string CreateWebAppBasedShortcut(const GURL& shortcut_url, - const std::u16string& shortcut_name) { + const std::u16string& shortcut_name, + bool with_icon = false) { // Create web app based shortcut. auto web_app_info = std::make_unique<web_app::WebAppInstallInfo>(); web_app_info->start_url = shortcut_url; web_app_info->title = shortcut_name; + + if (with_icon) { + const GeneratedIconsInfo icon_info( + IconPurpose::ANY, {web_app::icon_size::k32}, {SK_ColorBLACK}); + web_app::AddIconsToWebAppInstallInfo( + web_app_info.get(), GURL(shortcut_url.spec() + "/icon"), {icon_info}); + } + auto local_shortcut_id = web_app::test::InstallWebApp( profile(), std::move(web_app_info), /*overwrite_existing_manifest_fields=*/true); @@ -162,7 +173,8 @@ apps::IconEffects::kRoundCorners | apps::IconEffects::kCrOsStandardMask); auto local_id_2 = CreateWebAppBasedShortcut( - GURL("https://www.another-example.com/"), u"another shortcut name"); + GURL("https://www.another-example.com/"), u"another shortcut name", + /*with_icon = */ true); EXPECT_EQ(fake_publisher()->get_deltas().size(), 2U); EXPECT_EQ(fake_publisher()->get_deltas().back()->local_id, local_id_2); @@ -177,7 +189,7 @@ EXPECT_TRUE(fake_publisher()->get_deltas().back()->icon_key.has_value()); EXPECT_EQ( fake_publisher()->get_deltas().back()->icon_key->icon_effects, - apps::IconEffects::kRoundCorners | apps::IconEffects::kCrOsStandardMask); + apps::IconEffects::kRoundCorners | apps::IconEffects::kCrOsStandardIcon); } TEST_F(LacrosBrowserShortcutsControllerTest, WebAppNotPublished) {
diff --git a/chrome/browser/web_applications/commands/external_app_resolution_command.cc b/chrome/browser/web_applications/commands/external_app_resolution_command.cc index 59e857f..b79bc21c 100644 --- a/chrome/browser/web_applications/commands/external_app_resolution_command.cc +++ b/chrome/browser/web_applications/commands/external_app_resolution_command.cc
@@ -481,7 +481,6 @@ /*is_offline_install=*/false, ExternallyManagedAppManager::InstallResult( std::move(code), app_id, uninstall_triggered))); - base::OnceClosure finalized_callback; if (relaunch_app) { apps::AppLaunchParams app_launch_params( @@ -495,7 +494,7 @@ base::BindOnce(&WebAppUiManager::NotifyAppRelaunchState, provider->ui_manager().GetWeakPtr(), *installed_placeholder_app_id_, app_id, - profile_->GetWeakPtr(), + web_app_info_->title, profile_->GetWeakPtr(), AppRelaunchState::kAppAboutToRelaunch) .Then( base::BindOnce( @@ -504,12 +503,12 @@ std::move(app_launch_params), base::IgnoreArgs<base::WeakPtr<Browser>, base::WeakPtr<content::WebContents>, - apps::LaunchContainer>( - base::BindOnce(&WebAppUiManager::NotifyAppRelaunchState, - provider->ui_manager().GetWeakPtr(), - *installed_placeholder_app_id_, app_id, - profile_->GetWeakPtr(), - AppRelaunchState::kAppRelaunched)), + apps::LaunchContainer>(base::BindOnce( + &WebAppUiManager::NotifyAppRelaunchState, + provider->ui_manager().GetWeakPtr(), + *installed_placeholder_app_id_, app_id, + web_app_info_->title, profile_->GetWeakPtr(), + AppRelaunchState::kAppRelaunched)), FROM_HERE) .Then(std::move(installed_callback_with_arguments_bound))); } else { @@ -530,8 +529,8 @@ if (uninstall_placeholder) { if (relaunch_app) { provider->ui_manager().NotifyAppRelaunchState( - *installed_placeholder_app_id_, app_id, profile_->GetWeakPtr(), - AppRelaunchState::kAppClosingForRelaunch); + *installed_placeholder_app_id_, app_id, web_app_info_->title, + profile_->GetWeakPtr(), AppRelaunchState::kAppClosingForRelaunch); } auto& scheduler = WebAppProvider::GetForWebApps(&profile_.get())->scheduler();
diff --git a/chrome/browser/web_applications/commands/external_app_resolution_command_unittest.cc b/chrome/browser/web_applications/commands/external_app_resolution_command_unittest.cc index 774df522..b0aac2af 100644 --- a/chrome/browser/web_applications/commands/external_app_resolution_command_unittest.cc +++ b/chrome/browser/web_applications/commands/external_app_resolution_command_unittest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/web_applications/commands/external_app_resolution_command.h" #include <memory> +#include <string> #include "base/containers/contains.h" #include "base/containers/flat_map.h" @@ -60,8 +61,9 @@ public: MOCK_METHOD(void, NotifyAppRelaunchState, - (std::string placeholder_app_id, - std::string final_app_id, + (const webapps::AppId& placeholder_app_id, + const webapps::AppId& final_app_id, + const std::u16string& final_app_name, base::WeakPtr<Profile> profile, AppRelaunchState relaunch_state), (override)); @@ -434,7 +436,7 @@ MockWebAppUiManager& ui_manager = static_cast<MockWebAppUiManager&>(fake_ui_manager()); - EXPECT_CALL(ui_manager, NotifyAppRelaunchState(_, _, _, _)).Times(0); + EXPECT_CALL(ui_manager, NotifyAppRelaunchState(_, _, _, _, _)).Times(0); auto result = InstallAndWait(options, std::move(data_retriever)); @@ -490,15 +492,15 @@ /*manifest_id_path=*/absl::nullopt, kWebAppUrl))) .WillOnce(Return(1u)); EXPECT_CALL(ui_manager, - NotifyAppRelaunchState(placeholder_app_id, final_app_id, _, + NotifyAppRelaunchState(placeholder_app_id, final_app_id, _, _, AppRelaunchState::kAppAboutToRelaunch)) .Times(1); EXPECT_CALL(ui_manager, - NotifyAppRelaunchState(placeholder_app_id, final_app_id, _, + NotifyAppRelaunchState(placeholder_app_id, final_app_id, _, _, AppRelaunchState::kAppClosingForRelaunch)) .Times(1); EXPECT_CALL(ui_manager, - NotifyAppRelaunchState(placeholder_app_id, final_app_id, _, + NotifyAppRelaunchState(placeholder_app_id, final_app_id, _, _, AppRelaunchState::kAppRelaunched)) .Times(1); @@ -559,7 +561,7 @@ EXPECT_CALL(ui_manager, GetNumWindowsForApp(GenerateAppId( /*manifest_id_path=*/absl::nullopt, kWebAppUrl))) .WillOnce(Return(0u)); - EXPECT_CALL(ui_manager, NotifyAppRelaunchState(_, _, _, _)).Times(0); + EXPECT_CALL(ui_manager, NotifyAppRelaunchState(_, _, _, _, _)).Times(0); auto result = InstallAndWait(options);
diff --git a/chrome/browser/web_applications/test/fake_web_app_ui_manager.cc b/chrome/browser/web_applications/test/fake_web_app_ui_manager.cc index 382316e..871e5705 100644 --- a/chrome/browser/web_applications/test/fake_web_app_ui_manager.cc +++ b/chrome/browser/web_applications/test/fake_web_app_ui_manager.cc
@@ -181,8 +181,9 @@ #endif // BUILDFLAG(IS_CHROMEOS) void FakeWebAppUiManager::NotifyAppRelaunchState( - std::string placeholder_app_id, - std::string final_app_id, + const webapps::AppId& placeholder_app_id, + const webapps::AppId& final_app_id, + const std::u16string& final_app_name, base::WeakPtr<Profile> profile, AppRelaunchState relaunch_state) {}
diff --git a/chrome/browser/web_applications/test/fake_web_app_ui_manager.h b/chrome/browser/web_applications/test/fake_web_app_ui_manager.h index a916a221..fc085d0 100644 --- a/chrome/browser/web_applications/test/fake_web_app_ui_manager.h +++ b/chrome/browser/web_applications/test/fake_web_app_ui_manager.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_WEB_APPLICATIONS_TEST_FAKE_WEB_APP_UI_MANAGER_H_ #define CHROME_BROWSER_WEB_APPLICATIONS_TEST_FAKE_WEB_APP_UI_MANAGER_H_ +#include <string> #include <vector> #include "base/containers/flat_map.h" @@ -13,6 +14,7 @@ #include "base/values.h" #include "chrome/browser/web_applications/web_app_ui_manager.h" #include "components/services/app_service/public/cpp/app_launch_util.h" +#include "components/webapps/common/web_app_id.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace base { @@ -97,8 +99,9 @@ const std::vector<std::string>& app_names, base::WeakPtr<Profile> profile) override; #endif - void NotifyAppRelaunchState(std::string placeholder_app_id, - std::string final_app_id, + void NotifyAppRelaunchState(const webapps::AppId& placeholder_app_id, + const webapps::AppId& final_app_id, + const std::u16string& final_app_name, base::WeakPtr<Profile> profile, AppRelaunchState relaunch_state) override; content::WebContents* CreateNewTab() override;
diff --git a/chrome/browser/web_applications/web_app_ui_manager.h b/chrome/browser/web_applications/web_app_ui_manager.h index 9247ea7a..25933fbb 100644 --- a/chrome/browser/web_applications/web_app_ui_manager.h +++ b/chrome/browser/web_applications/web_app_ui_manager.h
@@ -220,8 +220,9 @@ // Displays the user about the status of a force app relaunch. This happens // when a placeholder with `placeholder_app_id` is installed and running, and // then is updated with an app with `final_app_id`. - virtual void NotifyAppRelaunchState(std::string placeholder_app_id, - std::string final_app_id, + virtual void NotifyAppRelaunchState(const webapps::AppId& placeholder_app_id, + const webapps::AppId& final_app_id, + const std::u16string& final_app_name, base::WeakPtr<Profile> profile, AppRelaunchState relaunch_state) = 0;
diff --git a/chrome/browser/webauthn/chrome_webauthn_browsertest.cc b/chrome/browser/webauthn/chrome_webauthn_browsertest.cc index 57329c8..d0dc93c 100644 --- a/chrome/browser/webauthn/chrome_webauthn_browsertest.cc +++ b/chrome/browser/webauthn/chrome_webauthn_browsertest.cc
@@ -155,7 +155,8 @@ scoped_refptr<device::MockBluetoothAdapter> mock_bluetooth_adapter_ = nullptr; device::FidoRequestHandlerBase::ScopedAlwaysAllowBLECalls always_allow_ble_; net::EmbeddedTestServer https_server_{net::EmbeddedTestServer::TYPE_HTTPS}; - base::test::ScopedFeatureList scoped_feature_list_; + const base::test::ScopedFeatureList scoped_feature_list{ + device::kWebAuthnRelatedOrigin}; }; static constexpr char kGetAssertionCredID1234[] = R"((() => { @@ -254,6 +255,27 @@ "webauthn: OK", content::EvalJs(browser()->tab_strip_model()->GetActiveWebContents(), kGetAssertionCredID1234)); + + static constexpr char kMakeCredentialCrossDomain[] = R"((() => { + return navigator.credentials.create({ publicKey: { + rp: { id: "example.com", name: "" }, + user: { id: new Uint8Array([0]), name: "foo", displayName: "" }, + pubKeyCredParams: [{type: "public-key", alg: -7}], + challenge: new Uint8Array([0]), + timeout: 10000, + userVerification: 'discouraged', + }}).then(c => 'webauthn: OK', + e => 'error ' + e); +})())"; + + // This should fail with INVALID_PROTOCOL and never one of the errors from + // related-origin processing because extensions don't participate in that + // system. + EXPECT_THAT( + content::EvalJs(browser()->tab_strip_model()->GetActiveWebContents(), + kMakeCredentialCrossDomain) + .ExtractString(), + testing::HasSubstr("Public-key credentials are only available to")); } #if BUILDFLAG(IS_WIN)
diff --git a/chrome/browser/webshare/share_service_browsertest.cc b/chrome/browser/webshare/share_service_browsertest.cc index 08c5c2a..b1507e9 100644 --- a/chrome/browser/webshare/share_service_browsertest.cc +++ b/chrome/browser/webshare/share_service_browsertest.cc
@@ -13,6 +13,7 @@ #include "chrome/common/chrome_features.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/safe_browsing/content/common/file_type_policies_test_util.h" #include "components/safe_browsing/core/browser/db/fake_database_manager.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_frame_host.h" @@ -147,6 +148,19 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingShareServiceBrowserTest, PortableDocumentFile) { + safe_browsing::FileTypePoliciesTestOverlay policies; + std::unique_ptr<safe_browsing::DownloadFileTypeConfig> file_type_config = + std::make_unique<safe_browsing::DownloadFileTypeConfig>(); + auto* file_type = file_type_config->mutable_default_file_type(); + file_type->set_uma_value(-1); + file_type->set_ping_setting(safe_browsing::DownloadFileType::FULL_PING); + auto* platform_settings = file_type->add_platform_settings(); + platform_settings->set_danger_level( + safe_browsing::DownloadFileType::NOT_DANGEROUS); + platform_settings->set_auto_open_hint( + safe_browsing::DownloadFileType::ALLOW_AUTO_OPEN); + policies.SwapConfig(file_type_config); + ASSERT_TRUE(embedded_test_server()->Start()); GURL url(embedded_test_server()->GetURL("/webshare/index.html")); ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url));
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt index 734647ab..5da6af5 100644 --- a/chrome/build/android-arm32.pgo.txt +++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@ -chrome-android32-main-1701280711-9b97f76fcb8d08d9afa748fcc659c93d40e002c5.profdata +chrome-android32-main-1701345003-101c15daf394a153f93de0a1069c318483c0639b.profdata
diff --git a/chrome/build/android-arm64.pgo.txt b/chrome/build/android-arm64.pgo.txt index b3f7b76..3e8dd80 100644 --- a/chrome/build/android-arm64.pgo.txt +++ b/chrome/build/android-arm64.pgo.txt
@@ -1 +1 @@ -chrome-android64-main-1701280711-2764b0f647e441f0f7b85a745602672b42ca2445.profdata +chrome-android64-main-1701345003-b0915745dbdf8d0cae1ac6da6da6a9e46adadd89.profdata
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index bce09408..3d2dd7a 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1701259184-a50d5f322404be194a691c359c3d87869cb74278.profdata +chrome-linux-main-1701323948-c79cb546ba431b6419a33d8c2f6acd33e87b9b52.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index 971efc3..bd9dc2f8 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1701273439-b3af7d5cd39986d000e24b087fdd88f9c56ba121.profdata +chrome-mac-arm-main-1701345003-3eac2be8acd866bc4ffa59fdf851c043237c8077.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 1f2baa5..16dd046 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1701259184-28db465c462b35d8d91faeebe6b2643ed54a757b.profdata +chrome-mac-main-1701323948-2771da2af3827446b855775c49135cc05bd55a89.profdata
diff --git a/chrome/build/win-arm64.pgo.txt b/chrome/build/win-arm64.pgo.txt index d19c25c..c26016f08 100644 --- a/chrome/build/win-arm64.pgo.txt +++ b/chrome/build/win-arm64.pgo.txt
@@ -1 +1 @@ -chrome-win-arm64-main-1701259184-3dcb474e4e663edf0f5c3b1e84afc07d293898f8.profdata +chrome-win-arm64-main-1701323948-ad297ba460b5bc3c0086d7e82b85cf09cec7aa4d.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index a8da208..be92b19 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1701269830-861308b97bff8eaa520690eac8c5fbfe5dcb1621.profdata +chrome-win32-main-1701323948-199a4287ce3ebd9a6e706190149423ebf0452f9e.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index a5af79e..e9299a4 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1701259184-7329774ee088b0317a0eec4d9134dc7a136057e1.profdata +chrome-win64-main-1701334502-a09badb510e4ea5ae00f60b148cffa46d924de4a.profdata
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index 9f7c8fd..3d7b8d6 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -278,8 +278,6 @@ BASE_DECLARE_FEATURE(kFlashDeprecationWarning); #endif -COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kFocusMode); - COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kGeoLanguage); COMPONENT_EXPORT(CHROME_FEATURES) BASE_DECLARE_FEATURE(kPrivacyGuide3);
diff --git a/chrome/common/compose/compose.mojom b/chrome/common/compose/compose.mojom index d8a97d6..7322677 100644 --- a/chrome/common/compose/compose.mojom +++ b/chrome/common/compose/compose.mojom
@@ -48,6 +48,17 @@ kPermissionDenied = 6, }; +// Whether the user has consented to page content sharing and acknowledged this +// consent in compose. +enum ConsentState { + // Consent has not been given + kUnset, + // Consent has been given but not acknowledged in compose + kExternalConsented, + // Consent has been given and acknowledged in compose + kConsented, +}; + // Configuration parameters used in rewrite requests, specifying how the // response should be changed. union StyleModifiers { @@ -96,6 +107,7 @@ // Information needed by the WebUI to show a new or restored // compose dialog. struct OpenMetadata { + ConsentState consent_state; // Renderer provided text selection. string initial_input; ComposeState compose_state; @@ -104,7 +116,11 @@ // The trigger for dismissing the compose dialog. enum CloseReason { - // The X button on the upper-right of the dialog. + // The X button on the upper-right of the consent/disclaimer dialog. + kConsentCloseButton, + // The page content consent was declined. + kPageContentConsentDeclined, + // The X button on the upper-right of the main app dialog. kCloseButton, // The Insert button of the dialog. kInsertButton, @@ -160,6 +176,10 @@ // Buganizer. OpenBugReportingLink(); + // Asks the Browser to open a new tab navigated to the Dogfood feedback + // survey. + OpenFeedbackSurveyLink(); + // Asks the Browser to open a new tab navigated to the Compose-related Chrome // settings page. OpenComposeSettings(); @@ -175,6 +195,10 @@ // Asks the receiver to close the compose dialog. `reason` describes // the user action that triggered the close. CloseUI(CloseReason reason); + // Notifies the browser that the page content consent was approved. + ApproveConsent(); + // Notifies the browser that the page content disclaimer was acknowledged. + AcknowledgeConsentDisclaimer(); }; // Interface for calls from the Browser process into Compose dialog JS.
diff --git a/chrome/common/extensions/api/tabs.json b/chrome/common/extensions/api/tabs.json index 4cad18d..5ed996ca 100644 --- a/chrome/common/extensions/api/tabs.json +++ b/chrome/common/extensions/api/tabs.json
@@ -55,6 +55,7 @@ "windowId": {"type": "integer", "minimum": 0, "description": "The ID of the window that contains the tab."}, "openerTabId": {"type": "integer", "minimum": 0, "optional": true, "description": "The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists."}, "selected": {"type": "boolean", "description": "Whether the tab is selected.", "deprecated": "Please use $(ref:tabs.Tab.highlighted)."}, + "lastAccessed": {"type": "number", "optional": true, "description": "The last time the tab was accessed as the number of milliseconds since epoch."}, "highlighted": {"type": "boolean", "description": "Whether the tab is highlighted."}, "active": {"type": "boolean", "description": "Whether the tab is active in its window. Does not necessarily mean the window is focused."}, "pinned": {"type": "boolean", "description": "Whether the tab is pinned."},
diff --git a/chrome/common/google_url_loader_throttle.cc b/chrome/common/google_url_loader_throttle.cc index f5b7bd0d..df687ecf 100644 --- a/chrome/common/google_url_loader_throttle.cc +++ b/chrome/common/google_url_loader_throttle.cc
@@ -16,6 +16,7 @@ #include "components/safe_search_api/safe_search_util.h" #include "net/base/url_util.h" #include "services/network/public/cpp/resource_request.h" +#include "services/network/public/mojom/fetch_api.mojom.h" #include "services/network/public/mojom/url_response_head.mojom.h" #include "services/network/public/mojom/x_frame_options.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -148,6 +149,11 @@ } #endif #if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS) + // `network::mojom::RequestDestination::kDocument` means that this is a + // navigation request. + is_main_frame_navigation_ = + request->is_outermost_main_frame && + request->destination == network::mojom::RequestDestination::kDocument; if (switches::IsBoundSessionCredentialsEnabled() && request->SendsCookies() && ShouldDeferRequestForBoundSession( request->url, @@ -263,6 +269,11 @@ base::TimeTicks::Now() - *bound_session_request_throttled_start_time_; UMA_HISTOGRAM_MEDIUM_TIMES( "Signin.BoundSessionCredentials.DeferredRequestDelay", duration); + if (is_main_frame_navigation_) { + UMA_HISTOGRAM_MEDIUM_TIMES( + "Signin.BoundSessionCredentials.DeferredNavigationRequestDelay", + duration); + } bound_session_request_throttled_start_time_ = absl::nullopt; switch (unblock_action) {
diff --git a/chrome/common/google_url_loader_throttle.h b/chrome/common/google_url_loader_throttle.h index 2a5cd01..a8876b6c 100644 --- a/chrome/common/google_url_loader_throttle.h +++ b/chrome/common/google_url_loader_throttle.h
@@ -73,6 +73,7 @@ std::unique_ptr<BoundSessionRequestThrottledHandler> bound_session_request_throttled_handler_; absl::optional<base::TimeTicks> bound_session_request_throttled_start_time_; + bool is_main_frame_navigation_ = false; #endif #if BUILDFLAG(IS_ANDROID)
diff --git a/chrome/common/google_url_loader_throttle_unittest.cc b/chrome/common/google_url_loader_throttle_unittest.cc index b4ac2040..bc0c3695 100644 --- a/chrome/common/google_url_loader_throttle_unittest.cc +++ b/chrome/common/google_url_loader_throttle_unittest.cc
@@ -14,6 +14,7 @@ #include "chrome/common/renderer_configuration.mojom.h" #include "components/signin/public/base/signin_switches.h" #include "services/network/public/cpp/resource_request.h" +#include "services/network/public/mojom/fetch_api.mojom.h" #include "services/network/public/mojom/url_response_head.mojom.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -116,7 +117,8 @@ } void UnblockRequestAndVerifyCallbackAction( - BoundSessionRequestThrottledHandler::UnblockAction unblock_action) { + BoundSessionRequestThrottledHandler::UnblockAction unblock_action, + bool is_expected_navigation = false) { switch (unblock_action) { case BoundSessionRequestThrottledHandler::UnblockAction::kResume: EXPECT_CALL(*delegate(), Resume()); @@ -134,6 +136,9 @@ histogram_tester_->ExpectTotalCount( "Signin.BoundSessionCredentials.DeferredRequestDelay", /*expected_count=*/1); + histogram_tester_->ExpectTotalCount( + "Signin.BoundSessionCredentials.DeferredNavigationRequestDelay", + /*expected_count=*/is_expected_navigation ? 1 : 0); histogram_tester_ = std::make_unique<base::HistogramTester>(); } @@ -317,6 +322,24 @@ BoundSessionRequestThrottledHandler::UnblockAction::kResume); } +TEST_P(GoogleURLLoaderThrottleTest, + InterceptNavigationBoundSessionCookieExpired) { + ConfigureBoundSessionThrottlerParams("google.com", "/", + base::Time::Now() - base::Minutes(10)); + bool defer = false; + network::ResourceRequest request; + request.url = GURL("https://accounts.google.com/test/bar.html"); + // Make `request` look like a main frame navigation request. + request.is_outermost_main_frame = true; + request.destination = network::mojom::RequestDestination::kDocument; + throttle()->WillStartRequest(&request, &defer); + EXPECT_TRUE(defer); + EXPECT_TRUE(bound_session_listener()->IsRequestBlocked()); + UnblockRequestAndVerifyCallbackAction( + BoundSessionRequestThrottledHandler::UnblockAction::kResume, + /*is_expected_navigation=*/true); +} + TEST_P(GoogleURLLoaderThrottleTest, NoInterceptBoundSessionFeatureOff) { base::test::ScopedFeatureList disable_feature; disable_feature.InitAndDisableFeature(
diff --git a/chrome/renderer/accessibility/ax_tree_distiller.cc b/chrome/renderer/accessibility/ax_tree_distiller.cc index 3dadd457..235e0cf 100644 --- a/chrome/renderer/accessibility/ax_tree_distiller.cc +++ b/chrome/renderer/accessibility/ax_tree_distiller.cc
@@ -43,7 +43,8 @@ ax::mojom::Role::kNavigation, }; -// Find all of the main and article nodes. +// Find all of the main and article nodes. Also, include unignored heading nodes +// which lie outside of the main and article node. // TODO(crbug.com/1266555): Replace this with a call to // OneShotAccessibilityTreeSearch. void GetContentRootNodes(const ui::AXNode* root, @@ -53,6 +54,7 @@ } std::queue<const ui::AXNode*> queue; queue.push(root); + bool has_main_or_heading = false; while (!queue.empty()) { const ui::AXNode* node = queue.front(); queue.pop(); @@ -61,6 +63,14 @@ if (node->GetRole() == ax::mojom::Role::kMain || node->GetRole() == ax::mojom::Role::kArticle) { content_root_nodes->push_back(node); + has_main_or_heading = true; + continue; + } + // If a heading node is found, add it to the list of content root nodes, + // too. It may be removed later if the tree doesn't contain a main or + // article node. + if (node->GetRole() == ax::mojom::Role::kHeading) { + content_root_nodes->push_back(node); continue; } for (auto iter = node->UnignoredChildrenBegin(); @@ -68,6 +78,9 @@ queue.push(iter.get()); } } + if (!has_main_or_heading) { + content_root_nodes->clear(); + } } // Recurse through the root node, searching for content nodes (any node whose
diff --git a/chrome/renderer/accessibility/ax_tree_distiller_browsertest.cc b/chrome/renderer/accessibility/ax_tree_distiller_browsertest.cc index 4a081d0..99bc387 100644 --- a/chrome/renderer/accessibility/ax_tree_distiller_browsertest.cc +++ b/chrome/renderer/accessibility/ax_tree_distiller_browsertest.cc
@@ -190,6 +190,23 @@ </div> <body>)HTML", {"Main", "Article 1", "Article 2", "Article 3"}}, + /* ----------------------- */ + {"simple_page_with_heading_outside_of_main", + R"HTML(<!doctype html> + <body> + <h1>Heading</h1> + <main> + <p>Main</p> + </main> + <body>)HTML", + {"Heading", "Main"}}, + /* ----------------------- */ + {"simple_page_with_heading_no_main", + R"HTML(<!doctype html> + <body> + <h1>Heading</h1> + <body>)HTML", + {}}, }; TEST_P(AXTreeDistillerTest, DistillsWebPage) {
diff --git a/chrome/renderer/chrome_render_frame_observer.cc b/chrome/renderer/chrome_render_frame_observer.cc index 1f858c69..11c0b05 100644 --- a/chrome/renderer/chrome_render_frame_observer.cc +++ b/chrome/renderer/chrome_render_frame_observer.cc
@@ -685,20 +685,6 @@ // loads, so attempt detection here first. if (translate_agent_ && (layout_type == blink::WebMeaningfulLayout::kFinishedParsing)) { - // Under kRetryLanguageDetection, do not attempt language detection if no - // page content was captured. - if (!base::FeatureList::IsEnabled(translate::kRetryLanguageDetection) || - contents.size()) { - translate_agent_->PageCaptured(contents); - } - } - // Under kRetryLanguageDetection, language detection may be attempted - // later when the page finishes loading if no content was captured at - // kFinishedParsing. - if (base::FeatureList::IsEnabled(translate::kRetryLanguageDetection) && - translate_agent_ && - (layout_type == blink::WebMeaningfulLayout::kFinishedLoading) && - !translate_agent_->WasPageContentCapturedForUrl()) { translate_agent_->PageCaptured(contents); }
diff --git a/chrome/renderer/extensions/api/file_browser_handler_custom_bindings.cc b/chrome/renderer/extensions/api/file_browser_handler_custom_bindings.cc index f9dc759..4981d86 100644 --- a/chrome/renderer/extensions/api/file_browser_handler_custom_bindings.cc +++ b/chrome/renderer/extensions/api/file_browser_handler_custom_bindings.cc
@@ -82,7 +82,7 @@ webframe, blink::kWebFileSystemTypeExternal, blink::WebString::FromUTF8(file_system_name), file_system_root) .CreateV8Entry(blink::WebString::FromUTF8(file_full_path), entry_type, - args.Holder(), isolate)); + isolate)); #endif }
diff --git a/chrome/renderer/extensions/api/file_manager_private_custom_bindings.cc b/chrome/renderer/extensions/api/file_manager_private_custom_bindings.cc index ef21ecbc..46183a45 100644 --- a/chrome/renderer/extensions/api/file_manager_private_custom_bindings.cc +++ b/chrome/renderer/extensions/api/file_manager_private_custom_bindings.cc
@@ -49,11 +49,11 @@ blink::WebLocalFrame* webframe = blink::WebLocalFrame::FrameForContext(context()->v8_context()); DCHECK(webframe); - args.GetReturnValue().Set( - blink::WebDOMFileSystem::Create( - webframe, blink::kWebFileSystemTypeExternal, - blink::WebString::FromUTF8(name), GURL(root_url)) - .ToV8Value(context()->v8_context()->Global(), isolate)); + args.GetReturnValue().Set(blink::WebDOMFileSystem::Create( + webframe, blink::kWebFileSystemTypeExternal, + blink::WebString::FromUTF8(name), + GURL(root_url)) + .ToV8Value(isolate)); } void FileManagerPrivateCustomBindings::GetExternalFileEntry(
diff --git a/chrome/renderer/extensions/api/media_galleries_custom_bindings.cc b/chrome/renderer/extensions/api/media_galleries_custom_bindings.cc index 159fd34..ed0679b 100644 --- a/chrome/renderer/extensions/api/media_galleries_custom_bindings.cc +++ b/chrome/renderer/extensions/api/media_galleries_custom_bindings.cc
@@ -51,11 +51,10 @@ fs_name.append(fs_mount); const GURL root_url( storage::GetExternalFileSystemRootURIString(origin, fs_mount)); - args.GetReturnValue().Set( - blink::WebDOMFileSystem::Create( - webframe, blink::kWebFileSystemTypeExternal, - blink::WebString::FromUTF8(fs_name), root_url) - .ToV8Value(context()->v8_context()->Global(), args.GetIsolate())); + args.GetReturnValue().Set(blink::WebDOMFileSystem::Create( + webframe, blink::kWebFileSystemTypeExternal, + blink::WebString::FromUTF8(fs_name), root_url) + .ToV8Value(args.GetIsolate())); } } // namespace extensions
diff --git a/chrome/renderer/extensions/api/sync_file_system_custom_bindings.cc b/chrome/renderer/extensions/api/sync_file_system_custom_bindings.cc index fc8e5028..c55e554 100644 --- a/chrome/renderer/extensions/api/sync_file_system_custom_bindings.cc +++ b/chrome/renderer/extensions/api/sync_file_system_custom_bindings.cc
@@ -56,11 +56,11 @@ blink::WebLocalFrame* webframe = blink::WebLocalFrame::FrameForContext(context()->v8_context()); - args.GetReturnValue().Set( - blink::WebDOMFileSystem::Create( - webframe, blink::kWebFileSystemTypeExternal, - blink::WebString::FromUTF8(name), GURL(root_url)) - .ToV8Value(context()->v8_context()->Global(), isolate)); + args.GetReturnValue().Set(blink::WebDOMFileSystem::Create( + webframe, blink::kWebFileSystemTypeExternal, + blink::WebString::FromUTF8(name), + GURL(root_url)) + .ToV8Value(isolate)); } } // namespace extensions
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index ad52289..a01aab8d 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -1116,6 +1116,7 @@ "../browser/ash/login/login_integration_test.cc", "../browser/ash/ml_integration_test.cc", "../browser/ash/power/ml/smart_dim/smart_dim_integration_test.cc", + "../browser/ash/scanning/scan_integration_test.cc", "../browser/ash/screenshot_integration_test.cc", "../browser/ash/system_web_apps/apps/terminal_integration_test.cc", "../browser/ash/web_handwriting_integration_test.cc", @@ -1136,7 +1137,10 @@ sources += [ "base/chromeos/crosier/test_accounts_test.cc" ] } - data = [ "//chrome/test/data/chromeos/web_handwriting/" ] + data = [ + "//chrome/test/data/chromeos/web_handwriting/", + "//chrome/test/data/scanning/", + ] deps += [ "//chrome/browser/ash:test_support", @@ -3726,6 +3730,7 @@ "../browser/extensions/navigation_extension_enabler_browsertest.cc", "../browser/extensions/offscreen_document_browsertest.cc", "../browser/extensions/options_page_apitest.cc", + "../browser/extensions/pack_extension_browsertest.cc", "../browser/extensions/permissions_manager_browsertest.cc", "../browser/extensions/process_management_browsertest.cc", "../browser/extensions/process_manager_browsertest.cc", @@ -4829,7 +4834,6 @@ "../browser/ui/webui/ash/add_supervision/add_supervision_metrics_recorder_browsertest.cc", "../browser/ui/webui/ash/add_supervision/add_supervision_ui_browsertest.cc", "../browser/ui/webui/ash/app_install/app_install_dialog_browsertest.cc", - "../browser/ui/webui/ash/bluetooth_pairing_dialog_browsertest-inl.h", "../browser/ui/webui/ash/cloud_upload/cloud_upload_dialog_browsertest.cc", "../browser/ui/webui/ash/cloud_upload/cloud_upload_dialog_browsertest.h", "../browser/ui/webui/ash/cloud_upload/drive_upload_handler_browsertest.cc", @@ -5000,6 +5004,7 @@ "//chrome/browser/ash:test_support", "//chrome/browser/ash/crosapi", "//chrome/browser/ash/crosapi:test_support", + "//chrome/browser/ash/geolocation:browser_tests", "//chrome/browser/ash/login/oobe_quick_start/connectivity:test_support", "//chrome/browser/ash/system_extensions:browser_tests", "//chrome/browser/ash/system_web_apps/types:types",
diff --git a/chrome/test/base/chromeos/ash_browser_test_starter.cc b/chrome/test/base/chromeos/ash_browser_test_starter.cc index 694ca6e..143726d 100644 --- a/chrome/test/base/chromeos/ash_browser_test_starter.cc +++ b/chrome/test/base/chromeos/ash_browser_test_starter.cc
@@ -12,12 +12,9 @@ #include "base/environment.h" #include "base/files/file_util.h" #include "base/strings/stringprintf.h" -#include "base/task/thread_pool.h" #include "base/test/bind.h" #include "base/test/test_future.h" #include "base/test/test_switches.h" -#include "base/test/test_timeouts.h" -#include "base/timer/timer.h" #include "chrome/browser/ash/crosapi/browser_manager.h" #include "chrome/browser/ash/crosapi/browser_manager_observer.h" #include "chrome/browser/ash/crosapi/browser_util.h" @@ -197,30 +194,12 @@ return true; } -void WaitForExoStarted(const base::FilePath& xdg_path) { - base::RepeatingTimer timer; - base::RunLoop run_loop; - timer.Start(FROM_HERE, base::Seconds(1), base::BindLambdaForTesting([&]() { - if (base::PathExists(xdg_path.Append("wayland-0")) && - base::PathExists(xdg_path.Append("wayland-0.lock"))) { - run_loop.Quit(); - } - })); - base::ThreadPool::PostDelayedTask(FROM_HERE, run_loop.QuitClosure(), - TestTimeouts::action_max_timeout()); - run_loop.Run(); - CHECK(base::PathExists(xdg_path.Append("wayland-0")) && - base::PathExists(xdg_path.Append("wayland-0.lock"))); -} - void AshBrowserTestStarter::StartLacros(InProcessBrowserTest* test_class_obj) { DCHECK(HasLacrosArgument()); crosapi::BrowserManager::Get()->set_device_ownership_waiter_for_testing( std::make_unique<crosapi::FakeDeviceOwnershipWaiter>()); - WaitForExoStarted(scoped_temp_dir_xdg_.GetPath()); - { NewLacrosWindowWatcher watcher; crosapi::BrowserManager::Get()->NewWindow(
diff --git a/chrome/test/data/extensions/api_test/context_menus/count/background.js b/chrome/test/data/extensions/api_test/context_menus/count/background.js index 49b1a52..cef8e29 100644 --- a/chrome/test/data/extensions/api_test/context_menus/count/background.js +++ b/chrome/test/data/extensions/api_test/context_menus/count/background.js
@@ -2,41 +2,36 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -function createMenuItems() { - // Create two parent items with two children each. - let parents = []; - parents.push(chrome.contextMenus.create({ - title: 'Test parent item 1', - id: 'parent1' - })); - parents.push(chrome.contextMenus.create({ - title: 'Test parent item 2', - id: 'parent2' - })); +// See MenuManager::kMaxItemsPerExtension. +const maxMenuItems = 1000; - let currentId = 1; - parents.forEach((parent) => { - let idString = 'child' + currentId; - ++currentId; - chrome.contextMenus.create({ - title: 'Child 1', - parentId: parent, - id: idString - }); +chrome.test.runTests([ + async function createTooManyMenuItems() { + // No menus should be initially created, since this extension only + // runs once, but remove all just in case. + await chrome.contextMenus.removeAll(); - idString = 'child' + currentId; - ++currentId; - chrome.contextMenus.create({ - title: 'Child 2', - parentId: parent, - id: idString - }); - }); -} + // Create the maximum allowed number of menus. + for (let i = 0; i < maxMenuItems; ++i) { + await new Promise((resolve) => { + chrome.contextMenus.create( + {title: `Test item ${i}`, + id: `item ${i}`}, + () => { + chrome.test.assertNoLastError(); + resolve(); + })}); + } -chrome.runtime.onInstalled.addListener(() => { - // Create the menu items and signal success. - createMenuItems(); - chrome.test.assertNoLastError(); - chrome.test.notifyPass(); -}); + // Try to create one more over the limit. + chrome.contextMenus.create( + {title: `Test item ${maxMenuItems}`, + id: `item ${maxMenuItems}`}, + () => { + chrome.test.assertLastError( + `An extension can create a maximum of ${maxMenuItems} menu ` + + 'items.'); + chrome.test.succeed(); + }); + }, +]);
diff --git a/chrome/test/data/extensions/api_test/tabs/basics/last_accessed/last_accessed.js b/chrome/test/data/extensions/api_test/tabs/basics/last_accessed/last_accessed.js new file mode 100644 index 0000000..c5b82873 --- /dev/null +++ b/chrome/test/data/extensions/api_test/tabs/basics/last_accessed/last_accessed.js
@@ -0,0 +1,46 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +var TEST_URL_1 = 'https://example.com/1'; +var TEST_URL_2 = 'https://example.com/2'; + +const scriptUrl = '_test_resources/api_test/tabs/basics/tabs_util.js'; +let loadScript = chrome.test.loadScript(scriptUrl); + +function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + +function createAndSelectTab(url) { + return new Promise((resolve) => { + chrome.tabs.create({ url: url }, (tab) => { + chrome.tabs.update(tab.id, { active: true }, function(selectedTab) { + resolve(selectedTab); + }); + }); + }); +} + +loadScript.then(async function() { +chrome.test.runTests([ + async function testLastAccessedForTwoTabs() { + let firstTabCreatedTime = Date.now(); + + const firstTab = await createAndSelectTab(TEST_URL_1); + assertTrue(firstTab.active); + assertTrue(firstTabCreatedTime < firstTab.lastAccessed); + + let secondTabCreatedTime = Date.now(); + // Adding a short delay to ensure different access times for each tab. + await sleep(1); + + const secondTab = await createAndSelectTab(TEST_URL_2); + assertTrue(secondTab.active); + assertTrue(secondTabCreatedTime < secondTab.lastAccessed); + + assertTrue(firstTab.lastAccessed < secondTab.lastAccessed); + chrome.test.succeed(); + }, +]); +});
diff --git a/chrome/test/data/extensions/api_test/tabs/basics/last_accessed/manifest.json b/chrome/test/data/extensions/api_test/tabs/basics/last_accessed/manifest.json new file mode 100644 index 0000000..0e55441 --- /dev/null +++ b/chrome/test/data/extensions/api_test/tabs/basics/last_accessed/manifest.json
@@ -0,0 +1,11 @@ +{ + "name": "chrome.tabs", + "version": "0.1", + "manifest_version": 2, + "description": "end-to-end browser test for chrome.tabs API", + "permissions": ["tabs"], + "background": { + "scripts": ["last_accessed.js"], + "persistent": true + } +}
diff --git a/chrome/test/data/webui/BUILD.gn b/chrome/test/data/webui/BUILD.gn index 34ef91c..4335ad84 100644 --- a/chrome/test/data/webui/BUILD.gn +++ b/chrome/test/data/webui/BUILD.gn
@@ -301,6 +301,9 @@ if (is_chromeos_ash) { in_files += [ "mocha_adapter.js", + + # TODO(dpapad): Remove this when all clients have been updated to use + # chromeos/mojo_webui_test_support.js. "mojo_webui_test_support.js", ] }
diff --git a/chrome/test/data/webui/chromeos/BUILD.gn b/chrome/test/data/webui/chromeos/BUILD.gn index 9ce9998..71b7d4dd 100644 --- a/chrome/test/data/webui/chromeos/BUILD.gn +++ b/chrome/test/data/webui/chromeos/BUILD.gn
@@ -185,6 +185,7 @@ "internet_detail_dialog_test.js", "mock_controller.js", "mock_controller.m.js", + "mojo_webui_test_support.js", "set_time_dialog_test.js", "test_browser_proxy.js", "test_util.js",
diff --git a/chrome/test/data/webui/chromeos/diagnostics/battery_status_card_test.js b/chrome/test/data/webui/chromeos/diagnostics/battery_status_card_test.js index 8aee405..8053d0b 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/battery_status_card_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/battery_status_card_test.js
@@ -4,7 +4,7 @@ import 'chrome://diagnostics/battery_status_card.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {BatteryStatusCardElement} from 'chrome://diagnostics/battery_status_card.js'; import {getDiagnosticsIcon} from 'chrome://diagnostics/diagnostics_utils.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/cellular_info_test.js b/chrome/test/data/webui/chromeos/diagnostics/cellular_info_test.js index 05ef2b38..4cfb7a0b 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/cellular_info_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/cellular_info_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/cellular_info.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {getLockType, getSignalStrength} from 'chrome://diagnostics/diagnostics_utils.js'; import {fakeCellularNetwork} from 'chrome://diagnostics/fake_data.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/connectivity_card_test.js b/chrome/test/data/webui/chromeos/diagnostics/connectivity_card_test.js index 633ccab..c88e9be 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/connectivity_card_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/connectivity_card_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/connectivity_card.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {ConnectivityCardElement} from 'chrome://diagnostics/connectivity_card.js'; import {fakeCellularNetwork, fakeEthernetNetwork, fakeNetworkGuidInfoList, fakeWifiNetwork} from 'chrome://diagnostics/fake_data.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/cpu_card_test.js b/chrome/test/data/webui/chromeos/diagnostics/cpu_card_test.js index 862954a..3fca6b2f 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/cpu_card_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/cpu_card_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/cpu_card.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {CpuCardElement} from 'chrome://diagnostics/cpu_card.js'; import {fakeCpuUsage, fakeMemoryUsage, fakeSystemInfo} from 'chrome://diagnostics/fake_data.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/data_point_test.js b/chrome/test/data/webui/chromeos/diagnostics/data_point_test.js index d360e09..843bf05 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/data_point_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/data_point_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/data_point.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {DataPointElement} from 'chrome://diagnostics/data_point.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/diagnostics_app_input_hiding_test.js b/chrome/test/data/webui/chromeos/diagnostics/diagnostics_app_input_hiding_test.js index a3ada1e..8d00667 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/diagnostics_app_input_hiding_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/diagnostics_app_input_hiding_test.js
@@ -4,7 +4,7 @@ import 'chrome://diagnostics/diagnostics_app.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {DiagnosticsAppElement} from 'chrome://diagnostics/diagnostics_app.js'; import {DiagnosticsBrowserProxyImpl} from 'chrome://diagnostics/diagnostics_browser_proxy.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/diagnostics_app_test.js b/chrome/test/data/webui/chromeos/diagnostics/diagnostics_app_test.js index a773001d..5aa7d0da 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/diagnostics_app_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/diagnostics_app_test.js
@@ -4,7 +4,7 @@ import 'chrome://diagnostics/diagnostics_app.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {DiagnosticsAppElement} from 'chrome://diagnostics/diagnostics_app.js'; import {DiagnosticsBrowserProxyImpl} from 'chrome://diagnostics/diagnostics_browser_proxy.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/diagnostics_network_icon_test.js b/chrome/test/data/webui/chromeos/diagnostics/diagnostics_network_icon_test.js index 5d9c333..2d16ff2 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/diagnostics_network_icon_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/diagnostics_network_icon_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {ConnectionStateType, CrosNetworkType, DiagnosticsNetworkIconElement, networkToNetworkStateAdapter} from 'chrome://diagnostics/diagnostics_network_icon.js'; import {fakeCellularDisabledNetwork, fakeCellularNetwork, fakeConnectingEthernetNetwork, fakeDisconnectedEthernetNetwork, fakeEthernetNetwork, fakePortalWifiNetwork, fakeWifiNetwork, fakeWifiNetworkDisabled} from 'chrome://diagnostics/fake_data.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/diagnostics_sticky_banner_test.js b/chrome/test/data/webui/chromeos/diagnostics/diagnostics_sticky_banner_test.js index fda73243..96435d9b 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/diagnostics_sticky_banner_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/diagnostics_sticky_banner_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {DiagnosticsStickyBannerElement} from 'chrome://diagnostics/diagnostics_sticky_banner.js'; import {assertEquals, assertFalse, assertNotEquals, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/diagnostics_utils_test.js b/chrome/test/data/webui/chromeos/diagnostics/diagnostics_utils_test.js index 3a78f5385..d789172 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/diagnostics_utils_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/diagnostics_utils_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/strings.m.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {convertKibToGibDecimalString, getNetworkCardTitle, getRoutineGroups, getSignalStrength, getSubnetMaskFromRoutingPrefix, setDisplayStateInTitleForTesting} from 'chrome://diagnostics/diagnostics_utils.js'; import {NetworkType} from 'chrome://diagnostics/network_health_provider.mojom-webui.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/drawing_provider_test.js b/chrome/test/data/webui/chromeos/diagnostics/drawing_provider_test.js index b6837ab5..2c8c356 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/drawing_provider_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/drawing_provider_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/strings.m.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {CanvasDrawingProvider} from 'chrome://diagnostics/drawing_provider.js'; import {constructRgba, DESTINATION_OVER, LINE_CAP, LINE_WIDTH, lookupCssVariableValue, MARK_COLOR, MARK_OPACITY, MARK_RADIUS, TRAIL_COLOR, TRAIL_MAX_OPACITY} from 'chrome://diagnostics/drawing_provider_utils.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/drawing_provider_utils_test.js b/chrome/test/data/webui/chromeos/diagnostics/drawing_provider_utils_test.js index 73f7ed5..de6f051 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/drawing_provider_utils_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/drawing_provider_utils_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/strings.m.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {constructRgba, getTrailOpacityFromPressure, lookupCssVariableValue, MARK_COLOR, MARK_OPACITY, TRAIL_COLOR, TRAIL_MAX_OPACITY} from 'chrome://diagnostics/drawing_provider_utils.js'; import {assertEquals} from 'chrome://webui-test/chromeos/chai_assert.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/ethernet_info_test.js b/chrome/test/data/webui/chromeos/diagnostics/ethernet_info_test.js index c3a835c..40c85ea 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/ethernet_info_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/ethernet_info_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/ethernet_info.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {fakeEthernetNetwork} from 'chrome://diagnostics/fake_data.js'; import {AuthenticationType, EthernetStateProperties, Network} from 'chrome://diagnostics/network_health_provider.mojom-webui.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/fake_network_health_provider_test.js b/chrome/test/data/webui/chromeos/diagnostics/fake_network_health_provider_test.js index 66ca254f..b7066aa 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/fake_network_health_provider_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/fake_network_health_provider_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {fakeCellularNetwork, fakeEthernetNetwork, fakeNetworkGuidInfoList, fakeWifiNetwork} from 'chrome://diagnostics/fake_data.js'; import {FakeNetworkHealthProvider} from 'chrome://diagnostics/fake_network_health_provider.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/fake_system_data_provider_test.js b/chrome/test/data/webui/chromeos/diagnostics/fake_system_data_provider_test.js index e9fc7222..82d93a16 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/fake_system_data_provider_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/fake_system_data_provider_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {fakeBatteryChargeStatus, fakeBatteryHealth, fakeBatteryInfo, fakeBatteryInfo2, fakeCpuUsage, fakeMemoryUsage} from 'chrome://diagnostics/fake_data.js'; import {FakeSystemDataProvider} from 'chrome://diagnostics/fake_system_data_provider.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/fake_system_routine_controller_test.js b/chrome/test/data/webui/chromeos/diagnostics/fake_system_routine_controller_test.js index b72f591..1ba7e3a 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/fake_system_routine_controller_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/fake_system_routine_controller_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {FakeSystemRoutineController} from 'chrome://diagnostics/fake_system_routine_controller.js'; import {RoutineRunnerRemote, RoutineType, StandardRoutineResult} from 'chrome://diagnostics/system_routine_controller.mojom-webui.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/frequency_channel_utils_test.js b/chrome/test/data/webui/chromeos/diagnostics/frequency_channel_utils_test.js index f2118501..6dcffd4 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/frequency_channel_utils_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/frequency_channel_utils_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {ChannelBand} from 'chrome://diagnostics/diagnostics_types.js'; import {convertFrequencyToChannel, getFrequencyChannelBand} from 'chrome://diagnostics/frequency_channel_utils.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/input_card_test.js b/chrome/test/data/webui/chromeos/diagnostics/input_card_test.js index a8c11e5..bfefa3b8 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/input_card_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/input_card_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/strings.m.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {fakeTouchDevices} from 'chrome://diagnostics/fake_data.js'; import {FakeInputDataProvider} from 'chrome://diagnostics/fake_input_data_provider.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/input_list_test.js b/chrome/test/data/webui/chromeos/diagnostics/input_list_test.js index ef0d2d5c..c8afda06 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/input_list_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/input_list_test.js
@@ -4,7 +4,7 @@ import 'chrome://diagnostics/input_list.js'; import 'chrome://diagnostics/strings.m.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {DiagnosticsBrowserProxyImpl} from 'chrome://diagnostics/diagnostics_browser_proxy.js'; import {NavigationView} from 'chrome://diagnostics/diagnostics_types.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/ip_config_info_drawer_test.js b/chrome/test/data/webui/chromeos/diagnostics/ip_config_info_drawer_test.js index 2153ada..0c5797af 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/ip_config_info_drawer_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/ip_config_info_drawer_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/ip_config_info_drawer.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {DiagnosticsBrowserProxyImpl} from 'chrome://diagnostics/diagnostics_browser_proxy.js'; import {fakeEthernetNetwork, fakeWifiNetwork, fakeWifiNetworkEmptyNameServers, fakeWifiNetworkMultipleNameServers, fakeWifiNetworkNoNameServers} from 'chrome://diagnostics/fake_data.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/keyboard_tester_test.js b/chrome/test/data/webui/chromeos/diagnostics/keyboard_tester_test.js index 5ec1888..6c0d16a 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/keyboard_tester_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/keyboard_tester_test.js
@@ -4,7 +4,7 @@ import 'chrome://diagnostics/keyboard_tester.js'; import 'chrome://diagnostics/strings.m.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {ConnectionType, MechanicalLayout, NumberPadPresence, PhysicalLayout, TopRightKey} from 'chrome://diagnostics/input.mojom-webui.js'; import {KeyEvent, KeyEventType} from 'chrome://diagnostics/input_data_provider.mojom-webui.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/memory_card_test.js b/chrome/test/data/webui/chromeos/diagnostics/memory_card_test.js index 858fe07..4e32345 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/memory_card_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/memory_card_test.js
@@ -4,7 +4,7 @@ import 'chrome://diagnostics/memory_card.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {convertKibToGibDecimalString} from 'chrome://diagnostics/diagnostics_utils.js'; import {fakeMemoryUsage, fakeMemoryUsageLowAvailableMemory} from 'chrome://diagnostics/fake_data.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/mojo_interface_provider_test.js b/chrome/test/data/webui/chromeos/diagnostics/mojo_interface_provider_test.js index 0c4c50d..c9fe68e8 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/mojo_interface_provider_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/mojo_interface_provider_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {FakeNetworkHealthProvider} from 'chrome://diagnostics/fake_network_health_provider.js'; import {FakeSystemDataProvider} from 'chrome://diagnostics/fake_system_data_provider.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/network_card_test.js b/chrome/test/data/webui/chromeos/diagnostics/network_card_test.js index cfecc27..c3f472a 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/network_card_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/network_card_test.js
@@ -6,7 +6,7 @@ // triggered during test. import 'chrome://diagnostics/strings.m.js'; import 'chrome://diagnostics/network_card.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {fakeCellularDisabledNetwork, fakeCellularDisconnectedNetwork, fakeCellularNetwork, fakeCellularWithIpConfigNetwork, fakeConnectingEthernetNetwork, fakeDisconnectedEthernetNetwork, fakeDisconnectedWifiNetwork, fakeEthernetNetwork, fakeNetworkGuidInfoList, fakePortalWifiNetwork, fakeWifiNetwork, fakeWifiNetworkDisabled, fakeWifiNetworkInvalidNameServers, fakeWifiNetworkNoIpAddress} from 'chrome://diagnostics/fake_data.js'; import {FakeNetworkHealthProvider} from 'chrome://diagnostics/fake_network_health_provider.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/network_info_test.js b/chrome/test/data/webui/chromeos/diagnostics/network_info_test.js index afa95c8..603bab1e 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/network_info_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/network_info_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/network_info.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {fakeCellularNetwork, fakeEthernetNetwork, fakeWifiNetwork} from 'chrome://diagnostics/fake_data.js'; import {Network} from 'chrome://diagnostics/network_health_provider.mojom-webui.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/network_list_test.js b/chrome/test/data/webui/chromeos/diagnostics/network_list_test.js index 554e8cf..7399d14c 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/network_list_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/network_list_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/network_list.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {ConnectivityCardElement} from 'chrome://diagnostics/connectivity_card.js'; import {DiagnosticsBrowserProxyImpl} from 'chrome://diagnostics/diagnostics_browser_proxy.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/network_troubleshooting_test.js b/chrome/test/data/webui/chromeos/diagnostics/network_troubleshooting_test.js index 06fd9111..b8919e8 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/network_troubleshooting_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/network_troubleshooting_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/strings.m.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {NetworkTroubleshootingElement} from 'chrome://diagnostics/network_troubleshooting.js'; import {assertFalse, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/overview_card_test.js b/chrome/test/data/webui/chromeos/diagnostics/overview_card_test.js index 77a19a61..809fe4a 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/overview_card_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/overview_card_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/overview_card.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {fakeSystemInfo, fakeSystemInfoWithoutBoardName, fakeSystemInfoWithTBD} from 'chrome://diagnostics/fake_data.js'; import {FakeSystemDataProvider} from 'chrome://diagnostics/fake_system_data_provider.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/percent_bar_chart_test.js b/chrome/test/data/webui/chromeos/diagnostics/percent_bar_chart_test.js index aede354..76b2ddbb 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/percent_bar_chart_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/percent_bar_chart_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/percent_bar_chart.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {PercentBarChartElement} from 'chrome://diagnostics/percent_bar_chart.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/realtime_cpu_chart_test.js b/chrome/test/data/webui/chromeos/diagnostics/realtime_cpu_chart_test.js index 27087dbc..de26a03 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/realtime_cpu_chart_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/realtime_cpu_chart_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/realtime_cpu_chart.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {RealtimeCpuChartElement} from 'chrome://diagnostics/realtime_cpu_chart.js'; import {assertEquals, assertFalse, assertGT, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/routine_group_test.js b/chrome/test/data/webui/chromeos/diagnostics/routine_group_test.js index e2bf2ef..419784e 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/routine_group_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/routine_group_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {createRoutine} from 'chrome://diagnostics/diagnostics_utils.js'; import {RoutineGroup} from 'chrome://diagnostics/routine_group.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/routine_list_executor_test.js b/chrome/test/data/webui/chromeos/diagnostics/routine_list_executor_test.js index 1e60d40..5947206 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/routine_list_executor_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/routine_list_executor_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {FakeSystemRoutineController} from 'chrome://diagnostics/fake_system_routine_controller.js'; import {ExecutionProgress, ResultStatusItem, RoutineListExecutor} from 'chrome://diagnostics/routine_list_executor.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/routine_result_entry_test.js b/chrome/test/data/webui/chromeos/diagnostics/routine_result_entry_test.js index 33c6323..60aac3a4 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/routine_result_entry_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/routine_result_entry_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/routine_result_entry.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {RoutineGroup} from 'chrome://diagnostics/routine_group.js'; import {ExecutionProgress, ResultStatusItem} from 'chrome://diagnostics/routine_list_executor.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/routine_result_list_test.js b/chrome/test/data/webui/chromeos/diagnostics/routine_result_list_test.js index 19e8711..3d1f6bd 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/routine_result_list_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/routine_result_list_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/routine_result_list.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {ExecutionProgress, ResultStatusItem} from 'chrome://diagnostics/routine_list_executor.js'; import {RoutineResultEntryElement} from 'chrome://diagnostics/routine_result_entry.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/routine_section_test.js b/chrome/test/data/webui/chromeos/diagnostics/routine_section_test.js index c8320e55..609a258 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/routine_section_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/routine_section_test.js
@@ -4,7 +4,7 @@ import 'chrome://diagnostics/routine_section.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {createRoutine} from 'chrome://diagnostics/diagnostics_utils.js'; import {FakeSystemRoutineController} from 'chrome://diagnostics/fake_system_routine_controller.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/system_page_test.js b/chrome/test/data/webui/chromeos/diagnostics/system_page_test.js index c10433c..59e7ebe 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/system_page_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/system_page_test.js
@@ -5,7 +5,7 @@ import 'chrome://diagnostics/strings.m.js'; import 'chrome://diagnostics/system_page.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {DiagnosticsBrowserProxyImpl} from 'chrome://diagnostics/diagnostics_browser_proxy.js'; import {NavigationView} from 'chrome://diagnostics/diagnostics_types.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/text_badge_test.js b/chrome/test/data/webui/chromeos/diagnostics/text_badge_test.js index 6177e31..1b447be 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/text_badge_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/text_badge_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/text_badge.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {BadgeType, TextBadgeElement} from 'chrome://diagnostics/text_badge.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/touchpad_tester_test.js b/chrome/test/data/webui/chromeos/diagnostics/touchpad_tester_test.js index 53cd28c..1f602c05 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/touchpad_tester_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/touchpad_tester_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://diagnostics/strings.m.js'; import {fakeTouchDevices} from 'chrome://diagnostics/fake_data.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/touchscreen_tester_test.js b/chrome/test/data/webui/chromeos/diagnostics/touchscreen_tester_test.js index 17831145..db424173 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/touchscreen_tester_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/touchscreen_tester_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {DialogType, SCREEN_MAX_LENGTH, TouchEventType} from 'chrome://diagnostics/touchscreen_tester.js'; import {assertDeepEquals, assertEquals, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js';
diff --git a/chrome/test/data/webui/chromeos/diagnostics/wifi_info_test.js b/chrome/test/data/webui/chromeos/diagnostics/wifi_info_test.js index 537c2f7..21cab7d4 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/wifi_info_test.js +++ b/chrome/test/data/webui/chromeos/diagnostics/wifi_info_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://diagnostics/wifi_info.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {getSignalStrength} from 'chrome://diagnostics/diagnostics_utils.js'; import {fakeDisconnectedWifiNetwork, fakeWifiNetwork, fakeWiFiStateProperties} from 'chrome://diagnostics/fake_data.js';
diff --git a/chrome/test/data/webui/chromeos/manage_mirrorsync/manage_mirrorsync_app_test.ts b/chrome/test/data/webui/chromeos/manage_mirrorsync/manage_mirrorsync_app_test.ts index 256b5df..3caec46 100644 --- a/chrome/test/data/webui/chromeos/manage_mirrorsync/manage_mirrorsync_app_test.ts +++ b/chrome/test/data/webui/chromeos/manage_mirrorsync/manage_mirrorsync_app_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://manage-mirrorsync/components/manage_mirrorsync.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {BrowserProxy} from 'chrome://manage-mirrorsync/browser_proxy.js'; import {FolderSelector} from 'chrome://manage-mirrorsync/components/folder_selector.js';
diff --git a/chrome/test/data/webui/chromeos/mojo_webui_test_support.js b/chrome/test/data/webui/chromeos/mojo_webui_test_support.js new file mode 100644 index 0000000..bab261ef --- /dev/null +++ b/chrome/test/data/webui/chromeos/mojo_webui_test_support.js
@@ -0,0 +1,19 @@ +// Copyright 2020 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview Helper module which must be loaded by tests of type + * "mojo_webui" to have proper support in test_api.js. + */ + +import {TestRunner} from './web_ui_test.mojom-webui.js'; + +/** + * Reports a test result using the TestRunner Mojo interface. + * @param {string=} opt_result + */ +window.reportMojoWebUITestResult = function(opt_result) { + const runner = TestRunner.getRemote(); + runner.testComplete(opt_result); +};
diff --git a/chrome/test/data/webui/chromeos/os_feedback_ui/confirmation_page_test.js b/chrome/test/data/webui/chromeos/os_feedback_ui/confirmation_page_test.js index 7f5c99c1..ba382c5 100644 --- a/chrome/test/data/webui/chromeos/os_feedback_ui/confirmation_page_test.js +++ b/chrome/test/data/webui/chromeos/os_feedback_ui/confirmation_page_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {ConfirmationPageElement} from 'chrome://os-feedback/confirmation_page.js'; import {FakeFeedbackServiceProvider} from 'chrome://os-feedback/fake_feedback_service_provider.js';
diff --git a/chrome/test/data/webui/chromeos/os_feedback_ui/fake_help_content_provider_test.js b/chrome/test/data/webui/chromeos/os_feedback_ui/fake_help_content_provider_test.js index 64a7c376..02d52330 100644 --- a/chrome/test/data/webui/chromeos/os_feedback_ui/fake_help_content_provider_test.js +++ b/chrome/test/data/webui/chromeos/os_feedback_ui/fake_help_content_provider_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {fakeHelpContentList, fakeSearchRequest, fakeSearchResponse} from 'chrome://os-feedback/fake_data.js'; import {FakeHelpContentProvider} from 'chrome://os-feedback/fake_help_content_provider.js';
diff --git a/chrome/test/data/webui/chromeos/os_feedback_ui/feedback_flow_test.js b/chrome/test/data/webui/chromeos/os_feedback_ui/feedback_flow_test.js index 2e22ee21..6492b6a 100644 --- a/chrome/test/data/webui/chromeos/os_feedback_ui/feedback_flow_test.js +++ b/chrome/test/data/webui/chromeos/os_feedback_ui/feedback_flow_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {fakeFeedbackContext, fakeFeedbackContextWithoutLinkedCrossDevicePhone, fakeInternalUserFeedbackContext, fakePngData, fakeSearchResponse} from 'chrome://os-feedback/fake_data.js'; import {FakeFeedbackServiceProvider} from 'chrome://os-feedback/fake_feedback_service_provider.js'; @@ -77,7 +77,7 @@ function getFeedbackContext_() { assertTrue(!!page); - return page.feedbackContext_; + return page.feedbackContext; } /** @return {!SearchPageElement} */
diff --git a/chrome/test/data/webui/chromeos/os_feedback_ui/file_attachment_test.js b/chrome/test/data/webui/chromeos/os_feedback_ui/file_attachment_test.js index 699f80a..1f68525c 100644 --- a/chrome/test/data/webui/chromeos/os_feedback_ui/file_attachment_test.js +++ b/chrome/test/data/webui/chromeos/os_feedback_ui/file_attachment_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://os-feedback/strings.m.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {FakeFeedbackServiceProvider} from 'chrome://os-feedback/fake_feedback_service_provider.js'; import {FileAttachmentElement} from 'chrome://os-feedback/file_attachment.js';
diff --git a/chrome/test/data/webui/chromeos/os_feedback_ui/help_content_test.js b/chrome/test/data/webui/chromeos/os_feedback_ui/help_content_test.js index e40acc6..f1ecd5a 100644 --- a/chrome/test/data/webui/chromeos/os_feedback_ui/help_content_test.js +++ b/chrome/test/data/webui/chromeos/os_feedback_ui/help_content_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {fakeHelpContentList, fakePopularHelpContentList} from 'chrome://os-feedback/fake_data.js'; import {HelpContentList} from 'chrome://os-feedback/feedback_types.js';
diff --git a/chrome/test/data/webui/chromeos/os_feedback_ui/mojo_interface_provider_test.js b/chrome/test/data/webui/chromeos/os_feedback_ui/mojo_interface_provider_test.js index 92c64a0..964c550 100644 --- a/chrome/test/data/webui/chromeos/os_feedback_ui/mojo_interface_provider_test.js +++ b/chrome/test/data/webui/chromeos/os_feedback_ui/mojo_interface_provider_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {FakeFeedbackServiceProvider} from 'chrome://os-feedback/fake_feedback_service_provider.js'; import {FakeHelpContentProvider} from 'chrome://os-feedback/fake_help_content_provider.js';
diff --git a/chrome/test/data/webui/chromeos/os_feedback_ui/search_page_test.js b/chrome/test/data/webui/chromeos/os_feedback_ui/search_page_test.js index af7168d0..526e00c 100644 --- a/chrome/test/data/webui/chromeos/os_feedback_ui/search_page_test.js +++ b/chrome/test/data/webui/chromeos/os_feedback_ui/search_page_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {fakeEmptySearchResponse, fakeFeedbackContext, fakeInternalUserFeedbackContext, fakeLoginFlowFeedbackContext, fakeSearchResponse} from 'chrome://os-feedback/fake_data.js'; import {FakeHelpContentProvider} from 'chrome://os-feedback/fake_help_content_provider.js';
diff --git a/chrome/test/data/webui/chromeos/os_feedback_ui/share_data_page_test.js b/chrome/test/data/webui/chromeos/os_feedback_ui/share_data_page_test.js index 661f860..5726cdb 100644 --- a/chrome/test/data/webui/chromeos/os_feedback_ui/share_data_page_test.js +++ b/chrome/test/data/webui/chromeos/os_feedback_ui/share_data_page_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {fakeEmptyFeedbackContext, fakeFeedbackContext, fakeInternalUserFeedbackContext, fakeLoginFlowFeedbackContext} from 'chrome://os-feedback/fake_data.js'; import {FakeFeedbackServiceProvider} from 'chrome://os-feedback/fake_feedback_service_provider.js';
diff --git a/chrome/test/data/webui/chromeos/parent_access/extension_approvals_test.ts b/chrome/test/data/webui/chromeos/parent_access/extension_approvals_test.ts index 13f4513..b88da98 100644 --- a/chrome/test/data/webui/chromeos/parent_access/extension_approvals_test.ts +++ b/chrome/test/data/webui/chromeos/parent_access/extension_approvals_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://parent-access/parent_access_before.js'; import 'chrome://parent-access/strings.m.js';
diff --git a/chrome/test/data/webui/chromeos/parent_access/parent_access_after_test.ts b/chrome/test/data/webui/chromeos/parent_access/parent_access_after_test.ts index 06057c80..463d70c 100644 --- a/chrome/test/data/webui/chromeos/parent_access/parent_access_after_test.ts +++ b/chrome/test/data/webui/chromeos/parent_access/parent_access_after_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://parent-access/parent_access_after.js'; import 'chrome://parent-access/strings.m.js';
diff --git a/chrome/test/data/webui/chromeos/parent_access/parent_access_app_test.ts b/chrome/test/data/webui/chromeos/parent_access/parent_access_app_test.ts index a6090c03..6881e97 100644 --- a/chrome/test/data/webui/chromeos/parent_access/parent_access_app_test.ts +++ b/chrome/test/data/webui/chromeos/parent_access/parent_access_app_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://parent-access/parent_access_app.js'; import 'chrome://parent-access/strings.m.js';
diff --git a/chrome/test/data/webui/chromeos/parent_access/parent_access_controller_test.ts b/chrome/test/data/webui/chromeos/parent_access/parent_access_controller_test.ts index 8c18c1b3..0345068 100644 --- a/chrome/test/data/webui/chromeos/parent_access/parent_access_controller_test.ts +++ b/chrome/test/data/webui/chromeos/parent_access/parent_access_controller_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://parent-access/strings.m.js'; import {ParentAccessController} from 'chrome://parent-access/parent_access_controller.js';
diff --git a/chrome/test/data/webui/chromeos/parent_access/parent_access_disabled_test.ts b/chrome/test/data/webui/chromeos/parent_access/parent_access_disabled_test.ts index ad11617..c790f53c 100644 --- a/chrome/test/data/webui/chromeos/parent_access/parent_access_disabled_test.ts +++ b/chrome/test/data/webui/chromeos/parent_access/parent_access_disabled_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://parent-access/parent_access_disabled.js'; import 'chrome://parent-access/strings.m.js';
diff --git a/chrome/test/data/webui/chromeos/parent_access/parent_access_test_client.ts b/chrome/test/data/webui/chromeos/parent_access/parent_access_test_client.ts index a613d4c0..50c7a89 100644 --- a/chrome/test/data/webui/chromeos/parent_access/parent_access_test_client.ts +++ b/chrome/test/data/webui/chromeos/parent_access/parent_access_test_client.ts
@@ -1,7 +1,7 @@ // Copyright 2021 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {PostMessageApiClient} from 'chrome://resources/ash/common/post_message_api/post_message_api_client.js';
diff --git a/chrome/test/data/webui/chromeos/parent_access/parent_access_ui_handler_test.ts b/chrome/test/data/webui/chromeos/parent_access/parent_access_ui_handler_test.ts index 3eeab25..f0a952b 100644 --- a/chrome/test/data/webui/chromeos/parent_access/parent_access_ui_handler_test.ts +++ b/chrome/test/data/webui/chromeos/parent_access/parent_access_ui_handler_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {ParentAccessServerMessageType, ParentAccessUiHandler} from 'chrome://parent-access/parent_access_ui.mojom-webui.js'; import {assertEquals} from 'chrome://webui-test/chai_assert.js';
diff --git a/chrome/test/data/webui/chromeos/parent_access/parent_access_ui_test.ts b/chrome/test/data/webui/chromeos/parent_access/parent_access_ui_test.ts index f14c1aa2..a59cd95 100644 --- a/chrome/test/data/webui/chromeos/parent_access/parent_access_ui_test.ts +++ b/chrome/test/data/webui/chromeos/parent_access/parent_access_ui_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://parent-access/parent_access_ui.js'; import 'chrome://parent-access/strings.m.js';
diff --git a/chrome/test/data/webui/chromeos/parent_access/webview_manager_test.ts b/chrome/test/data/webui/chromeos/parent_access/webview_manager_test.ts index 1abae35..247db1b 100644 --- a/chrome/test/data/webui/chromeos/parent_access/webview_manager_test.ts +++ b/chrome/test/data/webui/chromeos/parent_access/webview_manager_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {WebviewManager} from 'chrome://parent-access/webview_manager.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js';
diff --git a/chrome/test/data/webui/chromeos/personalization_app/personalization_app_browsertest.js b/chrome/test/data/webui/chromeos/personalization_app/personalization_app_browsertest.js index d01572d..f5ac047 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/personalization_app_browsertest.js +++ b/chrome/test/data/webui/chromeos/personalization_app/personalization_app_browsertest.js
@@ -125,7 +125,7 @@ // without javascript errors or a 404 or crash. Displays user preview, wallpaper // preview, and ambient preview. TEST_F(PersonalizationAppBrowserTest.name, 'All', async () => { - await import('chrome://webui-test/mojo_webui_test_support.js'); + await import('chrome://webui-test/chromeos/mojo_webui_test_support.js'); suite('main page', () => { test('has root page content', () => { @@ -218,7 +218,7 @@ TEST_F( PersonalizationAppAmbientModeAllowedBrowserTest.name, 'All', async () => { - await import('chrome://webui-test/mojo_webui_test_support.js'); + await import('chrome://webui-test/chromeos/mojo_webui_test_support.js'); suite('ambient mode allowed', () => { test('shows ambient preview', () => { @@ -266,7 +266,7 @@ TEST_F( PersonalizationAppAmbientModeDisallowedBrowserTest.name, 'All', async () => { - await import('chrome://webui-test/mojo_webui_test_support.js'); + await import('chrome://webui-test/chromeos/mojo_webui_test_support.js'); suite('ambient mode disallowed', () => { test('does not show ambient preview', () => { @@ -312,7 +312,7 @@ TEST_F( PersonalizationAppAmbientModeDisallowedJellyBrowserTest.name, 'All', async () => { - await import('chrome://webui-test/mojo_webui_test_support.js'); + await import('chrome://webui-test/chromeos/mojo_webui_test_support.js'); suite('ambient mode disallowed', () => { test('shows ambient preview', () => { @@ -365,7 +365,7 @@ PersonalizationAppWallpaperSubpageBrowserTest; TEST_F(PersonalizationAppWallpaperSubpageBrowserTest.name, 'All', async () => { - await import('chrome://webui-test/mojo_webui_test_support.js'); + await import('chrome://webui-test/chromeos/mojo_webui_test_support.js'); function clickWallpaperPreviewLink() { assertEquals( @@ -635,7 +635,7 @@ TEST_F( PersonalizationAppDynamicColorEnabledBrowserTest.name, 'All', async () => { - await import('chrome://webui-test/mojo_webui_test_support.js'); + await import('chrome://webui-test/chromeos/mojo_webui_test_support.js'); const {getThemeProvider} = await import('chrome://personalization/js/personalization_app.js'); const themeProvider = getThemeProvider();
diff --git a/chrome/test/data/webui/chromeos/personalization_app/sea_pen_images_element_test.ts b/chrome/test/data/webui/chromeos/personalization_app/sea_pen_images_element_test.ts index 4de8e7a..e08eafc1 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/sea_pen_images_element_test.ts +++ b/chrome/test/data/webui/chromeos/personalization_app/sea_pen_images_element_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://personalization/strings.m.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {SeaPenImagesElement} from 'chrome://personalization/js/personalization_app.js'; import {assertEquals, assertFalse} from 'chrome://webui-test/chai_assert.js';
diff --git a/chrome/test/data/webui/chromeos/personalization_app/sea_pen_recent_wallpapers_element_test.ts b/chrome/test/data/webui/chromeos/personalization_app/sea_pen_recent_wallpapers_element_test.ts index a42972ddf..b7f598b 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/sea_pen_recent_wallpapers_element_test.ts +++ b/chrome/test/data/webui/chromeos/personalization_app/sea_pen_recent_wallpapers_element_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://personalization/strings.m.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {SeaPenRecentWallpapersElement} from 'chrome://personalization/js/personalization_app.js'; import {assertEquals, assertFalse, assertNull, assertTrue} from 'chrome://webui-test/chai_assert.js';
diff --git a/chrome/test/data/webui/chromeos/personalization_app/sea_pen_template_query_element_test.ts b/chrome/test/data/webui/chromeos/personalization_app/sea_pen_template_query_element_test.ts index 82cac040..b7c6dc4b 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/sea_pen_template_query_element_test.ts +++ b/chrome/test/data/webui/chromeos/personalization_app/sea_pen_template_query_element_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://personalization/strings.m.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {SeaPenTemplateQueryElement} from 'chrome://personalization/js/personalization_app.js'; import {assertEquals, assertTrue} from 'chrome://webui-test/chai_assert.js';
diff --git a/chrome/test/data/webui/chromeos/personalization_app/wallpaper_subpage_top_element_test.ts b/chrome/test/data/webui/chromeos/personalization_app/wallpaper_subpage_top_element_test.ts index 262edc5..094e21a 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/wallpaper_subpage_top_element_test.ts +++ b/chrome/test/data/webui/chromeos/personalization_app/wallpaper_subpage_top_element_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://personalization/strings.m.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {emptyState, Paths, PersonalizationRouterElement, QueryParams, SeaPenActionName, SeaPenState, WallpaperSubpageTopElement} from 'chrome://personalization/js/personalization_app.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.js';
diff --git a/chrome/test/data/webui/chromeos/print_management/print_management_test.ts b/chrome/test/data/webui/chromeos/print_management/print_management_test.ts index 1bc43b3..bc74713 100644 --- a/chrome/test/data/webui/chromeos/print_management/print_management_test.ts +++ b/chrome/test/data/webui/chromeos/print_management/print_management_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://print-management/print_management.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {IronIconElement} from '//resources/polymer/v3_0/iron-icon/iron-icon.js'; import {setMetadataProviderForTesting, setPrintManagementHandlerForTesting} from 'chrome://print-management/mojo_interface_provider.js';
diff --git a/chrome/test/data/webui/chromeos/scanning/action_toolbar_test.ts b/chrome/test/data/webui/chromeos/scanning/action_toolbar_test.ts index d13a5f29..8e1472f 100644 --- a/chrome/test/data/webui/chromeos/scanning/action_toolbar_test.ts +++ b/chrome/test/data/webui/chromeos/scanning/action_toolbar_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://scanning/action_toolbar.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js';
diff --git a/chrome/test/data/webui/chromeos/scanning/color_mode_select_test.ts b/chrome/test/data/webui/chromeos/scanning/color_mode_select_test.ts index 9fefeea..b772148 100644 --- a/chrome/test/data/webui/chromeos/scanning/color_mode_select_test.ts +++ b/chrome/test/data/webui/chromeos/scanning/color_mode_select_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://scanning/color_mode_select.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js';
diff --git a/chrome/test/data/webui/chromeos/scanning/file_type_select_test.ts b/chrome/test/data/webui/chromeos/scanning/file_type_select_test.ts index 0926f8a1..b10dd8e 100644 --- a/chrome/test/data/webui/chromeos/scanning/file_type_select_test.ts +++ b/chrome/test/data/webui/chromeos/scanning/file_type_select_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://scanning/file_type_select.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js';
diff --git a/chrome/test/data/webui/chromeos/scanning/loading_page_test.ts b/chrome/test/data/webui/chromeos/scanning/loading_page_test.ts index eb888d44..fa1e42f 100644 --- a/chrome/test/data/webui/chromeos/scanning/loading_page_test.ts +++ b/chrome/test/data/webui/chromeos/scanning/loading_page_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://scanning/loading_page.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js';
diff --git a/chrome/test/data/webui/chromeos/scanning/multi_page_checkbox_test.ts b/chrome/test/data/webui/chromeos/scanning/multi_page_checkbox_test.ts index 389fea6..1ffaf48d2 100644 --- a/chrome/test/data/webui/chromeos/scanning/multi_page_checkbox_test.ts +++ b/chrome/test/data/webui/chromeos/scanning/multi_page_checkbox_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://scanning/multi_page_checkbox.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js';
diff --git a/chrome/test/data/webui/chromeos/scanning/multi_page_scan_test.ts b/chrome/test/data/webui/chromeos/scanning/multi_page_scan_test.ts index 996f70e..fa23346 100644 --- a/chrome/test/data/webui/chromeos/scanning/multi_page_scan_test.ts +++ b/chrome/test/data/webui/chromeos/scanning/multi_page_scan_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://scanning/multi_page_scan.js'; import {loadTimeData} from 'chrome://resources/ash/common/load_time_data.m.js';
diff --git a/chrome/test/data/webui/chromeos/scanning/page_size_select_test.ts b/chrome/test/data/webui/chromeos/scanning/page_size_select_test.ts index 7a146f6..ff3a96b 100644 --- a/chrome/test/data/webui/chromeos/scanning/page_size_select_test.ts +++ b/chrome/test/data/webui/chromeos/scanning/page_size_select_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://scanning/page_size_select.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js';
diff --git a/chrome/test/data/webui/chromeos/scanning/resolution_select_test.ts b/chrome/test/data/webui/chromeos/scanning/resolution_select_test.ts index 8d94482..aac772be 100644 --- a/chrome/test/data/webui/chromeos/scanning/resolution_select_test.ts +++ b/chrome/test/data/webui/chromeos/scanning/resolution_select_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://scanning/resolution_select.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js';
diff --git a/chrome/test/data/webui/chromeos/scanning/scan_done_section_test.ts b/chrome/test/data/webui/chromeos/scanning/scan_done_section_test.ts index 2fd318d..8ec96d7 100644 --- a/chrome/test/data/webui/chromeos/scanning/scan_done_section_test.ts +++ b/chrome/test/data/webui/chromeos/scanning/scan_done_section_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://scanning/scan_done_section.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js';
diff --git a/chrome/test/data/webui/chromeos/scanning/scan_preview_test.ts b/chrome/test/data/webui/chromeos/scanning/scan_preview_test.ts index 6091915..1a772963 100644 --- a/chrome/test/data/webui/chromeos/scanning/scan_preview_test.ts +++ b/chrome/test/data/webui/chromeos/scanning/scan_preview_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://scanning/scan_preview.js'; import {loadTimeData} from 'chrome://resources/ash/common/load_time_data.m.js';
diff --git a/chrome/test/data/webui/chromeos/scanning/scan_to_select_test.ts b/chrome/test/data/webui/chromeos/scanning/scan_to_select_test.ts index 0cbf9d30..b745de8 100644 --- a/chrome/test/data/webui/chromeos/scanning/scan_to_select_test.ts +++ b/chrome/test/data/webui/chromeos/scanning/scan_to_select_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://scanning/scan_to_select.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js';
diff --git a/chrome/test/data/webui/chromeos/scanning/scanner_select_test.ts b/chrome/test/data/webui/chromeos/scanning/scanner_select_test.ts index 227c038..8c53359 100644 --- a/chrome/test/data/webui/chromeos/scanning/scanner_select_test.ts +++ b/chrome/test/data/webui/chromeos/scanning/scanner_select_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://scanning/scanner_select.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js';
diff --git a/chrome/test/data/webui/chromeos/scanning/scanning_app_test.ts b/chrome/test/data/webui/chromeos/scanning/scanning_app_test.ts index 5fe5b9d4..6534ebb3 100644 --- a/chrome/test/data/webui/chromeos/scanning/scanning_app_test.ts +++ b/chrome/test/data/webui/chromeos/scanning/scanning_app_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://scanning/scanning_app.js'; import 'chrome://resources/cr_elements/cr_button/cr_button.js';
diff --git a/chrome/test/data/webui/chromeos/scanning/source_select_test.ts b/chrome/test/data/webui/chromeos/scanning/source_select_test.ts index ce2c0bd..35e5c278 100644 --- a/chrome/test/data/webui/chromeos/scanning/source_select_test.ts +++ b/chrome/test/data/webui/chromeos/scanning/source_select_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://scanning/source_select.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_edit_dialog_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_edit_dialog_test.ts index 29cc447b..410267e3 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_edit_dialog_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_edit_dialog_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://shortcut-customization/js/accelerator_edit_dialog.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {VKey} from 'chrome://resources/ash/common/shortcut_input_ui/accelerator_keys.mojom-webui.js'; import {FakeShortcutInputProvider} from 'chrome://resources/ash/common/shortcut_input_ui/fake_shortcut_input_provider.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_edit_view_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_edit_view_test.ts index f9a9dcc1..cc05665 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_edit_view_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_edit_view_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://shortcut-customization/js/accelerator_edit_view.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {VKey} from 'chrome://resources/ash/common/shortcut_input_ui/accelerator_keys.mojom-webui.js'; import {FakeShortcutInputProvider} from 'chrome://resources/ash/common/shortcut_input_ui/fake_shortcut_input_provider.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_lookup_manager_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_lookup_manager_test.ts index b14adf1..d5980bb 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_lookup_manager_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_lookup_manager_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {AcceleratorLookupManager} from 'chrome://shortcut-customization/js/accelerator_lookup_manager.js'; import {fakeAcceleratorConfig, fakeAmbientConfig, fakeLayoutInfo} from 'chrome://shortcut-customization/js/fake_data.js'; @@ -115,4 +115,4 @@ assertEquals(true, getManager().getHasLauncherButton()); }); }); -}); \ No newline at end of file +});
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_row_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_row_test.ts index 44c6eb9f..bc7587d 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_row_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_row_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://shortcut-customization/js/accelerator_row.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {ShortcutInputKeyElement} from 'chrome://resources/ash/common/shortcut_input_ui/shortcut_input_key.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_subsection_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_subsection_test.ts index 1522d660..260a294 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_subsection_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_subsection_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://shortcut-customization/js/accelerator_subsection.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js'; import {CrIconButtonElement} from 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_view_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_view_test.ts index 5267d87..6dda3df 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_view_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/accelerator_view_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://shortcut-customization/js/accelerator_view.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {IronIconElement} from '//resources/polymer/v3_0/iron-icon/iron-icon.js'; import {VKey} from 'chrome://resources/ash/common/shortcut_input_ui/accelerator_keys.mojom-webui.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/bottom_nav_content_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/bottom_nav_content_test.ts index 2685571..c6e4bf83 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/bottom_nav_content_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/bottom_nav_content_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://shortcut-customization/js/bottom_nav_content.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js'; import {CrButtonElement} from 'chrome://resources/cr_elements/cr_button/cr_button.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/fake_shortcut_provider_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/fake_shortcut_provider_test.ts index 9e0406c15..4d8e2e2e 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/fake_shortcut_provider_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/fake_shortcut_provider_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {fakeAcceleratorConfig, fakeLayoutInfo} from 'chrome://shortcut-customization/js/fake_data.js'; import {FakeShortcutProvider} from 'chrome://shortcut-customization/js/fake_shortcut_provider.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/fake_shortcut_search_handler_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/fake_shortcut_search_handler_test.ts index 45857532..2e84696a 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/fake_shortcut_search_handler_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/fake_shortcut_search_handler_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {stringToMojoString16} from 'chrome://resources/js/mojo_type_util.js'; import {fakeSearchResults} from 'chrome://shortcut-customization/js/fake_data.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/router_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/router_test.ts index 6ac4154..c0206ff9 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/router_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/router_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {RouteObserver, Router} from 'chrome://shortcut-customization/js/router.js'; import {assertEquals, assertNotEquals} from 'chrome://webui-test/chai_assert.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/search_box_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/search_box_test.ts index d4792ead..6b0585e7 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/search_box_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/search_box_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'chrome://shortcut-customization/js/search/search_box.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js'; import {getDeepActiveElement} from 'chrome://resources/ash/common/util.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/search_result_bolding_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/search_result_bolding_test.ts index eacc694..802e684 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/search_result_bolding_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/search_result_bolding_test.ts
@@ -1,7 +1,7 @@ // Copyright 2023 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {getBoldedDescription} from 'chrome://shortcut-customization/js/search/search_result_bolding.js'; import {assertEquals} from 'chrome://webui-test/chai_assert.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/search_result_row_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/search_result_row_test.ts index 9121e22..bc27ede 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/search_result_row_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/search_result_row_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'chrome://shortcut-customization/js/search/search_result_row.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {ShortcutInputKeyElement} from 'chrome://resources/ash/common/shortcut_input_ui/shortcut_input_key.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/shortcut_customization_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/shortcut_customization_test.ts index a6d392f..85ae18f 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/shortcut_customization_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/shortcut_customization_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://shortcut-customization/js/shortcut_customization_app.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {VKey} from 'chrome://resources/ash/common/shortcut_input_ui/accelerator_keys.mojom-webui.js'; import {FakeShortcutInputProvider} from 'chrome://resources/ash/common/shortcut_input_ui/fake_shortcut_input_provider.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/shortcut_search_handler_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/shortcut_search_handler_test.ts index 54d532f..bfe3181 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/shortcut_search_handler_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/shortcut_search_handler_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {FakeShortcutSearchHandler} from 'chrome://shortcut-customization/js/search/fake_shortcut_search_handler.js'; import {getShortcutSearchHandler, setShortcutSearchHandlerForTesting} from 'chrome://shortcut-customization/js/search/shortcut_search_handler.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/shortcut_utils_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/shortcut_utils_test.ts index c21e6b9..aa44389 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/shortcut_utils_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/shortcut_utils_test.ts
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {stringToMojoString16} from 'chrome://resources/js/mojo_type_util.js'; import {CycleTabsTextSearchResult, SnapWindowLeftSearchResult, TakeScreenshotSearchResult} from 'chrome://shortcut-customization/js/fake_data.js'; import {Accelerator, AcceleratorCategory, AcceleratorKeyState, Modifier, StandardAcceleratorInfo, TextAcceleratorPart, TextAcceleratorPartType} from 'chrome://shortcut-customization/js/shortcut_types.js'; -import {areAcceleratorsEqual, compareAcceleratorInfos, getAccelerator, getAcceleratorId, getModifiersForAcceleratorInfo, getModifierString, getNumpadKeyDisplay, getSortedModifiers, getSourceAndActionFromAcceleratorId, getURLForSearchResult, isCustomizationAllowed, isStandardAcceleratorInfo, isTextAcceleratorInfo, SHORTCUTS_APP_URL} from 'chrome://shortcut-customization/js/shortcut_utils.js'; +import {areAcceleratorsEqual, compareAcceleratorInfos, getAccelerator, getAcceleratorId, getModifiersForAcceleratorInfo, getModifierString, getNumpadKeyDisplay, getSortedModifiers, getSourceAndActionFromAcceleratorId, getUnidentifiedKeyDisplay, getURLForSearchResult, isCustomizationAllowed, isStandardAcceleratorInfo, isTextAcceleratorInfo, SHORTCUTS_APP_URL} from 'chrome://shortcut-customization/js/shortcut_utils.js'; import {assertArrayEquals, assertDeepEquals, assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {createStandardAcceleratorInfo, createTextAcceleratorInfo} from './shortcut_customization_test_util.js'; @@ -242,6 +242,25 @@ assertDeepEquals(result2, {source: 0, action: 33}); }); + test('getUnidentifiedKeyDisplay', async () => { + // If unidentified keys in unidentifiedKeyCodeToKey map, return the mapped + // value. + const key_event_1 = new KeyboardEvent('keydown', { + key: 'Unidentified', + keyCode: 239, + code: '', + }); + assertEquals('ViewAllApps', getUnidentifiedKeyDisplay(key_event_1)); + + // For other unidentified keys, keydisplay is "Keycode {digit}". + const key_event_2 = new KeyboardEvent('keydown', { + key: 'Unidentified', + keyCode: 10, + code: 'Unidentified', + }); + assertEquals('Unidentified 10', getUnidentifiedKeyDisplay(key_event_2)); + }); + test('areAcceleratorsEqual', async () => { const accelerator1: Accelerator = { keyCode: 65, // A
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/shortcuts_page_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/shortcuts_page_test.ts index 4129fc7..07e2057 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/shortcuts_page_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/shortcuts_page_test.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'chrome://shortcut-customization/js/shortcuts_page.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {strictQuery} from 'chrome://resources/ash/common/typescript_utils/strict_query.js'; import {getDeepActiveElement} from 'chrome://resources/ash/common/util.js';
diff --git a/chrome/test/data/webui/chromeos/shortcut_customization/text_accelerator_test.ts b/chrome/test/data/webui/chromeos/shortcut_customization/text_accelerator_test.ts index 527708db..a16bdaa 100644 --- a/chrome/test/data/webui/chromeos/shortcut_customization/text_accelerator_test.ts +++ b/chrome/test/data/webui/chromeos/shortcut_customization/text_accelerator_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://shortcut-customization/js/text_accelerator.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {ShortcutInputKeyElement} from 'chrome://resources/ash/common/shortcut_input_ui/shortcut_input_key.js'; import {KeyInputState} from 'chrome://resources/ash/common/shortcut_input_ui/shortcut_utils.js';
diff --git a/chrome/test/data/webui/compose/compose_app_test.ts b/chrome/test/data/webui/compose/compose_app_test.ts index 9026d9a..6d0b145 100644 --- a/chrome/test/data/webui/compose/compose_app_test.ts +++ b/chrome/test/data/webui/compose/compose_app_test.ts
@@ -5,7 +5,7 @@ import 'chrome://compose/app.js'; import {ComposeAppElement, ComposeAppState} from 'chrome://compose/app.js'; -import {CloseReason, ComposeDialogCallbackRouter, ComposeState, ComposeStatus, Length, OpenMetadata, StyleModifiers, Tone, UserFeedback} from 'chrome://compose/compose.mojom-webui.js'; +import {CloseReason, ComposeDialogCallbackRouter, ComposeState, ComposeStatus, ConsentState, Length, OpenMetadata, StyleModifiers, Tone, UserFeedback} from 'chrome://compose/compose.mojom-webui.js'; import {ComposeApiProxy, ComposeApiProxyImpl} from 'chrome://compose/compose_api_proxy.js'; import {CrFeedbackOption} from 'chrome://resources/cr_elements/cr_feedback_buttons/cr_feedback_buttons.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; @@ -15,6 +15,7 @@ import {isVisible, whenCheck} from 'chrome://webui-test/test_util.js'; class TestingApiProxy extends TestBrowserProxy implements ComposeApiProxy { + private initialConsentState_: ConsentState = ConsentState.kConsented; private initialInput_: string = ''; private initialState_: ComposeState = { webuiState: '', @@ -33,6 +34,7 @@ 'compose', 'rewrite', 'openBugReportingLink', + 'openFeedbackSurveyLink', 'requestInitialState', 'saveWebuiState', 'setUserFeedback', @@ -45,6 +47,10 @@ return Promise.resolve(true); } + acknowledgeConsentDisclaimer() {} + + approveConsent() {} + closeUi(reason: CloseReason) { this.methodCalled('closeUi', reason); } @@ -70,11 +76,16 @@ this.methodCalled('openBugReportingLink'); } + openFeedbackSurveyLink() { + this.methodCalled('openFeedbackSurveyLink'); + } + openComposeSettings() {} requestInitialState(): Promise<OpenMetadata> { this.methodCalled('requestInitialState'); return Promise.resolve({ + consentState: this.initialConsentState_, composeState: this.initialState_, initialInput: this.initialInput_, configurableParams: { @@ -93,6 +104,10 @@ this.methodCalled('setUserFeedback', feedback); } + setInitialConsentState(consent: ConsentState) { + this.initialConsentState_ = consent; + } + setInitialState(state: Partial<ComposeState>, input?: string) { this.initialState_ = Object.assign( { @@ -141,6 +156,16 @@ return testProxy.remote.$.flushForTesting(); } + async function initializeNewAppWithConsentState(consent: ConsentState): + Promise<ComposeAppElement> { + document.body.innerHTML = window.trustedTypes!.emptyHTML; + testProxy.setInitialConsentState(consent); + const newApp = document.createElement('compose-app'); + document.body.appendChild(newApp); + await flushTasks(); + return newApp; + } + test('SendsInputParams', () => { assertEquals(2, app.$.textarea.inputParams.minWordLimit); assertEquals(50, app.$.textarea.inputParams.maxWordLimit); @@ -232,6 +257,70 @@ assertTrue(220 < app.$.body.scrollHeight); }); + test('ConsentStateDeterminesViewState', async () => { + const appWithConsentDialog = + await initializeNewAppWithConsentState(ConsentState.kUnset); + // Check correct visibility for consent view state + assertFalse(isVisible(appWithConsentDialog.$.appDialog)); + assertTrue(isVisible(appWithConsentDialog.$.consentDialog)); + assertTrue(isVisible(appWithConsentDialog.$.consentFooter)); + assertFalse(isVisible(appWithConsentDialog.$.disclaimerFooter)); + + const appWithDisclaimerDialog = + await initializeNewAppWithConsentState(ConsentState.kExternalConsented); + // Check correct visibility for disclaimer view state + assertFalse(isVisible(appWithDisclaimerDialog.$.appDialog)); + assertTrue(isVisible(appWithDisclaimerDialog.$.consentDialog)); + assertFalse(isVisible(appWithDisclaimerDialog.$.consentFooter)); + assertTrue(isVisible(appWithDisclaimerDialog.$.disclaimerFooter)); + + const appWithMainDialog = + await initializeNewAppWithConsentState(ConsentState.kConsented); + // Check correct visibility for main app view state + assertTrue(isVisible(appWithMainDialog.$.appDialog)); + assertFalse(isVisible(appWithMainDialog.$.consentDialog)); + }); + + test('ConsentCloseButton', async () => { + const appWithConsentDialog = + await initializeNewAppWithConsentState(ConsentState.kUnset); + + appWithConsentDialog.$.closeButtonConsent.click(); + // Close reason should match that given to the consent close button. + const closeReason = await testProxy.whenCalled('closeUi'); + assertEquals(CloseReason.kConsentCloseButton, closeReason); + }); + + test('ConsentNoThanksButton', async () => { + const appWithConsentDialog = + await initializeNewAppWithConsentState(ConsentState.kUnset); + + appWithConsentDialog.$.consentNoThanksButton.click(); + // Close reason should match that given to the consent no thanks button. + const closeReason = await testProxy.whenCalled('closeUi'); + assertEquals(CloseReason.kPageContentConsentDeclined, closeReason); + }); + + test('ConsentYesButton', async () => { + const appWithConsentDialog = + await initializeNewAppWithConsentState(ConsentState.kUnset); + + appWithConsentDialog.$.consentYesButton.click(); + // View state should change from consent UI to main app UI. + assertFalse(isVisible(appWithConsentDialog.$.consentDialog)); + assertTrue(isVisible(appWithConsentDialog.$.appDialog)); + }); + + test('DisclaimerLetsGoButton', async () => { + const appWithDisclaimerDialog = + await initializeNewAppWithConsentState(ConsentState.kExternalConsented); + + appWithDisclaimerDialog.$.disclaimerLetsGoButton.click(); + // View state should change from disclaimer UI to main app UI. + assertFalse(isVisible(appWithDisclaimerDialog.$.consentDialog)); + assertTrue(isVisible(appWithDisclaimerDialog.$.appDialog)); + }); + test('InitializesWithState', async () => { async function initializeNewAppWithState( state: Partial<ComposeState>,
diff --git a/chrome/test/data/webui/cr_components/chromeos/network/network_ip_config_test.js b/chrome/test/data/webui/cr_components/chromeos/network/network_ip_config_test.js index c01000f..6846be63 100644 --- a/chrome/test/data/webui/cr_components/chromeos/network/network_ip_config_test.js +++ b/chrome/test/data/webui/cr_components/chromeos/network/network_ip_config_test.js
@@ -64,6 +64,25 @@ assertTrue(ipConfig.$$('#autoConfigIpToggle').disabled); }); + test( + 'Show ip config textbox when automatic config is toggled off', + function() { + ipConfig.managedProperties = { + type: NetworkType.kEthernet, + }; + flush(); + + const autoConfigIpToggle = ipConfig.$$('#autoConfigIpToggle'); + assertFalse(autoConfigIpToggle.disabled); + + autoConfigIpToggle.click(); + flush(); + + const propertyList = ipConfig.$$('network-property-list-mojo'); + assertTrue(!!propertyList); + assertFalse(propertyList.disabled); + }); + test('Disabled UI state', function() { // WiFi non-policy networks should enable autoConfigIpToggle. ipConfig.managedProperties = {
diff --git a/chrome/test/data/webui/nearby_share/nearby_confirmation_page_test.js b/chrome/test/data/webui/nearby_share/nearby_confirmation_page_test.js index 9b6dd5e..e7bd779 100644 --- a/chrome/test/data/webui/nearby_share/nearby_confirmation_page_test.js +++ b/chrome/test/data/webui/nearby_share/nearby_confirmation_page_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://nearby/nearby_confirmation_page.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {TransferStatus} from 'chrome://nearby/shared/nearby_share.mojom-webui.js'; import {ShareType} from 'chrome://nearby/shared/nearby_share_share_type.mojom-webui.js';
diff --git a/chrome/test/data/webui/nearby_share/nearby_discovery_page_test.js b/chrome/test/data/webui/nearby_share/nearby_discovery_page_test.js index d8ee9cf..f12d9528 100644 --- a/chrome/test/data/webui/nearby_share/nearby_discovery_page_test.js +++ b/chrome/test/data/webui/nearby_share/nearby_discovery_page_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://nearby/nearby_discovery_page.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {setDiscoveryManagerForTesting} from 'chrome://nearby/discovery_manager.js'; import {SelectShareTargetResult, ShareTargetListenerRemote, StartDiscoveryResult} from 'chrome://nearby/shared/nearby_share.mojom-webui.js';
diff --git a/chrome/test/data/webui/nearby_share/nearby_share_app_test.js b/chrome/test/data/webui/nearby_share/nearby_share_app_test.js index 3cab7df..13c2059 100644 --- a/chrome/test/data/webui/nearby_share/nearby_share_app_test.js +++ b/chrome/test/data/webui/nearby_share/nearby_share_app_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://nearby/app.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://resources/mojo/chromeos/ash/services/nearby/public/mojom/nearby_share_settings.mojom-webui.js'; import {setContactManagerForTesting} from 'chrome://nearby/shared/nearby_contact_manager.js';
diff --git a/chrome/test/data/webui/nearby_share/shared/nearby_contact_visibility_test.js b/chrome/test/data/webui/nearby_share/shared/nearby_contact_visibility_test.js index 8c2c7cd..d159e74 100644 --- a/chrome/test/data/webui/nearby_share/shared/nearby_contact_visibility_test.js +++ b/chrome/test/data/webui/nearby_share/shared/nearby_contact_visibility_test.js
@@ -4,7 +4,7 @@ import 'chrome://nearby/strings.m.js'; import 'chrome://nearby/shared/nearby_contact_visibility.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {setContactManagerForTesting} from 'chrome://nearby/shared/nearby_contact_manager.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.js';
diff --git a/chrome/test/data/webui/nearby_share/shared/nearby_device_icon_test.js b/chrome/test/data/webui/nearby_share/shared/nearby_device_icon_test.js index c06f575..04251711 100644 --- a/chrome/test/data/webui/nearby_share/shared/nearby_device_icon_test.js +++ b/chrome/test/data/webui/nearby_share/shared/nearby_device_icon_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://nearby/shared/nearby_device_icon.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {ShareTargetType} from 'chrome://resources/mojo/chromeos/ash/services/nearby/public/mojom/nearby_share_target_types.mojom-webui.js';
diff --git a/chrome/test/data/webui/nearby_share/shared/nearby_device_test.js b/chrome/test/data/webui/nearby_share/shared/nearby_device_test.js index 792e42f7..4501198 100644 --- a/chrome/test/data/webui/nearby_share/shared/nearby_device_test.js +++ b/chrome/test/data/webui/nearby_share/shared/nearby_device_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://nearby/shared/nearby_device.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {ShareTargetType} from 'chrome://resources/mojo/chromeos/ash/services/nearby/public/mojom/nearby_share_target_types.mojom-webui.js';
diff --git a/chrome/test/data/webui/nearby_share/shared/nearby_onboarding_one_page_test.js b/chrome/test/data/webui/nearby_share/shared/nearby_onboarding_one_page_test.js index d6e58e2..31f40ce 100644 --- a/chrome/test/data/webui/nearby_share/shared/nearby_onboarding_one_page_test.js +++ b/chrome/test/data/webui/nearby_share/shared/nearby_onboarding_one_page_test.js
@@ -4,7 +4,7 @@ import 'chrome://nearby/strings.m.js'; import 'chrome://nearby/shared/nearby_onboarding_one_page.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {setNearbyShareSettingsForTesting} from 'chrome://nearby/shared/nearby_share_settings.js'; import {loadTimeData} from 'chrome://resources/ash/common/load_time_data.m.js';
diff --git a/chrome/test/data/webui/nearby_share/shared/nearby_onboarding_page_test.js b/chrome/test/data/webui/nearby_share/shared/nearby_onboarding_page_test.js index 5129fb3..c0fd9d8 100644 --- a/chrome/test/data/webui/nearby_share/shared/nearby_onboarding_page_test.js +++ b/chrome/test/data/webui/nearby_share/shared/nearby_onboarding_page_test.js
@@ -4,7 +4,7 @@ import 'chrome://nearby/strings.m.js'; import 'chrome://nearby/shared/nearby_onboarding_page.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {setNearbyShareSettingsForTesting} from 'chrome://nearby/shared/nearby_share_settings.js'; import {loadTimeData} from 'chrome://resources/ash/common/load_time_data.m.js';
diff --git a/chrome/test/data/webui/nearby_share/shared/nearby_page_template_test.js b/chrome/test/data/webui/nearby_share/shared/nearby_page_template_test.js index 7ce647d..b34174d 100644 --- a/chrome/test/data/webui/nearby_share/shared/nearby_page_template_test.js +++ b/chrome/test/data/webui/nearby_share/shared/nearby_page_template_test.js
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import 'chrome://nearby/shared/nearby_page_template.js'; import {waitAfterNextRender} from 'chrome://webui-test/polymer_test_util.js';
diff --git a/chrome/test/data/webui/nearby_share/shared/nearby_preview_test.js b/chrome/test/data/webui/nearby_share/shared/nearby_preview_test.js index 69a7845..7baa9dac 100644 --- a/chrome/test/data/webui/nearby_share/shared/nearby_preview_test.js +++ b/chrome/test/data/webui/nearby_share/shared/nearby_preview_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://nearby/shared/nearby_preview.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {ShareType} from 'chrome://nearby/shared/nearby_share_share_type.mojom-webui.js';
diff --git a/chrome/test/data/webui/nearby_share/shared/nearby_progress_test.js b/chrome/test/data/webui/nearby_share/shared/nearby_progress_test.js index ecf7b7e..3f26c30b 100644 --- a/chrome/test/data/webui/nearby_share/shared/nearby_progress_test.js +++ b/chrome/test/data/webui/nearby_share/shared/nearby_progress_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. import 'chrome://nearby/shared/nearby_progress.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {ShareTargetType} from 'chrome://resources/mojo/chromeos/ash/services/nearby/public/mojom/nearby_share_target_types.mojom-webui.js';
diff --git a/chrome/test/data/webui/nearby_share/shared/nearby_visibility_page_test.js b/chrome/test/data/webui/nearby_share/shared/nearby_visibility_page_test.js index d69252ad..6a1848c 100644 --- a/chrome/test/data/webui/nearby_share/shared/nearby_visibility_page_test.js +++ b/chrome/test/data/webui/nearby_share/shared/nearby_visibility_page_test.js
@@ -4,7 +4,7 @@ import 'chrome://nearby/strings.m.js'; import 'chrome://nearby/shared/nearby_visibility_page.js'; -import 'chrome://webui-test/mojo_webui_test_support.js'; +import 'chrome://webui-test/chromeos/mojo_webui_test_support.js'; import {DataUsage, FastInitiationNotificationState, Visibility} from 'chrome://resources/mojo/chromeos/ash/services/nearby/public/mojom/nearby_share_settings.mojom-webui.js'; import {waitAfterNextRender} from 'chrome://webui-test/polymer_test_util.js';
diff --git a/chrome/test/data/webui/new_tab_page/app_test.ts b/chrome/test/data/webui/new_tab_page/app_test.ts index b67c1acf..88c106f 100644 --- a/chrome/test/data/webui/new_tab_page/app_test.ts +++ b/chrome/test/data/webui/new_tab_page/app_test.ts
@@ -542,6 +542,31 @@ NtpBackgroundImageSource.kUploadedImage)); }); + test( + 'setting wallpaper search background produces correct metrics', + async () => { + // Arrange. + const theme = createTheme(); + theme.backgroundImage = createBackgroundImage('https://foo.com'); + theme.backgroundImage.imageSource = + NtpBackgroundImageSource.kWallpaperSearch; + + // Act. + callbackRouterRemote.setTheme(theme); + await callbackRouterRemote.$.flushForTesting(); + + // Assert. + assertEquals(1, metrics.count('NewTabPage.Collections.IdOnLoad')); + assertEquals( + 1, metrics.count('NewTabPage.Collections.IdOnLoad', '')); + assertEquals(1, metrics.count('NewTabPage.BackgroundImageSource')); + assertEquals( + 1, + metrics.count( + 'NewTabPage.BackgroundImageSource', + NtpBackgroundImageSource.kWallpaperSearch)); + }); + suite('background image load', () => { suiteSetup(() => { loadTimeData.overrideValues({backgroundImageUrl: 'https://foo.com'});
diff --git a/chrome/test/data/webui/settings/chromeos/date_time_page/date_time_page_test.ts b/chrome/test/data/webui/settings/chromeos/date_time_page/date_time_page_test.ts index e42f1a9..376cd1c 100644 --- a/chrome/test/data/webui/settings/chromeos/date_time_page/date_time_page_test.ts +++ b/chrome/test/data/webui/settings/chromeos/date_time_page/date_time_page_test.ts
@@ -5,7 +5,7 @@ import 'chrome://os-settings/lazy_load.js'; import {DateTimeSettingsCardElement, SettingsDateTimePageElement, TimeZoneAutoDetectMethod, TimeZoneBrowserProxyImpl, TimezoneSubpageElement} from 'chrome://os-settings/lazy_load.js'; -import {ControlledRadioButtonElement, CrSettingsPrefs, PrefsState, Router, routes, SettingsDropdownMenuElement, SettingsToggleButtonElement} from 'chrome://os-settings/os_settings.js'; +import {ControlledRadioButtonElement, CrSettingsPrefs, GeolocationAccessLevel, PrefsState, Router, routes, SettingsDropdownMenuElement, SettingsToggleButtonElement} from 'chrome://os-settings/os_settings.js'; import {webUIListenerCallback} from 'chrome://resources/js/cr.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; @@ -64,6 +64,15 @@ value: true, }, }, + ash: { + user: { + geolocation_access_level: { + key: 'ash.user.geolocation_access_level', + type: GeolocationAccessLevel, + value: GeolocationAccessLevel.ALLOWED, + }, + }, + }, }; }
diff --git a/chrome/test/data/webui/settings/chromeos/device_page/device_page_test_util.ts b/chrome/test/data/webui/settings/chromeos/device_page/device_page_test_util.ts index f76a434b..b380cb46 100644 --- a/chrome/test/data/webui/settings/chromeos/device_page/device_page_test_util.ts +++ b/chrome/test/data/webui/settings/chromeos/device_page/device_page_test_util.ts
@@ -4,6 +4,9 @@ /** @fileoverview Utils for device page browser tests. */ +import {GeolocationAccessLevel} from 'chrome://os-settings/os_settings.js'; + + export function getFakePrefs() { return { arc: { @@ -48,6 +51,13 @@ value: 0, }, }, + user: { + geolocation_access_level: { + key: 'ash.user.geolocation_access_level', + type: GeolocationAccessLevel, + value: GeolocationAccessLevel.ALLOWED, + }, + }, }, gdata: { disabled: {
diff --git a/chrome/test/data/webui/side_panel/BUILD.gn b/chrome/test/data/webui/side_panel/BUILD.gn index d1fa3df0..c664810f 100644 --- a/chrome/test/data/webui/side_panel/BUILD.gn +++ b/chrome/test/data/webui/side_panel/BUILD.gn
@@ -20,6 +20,7 @@ "commerce/price_tracking_section_test.ts", "performance_controls/app_test.ts", "performance_controls/battery_saver_card_test.ts", + "performance_controls/browser_health_card_test.ts", "performance_controls/memory_saver_card_test.ts", "performance_controls/performance_page_api_proxy_test.ts", "performance_controls/battery_saver_card_api_proxy_test.ts",
diff --git a/chrome/test/data/webui/side_panel/performance_controls/browser_health_card_test.ts b/chrome/test/data/webui/side_panel/performance_controls/browser_health_card_test.ts new file mode 100644 index 0000000..1f38f767 --- /dev/null +++ b/chrome/test/data/webui/side_panel/performance_controls/browser_health_card_test.ts
@@ -0,0 +1,35 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'chrome://performance-side-panel.top-chrome/browser_health_card.js'; + +import {BrowserHealthCardElement} from 'chrome://performance-side-panel.top-chrome/browser_health_card.js'; +import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; +import {assertEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; + +suite('Browser health card', () => { + let browserHealthCard: BrowserHealthCardElement; + + setup(() => { + document.body.innerHTML = window.trustedTypes!.emptyHTML; + + browserHealthCard = document.createElement('browser-health-card'); + + document.body.appendChild(browserHealthCard); + }); + + test('heading exists', () => { + const heading = browserHealthCard.shadowRoot!.querySelector('sp-heading'); + assertTrue(!!heading); + assertEquals(heading.innerText.trim(), 'Browser Health'); + }); + + test('hides when features are disabled', () => { + loadTimeData.overrideValues({ + isPerformanceCPUInterventionEnabled: false, + isPerformanceMemoryInterventionEnabled: false, + }); + assertTrue(browserHealthCard.hidden); + }); +});
diff --git a/chrome/test/data/webui/side_panel/performance_controls/performance_controls_browsertest.cc b/chrome/test/data/webui/side_panel/performance_controls/performance_controls_browsertest.cc index 3bf6254..3b6e0b9 100644 --- a/chrome/test/data/webui/side_panel/performance_controls/performance_controls_browsertest.cc +++ b/chrome/test/data/webui/side_panel/performance_controls/performance_controls_browsertest.cc
@@ -28,6 +28,11 @@ "mocha.run()"); } +IN_PROC_BROWSER_TEST_F(SidePanelPerformanceControlsTest, BrowserHealthCard) { + RunTest("side_panel/performance_controls/browser_health_card_test.js", + "mocha.run()"); +} + IN_PROC_BROWSER_TEST_F(SidePanelPerformanceControlsTest, MemorySaverCard) { RunTest("side_panel/performance_controls/memory_saver_card_test.js", "mocha.run()");
diff --git a/chromecast/base/cast_features.cc b/chromecast/base/cast_features.cc index 1524d69..e4e49f3 100644 --- a/chromecast/base/cast_features.cc +++ b/chromecast/base/cast_features.cc
@@ -216,8 +216,7 @@ // Initialize the FeatureList from the command line. auto feature_list = std::make_unique<base::FeatureList>(); - feature_list->InitializeFromCommandLine(all_enable_features, - all_disable_features); + feature_list->InitFromCommandLine(all_enable_features, all_disable_features); // Override defaults from the DCS config. for (const auto kv : dcs_features) {
diff --git a/chromecast/external_mojo/external_service_support/process_setup.cc b/chromecast/external_mojo/external_service_support/process_setup.cc index 83d83d1..49323943 100644 --- a/chromecast/external_mojo/external_service_support/process_setup.cc +++ b/chromecast/external_mojo/external_service_support/process_setup.cc
@@ -46,7 +46,7 @@ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (!command_line->HasSwitch(switches::kDeferFeatureList)) { - base::FeatureList::InitializeInstance( + base::FeatureList::InitInstance( command_line->GetSwitchValueASCII(switches::kEnableFeatures), command_line->GetSwitchValueASCII(switches::kDisableFeatures)); }
diff --git a/chromeos/ash/components/dbus/fwupd/dbus_constants.h b/chromeos/ash/components/dbus/fwupd/dbus_constants.h index dbc65eb..80faf64 100644 --- a/chromeos/ash/components/dbus/fwupd/dbus_constants.h +++ b/chromeos/ash/components/dbus/fwupd/dbus_constants.h
@@ -14,6 +14,7 @@ const char kFwupdGetUpgradesMethodName[] = "GetUpgrades"; const char kFwupdGetDevicesMethodName[] = "GetDevices"; const char kFwupdInstallMethodName[] = "Install"; +const char kFwupdSetFeatureFlagsMethodName[] = "SetFeatureFlags"; } // namespace ash
diff --git a/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.cc b/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.cc index 14d6165..6f393e7 100644 --- a/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.cc +++ b/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.cc
@@ -52,4 +52,7 @@ observer.OnInstallResponse(install_success_); } +// Implement stub method to satisfy interface. +void FakeFwupdClient::SetFwupdFeatureFlags() {} + } // namespace ash
diff --git a/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.h b/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.h index 6d2da0c1..181b39c 100644 --- a/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.h +++ b/chromeos/ash/components/dbus/fwupd/fake_fwupd_client.h
@@ -27,6 +27,7 @@ FirmwareInstallOptions options) override; private: + void SetFwupdFeatureFlags() override; bool install_success_ = false; };
diff --git a/chromeos/ash/components/dbus/fwupd/fwupd_client.cc b/chromeos/ash/components/dbus/fwupd/fwupd_client.cc index 9880ed9..b320bef 100644 --- a/chromeos/ash/components/dbus/fwupd/fwupd_client.cc +++ b/chromeos/ash/components/dbus/fwupd/fwupd_client.cc
@@ -41,6 +41,9 @@ // "100000000"(9th bit) is the bit release flag for a trusted report. // Defined here: https://github.com/fwupd/fwupd/blob/main/libfwupd/fwupd-enums.h const uint64_t kTrustedReportsReleaseFlag = 1llu << 8; +// "10000"(5th bit) is the fwupd feature flag to allow interactive requests. +// Defined here: https://github.com/fwupd/fwupd/blob/main/libfwupd/fwupd-enums.h +const uint64_t kRequestsFeatureFlag = 1llu << 4; base::FilePath GetFilePathFromUri(const GURL uri) { const std::string filepath = uri.spec(); @@ -116,6 +119,24 @@ weak_ptr_factory_.GetWeakPtr())); properties_->ConnectSignals(); properties_->GetAll(); + + SetFwupdFeatureFlags(); + } + + void SetFwupdFeatureFlags() override { + // Enable interactive updates in fwupd by setting the "requests" + // FwupdFeatureFlag when the Firmware Updates v2 feature flag is enabled. + if (base::FeatureList::IsEnabled(features::kFirmwareUpdateUIV2)) { + dbus::MethodCall method_call(kFwupdServiceInterface, + kFwupdSetFeatureFlagsMethodName); + dbus::MessageWriter writer(&method_call); + writer.AppendInt64(kRequestsFeatureFlag); + + proxy_->CallMethodWithErrorResponse( + &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, + base::BindOnce(&FwupdClientImpl::SetFeatureFlagsCallback, + weak_ptr_factory_.GetWeakPtr())); + } } void RequestUpdates(const std::string& device_id) override { @@ -423,6 +444,15 @@ observer.OnPropertiesChangedResponse(properties_.get()); } + void SetFeatureFlagsCallback(dbus::Response* response, + dbus::ErrorResponse* error_response) { + // No need to take any specific action here. + if (!response) { + LOG(ERROR) << "No D-Bus response received from fwupd."; + return; + } + } + raw_ptr<dbus::ObjectProxy, ExperimentalAsh> proxy_ = nullptr; // Note: This should remain the last member so it'll be destroyed and
diff --git a/chromeos/ash/components/dbus/fwupd/fwupd_client.h b/chromeos/ash/components/dbus/fwupd/fwupd_client.h index ce09c76..72313d8 100644 --- a/chromeos/ash/components/dbus/fwupd/fwupd_client.h +++ b/chromeos/ash/components/dbus/fwupd/fwupd_client.h
@@ -74,6 +74,11 @@ FwupdClient(); ~FwupdClient() override; + // Set fwupd client-capability feature flags. + // See https://github.com/fwupd/fwupd/blob/main/libfwupd/fwupd-enums.h for the + // full list of FwupdFeatureFlags. + virtual void SetFwupdFeatureFlags() = 0; + // Auxiliary variables for testing. // TODO(swifton): Replace this with an observer. bool client_is_in_testing_mode_ = false;
diff --git a/chromeos/ash/components/dbus/fwupd/fwupd_client_unittest.cc b/chromeos/ash/components/dbus/fwupd/fwupd_client_unittest.cc index 86c9840..6fc2dd3 100644 --- a/chromeos/ash/components/dbus/fwupd/fwupd_client_unittest.cc +++ b/chromeos/ash/components/dbus/fwupd/fwupd_client_unittest.cc
@@ -4,9 +4,11 @@ #include "chromeos/ash/components/dbus/fwupd/fwupd_client.h" +#include "ash/constants/ash_features.h" #include "base/files/scoped_file.h" #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" +#include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "chromeos/ash/components/dbus/fwupd/fwupd_properties.h" #include "dbus/message.h" @@ -14,6 +16,7 @@ #include "dbus/mock_object_proxy.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/abseil-cpp/absl/types/optional.h" using ::testing::_; using ::testing::Invoke; @@ -105,6 +108,18 @@ return fwupd_client_->device_signal_call_count_for_testing_; } + void DisableFeatureFlag(const base::Feature& feature) { + scoped_feature_list_.InitAndDisableFeature(feature); + } + + void EnableFeatureFlag(const base::Feature& feature) { + scoped_feature_list_.InitAndEnableFeature(feature); + } + + // This helper method is used to invoke the protected method + // SetFwupdFeatureFlags() from this friend class. + void CallSetFwupdFeatureFlags() { fwupd_client_->SetFwupdFeatureFlags(); } + void OnMethodCalled(dbus::MethodCall* method_call, int timeout_ms, dbus::ObjectProxy::ResponseOrErrorCallback* callback) { @@ -315,6 +330,8 @@ std::string expected_checksum_; std::string expected_description_; int expected_priority_ = kFakeUpdatePriorityForTesting; + + base::test::ScopedFeatureList scoped_feature_list_; }; // TODO (swifton): Rewrite this test with an observer when it's available. @@ -674,4 +691,49 @@ base::RunLoop().RunUntilIdle(); } +TEST_F(FwupdClientTest, SetFeatureFlagsWithV2FlagDisabled) { + // Fwupd feature flags should not be set if the v2 flag is disabled. + // To test this, verify that no D-Bus method calls are made. + EXPECT_CALL(*proxy_, DoCallMethodWithErrorResponse(_, _, _)).Times(0); + DisableFeatureFlag(ash::features::kFirmwareUpdateUIV2); + CallSetFwupdFeatureFlags(); +} + +TEST_F(FwupdClientTest, SetFeatureFlagsWithV2FlagEnabled) { + // Expect that the D-Bus method "SetFeatureFlags" is called when the Firmware + // Updates v2 flag is enabled. + + // Helper function to get the int64 args passed to the given method_call. + auto GetInt64ArgumentOfMethod = + [](dbus::MethodCall* method_call) -> absl::optional<int64_t> { + dbus::MessageReader reader(method_call); + if (!reader.HasMoreData()) { + return absl::nullopt; + } + int64_t feature_flag_arguments; + if (!reader.PopInt64(&feature_flag_arguments)) { + return absl::nullopt; + } + return feature_flag_arguments; + }; + + const uint64_t kRequestsFeatureFlag = 1llu << 4; + + EXPECT_CALL( + *proxy_, + DoCallMethodWithErrorResponse( + testing::AllOf( + testing::ResultOf("method name", + std::mem_fn(&dbus::MethodCall::GetMember), + testing::StrEq("SetFeatureFlags")), + testing::ResultOf("feature flag passed to the method call", + GetInt64ArgumentOfMethod, + testing::Eq(kRequestsFeatureFlag))), + _, _)) + .Times(1); + + EnableFeatureFlag(ash::features::kFirmwareUpdateUIV2); + CallSetFwupdFeatureFlags(); +} + } // namespace ash
diff --git a/chromeos/ash/components/network/network_connect.cc b/chromeos/ash/components/network/network_connect.cc index 7af08f1..583be02a 100644 --- a/chromeos/ash/components/network/network_connect.cc +++ b/chromeos/ash/components/network/network_connect.cc
@@ -502,13 +502,6 @@ void NetworkConnectImpl::ShowPortalSignin(const std::string& network_id, Source source) { - const NetworkState* network = GetNetworkStateFromId(network_id); - if (!network || !network->IsConnectedState() || - !NetworkState::StateIsPortalled(network->connection_state())) { - NET_LOG(ERROR) << "ShowPortalSignin without a portalled state: " - << NetworkGuidId(network_id); - return; - } delegate_->ShowPortalSignin(network_id, source); }
diff --git a/chromeos/ash/components/tether/host_connection_metrics_logger.cc b/chromeos/ash/components/tether/host_connection_metrics_logger.cc index c316973..939202ce 100644 --- a/chromeos/ash/components/tether/host_connection_metrics_logger.cc +++ b/chromeos/ash/components/tether/host_connection_metrics_logger.cc
@@ -23,110 +23,122 @@ void HostConnectionMetricsLogger::RecordConnectionToHostResult( ConnectionToHostResult result, - const std::string& device_id) { - // Persist this value for later use in RecordConnectionResultSuccess(). It - // will be cleared once used. - active_host_device_id_ = device_id; + const std::string& device_id, + absl::optional<ConnectionToHostInternalError> internal_error) { + if (!active_host_device_id_.empty()) { + active_host_device_id_.clear(); + } - switch (result) { - case ConnectionToHostResult::CONNECTION_RESULT_PROVISIONING_FAILED: - RecordConnectionResultProvisioningFailure( - ConnectionToHostResult_ProvisioningFailureEventType:: - PROVISIONING_FAILED); - break; - case ConnectionToHostResult::CONNECTION_RESULT_SUCCESS: - RecordConnectionResultSuccess( - ConnectionToHostResult_SuccessEventType::SUCCESS); - break; - case ConnectionToHostResult::CONNECTION_RESULT_FAILURE_UNKNOWN_ERROR: + if (result == ConnectionToHostResult::INTERNAL_ERROR) { + CHECK(internal_error.has_value()); + RecordInternalError(internal_error.value()); + } else { + CHECK(!internal_error.has_value()); + } + + UMA_HISTOGRAM_ENUMERATION( + "InstantTethering.ConnectionToHostResult.EndResult", result, + ConnectionToHostResult::CONNECTION_TO_HOST_RESULT_MAX); + + // Preserve legacy + // InstantTethering.ConnectionToHostResult.ProvisioningFailureRate metric by + // counting the PROVISIONING_FAILED result as a provisioning failure, and + // other results as "other" + if (result == ConnectionToHostResult::PROVISIONING_FAILURE) { + UMA_HISTOGRAM_ENUMERATION( + "InstantTethering.ConnectionToHostResult.ProvisioningFailureRate", + ConnectionToHostResult_ProvisioningFailureEventType:: + PROVISIONING_FAILED, + ConnectionToHostResult_ProvisioningFailureEventType:: + PROVISIONING_FAILURE_MAX); + } else { + UMA_HISTOGRAM_ENUMERATION( + "InstantTethering.ConnectionToHostResult.ProvisioningFailureRate", + ConnectionToHostResult_ProvisioningFailureEventType::OTHER, + ConnectionToHostResult_ProvisioningFailureEventType:: + PROVISIONING_FAILURE_MAX); + + // Preserve InstantTethering.ConnectionToHostResult.SuccessRate.Background + // by counting "success" as success, and all other results as failures. + if (result == ConnectionToHostResult::SUCCESS) { + UMA_HISTOGRAM_ENUMERATION( + "InstantTethering.ConnectionToHostResult.SuccessRate.Background", + ConnectionToHostResult_SuccessEventType::SUCCESS, + ConnectionToHostResult_SuccessEventType::SUCCESS_MAX); + } else { + UMA_HISTOGRAM_ENUMERATION( + "InstantTethering.ConnectionToHostResult.SuccessRate.Background", + ConnectionToHostResult_SuccessEventType::FAILURE, + ConnectionToHostResult_SuccessEventType::SUCCESS_MAX); + } + } +} + +void HostConnectionMetricsLogger::RecordInternalError( + ConnectionToHostInternalError internal_error) { + switch (internal_error) { + case ConnectionToHostInternalError::UNKNOWN_ERROR: RecordConnectionResultFailure( ConnectionToHostResult_FailureEventType::UNKNOWN_ERROR); break; - case ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_TIMEOUT: - RecordConnectionResultFailureClientConnection( - ConnectionToHostResult_FailureClientConnectionEventType::TIMEOUT); - break; - case ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_CANCELED_BY_USER: - RecordConnectionResultFailureClientConnection( - ConnectionToHostResult_FailureClientConnectionEventType:: - CANCELED_BY_USER); - break; - case ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_INTERNAL_ERROR: + case ConnectionToHostInternalError::CLIENT_CONNECTION_INTERNAL_ERROR: RecordConnectionResultFailureClientConnection( ConnectionToHostResult_FailureClientConnectionEventType:: INTERNAL_ERROR); break; - case ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_TETHERING_TIMED_OUT_FIRST_TIME_SETUP_WAS_REQUIRED: + case ConnectionToHostInternalError::CLIENT_CONNECTION_TIMEOUT: + RecordConnectionResultFailureClientConnection( + ConnectionToHostResult_FailureClientConnectionEventType::TIMEOUT); + break; + case ConnectionToHostInternalError:: + TETHERING_TIMED_OUT_FIRST_TIME_SETUP_REQUIRED: RecordConnectionResultFailureTetheringTimeout( ConnectionToHostResult_FailureTetheringTimeoutEventType:: FIRST_TIME_SETUP_WAS_REQUIRED); break; - case ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_TETHERING_TIMED_OUT_FIRST_TIME_SETUP_WAS_NOT_REQUIRED: + case ConnectionToHostInternalError:: + TETHERING_TIMED_OUT_FIRST_TIME_SETUP_NOT_REQUIRED: RecordConnectionResultFailureTetheringTimeout( ConnectionToHostResult_FailureTetheringTimeoutEventType:: FIRST_TIME_SETUP_WAS_NOT_REQUIRED); break; - case ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_TETHERING_UNSUPPORTED: - RecordConnectionResultFailure( - ConnectionToHostResult_FailureEventType::TETHERING_UNSUPPORTED); - break; - case ConnectionToHostResult::CONNECTION_RESULT_FAILURE_NO_CELL_DATA: - RecordConnectionResultFailure( - ConnectionToHostResult_FailureEventType::NO_CELL_DATA); - break; - case ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_FAILED: + case ConnectionToHostInternalError::ENABLING_HOTSPOT_FAILED: RecordConnectionResultFailure( ConnectionToHostResult_FailureEventType::ENABLING_HOTSPOT_FAILED); break; - case ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_TIMEOUT: + case ConnectionToHostInternalError::ENABLING_HOTSPOT_TIMEOUT: RecordConnectionResultFailure( ConnectionToHostResult_FailureEventType::ENABLING_HOTSPOT_TIMEOUT); break; - case ConnectionToHostResult::CONNECTION_RESULT_FAILURE_NO_RESPONSE: + case ConnectionToHostInternalError::NO_RESPONSE: RecordConnectionResultFailure( ConnectionToHostResult_FailureEventType::NO_RESPONSE); break; - case ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_INVALID_HOTSPOT_CREDENTIALS: + case ConnectionToHostInternalError::INVALID_HOTSPOT_CREDENTIALS: RecordConnectionResultFailure( ConnectionToHostResult_FailureEventType::INVALID_HOTSPOT_CREDENTIALS); break; - case ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_SUCCESSFUL_REQUEST_BUT_NO_RESPONSE: + case ConnectionToHostInternalError::SUCCESSFUL_REQUEST_BUT_NO_RESPONSE: RecordConnectionResultFailure(ConnectionToHostResult_FailureEventType:: SUCCESSFUL_REQUEST_BUT_NO_RESPONSE); break; - case ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_UNRECOGNIZED_RESPONSE_ERROR: + case ConnectionToHostInternalError::UNRECOGNIZED_RESPONSE_ERROR: RecordConnectionResultFailure( ConnectionToHostResult_FailureEventType::UNRECOGNIZED_RESPONSE_ERROR); break; - case ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_INVALID_ACTIVE_EXISTING_SOFT_AP_CONFIG: + case ConnectionToHostInternalError::INVALID_ACTIVE_EXISTING_SOFT_AP_CONFIG: RecordConnectionResultFailure(ConnectionToHostResult_FailureEventType:: INVALID_ACTIVE_EXISTING_SOFT_AP_CONFIG); break; - case ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_INVALID_NEW_SOFT_AP_CONFIG: + case ConnectionToHostInternalError::INVALID_NEW_SOFT_AP_CONFIG: RecordConnectionResultFailure( ConnectionToHostResult_FailureEventType::INVALID_NEW_SOFT_AP_CONFIG); break; - case ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_INVALID_WIFI_AP_CONFIG: + case ConnectionToHostInternalError::INVALID_WIFI_AP_CONFIG: RecordConnectionResultFailure( ConnectionToHostResult_FailureEventType::INVALID_WIFI_AP_CONFIG); break; - default: - NOTREACHED(); - }; + } } void HostConnectionMetricsLogger::OnActiveHostChanged( @@ -139,37 +151,11 @@ } } -void HostConnectionMetricsLogger::RecordConnectionResultProvisioningFailure( - ConnectionToHostResult_ProvisioningFailureEventType event_type) { - UMA_HISTOGRAM_ENUMERATION( - "InstantTethering.ConnectionToHostResult.ProvisioningFailureRate", - event_type, - ConnectionToHostResult_ProvisioningFailureEventType:: - PROVISIONING_FAILURE_MAX); -} - -void HostConnectionMetricsLogger::RecordConnectionResultSuccess( - ConnectionToHostResult_SuccessEventType event_type) { - DCHECK(!active_host_device_id_.empty()); - - active_host_device_id_.clear(); - - UMA_HISTOGRAM_ENUMERATION( - "InstantTethering.ConnectionToHostResult.SuccessRate.Background", - event_type, ConnectionToHostResult_SuccessEventType::SUCCESS_MAX); - - RecordConnectionResultProvisioningFailure( - ConnectionToHostResult_ProvisioningFailureEventType::OTHER); -} - void HostConnectionMetricsLogger::RecordConnectionResultFailure( ConnectionToHostResult_FailureEventType event_type) { UMA_HISTOGRAM_ENUMERATION( "InstantTethering.ConnectionToHostResult.Failure", event_type, ConnectionToHostResult_FailureEventType::FAILURE_MAX); - - RecordConnectionResultSuccess( - ConnectionToHostResult_SuccessEventType::FAILURE); } void HostConnectionMetricsLogger::RecordConnectionResultFailureClientConnection(
diff --git a/chromeos/ash/components/tether/host_connection_metrics_logger.h b/chromeos/ash/components/tether/host_connection_metrics_logger.h index 6fa7cb8..fcc53ea 100644 --- a/chromeos/ash/components/tether/host_connection_metrics_logger.h +++ b/chromeos/ash/components/tether/host_connection_metrics_logger.h
@@ -5,7 +5,6 @@ #ifndef CHROMEOS_ASH_COMPONENTS_TETHER_HOST_CONNECTION_METRICS_LOGGER_H_ #define CHROMEOS_ASH_COMPONENTS_TETHER_HOST_CONNECTION_METRICS_LOGGER_H_ -#include <map> #include <string> #include "base/gtest_prod_util.h" @@ -27,30 +26,37 @@ class HostConnectionMetricsLogger : public ActiveHost::Observer { public: enum class ConnectionToHostResult { - CONNECTION_RESULT_PROVISIONING_FAILED, - CONNECTION_RESULT_SUCCESS, - CONNECTION_RESULT_FAILURE_UNKNOWN_ERROR, - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_TIMEOUT, - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_CANCELED_BY_USER, - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_INTERNAL_ERROR, - CONNECTION_RESULT_FAILURE_TETHERING_TIMED_OUT_FIRST_TIME_SETUP_WAS_REQUIRED, - CONNECTION_RESULT_FAILURE_TETHERING_TIMED_OUT_FIRST_TIME_SETUP_WAS_NOT_REQUIRED, - CONNECTION_RESULT_FAILURE_TETHERING_UNSUPPORTED, - CONNECTION_RESULT_FAILURE_NO_CELL_DATA, - CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_FAILED, - CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_TIMEOUT, - CONNECTION_RESULT_FAILURE_NO_RESPONSE, - CONNECTION_RESULT_FAILURE_INVALID_HOTSPOT_CREDENTIALS, - CONNECTION_RESULT_FAILURE_SUCCESSFUL_REQUEST_BUT_NO_RESPONSE, - CONNECTION_RESULT_FAILURE_UNRECOGNIZED_RESPONSE_ERROR, - CONNECTION_RESULT_FAILURE_INVALID_ACTIVE_EXISTING_SOFT_AP_CONFIG, - CONNECTION_RESULT_FAILURE_INVALID_NEW_SOFT_AP_CONFIG, - CONNECTION_RESULT_FAILURE_INVALID_WIFI_AP_CONFIG, + SUCCESS = 0, + INTERNAL_ERROR = 1, + USER_CANCELLATION = 2, + PROVISIONING_FAILURE = 3, + NO_CELLULAR_DATA = 4, + TETHERING_UNSUPPORTED = 5, + CONNECTION_TO_HOST_RESULT_MAX, + }; + + enum class ConnectionToHostInternalError { + UNKNOWN_ERROR, + CLIENT_CONNECTION_TIMEOUT, + CLIENT_CONNECTION_INTERNAL_ERROR, + TETHERING_TIMED_OUT_FIRST_TIME_SETUP_REQUIRED, + TETHERING_TIMED_OUT_FIRST_TIME_SETUP_NOT_REQUIRED, + ENABLING_HOTSPOT_FAILED, + ENABLING_HOTSPOT_TIMEOUT, + NO_RESPONSE, + INVALID_HOTSPOT_CREDENTIALS, + SUCCESSFUL_REQUEST_BUT_NO_RESPONSE, + UNRECOGNIZED_RESPONSE_ERROR, + INVALID_ACTIVE_EXISTING_SOFT_AP_CONFIG, + INVALID_NEW_SOFT_AP_CONFIG, + INVALID_WIFI_AP_CONFIG, }; // Record the result of an attempted host connection. - virtual void RecordConnectionToHostResult(ConnectionToHostResult result, - const std::string& device_id); + virtual void RecordConnectionToHostResult( + ConnectionToHostResult result, + const std::string& device_id, + absl::optional<ConnectionToHostInternalError> internal_error); HostConnectionMetricsLogger(ActiveHost* active_host); @@ -130,6 +136,8 @@ HostConnectionMetricsLoggerTest, RecordConnectionResultFailureInvalidHotspotCredentials); + void RecordInternalError(ConnectionToHostInternalError internal_error); + // An Instant Tethering connection can fail for several different reasons. // Though traditionally success and each failure case would be logged to a // single enum, we have chosen to start at a top-level of view of simply @@ -187,16 +195,6 @@ FAILURE_TETHERING_TIMEOUT_MAX }; - // Record if a host connection attempt never went through due to provisioning - // failure, or otherwise continued. - void RecordConnectionResultProvisioningFailure( - ConnectionToHostResult_ProvisioningFailureEventType event_type); - - // Record if a host connection attempt succeeded or failed. Failure is - // covered by the RecordConnectionResultFailure() method. - void RecordConnectionResultSuccess( - ConnectionToHostResult_SuccessEventType event_type); - // Record how a host connection attempt failed. Failure due to client error or // tethering timeout is covered by the // RecordConnectionResultFailureClientConnection() or
diff --git a/chromeos/ash/components/tether/host_connection_metrics_logger_unittest.cc b/chromeos/ash/components/tether/host_connection_metrics_logger_unittest.cc index 537bc0260..82fd3be 100644 --- a/chromeos/ash/components/tether/host_connection_metrics_logger_unittest.cc +++ b/chromeos/ash/components/tether/host_connection_metrics_logger_unittest.cc
@@ -23,6 +23,11 @@ const char kWifiNetworkGuid[] = "wifiNetworkGuid"; } // namespace +using ConnectionToHostResult = + HostConnectionMetricsLogger::ConnectionToHostResult; +using ConnectionToHostInternalError = + HostConnectionMetricsLogger::ConnectionToHostInternalError; + class HostConnectionMetricsLoggerTest : public testing::Test { public: HostConnectionMetricsLoggerTest(const HostConnectionMetricsLoggerTest&) = @@ -67,6 +72,11 @@ "InstantTethering.ConnectionToHostResult.Failure", event_type, 1); } + void VerifyEndResult(ConnectionToHostResult result) { + histogram_tester_.ExpectUniqueSample( + "InstantTethering.ConnectionToHostResult.EndResult", result, 1); + } + void VerifyFailure_ClientConnection( HostConnectionMetricsLogger:: ConnectionToHostResult_FailureClientConnectionEventType event_type) { @@ -115,9 +125,8 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_PROVISIONING_FAILED, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::PROVISIONING_FAILURE, + test_devices_[0].GetDeviceId(), absl::nullopt); VerifyProvisioningFailure( HostConnectionMetricsLogger:: @@ -129,15 +138,15 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_SUCCESS, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::SUCCESS, + test_devices_[0].GetDeviceId(), absl::nullopt); VerifySuccess(HostConnectionMetricsLogger:: ConnectionToHostResult_SuccessEventType::SUCCESS); VerifyProvisioningFailure( HostConnectionMetricsLogger:: ConnectionToHostResult_ProvisioningFailureEventType::OTHER); + VerifyEndResult(ConnectionToHostResult::SUCCESS); } TEST_F(HostConnectionMetricsLoggerTest, @@ -145,24 +154,24 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_SUCCESS, - test_devices_[1].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::SUCCESS, + test_devices_[1].GetDeviceId(), absl::nullopt); VerifySuccess(HostConnectionMetricsLogger:: ConnectionToHostResult_SuccessEventType::SUCCESS); VerifyProvisioningFailure( HostConnectionMetricsLogger:: ConnectionToHostResult_ProvisioningFailureEventType::OTHER); + VerifyEndResult(ConnectionToHostResult::SUCCESS); } TEST_F(HostConnectionMetricsLoggerTest, RecordConnectionResultFailure) { SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_UNKNOWN_ERROR, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + test_devices_[0].GetDeviceId(), + ConnectionToHostInternalError::UNKNOWN_ERROR); VerifyFailure(HostConnectionMetricsLogger:: ConnectionToHostResult_FailureEventType::UNKNOWN_ERROR); @@ -172,6 +181,7 @@ VerifyProvisioningFailure( HostConnectionMetricsLogger:: ConnectionToHostResult_ProvisioningFailureEventType::OTHER); + VerifyEndResult(ConnectionToHostResult::INTERNAL_ERROR); } TEST_F(HostConnectionMetricsLoggerTest, @@ -179,9 +189,9 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_UNKNOWN_ERROR, - test_devices_[1].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + test_devices_[1].GetDeviceId(), + ConnectionToHostInternalError::UNKNOWN_ERROR); VerifyFailure(HostConnectionMetricsLogger:: ConnectionToHostResult_FailureEventType::UNKNOWN_ERROR); @@ -191,6 +201,7 @@ VerifyProvisioningFailure( HostConnectionMetricsLogger:: ConnectionToHostResult_ProvisioningFailureEventType::OTHER); + VerifyEndResult(ConnectionToHostResult::INTERNAL_ERROR); } TEST_F(HostConnectionMetricsLoggerTest, @@ -198,9 +209,9 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_TIMEOUT, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + test_devices_[0].GetDeviceId(), + ConnectionToHostInternalError::CLIENT_CONNECTION_TIMEOUT); VerifyFailure_ClientConnection( HostConnectionMetricsLogger:: @@ -213,6 +224,7 @@ VerifyProvisioningFailure( HostConnectionMetricsLogger:: ConnectionToHostResult_ProvisioningFailureEventType::OTHER); + VerifyEndResult(ConnectionToHostResult::INTERNAL_ERROR); } TEST_F(HostConnectionMetricsLoggerTest, @@ -220,9 +232,9 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_INVALID_WIFI_AP_CONFIG, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + test_devices_[0].GetDeviceId(), + ConnectionToHostInternalError::INVALID_WIFI_AP_CONFIG); VerifyFailure( HostConnectionMetricsLogger::ConnectionToHostResult_FailureEventType:: @@ -232,6 +244,7 @@ VerifyProvisioningFailure( HostConnectionMetricsLogger:: ConnectionToHostResult_ProvisioningFailureEventType::OTHER); + VerifyEndResult(ConnectionToHostResult::INTERNAL_ERROR); } TEST_F(HostConnectionMetricsLoggerTest, @@ -239,9 +252,9 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_INVALID_ACTIVE_EXISTING_SOFT_AP_CONFIG, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + test_devices_[0].GetDeviceId(), + ConnectionToHostInternalError::INVALID_ACTIVE_EXISTING_SOFT_AP_CONFIG); VerifyFailure( HostConnectionMetricsLogger::ConnectionToHostResult_FailureEventType:: @@ -251,6 +264,7 @@ VerifyProvisioningFailure( HostConnectionMetricsLogger:: ConnectionToHostResult_ProvisioningFailureEventType::OTHER); + VerifyEndResult(ConnectionToHostResult::INTERNAL_ERROR); } TEST_F(HostConnectionMetricsLoggerTest, @@ -258,9 +272,9 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_INVALID_NEW_SOFT_AP_CONFIG, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + test_devices_[0].GetDeviceId(), + ConnectionToHostInternalError::INVALID_NEW_SOFT_AP_CONFIG); VerifyFailure( HostConnectionMetricsLogger::ConnectionToHostResult_FailureEventType:: @@ -270,6 +284,7 @@ VerifyProvisioningFailure( HostConnectionMetricsLogger:: ConnectionToHostResult_ProvisioningFailureEventType::OTHER); + VerifyEndResult(ConnectionToHostResult::INTERNAL_ERROR); } TEST_F(HostConnectionMetricsLoggerTest, @@ -277,22 +292,15 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_CANCELED_BY_USER, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::USER_CANCELLATION, + test_devices_[0].GetDeviceId(), absl::nullopt); - VerifyFailure_ClientConnection( - HostConnectionMetricsLogger:: - ConnectionToHostResult_FailureClientConnectionEventType:: - CANCELED_BY_USER); - VerifyFailure( - HostConnectionMetricsLogger::ConnectionToHostResult_FailureEventType:: - CLIENT_CONNECTION_ERROR); VerifySuccess(HostConnectionMetricsLogger:: ConnectionToHostResult_SuccessEventType::FAILURE); VerifyProvisioningFailure( HostConnectionMetricsLogger:: ConnectionToHostResult_ProvisioningFailureEventType::OTHER); + VerifyEndResult(ConnectionToHostResult::USER_CANCELLATION); } TEST_F(HostConnectionMetricsLoggerTest, @@ -300,9 +308,9 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_INTERNAL_ERROR, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + test_devices_[0].GetDeviceId(), + ConnectionToHostInternalError::CLIENT_CONNECTION_INTERNAL_ERROR); VerifyFailure_ClientConnection( HostConnectionMetricsLogger:: @@ -316,6 +324,7 @@ VerifyProvisioningFailure( HostConnectionMetricsLogger:: ConnectionToHostResult_ProvisioningFailureEventType::OTHER); + VerifyEndResult(ConnectionToHostResult::INTERNAL_ERROR); } TEST_F(HostConnectionMetricsLoggerTest, @@ -323,9 +332,10 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_TETHERING_TIMED_OUT_FIRST_TIME_SETUP_WAS_REQUIRED, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + test_devices_[0].GetDeviceId(), + ConnectionToHostInternalError:: + TETHERING_TIMED_OUT_FIRST_TIME_SETUP_REQUIRED); VerifyFailure_TetheringTimeout( HostConnectionMetricsLogger:: @@ -339,6 +349,7 @@ VerifyProvisioningFailure( HostConnectionMetricsLogger:: ConnectionToHostResult_ProvisioningFailureEventType::OTHER); + VerifyEndResult(ConnectionToHostResult::INTERNAL_ERROR); } TEST_F(HostConnectionMetricsLoggerTest, @@ -346,9 +357,10 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_TETHERING_TIMED_OUT_FIRST_TIME_SETUP_WAS_NOT_REQUIRED, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + test_devices_[0].GetDeviceId(), + ConnectionToHostInternalError:: + TETHERING_TIMED_OUT_FIRST_TIME_SETUP_NOT_REQUIRED); VerifyFailure_TetheringTimeout( HostConnectionMetricsLogger:: @@ -362,6 +374,7 @@ VerifyProvisioningFailure( HostConnectionMetricsLogger:: ConnectionToHostResult_ProvisioningFailureEventType::OTHER); + VerifyEndResult(ConnectionToHostResult::INTERNAL_ERROR); } TEST_F(HostConnectionMetricsLoggerTest, @@ -370,14 +383,12 @@ metrics_logger_->RecordConnectionToHostResult( HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_TETHERING_UNSUPPORTED, - test_devices_[0].GetDeviceId()); + TETHERING_UNSUPPORTED, + test_devices_[0].GetDeviceId(), absl::nullopt); - VerifyFailure( - HostConnectionMetricsLogger::ConnectionToHostResult_FailureEventType:: - TETHERING_UNSUPPORTED); VerifySuccess(HostConnectionMetricsLogger:: ConnectionToHostResult_SuccessEventType::FAILURE); + VerifyEndResult(ConnectionToHostResult::TETHERING_UNSUPPORTED); } TEST_F(HostConnectionMetricsLoggerTest, @@ -385,14 +396,12 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_NO_CELL_DATA, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::NO_CELLULAR_DATA, + test_devices_[0].GetDeviceId(), absl::nullopt); - VerifyFailure(HostConnectionMetricsLogger:: - ConnectionToHostResult_FailureEventType::NO_CELL_DATA); VerifySuccess(HostConnectionMetricsLogger:: ConnectionToHostResult_SuccessEventType::FAILURE); + VerifyEndResult(ConnectionToHostResult::NO_CELLULAR_DATA); } TEST_F(HostConnectionMetricsLoggerTest, @@ -400,15 +409,16 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_FAILED, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + test_devices_[0].GetDeviceId(), + ConnectionToHostInternalError::ENABLING_HOTSPOT_FAILED); VerifyFailure( HostConnectionMetricsLogger::ConnectionToHostResult_FailureEventType:: ENABLING_HOTSPOT_FAILED); VerifySuccess(HostConnectionMetricsLogger:: ConnectionToHostResult_SuccessEventType::FAILURE); + VerifyEndResult(ConnectionToHostResult::INTERNAL_ERROR); } TEST_F(HostConnectionMetricsLoggerTest, @@ -416,15 +426,16 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_TIMEOUT, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + test_devices_[0].GetDeviceId(), + ConnectionToHostInternalError::ENABLING_HOTSPOT_TIMEOUT); VerifyFailure( HostConnectionMetricsLogger::ConnectionToHostResult_FailureEventType:: ENABLING_HOTSPOT_TIMEOUT); VerifySuccess(HostConnectionMetricsLogger:: ConnectionToHostResult_SuccessEventType::FAILURE); + VerifyEndResult(ConnectionToHostResult::INTERNAL_ERROR); } TEST_F(HostConnectionMetricsLoggerTest, RecordConnectToHostDuration) { @@ -436,14 +447,15 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_NO_RESPONSE, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + test_devices_[0].GetDeviceId(), + ConnectionToHostInternalError::NO_RESPONSE); VerifyFailure(HostConnectionMetricsLogger:: ConnectionToHostResult_FailureEventType::NO_RESPONSE); VerifySuccess(HostConnectionMetricsLogger:: ConnectionToHostResult_SuccessEventType::FAILURE); + VerifyEndResult(ConnectionToHostResult::INTERNAL_ERROR); } TEST_F(HostConnectionMetricsLoggerTest, @@ -451,15 +463,16 @@ SetActiveHostToConnecting(test_devices_[0].GetDeviceId()); metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_INVALID_HOTSPOT_CREDENTIALS, - test_devices_[0].GetDeviceId()); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + test_devices_[0].GetDeviceId(), + ConnectionToHostInternalError::INVALID_HOTSPOT_CREDENTIALS); VerifyFailure( HostConnectionMetricsLogger::ConnectionToHostResult_FailureEventType:: INVALID_HOTSPOT_CREDENTIALS); VerifySuccess(HostConnectionMetricsLogger:: ConnectionToHostResult_SuccessEventType::FAILURE); + VerifyEndResult(ConnectionToHostResult::INTERNAL_ERROR); } } // namespace tether
diff --git a/chromeos/ash/components/tether/mock_host_connection_metrics_logger.h b/chromeos/ash/components/tether/mock_host_connection_metrics_logger.h index 552281bd..e009e01 100644 --- a/chromeos/ash/components/tether/mock_host_connection_metrics_logger.h +++ b/chromeos/ash/components/tether/mock_host_connection_metrics_logger.h
@@ -27,9 +27,12 @@ ~MockHostConnectionMetricsLogger() override; - MOCK_METHOD2(RecordConnectionToHostResult, - void(HostConnectionMetricsLogger::ConnectionToHostResult, - const std::string&)); + MOCK_METHOD3( + RecordConnectionToHostResult, + void(HostConnectionMetricsLogger::ConnectionToHostResult, + const std::string&, + absl::optional< + HostConnectionMetricsLogger::ConnectionToHostInternalError>)); }; } // namespace tether
diff --git a/chromeos/ash/components/tether/tether_connector_impl.cc b/chromeos/ash/components/tether/tether_connector_impl.cc index 970e9ba..c07956a 100644 --- a/chromeos/ash/components/tether/tether_connector_impl.cc +++ b/chromeos/ash/components/tether/tether_connector_impl.cc
@@ -6,7 +6,6 @@ #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" -#include "base/metrics/histogram_macros.h" #include "chromeos/ash/components/multidevice/logging/logging.h" #include "chromeos/ash/components/network/network_handler.h" #include "chromeos/ash/components/network/network_state.h" @@ -27,6 +26,11 @@ namespace tether { +using ConnectionToHostResult = + HostConnectionMetricsLogger::ConnectionToHostResult; +using ConnectionToHostInternalError = + HostConnectionMetricsLogger::ConnectionToHostInternalError; + namespace { void OnDisconnectFromWifiFailure(const std::string& device_id, @@ -144,10 +148,11 @@ disconnect_tethering_request_sender_->SendDisconnectRequestToDevice( device_id); - SetConnectionFailed( - NetworkConnectionHandler::kErrorConnectCanceled, - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_CANCELED_BY_USER); + host_connection_metrics_logger_->RecordConnectionToHostResult( + ConnectionToHostResult::USER_CANCELLATION, device_id_pending_connection_, + absl::nullopt); + + SetConnectionFailed(NetworkConnectionHandler::kErrorConnectCanceled); return true; } @@ -229,9 +234,9 @@ connect_tethering_operation_->RemoveObserver(this); connect_tethering_operation_.reset(); - SetConnectionFailed( - NetworkConnectionHandler::kErrorConnectFailed, - GetConnectionToHostResultFromErrorCode(device_id_copy, error_code)); + RecordConnectTetheringOperationResult(device_id_pending_connection_, + error_code); + SetConnectionFailed(NetworkConnectionHandler::kErrorConnectFailed); } void TetherConnectorImpl::OnTetherHostToConnectFetched( @@ -250,10 +255,10 @@ << multidevice::RemoteDeviceRef::TruncateDeviceIdForLogs( device_id) << ". Cannot connect."; - SetConnectionFailed( - NetworkConnectionHandler::kErrorConnectFailed, - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_INTERNAL_ERROR); + host_connection_metrics_logger_->RecordConnectionToHostResult( + ConnectionToHostResult::INTERNAL_ERROR, device_id_pending_connection_, + ConnectionToHostInternalError::CLIENT_CONNECTION_INTERNAL_ERROR); + SetConnectionFailed(NetworkConnectionHandler::kErrorConnectFailed); return; } @@ -270,10 +275,7 @@ connect_tethering_operation_->Initialize(); } -void TetherConnectorImpl::SetConnectionFailed( - const std::string& error_name, - HostConnectionMetricsLogger::ConnectionToHostResult - connection_to_host_result) { +void TetherConnectorImpl::SetConnectionFailed(const std::string& error_name) { DCHECK(!device_id_pending_connection_.empty()); DCHECK(!error_callback_.is_null()); @@ -291,9 +293,6 @@ std::move(error_callback).Run(error_name); active_host_->SetActiveHostDisconnected(); - host_connection_metrics_logger_->RecordConnectionToHostResult( - connection_to_host_result, failed_connection_device_id); - if (error_name == NetworkConnectionHandler::kErrorConnectFailed) { // Only show notification if the error is kErrorConnectFailed. Other error // names (e.g., kErrorConnectCanceled) are a result of user interaction and @@ -310,9 +309,8 @@ DCHECK(!success_callback_.is_null()); host_connection_metrics_logger_->RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_SUCCESS, - device_id); + HostConnectionMetricsLogger::ConnectionToHostResult::SUCCESS, device_id, + absl::nullopt); notification_presenter_->RemoveSetupRequiredNotification(); @@ -367,79 +365,92 @@ device_id) << "."; - SetConnectionFailed( - NetworkConnectionHandler::kErrorConnectFailed, - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_TIMEOUT); + host_connection_metrics_logger_->RecordConnectionToHostResult( + ConnectionToHostResult::INTERNAL_ERROR, device_id, + ConnectionToHostInternalError::CLIENT_CONNECTION_TIMEOUT); + SetConnectionFailed(NetworkConnectionHandler::kErrorConnectFailed); return; } SetConnectionSucceeded(device_id, wifi_network_guid); } -HostConnectionMetricsLogger::ConnectionToHostResult -TetherConnectorImpl::GetConnectionToHostResultFromErrorCode( +void TetherConnectorImpl::RecordConnectTetheringOperationResult( const std::string& device_id, ConnectTetheringOperation::HostResponseErrorCode error_code) { + absl::optional<ConnectionToHostResult> result = + ConnectionToHostResult::INTERNAL_ERROR; + absl::optional<ConnectionToHostInternalError> internal_error = absl::nullopt; + switch (error_code) { case ConnectTetheringOperation::HostResponseErrorCode::PROVISIONING_FAILED: - return HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_PROVISIONING_FAILED; + result = ConnectionToHostResult::PROVISIONING_FAILURE; + break; case ConnectTetheringOperation::HostResponseErrorCode::TETHERING_TIMEOUT: if (host_scan_cache_->DoesHostRequireSetup( device_id_tether_network_guid_map_ ->GetTetherNetworkGuidForDeviceId(device_id))) { - return HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_TETHERING_TIMED_OUT_FIRST_TIME_SETUP_WAS_REQUIRED; + internal_error = ConnectionToHostInternalError:: + TETHERING_TIMED_OUT_FIRST_TIME_SETUP_REQUIRED; } else { - return HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_TETHERING_TIMED_OUT_FIRST_TIME_SETUP_WAS_NOT_REQUIRED; + internal_error = ConnectionToHostInternalError:: + TETHERING_TIMED_OUT_FIRST_TIME_SETUP_NOT_REQUIRED; } + break; case ConnectTetheringOperation::HostResponseErrorCode:: TETHERING_UNSUPPORTED: - return HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_TETHERING_UNSUPPORTED; + result = ConnectionToHostResult::TETHERING_UNSUPPORTED; + break; case ConnectTetheringOperation::HostResponseErrorCode::NO_CELL_DATA: - return HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_NO_CELL_DATA; + result = ConnectionToHostResult::NO_CELLULAR_DATA; + break; case ConnectTetheringOperation::HostResponseErrorCode:: ENABLING_HOTSPOT_FAILED: - return HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_FAILED; + internal_error = ConnectionToHostInternalError::ENABLING_HOTSPOT_FAILED; + break; case ConnectTetheringOperation::HostResponseErrorCode:: ENABLING_HOTSPOT_TIMEOUT: - return HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_TIMEOUT; + internal_error = ConnectionToHostInternalError::ENABLING_HOTSPOT_TIMEOUT; + break; case ConnectTetheringOperation::HostResponseErrorCode::UNKNOWN_ERROR: - return HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_UNKNOWN_ERROR; + internal_error = ConnectionToHostInternalError::UNKNOWN_ERROR; + break; case ConnectTetheringOperation::HostResponseErrorCode:: INVALID_HOTSPOT_CREDENTIALS: - return HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_INVALID_HOTSPOT_CREDENTIALS; + internal_error = + ConnectionToHostInternalError::INVALID_HOTSPOT_CREDENTIALS; + break; case ConnectTetheringOperation::HostResponseErrorCode::NO_RESPONSE: if (did_send_successful_request_) { - return HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_SUCCESSFUL_REQUEST_BUT_NO_RESPONSE; + internal_error = + ConnectionToHostInternalError::SUCCESSFUL_REQUEST_BUT_NO_RESPONSE; } else { - return HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_NO_RESPONSE; + internal_error = ConnectionToHostInternalError::NO_RESPONSE; } + break; case ConnectTetheringOperation::HostResponseErrorCode:: INVALID_ACTIVE_EXISTING_SOFT_AP_CONFIG: - return HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_INVALID_ACTIVE_EXISTING_SOFT_AP_CONFIG; + internal_error = + ConnectionToHostInternalError::INVALID_ACTIVE_EXISTING_SOFT_AP_CONFIG; + break; case ConnectTetheringOperation::HostResponseErrorCode:: INVALID_NEW_SOFT_AP_CONFIG: - return HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_INVALID_NEW_SOFT_AP_CONFIG; + internal_error = + ConnectionToHostInternalError::INVALID_NEW_SOFT_AP_CONFIG; + break; case ConnectTetheringOperation::HostResponseErrorCode:: INVALID_WIFI_AP_CONFIG: - return HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_INVALID_WIFI_AP_CONFIG; + internal_error = ConnectionToHostInternalError::INVALID_WIFI_AP_CONFIG; + break; default: - return HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_UNRECOGNIZED_RESPONSE_ERROR; + internal_error = + ConnectionToHostInternalError::UNRECOGNIZED_RESPONSE_ERROR; + break; + } + + if (result.has_value()) { + host_connection_metrics_logger_->RecordConnectionToHostResult( + result.value(), device_id, internal_error); } }
diff --git a/chromeos/ash/components/tether/tether_connector_impl.h b/chromeos/ash/components/tether/tether_connector_impl.h index 47d0c65..2dd536ba 100644 --- a/chromeos/ash/components/tether/tether_connector_impl.h +++ b/chromeos/ash/components/tether/tether_connector_impl.h
@@ -87,9 +87,7 @@ private: friend class TetherConnectorImplTest; - void SetConnectionFailed(const std::string& error_name, - HostConnectionMetricsLogger::ConnectionToHostResult - connection_to_host_result); + void SetConnectionFailed(const std::string& error_name); void SetConnectionSucceeded(const std::string& device_id, const std::string& wifi_network_guid); @@ -98,8 +96,7 @@ absl::optional<multidevice::RemoteDeviceRef> tether_host_to_connect); void OnWifiConnection(const std::string& device_id, const std::string& wifi_network_guid); - HostConnectionMetricsLogger::ConnectionToHostResult - GetConnectionToHostResultFromErrorCode( + void RecordConnectTetheringOperationResult( const std::string& device_id, ConnectTetheringOperation::HostResponseErrorCode error_code);
diff --git a/chromeos/ash/components/tether/tether_connector_impl_unittest.cc b/chromeos/ash/components/tether/tether_connector_impl_unittest.cc index c233b10b..e55a4aaf 100644 --- a/chromeos/ash/components/tether/tether_connector_impl_unittest.cc +++ b/chromeos/ash/components/tether/tether_connector_impl_unittest.cc
@@ -26,6 +26,7 @@ #include "chromeos/ash/components/tether/fake_tether_host_fetcher.h" #include "chromeos/ash/components/tether/fake_wifi_hotspot_connector.h" #include "chromeos/ash/components/tether/fake_wifi_hotspot_disconnector.h" +#include "chromeos/ash/components/tether/host_connection_metrics_logger.h" #include "chromeos/ash/components/tether/mock_host_connection_metrics_logger.h" #include "chromeos/ash/components/tether/mock_tether_host_response_recorder.h" #include "chromeos/ash/services/device_sync/public/cpp/fake_device_sync_client.h" @@ -35,6 +36,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/cros_system_api/dbus/shill/dbus-constants.h" +using testing::Eq; +using testing::Optional; using testing::StrictMock; namespace ash { @@ -58,6 +61,8 @@ return ss.str(); } +using ::testing::Optional; + class FakeConnectTetheringOperation : public ConnectTetheringOperation { public: FakeConnectTetheringOperation( @@ -262,11 +267,14 @@ void VerifyConnectTetheringOperationFails( ConnectTetheringOperation::HostResponseErrorCode response_code, bool setup_required, - HostConnectionMetricsLogger::ConnectionToHostResult expected_event_type) { + HostConnectionMetricsLogger::ConnectionToHostResult expected_event_type, + absl::optional<HostConnectionMetricsLogger::ConnectionToHostInternalError> + expected_internal_error) { EXPECT_CALL(*mock_host_connection_metrics_logger_, RecordConnectionToHostResult( expected_event_type, - test_devices_[setup_required ? 1 : 0].GetDeviceId())); + test_devices_[setup_required ? 1 : 0].GetDeviceId(), + expected_internal_error)); EXPECT_FALSE( fake_notification_presenter_->is_setup_required_notification_shown()); @@ -353,9 +361,11 @@ EXPECT_CALL( *mock_host_connection_metrics_logger_, RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_INTERNAL_ERROR, - kNonexistentDeviceId)); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + kNonexistentDeviceId, + absl::optional( + HostConnectionMetricsLogger::ConnectionToHostInternalError:: + CLIENT_CONNECTION_INTERNAL_ERROR))); CallConnect(GetTetherNetworkGuid(kNonexistentDeviceId)); @@ -369,12 +379,11 @@ } TEST_F(TetherConnectorImplTest, DISABLED_TestCancelWhileOperationActive) { - EXPECT_CALL( - *mock_host_connection_metrics_logger_, - RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_CANCELED_BY_USER, - test_devices_[0].GetDeviceId())); + EXPECT_CALL(*mock_host_connection_metrics_logger_, + RecordConnectionToHostResult( + HostConnectionMetricsLogger::ConnectionToHostResult:: + USER_CANCELLATION, + test_devices_[0].GetDeviceId(), Eq(absl::nullopt))); CallConnect(GetTetherNetworkGuid(test_devices_[0].GetDeviceId())); EXPECT_EQ(ActiveHost::ActiveHostStatus::CONNECTING, @@ -409,8 +418,9 @@ VerifyConnectTetheringOperationFails( ConnectTetheringOperation::HostResponseErrorCode::UNKNOWN_ERROR, false /* setup_required */, - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_UNKNOWN_ERROR); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + absl::optional(HostConnectionMetricsLogger:: + ConnectionToHostInternalError::UNKNOWN_ERROR)); } TEST_F(TetherConnectorImplTest, @@ -418,8 +428,9 @@ VerifyConnectTetheringOperationFails( ConnectTetheringOperation::HostResponseErrorCode::UNKNOWN_ERROR, true /* setup_required */, - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_UNKNOWN_ERROR); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + absl::optional(HostConnectionMetricsLogger:: + ConnectionToHostInternalError::UNKNOWN_ERROR)); } TEST_F(TetherConnectorImplTest, @@ -427,8 +438,8 @@ VerifyConnectTetheringOperationFails( ConnectTetheringOperation::HostResponseErrorCode::PROVISIONING_FAILED, false /* setup_required */, - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_PROVISIONING_FAILED); + HostConnectionMetricsLogger::ConnectionToHostResult::PROVISIONING_FAILURE, + absl::nullopt); } TEST_F( @@ -437,8 +448,10 @@ VerifyConnectTetheringOperationFails( ConnectTetheringOperation::HostResponseErrorCode::TETHERING_TIMEOUT, false /* setup_required */, - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_TETHERING_TIMED_OUT_FIRST_TIME_SETUP_WAS_NOT_REQUIRED); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + absl::optional( + HostConnectionMetricsLogger::ConnectionToHostInternalError:: + TETHERING_TIMED_OUT_FIRST_TIME_SETUP_NOT_REQUIRED)); } TEST_F( @@ -447,8 +460,10 @@ VerifyConnectTetheringOperationFails( ConnectTetheringOperation::HostResponseErrorCode::TETHERING_TIMEOUT, true /* setup_required */, - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_TETHERING_TIMED_OUT_FIRST_TIME_SETUP_WAS_REQUIRED); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + absl::optional( + HostConnectionMetricsLogger::ConnectionToHostInternalError:: + TETHERING_TIMED_OUT_FIRST_TIME_SETUP_REQUIRED)); } TEST_F(TetherConnectorImplTest, @@ -457,7 +472,8 @@ ConnectTetheringOperation::HostResponseErrorCode::TETHERING_UNSUPPORTED, false /* setup_required */, HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_TETHERING_UNSUPPORTED); + TETHERING_UNSUPPORTED, + absl::nullopt); } TEST_F(TetherConnectorImplTest, @@ -465,8 +481,8 @@ VerifyConnectTetheringOperationFails( ConnectTetheringOperation::HostResponseErrorCode::NO_CELL_DATA, false /* setup_required */, - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_NO_CELL_DATA); + HostConnectionMetricsLogger::ConnectionToHostResult::NO_CELLULAR_DATA, + absl::nullopt); } TEST_F(TetherConnectorImplTest, @@ -474,8 +490,10 @@ VerifyConnectTetheringOperationFails( ConnectTetheringOperation::HostResponseErrorCode::ENABLING_HOTSPOT_FAILED, false /* setup_required */, - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_FAILED); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + absl::optional( + HostConnectionMetricsLogger::ConnectionToHostInternalError:: + ENABLING_HOTSPOT_FAILED)); } TEST_F(TetherConnectorImplTest, @@ -484,8 +502,10 @@ ConnectTetheringOperation::HostResponseErrorCode:: ENABLING_HOTSPOT_TIMEOUT, false /* setup_required */, - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_TIMEOUT); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + absl::optional( + HostConnectionMetricsLogger::ConnectionToHostInternalError:: + ENABLING_HOTSPOT_TIMEOUT)); } TEST_F(TetherConnectorImplTest, @@ -493,8 +513,8 @@ VerifyConnectTetheringOperationFails( ConnectTetheringOperation::HostResponseErrorCode::NO_RESPONSE, false /* setup_required */, - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_NO_RESPONSE); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + HostConnectionMetricsLogger::ConnectionToHostInternalError::NO_RESPONSE); } TEST_F(TetherConnectorImplTest, @@ -503,8 +523,9 @@ ConnectTetheringOperation::HostResponseErrorCode:: INVALID_HOTSPOT_CREDENTIALS, false /* setup_required */, - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_INVALID_HOTSPOT_CREDENTIALS); + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + HostConnectionMetricsLogger::ConnectionToHostInternalError:: + INVALID_HOTSPOT_CREDENTIALS); } TEST_F(TetherConnectorImplTest, @@ -519,11 +540,13 @@ } TEST_F(TetherConnectorImplTest, DISABLED_TestConnectingToWifiFails) { - EXPECT_CALL(*mock_host_connection_metrics_logger_, - RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_TIMEOUT, - test_devices_[0].GetDeviceId())); + EXPECT_CALL( + *mock_host_connection_metrics_logger_, + RecordConnectionToHostResult( + HostConnectionMetricsLogger::ConnectionToHostResult::INTERNAL_ERROR, + test_devices_[0].GetDeviceId(), + Optional(HostConnectionMetricsLogger::ConnectionToHostInternalError:: + CLIENT_CONNECTION_TIMEOUT))); CallConnect(GetTetherNetworkGuid(test_devices_[0].GetDeviceId())); EXPECT_EQ(ActiveHost::ActiveHostStatus::CONNECTING, @@ -563,12 +586,11 @@ } TEST_F(TetherConnectorImplTest, DISABLED_TestCancelWhileConnectingToWifi) { - EXPECT_CALL( - *mock_host_connection_metrics_logger_, - RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_CANCELED_BY_USER, - test_devices_[0].GetDeviceId())); + EXPECT_CALL(*mock_host_connection_metrics_logger_, + RecordConnectionToHostResult( + HostConnectionMetricsLogger::ConnectionToHostResult:: + USER_CANCELLATION, + test_devices_[0].GetDeviceId(), Eq(absl::nullopt))); CallConnect(GetTetherNetworkGuid(test_devices_[0].GetDeviceId())); EXPECT_EQ(ActiveHost::ActiveHostStatus::CONNECTING, @@ -614,9 +636,8 @@ TEST_F(TetherConnectorImplTest, DISABLED_TestSuccessfulConnection) { EXPECT_CALL(*mock_host_connection_metrics_logger_, RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_SUCCESS, - test_devices_[0].GetDeviceId())); + HostConnectionMetricsLogger::ConnectionToHostResult::SUCCESS, + test_devices_[0].GetDeviceId(), Eq(absl::nullopt))); CallConnect(GetTetherNetworkGuid(test_devices_[0].GetDeviceId())); EXPECT_EQ(ActiveHost::ActiveHostStatus::CONNECTING, @@ -668,9 +689,8 @@ DISABLED_TestSuccessfulConnection_SetupRequired) { EXPECT_CALL(*mock_host_connection_metrics_logger_, RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_SUCCESS, - test_devices_[1].GetDeviceId())); + HostConnectionMetricsLogger::ConnectionToHostResult::SUCCESS, + test_devices_[1].GetDeviceId(), Eq(absl::nullopt))); EXPECT_FALSE( fake_notification_presenter_->is_setup_required_notification_shown()); @@ -702,17 +722,15 @@ TEST_F(TetherConnectorImplTest, DISABLED_TestNewConnectionAttemptDuringOperation_DifferentDevice) { - EXPECT_CALL( - *mock_host_connection_metrics_logger_, - RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_CANCELED_BY_USER, - test_devices_[0].GetDeviceId())); EXPECT_CALL(*mock_host_connection_metrics_logger_, RecordConnectionToHostResult( HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_SUCCESS, - test_devices_[1].GetDeviceId())); + USER_CANCELLATION, + test_devices_[0].GetDeviceId(), Eq(absl::nullopt))); + EXPECT_CALL(*mock_host_connection_metrics_logger_, + RecordConnectionToHostResult( + HostConnectionMetricsLogger::ConnectionToHostResult::SUCCESS, + test_devices_[1].GetDeviceId(), Eq(absl::nullopt))); CallConnect(GetTetherNetworkGuid(test_devices_[0].GetDeviceId())); EXPECT_EQ(ActiveHost::ActiveHostStatus::CONNECTING, @@ -769,17 +787,15 @@ TEST_F(TetherConnectorImplTest, DISABLED_TestNewConnectionAttemptDuringWifiConnection_DifferentDevice) { - EXPECT_CALL( - *mock_host_connection_metrics_logger_, - RecordConnectionToHostResult( - HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_FAILURE_CLIENT_CONNECTION_CANCELED_BY_USER, - test_devices_[0].GetDeviceId())); EXPECT_CALL(*mock_host_connection_metrics_logger_, RecordConnectionToHostResult( HostConnectionMetricsLogger::ConnectionToHostResult:: - CONNECTION_RESULT_SUCCESS, - test_devices_[1].GetDeviceId())); + USER_CANCELLATION, + test_devices_[0].GetDeviceId(), Eq(absl::nullopt))); + EXPECT_CALL(*mock_host_connection_metrics_logger_, + RecordConnectionToHostResult( + HostConnectionMetricsLogger::ConnectionToHostResult::SUCCESS, + test_devices_[1].GetDeviceId(), Eq(absl::nullopt))); CallConnect(GetTetherNetworkGuid(test_devices_[0].GetDeviceId())); EXPECT_EQ(ActiveHost::ActiveHostStatus::CONNECTING,
diff --git a/chromeos/chromeos_strings.grd b/chromeos/chromeos_strings.grd index 07ed533..26fa910 100644 --- a/chromeos/chromeos_strings.grd +++ b/chromeos/chromeos_strings.grd
@@ -4694,6 +4694,12 @@ Your administrator doesn't allow closing this app </message> <!-- End of Strings for WebAppSettings --> + <message name="IDS_WEB_APP_RELAUNCH_NOTIFICATION_TITLE" desc="Title of the app relaunch notification."> + Restarting and updating <ph name="APP_NAME">$1</ph> + </message> + <message name="IDS_WEB_APP_RELAUNCH_NOTIFICATION_MESSAGE" desc="Message of the app relaunch notification."> + Please wait while this application is being updated + </message> </messages> </release>
diff --git a/chromeos/chromeos_strings_grd/IDS_WEB_APP_RELAUNCH_NOTIFICATION_MESSAGE.png.sha1 b/chromeos/chromeos_strings_grd/IDS_WEB_APP_RELAUNCH_NOTIFICATION_MESSAGE.png.sha1 new file mode 100644 index 0000000..ca43ad21 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_WEB_APP_RELAUNCH_NOTIFICATION_MESSAGE.png.sha1
@@ -0,0 +1 @@ +3392aa598b42da27dfa504911c5d0ded528dc89a \ No newline at end of file
diff --git a/chromeos/chromeos_strings_grd/IDS_WEB_APP_RELAUNCH_NOTIFICATION_TITLE.png.sha1 b/chromeos/chromeos_strings_grd/IDS_WEB_APP_RELAUNCH_NOTIFICATION_TITLE.png.sha1 new file mode 100644 index 0000000..ca43ad21 --- /dev/null +++ b/chromeos/chromeos_strings_grd/IDS_WEB_APP_RELAUNCH_NOTIFICATION_TITLE.png.sha1
@@ -0,0 +1 @@ +3392aa598b42da27dfa504911c5d0ded528dc89a \ No newline at end of file
diff --git a/chromeos/components/in_session_auth/BUILD.gn b/chromeos/components/in_session_auth/BUILD.gn new file mode 100644 index 0000000..bf09f86 --- /dev/null +++ b/chromeos/components/in_session_auth/BUILD.gn
@@ -0,0 +1,26 @@ +# Copyright 2023 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chromeos/ui_mode.gni") + +assert(is_chromeos_ash) + +static_library("in_session_auth") { + sources = [ + "in_process_instances.cc", + "in_process_instances.h", + "in_session_auth.cc", + "in_session_auth.h", + ] + + deps = [ + "//ash/public/cpp", + "//chromeos/ash/components/osauth/public", + ] + + public_deps = [ + "//chromeos/components/in_session_auth/mojom", + "//mojo/public/cpp/bindings", + ] +}
diff --git a/chromeos/components/in_session_auth/DEPS b/chromeos/components/in_session_auth/DEPS new file mode 100644 index 0000000..1cfbb777 --- /dev/null +++ b/chromeos/components/in_session_auth/DEPS
@@ -0,0 +1,4 @@ +include_rules = [ + "+ash/public/cpp", + "+chrome/browser/ash/login/quick_unlock", +]
diff --git a/chromeos/components/in_session_auth/DIR_METADATA b/chromeos/components/in_session_auth/DIR_METADATA new file mode 100644 index 0000000..88df346 --- /dev/null +++ b/chromeos/components/in_session_auth/DIR_METADATA
@@ -0,0 +1 @@ +mixins: "//ash/login/LOGIN_LOCK_METADATA"
diff --git a/chromeos/components/in_session_auth/OWNERS b/chromeos/components/in_session_auth/OWNERS new file mode 100644 index 0000000..3c1719b --- /dev/null +++ b/chromeos/components/in_session_auth/OWNERS
@@ -0,0 +1,4 @@ +emaamari@google.com +antrim@chromium.org + +file://ash/login/LOGIN_LOCK_OWNERS
diff --git a/chromeos/components/in_session_auth/in_process_instances.cc b/chromeos/components/in_session_auth/in_process_instances.cc new file mode 100644 index 0000000..d143360 --- /dev/null +++ b/chromeos/components/in_session_auth/in_process_instances.cc
@@ -0,0 +1,30 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chromeos/components/in_session_auth/in_process_instances.h" +#include "chromeos/components/in_session_auth/in_session_auth.h" + +namespace chromeos::auth { + +namespace { + +InSessionAuth* GetInSessionAuthService() { + // The global singleton. + static raw_ptr<InSessionAuth> in_session_auth_service_; + + if (in_session_auth_service_ == nullptr) { + in_session_auth_service_ = new InSessionAuth(); + } + + return in_session_auth_service_; +} + +} // namespace + +void BindToInSessionAuthService( + mojo::PendingReceiver<mojom::InSessionAuth> receiver) { + GetInSessionAuthService()->BindReceiver(std::move(receiver)); +} + +} // namespace chromeos::auth
diff --git a/chromeos/components/in_session_auth/in_process_instances.h b/chromeos/components/in_session_auth/in_process_instances.h new file mode 100644 index 0000000..d0ece38 --- /dev/null +++ b/chromeos/components/in_session_auth/in_process_instances.h
@@ -0,0 +1,21 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROMEOS_COMPONENTS_IN_SESSION_AUTH_IN_PROCESS_INSTANCES_H_ +#define CHROMEOS_COMPONENTS_IN_SESSION_AUTH_IN_PROCESS_INSTANCES_H_ + +#include "chromeos/components/in_session_auth/in_session_auth.h" +#include "chromeos/components/in_session_auth/mojom/in_session_auth.mojom.h" + +namespace chromeos::auth { + +// Binds the pending receiver to the implementation of the InSessionAuth +// service. The InSessionAuth service is a global singleton that persists +// in memory after being created. +void BindToInSessionAuthService( + mojo::PendingReceiver<mojom::InSessionAuth> receiver); + +} // namespace chromeos::auth + +#endif // CHROMEOS_COMPONENTS_IN_SESSION_AUTH_IN_PROCESS_INSTANCES_H_
diff --git a/chromeos/components/in_session_auth/in_session_auth.cc b/chromeos/components/in_session_auth/in_session_auth.cc new file mode 100644 index 0000000..7b948c4 --- /dev/null +++ b/chromeos/components/in_session_auth/in_session_auth.cc
@@ -0,0 +1,68 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chromeos/components/in_session_auth/in_session_auth.h" +#include "ash/constants/ash_features.h" +#include "ash/public/cpp/in_session_auth_dialog_controller.h" +#include "ash/public/cpp/session/session_controller.h" +#include "base/notreached.h" +#include "chromeos/ash/components/osauth/public/auth_session_storage.h" + +namespace chromeos::auth { + +ash::InSessionAuthDialogController::Reason ToAshReason( + chromeos::auth::mojom::Reason reason) { + switch (reason) { + case chromeos::auth::mojom::Reason::kAccessPasswordManager: + // In theory, execution shouldn't reach this case because this + // implementation of the `chromeos::auth::mojom::InSessionAuth` should + // only be reachable from ash. + return ash::InSessionAuthDialogController::kAccessPasswordManager; + case chromeos::auth::mojom::Reason::kAccessAuthenticationSettings: + return ash::InSessionAuthDialogController::kAccessAuthenticationSettings; + case chromeos::auth::mojom::Reason::kAccessMultideviceSettings: + return ash::InSessionAuthDialogController::kAccessMultideviceSettings; + } +} + +InSessionAuth::InSessionAuth() {} + +InSessionAuth::~InSessionAuth() = default; + +void InSessionAuth::BindReceiver( + mojo::PendingReceiver<chromeos::auth::mojom::InSessionAuth> receiver) { + receivers_.Add(this, std::move(receiver)); +} + +void InSessionAuth::RequestToken(chromeos::auth::mojom::Reason reason, + const absl::optional<std::string>& prompt, + RequestTokenCallback callback) { + ash::InSessionAuthDialogController::Get()->ShowAuthDialog( + ToAshReason(reason), + base::BindOnce(&InSessionAuth::OnAuthComplete, weak_factory_.GetWeakPtr(), + std::move(callback))); +} + +void InSessionAuth::CheckToken(chromeos::auth::mojom::Reason reason, + const std::string& token, + CheckTokenCallback callback) { + bool token_valid; + token_valid = ash::AuthSessionStorage::Get()->IsValid(token); + std::move(callback).Run(token_valid); +} + +void InSessionAuth::InvalidateToken(const std::string& token) { + ash::AuthSessionStorage::Get()->Invalidate(token, base::DoNothing()); +} + +void InSessionAuth::OnAuthComplete(RequestTokenCallback callback, + bool success, + const ash::AuthProofToken& token, + base::TimeDelta timeout) { + std::move(callback).Run( + success ? chromeos::auth::mojom::RequestTokenReply::New(token, timeout) + : nullptr); +} + +} // namespace chromeos::auth
diff --git a/chromeos/components/in_session_auth/in_session_auth.h b/chromeos/components/in_session_auth/in_session_auth.h new file mode 100644 index 0000000..4d6f6c5 --- /dev/null +++ b/chromeos/components/in_session_auth/in_session_auth.h
@@ -0,0 +1,55 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROMEOS_COMPONENTS_IN_SESSION_AUTH_IN_SESSION_AUTH_H_ +#define CHROMEOS_COMPONENTS_IN_SESSION_AUTH_IN_SESSION_AUTH_H_ + +#include "chromeos/ash/components/osauth/public/common_types.h" +#include "chromeos/components/in_session_auth/mojom/in_session_auth.mojom.h" +#include "mojo/public/cpp/bindings/receiver_set.h" + +namespace chromeos::auth { + +struct TokenChecker { + // Check, for user with `account_id`, if the given `token` is valid. + virtual bool IsTokenValid(const AccountId& account_id, + const std::string& token) = 0; +}; + +// The implementation of the InSessionAuth service. +class InSessionAuth : public chromeos::auth::mojom::InSessionAuth { + public: + explicit InSessionAuth(); + ~InSessionAuth() override; + InSessionAuth(const InSessionAuth&) = delete; + InSessionAuth& operator=(const InSessionAuth&) = delete; + + void BindReceiver( + mojo::PendingReceiver<chromeos::auth::mojom::InSessionAuth> receiver); + + // chromeos::auth::mojom::InSessionAuth: + void RequestToken(chromeos::auth::mojom::Reason reason, + const absl::optional<std::string>& prompt, + RequestTokenCallback callback) override; + void CheckToken(chromeos::auth::mojom::Reason reason, + const std::string& token, + CheckTokenCallback callback) override; + void InvalidateToken(const std::string& token) override; + + private: + // Continuation of InSessionAuth::RequestToken. Last 3 params match + // InSessionAuthDialogController::OnAuthComplete + void OnAuthComplete(RequestTokenCallback callback, + bool success, + const ash::AuthProofToken& token, + base::TimeDelta timeout); + + mojo::ReceiverSet<chromeos::auth::mojom::InSessionAuth> receivers_; + + base::WeakPtrFactory<InSessionAuth> weak_factory_{this}; +}; + +} // namespace chromeos::auth + +#endif // CHROMEOS_COMPONENTS_IN_SESSION_AUTH_IN_SESSION_AUTH_H_
diff --git a/chromeos/components/in_session_auth/mojom/in_session_auth.mojom b/chromeos/components/in_session_auth/mojom/in_session_auth.mojom index fa16e53..ad475dfd 100644 --- a/chromeos/components/in_session_auth/mojom/in_session_auth.mojom +++ b/chromeos/components/in_session_auth/mojom/in_session_auth.mojom
@@ -27,8 +27,8 @@ [Stable, Extensible, RenamedFrom="crosapi.mojom.Reason"] enum Reason { [Default] kAccessPasswordManager = 0, - kModifyAuthFactors, - kModifyAuthFactorsMultidevice, + kAccessAuthenticationSettings, + kAccessMultideviceSettings, }; // An interface implemented by Ash to expose Ash's authentication capabilities.
diff --git a/chromeos/components/onc/onc_utils.cc b/chromeos/components/onc/onc_utils.cc index 3d5541e..cc210ab 100644 --- a/chromeos/components/onc/onc_utils.cc +++ b/chromeos/components/onc/onc_utils.cc
@@ -10,7 +10,6 @@ #include "base/base64.h" #include "base/json/json_reader.h" #include "base/logging.h" -#include "base/metrics/histogram_macros.h" #include "base/notreached.h" #include "base/strings/string_number_conversions.h" #include "base/values.h" @@ -687,11 +686,6 @@ toplevel_onc.value(), &validation_result); - if (from_policy) { - UMA_HISTOGRAM_BOOLEAN("Enterprise.ONC.PolicyValidation", - validation_result == Validator::VALID); - } - bool success = true; if (validation_result == Validator::VALID_WITH_WARNINGS) { NET_LOG(DEBUG) << "ONC validation produced warnings: "
diff --git a/chromeos/crosapi/mojom/document_scan.mojom b/chromeos/crosapi/mojom/document_scan.mojom index 0191f58..e2ae64e4 100644 --- a/chromeos/crosapi/mojom/document_scan.mojom +++ b/chromeos/crosapi/mojom/document_scan.mojom
@@ -149,6 +149,176 @@ bool secure@1; }; +// The enum below is exactly the same as its counterpart in +// third_party/cros_system_api/dbus/lorgnette/lorgnette_service.proto +// +// The type of an option. This is the same set of types as SANE_Value_Type. +[Stable, Extensible] +enum OptionType { + [Default] kUnknown = 0, + kBool = 1, + kInt = 2, + kFixed = 3, + kString = 4, + kButton = 5, + kGroup = 6, +}; + +// The enum below is exactly the same as its counterpart in +// third_party/cros_system_api/dbus/lorgnette/lorgnette_service.proto +// +// The unit of measurement for an option. This is the same set of units as +// SANE_Unit. +[Stable, Extensible] +enum OptionUnit { + // Value is a unitless number, e.g., threshold. + [Default] kUnitless = 0, + + // Value is a number of pixels, e.g., scan dimensions. + kPixel = 1, + + // Value is the number of bits, e.g., color depth. + kBit = 2, + + // Value is in mm, e.g., scan dimensions. + kMm = 3, + + // Value is in dots per inch, e.g., resolution. + kDpi = 4, + + // Value is a percent, e.g., brightness. + kPercent = 5, + + // Value is in µs, e.g. exposure time. + kMicrosecond = 6, +}; + +// The value of a `ScannerOption`. The active field must match the +// `OptionType` of the option. +[Stable] +union OptionValue { + bool bool_value; + int32 int_value; + array<int32> int_list; + double fixed_value; + array<double> fixed_list; + string string_value; +}; + +// The enum below is exactly the same as its counterpart in +// third_party/cros_system_api/dbus/lorgnette/lorgnette_service.proto +// +// The type of a constraint. These correspond to SANE_Constraint_Type. +[Stable, Extensible] +enum OptionConstraintType { + [Default] kNone = 0, + kIntRange = 1, + kFixedRange = 2, + kIntList = 3, + kFixedList = 4, + kStringList = 5, +}; + +// A range of valid values for an option of type `OptionType.kInt`. +[Stable] +struct IntRange { + int32 min@0; + int32 max@1; + int32 quant@2; +}; + +// A range of valid values for an option of type `OptionType.kFixed`. +[Stable] +struct FixedRange { + double min@0; + double max@1; + double quant@2; +}; + +// The specific restriction imposed by an `OptionConstraint`. Each type of +// restriction corresponds to a value of `OptionConstraintType`. +[Stable] +union OptionConstraintRestriction { + IntRange int_range; + FixedRange fixed_range; + array<int32> valid_int; + array<double> valid_fixed; + array<string> valid_string; +}; + +// A constraint on the allowed values of a `ScannerOption`. The `type` field +// indicates which union member of `constraint` is expected to be set. +[Stable] +struct OptionConstraint { + OptionConstraintType type@0; + OptionConstraintRestriction restriction@1; +}; + +// How an option can be configured. An option can be configured through +// software, through hardware, or neither (read-only). The SANE model does not +// permit an option to be configured in both hardware and software. +[Stable, Extensible] +enum OptionConfigurability { + // Option is read-only and cannot be changed. + kNotConfigurable = 0, + + // Option can be set in software. + [Default] kSoftwareConfigurable = 1, + + // Option can be set by the user toggling/pushing a hardware button. + kHardwareConfigurable = 2, +}; + +// A self-describing scanner option, in the style of SANE_Option_Descriptor. A +// `ScannerOption` represents an individual option with display information, an +// optional current value, and an optional constraint on valid values. +[Stable] +struct ScannerOption { + // Option name using lowercase a-z, numbers, and dashes. + string name@0; + + // Printable one-line title. + string title@1; + + // Longer description of the option. May contain embedded newlines. + string description@2; + + // Lorgnette type for the option. + OptionType type@3; + + // Unit of the option's value. + OptionUnit unit@4; + + // Current value of the option if relevant. + OptionValue? value@5; + + // Constrain on possible option values. + OptionConstraint? constraint@6; + + // Option can be detected in software. + bool isDetectable@7; + + // How the option value can be changed. + OptionConfigurability configurability@8; + + // Can be automatically set by the backend. + bool isAutoSettable@9; + + // Emulated by the backend instead of implemented in the scanner. + bool isEmulated@10; + + // Option is active and can be set/retrieved. If false, the `value` field + // will not be set. + bool isActive@11; + + // UI should not display this option by default. + bool isAdvanced@12; + + // Option is used for internal configuration and should never be displayed + // in the UI. + bool isInternal@13; +}; + // The result of combining lorgnette's d-bus response with Chrome's mDNS // discovery for `GetScannerList()`. [Stable] @@ -160,9 +330,40 @@ array<ScannerInfo> scanners@1; }; +// The response from calling `OpenScanner()`. +[Stable] +struct OpenScannerResponse { + // Same scanner_id value passed to `OpenScanner()`. + string scanner_id@0; + + // Backend result of opening the scanner. + ScannerOperationResult result@1; + + // If result is ScannerOperationResult.kSuccess, an exclusive handle to the + // scanner that can be used for further operations. This handle remains + // valid until `CloseScanner()` is called, `OpenScanner()` is called again by + // the same client with the same `scanner_id`, or a hardware change causes + // the scanner to become inaccessible. + string? scanner_handle@2; + + // If result is ScannerOperationResult.kSuccess, a mapping from option names + // to `ScannerOption`. + map<string, ScannerOption>? options@3; +}; + +// The response from calling `CloseScanner()`. +[Stable] +struct CloseScannerResponse { + // Same scanner_handle value passed to `CloseScanner()`. + string scanner_handle@0; + + // Backend result of closing the scanner handle. + ScannerOperationResult result@1; +}; + // This interface is used to access scanners. -// Next version: 2 -// Next method id: 3 +// Next version: 3 +// Next method id: 5 [Stable, Uuid="f0c77c02-b5c1-4919-8218-3076ecad58db"] interface DocumentScan { // Returns the names of all available, de-duplicated scanners. @@ -187,4 +388,13 @@ [MinVersion=1] GetScannerList@2(string client_id, ScannerEnumFilter? filter) => (GetScannerListResponse response); + + // Open an exclusive handle to a scanner returned from `GetScannerList()`. + [MinVersion=2] + OpenScanner@3(string client_id, string scanner_id) + => (OpenScannerResponse response); + + // Close a scanner handle opened by `OpenScanner()`. + [MinVersion=2] + CloseScanner@4(string scanner_handle) => (CloseScannerResponse response); };
diff --git a/chromeos/profiles/arm.afdo.newest.txt b/chromeos/profiles/arm.afdo.newest.txt index 5e2868f..4d15e5c 100644 --- a/chromeos/profiles/arm.afdo.newest.txt +++ b/chromeos/profiles/arm.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-arm-none-121-6126.0-1701089735-benchmark-121.0.6154.0-r1-redacted.afdo.xz +chromeos-chrome-arm-none-121-6126.0-1701089735-benchmark-121.0.6155.0-r1-redacted.afdo.xz
diff --git a/chromeos/profiles/atom.afdo.newest.txt b/chromeos/profiles/atom.afdo.newest.txt index 34d827c..a7b05b0 100644 --- a/chromeos/profiles/atom.afdo.newest.txt +++ b/chromeos/profiles/atom.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-atom-121-6126.0-1701086572-benchmark-121.0.6153.0-r1-redacted.afdo.xz +chromeos-chrome-amd64-atom-121-6126.0-1701086572-benchmark-121.0.6155.0-r1-redacted.afdo.xz
diff --git a/chromeos/profiles/bigcore.afdo.newest.txt b/chromeos/profiles/bigcore.afdo.newest.txt index cc5b5d9..137ea55 100644 --- a/chromeos/profiles/bigcore.afdo.newest.txt +++ b/chromeos/profiles/bigcore.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-bigcore-121-6126.0-1701082639-benchmark-121.0.6153.0-r1-redacted.afdo.xz +chromeos-chrome-amd64-bigcore-121-6126.0-1701082639-benchmark-121.0.6154.0-r1-redacted.afdo.xz
diff --git a/chromeos/startup/browser_init_params.h b/chromeos/startup/browser_init_params.h index 1f84886..a2ab0f8 100644 --- a/chromeos/startup/browser_init_params.h +++ b/chromeos/startup/browser_init_params.h
@@ -29,8 +29,7 @@ static void SetInitParamsForTests( crosapi::mojom::BrowserInitParamsPtr init_params); - // Create Mem FD from `init_params_`. This must be called after `init_params_` - // has initialized by calling GetInstance(). + // Create Mem FD from `init_params_`. static base::ScopedFD CreateStartupData(); static bool is_crosapi_disabled_for_testing() {
diff --git a/chromeos/ui/frame/caption_buttons/frame_center_button.cc b/chromeos/ui/frame/caption_buttons/frame_center_button.cc index 2bb7030..c02f584 100644 --- a/chromeos/ui/frame/caption_buttons/frame_center_button.cc +++ b/chromeos/ui/frame/caption_buttons/frame_center_button.cc
@@ -5,6 +5,7 @@ #include "chromeos/ui/frame/caption_buttons/frame_center_button.h" #include <algorithm> +#include <utility> #include "base/i18n/rtl.h" #include "base/numerics/safe_conversions.h" @@ -49,7 +50,9 @@ } // namespace FrameCenterButton::FrameCenterButton(PressedCallback callback) - : FrameCaptionButton(callback, views::CAPTION_BUTTON_ICON_CENTER, HTMENU) { + : FrameCaptionButton(std::move(callback), + views::CAPTION_BUTTON_ICON_CENTER, + HTMENU) { SetAccessibleName(l10n_util::GetStringUTF16(IDS_APP_ACCNAME_CENTER)); background_color_changed_subscription_ = AddBackgroundColorChangedCallback( base::BindRepeating(&FrameCenterButton::OnBackgroundColorChanged,
diff --git a/clank b/clank index e4d96a4..0b5f021 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit e4d96a442aa336f431e66b1a29d61da34f59bcb6 +Subproject commit 0b5f021a8a68d2e7b9608875dbca50ec07256d1f
diff --git a/components/allocation_recorder/testing/mock_objects.h b/components/allocation_recorder/testing/mock_objects.h index 7323cf1..801eadf 100644 --- a/components/allocation_recorder/testing/mock_objects.h +++ b/components/allocation_recorder/testing/mock_objects.h
@@ -48,4 +48,4 @@ } // namespace allocation_recorder::testing::crash_handler -#endif +#endif // COMPONENTS_ALLOCATION_RECORDER_TESTING_MOCK_OBJECTS_H_
diff --git a/components/attribution_reporting/BUILD.gn b/components/attribution_reporting/BUILD.gn index 02cf968..7ad4e26 100644 --- a/components/attribution_reporting/BUILD.gn +++ b/components/attribution_reporting/BUILD.gn
@@ -40,6 +40,8 @@ sources = [ "aggregatable_dedup_key.cc", "aggregatable_dedup_key.h", + "aggregatable_trigger_config.cc", + "aggregatable_trigger_config.h", "aggregatable_trigger_data.cc", "aggregatable_trigger_data.h", "aggregatable_values.cc", @@ -111,6 +113,7 @@ sources = [ "aggregatable_dedup_key_unittest.cc", + "aggregatable_trigger_config_unittest.cc", "aggregatable_trigger_data_unittest.cc", "aggregatable_values_unittest.cc", "aggregation_keys_unittest.cc",
diff --git a/components/attribution_reporting/aggregatable_trigger_config.cc b/components/attribution_reporting/aggregatable_trigger_config.cc new file mode 100644 index 0000000..62e1b7b --- /dev/null +++ b/components/attribution_reporting/aggregatable_trigger_config.cc
@@ -0,0 +1,179 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/attribution_reporting/aggregatable_trigger_config.h" + +#include <stddef.h> + +#include <string> +#include <utility> + +#include "base/check.h" +#include "base/feature_list.h" +#include "base/types/expected.h" +#include "base/types/expected_macros.h" +#include "base/values.h" +#include "components/attribution_reporting/features.h" +#include "components/attribution_reporting/source_registration_time_config.mojom.h" +#include "components/attribution_reporting/trigger_registration_error.mojom.h" +#include "third_party/abseil-cpp/absl/types/optional.h" + +namespace attribution_reporting { + +namespace { + +using ::attribution_reporting::mojom::SourceRegistrationTimeConfig; +using ::attribution_reporting::mojom::TriggerRegistrationError; + +constexpr char kAggregatableSourceRegistrationTime[] = + "aggregatable_source_registration_time"; +constexpr char kTriggerContextId[] = "trigger_context_id"; + +constexpr char kInclude[] = "include"; +constexpr char kExclude[] = "exclude"; + +constexpr size_t kMaxTriggerContextIdLength = 64; + +base::expected<mojom::SourceRegistrationTimeConfig, TriggerRegistrationError> +ParseAggregatableSourceRegistrationTime(const base::Value* value) { + if (!value) { + return SourceRegistrationTimeConfig::kExclude; + } + + const std::string* str = value->GetIfString(); + if (!str) { + return base::unexpected( + TriggerRegistrationError::kAggregatableSourceRegistrationTimeWrongType); + } + + if (*str == kInclude) { + return SourceRegistrationTimeConfig::kInclude; + } + + if (*str == kExclude) { + return SourceRegistrationTimeConfig::kExclude; + } + + return base::unexpected(TriggerRegistrationError:: + kAggregatableSourceRegistrationTimeUnknownValue); +} + +std::string SerializeAggregatableSourceRegistrationTime( + SourceRegistrationTimeConfig config) { + switch (config) { + case SourceRegistrationTimeConfig::kInclude: + return kInclude; + case SourceRegistrationTimeConfig::kExclude: + return kExclude; + } +} + +bool IsTriggerContextIdValid(const std::string& s) { + return !s.empty() && s.length() <= kMaxTriggerContextIdLength; +} + +bool IsTriggerContextIdAllowed( + SourceRegistrationTimeConfig source_registration_time_config) { + switch (source_registration_time_config) { + case SourceRegistrationTimeConfig::kExclude: + return true; + case SourceRegistrationTimeConfig::kInclude: + return false; + } +} + +bool IsValid(SourceRegistrationTimeConfig source_registration_time_config, + const absl::optional<std::string>& trigger_context_id) { + if (!trigger_context_id.has_value()) { + return true; + } + + return IsTriggerContextIdValid(*trigger_context_id) && + IsTriggerContextIdAllowed(source_registration_time_config); +} + +base::expected<absl::optional<std::string>, TriggerRegistrationError> +ParseTriggerContextId(base::Value* value) { + if (!base::FeatureList::IsEnabled( + features::kAttributionReportingTriggerContextId) || + !value) { + return absl::nullopt; + } + + std::string* s = value->GetIfString(); + if (!s || !IsTriggerContextIdValid(*s)) { + return base::unexpected( + TriggerRegistrationError::kTriggerContextIdInvalidValue); + } + return std::move(*s); +} + +} // namespace + +// static +base::expected<AggregatableTriggerConfig, TriggerRegistrationError> +AggregatableTriggerConfig::Parse(base::Value::Dict& dict) { + ASSIGN_OR_RETURN(SourceRegistrationTimeConfig source_registration_time_config, + ParseAggregatableSourceRegistrationTime( + dict.Find(kAggregatableSourceRegistrationTime))); + + ASSIGN_OR_RETURN(absl::optional<std::string> trigger_context_id, + ParseTriggerContextId(dict.Find(kTriggerContextId))); + + if (trigger_context_id.has_value() && + !IsTriggerContextIdAllowed(source_registration_time_config)) { + return base::unexpected( + TriggerRegistrationError:: + kTriggerContextIdInvalidSourceRegistrationTimeConfig); + } + + return AggregatableTriggerConfig(source_registration_time_config, + std::move(trigger_context_id)); +} + +// static +absl::optional<AggregatableTriggerConfig> AggregatableTriggerConfig::Create( + SourceRegistrationTimeConfig source_registration_time_config, + absl::optional<std::string> trigger_context_id) { + if (!IsValid(source_registration_time_config, trigger_context_id)) { + return absl::nullopt; + } + return AggregatableTriggerConfig(source_registration_time_config, + std::move(trigger_context_id)); +} + +AggregatableTriggerConfig::AggregatableTriggerConfig() = default; + +AggregatableTriggerConfig::AggregatableTriggerConfig( + SourceRegistrationTimeConfig source_registration_time_config, + absl::optional<std::string> trigger_context_id) + : source_registration_time_config_(source_registration_time_config), + trigger_context_id_(std::move(trigger_context_id)) { + CHECK(IsValid(source_registration_time_config_, trigger_context_id_)); +} + +AggregatableTriggerConfig::AggregatableTriggerConfig( + const AggregatableTriggerConfig&) = default; + +AggregatableTriggerConfig& AggregatableTriggerConfig::operator=( + const AggregatableTriggerConfig&) = default; + +AggregatableTriggerConfig::AggregatableTriggerConfig( + AggregatableTriggerConfig&&) = default; + +AggregatableTriggerConfig& AggregatableTriggerConfig::operator=( + AggregatableTriggerConfig&&) = default; + +AggregatableTriggerConfig::~AggregatableTriggerConfig() = default; + +void AggregatableTriggerConfig::Serialize(base::Value::Dict& dict) const { + dict.Set(kAggregatableSourceRegistrationTime, + SerializeAggregatableSourceRegistrationTime( + source_registration_time_config_)); + if (trigger_context_id_.has_value()) { + dict.Set(kTriggerContextId, *trigger_context_id_); + } +} + +} // namespace attribution_reporting
diff --git a/components/attribution_reporting/aggregatable_trigger_config.h b/components/attribution_reporting/aggregatable_trigger_config.h new file mode 100644 index 0000000..38a5456 --- /dev/null +++ b/components/attribution_reporting/aggregatable_trigger_config.h
@@ -0,0 +1,64 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_ATTRIBUTION_REPORTING_AGGREGATABLE_TRIGGER_CONFIG_H_ +#define COMPONENTS_ATTRIBUTION_REPORTING_AGGREGATABLE_TRIGGER_CONFIG_H_ + +#include <string> + +#include "base/component_export.h" +#include "base/types/expected.h" +#include "base/values.h" +#include "components/attribution_reporting/source_registration_time_config.mojom.h" +#include "components/attribution_reporting/trigger_registration_error.mojom-forward.h" +#include "third_party/abseil-cpp/absl/types/optional.h" + +namespace attribution_reporting { + +class COMPONENT_EXPORT(ATTRIBUTION_REPORTING) AggregatableTriggerConfig { + public: + static base::expected<AggregatableTriggerConfig, + mojom::TriggerRegistrationError> + Parse(base::Value::Dict&); + + static absl::optional<AggregatableTriggerConfig> Create( + mojom::SourceRegistrationTimeConfig, + absl::optional<std::string> trigger_context_id); + + AggregatableTriggerConfig(); + + AggregatableTriggerConfig(const AggregatableTriggerConfig&); + AggregatableTriggerConfig& operator=(const AggregatableTriggerConfig&); + + AggregatableTriggerConfig(AggregatableTriggerConfig&&); + AggregatableTriggerConfig& operator=(AggregatableTriggerConfig&&); + + ~AggregatableTriggerConfig(); + + friend bool operator==(const AggregatableTriggerConfig&, + const AggregatableTriggerConfig&) = default; + + void Serialize(base::Value::Dict&) const; + + mojom::SourceRegistrationTimeConfig source_registration_time_config() const { + return source_registration_time_config_; + } + + const absl::optional<std::string>& trigger_context_id() const { + return trigger_context_id_; + } + + private: + AggregatableTriggerConfig(mojom::SourceRegistrationTimeConfig, + absl::optional<std::string> trigger_context_id); + + mojom::SourceRegistrationTimeConfig source_registration_time_config_ = + mojom::SourceRegistrationTimeConfig::kExclude; + + absl::optional<std::string> trigger_context_id_; +}; + +} // namespace attribution_reporting + +#endif // COMPONENTS_ATTRIBUTION_REPORTING_AGGREGATABLE_TRIGGER_CONFIG_H_
diff --git a/components/attribution_reporting/aggregatable_trigger_config_unittest.cc b/components/attribution_reporting/aggregatable_trigger_config_unittest.cc new file mode 100644 index 0000000..6d82e483 --- /dev/null +++ b/components/attribution_reporting/aggregatable_trigger_config_unittest.cc
@@ -0,0 +1,273 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/attribution_reporting/aggregatable_trigger_config.h" + +#include <string> + +#include "base/test/gmock_expected_support.h" +#include "base/test/scoped_feature_list.h" +#include "base/test/values_test_util.h" +#include "base/values.h" +#include "components/attribution_reporting/features.h" +#include "components/attribution_reporting/source_registration_time_config.mojom.h" +#include "components/attribution_reporting/test_utils.h" +#include "components/attribution_reporting/trigger_registration_error.mojom.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/abseil-cpp/absl/types/optional.h" + +namespace attribution_reporting { +namespace { + +using ::attribution_reporting::mojom::SourceRegistrationTimeConfig; +using ::attribution_reporting::mojom::TriggerRegistrationError; +using ::base::test::ErrorIs; +using ::base::test::ValueIs; +using ::testing::Optional; +using ::testing::Property; + +TEST(AggregatableTriggerConfigTest, ParseAggregatableSourceRegistrationTime) { + const struct { + const char* desc; + const char* json; + ::testing::Matcher< + base::expected<AggregatableTriggerConfig, TriggerRegistrationError>> + matches; + } kTestCases[] = { + { + "empty", + R"json({})json", + ValueIs(AggregatableTriggerConfig()), + }, + { + "aggregatable_source_registration_time_include", + R"json({"aggregatable_source_registration_time":"include"})json", + ValueIs(Property( + &AggregatableTriggerConfig::source_registration_time_config, + SourceRegistrationTimeConfig::kInclude)), + }, + { + "aggregatable_source_registration_time_exclude", + R"json({"aggregatable_source_registration_time":"exclude"})json", + ValueIs(Property( + &AggregatableTriggerConfig::source_registration_time_config, + SourceRegistrationTimeConfig::kExclude)), + }, + { + "aggregatable_source_registration_time_wrong_type", + R"json({"aggregatable_source_registration_time":123})json", + ErrorIs(TriggerRegistrationError:: + kAggregatableSourceRegistrationTimeWrongType), + }, + { + "aggregatable_source_registration_time_invalid_value", + R"json({"aggregatable_source_registration_time":"unknown"})json", + ErrorIs(TriggerRegistrationError:: + kAggregatableSourceRegistrationTimeUnknownValue), + }, + }; + + for (const auto& test_case : kTestCases) { + SCOPED_TRACE(test_case.desc); + + base::Value::Dict input = base::test::ParseJsonDict(test_case.json); + + EXPECT_THAT(AggregatableTriggerConfig::Parse(input), test_case.matches); + } +} + +TEST(AggregatableTriggerConfigTest, ParseTriggerContextId) { + const struct { + const char* desc; + const char* json; + ::testing::Matcher< + base::expected<AggregatableTriggerConfig, TriggerRegistrationError>> + enabled_matches; + ::testing::Matcher< + base::expected<AggregatableTriggerConfig, TriggerRegistrationError>> + disabled_matches; + } kTestCases[] = { + { + "empty", + R"json({})json", + ValueIs(AggregatableTriggerConfig()), + ValueIs(AggregatableTriggerConfig()), + }, + { + "trigger_context_id_valid", + R"json({"trigger_context_id":"123"})json", + ValueIs(Property(&AggregatableTriggerConfig::trigger_context_id, + Optional(std::string("123")))), + ValueIs(AggregatableTriggerConfig()), + }, + { + "trigger_context_id_wrong_type", + R"json({"trigger_context_id":123})json", + ErrorIs(TriggerRegistrationError::kTriggerContextIdInvalidValue), + ValueIs(AggregatableTriggerConfig()), + }, + { + "trigger_context_id_invalid_value", + R"json({"trigger_context_id":""})json", + ErrorIs(TriggerRegistrationError::kTriggerContextIdInvalidValue), + ValueIs(AggregatableTriggerConfig()), + }, + { + "trigger_context_id_disallowed", + R"json({ + "aggregatable_source_registration_time":"include", + "trigger_context_id":"123" + })json", + ErrorIs(TriggerRegistrationError:: + kTriggerContextIdInvalidSourceRegistrationTimeConfig), + ValueIs(*AggregatableTriggerConfig::Create( + SourceRegistrationTimeConfig::kInclude, + /*trigger_context_id=*/absl::nullopt)), + }, + }; + + for (const auto& test_case : kTestCases) { + SCOPED_TRACE(test_case.desc); + + base::Value::Dict input = base::test::ParseJsonDict(test_case.json); + + { + SCOPED_TRACE("disabled"); + + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitAndDisableFeature( + features::kAttributionReportingTriggerContextId); + + EXPECT_THAT(AggregatableTriggerConfig::Parse(input), + test_case.disabled_matches); + } + + { + SCOPED_TRACE("enabled"); + + base::test::ScopedFeatureList scoped_feature_list( + features::kAttributionReportingTriggerContextId); + + EXPECT_THAT(AggregatableTriggerConfig::Parse(input), + test_case.enabled_matches); + } + } +} + +TEST(AggregatableTriggerConfigTest, Create) { + const struct { + const char* desc; + SourceRegistrationTimeConfig source_registration_time_config; + absl::optional<std::string> trigger_context_id; + absl::optional<AggregatableTriggerConfig> expected; + } kTestCases[] = { + { + "valid_exclude_source_registration_time_with_trigger_context_id", + SourceRegistrationTimeConfig::kExclude, + "123", + *AggregatableTriggerConfig::Create( + SourceRegistrationTimeConfig::kExclude, "123"), + }, + { + "valid_exclude_source_registration_time_without_trigger_context_id", + SourceRegistrationTimeConfig::kExclude, + absl::nullopt, + AggregatableTriggerConfig(), + }, + { + "valid_include_source_registration_time_without_trigger_context_id", + SourceRegistrationTimeConfig::kInclude, + absl::nullopt, + *AggregatableTriggerConfig::Create( + SourceRegistrationTimeConfig::kInclude, absl::nullopt), + }, + { + "trigger_context_id_empty", + SourceRegistrationTimeConfig::kExclude, + "", + absl::nullopt, + }, + { + "trigger_context_id_too_long", + SourceRegistrationTimeConfig::kExclude, + std::string(65, 'a'), + absl::nullopt, + }, + { + "trigger_context_id_disallowed", + SourceRegistrationTimeConfig::kInclude, + "123", + absl::nullopt, + }, + }; + + for (const auto& test_case : kTestCases) { + SCOPED_TRACE(test_case.desc); + + EXPECT_EQ(AggregatableTriggerConfig::Create( + test_case.source_registration_time_config, + test_case.trigger_context_id), + test_case.expected); + } +} + +TEST(AggregatableTriggerConfigTest, Parse_TriggerContextIdLength) { + base::test::ScopedFeatureList scoped_feature_list( + features::kAttributionReportingTriggerContextId); + + constexpr char kTriggerContextId[] = "trigger_context_id"; + + base::Value::Dict dict; + dict.Set(kTriggerContextId, std::string(64, 'a')); + EXPECT_THAT(AggregatableTriggerConfig::Parse(dict), + ValueIs(Property(&AggregatableTriggerConfig::trigger_context_id, + Optional(std::string(64, 'a'))))); + + dict.Set(kTriggerContextId, std::string(65, 'a')); + EXPECT_THAT(AggregatableTriggerConfig::Parse(dict), + ErrorIs(TriggerRegistrationError::kTriggerContextIdInvalidValue)); +} + +TEST(AggregatableTriggerConfigTest, Serialize) { + const struct { + AggregatableTriggerConfig input; + const char* expected_json; + } kTestCases[] = { + { + AggregatableTriggerConfig(), + R"json({ + "aggregatable_source_registration_time":"exclude" + })json", + }, + { + *AggregatableTriggerConfig::Create( + SourceRegistrationTimeConfig::kInclude, + /*trigger_context_id=*/absl::nullopt), + R"json({ + "aggregatable_source_registration_time":"include" + })json", + }, + { + *AggregatableTriggerConfig::Create( + SourceRegistrationTimeConfig::kExclude, + /*trigger_context_id=*/"123"), + R"json({ + "aggregatable_source_registration_time":"exclude", + "trigger_context_id":"123" + })json", + }, + }; + + for (const auto& test_case : kTestCases) { + SCOPED_TRACE(test_case.input); + + base::Value::Dict dict; + test_case.input.Serialize(dict); + EXPECT_THAT(dict, base::test::IsJson(test_case.expected_json)); + } +} + +} // namespace +} // namespace attribution_reporting
diff --git a/components/attribution_reporting/features.cc b/components/attribution_reporting/features.cc index 13a8626f..5d3e2d4 100644 --- a/components/attribution_reporting/features.cc +++ b/components/attribution_reporting/features.cc
@@ -17,4 +17,8 @@ "AttributionReportingTriggerConfig", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kAttributionReportingTriggerContextId, + "AttributionReportingTriggerContextId", + base::FEATURE_ENABLED_BY_DEFAULT); + } // namespace attribution_reporting::features
diff --git a/components/attribution_reporting/features.h b/components/attribution_reporting/features.h index 40ba0b93..bebbf598 100644 --- a/components/attribution_reporting/features.h +++ b/components/attribution_reporting/features.h
@@ -17,6 +17,9 @@ COMPONENT_EXPORT(ATTRIBUTION_REPORTING_FEATURES) BASE_DECLARE_FEATURE(kAttributionReportingTriggerConfig); +COMPONENT_EXPORT(ATTRIBUTION_REPORTING_FEATURES) +BASE_DECLARE_FEATURE(kAttributionReportingTriggerContextId); + } // namespace attribution_reporting::features #endif // COMPONENTS_ATTRIBUTION_REPORTING_FEATURES_H_
diff --git a/components/attribution_reporting/registration.mojom b/components/attribution_reporting/registration.mojom index cf39cce..ebd0555 100644 --- a/components/attribution_reporting/registration.mojom +++ b/components/attribution_reporting/registration.mojom
@@ -189,6 +189,10 @@ // Specifies whether to include source registration time in aggregatable // reports. SourceRegistrationTimeConfig source_registration_time_config; + + // Specifies the context ID associated with the trigger. The context ID + // cannot be empty or longer than 64 bytes. + string? trigger_context_id; }; // Represents a source or trigger registration item that will be passed to the OS, if supported.
diff --git a/components/attribution_reporting/registration_mojom_traits.cc b/components/attribution_reporting/registration_mojom_traits.cc index 449bd82b..4ca7bd8 100644 --- a/components/attribution_reporting/registration_mojom_traits.cc +++ b/components/attribution_reporting/registration_mojom_traits.cc
@@ -6,6 +6,7 @@ #include <stdint.h> +#include <string> #include <utility> #include <vector> @@ -13,6 +14,7 @@ #include "base/time/time.h" #include "base/uuid.h" #include "components/attribution_reporting/aggregatable_dedup_key.h" +#include "components/attribution_reporting/aggregatable_trigger_config.h" #include "components/attribution_reporting/aggregatable_trigger_data.h" #include "components/attribution_reporting/aggregatable_values.h" #include "components/attribution_reporting/aggregation_keys.h" @@ -354,9 +356,23 @@ return false; } + absl::optional<std::string> trigger_context_id; + if (!data.ReadTriggerContextId(&trigger_context_id)) { + return false; + } + + absl::optional<attribution_reporting::AggregatableTriggerConfig> + aggregatable_trigger_config = + attribution_reporting::AggregatableTriggerConfig::Create( + data.source_registration_time_config(), + std::move(trigger_context_id)); + if (!aggregatable_trigger_config.has_value()) { + return false; + } + out->aggregatable_trigger_config = std::move(*aggregatable_trigger_config); + out->debug_key = data.debug_key(); out->debug_reporting = data.debug_reporting(); - out->source_registration_time_config = data.source_registration_time_config(); return true; }
diff --git a/components/attribution_reporting/registration_mojom_traits.h b/components/attribution_reporting/registration_mojom_traits.h index 57ea9353..614d26ee 100644 --- a/components/attribution_reporting/registration_mojom_traits.h +++ b/components/attribution_reporting/registration_mojom_traits.h
@@ -14,6 +14,7 @@ #include "base/containers/flat_set.h" #include "base/time/time.h" #include "components/attribution_reporting/aggregatable_dedup_key.h" +#include "components/attribution_reporting/aggregatable_trigger_config.h" #include "components/attribution_reporting/aggregatable_trigger_data.h" #include "components/attribution_reporting/aggregatable_values.h" #include "components/attribution_reporting/aggregation_keys.h" @@ -349,7 +350,13 @@ static attribution_reporting::mojom::SourceRegistrationTimeConfig source_registration_time_config( const attribution_reporting::TriggerRegistration& trigger) { - return trigger.source_registration_time_config; + return trigger.aggregatable_trigger_config + .source_registration_time_config(); + } + + static const absl::optional<std::string>& trigger_context_id( + const attribution_reporting::TriggerRegistration& trigger) { + return trigger.aggregatable_trigger_config.trigger_context_id(); } static bool Read(
diff --git a/components/attribution_reporting/test_utils.cc b/components/attribution_reporting/test_utils.cc index e75ee143..683c01d 100644 --- a/components/attribution_reporting/test_utils.cc +++ b/components/attribution_reporting/test_utils.cc
@@ -10,6 +10,7 @@ #include "base/time/time.h" #include "base/values.h" #include "components/attribution_reporting/aggregatable_dedup_key.h" +#include "components/attribution_reporting/aggregatable_trigger_config.h" #include "components/attribution_reporting/aggregatable_trigger_data.h" #include "components/attribution_reporting/aggregatable_values.h" #include "components/attribution_reporting/aggregation_keys.h" @@ -127,4 +128,12 @@ return out << "{" << (*it).first << ", " << (*it).second << "}"; } +std::ostream& operator<<( + std::ostream& out, + const AggregatableTriggerConfig& aggregatable_trigger_config) { + base::Value::Dict dict; + aggregatable_trigger_config.Serialize(dict); + return out << dict; +} + } // namespace attribution_reporting
diff --git a/components/attribution_reporting/test_utils.h b/components/attribution_reporting/test_utils.h index 6655f9a..3174516 100644 --- a/components/attribution_reporting/test_utils.h +++ b/components/attribution_reporting/test_utils.h
@@ -18,6 +18,7 @@ namespace attribution_reporting { +class AggregatableTriggerConfig; class AggregatableTriggerData; class AggregatableValues; class AggregationKeys; @@ -70,6 +71,8 @@ std::ostream& operator<<(std::ostream&, const TriggerSpecs::const_iterator&); +std::ostream& operator<<(std::ostream&, const AggregatableTriggerConfig&); + } // namespace attribution_reporting #endif // COMPONENTS_ATTRIBUTION_REPORTING_TEST_UTILS_H_
diff --git a/components/attribution_reporting/trigger_registration.cc b/components/attribution_reporting/trigger_registration.cc index 081c3a9..385a3438 100644 --- a/components/attribution_reporting/trigger_registration.cc +++ b/components/attribution_reporting/trigger_registration.cc
@@ -18,13 +18,13 @@ #include "components/aggregation_service/features.h" #include "components/aggregation_service/parsing_utils.h" #include "components/attribution_reporting/aggregatable_dedup_key.h" +#include "components/attribution_reporting/aggregatable_trigger_config.h" #include "components/attribution_reporting/aggregatable_trigger_data.h" #include "components/attribution_reporting/aggregatable_values.h" #include "components/attribution_reporting/event_trigger_data.h" #include "components/attribution_reporting/features.h" #include "components/attribution_reporting/filters.h" #include "components/attribution_reporting/parsing_utils.h" -#include "components/attribution_reporting/source_registration_time_config.mojom.h" #include "components/attribution_reporting/suitable_origin.h" #include "components/attribution_reporting/trigger_registration_error.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -42,11 +42,6 @@ constexpr char kAggregatableTriggerData[] = "aggregatable_trigger_data"; constexpr char kAggregatableValues[] = "aggregatable_values"; constexpr char kEventTriggerData[] = "event_trigger_data"; -constexpr char kAggregatableSourceRegistrationTime[] = - "aggregatable_source_registration_time"; - -constexpr char kInclude[] = "include"; -constexpr char kExclude[] = "exclude"; base::expected<absl::optional<SuitableOrigin>, TriggerRegistrationError> ParseAggregationCoordinator(const base::Value* value) { @@ -116,40 +111,6 @@ return vec; } -base::expected<mojom::SourceRegistrationTimeConfig, TriggerRegistrationError> -ParseAggregatableSourceRegistrationTime(const base::Value* value) { - if (!value) { - return mojom::SourceRegistrationTimeConfig::kExclude; - } - - const std::string* str = value->GetIfString(); - if (!str) { - return base::unexpected( - TriggerRegistrationError::kAggregatableSourceRegistrationTimeWrongType); - } - - if (*str == kInclude) { - return mojom::SourceRegistrationTimeConfig::kInclude; - } - - if (*str == kExclude) { - return mojom::SourceRegistrationTimeConfig::kExclude; - } - - return base::unexpected(TriggerRegistrationError:: - kAggregatableSourceRegistrationTimeUnknownValue); -} - -std::string SerializeAggregatableSourceRegistrationTime( - mojom::SourceRegistrationTimeConfig config) { - switch (config) { - case mojom::SourceRegistrationTimeConfig::kInclude: - return kInclude; - case mojom::SourceRegistrationTimeConfig::kExclude: - return kExclude; - } -} - } // namespace // static @@ -186,16 +147,14 @@ absl::optional<uint64_t> debug_key = ParseDebugKey(registration); bool debug_reporting = ParseDebugReporting(registration); - ASSIGN_OR_RETURN( - mojom::SourceRegistrationTimeConfig source_registration_time_config, - ParseAggregatableSourceRegistrationTime( - registration.Find(kAggregatableSourceRegistrationTime))); + ASSIGN_OR_RETURN(auto aggregatable_trigger_config, + AggregatableTriggerConfig::Parse(registration)); return TriggerRegistration( std::move(filters), debug_key, std::move(aggregatable_dedup_keys), std::move(event_triggers), std::move(aggregatable_trigger_data), std::move(aggregatable_values), debug_reporting, aggregation_coordinator, - source_registration_time_config); + std::move(aggregatable_trigger_config)); } // static @@ -218,9 +177,10 @@ if (!trigger.has_value()) { static_assert( TriggerRegistrationError::kMaxValue == - TriggerRegistrationError::kFiltersUsingReservedKey, - "Bump version of Conversions.TriggerRegistrationError8 histogram."); - base::UmaHistogramEnumeration("Conversions.TriggerRegistrationError8", + TriggerRegistrationError:: + kTriggerContextIdInvalidSourceRegistrationTimeConfig, + "Bump version of Conversions.TriggerRegistrationError9 histogram."); + base::UmaHistogramEnumeration("Conversions.TriggerRegistrationError9", trigger.error()); } @@ -238,7 +198,7 @@ AggregatableValues aggregatable_values, bool debug_reporting, absl::optional<SuitableOrigin> aggregation_coordinator_origin, - mojom::SourceRegistrationTimeConfig source_registration_time_config) + AggregatableTriggerConfig aggregatable_trigger_config) : filters(std::move(filters)), debug_key(debug_key), aggregatable_dedup_keys(std::move(aggregatable_dedup_keys)), @@ -247,7 +207,7 @@ aggregatable_values(std::move(aggregatable_values)), debug_reporting(debug_reporting), aggregation_coordinator_origin(std::move(aggregation_coordinator_origin)), - source_registration_time_config(source_registration_time_config) {} + aggregatable_trigger_config(std::move(aggregatable_trigger_config)) {} TriggerRegistration::~TriggerRegistration() = default; @@ -287,9 +247,7 @@ aggregation_coordinator_origin->Serialize()); } - dict.Set(kAggregatableSourceRegistrationTime, - SerializeAggregatableSourceRegistrationTime( - source_registration_time_config)); + aggregatable_trigger_config.Serialize(dict); return dict; }
diff --git a/components/attribution_reporting/trigger_registration.h b/components/attribution_reporting/trigger_registration.h index afa3a1b..0f16c87 100644 --- a/components/attribution_reporting/trigger_registration.h +++ b/components/attribution_reporting/trigger_registration.h
@@ -13,9 +13,9 @@ #include "base/strings/string_piece.h" #include "base/types/expected.h" #include "base/values.h" +#include "components/attribution_reporting/aggregatable_trigger_config.h" #include "components/attribution_reporting/aggregatable_values.h" #include "components/attribution_reporting/filters.h" -#include "components/attribution_reporting/source_registration_time_config.mojom.h" #include "components/attribution_reporting/suitable_origin.h" #include "components/attribution_reporting/trigger_registration_error.mojom-forward.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -47,7 +47,7 @@ AggregatableValues aggregatable_values, bool debug_reporting, absl::optional<SuitableOrigin> aggregation_coordinator_origin, - mojom::SourceRegistrationTimeConfig source_registration_time_config); + AggregatableTriggerConfig aggregatable_trigger_config); ~TriggerRegistration(); @@ -70,9 +70,7 @@ AggregatableValues aggregatable_values; bool debug_reporting = false; absl::optional<SuitableOrigin> aggregation_coordinator_origin; - attribution_reporting::mojom::SourceRegistrationTimeConfig - source_registration_time_config = - attribution_reporting::mojom::SourceRegistrationTimeConfig::kExclude; + AggregatableTriggerConfig aggregatable_trigger_config; }; } // namespace attribution_reporting
diff --git a/components/attribution_reporting/trigger_registration_error.mojom b/components/attribution_reporting/trigger_registration_error.mojom index eb9c686..5b5bd7d5 100644 --- a/components/attribution_reporting/trigger_registration_error.mojom +++ b/components/attribution_reporting/trigger_registration_error.mojom
@@ -45,4 +45,7 @@ kAggregatableSourceRegistrationTimeWrongType = 34, kAggregatableSourceRegistrationTimeUnknownValue = 35, + + kTriggerContextIdInvalidValue = 37, + kTriggerContextIdInvalidSourceRegistrationTimeConfig = 38, };
diff --git a/components/attribution_reporting/trigger_registration_fuzzer_corpus/all_params.textproto b/components/attribution_reporting/trigger_registration_fuzzer_corpus/all_params.textproto index 13686d9f8..75f39a95 100644 --- a/components/attribution_reporting/trigger_registration_fuzzer_corpus/all_params.textproto +++ b/components/attribution_reporting/trigger_registration_fuzzer_corpus/all_params.textproto
@@ -394,4 +394,12 @@ } } } + field { + name: "trigger_context_id" + value { + string_value { + value: "example" + } + } + } }
diff --git a/components/attribution_reporting/trigger_registration_unittest.cc b/components/attribution_reporting/trigger_registration_unittest.cc index 2620e4b..2be4c7f 100644 --- a/components/attribution_reporting/trigger_registration_unittest.cc +++ b/components/attribution_reporting/trigger_registration_unittest.cc
@@ -18,6 +18,7 @@ #include "base/values.h" #include "components/aggregation_service/features.h" #include "components/attribution_reporting/aggregatable_dedup_key.h" +#include "components/attribution_reporting/aggregatable_trigger_config.h" #include "components/attribution_reporting/aggregatable_trigger_data.h" #include "components/attribution_reporting/aggregatable_values.h" #include "components/attribution_reporting/event_trigger_data.h" @@ -44,6 +45,7 @@ using ::testing::ElementsAre; using ::testing::Field; using ::testing::IsEmpty; +using ::testing::Property; TriggerRegistration TriggerRegistrationWith( base::FunctionRef<void(TriggerRegistration&)> f) { @@ -84,8 +86,8 @@ Field(&TriggerRegistration::debug_reporting, false), Field(&TriggerRegistration::aggregation_coordinator_origin, absl::nullopt), - Field(&TriggerRegistration::source_registration_time_config, - SourceRegistrationTimeConfig::kExclude))), + Field(&TriggerRegistration::aggregatable_trigger_config, + AggregatableTriggerConfig()))), }, { "filters_valid", @@ -260,33 +262,28 @@ ErrorIs(TriggerRegistrationError::kAggregatableDedupKeyValueInvalid), }, { - "aggregatable_source_registration_time_include", + // Tested more thoroughly in + // `aggregatable_trigger_config_unittest.cc`. + "aggregatable_source_registration_time_valid", R"json({"aggregatable_source_registration_time":"include"})json", - ValueIs(Field(&TriggerRegistration::source_registration_time_config, - SourceRegistrationTimeConfig::kInclude)), + ValueIs(Field( + &TriggerRegistration::aggregatable_trigger_config, + Property( + &AggregatableTriggerConfig::source_registration_time_config, + SourceRegistrationTimeConfig::kInclude))), }, { - "aggregatable_source_registration_time_exclude", - R"json({"aggregatable_source_registration_time":"exclude"})json", - ValueIs(Field(&TriggerRegistration::source_registration_time_config, - SourceRegistrationTimeConfig::kExclude)), - }, - { - "aggregatable_source_registration_time_wrong_type", + // Tested more thoroughly in + // `aggregatable_trigger_config_unittest.cc`. + "aggregatable_source_registration_time_invalid", R"json({"aggregatable_source_registration_time":123})json", ErrorIs(TriggerRegistrationError:: kAggregatableSourceRegistrationTimeWrongType), }, - { - "aggregatable_source_registration_time_invalid_value", - R"json({"aggregatable_source_registration_time":"unknown"})json", - ErrorIs(TriggerRegistrationError:: - kAggregatableSourceRegistrationTimeUnknownValue), - }, }; static constexpr char kTriggerRegistrationErrorMetric[] = - "Conversions.TriggerRegistrationError8"; + "Conversions.TriggerRegistrationError9"; for (const auto& test_case : kTestCases) { SCOPED_TRACE(test_case.description); @@ -328,11 +325,12 @@ r.filters.positive = {*FilterConfig::Create({{{"b", {}}}})}; r.filters.negative = {*FilterConfig::Create( {{{"c", {}}}}, /*lookback_window=*/base::Seconds(2))}; - r.source_registration_time_config = - SourceRegistrationTimeConfig::kInclude; + r.aggregatable_trigger_config = *AggregatableTriggerConfig::Create( + SourceRegistrationTimeConfig::kExclude, + /*trigger_context_id=*/"123"); }), R"json({ - "aggregatable_source_registration_time": "include", + "aggregatable_source_registration_time": "exclude", "aggregatable_deduplication_keys": [{"deduplication_key":"1"}], "aggregatable_trigger_data": [{"key_piece":"0x0"}], "aggregatable_values": {"a": 2}, @@ -340,7 +338,8 @@ "debug_reporting": true, "event_trigger_data": [{"priority":"0","trigger_data":"0"}], "filters": [{"b": []}], - "not_filters": [{"c": [], "_lookback_window": 2}] + "not_filters": [{"c": [], "_lookback_window": 2}], + "trigger_context_id": "123" })json", }, }; @@ -380,7 +379,7 @@ }; static constexpr char kTriggerRegistrationErrorMetric[] = - "Conversions.TriggerRegistrationError8"; + "Conversions.TriggerRegistrationError9"; base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitAndEnableFeatureWithParameters(
diff --git a/components/autofill/android/java/src/org/chromium/components/autofill/AutofillProfile.java b/components/autofill/android/java/src/org/chromium/components/autofill/AutofillProfile.java index af57713f..fec5403a 100644 --- a/components/autofill/android/java/src/org/chromium/components/autofill/AutofillProfile.java +++ b/components/autofill/android/java/src/org/chromium/components/autofill/AutofillProfile.java
@@ -404,6 +404,7 @@ return getInfoStatus(ServerFieldType.ADDRESS_HOME_SORTING_CODE); } + @CalledByNative public String getCountryCode() { return getInfo(ServerFieldType.ADDRESS_HOME_COUNTRY); }
diff --git a/components/autofill/content/browser/test_autofill_client_injector.h b/components/autofill/content/browser/test_autofill_client_injector.h index 430e7916..8fc4693 100644 --- a/components/autofill/content/browser/test_autofill_client_injector.h +++ b/components/autofill/content/browser/test_autofill_client_injector.h
@@ -90,4 +90,4 @@ } // namespace autofill -#endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_TEST_AUTOFILL_MANAGER_INJECTOR_H_ +#endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_TEST_AUTOFILL_CLIENT_INJECTOR_H_
diff --git a/components/autofill/core/browser/address_normalization_manager_unittest.cc b/components/autofill/core/browser/address_normalization_manager_unittest.cc index 4eb9d67..b80a976 100644 --- a/components/autofill/core/browser/address_normalization_manager_unittest.cc +++ b/components/autofill/core/browser/address_normalization_manager_unittest.cc
@@ -38,7 +38,8 @@ TEST_F(AddressNormalizationManagerTest, SynchronousResult) { Initialize("en-US"); - AutofillProfile profile_to_normalize; + AutofillProfile profile_to_normalize( + i18n_model_definition::kLegacyHierarchyCountryCode); manager_->NormalizeAddressUntilFinalized(&profile_to_normalize); EXPECT_FALSE(completion_callback_called_); @@ -50,7 +51,8 @@ Initialize("en-US"); address_normalizer_.DelayNormalization(); - AutofillProfile profile_to_normalize; + AutofillProfile profile_to_normalize( + i18n_model_definition::kLegacyHierarchyCountryCode); manager_->NormalizeAddressUntilFinalized(&profile_to_normalize); EXPECT_FALSE(completion_callback_called_);
diff --git a/components/autofill/core/browser/address_profile_save_manager_unittest.cc b/components/autofill/core/browser/address_profile_save_manager_unittest.cc index 9cfeff1..322b0b7 100644 --- a/components/autofill/core/browser/address_profile_save_manager_unittest.cc +++ b/components/autofill/core/browser/address_profile_save_manager_unittest.cc
@@ -136,7 +136,8 @@ AutofillProfile observed_profile; bool is_prompt_expected; UserDecision user_decision; - AutofillProfile edited_profile{}; + AutofillProfile edited_profile{ + i18n_model_definition::kLegacyHierarchyCountryCode}; AutofillProfileImportType expected_import_type; bool is_profile_change_expected; absl::optional<AutofillProfile> merge_candidate; @@ -1205,7 +1206,8 @@ // Silent Update is enabled for the test. TEST_P(AddressProfileSaveManagerTest, SilentlyUpdateProfile_UpdateStructuredName) { - AutofillProfile updateable_profile; + AutofillProfile updateable_profile( + i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileTestValues( &updateable_profile, {{NAME_FULL, "AAA BBB CCC", VerificationStatus::kObserved}, @@ -1219,7 +1221,8 @@ {ADDRESS_HOME_ZIP, "99666", VerificationStatus::kObserved}, {ADDRESS_HOME_CITY, "Los Angeles", VerificationStatus::kObserved}}); - AutofillProfile observed_profile; + AutofillProfile observed_profile( + i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileTestValues( &observed_profile, {{NAME_FULL, "AAA BBB CCC", VerificationStatus::kObserved}, @@ -1255,7 +1258,8 @@ // Silent Update is enabled for the test. TEST_P(AddressProfileSaveManagerTest, SilentlyUpdateProfile_UpdateStructuredNameWithIncompleteProfile) { - AutofillProfile updateable_profile; + AutofillProfile updateable_profile( + i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileTestValues( &updateable_profile, {{NAME_FULL, "AAA BBB CCC", VerificationStatus::kObserved}, @@ -1269,7 +1273,8 @@ {ADDRESS_HOME_ZIP, "99666", VerificationStatus::kObserved}, {ADDRESS_HOME_CITY, "Los Angeles", VerificationStatus::kObserved}}); - AutofillProfile observed_profile; + AutofillProfile observed_profile( + i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileTestValues( &observed_profile, {{NAME_FULL, "AAA BBB CCC", VerificationStatus::kObserved}, @@ -1277,7 +1282,8 @@ {NAME_MIDDLE, "", VerificationStatus::kParsed}, {NAME_LAST, "BBB CCC", VerificationStatus::kParsed}}); - AutofillProfile final_profile; + AutofillProfile final_profile( + i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileTestValues( &final_profile, {{NAME_FULL, "AAA BBB CCC", VerificationStatus::kObserved},
diff --git a/components/autofill/core/browser/autofill_external_delegate.cc b/components/autofill/core/browser/autofill_external_delegate.cc index 55961b1..04e798ef 100644 --- a/components/autofill/core/browser/autofill_external_delegate.cc +++ b/components/autofill/core/browser/autofill_external_delegate.cc
@@ -581,7 +581,7 @@ manager_->FillOrPreviewField( mojom::ActionPersistence::kFill, mojom::TextReplacement::kReplaceAll, query_form_, query_field_, suggestion.main_text.value, - PopupItemId::kMerchantPromoCodeEntry); + suggestion.popup_item_id); manager_->OnSingleFieldSuggestionSelected(suggestion.main_text.value, suggestion.popup_item_id, query_form_, query_field_);
diff --git a/components/autofill/core/browser/autofill_external_delegate_unittest.cc b/components/autofill/core/browser/autofill_external_delegate_unittest.cc index 610b8dc..6760c404 100644 --- a/components/autofill/core/browser/autofill_external_delegate_unittest.cc +++ b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
@@ -75,6 +75,7 @@ using ::testing::Matcher; using ::testing::Mock; using ::testing::NiceMock; +using ::testing::Property; using ::testing::Return; using ::testing::SizeIs; using ::testing::StartsWith; @@ -88,45 +89,18 @@ "Autofill.PlusAddresses.Suggestion.Events"; // Creates a `PopupItemdId::kFieldByFieldFilling` suggestion. -// `profile_guid` is used to set `Suggestion::payload` as -// `Suggestion::Guid(profile_guid)`. This method also sets the -// `Suggestion::field_by_field_filling_type_used` to a default value of -// `NAME_FIRST`, which means that selecting this suggestion will fill the field -// with `NAME_FIRST` information stored in the profile that has `guid`. -Suggestion CreateFieldByFieldFillingSuggestion( - const std::string& profile_guid) { - Suggestion suggestion = test::CreateAutofillSuggestion( - PopupItemId::kFieldByFieldFilling, u"field by field", - Suggestion::Guid(profile_guid)); - // This is an arbitrary type. The delegate asserts the existence of - // `field_by_field_filling_type_used` for - // `PopupItemId::kFieldByFieldFilling` suggestions. - suggestion.field_by_field_filling_type_used = std::optional(NAME_FIRST); +// `guid` is used to set `Suggestion::payload` as +// `Suggestion::Guid(guid)`. This method also sets the +// `Suggestion::field_by_field_filling_type_used` to `fbf_type_used`. +Suggestion CreateFieldByFieldFillingSuggestion(const std::string& guid, + ServerFieldType fbf_type_used) { + Suggestion suggestion = + test::CreateAutofillSuggestion(PopupItemId::kFieldByFieldFilling, + u"field by field", Suggestion::Guid(guid)); + suggestion.field_by_field_filling_type_used = std::optional(fbf_type_used); return suggestion; } -// Matches a FillFieldLogEvent by equality of fields. Use FillEventId(-1) if -// you want to ignore the fill_event_id. -auto EqualsFillFieldLogEvent(const FillFieldLogEvent& expected) { - return AllOf(testing::Conditional( - expected.fill_event_id == FillEventId(-1), _, - Field("fill_event_id", &FillFieldLogEvent::fill_event_id, - expected.fill_event_id)), - Field("had_value_before_filling", - &FillFieldLogEvent::had_value_before_filling, - expected.had_value_before_filling), - Field("autofill_skipped_status", - &FillFieldLogEvent::autofill_skipped_status, - expected.autofill_skipped_status), - Field("was_autofilled", &FillFieldLogEvent::was_autofilled, - expected.was_autofilled), - Field("had_value_after_filling", - &FillFieldLogEvent::had_value_after_filling, - expected.had_value_after_filling), - Field("filling_method", &FillFieldLogEvent::filling_method, - expected.filling_method)); -} - Matcher<const AutofillTriggerDetails&> EqualsAutofilltriggerDetails( AutofillTriggerDetails details) { return AllOf( @@ -162,13 +136,6 @@ MockAutofillDriver& operator=(const MockAutofillDriver&) = delete; // Mock methods to enable testability. MOCK_METHOD(void, - ApplyFieldAction, - (mojom::ActionPersistence, - mojom::TextReplacement, - const FieldGlobalId&, - const std::u16string&), - (override)); - MOCK_METHOD(void, RendererShouldAcceptDataListSuggestion, (const FieldGlobalId&, const std::u16string&), (override)); @@ -290,6 +257,15 @@ const std::u16string& cvc, const AutofillTriggerDetails& trigger_details), (override)); + MOCK_METHOD(void, + FillOrPreviewField, + (mojom::ActionPersistence, + mojom::TextReplacement, + const FormData&, + const FormFieldData&, + const std::u16string&, + PopupItemId), + (override)); private: bool should_show_cards_from_account_option_ = false; @@ -338,6 +314,15 @@ kDefaultTriggerSource); } + Matcher<const FormData&> HasQueriedFormId() { + return Property(&FormData::global_id, queried_form_.global_id()); + } + + Matcher<const FormFieldData&> HasQueriedFieldId() { + return Property(&FormFieldData::global_id, + queried_form_triggering_field_id_); + } + void DestroyAutofillDriver() { autofill_driver_.reset(); } MockAutofillClient& client() { return autofill_client_; } @@ -717,7 +702,8 @@ queried_form_triggering_field_id_, autofill_item, kDefaultTriggerSource); EXPECT_CALL(manager(), FillOrPreviewProfileForm( - mojom::ActionPersistence::kFill, _, _, _, _)); + mojom::ActionPersistence::kFill, + HasQueriedFormId(), HasQueriedFieldId(), _, _)); EXPECT_CALL(client(), HideAutofillPopup(PopupHidingReason::kAcceptSuggestion)); @@ -980,18 +966,20 @@ suggestions, kDefaultTriggerSource); EXPECT_CALL(driver(), RendererShouldClearPreviewedForm()); - EXPECT_CALL(driver(), ApplyFieldAction(mojom::ActionPersistence::kPreview, - mojom::TextReplacement::kReplaceAll, - queried_form_triggering_field_id_, - masked_iban_value)); + EXPECT_CALL(manager(), + FillOrPreviewField(mojom::ActionPersistence::kPreview, + mojom::TextReplacement::kReplaceAll, + HasQueriedFormId(), HasQueriedFieldId(), + masked_iban_value, PopupItemId::kIbanEntry)); external_delegate().DidSelectSuggestion(suggestions[0], kDefaultTriggerSource); EXPECT_CALL(client(), HideAutofillPopup(PopupHidingReason::kAcceptSuggestion)); - EXPECT_CALL(driver(), ApplyFieldAction(mojom::ActionPersistence::kFill, - mojom::TextReplacement::kReplaceAll, - queried_form_triggering_field_id_, - unmasked_iban_value)); + EXPECT_CALL(manager(), + FillOrPreviewField(mojom::ActionPersistence::kFill, + mojom::TextReplacement::kReplaceAll, + HasQueriedFormId(), HasQueriedFieldId(), + unmasked_iban_value, PopupItemId::kIbanEntry)); external_delegate().DidAcceptSuggestion( suggestions[0], SuggestionPosition{.row = 0}, kDefaultTriggerSource); } @@ -1016,18 +1004,22 @@ suggestions, kDefaultTriggerSource); EXPECT_CALL(driver(), RendererShouldClearPreviewedForm()); - EXPECT_CALL(driver(), ApplyFieldAction(mojom::ActionPersistence::kPreview, - mojom::TextReplacement::kReplaceAll, - queried_form_triggering_field_id_, - promo_code_value)); + EXPECT_CALL(manager(), + FillOrPreviewField(mojom::ActionPersistence::kPreview, + mojom::TextReplacement::kReplaceAll, + HasQueriedFormId(), HasQueriedFieldId(), + promo_code_value, + PopupItemId::kMerchantPromoCodeEntry)); external_delegate().DidSelectSuggestion(suggestions[0], kDefaultTriggerSource); EXPECT_CALL(client(), HideAutofillPopup(PopupHidingReason::kAcceptSuggestion)); - EXPECT_CALL(driver(), ApplyFieldAction(mojom::ActionPersistence::kFill, - mojom::TextReplacement::kReplaceAll, - queried_form_triggering_field_id_, - promo_code_value)); + EXPECT_CALL(manager(), + FillOrPreviewField(mojom::ActionPersistence::kFill, + mojom::TextReplacement::kReplaceAll, + HasQueriedFormId(), HasQueriedFieldId(), + promo_code_value, + PopupItemId::kMerchantPromoCodeEntry)); external_delegate().DidAcceptSuggestion( suggestions[0], SuggestionPosition{.row = 0}, kDefaultTriggerSource); @@ -1058,7 +1050,8 @@ kDefaultTriggerSource); EXPECT_CALL(driver(), RendererShouldClearPreviewedForm()); EXPECT_CALL(manager(), FillOrPreviewProfileForm( - mojom::ActionPersistence::kPreview, _, _, _, _)); + mojom::ActionPersistence::kPreview, + HasQueriedFormId(), HasQueriedFieldId(), _, _)); const AutofillProfile profile = test::GetFullProfile(); pdm().AddProfile(profile); external_delegate().DidSelectSuggestion( @@ -1069,10 +1062,12 @@ // Ensure selecting an autocomplete entry will cause any previews to // get cleared. EXPECT_CALL(driver(), RendererShouldClearPreviewedForm()); - EXPECT_CALL(driver(), ApplyFieldAction(mojom::ActionPersistence::kPreview, - mojom::TextReplacement::kReplaceAll, - queried_form_triggering_field_id_, - std::u16string(u"baz foo"))); + EXPECT_CALL(manager(), + FillOrPreviewField(mojom::ActionPersistence::kPreview, + mojom::TextReplacement::kReplaceAll, + HasQueriedFormId(), HasQueriedFieldId(), + std::u16string(u"baz foo"), + PopupItemId::kAutocompleteEntry)); external_delegate().DidSelectSuggestion( test::CreateAutofillSuggestion(PopupItemId::kAutocompleteEntry, u"baz foo"), @@ -1084,7 +1079,8 @@ // get cleared. EXPECT_CALL(driver(), RendererShouldClearPreviewedForm()); EXPECT_CALL(manager(), FillOrPreviewCreditCardForm( - mojom::ActionPersistence::kPreview, _, _, _, _)); + mojom::ActionPersistence::kPreview, + HasQueriedFormId(), HasQueriedFieldId(), _, _)); Suggestion suggestion(PopupItemId::kVirtualCreditCardEntry); suggestion.payload = Suggestion::Guid(card.guid()); external_delegate().DidSelectSuggestion(suggestion, kDefaultTriggerSource); @@ -1163,7 +1159,7 @@ pdm().AddProfile(profile); const Suggestion suggestion = params.popup_item_id == PopupItemId::kFieldByFieldFilling - ? CreateFieldByFieldFillingSuggestion(profile.guid()) + ? CreateFieldByFieldFillingSuggestion(profile.guid(), NAME_FIRST) : test::CreateAutofillSuggestion(params.popup_item_id); manager().OnFormsSeen({queried_form_}, {}); base::HistogramTester histogram_tester; @@ -1216,7 +1212,7 @@ pdm().AddProfile(profile); const Suggestion suggestion = params.popup_item_id == PopupItemId::kFieldByFieldFilling - ? CreateFieldByFieldFillingSuggestion(profile.guid()) + ? CreateFieldByFieldFillingSuggestion(profile.guid(), NAME_FIRST) : test::CreateAutofillSuggestion(params.popup_item_id, u"baz foo", Suggestion::Guid(profile.guid())); auto expected_source = @@ -1228,7 +1224,8 @@ // Test preview EXPECT_CALL(manager(), FillOrPreviewProfileForm( - mojom::ActionPersistence::kPreview, _, _, _, + mojom::ActionPersistence::kPreview, HasQueriedFormId(), + HasQueriedFieldId(), _, EqualsAutofilltriggerDetails( {.trigger_source = expected_source, .field_types_to_fill = params.field_types_to_fill}))); @@ -1237,7 +1234,8 @@ // Test fill EXPECT_CALL(manager(), FillOrPreviewProfileForm( - mojom::ActionPersistence::kFill, _, _, _, + mojom::ActionPersistence::kFill, HasQueriedFormId(), + HasQueriedFieldId(), _, EqualsAutofilltriggerDetails( {.trigger_source = expected_source, .field_types_to_fill = params.field_types_to_fill}))); @@ -1255,10 +1253,12 @@ // Test that an accepted autofill suggestion will fill the form. TEST_F(AutofillExternalDelegateUnitTest, AcceptSuggestion) { + IssueOnQuery(); EXPECT_CALL(client(), HideAutofillPopup(PopupHidingReason::kAcceptSuggestion)); EXPECT_CALL(manager(), FillOrPreviewProfileForm( - mojom::ActionPersistence::kFill, _, _, _, _)); + mojom::ActionPersistence::kFill, + HasQueriedFormId(), HasQueriedFieldId(), _, _)); const AutofillProfile profile = test::GetFullProfile(); pdm().AddProfile(profile); @@ -1310,6 +1310,7 @@ TEST_F(AutofillExternalDelegateUnitTest, ExternalDelegateAccept_FillEverythingSuggestion_FillAndPreview) { + IssueOnQuery(); const AutofillProfile profile = test::GetFullProfile(); pdm().AddProfile(profile); const Suggestion suggestion = test::CreateAutofillSuggestion( @@ -1320,14 +1321,16 @@ HideAutofillPopup(PopupHidingReason::kAcceptSuggestion)); // Test fill EXPECT_CALL(manager(), FillOrPreviewProfileForm( - mojom::ActionPersistence::kFill, _, _, _, _)); + mojom::ActionPersistence::kFill, + HasQueriedFormId(), HasQueriedFieldId(), _, _)); external_delegate().DidAcceptSuggestion( suggestion, SuggestionPosition{.row = 2}, kDefaultTriggerSource); // Test preview EXPECT_CALL(manager(), FillOrPreviewProfileForm( - mojom::ActionPersistence::kPreview, _, _, _, _)); + mojom::ActionPersistence::kPreview, + HasQueriedFormId(), HasQueriedFieldId(), _, _)); external_delegate().DidSelectSuggestion(suggestion, kDefaultTriggerSource); } @@ -1335,6 +1338,7 @@ // Tests that when accepting a suggestion, the `AutofillSuggestionTriggerSource` // is converted to the correct `AutofillTriggerSource`. TEST_F(AutofillExternalDelegateUnitTest, AcceptSuggestion_TriggerSource) { + IssueOnQuery(); const AutofillProfile profile = test::GetFullProfile(); pdm().AddProfile(profile); Suggestion suggestion = test::CreateAutofillSuggestion( @@ -1354,7 +1358,8 @@ EXPECT_CALL( manager(), FillOrPreviewProfileForm( - mojom::ActionPersistence::kFill, _, _, _, + mojom::ActionPersistence::kFill, HasQueriedFormId(), + HasQueriedFieldId(), _, EqualsAutofilltriggerDetails({.trigger_source = expected_source}))); external_delegate().DidAcceptSuggestion( suggestion, SuggestionPosition{.row = 1}, suggestion_source); @@ -1366,7 +1371,8 @@ EXPECT_CALL( manager(), FillOrPreviewProfileForm( - mojom::ActionPersistence::kFill, _, _, _, + mojom::ActionPersistence::kFill, HasQueriedFormId(), + HasQueriedFieldId(), _, EqualsAutofilltriggerDetails({.trigger_source = expected_source}))); external_delegate().DidAcceptSuggestion( suggestion, SuggestionPosition{.row = 1}, suggestion_source); @@ -1380,9 +1386,7 @@ const AutofillProfile profile = test::GetFullProfile(); pdm().AddProfile(profile); Suggestion suggestion = - test::CreateAutofillSuggestion(PopupItemId::kFieldByFieldFilling, u"Jon", - Suggestion::Guid(profile.guid())); - suggestion.field_by_field_filling_type_used = std::optional(NAME_FIRST); + CreateFieldByFieldFillingSuggestion(profile.guid(), NAME_FIRST); IssueOnQuery(); manager().OnFormsSeen({queried_form_}, {}); base::HistogramTester histogram_tester; @@ -1401,9 +1405,7 @@ const AutofillProfile profile = test::GetFullProfile(); pdm().AddProfile(profile); Suggestion suggestion = - test::CreateAutofillSuggestion(PopupItemId::kFieldByFieldFilling, u"Jon", - Suggestion::Guid(profile.guid())); - suggestion.field_by_field_filling_type_used = std::optional(NAME_FIRST); + CreateFieldByFieldFillingSuggestion(profile.guid(), NAME_FIRST); IssueOnQuery(); manager().OnFormsSeen({queried_form_}, {}); base::HistogramTester histogram_tester; @@ -1421,17 +1423,17 @@ FieldByFieldFilling_PreviewCreditCard) { const CreditCard local_card = test::GetCreditCard(); pdm().AddCreditCard(local_card); - Suggestion suggestion = test::CreateAutofillSuggestion( - PopupItemId::kFieldByFieldFilling, u"Name on card", - Suggestion::Guid(local_card.guid())); - suggestion.field_by_field_filling_type_used = CREDIT_CARD_NAME_FULL; + Suggestion suggestion = CreateFieldByFieldFillingSuggestion( + local_card.guid(), CREDIT_CARD_NAME_FULL); IssueOnQuery(); manager().OnFormsSeen({queried_form_}, {}); - EXPECT_CALL(driver(), ApplyFieldAction(mojom::ActionPersistence::kPreview, - mojom::TextReplacement::kReplaceAll, - queried_form_triggering_field_id_, - suggestion.main_text.value)); + EXPECT_CALL(manager(), + FillOrPreviewField(mojom::ActionPersistence::kPreview, + mojom::TextReplacement::kReplaceAll, + HasQueriedFormId(), HasQueriedFieldId(), + suggestion.main_text.value, + PopupItemId::kFieldByFieldFilling)); external_delegate().DidSelectSuggestion( suggestion, AutofillSuggestionTriggerSource::kManualFallbackPayments); @@ -1440,17 +1442,17 @@ TEST_F(AutofillExternalDelegateUnitTest, FieldByFieldFilling_FillCreditCard) { const CreditCard local_card = test::GetCreditCard(); pdm().AddCreditCard(local_card); - Suggestion suggestion = test::CreateAutofillSuggestion( - PopupItemId::kFieldByFieldFilling, u"Name on card", - Suggestion::Guid(local_card.guid())); - suggestion.field_by_field_filling_type_used = CREDIT_CARD_NAME_FULL; + Suggestion suggestion = CreateFieldByFieldFillingSuggestion( + local_card.guid(), CREDIT_CARD_NAME_FULL); IssueOnQuery(); manager().OnFormsSeen({queried_form_}, {}); - EXPECT_CALL(driver(), ApplyFieldAction(mojom::ActionPersistence::kFill, - mojom::TextReplacement::kReplaceAll, - queried_form_triggering_field_id_, - suggestion.main_text.value)); + EXPECT_CALL(manager(), + FillOrPreviewField(mojom::ActionPersistence::kFill, + mojom::TextReplacement::kReplaceAll, + HasQueriedFormId(), HasQueriedFieldId(), + suggestion.main_text.value, + PopupItemId::kFieldByFieldFilling)); external_delegate().DidAcceptSuggestion( suggestion, SuggestionPosition{.row = 1}, @@ -1522,7 +1524,7 @@ ON_CALL(pdm(), IsAutofillProfileEnabled).WillByDefault(Return(true)); const Suggestion suggestion = params.popup_item_id == PopupItemId::kFieldByFieldFilling - ? CreateFieldByFieldFillingSuggestion(profile.guid()) + ? CreateFieldByFieldFillingSuggestion(profile.guid(), NAME_FIRST) : test::CreateAutofillSuggestion(params.popup_item_id); if (!params.is_preview) { @@ -1570,18 +1572,22 @@ suggestions, kDefaultTriggerSource); EXPECT_CALL(driver(), RendererShouldClearPreviewedForm()); - EXPECT_CALL(driver(), ApplyFieldAction(mojom::ActionPersistence::kPreview, - mojom::TextReplacement::kReplaceAll, - queried_form_triggering_field_id_, - plus_address)); + EXPECT_CALL( + manager(), + FillOrPreviewField(mojom::ActionPersistence::kPreview, + mojom::TextReplacement::kReplaceAll, + HasQueriedFormId(), HasQueriedFieldId(), plus_address, + PopupItemId::kFillExistingPlusAddress)); external_delegate().DidSelectSuggestion(suggestions[0], kDefaultTriggerSource); EXPECT_CALL(client(), HideAutofillPopup(PopupHidingReason::kAcceptSuggestion)); - EXPECT_CALL(driver(), ApplyFieldAction(mojom::ActionPersistence::kFill, - mojom::TextReplacement::kReplaceAll, - queried_form_triggering_field_id_, - plus_address)); + EXPECT_CALL( + manager(), + FillOrPreviewField(mojom::ActionPersistence::kFill, + mojom::TextReplacement::kReplaceAll, + HasQueriedFormId(), HasQueriedFieldId(), plus_address, + PopupItemId::kFillExistingPlusAddress)); external_delegate().DidAcceptSuggestion( suggestions[0], SuggestionPosition{.row = 0}, kDefaultTriggerSource); EXPECT_THAT( @@ -1628,10 +1634,12 @@ // `kMockPlusAddressForCreationCallback` is returned in the callback from the // mocked `OfferPlusAddressCreation()`. Ensure it is filled (vs, say, the // empty text of the suggestion). - EXPECT_CALL(driver(), ApplyFieldAction(mojom::ActionPersistence::kFill, - mojom::TextReplacement::kReplaceAll, - queried_form_triggering_field_id_, - kMockPlusAddressForCreationCallback)); + EXPECT_CALL(manager(), + FillOrPreviewField(mojom::ActionPersistence::kFill, + mojom::TextReplacement::kReplaceAll, + HasQueriedFormId(), HasQueriedFieldId(), + kMockPlusAddressForCreationCallback, + PopupItemId::kCreateNewPlusAddress)); external_delegate().DidAcceptSuggestion( suggestions[0], SuggestionPosition{.row = 0}, kDefaultTriggerSource); EXPECT_THAT( @@ -1672,11 +1680,11 @@ ASSERT_TRUE(callback); const std::u16string kComposeResponse = u"Cucumbers are tasty."; - EXPECT_CALL( - driver(), - ApplyFieldAction(mojom::ActionPersistence::kFill, - mojom::TextReplacement::kReplaceSelection, - queried_form_triggering_field_id_, kComposeResponse)); + EXPECT_CALL(manager(), + FillOrPreviewField(mojom::ActionPersistence::kFill, + mojom::TextReplacement::kReplaceSelection, + HasQueriedFormId(), HasQueriedFieldId(), + kComposeResponse, PopupItemId::kCompose)); std::move(callback).Run(kComposeResponse); } @@ -1847,10 +1855,12 @@ base::HistogramTester histogram_tester; std::u16string dummy_autocomplete_string(u"autocomplete"); - EXPECT_CALL(driver(), ApplyFieldAction(mojom::ActionPersistence::kFill, - mojom::TextReplacement::kReplaceAll, - queried_form_triggering_field_id_, - dummy_autocomplete_string)); + EXPECT_CALL(manager(), + FillOrPreviewField(mojom::ActionPersistence::kFill, + mojom::TextReplacement::kReplaceAll, + HasQueriedFormId(), HasQueriedFieldId(), + dummy_autocomplete_string, + PopupItemId::kAutocompleteEntry)); EXPECT_CALL(*client().GetMockAutocompleteHistoryManager(), OnSingleFieldSuggestionSelected(dummy_autocomplete_string, PopupItemId::kAutocompleteEntry)); @@ -1871,10 +1881,12 @@ IssueOnQuery(); std::u16string dummy_promo_code_string(u"merchant promo"); - EXPECT_CALL(driver(), ApplyFieldAction(mojom::ActionPersistence::kFill, - mojom::TextReplacement::kReplaceAll, - queried_form_triggering_field_id_, - dummy_promo_code_string)); + EXPECT_CALL(manager(), + FillOrPreviewField(mojom::ActionPersistence::kFill, + mojom::TextReplacement::kReplaceAll, + HasQueriedFormId(), HasQueriedFieldId(), + dummy_promo_code_string, + PopupItemId::kMerchantPromoCodeEntry)); EXPECT_CALL( *client().GetMockMerchantPromoCodeManager(), OnSingleFieldSuggestionSelected(dummy_promo_code_string, @@ -1894,10 +1906,11 @@ std::u16string masked_iban_value = u"IE12 **** **** **** **56 78"; std::u16string unmasked_iban_value = u"IE12 BOFI 9000 0112 3456 78"; - EXPECT_CALL(driver(), ApplyFieldAction(mojom::ActionPersistence::kFill, - mojom::TextReplacement::kReplaceAll, - queried_form_triggering_field_id_, - unmasked_iban_value)); + EXPECT_CALL(manager(), + FillOrPreviewField(mojom::ActionPersistence::kFill, + mojom::TextReplacement::kReplaceAll, + HasQueriedFormId(), HasQueriedFieldId(), + unmasked_iban_value, PopupItemId::kIbanEntry)); EXPECT_CALL(*client().GetMockIbanManager(), OnSingleFieldSuggestionSelected(masked_iban_value, PopupItemId::kIbanEntry)); @@ -1915,56 +1928,22 @@ pdm().AddProfile(profile); IssueOnQuery(); manager().OnFormsSeen({queried_form_}, {}); - Suggestion suggestion = CreateFieldByFieldFillingSuggestion(profile.guid()); + Suggestion suggestion = + CreateFieldByFieldFillingSuggestion(profile.guid(), NAME_FIRST); EXPECT_CALL(client(), HideAutofillPopup(PopupHidingReason::kAcceptSuggestion)); EXPECT_CALL( - driver(), - ApplyFieldAction( + manager(), + FillOrPreviewField( mojom::ActionPersistence::kFill, mojom::TextReplacement::kReplaceAll, - queried_form_triggering_field_id_, - profile.GetRawInfo(*suggestion.field_by_field_filling_type_used))); + HasQueriedFormId(), HasQueriedFieldId(), + profile.GetRawInfo(*suggestion.field_by_field_filling_type_used), + PopupItemId::kFieldByFieldFilling)); external_delegate().DidAcceptSuggestion( suggestion, SuggestionPosition{.row = 0}, kDefaultTriggerSource); } -TEST_F(AutofillExternalDelegateUnitTest, - ExternalDelegate_FieldByFieldFilling_LogFillFieldEvent) { - base::test::ScopedFeatureList features( - features::kAutofillGranularFillingAvailable); - const AutofillProfile profile = test::GetFullProfile(); - pdm().AddProfile(profile); - EXPECT_CALL(client(), - HideAutofillPopup(PopupHidingReason::kAcceptSuggestion)); - IssueOnQuery(); - manager().OnFormsSeen({queried_form_}, {}); - external_delegate().DidAcceptSuggestion( - CreateFieldByFieldFillingSuggestion(profile.guid()), - SuggestionPosition{.row = 0}, kDefaultTriggerSource); - const std::vector<AutofillField::FieldLogEventType>& log_events = - get_triggering_autofill_field()->field_log_events(); - - // We only expect one `FillFieldLogEvent` for this field. - size_t count_fill_field_log_event = 0; - for (const auto& event : log_events) { - if (absl::holds_alternative<FillFieldLogEvent>(event)) { - ++count_fill_field_log_event; - EXPECT_THAT( - absl::get<FillFieldLogEvent>(event), - EqualsFillFieldLogEvent(FillFieldLogEvent{ - .fill_event_id = FillEventId(-1), - .had_value_before_filling = OptionalBoolean::kFalse, - .autofill_skipped_status = FieldFillingSkipReason::kNotSkipped, - .was_autofilled = OptionalBoolean::kTrue, - .had_value_after_filling = OptionalBoolean::kTrue, - .filling_method = AutofillFillingMethod::kFieldByFieldFilling, - })); - } - } - EXPECT_EQ(count_fill_field_log_event, 1u); -} - TEST_F(AutofillExternalDelegateUnitTest, ShouldShowGooglePayIcon) { IssueOnQuery(); @@ -2035,11 +2014,13 @@ // Test that browser autofill manager will handle the unmasking request for the // virtual card after users accept the suggestion to use a virtual card. TEST_F(AutofillExternalDelegateUnitTest, AcceptVirtualCardOptionItem) { + IssueOnQuery(); FormData form; CreditCard card = test::GetMaskedServerCard(); pdm().AddCreditCard(card); EXPECT_CALL(manager(), FillOrPreviewCreditCardForm( - mojom::ActionPersistence::kFill, _, _, _, _)); + mojom::ActionPersistence::kFill, + HasQueriedFormId(), HasQueriedFieldId(), _, _)); Suggestion suggestion(PopupItemId::kVirtualCreditCardEntry); suggestion.payload = Suggestion::Guid(card.guid()); external_delegate().DidAcceptSuggestion( @@ -2047,10 +2028,12 @@ } TEST_F(AutofillExternalDelegateUnitTest, SelectVirtualCardOptionItem) { + IssueOnQuery(); CreditCard card = test::GetMaskedServerCard(); pdm().AddCreditCard(card); EXPECT_CALL(manager(), FillOrPreviewCreditCardForm( - mojom::ActionPersistence::kPreview, _, _, _, _)); + mojom::ActionPersistence::kPreview, + HasQueriedFormId(), HasQueriedFieldId(), _, _)); Suggestion suggestion(PopupItemId::kVirtualCreditCardEntry); suggestion.payload = Suggestion::Guid(card.guid()); external_delegate().DidSelectSuggestion(suggestion, kDefaultTriggerSource);
diff --git a/components/autofill/core/browser/autofill_granular_filling_utils.h b/components/autofill/core/browser/autofill_granular_filling_utils.h index 4fcc6a87..d02a9159 100644 --- a/components/autofill/core/browser/autofill_granular_filling_utils.h +++ b/components/autofill/core/browser/autofill_granular_filling_utils.h
@@ -54,4 +54,4 @@ } // namespace autofill -#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_GRANULAR_FILLING_UTILS_H_ +#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_GRANULAR_FILLING_UTILS_H_
diff --git a/components/autofill/core/browser/autofill_profile_import_process_unittest.cc b/components/autofill/core/browser/autofill_profile_import_process_unittest.cc index 6c571b4c..d4f2d5c 100644 --- a/components/autofill/core/browser/autofill_profile_import_process_unittest.cc +++ b/components/autofill/core/browser/autofill_profile_import_process_unittest.cc
@@ -64,7 +64,8 @@ // Test that two subsequently created `ProfileImportProcess`s have distinct ids. TEST_F(AutofillProfileImportProcessTest, DistinctIds) { - AutofillProfile empty_profile; + AutofillProfile empty_profile( + i18n_model_definition::kLegacyHierarchyCountryCode); ProfileImportProcess import_data1(empty_profile, "en_US", url_, &personal_data_manager_, /*allow_only_silent_updates=*/false);
diff --git a/components/autofill/core/browser/autofill_suggestion_generator_unittest.cc b/components/autofill/core/browser/autofill_suggestion_generator_unittest.cc index acd7edc..e513adb 100644 --- a/components/autofill/core/browser/autofill_suggestion_generator_unittest.cc +++ b/components/autofill/core/browser/autofill_suggestion_generator_unittest.cc
@@ -249,7 +249,8 @@ // field input with the available emails to suggest. TEST_F(AutofillSuggestionGeneratorTest, GetProfilesToSuggest_UseSpecialCharactersInEmail) { - AutofillProfile profile_1, profile_2; + AutofillProfile profile_1(i18n_model_definition::kLegacyHierarchyCountryCode); + AutofillProfile profile_2(i18n_model_definition::kLegacyHierarchyCountryCode); profile_1.SetRawInfo(EMAIL_ADDRESS, u"test@email.xyz"); profile_2.SetRawInfo(EMAIL_ADDRESS, u"test1@email.xyz"); personal_data()->AddProfile(profile_1); @@ -265,7 +266,7 @@ } TEST_F(AutofillSuggestionGeneratorTest, GetProfilesToSuggest_HideSubsets) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.\nSecond Line\nThird line", "unit 5", @@ -310,7 +311,7 @@ for (size_t i = 0; i < 2 * AutofillSuggestionGenerator::kMaxUniqueSuggestedProfilesCount; i++) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, base::StringPrintf("Marion%zu", i).c_str(), "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.\nSecond Line\nThird line", "unit 5", @@ -335,7 +336,7 @@ std::vector<AutofillProfile> profiles; for (size_t i = 0; i < AutofillSuggestionGenerator::kMaxSuggestedProfilesCount; i++) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo( &profile, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", @@ -353,7 +354,7 @@ } // Add another profile that matches, but that will get stripped out. - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Marie", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "000 Zoo St.\nSecond Line\nThird line", "unit 5", @@ -378,7 +379,7 @@ TEST_F(AutofillSuggestionGeneratorTest, GetProfilesToSuggest_Ranking) { // Set up the profiles. They are named with number suffixes X so the X is the // order in which they should be ordered by the ranking formula. - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Marion3", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.\nSecond Line\nThird line", "unit 5", @@ -387,7 +388,7 @@ profile3.set_use_count(5); personal_data()->AddProfile(profile3); - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Marion1", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.\nSecond Line\nThird line", "unit 5", @@ -396,7 +397,7 @@ profile1.set_use_count(10); personal_data()->AddProfile(profile1); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Marion2", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.\nSecond Line\nThird line", "unit 5", @@ -418,21 +419,21 @@ TEST_F(AutofillSuggestionGeneratorTest, GetProfilesToSuggest_NumberOfSuggestions) { // Set up 3 different profiles. - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Marion1", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.\nSecond Line\nThird line", "unit 5", "Hollywood", "CA", "91601", "US", "12345678910"); personal_data()->AddProfile(profile1); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Marion2", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.\nSecond Line\nThird line", "unit 5", "Hollywood", "CA", "91601", "US", "12345678910"); personal_data()->AddProfile(profile2); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Marion3", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.\nSecond Line\nThird line", "unit 5", @@ -450,12 +451,12 @@ TEST_F(AutofillSuggestionGeneratorTest, GetProfilesToSuggest_PhoneNumberDeduplication) { // Set up 2 different profiles. - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); profile1.SetRawInfo(NAME_FULL, u"First Middle Last"); profile1.SetRawInfo(PHONE_HOME_WHOLE_NUMBER, u"+491601234567"); personal_data()->AddProfile(profile1); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); profile2.SetRawInfo(NAME_FULL, u"First Middle Last"); profile2.SetRawInfo(PHONE_HOME_WHOLE_NUMBER, u"+491607654321"); personal_data()->AddProfile(profile2); @@ -496,7 +497,7 @@ TEST_F(AutofillSuggestionGeneratorTest, GetProfilesToSuggest_SuppressDisusedProfilesOnEmptyField) { // Set up 2 different profiles. - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Marion1", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.\nSecond Line\nThird line", "unit 5", @@ -504,7 +505,7 @@ profile1.set_use_date(AutofillClock::Now() - base::Days(200)); personal_data()->AddProfile(profile1); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Marion2", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "456 Zoo St.\nSecond Line\nThird line", "unit 5", @@ -566,7 +567,8 @@ // Given two suggestions with the same name and one with a different, and also // last name field to compare, Expect all profiles listed as unique suggestions. TEST_F(AutofillSuggestionGeneratorTest, GetProfilesToSuggest_MultipleDedupe) { - std::vector<AutofillProfile> profiles(3); + std::vector<AutofillProfile> profiles( + 3, AutofillProfile(i18n_model_definition::kLegacyHierarchyCountryCode)); profiles[0].SetRawInfo(NAME_FIRST, u"Bob"); profiles[0].SetRawInfo(NAME_LAST, u"Morrison"); profiles[0].set_use_count(10); @@ -595,7 +597,7 @@ for (size_t i = 0; i < AutofillSuggestionGenerator::kMaxUniqueSuggestedProfilesCount + 1; i++) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfo(NAME_FULL, base::UTF8ToUTF16(base::StringPrintf("Bob %zu Doe", i))); profile.set_use_count( @@ -630,12 +632,12 @@ TEST_F(AutofillSuggestionGeneratorTest, GetProfilesToSuggest_kAccountPrecedence) { // Create two profiles that only differ by their source. - AutofillProfile profile_1; + AutofillProfile profile_1(i18n_model_definition::kLegacyHierarchyCountryCode); profile_1.SetRawInfo(NAME_FULL, u"First Last"); profile_1.set_source_for_testing(AutofillProfile::Source::kAccount); personal_data()->AddProfile(profile_1); - AutofillProfile profile_2; + AutofillProfile profile_2(i18n_model_definition::kLegacyHierarchyCountryCode); profile_2.SetRawInfo(NAME_FULL, u"First Last"); profile_2.set_source_for_testing(AutofillProfile::Source::kLocalOrSyncable); // Set high use count for profile 2 so that it has greater ranking than @@ -655,11 +657,13 @@ TEST_F(AutofillSuggestionGeneratorTest, GetProfilesToSuggest_GetMatchingProfile) { - AutofillProfile marion_profile; + AutofillProfile marion_profile( + i18n_model_definition::kLegacyHierarchyCountryCode); marion_profile.SetRawInfo(NAME_FIRST, u"Marion"); personal_data()->AddProfile(marion_profile); - AutofillProfile bob_profile; + AutofillProfile bob_profile( + i18n_model_definition::kLegacyHierarchyCountryCode); bob_profile.SetRawInfo(NAME_FIRST, u"Bob"); personal_data()->AddProfile(bob_profile); @@ -673,7 +677,8 @@ TEST_F(AutofillSuggestionGeneratorTest, GetProfilesToSuggest_NoMatchingProfile) { - AutofillProfile bob_profile; + AutofillProfile bob_profile( + i18n_model_definition::kLegacyHierarchyCountryCode); bob_profile.SetRawInfo(NAME_FIRST, u"Bob"); personal_data()->AddProfile(bob_profile); @@ -706,7 +711,9 @@ // Set up the profile vectors with last use dates ranging from `kCurrentTime` // to 270 days ago, in 30 day increments. - std::vector<AutofillProfile> profiles(kNumProfiles); + std::vector<AutofillProfile> profiles( + kNumProfiles, + AutofillProfile(i18n_model_definition::kLegacyHierarchyCountryCode)); for (size_t i = 0; i < kNumProfiles; ++i) { profiles[i].SetRawInfo( NAME_FULL, base::UTF8ToUTF16(base::StringPrintf("Bob %zu Doe", i))); @@ -732,7 +739,7 @@ } TEST_F(AutofillSuggestionGeneratorTest, CreateSuggestionsFromProfiles) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.\nSecond Line\nThird line", "unit 5", @@ -754,7 +761,7 @@ scoped_features.InitAndDisableFeature( features::kAutofillUseImprovedLabelDisambiguation); - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.\nSecond Line\nThird line", "unit 5", @@ -772,7 +779,7 @@ #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) TEST_F(AutofillSuggestionGeneratorTest, CreateSuggestionsFromProfiles_LogProfileSuggestionsMadeWithFormatter) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Hoa", "", "Pham", "hoa.pham@comcast.net", "", "401 Merrimack St", "", "Lowell", "MA", "01852", "US", "19786744120"); @@ -799,7 +806,7 @@ #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) TEST_F(AutofillSuggestionGeneratorTest, CreateSuggestionsFromProfiles_ForContactForm) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Hoa", "", "Pham", "hoa.pham@comcast.net", "", "401 Merrimack St", "", "Lowell", "MA", "01852", "US", "19786744120"); @@ -825,7 +832,7 @@ #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) TEST_F(AutofillSuggestionGeneratorTest, CreateSuggestionsFromProfiles_AddressForm) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Hoa", "", "Pham", "hoa.pham@comcast.net", "", "401 Merrimack St", "", "Lowell", "MA", "01852", "US", "19786744120"); @@ -851,7 +858,7 @@ #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) TEST_F(AutofillSuggestionGeneratorTest, CreateSuggestionsFromProfiles_AddressPhoneForm) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Hoa", "", "Pham", "hoa.pham@comcast.net", "", "401 Merrimack St", "", "Lowell", "MA", "01852", "US", "19786744120"); @@ -877,7 +884,7 @@ #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) TEST_F(AutofillSuggestionGeneratorTest, CreateSuggestionsFromProfiles_AddressEmailForm) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Hoa", "", "Pham", "hoa.pham@comcast.net", "", "401 Merrimack St", "", "Lowell", "MA", "01852", "US", "19786744120"); @@ -902,7 +909,7 @@ #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) TEST_F(AutofillSuggestionGeneratorTest, CreateSuggestionsFromProfiles_FormWithOneProfile) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Hoa", "", "Pham", "hoa.pham@comcast.net", "", "401 Merrimack St", "", "Lowell", "MA", "01852", "US", "19786744120"); @@ -935,12 +942,12 @@ features::kAutofillUseImprovedLabelDisambiguation}, /*disabled_features=*/{}); - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Hoa", "", "Pham", "hoa.pham@comcast.net", "", "401 Merrimack St", "", "Lowell", "MA", "01852", "US", "19786744120"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Hoa", "", "Pham", "hp@aol.com", "", "216 Broadway St", "", "Lowell", "MA", "01854", "US", "19784523366"); @@ -976,11 +983,11 @@ scoped_features.InitAndEnableFeatureWithParameters( features::kAutofillUseMobileLabelDisambiguation, parameters); - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Hoa", "", "Pham", "hoa.pham@comcast.net", "", "401 Merrimack St", "", "Lowell", "MA", "01852", "US", "19786744120"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "María", "", "Lòpez", "maria@aol.com", "", "11 Elkins St", "", "Boston", "MA", "02127", "US", "6172686862"); @@ -1032,11 +1039,11 @@ scoped_features.InitAndEnableFeatureWithParameters( features::kAutofillUseMobileLabelDisambiguation, parameters); - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Hoa", "", "Pham", "hoa.pham@comcast.net", "", "401 Merrimack St", "", "Lowell", "MA", "01852", "US", "19786744120"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "María", "", "Lòpez", "maria@aol.com", "", "11 Elkins St", "", "Boston", "MA", "02127", "US", "6172686862"); @@ -1524,7 +1531,7 @@ TEST_F( AutofillChildrenSuggestionsGenenarationTest, CreateSuggestionsFromProfiles_ChildrenSuggestions_HouseNumberAndStreetNameCanBeNestedUnderDifferentAddressLines) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); // Update the profile to have house number and street name information in // different address lines. profile.SetRawInfo(ADDRESS_HOME_LINE1, u"Amphitheatre Parkway, Brookling"); @@ -1572,7 +1579,8 @@ // the test if it is not needed. TEST_F(AutofillSuggestionGeneratorTest, CreateSuggestionsFromProfiles_DiscardDuplicateSuggestions) { - std::vector<AutofillProfile> profiles(3); + std::vector<AutofillProfile> profiles( + 3, AutofillProfile(i18n_model_definition::kLegacyHierarchyCountryCode)); for (AutofillProfile& profile : profiles) { profile.SetRawInfo(NAME_FULL, u"Jon Snow"); profile.SetRawInfo(ADDRESS_HOME_STREET_ADDRESS, u"2 Beyond-the-Wall Rd"); @@ -1608,14 +1616,14 @@ // the test if it is not needed. TEST_F(AutofillSuggestionGeneratorTest, CreateSuggestionsFromProfiles_KeepNonDuplicateSuggestions) { - AutofillProfile profile_1; + AutofillProfile profile_1(i18n_model_definition::kLegacyHierarchyCountryCode); profile_1.SetRawInfo(NAME_FIRST, u"Sansa"); profile_1.SetRawInfo(ADDRESS_HOME_STREET_ADDRESS, u"1 Winterfell Ln"); - AutofillProfile profile_2; + AutofillProfile profile_2(i18n_model_definition::kLegacyHierarchyCountryCode); profile_2.SetRawInfo(NAME_FIRST, u"Sansa"); - AutofillProfile profile_3; + AutofillProfile profile_3(i18n_model_definition::kLegacyHierarchyCountryCode); profile_3.SetRawInfo(NAME_FIRST, u"Brienne"); profile_3.SetRawInfo(ADDRESS_HOME_STREET_ADDRESS, u"1 Winterfell Ln"); @@ -1652,7 +1660,7 @@ // the test if it is not needed. TEST_F(AutofillSuggestionGeneratorTest, CreateSuggestionsFromProfiles_SameStringInValueAndLabel) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfo(ADDRESS_HOME_STREET_ADDRESS, u"Mañana Road"); profile.SetRawInfo(ADDRESS_HOME_STREET_NAME, u"manana road");
diff --git a/components/autofill/core/browser/autofill_test_utils.cc b/components/autofill/core/browser/autofill_test_utils.cc index d8ad286..2ca50d4 100644 --- a/components/autofill/core/browser/autofill_test_utils.cc +++ b/components/autofill/core/browser/autofill_test_utils.cc
@@ -655,6 +655,9 @@ const char* phone, bool finalize, VerificationStatus status) { + // Set the country first to ensure that the proper address model is used. + check_and_set(profile, ADDRESS_HOME_COUNTRY, country, status); + check_and_set(profile, NAME_FIRST, first_name, status); check_and_set(profile, NAME_MIDDLE, middle_name, status); check_and_set(profile, NAME_LAST, last_name, status); @@ -665,7 +668,6 @@ check_and_set(profile, ADDRESS_HOME_CITY, city, status); check_and_set(profile, ADDRESS_HOME_STATE, state, status); check_and_set(profile, ADDRESS_HOME_ZIP, zipcode, status); - check_and_set(profile, ADDRESS_HOME_COUNTRY, country, status); check_and_set(profile, PHONE_HOME_WHOLE_NUMBER, phone, status); if (finalize) profile->FinalizeAfterImport();
diff --git a/components/autofill/core/browser/browser_autofill_manager_unittest.cc b/components/autofill/core/browser/browser_autofill_manager_unittest.cc index ed24393..f0ff7e92 100644 --- a/components/autofill/core/browser/browser_autofill_manager_unittest.cc +++ b/components/autofill/core/browser/browser_autofill_manager_unittest.cc
@@ -145,6 +145,120 @@ const std::string_view kPlusAddressSuggestionMetric = "Autofill.PlusAddresses.Suggestion.Events"; +bool ShouldSplitCardNameAndLastFourDigitsForMetadata() { + // Splitting card name and last four logic does not apply to iOS because the + // AutofillSuggestionGenerator on iOS doesn't currently support it. +#if BUILDFLAG(IS_IOS) + return false; +#else + return base::FeatureList::IsEnabled( + features::kAutofillEnableVirtualCardMetadata) && + base::FeatureList::IsEnabled( + features::kAutofillEnableCardProductName) && + base::FeatureList::IsEnabled(features::kAutofillEnableCardArtImage); +#endif +} + +// The number of obfuscation dots we use as a prefix when showing a credit +// card's last four. +int ObfuscationLengthForCreditCardLastFourDigits() { +#if BUILDFLAG(IS_ANDROID) + return 2; +#elif BUILDFLAG(IS_IOS) + return base::FeatureList::IsEnabled( + features::kAutofillUseTwoDotsForLastFourDigits) + ? 2 + : 4; +#else + return 4; +#endif +} + +// Generates credit card suggestion labels. If metadata is enabled, we produce +// shortened labels regardless of whether there is card metadata or not. +std::vector<std::vector<Suggestion::Text>> GenerateLabelsFromCreditCard( + CreditCard& card) { + std::vector<std::vector<Suggestion::Text>> suggestion_labels; + +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) + // Android and iOS do not adhere to card label splitting. + suggestion_labels = { + {Suggestion::Text(card.ObfuscatedNumberWithVisibleLastFourDigits( + ObfuscationLengthForCreditCardLastFourDigits()))}}; +#else + if (ShouldSplitCardNameAndLastFourDigitsForMetadata()) { + // First label contains card name details and second label contains + // obfuscated last four. + suggestion_labels = { + {Suggestion::Text(card.CardNameForAutofillDisplay(), + Suggestion::Text::IsPrimary(false), + Suggestion::Text::ShouldTruncate(true)), + Suggestion::Text(card.ObfuscatedNumberWithVisibleLastFourDigits( + ObfuscationLengthForCreditCardLastFourDigits()))}}; + } else { + // Desktop uses the descriptive label. + suggestion_labels = { + {Suggestion::Text(card.CardIdentifierStringAndDescriptiveExpiration( + /*app_locale=*/"en-US"))}}; + } +#endif + return suggestion_labels; +} + +Suggestion GenerateSuggestionFromCardDetails( + const std::string& network, + const Suggestion::Icon icon, + const std::string& last_four, + std::string expiration_date_label, + const std::string& nickname = std::string()) { + const std::string& network_or_nickname = + nickname.empty() + ? base::UTF16ToUTF8(CreditCard::NetworkForDisplay(network)) + : nickname; + if (ShouldSplitCardNameAndLastFourDigitsForMetadata()) { + return Suggestion( + network_or_nickname, + test::ObfuscatedCardDigitsAsUTF8( + last_four, ObfuscationLengthForCreditCardLastFourDigits()), + expiration_date_label, icon, PopupItemId::kCreditCardEntry); + } else { +#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) + // We use a longer label on desktop platforms. + expiration_date_label = std::string("Expires on ") + expiration_date_label; +#endif + return Suggestion( + base::StrCat( + {network_or_nickname, std::string(" "), + test::ObfuscatedCardDigitsAsUTF8( + last_four, ObfuscationLengthForCreditCardLastFourDigits())}), + expiration_date_label, icon, PopupItemId::kCreditCardEntry); + } +} + +Suggestion GetCardSuggestion(const std::string& network, + const std::string& nickname = std::string()) { + Suggestion::Icon icon = Suggestion::Icon::kCardGeneric; + std::string last_four; + std::string expiration_date; + if (network == kVisaCard) { + icon = Suggestion::Icon::kCardVisa; + last_four = "3456"; + expiration_date = "04/99"; + } else if (network == kMasterCard) { + icon = Suggestion::Icon::kCardMasterCard; + last_four = "8765"; + expiration_date = "10/98"; + } else if (network == kAmericanExpressCard) { + icon = Suggestion::Icon::kCardAmericanExpress; + last_four = "0005"; + expiration_date = "04/10"; + } else { + NOTREACHED_NORETURN(); + } + return GenerateSuggestionFromCardDetails(network, icon, last_four, + expiration_date, nickname); +} + struct TestAddressFillData { TestAddressFillData(const char* first, const char* middle, @@ -240,6 +354,28 @@ "RCA"}; } +// Matches a FillFieldLogEvent by equality of fields. Use FillEventId(-1) if +// you want to ignore the fill_event_id. +auto EqualsFillFieldLogEvent(const FillFieldLogEvent& expected) { + return AllOf(testing::Conditional( + expected.fill_event_id == FillEventId(-1), _, + Field("fill_event_id", &FillFieldLogEvent::fill_event_id, + expected.fill_event_id)), + Field("had_value_before_filling", + &FillFieldLogEvent::had_value_before_filling, + expected.had_value_before_filling), + Field("autofill_skipped_status", + &FillFieldLogEvent::autofill_skipped_status, + expected.autofill_skipped_status), + Field("was_autofilled", &FillFieldLogEvent::was_autofilled, + expected.was_autofilled), + Field("had_value_after_filling", + &FillFieldLogEvent::had_value_after_filling, + expected.had_value_after_filling), + Field("filling_method", &FillFieldLogEvent::filling_method, + expected.filling_method)); +} + // Creates a GUID for testing. For example, // MakeGuid(123) = "00000000-0000-0000-0000-000000000123"; std::string MakeGuid(size_t last_digit) { @@ -349,7 +485,7 @@ }; AutofillProfile FillDataToAutofillProfile(const TestAddressFillData& data) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, data.first, data.middle, data.last, data.email, data.company, data.address1, data.address2, data.city, data.state, data.postal_code, data.country_short, @@ -1133,24 +1269,12 @@ return ElementsAreArray(matchers); } - virtual int ObfuscationLength() { -#if BUILDFLAG(IS_ANDROID) - return 2; -#elif BUILDFLAG(IS_IOS) - return base::FeatureList::IsEnabled( - features::kAutofillUseTwoDotsForLastFourDigits) - ? 2 - : 4; -#else - return 4; -#endif - } - // Always show only the `last_four` digits. std::string MakeCardLabel(const std::string& nickname, const std::string& last_four) { return nickname + " " + - test::ObfuscatedCardDigitsAsUTF8(last_four, ObfuscationLength()); + test::ObfuscatedCardDigitsAsUTF8( + last_four, ObfuscationLengthForCreditCardLastFourDigits()); } TestPersonalDataManager& personal_data() { @@ -1202,14 +1326,16 @@ profile1.set_guid(kElvisProfileGuid); personal_data().AddProfile(profile1); - AutofillProfile profile2; + AutofillProfile profile2( + i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Charles", "Hardin", "Holley", "buddy@gmail.com", "Decca", "123 Apple St.", "unit 6", "Lubbock", "Texas", "79401", "US", "23456789012"); profile2.set_guid(MakeGuid(2)); personal_data().AddProfile(profile2); - AutofillProfile profile3; + AutofillProfile profile3( + i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "", "", "", "", "", "", "", "", "", "", "", ""); profile3.set_guid(MakeGuid(3)); @@ -1248,13 +1374,15 @@ class SuggestionMatchingTest : public BrowserAutofillManagerTest, - public testing::WithParamInterface<std::tuple<bool, std::string>> { + public testing::WithParamInterface<std::tuple<bool, std::string, bool>> { protected: void SetUp() override { BrowserAutofillManagerTest::SetUp(); InitializeFeatures(); } + bool IsMetadataEnabled() const { return std::get<2>(GetParam()); } + #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) void InitializeFeatures(); #else @@ -1296,11 +1424,17 @@ } #else void SuggestionMatchingTest::InitializeFeatures() { - enabled_feature_ = std::get<0>(GetParam()) ? EnabledFeature::kDesktop - : EnabledFeature::kNone; - features_.InitWithFeatureState( - features::kAutofillUseImprovedLabelDisambiguation, - std::get<0>(GetParam())); + bool improved_label_feature = std::get<0>(GetParam()); + + enabled_feature_ = + improved_label_feature ? EnabledFeature::kDesktop : EnabledFeature::kNone; + + features_.InitWithFeatureStates( + {{features::kAutofillUseImprovedLabelDisambiguation, + improved_label_feature}, + {features::kAutofillEnableVirtualCardMetadata, IsMetadataEnabled()}, + {features::kAutofillEnableCardProductName, IsMetadataEnabled()}, + {features::kAutofillEnableCardArtImage, IsMetadataEnabled()}}); } #endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) @@ -1327,19 +1461,6 @@ features::kAutofillEnableCardProductName}); } - int ObfuscationLength() override { -#if BUILDFLAG(IS_ANDROID) - return 2; -#elif BUILDFLAG(IS_IOS) - return base::FeatureList::IsEnabled( - features::kAutofillUseTwoDotsForLastFourDigits) - ? 2 - : 4; -#else - return 4; -#endif - } - private: base::test::ScopedFeatureList feature_list_card_metadata_and_product_name_; }; @@ -1933,21 +2054,21 @@ // Two profiles have the same last name, and the third shares the same first // letter for last name. - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); profile1.set_guid(MakeGuid(103)); profile1.SetInfo(NAME_FIRST, u"Robin", "en-US"); profile1.SetInfo(NAME_LAST, u"Grimes", "en-US"); profile1.SetInfo(ADDRESS_HOME_LINE1, u"1234 Smith Blvd.", "en-US"); personal_data().AddProfile(profile1); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); profile2.set_guid(MakeGuid(124)); profile2.SetInfo(NAME_FIRST, u"Carl", "en-US"); profile2.SetInfo(NAME_LAST, u"Grimes", "en-US"); profile2.SetInfo(ADDRESS_HOME_LINE1, u"1234 Smith Blvd.", "en-US"); personal_data().AddProfile(profile2); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); profile3.set_guid(MakeGuid(126)); profile3.SetInfo(NAME_FIRST, u"Aaron", "en-US"); profile3.SetInfo(NAME_LAST, u"Googler", "en-US"); @@ -2111,39 +2232,55 @@ CheckSuggestions(form.fields[0].global_id(), suggestions[0], suggestions[1]); } +class BrowserAutofillManagerTestForMetadataCardSuggestions + : public BrowserAutofillManagerTest, + public testing::WithParamInterface<bool> { + public: + BrowserAutofillManagerTestForMetadataCardSuggestions() { + if (IsMetadataEnabled()) { + card_metadata_flags_.InitWithFeatures( + /*enabled_features=*/{features::kAutofillEnableVirtualCardMetadata, + features::kAutofillEnableCardProductName, + features::kAutofillEnableCardArtImage}, + /*disabled_features=*/{}); + } else { + card_metadata_flags_.InitWithFeatures( + /*enabled_features=*/{}, + /*=disabled_features=*/{features::kAutofillEnableVirtualCardMetadata, + features::kAutofillEnableCardProductName, + features::kAutofillEnableCardArtImage}); + } + } + + bool IsMetadataEnabled() const { return GetParam(); } + + private: + base::test::ScopedFeatureList card_metadata_flags_; +}; + +INSTANTIATE_TEST_SUITE_P(All, + BrowserAutofillManagerTestForMetadataCardSuggestions, + ::testing::Bool()); + // Test that we return all credit card profile suggestions when all form fields // are empty. -TEST_F(BrowserAutofillManagerTest, GetCreditCardSuggestions_EmptyValue) { +TEST_P(BrowserAutofillManagerTestForMetadataCardSuggestions, + GetCreditCardSuggestions_EmptyValue) { // Set up our form data. FormData form = CreateTestCreditCardFormData(true, false); FormsSeen({form}); GetAutofillSuggestions(form, form.fields[1]); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string visa_label = std::string("04/99"); - const std::string master_card_label = std::string("10/98"); -#else - const std::string visa_label = std::string("Expires on 04/99"); - const std::string master_card_label = std::string("Expires on 10/98"); -#endif - // Test that we sent the credit card suggestions to the external delegate. - CheckSuggestions( - form.fields[1].global_id(), - Suggestion(std::string("Visa ") + test::ObfuscatedCardDigitsAsUTF8( - "3456", ObfuscationLength()), - visa_label, Suggestion::Icon::kCardVisa, - PopupItemId::kCreditCardEntry), - Suggestion(std::string("Mastercard ") + test::ObfuscatedCardDigitsAsUTF8( - "8765", ObfuscationLength()), - master_card_label, Suggestion::Icon::kCardMasterCard, - PopupItemId::kCreditCardEntry)); + CheckSuggestions(form.fields[1].global_id(), GetCardSuggestion(kVisaCard), + GetCardSuggestion(kMasterCard)); } // Test that we return all credit card profile suggestions when the triggering // field has whitespace in it. -TEST_F(BrowserAutofillManagerTest, GetCreditCardSuggestions_Whitespace) { +TEST_P(BrowserAutofillManagerTestForMetadataCardSuggestions, + GetCreditCardSuggestions_Whitespace) { // Set up our form data. FormData form = CreateTestCreditCardFormData(true, false); FormsSeen({form}); @@ -2152,30 +2289,15 @@ field.value = u" "; GetAutofillSuggestions(form, field); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string visa_label = std::string("04/99"); - const std::string master_card_label = std::string("10/98"); -#else - const std::string visa_label = std::string("Expires on 04/99"); - const std::string master_card_label = std::string("Expires on 10/98"); -#endif - // Test that we sent the right values to the external delegate. - CheckSuggestions( - field.global_id(), - Suggestion(std::string("Visa ") + test::ObfuscatedCardDigitsAsUTF8( - "3456", ObfuscationLength()), - visa_label, Suggestion::Icon::kCardVisa, - PopupItemId::kCreditCardEntry), - Suggestion(std::string("Mastercard ") + test::ObfuscatedCardDigitsAsUTF8( - "8765", ObfuscationLength()), - master_card_label, Suggestion::Icon::kCardMasterCard, - PopupItemId::kCreditCardEntry)); + CheckSuggestions(field.global_id(), GetCardSuggestion(kVisaCard), + GetCardSuggestion(kMasterCard)); } // Test that we return all credit card profile suggestions when the triggering // field has stop characters in it, which should be removed. -TEST_F(BrowserAutofillManagerTest, GetCreditCardSuggestions_StopCharsOnly) { +TEST_P(BrowserAutofillManagerTestForMetadataCardSuggestions, + GetCreditCardSuggestions_StopCharsOnly) { // Set up our form data. FormData form = CreateTestCreditCardFormData(true, false); FormsSeen({form}); @@ -2183,31 +2305,14 @@ FormFieldData field = form.fields[1]; field.value = u"____-____-____-____"; GetAutofillSuggestions(form, field); - -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string visa_label = std::string("04/99"); - const std::string master_card_label = std::string("10/98"); -#else - const std::string visa_label = std::string("Expires on 04/99"); - const std::string master_card_label = std::string("Expires on 10/98"); -#endif - // Test that we sent the right values to the external delegate. - CheckSuggestions( - field.global_id(), - Suggestion(std::string("Visa ") + test::ObfuscatedCardDigitsAsUTF8( - "3456", ObfuscationLength()), - visa_label, Suggestion::Icon::kCardVisa, - PopupItemId::kCreditCardEntry), - Suggestion(std::string("Mastercard ") + test::ObfuscatedCardDigitsAsUTF8( - "8765", ObfuscationLength()), - master_card_label, Suggestion::Icon::kCardMasterCard, - PopupItemId::kCreditCardEntry)); + CheckSuggestions(field.global_id(), GetCardSuggestion(kVisaCard), + GetCardSuggestion(kMasterCard)); } // Test that we return all credit card profile suggestions when the triggering // field has some invisible unicode characters in it. -TEST_F(BrowserAutofillManagerTest, +TEST_P(BrowserAutofillManagerTestForMetadataCardSuggestions, GetCreditCardSuggestions_InvisibleUnicodeOnly) { // Set up our form data. FormData form = CreateTestCreditCardFormData(true, false); @@ -2217,36 +2322,20 @@ field.value = std::u16string({0x200E, 0x200F}); GetAutofillSuggestions(form, field); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string visa_label = std::string("04/99"); - const std::string master_card_label = std::string("10/98"); -#else - const std::string visa_label = std::string("Expires on 04/99"); - const std::string master_card_label = std::string("Expires on 10/98"); -#endif - // Test that we sent the right values to the external delegate. - CheckSuggestions( - field.global_id(), - Suggestion(std::string("Visa ") + test::ObfuscatedCardDigitsAsUTF8( - "3456", ObfuscationLength()), - visa_label, Suggestion::Icon::kCardVisa, - PopupItemId::kCreditCardEntry), - Suggestion(std::string("Mastercard ") + test::ObfuscatedCardDigitsAsUTF8( - "8765", ObfuscationLength()), - master_card_label, Suggestion::Icon::kCardMasterCard, - PopupItemId::kCreditCardEntry)); + CheckSuggestions(field.global_id(), GetCardSuggestion(kVisaCard), + GetCardSuggestion(kMasterCard)); } // Test that we return all credit card profile suggestions when the triggering // field has stop characters in it and some input. -TEST_F(BrowserAutofillManagerTest, +TEST_P(BrowserAutofillManagerTestForMetadataCardSuggestions, GetCreditCardSuggestions_StopCharsWithInput) { // Add a credit card with particular numbers that we will attempt to recall. CreditCard credit_card; test::SetCreditCardInfo(&credit_card, "John Smith", - "5255667890123123", // Mastercard - "08", "2017", "1"); + "5255667890168765", // Mastercard + "10", "2098", "1"); credit_card.set_guid(MakeGuid(7)); personal_data().AddCreditCard(credit_card); @@ -2258,24 +2347,14 @@ field.value = u"5255-66__-____-____"; GetAutofillSuggestions(form, field); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string master_card_label = std::string("08/17"); -#else - const std::string master_card_label = std::string("Expires on 08/17"); -#endif - // Test that we sent the right value to the external delegate. - CheckSuggestions( - field.global_id(), - Suggestion(std::string("Mastercard ") + test::ObfuscatedCardDigitsAsUTF8( - "3123", ObfuscationLength()), - master_card_label, Suggestion::Icon::kCardMasterCard, - PopupItemId::kCreditCardEntry)); + CheckSuggestions(field.global_id(), GetCardSuggestion(kMasterCard)); } // Test that we return only matching credit card profile suggestions when the // selected form field has been partially filled out. -TEST_F(BrowserAutofillManagerTest, GetCreditCardSuggestions_MatchCharacter) { +TEST_P(BrowserAutofillManagerTestForMetadataCardSuggestions, + GetCreditCardSuggestions_MatchCharacter) { // Set up our form data. FormData form = CreateTestCreditCardFormData(true, false); FormsSeen({form}); @@ -2284,19 +2363,8 @@ FormControlType::kInputText); GetAutofillSuggestions(form, field); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string visa_label = std::string("04/99"); -#else - const std::string visa_label = std::string("Expires on 04/99"); -#endif - // Test that we sent the right values to the external delegate. - CheckSuggestions( - field.global_id(), - Suggestion(std::string("Visa ") + test::ObfuscatedCardDigitsAsUTF8( - "3456", ObfuscationLength()), - visa_label, Suggestion::Icon::kCardVisa, - PopupItemId::kCreditCardEntry)); + CheckSuggestions(field.global_id(), GetCardSuggestion(kVisaCard)); } // Test that we return credit card profile suggestions when the selected form @@ -2312,12 +2380,14 @@ GetAutofillSuggestions(form, credit_card_number_field); const std::string visa_value = std::string("Visa ") + - test::ObfuscatedCardDigitsAsUTF8("3456", ObfuscationLength()); + test::ObfuscatedCardDigitsAsUTF8( + "3456", ObfuscationLengthForCreditCardLastFourDigits()); // Mastercard has a valid nickname. Display nickname + last four in the // suggestion title. const std::string master_card_value = kArbitraryNickname + " " + - test::ObfuscatedCardDigitsAsUTF8("8765", ObfuscationLength()); + test::ObfuscatedCardDigitsAsUTF8( + "8765", ObfuscationLengthForCreditCardLastFourDigits()); #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) const std::string visa_label = std::string("04/99"); @@ -2350,9 +2420,11 @@ GetAutofillSuggestions(form, cardholder_name_field); const std::string obfuscated_last_four_digits1 = - test::ObfuscatedCardDigitsAsUTF8("3456", ObfuscationLength()); + test::ObfuscatedCardDigitsAsUTF8( + "3456", ObfuscationLengthForCreditCardLastFourDigits()); const std::string obfuscated_last_four_digits2 = - test::ObfuscatedCardDigitsAsUTF8("8765", ObfuscationLength()); + test::ObfuscatedCardDigitsAsUTF8( + "8765", ObfuscationLengthForCreditCardLastFourDigits()); #if BUILDFLAG(IS_ANDROID) // For Android always show obfuscated last four. @@ -2416,7 +2488,7 @@ // Test that we return credit card suggestions for secure pages that have an // empty form action target URL. -TEST_F(BrowserAutofillManagerTest, +TEST_P(BrowserAutofillManagerTestForMetadataCardSuggestions, GetCreditCardSuggestions_SecureContext_EmptyFormAction) { // Set up our form data. FormData form = CreateTestCreditCardFormData(true, false); @@ -2426,30 +2498,14 @@ GetAutofillSuggestions(form, form.fields[1]); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string visa_label = std::string("04/99"); - const std::string master_card_label = std::string("10/98"); -#else - const std::string visa_label = std::string("Expires on 04/99"); - const std::string master_card_label = std::string("Expires on 10/98"); -#endif - // Test that we sent the right values to the external delegate. - CheckSuggestions( - form.fields[1].global_id(), - Suggestion(std::string("Visa ") + test::ObfuscatedCardDigitsAsUTF8( - "3456", ObfuscationLength()), - visa_label, Suggestion::Icon::kCardVisa, - PopupItemId::kCreditCardEntry), - Suggestion(std::string("Mastercard ") + test::ObfuscatedCardDigitsAsUTF8( - "8765", ObfuscationLength()), - master_card_label, Suggestion::Icon::kCardMasterCard, - PopupItemId::kCreditCardEntry)); + CheckSuggestions(form.fields[1].global_id(), GetCardSuggestion(kVisaCard), + GetCardSuggestion(kMasterCard)); } // Test that we return credit card suggestions for secure pages that have a // form action set to "javascript:something". -TEST_F(BrowserAutofillManagerTest, +TEST_P(BrowserAutofillManagerTestForMetadataCardSuggestions, GetCreditCardSuggestions_SecureContext_JavascriptFormAction) { // Set up our form data. FormData form = CreateTestCreditCardFormData(true, false); @@ -2459,37 +2515,21 @@ GetAutofillSuggestions(form, form.fields[1]); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string visa_label = std::string("04/99"); - const std::string master_card_label = std::string("10/98"); -#else - const std::string visa_label = std::string("Expires on 04/99"); - const std::string master_card_label = std::string("Expires on 10/98"); -#endif - // Test that we sent the right values to the external delegate. - CheckSuggestions( - form.fields[1].global_id(), - Suggestion(std::string("Visa ") + test::ObfuscatedCardDigitsAsUTF8( - "3456", ObfuscationLength()), - visa_label, Suggestion::Icon::kCardVisa, - PopupItemId::kCreditCardEntry), - Suggestion(std::string("Mastercard ") + test::ObfuscatedCardDigitsAsUTF8( - "8765", ObfuscationLength()), - master_card_label, Suggestion::Icon::kCardMasterCard, - PopupItemId::kCreditCardEntry)); + CheckSuggestions(form.fields[1].global_id(), GetCardSuggestion(kVisaCard), + GetCardSuggestion(kMasterCard)); } // Test that we return all credit card suggestions in the case that two cards // have the same obfuscated number. -TEST_F(BrowserAutofillManagerTest, +TEST_P(BrowserAutofillManagerTestForMetadataCardSuggestions, GetCreditCardSuggestions_RepeatedObfuscatedNumber) { // Add a credit card with the same obfuscated number as Elvis's. // |credit_card| will be owned by the mock PersonalDataManager. CreditCard credit_card; test::SetCreditCardInfo(&credit_card, "Elvis Presley", - "5231567890123456", // Mastercard - "05", "2999", "1"); + "5255667890168765", // Mastercard + "10", "2098", "1"); credit_card.set_guid(MakeGuid(7)); credit_card.set_use_date(AutofillClock::Now() - base::Days(15)); personal_data().AddCreditCard(credit_card); @@ -2500,34 +2540,13 @@ GetAutofillSuggestions(form, form.fields[1]); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string visa_label = std::string("04/99"); - const std::string master_card_label1 = std::string("10/98"); - const std::string master_card_label2 = std::string("05/99"); -#else - const std::string visa_label = std::string("Expires on 04/99"); - const std::string master_card_label1 = std::string("Expires on 10/98"); - const std::string master_card_label2 = std::string("Expires on 05/99"); -#endif - // Test that we sent the right values to the external delegate. - CheckSuggestions( - form.fields[1].global_id(), - Suggestion(std::string("Visa ") + test::ObfuscatedCardDigitsAsUTF8( - "3456", ObfuscationLength()), - visa_label, Suggestion::Icon::kCardVisa, - PopupItemId::kCreditCardEntry), - Suggestion(std::string("Mastercard ") + test::ObfuscatedCardDigitsAsUTF8( - "8765", ObfuscationLength()), - master_card_label1, Suggestion::Icon::kCardMasterCard, - PopupItemId::kCreditCardEntry), - Suggestion(std::string("Mastercard ") + test::ObfuscatedCardDigitsAsUTF8( - "3456", ObfuscationLength()), - master_card_label2, Suggestion::Icon::kCardMasterCard, - PopupItemId::kCreditCardEntry)); + CheckSuggestions(form.fields[1].global_id(), GetCardSuggestion(kVisaCard), + GetCardSuggestion(kMasterCard), + GetCardSuggestion(kMasterCard)); } -// Test that a masked server card is not suggested if more that six digits +// Test that a masked server card is not suggested if more than six digits // have been typed in the field. TEST_F(BrowserAutofillManagerTest, GetCreditCardSuggestions_MaskedCardWithMoreThan6Digits) { @@ -2556,14 +2575,15 @@ // Test that expired cards are ordered by their ranking score and are always // suggested after non expired cards even if they have a higher ranking score. -TEST_F(BrowserAutofillManagerTest, GetCreditCardSuggestions_ExpiredCards) { +TEST_P(BrowserAutofillManagerTestForMetadataCardSuggestions, + GetCreditCardSuggestions_ExpiredCards) { personal_data().ClearCreditCards(); // Add a never used non expired credit card. CreditCard credit_card0("002149C1-EE28-4213-A3B9-DA243FFF021B", test::kEmptyOrigin); test::SetCreditCardInfo(&credit_card0, "Bonnie Parker", - "5105105105105100" /* Mastercard */, "04", "2055", + "5105105105108765" /* Mastercard */, "10", "2098", "1"); credit_card0.set_guid(MakeGuid(1)); personal_data().AddCreditCard(credit_card0); @@ -2585,7 +2605,7 @@ credit_card2.set_use_count(3); credit_card2.set_use_date(AutofillClock::Now() - base::Days(1)); test::SetCreditCardInfo(&credit_card2, "John Dillinger", - "4234567890123456" /* Visa */, "01", "2011", "1"); + "4234567890123456" /* Visa */, "04", "2011", "1"); credit_card2.set_guid(MakeGuid(3)); personal_data().AddCreditCard(credit_card2); @@ -2596,35 +2616,19 @@ FormsSeen({form}); GetAutofillSuggestions(form, form.fields[1]); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string visa_label = std::string("01/11"); - const std::string master_card_label = std::string("04/55"); - const std::string amex_card_label = std::string("04/10"); -#else - const std::string visa_label = std::string("Expires on 01/11"); - const std::string master_card_label = std::string("Expires on 04/55"); - const std::string amex_card_label = std::string("Expires on 04/10"); -#endif + Suggestion visa_suggestion = GenerateSuggestionFromCardDetails( + kVisaCard, Suggestion::Icon::kCardVisa, "3456", "04/11"); + Suggestion amex_suggestion = GetCardSuggestion(kAmericanExpressCard); + Suggestion mastercard_suggestion = GetCardSuggestion(kMasterCard); - CheckSuggestions( - form.fields[1].global_id(), - Suggestion(std::string("Mastercard ") + test::ObfuscatedCardDigitsAsUTF8( - "5100", ObfuscationLength()), - master_card_label, Suggestion::Icon::kCardMasterCard, - PopupItemId::kCreditCardEntry), - Suggestion(std::string("Amex ") + test::ObfuscatedCardDigitsAsUTF8( - "0005", ObfuscationLength()), - amex_card_label, Suggestion::Icon::kCardAmericanExpress, - PopupItemId::kCreditCardEntry), - Suggestion(std::string("Visa ") + test::ObfuscatedCardDigitsAsUTF8( - "3456", ObfuscationLength()), - visa_label, Suggestion::Icon::kCardVisa, - PopupItemId::kCreditCardEntry)); + // Test that we sent the credit card suggestions to the external delegate. + CheckSuggestions(form.fields[1].global_id(), mastercard_suggestion, + amex_suggestion, visa_suggestion); } // Test cards that are expired AND disused are suppressed when suppression is // enabled and the input field is empty. -TEST_F(BrowserAutofillManagerTest, +TEST_P(BrowserAutofillManagerTestForMetadataCardSuggestions, GetCreditCardSuggestions_SuppressDisusedCreditCardsOnEmptyField) { personal_data().ClearCreditCards(); ASSERT_EQ(0U, personal_data().GetCreditCards().size()); @@ -2664,29 +2668,13 @@ { GetAutofillSuggestions(form, form.fields[0]); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string mastercard_label = - test::ObfuscatedCardDigitsAsUTF8("5100", ObfuscationLength()); - const std::string visa_label = - test::ObfuscatedCardDigitsAsUTF8("3456", ObfuscationLength()); -#else - const std::string mastercard_label = - std::string("Mastercard ") + - test::ObfuscatedCardDigitsAsUTF8("5100", ObfuscationLength()) + - std::string(", expires on 04/99"); - const std::string visa_label = - std::string("Visa ") + - test::ObfuscatedCardDigitsAsUTF8("3456", ObfuscationLength()) + - std::string(", expires on 04/10"); -#endif - CheckSuggestions( form.fields[0].global_id(), - Suggestion("Bonnie Parker", mastercard_label, + Suggestion("Bonnie Parker", GenerateLabelsFromCreditCard(credit_card0), Suggestion::Icon::kCardMasterCard, PopupItemId::kCreditCardEntry), - Suggestion("Clyde Barrow", visa_label, Suggestion::Icon::kCardVisa, - PopupItemId::kCreditCardEntry)); + Suggestion("Clyde Barrow", GenerateLabelsFromCreditCard(credit_card1), + Suggestion::Icon::kCardVisa, PopupItemId::kCreditCardEntry)); } // Query with name prefix for card0 returns card0. @@ -2695,20 +2683,11 @@ field.value = u"B"; GetAutofillSuggestions(form, field); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string mastercard_label = - test::ObfuscatedCardDigitsAsUTF8("5100", ObfuscationLength()); -#else - const std::string mastercard_label = - std::string("Mastercard ") + - test::ObfuscatedCardDigitsAsUTF8("5100", ObfuscationLength()) + - std::string(", expires on 04/99"); -#endif - - CheckSuggestions(form.fields[0].global_id(), - Suggestion("Bonnie Parker", mastercard_label, - Suggestion::Icon::kCardMasterCard, - PopupItemId::kCreditCardEntry)); + CheckSuggestions( + form.fields[0].global_id(), + Suggestion("Bonnie Parker", GenerateLabelsFromCreditCard(credit_card0), + Suggestion::Icon::kCardMasterCard, + PopupItemId::kCreditCardEntry)); } // Query with name prefix for card1 returns card1. @@ -2717,20 +2696,10 @@ field.value = u"Cl"; GetAutofillSuggestions(form, field); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string visa_label = - test::ObfuscatedCardDigitsAsUTF8("3456", ObfuscationLength()); -#else - const std::string visa_label = - std::string("Visa ") + - test::ObfuscatedCardDigitsAsUTF8("3456", ObfuscationLength()) + - std::string(", expires on 04/10"); -#endif - CheckSuggestions( form.fields[0].global_id(), - Suggestion("Clyde Barrow", visa_label, Suggestion::Icon::kCardVisa, - PopupItemId::kCreditCardEntry)); + Suggestion("Clyde Barrow", GenerateLabelsFromCreditCard(credit_card1), + Suggestion::Icon::kCardVisa, PopupItemId::kCreditCardEntry)); } // Query with name prefix for card2 returns card2. @@ -2739,27 +2708,19 @@ field.value = u"Jo"; GetAutofillSuggestions(form, field); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string amex_label = - test::ObfuscatedCardDigitsAsUTF8("0005", ObfuscationLength()); -#else - const std::string amex_label = - std::string("Amex ") + - test::ObfuscatedCardDigitsAsUTF8("0005", ObfuscationLength()) + - std::string(", expires on 01/10"); -#endif - - CheckSuggestions(form.fields[0].global_id(), - Suggestion("John Dillinger", amex_label, - Suggestion::Icon::kCardAmericanExpress, - PopupItemId::kCreditCardEntry)); + CheckSuggestions( + form.fields[0].global_id(), + Suggestion("John Dillinger", GenerateLabelsFromCreditCard(credit_card2), + Suggestion::Icon::kCardAmericanExpress, + PopupItemId::kCreditCardEntry)); } } // Test that a card that doesn't have a number is not shown in the // suggestions when querying credit cards by their number, and is shown when // querying other fields. -TEST_F(BrowserAutofillManagerTest, GetCreditCardSuggestions_NumberMissing) { +TEST_P(BrowserAutofillManagerTestForMetadataCardSuggestions, + GetCreditCardSuggestions_NumberMissing) { // Create one normal credit card and one credit card with the number // missing. personal_data().ClearCreditCards(); @@ -2769,7 +2730,7 @@ test::kEmptyOrigin); test::SetCreditCardInfo(&credit_card0, "Clyde Barrow", "378282246310005" /* American Express */, "04", - "2999", "1"); + "2910", "1"); credit_card0.set_guid(MakeGuid(1)); personal_data().AddCreditCard(credit_card0); @@ -2791,37 +2752,17 @@ // Sublabel is expiration date when filling card number. The second card // doesn't have a number so it should not be included in the suggestions. -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string amex_card_exp_label = std::string("04/99"); -#else - const std::string amex_card_exp_label = std::string("Expires on 04/99"); -#endif - - CheckSuggestions( - form.fields[1].global_id(), - Suggestion(std::string("Amex ") + test::ObfuscatedCardDigitsAsUTF8( - "0005", ObfuscationLength()), - amex_card_exp_label, Suggestion::Icon::kCardAmericanExpress, - PopupItemId::kCreditCardEntry)); + CheckSuggestions(form.fields[1].global_id(), + GetCardSuggestion(kAmericanExpressCard)); // Query by cardholder name field. GetAutofillSuggestions(form, form.fields[0]); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string amex_card_label = - test::ObfuscatedCardDigitsAsUTF8("0005", ObfuscationLength()); -#else - const std::string amex_card_label = - std::string("Amex ") + - test::ObfuscatedCardDigitsAsUTF8("0005", ObfuscationLength()) + - std::string(", expires on 04/99"); -#endif - CheckSuggestions( form.fields[0].global_id(), Suggestion("John Dillinger", "", Suggestion::Icon::kCardGeneric, PopupItemId::kCreditCardEntry), - Suggestion("Clyde Barrow", amex_card_label, + Suggestion("Clyde Barrow", GenerateLabelsFromCreditCard(credit_card0), Suggestion::Icon::kCardAmericanExpress, PopupItemId::kCreditCardEntry)); } @@ -2889,22 +2830,9 @@ FormControlType::kInputText); GetAutofillSuggestions(form, field); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string visa_label = std::string("04/99"); - const std::string master_card_label = std::string("10/98"); -#else - const std::string visa_label = std::string("Expires on 04/99"); - const std::string master_card_label = std::string("Expires on 10/98"); -#endif - // Test that we sent the credit card suggestions to the external delegate. - CheckSuggestions( - field.global_id(), - Suggestion(MakeCardLabel("Visa", "3456"), visa_label, - Suggestion::Icon::kCardVisa, PopupItemId::kCreditCardEntry), - Suggestion(MakeCardLabel("Mastercard", "8765"), master_card_label, - Suggestion::Icon::kCardMasterCard, - PopupItemId::kCreditCardEntry)); + CheckSuggestions(field.global_id(), GetCardSuggestion(kVisaCard), + GetCardSuggestion(kMasterCard)); } // Test that for non-https forms with both address and credit card fields, we @@ -3449,7 +3377,7 @@ test::ClearAlternativeStateNameMapForTesting(); test::PopulateAlternativeStateNameMapForTesting(); - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "", "", "", "", "", "", "", "", "Bavaria", "", "DE", ""); @@ -3609,7 +3537,7 @@ FormsSeen({form}); // |profile| will be owned by the mock PersonalDataManager. - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Elvis", "", "", "", "", "", "", "", "", "", "", ""); profile.set_guid(MakeGuid(101)); @@ -3666,7 +3594,7 @@ FormsSeen({form}); personal_data().ClearProfiles(); - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.set_guid(MakeGuid(104)); profile.SetRawInfo(PHONE_HOME_WHOLE_NUMBER, u"1800FLOWERS"); personal_data().AddProfile(profile); @@ -3696,7 +3624,7 @@ form.fields[9].max_length = 10; FormsSeen({form}); - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.set_guid(MakeGuid(103)); profile.SetInfo(NAME_FULL, u"Natty Bumppo", "en-US"); profile.SetRawInfo(PHONE_HOME_WHOLE_NUMBER, u"+886123456789"); @@ -3742,7 +3670,7 @@ FormsSeen({form}); personal_data().ClearProfiles(); - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.set_guid(MakeGuid(103)); profile.SetRawInfo(NAME_FULL, u"Natty Bumppo"); profile.SetRawInfo(EMAIL_ADDRESS, u"test@example.com"); @@ -6004,14 +5932,20 @@ ->field_log_events(); ASSERT_EQ(CountEventOfType<FillFieldLogEvent>(fill_field_log_events), 1u); - const FillFieldLogEvent* first_fill_field_log_event = - FindFirstEventOfType<FillFieldLogEvent>(fill_field_log_events); - EXPECT_EQ(first_fill_field_log_event->filling_method, - AutofillFillingMethod::kFullForm); + EXPECT_THAT( + *FindFirstEventOfType<FillFieldLogEvent>(fill_field_log_events), + EqualsFillFieldLogEvent(FillFieldLogEvent{ + .fill_event_id = FillEventId(-1), + .had_value_before_filling = OptionalBoolean::kFalse, + .autofill_skipped_status = FieldFillingSkipReason::kNotSkipped, + .was_autofilled = OptionalBoolean::kTrue, + .had_value_after_filling = OptionalBoolean::kTrue, + .filling_method = AutofillFillingMethod::kFullForm, + })); } TEST_F(BrowserAutofillManagerWithLogEventsTest, - FillingMethod_TargetedGranularFillingGroup_GroupFiling) { + FillingMethod_TargetedGranularFillingGroup_GroupFilling) { base::test::ScopedFeatureList enabled_features( features::kAutofillGranularFillingAvailable); @@ -6029,10 +5963,46 @@ ->field_log_events(); ASSERT_EQ(CountEventOfType<FillFieldLogEvent>(fill_field_log_events), 1u); - const FillFieldLogEvent* first_fill_field_log_event = - FindFirstEventOfType<FillFieldLogEvent>(fill_field_log_events); - EXPECT_EQ(first_fill_field_log_event->filling_method, - AutofillFillingMethod::kGroupFilling); + EXPECT_THAT( + *FindFirstEventOfType<FillFieldLogEvent>(fill_field_log_events), + EqualsFillFieldLogEvent(FillFieldLogEvent{ + .fill_event_id = FillEventId(-1), + .had_value_before_filling = OptionalBoolean::kFalse, + .autofill_skipped_status = FieldFillingSkipReason::kNotSkipped, + .was_autofilled = OptionalBoolean::kTrue, + .had_value_after_filling = OptionalBoolean::kTrue, + .filling_method = AutofillFillingMethod::kGroupFilling, + })); +} + +TEST_F(BrowserAutofillManagerWithLogEventsTest, + FillingMethod_TargetedSingleField_FieldByFieldFilling) { + base::test::ScopedFeatureList features( + features::kAutofillGranularFillingAvailable); + + FormData form = + test::GetFormData({.fields = {{.role = NAME_FIRST, + .autocomplete_attribute = "given-name"}}}); + FormsSeen({form}); + FillAutofillFormDataAndGetResults( + form, form.fields[0], MakeGuid(1), + {.trigger_source = AutofillTriggerSource::kPopup, + .field_types_to_fill = {NAME_FIRST}}); + const std::vector<AutofillField::FieldLogEventType>& fill_field_log_events = + browser_autofill_manager_->GetAutofillField(form, form.fields[0]) + ->field_log_events(); + + ASSERT_EQ(CountEventOfType<FillFieldLogEvent>(fill_field_log_events), 1u); + EXPECT_THAT( + *FindFirstEventOfType<FillFieldLogEvent>(fill_field_log_events), + EqualsFillFieldLogEvent(FillFieldLogEvent{ + .fill_event_id = FillEventId(-1), + .had_value_before_filling = OptionalBoolean::kFalse, + .autofill_skipped_status = FieldFillingSkipReason::kNotSkipped, + .was_autofilled = OptionalBoolean::kTrue, + .had_value_after_filling = OptionalBoolean::kTrue, + .filling_method = AutofillFillingMethod::kFieldByFieldFilling, + })); } // Test that we record FillFieldLogEvents after filling a form twice, the first @@ -7307,8 +7277,9 @@ const ServerFieldTypeSet& expected_possible_types = test_case.field_types; // Set up the test profiles. - std::vector<AutofillProfile> profiles; - profiles.resize(3); + std::vector<AutofillProfile> profiles( + 3, AutofillProfile(i18n_model_definition::kLegacyHierarchyCountryCode)); + TestAddressFillData profile_info_data = GetElvisAddressFillData(); profile_info_data.phone = "+1 (234) 567-8901"; profiles[0] = FillDataToAutofillProfile(profile_info_data); @@ -7369,7 +7340,8 @@ enable_autofill_vote_for_select_option_values); // Set up a profile and no credit cards. - std::vector<AutofillProfile> profiles(1); + std::vector<AutofillProfile> profiles = { + AutofillProfile(i18n_model_definition::kLegacyHierarchyCountryCode)}; TestAddressFillData profile_info_data = GetElvisAddressFillData(); profile_info_data.phone = "+1 (234) 567-8901"; profiles[0] = FillDataToAutofillProfile(profile_info_data); @@ -8178,7 +8150,7 @@ // Test to verify suggestions appears for forms having credit card number split // across fields. -TEST_F(BrowserAutofillManagerTest, +TEST_P(BrowserAutofillManagerTestForMetadataCardSuggestions, GetCreditCardSuggestions_ForNumberSplitAcrossFields) { // Set up our form data with credit card number split across fields. FormData form; @@ -8215,20 +8187,7 @@ // Get the suggestions for already filled credit card |number_field|. GetAutofillSuggestions(form, number_field); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string visa_label = std::string("04/99"); - const std::string master_card_label = std::string("10/98"); -#else - const std::string visa_label = std::string("Expires on 04/99"); - const std::string master_card_label = std::string("Expires on 10/98"); -#endif - - CheckSuggestions( - form.fields[3].global_id(), - Suggestion(std::string("Visa ") + test::ObfuscatedCardDigitsAsUTF8( - "3456", ObfuscationLength()), - visa_label, Suggestion::Icon::kCardVisa, - PopupItemId::kCreditCardEntry)); + CheckSuggestions(form.fields[3].global_id(), GetCardSuggestion(kVisaCard)); } // Test that inputs detected to be CVC inputs are forced to @@ -8642,28 +8601,32 @@ std::string label = std::string("Expires on 04/99"); #endif - Suggestion virtual_card_suggestion = - Suggestion("Virtual card", - std::string("nickname ") + test::ObfuscatedCardDigitsAsUTF8( - "3456", ObfuscationLength()), - label, Suggestion::Icon::kCardVisa, - autofill::PopupItemId::kVirtualCreditCardEntry); + Suggestion virtual_card_suggestion = Suggestion( + "Virtual card", + std::string("nickname ") + + test::ObfuscatedCardDigitsAsUTF8( + "3456", ObfuscationLengthForCreditCardLastFourDigits()), + label, Suggestion::Icon::kCardVisa, + autofill::PopupItemId::kVirtualCreditCardEntry); CheckSuggestions( form.fields[1].global_id(), virtual_card_suggestion, - Suggestion(std::string("nickname ") + test::ObfuscatedCardDigitsAsUTF8( - "3456", ObfuscationLength()), - label, Suggestion::Icon::kCardVisa, - PopupItemId::kCreditCardEntry)); + Suggestion( + std::string("nickname ") + + test::ObfuscatedCardDigitsAsUTF8( + "3456", ObfuscationLengthForCreditCardLastFourDigits()), + label, Suggestion::Icon::kCardVisa, PopupItemId::kCreditCardEntry)); // Non card number field (cardholder name field). GetAutofillSuggestions(form, form.fields[0]); #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - label = test::ObfuscatedCardDigitsAsUTF8("3456", ObfuscationLength()); + label = test::ObfuscatedCardDigitsAsUTF8( + "3456", ObfuscationLengthForCreditCardLastFourDigits()); #else label = std::string("nickname ") + - test::ObfuscatedCardDigitsAsUTF8("3456", ObfuscationLength()) + + test::ObfuscatedCardDigitsAsUTF8( + "3456", ObfuscationLengthForCreditCardLastFourDigits()) + std::string(", expires on 04/99"); #endif @@ -10344,29 +10307,34 @@ INSTANTIATE_TEST_SUITE_P(All, OnFocusOnFormFieldTest, testing::Bool()); #if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_ANDROID) -INSTANTIATE_TEST_SUITE_P(, - SuggestionMatchingTest, - testing::Values(std::make_tuple(0, ""), - std::make_tuple(1, "show-all"), - std::make_tuple(1, "show-one"))); +INSTANTIATE_TEST_SUITE_P( + , + SuggestionMatchingTest, + testing::Values(std::make_tuple(0, "", false), + std::make_tuple(1, "show-all", false), + std::make_tuple(1, "show-one", false))); #else INSTANTIATE_TEST_SUITE_P(All, SuggestionMatchingTest, - testing::Values(std::make_tuple(0, ""), - std::make_tuple(1, ""))); + testing::Values(std::make_tuple(0, "", false), + std::make_tuple(0, "", true), + std::make_tuple(1, "", false), + std::make_tuple(1, "", true))); #endif // BUILDFLAG(IS_IOS) || BUILDFLAG(IS_ANDROID) struct ShareNicknameTestParam { std::string local_nickname; std::string server_nickname; std::string expected_nickname; + bool metadata_enabled; }; const ShareNicknameTestParam kShareNicknameTestParam[] = { - {"", "", ""}, - {"", "server nickname", "server nickname"}, - {"local nickname", "", "local nickname"}, - {"local nickname", "server nickname", "local nickname"}, + {"", "", "", false}, + {"", "server nickname", "server nickname", false}, + {"local nickname", "", "local nickname", false}, + {"local nickname", "server nickname", "local nickname", false}, + {"local nickname", "server nickname", "local nickname", true}, }; class BrowserAutofillManagerTestForSharingNickname @@ -10376,14 +10344,28 @@ BrowserAutofillManagerTestForSharingNickname() : local_nickname_(GetParam().local_nickname), server_nickname_(GetParam().server_nickname), - expected_nickname_(GetParam().expected_nickname) {} + expected_nickname_(GetParam().expected_nickname) { + if (GetParam().metadata_enabled) { + card_metadata_flags_.InitWithFeatures( + /*enabled_features=*/{features::kAutofillEnableVirtualCardMetadata, + features::kAutofillEnableCardProductName, + features::kAutofillEnableCardArtImage}, + /*disabled_features=*/{}); + } else { + card_metadata_flags_.InitWithFeatures( + /*enabled_features=*/{}, + /*disabled_features=*/{features::kAutofillEnableVirtualCardMetadata, + features::kAutofillEnableCardProductName, + features::kAutofillEnableCardArtImage}); + } + } CreditCard GetLocalCard() { CreditCard local_card("287151C8-6AB1-487C-9095-28E80BE5DA15", test::kEmptyOrigin); test::SetCreditCardInfo(&local_card, "Clyde Barrow", "378282246310005" /* American Express */, "04", - "2999", "1"); + "2910", "1"); local_card.set_use_count(3); local_card.set_use_date(AutofillClock::Now() - base::Days(1)); local_card.SetNickname(base::UTF8ToUTF16(local_nickname_)); @@ -10396,12 +10378,13 @@ "c789"); test::SetCreditCardInfo(&full_server_card, "Clyde Barrow", "378282246310005" /* American Express */, "04", - "2999", "1"); + "2910", "1"); full_server_card.SetNickname(base::UTF8ToUTF16(server_nickname_)); full_server_card.set_guid(MakeGuid(2)); return full_server_card; } + base::test::ScopedFeatureList card_metadata_flags_; std::string local_nickname_; std::string server_nickname_; std::string expected_nickname_; @@ -10427,21 +10410,8 @@ // Query by card number field. GetAutofillSuggestions(form, form.fields[1]); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string exp_label = std::string("04/99"); -#else - const std::string exp_label = std::string("Expires on 04/99"); -#endif - - CheckSuggestions( - form.fields[1].global_id(), - Suggestion( - (expected_nickname_.empty() ? std::string("Amex") - : expected_nickname_) + - " " + - test::ObfuscatedCardDigitsAsUTF8("0005", ObfuscationLength()), - exp_label, Suggestion::Icon::kCardAmericanExpress, - PopupItemId::kCreditCardEntry)); + CheckSuggestions(form.fields[1].global_id(), + GetCardSuggestion(kAmericanExpressCard, expected_nickname_)); } TEST_P(BrowserAutofillManagerTestForSharingNickname, @@ -10454,7 +10424,7 @@ std::vector<CreditCard> server_cards; CreditCard server_card = GetServerCard(); // Make sure the cards are different by giving a different card number. - server_card.SetNumber(u"371449635398431"); + server_card.SetNumber(u"371449635320005"); personal_data().AddServerCreditCard(server_card); ASSERT_EQ(2U, personal_data().GetCreditCards().size()); @@ -10466,26 +10436,9 @@ // Query by card number field. GetAutofillSuggestions(form, form.fields[1]); -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_IOS) - const std::string exp_label = std::string("04/99"); -#else - const std::string exp_label = std::string("Expires on 04/99"); -#endif - - CheckSuggestions( - form.fields[1].global_id(), - Suggestion( - (local_nickname_.empty() ? std::string("Amex") : local_nickname_) + - " " + - test::ObfuscatedCardDigitsAsUTF8("0005", ObfuscationLength()), - exp_label, Suggestion::Icon::kCardAmericanExpress, - PopupItemId::kCreditCardEntry), - Suggestion( - (server_nickname_.empty() ? std::string("Amex") : server_nickname_) + - " " + - test::ObfuscatedCardDigitsAsUTF8("8431", ObfuscationLength()), - exp_label, Suggestion::Icon::kCardAmericanExpress, - PopupItemId::kCreditCardEntry)); + CheckSuggestions(form.fields[1].global_id(), + GetCardSuggestion(kAmericanExpressCard, local_nickname_), + GetCardSuggestion(kAmericanExpressCard, server_nickname_)); } // The following Refill Tests ensure that Autofill can handle the situation
diff --git a/components/autofill/core/browser/contact_info_sync_util.h b/components/autofill/core/browser/contact_info_sync_util.h index 6bb66db8..7a8a6c3d3 100644 --- a/components/autofill/core/browser/contact_info_sync_util.h +++ b/components/autofill/core/browser/contact_info_sync_util.h
@@ -51,4 +51,4 @@ } // namespace autofill -#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_SYNC_UTIL_H_ +#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CONTACT_INFO_SYNC_UTIL_H_
diff --git a/components/autofill/core/browser/data_model/autofill_profile.cc b/components/autofill/core/browser/data_model/autofill_profile.cc index f5c28c2..ef74e07 100644 --- a/components/autofill/core/browser/data_model/autofill_profile.cc +++ b/components/autofill/core/browser/data_model/autofill_profile.cc
@@ -221,6 +221,39 @@ } } +#if BUILDFLAG(IS_ANDROID) +// Constructs an AutofillProfile using the provided `existing_profile` as a +// foundation. In case that the `existing_profile` is invalid, an empty profile +// with a unique identifier (GUID) corresponding to the Java profile +// (`jprofile`) is initialized. +AutofillProfile CreateStarterProfile( + const base::android::JavaParamRef<jobject>& jprofile, + JNIEnv* env, + const AutofillProfile* existing_profile) { + std::string guid = + ConvertJavaStringToUTF8(Java_AutofillProfile_getGUID(env, jprofile)); + if (!existing_profile) { + AutofillProfile::Source source = static_cast<AutofillProfile::Source>( + Java_AutofillProfile_getSource(env, jprofile)); + AddressCountryCode country_code = + AddressCountryCode(ConvertJavaStringToUTF8( + Java_AutofillProfile_getCountryCode(env, jprofile))); + AutofillProfile profile = AutofillProfile(source, country_code); + // Only set the guid if CreateStartProfile is called on an existing profile + // (java guid not empty). Otherwise, keep the generated one. + // TODO(crbug.com/1484006): `guid` should be always empty when existing + // profile is not set. CHECK should be added when this condition holds. + if (!guid.empty()) { + profile.set_guid(guid); + } + return profile; + } + + CHECK_EQ(existing_profile->guid(), guid); + return *existing_profile; +} +#endif // BUILDFLAG(IS_ANDROID) + } // namespace AutofillProfile::AutofillProfile(AddressCountryCode country_code) @@ -318,25 +351,8 @@ const AutofillProfile* existing_profile, const std::string& app_locale) { JNIEnv* env = base::android::AttachCurrentThread(); - - AutofillProfile profile; - if (!existing_profile) { - profile = AutofillProfile(static_cast<AutofillProfile::Source>( - Java_AutofillProfile_getSource(env, jprofile))); - // Only set the guid if it is an existing profile (java guid not empty). - // Otherwise, keep the generated one. - std::string guid = - ConvertJavaStringToUTF8(Java_AutofillProfile_getGUID(env, jprofile)); - // TODO(crbug.com/1484006): `guid` should be always empty when existing - // profile is not set. CHECK should be added when this condition holds. - if (!guid.empty()) { - profile.set_guid(guid); - } - } else { - profile = *existing_profile; - CHECK_EQ(profile.guid(), ConvertJavaStringToUTF8( - Java_AutofillProfile_getGUID(env, jprofile))); - } + AutofillProfile profile = + CreateStarterProfile(jprofile, env, existing_profile); std::vector<int> field_types; base::android::JavaIntArrayToIntVector(
diff --git a/components/autofill/core/browser/data_model/autofill_profile_comparator_unittest.cc b/components/autofill/core/browser/data_model/autofill_profile_comparator_unittest.cc index 803d6ee..68d542b 100644 --- a/components/autofill/core/browser/data_model/autofill_profile_comparator_unittest.cc +++ b/components/autofill/core/browser/data_model/autofill_profile_comparator_unittest.cc
@@ -125,7 +125,7 @@ const char* middle, const char* last, bool finalize = true) { - AutofillProfile profile; + AutofillProfile profile(kLegacyHierarchyCountryCode); autofill::test::SetProfileInfo(&profile, first, middle, last, "", "", "", "", "", "", "", "", ""); if (finalize) @@ -135,7 +135,7 @@ AutofillProfile CreateProfileWithName(const NameInfo& name, bool finalize = true) { - AutofillProfile profile; + AutofillProfile profile(kLegacyHierarchyCountryCode); profile.SetRawInfoWithVerificationStatus( NAME_FULL, name.GetRawInfo(NAME_FULL), name.GetVerificationStatus(NAME_FULL)); @@ -155,21 +155,21 @@ } AutofillProfile CreateProfileWithEmail(const char* email) { - AutofillProfile profile; + AutofillProfile profile(kLegacyHierarchyCountryCode); autofill::test::SetProfileInfo(&profile, "", "", "", email, "", "", "", "", "", "", "", ""); return profile; } AutofillProfile CreateProfileWithCompanyName(const char* company_name) { - AutofillProfile profile; + AutofillProfile profile(kLegacyHierarchyCountryCode); autofill::test::SetProfileInfo(&profile, "", "", "", "", company_name, "", "", "", "", "", "", ""); return profile; } AutofillProfile CreateProfileWithPhoneNumber(const char* phone_number) { - AutofillProfile profile; + AutofillProfile profile(kLegacyHierarchyCountryCode); autofill::test::SetProfileInfo(&profile, "", "", "", "", "", "", "", "", "", "", "", phone_number); return profile; @@ -181,7 +181,7 @@ const char* state, const char* zip, const char* country) { - AutofillProfile profile; + AutofillProfile profile(kLegacyHierarchyCountryCode); autofill::test::SetProfileInfo(&profile, "", "", "", "", "", line1, line2, city, state, zip, country, ""); return profile; @@ -190,7 +190,7 @@ AutofillProfile CreateProfileWithBirthdate(const char* day, const char* month, const char* year) { - AutofillProfile profile; + AutofillProfile profile(kLegacyHierarchyCountryCode); profile.SetRawInfo(BIRTHDATE_DAY, base::UTF8ToUTF16(day)); profile.SetRawInfo(BIRTHDATE_MONTH, base::UTF8ToUTF16(month)); profile.SetRawInfo(BIRTHDATE_4_DIGIT_YEAR, base::UTF8ToUTF16(year));
diff --git a/components/autofill/core/browser/data_model/autofill_profile_unittest.cc b/components/autofill/core/browser/data_model/autofill_profile_unittest.cc index a2b3baf..bff4beb 100644 --- a/components/autofill/core/browser/data_model/autofill_profile_unittest.cc +++ b/components/autofill/core/browser/data_model/autofill_profile_unittest.cc
@@ -69,21 +69,21 @@ // Based on existence of first name, last name, and address line 1. TEST(AutofillProfileTest, PreviewSummaryString) { // Case 0/null: "" - AutofillProfile profile0; + AutofillProfile profile0(i18n_model_definition::kLegacyHierarchyCountryCode); // Empty profile - nothing to update. std::u16string summary0 = GetSuggestionLabel(&profile0); EXPECT_EQ(std::u16string(), summary0); // Case 0a/empty name and address, so the first two fields of the rest of the // data is used: "Hollywood, CA" - AutofillProfile profile00; + AutofillProfile profile00(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile00, "", "", "", "johnwayne@me.xyz", "Fox", "", "", "Hollywood", "CA", "91601", "US", "16505678910"); std::u16string summary00 = GetSuggestionLabel(&profile00); EXPECT_EQ(u"Hollywood, CA", summary00); // Case 1: "<address>" without line 2. - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "", "", "", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "", "Hollywood", "CA", "91601", "US", "16505678910"); @@ -91,7 +91,7 @@ EXPECT_EQ(u"123 Zoo St., Hollywood", summary1); // Case 1a: "<address>" with line 2. - AutofillProfile profile1a; + AutofillProfile profile1a(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1a, "", "", "", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "16505678910"); @@ -99,7 +99,7 @@ EXPECT_EQ(u"123 Zoo St., unit 5", summary1a); // Case 2: "<lastname>" - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "", "", "Hollywood", "CA", "91601", "US", "16505678910"); @@ -108,7 +108,7 @@ EXPECT_EQ(u"Mitchell Morrison, Hollywood", summary2); // Case 3: "<lastname>, <address>" - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "", "Hollywood", "CA", "91601", "US", "16505678910"); @@ -116,7 +116,7 @@ EXPECT_EQ(u"Mitchell Morrison, 123 Zoo St.", summary3); // Case 4: "<firstname>" - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "Marion", "Mitchell", "", "johnwayne@me.xyz", "Fox", "", "", "Hollywood", "CA", "91601", "US", "16505678910"); @@ -124,7 +124,7 @@ EXPECT_EQ(u"Marion Mitchell, Hollywood", summary4); // Case 5: "<firstname>, <address>" - AutofillProfile profile5; + AutofillProfile profile5(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile5, "Marion", "Mitchell", "", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "16505678910"); @@ -132,7 +132,7 @@ EXPECT_EQ(u"Marion Mitchell, 123 Zoo St.", summary5); // Case 6: "<firstname> <lastname>" - AutofillProfile profile6; + AutofillProfile profile6(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile6, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "", "", "Hollywood", "CA", "91601", "US", "16505678910"); @@ -140,7 +140,7 @@ EXPECT_EQ(u"Marion Mitchell Morrison, Hollywood", summary6); // Case 7: "<firstname> <lastname>, <address>" - AutofillProfile profile7; + AutofillProfile profile7(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile7, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "16505678910"); @@ -149,7 +149,7 @@ // Case 7a: "<firstname> <lastname>, <address>" - same as #7, except for // e-mail. - AutofillProfile profile7a; + AutofillProfile profile7a(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile7a, "Marion", "Mitchell", "Morrison", "marion@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "16505678910"); @@ -168,11 +168,13 @@ TEST(AutofillProfileTest, AdjustInferredLabels) { std::vector<std::unique_ptr<AutofillProfile>> profiles; - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[0].get(), "John", "", "Doe", "johndoe@hades.com", "Underworld", "666 Erebus St.", "", "Elysium", "CA", "91111", "US", "16502111111"); - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[1].get(), "Jane", "", "Doe", "janedoe@tertium.com", "Pluto Inc.", "123 Letha Shore.", "", "Dis", "CA", "91222", "US", "12345678910"); @@ -183,7 +185,8 @@ EXPECT_EQ(u"John Doe, 666 Erebus St.", labels[0]); EXPECT_EQ(u"Jane Doe, 123 Letha Shore.", labels[1]); - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[2].get(), "John", "", "Doe", "johndoe@tertium.com", "Underworld", "666 Erebus St.", "", "Elysium", "CA", "91111", "US", "16502111111"); @@ -199,7 +202,8 @@ profiles.resize(2); - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[2].get(), "John", "", "Doe", "johndoe@hades.com", "Underworld", "666 Erebus St.", "", "Elysium", "CO", // State is different @@ -215,7 +219,8 @@ EXPECT_EQ(u"Jane Doe, 123 Letha Shore.", labels[1]); EXPECT_EQ(u"John Doe, 666 Erebus St., CO", labels[2]); - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[3].get(), "John", "", "Doe", "johndoe@hades.com", "Underworld", "666 Erebus St.", "", "Elysium", "CO", // State is different for some. @@ -233,7 +238,8 @@ // information. EXPECT_EQ(u"John Doe, 666 Erebus St., CO, 16504444444", labels[3]); - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[4].get(), "John", "", "Doe", "johndoe@styx.com", // E-Mail is different for some. "Underworld", "666 Erebus St.", "", "Elysium", @@ -258,7 +264,8 @@ TEST(AutofillProfileTest, CreateInferredLabelsI18n_CH) { std::vector<std::unique_ptr<AutofillProfile>> profiles; - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles.back().get(), "H.", "R.", "Giger", "hrgiger@beispiel.com", "Beispiel Inc", "Brandschenkestrasse 110", "", "Zurich", "", "8002", @@ -291,7 +298,8 @@ TEST(AutofillProfileTest, CreateInferredLabelsI18n_FR) { std::vector<std::unique_ptr<AutofillProfile>> profiles; - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles.back().get(), "Antoine", "", "de Saint-Exupéry", "antoine@exemple.com", "Exemple Inc", "8 Rue de Londres", "", "Paris", "", "75009", "FR", "+33 (0) 1 42 68 53 00"); @@ -325,7 +333,8 @@ TEST(AutofillProfileTest, CreateInferredLabelsI18n_KR) { std::vector<std::unique_ptr<AutofillProfile>> profiles; - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles.back().get(), "Park", "", "Jae-sang", "park@yeleul.com", "Yeleul Inc", "Gangnam Finance Center", "152 Teheran-ro", "Gangnam-Gu", @@ -369,7 +378,8 @@ TEST(AutofillProfileTest, CreateInferredLabelsI18n_JP_Latn) { std::vector<std::unique_ptr<AutofillProfile>> profiles; - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles.back().get(), "Miku", "", "Hatsune", "miku@rei.com", "Rei Inc", "Roppongi Hills Mori Tower", "6-10-1 Roppongi, Minato-ku", "", "Tokyo", "106-6126", @@ -406,7 +416,8 @@ TEST(AutofillProfileTest, CreateInferredLabelsI18n_JP_ja) { std::vector<std::unique_ptr<AutofillProfile>> profiles; - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles.back().get(), "ミク", "", "初音", "miku@rei.com", "例", "港区六本木ヒルズ森タワー", "六本木 6-10-1", "", "東京都", "106-6126", "JP", @@ -439,11 +450,13 @@ TEST(AutofillProfileTest, CreateInferredLabels) { std::vector<std::unique_ptr<AutofillProfile>> profiles; - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[0].get(), "John", "", "Doe", "johndoe@hades.com", "Underworld", "666 Erebus St.", "", "Elysium", "CA", "91111", "US", "16502111111"); - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[1].get(), "Jane", "", "Doe", "janedoe@tertium.com", "Pluto Inc.", "123 Letha Shore.", "", "Dis", "CA", "91222", "US", "12345678910"); @@ -534,10 +547,12 @@ // distinguishing fields, but only if it makes sense given the suggested fields. TEST(AutofillProfileTest, CreateInferredLabelsFallsBackToFullName) { std::vector<std::unique_ptr<AutofillProfile>> profiles; - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[0].get(), "John", "", "Doe", "doe@example.com", "", "88 Nowhere Ave.", "", "", "", "", "", ""); - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[1].get(), "Johnny", "K", "Doe", "doe@example.com", "", "88 Nowhere Ave.", "", "", "", "", "", ""); @@ -567,10 +582,12 @@ // Test that we do not show duplicate fields in the labels. TEST(AutofillProfileTest, CreateInferredLabelsNoDuplicatedFields) { std::vector<std::unique_ptr<AutofillProfile>> profiles; - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[0].get(), "John", "", "Doe", "doe@example.com", "", "88 Nowhere Ave.", "", "", "", "", "", ""); - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[1].get(), "John", "", "Doe", "dojo@example.com", "", "88 Nowhere Ave.", "", "", "", "", "", ""); @@ -589,13 +606,16 @@ // Make sure that empty fields are not treated as distinguishing fields. TEST(AutofillProfileTest, CreateInferredLabelsSkipsEmptyFields) { std::vector<std::unique_ptr<AutofillProfile>> profiles; - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[0].get(), "John", "", "Doe", "doe@example.com", "Gogole", "", "", "", "", "", "", ""); - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[1].get(), "John", "", "Doe", "doe@example.com", "Ggoole", "", "", "", "", "", "", ""); - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[2].get(), "John", "", "Doe", "john.doe@example.com", "Goolge", "", "", "", "", "", "", ""); @@ -625,7 +645,8 @@ // Test that labels that would otherwise have multiline values are flattened. TEST(AutofillProfileTest, CreateInferredLabelsFlattensMultiLineValues) { std::vector<std::unique_ptr<AutofillProfile>> profiles; - profiles.push_back(std::make_unique<AutofillProfile>()); + profiles.push_back(std::make_unique<AutofillProfile>( + i18n_model_definition::kLegacyHierarchyCountryCode)); test::SetProfileInfo(profiles[0].get(), "John", "", "Doe", "doe@example.com", "", "88 Nowhere Ave.", "Apt. 42", "", "", "", "", ""); @@ -655,15 +676,15 @@ } TEST(AutofillProfileTest, IsSubsetOfForFieldSet_DifferentMiddleNames) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Genevieve", "", "Fox", "", "", "", "", "", "", "", "US", ""); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Genevieve", "M", "Fox", "", "", "", "", "", "", "", "US", ""); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Genevieve", "Marie", "Fox", "", "", "", "", "", "", "", "US", ""); @@ -703,11 +724,11 @@ } TEST(AutofillProfileTest, IsSubsetOfForFieldSet_DifferentFirstNames) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Cynthia", "", "Fox", "", "", "", "", "", "", "", "US", ""); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Genevieve", "", "Fox", "", "", "", "", "", "", "", "US", ""); @@ -724,11 +745,11 @@ } TEST(AutofillProfileTest, IsSubsetOfForFieldSet_DifferentLastNames) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Genevieve", "", "Fuller", "", "", "", "", "", "", "", "US", ""); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Genevieve", "", "Fox", "", "", "", "", "", "", "", "US", ""); @@ -745,11 +766,11 @@ } TEST(AutofillProfileTest, IsSubsetOfForFieldSet_DifferentStreetAddresses) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); profile1.SetRawInfo(ADDRESS_HOME_COUNTRY, u"US"); profile1.SetRawInfo(ADDRESS_HOME_STREET_ADDRESS, u"274 Main St"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); profile2.SetRawInfo(ADDRESS_HOME_COUNTRY, u"US"); profile2.SetRawInfo(ADDRESS_HOME_STREET_ADDRESS, u"275 Main Street"); @@ -779,11 +800,11 @@ } TEST(AutofillProfileTest, IsSubsetOfForFieldSet_DifferentNonStreetAddresses) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Genevieve", "", "Fox", "", "", "274 Main St", "", "Northhampton", "", "", "US", ""); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Genevieve", "", "Fox", "", "", "274 Main St", "", "Sturbridge", "", "", "US", ""); @@ -799,11 +820,11 @@ TEST(AutofillProfileTest, IsSubsetOfForFieldSet_PostalCodesWithAndWithoutSpaces) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Genevieve", "", "Fox", "", "", "", "", "", "", "H3B 2Y5", "CA", ""); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Genevieve", "", "Fox", "", "", "", "", "", "", "H3B2Y5", "CA", ""); @@ -817,11 +838,11 @@ TEST(AutofillProfileTest, IsSubsetOfForFieldSet_PhoneNumbersWithAndWithoutSpacesAndPunctuation) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Genevieve", "", "Fox", "", "", "", "", "", "", "", "CA", "+1 (514) 444-5454"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Genevieve", "", "Fox", "", "", "", "", "", "", "", "CA", "15144445454"); @@ -840,17 +861,17 @@ TEST(AutofillProfileTest, IsSubsetOfForFieldSet_PhoneNumbersWithAndWithoutCodes_US) { // Has country and city codes. - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Genevieve", "", "Fox", "", "", "", "", "", "", "", "US", "+1 (508) 444-5454"); // Has a city code. - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Genevieve", "", "Fox", "", "", "", "", "", "", "", "US", "5084445454"); // Has neither a country nor a city code. - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Genevieve", "", "Fox", "", "", "", "", "", "", "", "US", "4445454"); @@ -886,17 +907,17 @@ TEST(AutofillProfileTest, IsSubsetOfForFieldSet_PhoneNumbersWithAndWithoutCodes_BR) { // Has country and city codes. - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Thiago", "", "Avila", "", "", "", "", "", "", "", "", "BR", "5521987650000"); // Has a city code. - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Thiago", "", "Avila", "", "", "", "", "", "", "", "", "BR", "21987650000"); // Has neither a country nor a city code. - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Thiago", "", "Avila", "", "", "", "", "", "", "", "", "BR", "987650000"); @@ -950,7 +971,7 @@ TEST(AutofillProfileTest, TestFinalizeAfterImport) { // A profile with just a full name should be finalizeable. { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfoWithVerificationStatus(NAME_FULL, u"Peter Pan", VerificationStatus::kObserved); EXPECT_TRUE(profile.FinalizeAfterImport()); @@ -967,7 +988,7 @@ // it is highly likely that this scenario is caused by a classification error // and would not yield a correctly imported name. { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfoWithVerificationStatus(NAME_FULL, u"Peter Pan", VerificationStatus::kObserved); profile.SetRawInfoWithVerificationStatus(NAME_FIRST, u"Michael", @@ -977,7 +998,7 @@ } TEST(AutofillProfileTest, SetAndGetRawInfoWithValidationStatus) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); // An unsupported type should return |kNoStatus|. EXPECT_EQ(profile.GetVerificationStatus(UNKNOWN_TYPE), VerificationStatus::kNoStatus); @@ -1002,7 +1023,7 @@ } TEST(AutofillProfileTest, SetAndGetInfoWithValidationStatus) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); // An unsupported type should return |kNoStatus|. EXPECT_EQ(profile.GetVerificationStatus(UNKNOWN_TYPE), VerificationStatus::kNoStatus); @@ -1044,7 +1065,7 @@ } TEST(AutofillProfileTest, MergeDataFrom_DifferentProfile) { - AutofillProfile a; + AutofillProfile a(i18n_model_definition::kLegacyHierarchyCountryCode); SetupTestProfile(a); // Create an identical profile except that the new profile: @@ -1076,7 +1097,7 @@ } TEST(AutofillProfileTest, MergeDataFrom_SameProfile) { - AutofillProfile a; + AutofillProfile a(i18n_model_definition::kLegacyHierarchyCountryCode); SetupTestProfile(a); // The profile has no full name yet. Merge will add it. @@ -1106,7 +1127,8 @@ base::test::ScopedFeatureList feature{ features::kAutofillTrackProfileTokenQuality}; - AutofillProfile a, b; + AutofillProfile a(i18n_model_definition::kLegacyHierarchyCountryCode); + AutofillProfile b((i18n_model_definition::kLegacyHierarchyCountryCode)); // Set the same state for both profiles. Expect that a's quality will be kept. a.SetRawInfo(ADDRESS_HOME_STATE, u"TX"); b.SetRawInfo(ADDRESS_HOME_STATE, u"TX"); @@ -1133,7 +1155,7 @@ } TEST(AutofillProfileTest, OverwriteName_AddNameFull) { - AutofillProfile a; + AutofillProfile a(i18n_model_definition::kLegacyHierarchyCountryCode); a.SetRawInfo(NAME_FIRST, u"Marion"); a.SetRawInfo(NAME_MIDDLE, u"Mitchell"); @@ -1156,7 +1178,7 @@ // Tests that OverwriteName overwrites the name parts if they have different // case. TEST(AutofillProfileTest, OverwriteName_DifferentCase) { - AutofillProfile a; + AutofillProfile a(i18n_model_definition::kLegacyHierarchyCountryCode); AutofillProfile b = a; a.SetRawInfoWithVerificationStatus(NAME_FIRST, u"marion", @@ -1183,13 +1205,13 @@ } TEST(AutofillProfileTest, AssignmentOperator) { - AutofillProfile a; + AutofillProfile a(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&a, "Marion", "Mitchell", "Morrison", "marion@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "12345678910"); // Result of assignment should be logically equal to the original profile. - AutofillProfile b; + AutofillProfile b(i18n_model_definition::kLegacyHierarchyCountryCode); b = a; EXPECT_TRUE(a == b); @@ -1199,7 +1221,7 @@ } TEST(AutofillProfileTest, Copy) { - AutofillProfile a; + AutofillProfile a(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&a, "Marion", "Mitchell", "Morrison", "marion@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "12345678910"); @@ -1210,8 +1232,8 @@ } TEST(AutofillProfileTest, Compare) { - AutofillProfile a; - AutofillProfile b; + AutofillProfile a(i18n_model_definition::kLegacyHierarchyCountryCode); + AutofillProfile b(i18n_model_definition::kLegacyHierarchyCountryCode); // Empty profiles are the same. EXPECT_EQ(0, a.Compare(b)); @@ -1296,8 +1318,10 @@ for (auto type : structured_types) { // Create two empty profiles to test the tokens individually. - AutofillProfile profile1; - AutofillProfile profile2; + AutofillProfile profile1( + i18n_model_definition::kLegacyHierarchyCountryCode); + AutofillProfile profile2( + i18n_model_definition::kLegacyHierarchyCountryCode); SCOPED_TRACE(testing::Message() << "Testing the Compare method for the type: " @@ -1320,7 +1344,7 @@ } TEST(AutofillProfileTest, IsPresentButInvalid) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); EXPECT_FALSE(profile.IsPresentButInvalid(ADDRESS_HOME_STATE)); EXPECT_FALSE(profile.IsPresentButInvalid(ADDRESS_HOME_ZIP)); EXPECT_FALSE(profile.IsPresentButInvalid(PHONE_HOME_WHOLE_NUMBER)); @@ -1354,7 +1378,7 @@ } TEST(AutofillProfileTest, SetRawInfoPreservesLineBreaks) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfo(ADDRESS_HOME_STREET_ADDRESS, u"123 Super St.\n" u"Apt. #42"); @@ -1365,7 +1389,7 @@ } TEST(AutofillProfileTest, SetInfoPreservesLineBreaks) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetInfo(ADDRESS_HOME_STREET_ADDRESS, u"123 Super St.\n" u"Apt. #42", @@ -1377,7 +1401,7 @@ } TEST(AutofillProfileTest, SetRawInfoDoesntTrimWhitespace) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfo(EMAIL_ADDRESS, u"\tuser@example.com "); EXPECT_EQ(u"\tuser@example.com ", profile.GetRawInfo(EMAIL_ADDRESS)); } @@ -1385,7 +1409,7 @@ TEST(AutofillProfileTest, SetRawInfoWorksForLandmark) { base::test::ScopedFeatureList feature_list( features::kAutofillEnableSupportForLandmark); - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfo(ADDRESS_HOME_LANDMARK, u"Red tree"); EXPECT_EQ(u"Red tree", profile.GetRawInfo(ADDRESS_HOME_LANDMARK)); @@ -1394,7 +1418,7 @@ TEST(AutofillProfileTest, SetRawInfoWorksForBetweenStreets) { base::test::ScopedFeatureList feature_list( features::kAutofillEnableSupportForBetweenStreets); - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfo(ADDRESS_HOME_BETWEEN_STREETS, u"Between streets example"); EXPECT_EQ(u"Between streets example", @@ -1402,13 +1426,13 @@ } TEST(AutofillProfileTest, SetInfoTrimsWhitespace) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetInfo(EMAIL_ADDRESS, u"\tuser@example.com ", "en-US"); EXPECT_EQ(u"user@example.com", profile.GetRawInfo(EMAIL_ADDRESS)); } TEST(AutofillProfileTest, SaveAdditionalInfo_Name_AddingNameFull) { - AutofillProfile a; + AutofillProfile a(i18n_model_definition::kLegacyHierarchyCountryCode); a.SetRawInfo(NAME_FIRST, u"Marion"); a.SetRawInfo(NAME_MIDDLE, u"Mitchell"); @@ -1429,7 +1453,7 @@ } TEST(AutofillProfileTest, SaveAdditionalInfo_Name_KeepNameFull) { - AutofillProfile a; + AutofillProfile a(i18n_model_definition::kLegacyHierarchyCountryCode); a.SetRawInfo(NAME_FIRST, u"Marion"); a.SetRawInfo(NAME_MIDDLE, u"Mitchell"); @@ -1451,7 +1475,7 @@ // non-empty fields overwriting the initial profiles values. TEST(AutofillProfileTest, SaveAdditionalInfo_Name_DifferentCaseAndDiacriticsNoNameFull) { - AutofillProfile a; + AutofillProfile a(i18n_model_definition::kLegacyHierarchyCountryCode); a.SetRawInfoWithVerificationStatus(NAME_FIRST, u"marion", kObserved); a.SetRawInfoWithVerificationStatus(NAME_MIDDLE, u"mitchell", kObserved); @@ -1483,7 +1507,7 @@ // Tests that no loss of information happens when SavingAdditionalInfo with a // profile with an empty name part. TEST(AutofillProfileTest, SaveAdditionalInfo_Name_LossOfInformation) { - AutofillProfile a; + AutofillProfile a(i18n_model_definition::kLegacyHierarchyCountryCode); a.SetRawInfo(NAME_FIRST, u"Marion"); a.SetRawInfo(NAME_MIDDLE, u"Mitchell"); @@ -1502,13 +1526,13 @@ // Tests that merging two complementary profiles for names results in a profile // with a complete name. TEST(AutofillProfileTest, SaveAdditionalInfo_Name_ComplementaryInformation) { - AutofillProfile a; + AutofillProfile a(i18n_model_definition::kLegacyHierarchyCountryCode); a.SetRawInfo(NAME_FIRST, u"Marion"); a.SetRawInfo(NAME_MIDDLE, u"Mitchell"); a.SetRawInfo(NAME_LAST, u"Morrison"); a.FinalizeAfterImport(); - AutofillProfile b; + AutofillProfile b(i18n_model_definition::kLegacyHierarchyCountryCode); b.SetRawInfo(NAME_FULL, u"Marion Mitchell Morrison"); b.FinalizeAfterImport(); @@ -1525,7 +1549,7 @@ // Test that the label is correctly set and retrieved from the profile. TEST(AutofillProfileTest, SetAndGetProfileLabels) { - AutofillProfile p; + AutofillProfile p(i18n_model_definition::kLegacyHierarchyCountryCode); EXPECT_EQ(p.profile_label(), std::string()); p.set_profile_label("my label"); @@ -1533,10 +1557,10 @@ } TEST(AutofillProfileTest, LabelsInAssignmentAndComparisonOperator) { - AutofillProfile p1; + AutofillProfile p1(i18n_model_definition::kLegacyHierarchyCountryCode); p1.set_profile_label("my label"); - AutofillProfile p2; + AutofillProfile p2(i18n_model_definition::kLegacyHierarchyCountryCode); p2 = p1; // Check that the label was assigned correctly to p2. @@ -1552,7 +1576,7 @@ // seconds have passed. TEST(AutofillProfileTest, RecordUseAndLog_Delay) { TestAutofillClock clock; - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); // AutofillProfile is initialized with a `use_count()` of 1 and a last used // date of `AutofillClock::Now()`. ASSERT_EQ(profile.use_count(), 1u); @@ -1573,7 +1597,7 @@ // Tests that the |HasStructuredData| returns whether the profile has structured // data or not. TEST(AutofillProfileTest, HasStructuredData) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfoWithVerificationStatus( NAME_FULL, u"marion mitchell morrison", kObserved); EXPECT_FALSE(profile.HasStructuredData()); @@ -1607,7 +1631,8 @@ return !inaccessible_fields.empty(); }; - AutofillProfile actual_profile; + AutofillProfile actual_profile( + i18n_model_definition::kLegacyHierarchyCountryCode); actual_profile.SetRawInfo(NAME_FIRST, u"Florian"); // State is uncommon in Germany and inaccessible in the settings. Expect it @@ -1636,7 +1661,7 @@ } TEST(AutofillProfileTest, GetNonEmptyRawTypes) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Marion", nullptr, "Morrison", "johnwayne@me.xyz", nullptr, "123 Zoo St.", nullptr, "Hollywood", "CA", "91601", "US", "14155678910"); @@ -1666,7 +1691,7 @@ } TEST(AutofillProfileTest, GetStorableTypeOf) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); // Test that additional types are mapped to their stored types EXPECT_EQ(profile.GetStorableTypeOf(ADDRESS_HOME_LINE1), ADDRESS_HOME_STREET_ADDRESS);
diff --git a/components/autofill/core/browser/data_model/phone_number_unittest.cc b/components/autofill/core/browser/data_model/phone_number_unittest.cc index d9b4476..57ec961 100644 --- a/components/autofill/core/browser/data_model/phone_number_unittest.cc +++ b/components/autofill/core/browser/data_model/phone_number_unittest.cc
@@ -44,7 +44,7 @@ features::kAutofillEnableSupportForPhoneNumberTrunkTypes, trunk_types_enabled); - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfo(ADDRESS_HOME_COUNTRY, country); PhoneNumber phone_number(&profile); // `kLocale` is irrelevant, because `profile` has country information. @@ -122,7 +122,7 @@ // Verify that `PhoneNumber::SetInfo()` correctly formats the incoming number. // `kLocale` is irrelevant, as `profile` has a country. TEST(PhoneNumberTest, SetInfo) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfo(ADDRESS_HOME_COUNTRY, u"US"); PhoneNumber phone(&profile); @@ -174,7 +174,7 @@ complement_calling_code_enabled.InitAndEnableFeature( features::kAutofillInferCountryCallingCode); - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); PhoneNumber phone(&profile); // No country information available and thus no calling code inferred. @@ -215,7 +215,7 @@ // Test that cached phone numbers are correctly invalidated and updated. TEST(PhoneNumberTest, UpdateCachedPhoneNumber) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfo(ADDRESS_HOME_COUNTRY, u"US"); PhoneNumber phone(&profile); @@ -240,7 +240,7 @@ } TEST(PhoneNumberTest, PhoneCombineHelper) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfo(ADDRESS_HOME_COUNTRY, u"US"); PhoneNumber::PhoneCombineHelper number1; @@ -291,7 +291,7 @@ } TEST(PhoneNumberTest, HelperSetsAllPhoneFieldTypes) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); PhoneNumber phone_number(&profile); ServerFieldTypeSet types; @@ -308,7 +308,7 @@ } TEST(PhoneNumberTest, InternationalPhoneHomeCityAndNumber_US) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfo(ADDRESS_HOME_COUNTRY, u"US"); // Set phone number so country_code == 1, city_code = 650, number = 2345678. std::u16string phone(u"+1 (650) 234-5678"); @@ -320,7 +320,7 @@ // This is a regression test for crbug.com/638795. TEST(PhoneNumberTest, InternationalPhoneHomeCityAndNumber_DE) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfo(ADDRESS_HOME_COUNTRY, u"DE"); // Set phone number so country_code == 49, city_code = 174, number = 12 34 // 567. @@ -334,7 +334,7 @@ } TEST(PhoneNumberTest, TrunkPrefix) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); // Constructs a `PhoneNumber` object from `number` and verifies that the // city-code and city-and-number types with and without trunk prefix are @@ -402,7 +402,7 @@ // Tests that PHONE_HOME_NUMBER_PREFIX and PHONE_HOME_NUMBER_PREFIX are // extracted correctly. TEST(PhoneNumberTest, NumberPreAndSuffixes) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); // Constructs a `PhoneNumber` object from `number` and verifies that the // pre- and suffix match the expectation. @@ -439,7 +439,7 @@ // Tests that extensions are not stored and even stripped from the raw info. TEST(PhoneNumberTest, Extension) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); PhoneNumber phone(&profile); const std::string locale = "en-US"; EXPECT_TRUE(phone.SetInfo(PHONE_HOME_WHOLE_NUMBER, u"(650) 234-2345 ext. 234", @@ -452,7 +452,7 @@ // Tests whether the |PHONE_HOME_COUNTRY_CODE| is added to the set of matching // types. TEST(PhoneNumberTest, CountryCodeInMatchingTypes) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfo(ADDRESS_HOME_COUNTRY, u"US"); // Set the phone number such that country_code == 1, city_code = 650, // number = 2345678. @@ -495,7 +495,7 @@ // Tests that the |PHONE_HOME_COUNTRY_CODE| should not be added to the set of // matching types. TEST(PhoneNumberTest, CountryCodeNotInMatchingTypes) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfo(ADDRESS_HOME_COUNTRY, u"US"); // Set phone number so country_code == 1, city_code = 650, number = 2345678. std::u16string phone(u"1 [650] 234-5678");
diff --git a/components/autofill/core/browser/form_data_importer.h b/components/autofill/core/browser/form_data_importer.h index 79c8055..b6da3ca 100644 --- a/components/autofill/core/browser/form_data_importer.h +++ b/components/autofill/core/browser/form_data_importer.h
@@ -196,7 +196,7 @@ ~AddressProfileImportCandidate(); // The profile that was extracted from the form. - AutofillProfile profile; + AutofillProfile profile{i18n_model_definition::kLegacyHierarchyCountryCode}; // The URL the profile was extracted from. GURL url; // Indicates if all import requirements have been fulfilled.
diff --git a/components/autofill/core/browser/form_data_importer_unittest.cc b/components/autofill/core/browser/form_data_importer_unittest.cc index 30c91ca..1464df4 100644 --- a/components/autofill/core/browser/form_data_importer_unittest.cc +++ b/components/autofill/core/browser/form_data_importer_unittest.cc
@@ -203,7 +203,7 @@ // profile is finalizes in the end. AutofillProfile ConstructProfileFromTypeValuePairs( TypeValuePairs type_value_pairs) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); for (const auto& [type, value] : type_value_pairs) { profile.SetRawInfoWithVerificationStatus(type, base::UTF8ToUTF16(value), VerificationStatus::kObserved); @@ -1702,18 +1702,6 @@ ImportAddressProfileAndVerifyImportOfNoProfile(*form_structure); } -// Tests that a profile with an empty name is not imported. -TEST_F(FormDataImporterTest, ImportAddressProfiles_MissingName) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndEnableFeature( - features::kAutofillRequireNameForProfileImport); - TypeValuePairs type_value_pairs = GetDefaultProfileTypeValuePairs(); - SetValueForType(type_value_pairs, NAME_FIRST, ""); - SetValueForType(type_value_pairs, NAME_LAST, ""); - ImportAddressProfileAndVerifyImportOfNoProfile( - *ConstructFormStructureFromTypeValuePairs(type_value_pairs)); -} - // Tests that a profile is created for countries with composed names. TEST_F(FormDataImporterTest, ImportAddressProfiles_CompleteComposedCountryName) { @@ -1738,7 +1726,7 @@ nullptr); ExtractAddressProfiles(/*extraction_successful=*/true, form_structure); - AutofillProfile expected; + AutofillProfile expected(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&expected, "George", nullptr, "Washington", "theprez@gmail.com", nullptr, "No. 43 Bo Aung Gyaw Street", nullptr, "Yangon", "", @@ -3592,7 +3580,7 @@ scoped_feature_list.InitAndEnableFeature( features::kAutofillSilentProfileUpdateForInsufficientImport); - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "12345678910"); @@ -3641,7 +3629,7 @@ scoped_feature_list.InitAndEnableFeature( features::kAutofillSilentProfileUpdateForInsufficientImport); - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "12345678910"); @@ -3689,7 +3677,7 @@ scoped_feature_list.InitAndEnableFeature( features::kAutofillSilentProfileUpdateForInsufficientImport); - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "12345678910");
diff --git a/components/autofill/core/browser/form_data_importer_utils_unittest.cc b/components/autofill/core/browser/form_data_importer_utils_unittest.cc index 962a0a6..49073c4 100644 --- a/components/autofill/core/browser/form_data_importer_utils_unittest.cc +++ b/components/autofill/core/browser/form_data_importer_utils_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "components/autofill/core/browser/form_data_importer_utils.h" +#include "components/autofill/core/browser/country_type.h" #include <vector> @@ -82,9 +83,9 @@ } TEST(FormDataImporterUtilsTest, GetPredictedCountryCode) { - AutofillProfile us_profile; - us_profile.SetRawInfo(ADDRESS_HOME_COUNTRY, u"US"); - AutofillProfile empty_profile; + AutofillProfile us_profile(AddressCountryCode("US")); + AutofillProfile empty_profile( + i18n_model_definition::kLegacyHierarchyCountryCode); // Test prioritization: profile > variation service state > app locale EXPECT_EQ(GetPredictedCountryCode(us_profile, GeoIpCountryCode("DE"), "de-AT", nullptr),
diff --git a/components/autofill/core/browser/geo/address_i18n_unittest.cc b/components/autofill/core/browser/geo/address_i18n_unittest.cc index ecdf627a..7aa2e0c 100644 --- a/components/autofill/core/browser/geo/address_i18n_unittest.cc +++ b/components/autofill/core/browser/geo/address_i18n_unittest.cc
@@ -108,7 +108,7 @@ } TEST(AddressI18nTest, CreateAddressDataFromAutofillProfile) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "John", "H.", "Doe", "johndoe@hades.com", "Underworld", "666 Erebus St.", "Apt 8", "Elysium", "CA", "91111", "US", "16502111111");
diff --git a/components/autofill/core/browser/geo/alternative_state_name_map_updater_unittest.cc b/components/autofill/core/browser/geo/alternative_state_name_map_updater_unittest.cc index a943c7e..e75ab01 100644 --- a/components/autofill/core/browser/geo/alternative_state_name_map_updater_unittest.cc +++ b/components/autofill/core/browser/geo/alternative_state_name_map_updater_unittest.cc
@@ -11,6 +11,7 @@ #include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "components/autofill/core/browser/autofill_test_utils.h" +#include "components/autofill/core/browser/country_type.h" #include "components/autofill/core/browser/geo/alternative_state_name_map.h" #include "components/autofill/core/browser/geo/alternative_state_name_map_test_utils.h" #include "components/autofill/core/browser/geo/mock_alternative_state_name_map_updater.h" @@ -268,9 +269,8 @@ base::WriteFile(GetPath().AppendASCII("DE"), test::CreateStatesProtoAsString()); - AutofillProfile profile; + AutofillProfile profile(AddressCountryCode("DE")); profile.SetInfo(ADDRESS_HOME_STATE, u"Bavaria", "en-US"); - profile.SetInfo(ADDRESS_HOME_COUNTRY, u"DE", "en-US"); base::RunLoop run_loop; MockAlternativeStateNameMapUpdater mock_alternative_state_name_updater(
diff --git a/components/autofill/core/browser/geo/autofill_country.cc b/components/autofill/core/browser/geo/autofill_country.cc index 5b26bf64..07af920 100644 --- a/components/autofill/core/browser/geo/autofill_country.cc +++ b/components/autofill/core/browser/geo/autofill_country.cc
@@ -202,9 +202,6 @@ } bool AutofillCountry::IsAddressFieldRequired(ServerFieldType field_type) const { - if (field_type == ServerFieldType::NAME_FULL && requires_full_name()) { - return true; - } auto* mapping_it = kRequiredFieldMapping.find(field_type); return mapping_it != kRequiredFieldMapping.end() && (required_fields_for_address_import_ & mapping_it->second);
diff --git a/components/autofill/core/browser/geo/autofill_country.h b/components/autofill/core/browser/geo/autofill_country.h index e31f98a2b..c246197 100644 --- a/components/autofill/core/browser/geo/autofill_country.h +++ b/components/autofill/core/browser/geo/autofill_country.h
@@ -80,12 +80,6 @@ // the constructor. If no `locale` was provided, an empty string is returned. const std::u16string& name() const { return name_; } - // Full name is expected in a complete address for this country. - bool requires_full_name() const { - return base::FeatureList::IsEnabled( - features::kAutofillRequireNameForProfileImport); - } - // City is expected in a complete address for this country. bool requires_city() const { return (required_fields_for_address_import_ & ADDRESS_REQUIRES_CITY) != 0;
diff --git a/components/autofill/core/browser/geo/autofill_country_unittest.cc b/components/autofill/core/browser/geo/autofill_country_unittest.cc index c11b858..0c58bed5 100644 --- a/components/autofill/core/browser/geo/autofill_country_unittest.cc +++ b/components/autofill/core/browser/geo/autofill_country_unittest.cc
@@ -156,26 +156,6 @@ ServerFieldType::ADDRESS_HOME_STREET_ADDRESS)); } -// Test the full name requirement depending on the -// kAutofillRequireNameForProfileImport feature flag. -TEST(AutofillCountryTest, IsAddressFieldRequired_RequireName) { - AutofillCountry country("US", "en_US"); - - { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndDisableFeature( - features::kAutofillRequireNameForProfileImport); - EXPECT_FALSE(country.IsAddressFieldRequired(ServerFieldType::NAME_FULL)); - } - - { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndEnableFeature( - features::kAutofillRequireNameForProfileImport); - EXPECT_TRUE(country.IsAddressFieldRequired(ServerFieldType::NAME_FULL)); - } -} - // Test mapping all country codes to country names. TEST(AutofillCountryTest, AllCountryCodesHaveCountryName) { std::set<std::string> expected_failures;
diff --git a/components/autofill/core/browser/geo/phone_number_i18n_unittest.cc b/components/autofill/core/browser/geo/phone_number_i18n_unittest.cc index 7b7732e5..0b9b924 100644 --- a/components/autofill/core/browser/geo/phone_number_i18n_unittest.cc +++ b/components/autofill/core/browser/geo/phone_number_i18n_unittest.cc
@@ -319,9 +319,9 @@ TEST_P(GetFormattedPhoneNumberForDisplayTest, GetFormattedPhoneNumberForDisplay) { - AutofillProfile profile; + AutofillProfile profile( + AddressCountryCode(base::UTF16ToUTF8(GetParam().country))); profile.SetRawInfo(PHONE_HOME_WHOLE_NUMBER, GetParam().phone); - profile.SetRawInfo(ADDRESS_HOME_COUNTRY, GetParam().country); EXPECT_EQ(GetParam().expected_format, i18n::GetFormattedPhoneNumberForDisplay( profile, GetParam().locale)); }
diff --git a/components/autofill/core/browser/manual_testing_import_unittest.cc b/components/autofill/core/browser/manual_testing_import_unittest.cc index 3a902cb..4fb66ef 100644 --- a/components/autofill/core/browser/manual_testing_import_unittest.cc +++ b/components/autofill/core/browser/manual_testing_import_unittest.cc
@@ -194,7 +194,9 @@ ] })"); - AutofillProfile expected_profile1(AutofillProfile::Source::kLocalOrSyncable); + AutofillProfile expected_profile1( + AutofillProfile::Source::kLocalOrSyncable, + i18n_model_definition::kLegacyHierarchyCountryCode); expected_profile1.SetRawInfoWithVerificationStatus( NAME_FULL, u"first last", VerificationStatus::kObserved); expected_profile1.SetRawInfoWithVerificationStatus( @@ -204,7 +206,9 @@ expected_profile1.SetRawInfoWithVerificationStatus( NAME_LAST_SECOND, u"last", VerificationStatus::kObserved); - AutofillProfile expected_profile2(AutofillProfile::Source::kAccount); + AutofillProfile expected_profile2( + AutofillProfile::Source::kAccount, + i18n_model_definition::kLegacyHierarchyCountryCode); expected_profile2.set_initial_creator_id(999); expected_profile2.SetRawInfoWithVerificationStatus( ADDRESS_HOME_STREET_ADDRESS, u"street 123", @@ -341,7 +345,9 @@ ] })"); - AutofillProfile expected_profile1(AutofillProfile::Source::kLocalOrSyncable); + AutofillProfile expected_profile1( + AutofillProfile::Source::kLocalOrSyncable, + i18n_model_definition::kLegacyHierarchyCountryCode); expected_profile1.SetRawInfoWithVerificationStatus( NAME_FULL, u"first last", VerificationStatus::kObserved); expected_profile1.SetRawInfoWithVerificationStatus(
diff --git a/components/autofill/core/browser/metrics/address_rewriter_in_profile_subset_metrics_unittest.cc b/components/autofill/core/browser/metrics/address_rewriter_in_profile_subset_metrics_unittest.cc index 1d1d6ef..b91a266 100644 --- a/components/autofill/core/browser/metrics/address_rewriter_in_profile_subset_metrics_unittest.cc +++ b/components/autofill/core/browser/metrics/address_rewriter_in_profile_subset_metrics_unittest.cc
@@ -49,12 +49,10 @@ TEST_P(AddressRewriterInProfileSubsetMetricsTest, AddressRewriterInProfileSubsetMetricsTestCase) { AddressRewriterInProfileSubsetMetricsTestCase test_case = GetParam(); - AutofillProfile profile_a; - profile_a.SetRawInfo(ADDRESS_HOME_COUNTRY, u"US"); + AutofillProfile profile_a(AddressCountryCode("US")); profile_a.SetRawInfo(ADDRESS_HOME_STREET_ADDRESS, test_case.address_line_a); - AutofillProfile profile_b; - profile_b.SetRawInfo(ADDRESS_HOME_COUNTRY, u"US"); + AutofillProfile profile_b(AddressCountryCode("US")); profile_b.SetRawInfo(ADDRESS_HOME_STREET_ADDRESS, test_case.address_line_b); base::HistogramTester histogram_tester; @@ -82,15 +80,13 @@ TEST_F(AddressRewriterInProfileSubsetMetricsTest, UserAcceptsPreviouslyHiddenSuggestion) { - AutofillProfile profile_a; - profile_a.SetRawInfo(ADDRESS_HOME_COUNTRY, u"US"); + AutofillProfile profile_a(AddressCountryCode("US")); profile_a.SetRawInfo(NAME_FULL, u"first last"); profile_a.SetRawInfo(ADDRESS_HOME_LINE1, u"123 Main Street"); profile_a.SetRawInfo(EMAIL_ADDRESS, u"email@foo.com"); personal_data().AddProfile(profile_a); - AutofillProfile profile_b; - profile_b.SetRawInfo(ADDRESS_HOME_COUNTRY, u"US"); + AutofillProfile profile_b(AddressCountryCode("US")); profile_b.SetRawInfo(NAME_FULL, u"first last"); profile_b.SetRawInfo(ADDRESS_HOME_LINE1, u"124 Main Street"); personal_data().AddProfile(profile_b);
diff --git a/components/autofill/core/browser/metrics/autofill_metrics_test_base.cc b/components/autofill/core/browser/metrics/autofill_metrics_test_base.cc index 1f2d34d..55f430e 100644 --- a/components/autofill/core/browser/metrics/autofill_metrics_test_base.cc +++ b/components/autofill/core/browser/metrics/autofill_metrics_test_base.cc
@@ -106,7 +106,7 @@ personal_data().ClearProfiles(); CreateTestAutofillProfiles(); - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "John", "Decca", "Public", "john@gmail.com", "Company", "123 Main St.", "unit 7", "Springfield", "Texas", "79401", "US", "2345678901"); @@ -117,7 +117,7 @@ void AutofillMetricsBaseTest::RecreateProfile() { personal_data().ClearProfiles(); - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); SetProfileTestData(&profile); personal_data().AddProfile(profile); personal_data().Refresh(); @@ -298,7 +298,7 @@ } void AutofillMetricsBaseTest::CreateTestAutofillProfiles() { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Elvis", "Aaron", "Presley", "theking@gmail.com", "RCA", "3734 Elvis Presley Blvd.", "Apt. 10", "Memphis", "Tennessee", "38116", "US", @@ -306,7 +306,7 @@ profile1.set_guid(kTestProfileId); personal_data().AddProfile(profile1); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Charles", "Hardin", "Holley", "buddy@gmail.com", "Decca", "123 Apple St.", "unit 6", "Lubbock", "Texas", "79401", "US", "2345678901");
diff --git a/components/autofill/core/browser/metrics/autofill_metrics_unittest.cc b/components/autofill/core/browser/metrics/autofill_metrics_unittest.cc index 22bfa91..587e0f95 100644 --- a/components/autofill/core/browser/metrics/autofill_metrics_unittest.cc +++ b/components/autofill/core/browser/metrics/autofill_metrics_unittest.cc
@@ -5259,7 +5259,7 @@ // Test that we log the days since last use of a profile when it is used. TEST_F(AutofillMetricsTest, DaysSinceLastUse_Profile) { base::HistogramTester histogram_tester; - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.set_use_date(AutofillClock::Now() - base::Days(13)); profile.RecordAndLogUse(); histogram_tester.ExpectBucketCount("Autofill.DaysSinceLastUse.Profile", 13, @@ -5269,7 +5269,7 @@ // Test that we log the verification status of name tokens. TEST_F(AutofillMetricsTest, LogVerificationStatusesOfNameTokens) { base::HistogramTester histogram_tester; - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfoWithVerificationStatus(NAME_FULL, u"First Last", VerificationStatus::kObserved); profile.SetRawInfoWithVerificationStatus(NAME_FIRST, u"First", @@ -5306,7 +5306,7 @@ // Test that we log the verification status of address tokens.. TEST_F(AutofillMetricsTest, LogVerificationStatusesOfAddressTokens) { base::HistogramTester histogram_tester; - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetRawInfoWithVerificationStatus(ADDRESS_HOME_STREET_ADDRESS, u"123 StreetName", VerificationStatus::kFormatted);
diff --git a/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.cc b/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.cc index 2a551a4e..b08c104 100644 --- a/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.cc +++ b/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.cc
@@ -114,6 +114,15 @@ NOTREACHED_NORETURN(); } +void LogRiskBasedAuthAttempt(CreditCard::RecordType card_type) { + std::string card_type_histogram_string = + AutofillMetrics::GetHistogramStringForCardType(card_type); + base::UmaHistogramBoolean( + base::StrCat( + {"Autofill.RiskBasedAuth", card_type_histogram_string, ".Attempt"}), + true); +} + void LogRiskBasedAuthResult(CreditCard::RecordType card_type, RiskBasedAuthEvent event) { std::string card_type_histogram_string =
diff --git a/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.h b/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.h index e26e983..7ec12055 100644 --- a/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.h +++ b/components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.h
@@ -182,10 +182,13 @@ kMaxValue = kUnexpectedError }; +// Logs when a risk-based authentication starts. +void LogRiskBasedAuthAttempt(CreditCard::RecordType card_type); + // Logs when a risk-based authentication finishes. void LogRiskBasedAuthResult(CreditCard::RecordType card_type, RiskBasedAuthEvent event); } // namespace autofill::autofill_metrics -#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_METRICS_PAYMENTS_CARD_UNMASK_AUTHNTICATION_METRICS_H_ +#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_METRICS_PAYMENTS_CARD_UNMASK_AUTHENTICATION_METRICS_H_
diff --git a/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.cc b/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.cc index 31941fc..4561ab3 100644 --- a/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.cc +++ b/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.cc
@@ -39,6 +39,9 @@ case ServerCardUnmaskFlowType::kRiskBased: flow_type_suffix = ".RiskBased"; break; + case ServerCardUnmaskFlowType::kDeviceUnlock: + flow_type_suffix = ".DeviceUnlock"; + break; } base::UmaHistogramEnumeration(
diff --git a/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.h b/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.h index 9793314..4775ec70 100644 --- a/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.h +++ b/components/autofill/core/browser/metrics/payments/card_unmask_flow_metrics.h
@@ -55,7 +55,9 @@ kOtpFallbackFromFido = 3, // Risk-based auth with no challenge involved. kRiskBased = 4, - kMaxValue = kRiskBased, + // Device unlock auth was offered. + kDeviceUnlock = 5, + kMaxValue = kDeviceUnlock, }; void LogServerCardUnmaskAttempt(AutofillClient::PaymentsRpcCardType card_type);
diff --git a/components/autofill/core/browser/metrics/profile_import_metrics.h b/components/autofill/core/browser/metrics/profile_import_metrics.h index b5c52a2b..2dd06439 100644 --- a/components/autofill/core/browser/metrics/profile_import_metrics.h +++ b/components/autofill/core/browser/metrics/profile_import_metrics.h
@@ -59,12 +59,9 @@ // line 1 or a house number. kLine1OrHouseNumberRequirementFulfilled = 26, kLine1OrHouseNumberRequirementViolated = 27, - // If required by `kAutofillRequireNameForProfileImportsFromForms` feature, - // the form must contain a non-empty name. - kNameRequirementFulfilled = 28, - kNameRequirementViolated = 29, - // Must be set to the last entry. - kMaxValue = kNameRequirementViolated, + kDeprecatedNameRequirementFulfilled = 28, + kDeprecatedNameRequirementViolated = 29, + kMaxValue = kDeprecatedNameRequirementViolated, }; // Represents the status of the field type requirements that are specific to
diff --git a/components/autofill/core/browser/metrics/profile_import_metrics_unittest.cc b/components/autofill/core/browser/metrics/profile_import_metrics_unittest.cc index f9feba8..8e99cda 100644 --- a/components/autofill/core/browser/metrics/profile_import_metrics_unittest.cc +++ b/components/autofill/core/browser/metrics/profile_import_metrics_unittest.cc
@@ -114,8 +114,6 @@ // 'perfect' profile import. TEST_F(AutofillProfileImportMetricsTest, ProfileImportRequirements_AllFulfilled) { - base::test::ScopedFeatureList features; - features.InitAndEnableFeature(features::kAutofillRequireNameForProfileImport); // Set up our form data. FormData form = GetAndAddSeenForm( {.description_for_logging = "ProfileImportRequirements_AllFulfilled", @@ -159,9 +157,7 @@ {AddressImportRequirements::kLine1RequirementFulfilled, true}, {AddressImportRequirements::kLine1RequirementViolated, false}, {AddressImportRequirements::kZipOrStateRequirementFulfilled, true}, - {AddressImportRequirements::kZipOrStateRequirementViolated, false}, - {AddressImportRequirements::kNameRequirementFulfilled, true}, - {AddressImportRequirements::kNameRequirementViolated, false}}; + {AddressImportRequirements::kZipOrStateRequirementViolated, false}}; TestAddressProfileImportRequirements(&histogram_tester, expectations); @@ -225,9 +221,7 @@ {AddressImportRequirements::kLine1RequirementFulfilled, false}, {AddressImportRequirements::kLine1RequirementViolated, true}, {AddressImportRequirements::kZipOrStateRequirementFulfilled, true}, - {AddressImportRequirements::kZipOrStateRequirementViolated, false}, - {AddressImportRequirements::kNameRequirementFulfilled, false}, - {AddressImportRequirements::kNameRequirementViolated, false}}; + {AddressImportRequirements::kZipOrStateRequirementViolated, false}}; TestAddressProfileImportRequirements(&histogram_tester, expectations); @@ -242,8 +236,6 @@ // 'perfect' profile import. TEST_F(AutofillProfileImportMetricsTest, ProfileImportRequirements_AllFulfilledForNonStateCountry) { - base::test::ScopedFeatureList features; - features.InitAndEnableFeature(features::kAutofillRequireNameForProfileImport); // Set up our form data. FormData form = test::GetFormData( {.description_for_logging = @@ -295,9 +287,7 @@ {AddressImportRequirements::kLine1RequirementFulfilled, true}, {AddressImportRequirements::kLine1RequirementViolated, false}, {AddressImportRequirements::kZipOrStateRequirementFulfilled, true}, - {AddressImportRequirements::kZipOrStateRequirementViolated, false}, - {AddressImportRequirements::kNameRequirementFulfilled, true}, - {AddressImportRequirements::kNameRequirementViolated, false}}; + {AddressImportRequirements::kZipOrStateRequirementViolated, false}}; TestAddressProfileImportRequirements(&histogram_tester, expectations); // All country specific field requirements have been fulfilled. @@ -310,8 +300,6 @@ // completely filled profile but with invalid values. TEST_F(AutofillProfileImportMetricsTest, ProfileImportRequirements_FilledButInvalidZipEmailAndState) { - base::test::ScopedFeatureList features; - features.InitAndEnableFeature(features::kAutofillRequireNameForProfileImport); // Set up our form data. test::FormDescription form_description = { .description_for_logging = @@ -358,9 +346,7 @@ {AddressImportRequirements::kLine1RequirementFulfilled, true}, {AddressImportRequirements::kLine1RequirementViolated, false}, {AddressImportRequirements::kZipOrStateRequirementFulfilled, true}, - {AddressImportRequirements::kZipOrStateRequirementViolated, false}, - {AddressImportRequirements::kNameRequirementFulfilled, true}, - {AddressImportRequirements::kNameRequirementViolated, false}}; + {AddressImportRequirements::kZipOrStateRequirementViolated, false}}; TestAddressProfileImportRequirements(&histogram_tester, expectations); @@ -374,8 +360,6 @@ // profile with multiple email addresses. TEST_F(AutofillProfileImportMetricsTest, ProfileImportRequirements_NonUniqueEmail) { - base::test::ScopedFeatureList features; - features.InitAndEnableFeature(features::kAutofillRequireNameForProfileImport); // Set up our form data. FormData form = test::GetFormData( {.description_for_logging = "ProfileImportRequirements_NonUniqueEmail", @@ -431,9 +415,7 @@ {AddressImportRequirements::kLine1RequirementFulfilled, true}, {AddressImportRequirements::kLine1RequirementViolated, false}, {AddressImportRequirements::kZipOrStateRequirementFulfilled, true}, - {AddressImportRequirements::kZipOrStateRequirementViolated, false}, - {AddressImportRequirements::kNameRequirementFulfilled, true}, - {AddressImportRequirements::kNameRequirementViolated, false}}; + {AddressImportRequirements::kZipOrStateRequirementViolated, false}}; TestAddressProfileImportRequirements(&histogram_tester, expectations); @@ -498,9 +480,7 @@ {AddressImportRequirements::kLine1RequirementFulfilled, true}, {AddressImportRequirements::kLine1RequirementViolated, false}, {AddressImportRequirements::kZipOrStateRequirementFulfilled, true}, - {AddressImportRequirements::kZipOrStateRequirementViolated, false}, - {AddressImportRequirements::kNameRequirementFulfilled, false}, - {AddressImportRequirements::kNameRequirementViolated, false}}; + {AddressImportRequirements::kZipOrStateRequirementViolated, false}}; TestAddressProfileImportRequirements(&histogram_tester, expectations); @@ -511,57 +491,4 @@ ZIP_STATE_CITY_REQUIREMENT_VIOLATED); } -// Test that the ProfileImportRequirements are all counted as fulfilled, except -// for the name requirement which was violated. -TEST_F(AutofillProfileImportMetricsTest, - ProfileImportRequirements_AllFulfilledButName) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndEnableFeature( - features::kAutofillRequireNameForProfileImport); - // Set up our form data. - FormData form = GetAndAddSeenForm( - {.description_for_logging = "ProfileImportRequirements_AllButName", - .fields = { - {.role = NAME_FULL, .value = u""}, - {.role = ADDRESS_HOME_LINE1, .value = u"3734 Elvis Presley Blvd."}, - {.role = ADDRESS_HOME_CITY, .value = u"New York"}, - {.role = PHONE_HOME_CITY_AND_NUMBER, .value = u"2345678901"}, - {.role = ADDRESS_HOME_STATE, .value = u"CA"}, - {.role = ADDRESS_HOME_ZIP, .value = u"37373"}, - {.role = ADDRESS_HOME_COUNTRY, .value = u"USA"}}}); - FillTestProfile(form); - base::HistogramTester histogram_tester; - SubmitForm(form); - std::vector<AddressProfileImportRequirementExpectations> expectations = { - {AddressImportRequirements::kStateValidRequirementFulfilled, true}, - {AddressImportRequirements::kStateValidRequirementViolated, false}, - {AddressImportRequirements::kEmailValidRequirementFulfilled, true}, - {AddressImportRequirements::kEmailValidRequirementViolated, false}, - {AddressImportRequirements::kZipValidRequirementFulfilled, true}, - {AddressImportRequirements::kZipValidRequirementViolated, false}, - {AddressImportRequirements::kEmailAddressUniqueRequirementFulfilled, - true}, - {AddressImportRequirements::kEmailAddressUniqueRequirementViolated, - false}, - {AddressImportRequirements::kNoInvalidFieldTypesRequirementFulfilled, - true}, - {AddressImportRequirements::kNoInvalidFieldTypesRequirementViolated, - false}, - {AddressImportRequirements::kCityRequirementFulfilled, true}, - {AddressImportRequirements::kCityRequirementViolated, false}, - {AddressImportRequirements::kZipRequirementFulfilled, true}, - {AddressImportRequirements::kZipRequirementViolated, false}, - {AddressImportRequirements::kStateRequirementFulfilled, true}, - {AddressImportRequirements::kStateRequirementViolated, false}, - {AddressImportRequirements::kOverallRequirementFulfilled, false}, - {AddressImportRequirements::kOverallRequirementViolated, true}, - {AddressImportRequirements::kLine1RequirementFulfilled, true}, - {AddressImportRequirements::kLine1RequirementViolated, false}, - {AddressImportRequirements::kZipOrStateRequirementFulfilled, true}, - {AddressImportRequirements::kZipOrStateRequirementViolated, false}, - {AddressImportRequirements::kNameRequirementFulfilled, false}, - {AddressImportRequirements::kNameRequirementViolated, true}}; - TestAddressProfileImportRequirements(&histogram_tester, expectations); -} - } // namespace autofill::autofill_metrics
diff --git a/components/autofill/core/browser/payments/credit_card_access_manager.cc b/components/autofill/core/browser/payments/credit_card_access_manager.cc index 65d0626e..9366fc90 100644 --- a/components/autofill/core/browser/payments/credit_card_access_manager.cc +++ b/components/autofill/core/browser/payments/credit_card_access_manager.cc
@@ -1578,12 +1578,17 @@ : autofill_metrics::MandatoryReauthAuthenticationFlowEvent:: kFlowFailed); CHECK(card); + autofill_metrics::LogServerCardUnmaskResult( + successful_auth + ? autofill_metrics::ServerCardUnmaskResult::kAuthenticationUnmasked + : autofill_metrics::ServerCardUnmaskResult::kAuthenticationError, + card->record_type(), + autofill_metrics::ServerCardUnmaskFlowType::kDeviceUnlock); + std::move(on_credit_card_fetched_callback_) .Run(successful_auth ? CreditCardFetchResult::kSuccess : CreditCardFetchResult::kTransientError, card); - // TODO(crbug.com/1427216): Add logging for the payments autofill device - // authentication flow. // `accessor->OnCreditCardFetched()` makes a copy of `card` and `cvc` before // it asynchronously fills them into the form. Thus we can safely call // `Reset()` here, and we should as from this class' point of view the
diff --git a/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc b/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc index 657b543..00f04350 100644 --- a/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc +++ b/components/autofill/core/browser/payments/credit_card_access_manager_unittest.cc
@@ -693,25 +693,31 @@ EXPECT_EQ(accessor_->number(), kTestNumber16); EXPECT_EQ(accessor_->cvc(), kTestCvc16); } - std::string histogram_name = + std::string reauth_usage_histogram_name = "Autofill.PaymentMethods.CheckoutFlow.ReauthUsage.LocalCard"; - histogram_name += isBiometric() ? ".Biometric" : ".ScreenLock"; + reauth_usage_histogram_name += isBiometric() ? ".Biometric" : ".ScreenLock"; if (IsMandatoryReauthEnabled()) { histogram_tester.ExpectBucketCount( - histogram_name, + reauth_usage_histogram_name, autofill_metrics::MandatoryReauthAuthenticationFlowEvent::kFlowStarted, 1); histogram_tester.ExpectBucketCount( - histogram_name, + reauth_usage_histogram_name, MandatoryReauthResponseIsSuccess() ? autofill_metrics::MandatoryReauthAuthenticationFlowEvent:: kFlowSucceeded : autofill_metrics::MandatoryReauthAuthenticationFlowEvent:: kFlowFailed, 1); + histogram_tester.ExpectUniqueSample( + "Autofill.ServerCardUnmask.LocalCard.Result.DeviceUnlock", + MandatoryReauthResponseIsSuccess() + ? autofill_metrics::ServerCardUnmaskResult::kAuthenticationUnmasked + : autofill_metrics::ServerCardUnmaskResult::kAuthenticationError, + 1); } else { histogram_tester.ExpectBucketCount( - histogram_name, + reauth_usage_histogram_name, autofill_metrics::MandatoryReauthAuthenticationFlowEvent::kFlowStarted, 0); } @@ -759,25 +765,31 @@ EXPECT_EQ(accessor_->expiry_month(), base::UTF8ToUTF16(test::NextMonth())); EXPECT_EQ(accessor_->expiry_year(), base::UTF8ToUTF16(test::NextYear())); } - std::string histogram_name = + std::string reauth_usage_histogram_name = "Autofill.PaymentMethods.CheckoutFlow.ReauthUsage.VirtualCard"; - histogram_name += isBiometric() ? ".Biometric" : ".ScreenLock"; + reauth_usage_histogram_name += isBiometric() ? ".Biometric" : ".ScreenLock"; if (IsMandatoryReauthEnabled()) { histogram_tester.ExpectBucketCount( - histogram_name, + reauth_usage_histogram_name, autofill_metrics::MandatoryReauthAuthenticationFlowEvent::kFlowStarted, 1); histogram_tester.ExpectBucketCount( - histogram_name, + reauth_usage_histogram_name, MandatoryReauthResponseIsSuccess() ? autofill_metrics::MandatoryReauthAuthenticationFlowEvent:: kFlowSucceeded : autofill_metrics::MandatoryReauthAuthenticationFlowEvent:: kFlowFailed, 1); + histogram_tester.ExpectUniqueSample( + "Autofill.ServerCardUnmask.VirtualCard.Result.DeviceUnlock", + MandatoryReauthResponseIsSuccess() + ? autofill_metrics::ServerCardUnmaskResult::kAuthenticationUnmasked + : autofill_metrics::ServerCardUnmaskResult::kAuthenticationError, + 1); } else { histogram_tester.ExpectBucketCount( - histogram_name, + reauth_usage_histogram_name, autofill_metrics::MandatoryReauthAuthenticationFlowEvent::kFlowStarted, 0); } @@ -823,25 +835,31 @@ EXPECT_EQ(accessor_->result(), CreditCardFetchResult::kSuccess); EXPECT_EQ(accessor_->number(), base::UTF8ToUTF16(test_number)); } - std::string histogram_name = + std::string reauth_usage_histogram_name = "Autofill.PaymentMethods.CheckoutFlow.ReauthUsage.ServerCard"; - histogram_name += isBiometric() ? ".Biometric" : ".ScreenLock"; + reauth_usage_histogram_name += isBiometric() ? ".Biometric" : ".ScreenLock"; if (IsMandatoryReauthEnabled()) { histogram_tester.ExpectBucketCount( - histogram_name, + reauth_usage_histogram_name, autofill_metrics::MandatoryReauthAuthenticationFlowEvent::kFlowStarted, 1); histogram_tester.ExpectBucketCount( - histogram_name, + reauth_usage_histogram_name, MandatoryReauthResponseIsSuccess() ? autofill_metrics::MandatoryReauthAuthenticationFlowEvent:: kFlowSucceeded : autofill_metrics::MandatoryReauthAuthenticationFlowEvent:: kFlowFailed, 1); + histogram_tester.ExpectUniqueSample( + "Autofill.ServerCardUnmask.ServerCard.Result.DeviceUnlock", + MandatoryReauthResponseIsSuccess() + ? autofill_metrics::ServerCardUnmaskResult::kAuthenticationUnmasked + : autofill_metrics::ServerCardUnmaskResult::kAuthenticationError, + 1); } else { histogram_tester.ExpectBucketCount( - histogram_name, + reauth_usage_histogram_name, autofill_metrics::MandatoryReauthAuthenticationFlowEvent::kFlowStarted, 0); }
diff --git a/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.cc b/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.cc index 539a209..5bba0f0 100644 --- a/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.cc +++ b/components/autofill/core/browser/payments/credit_card_risk_based_authenticator.cc
@@ -76,6 +76,7 @@ void CreditCardRiskBasedAuthenticator::OnDidGetUnmaskRiskData( const std::string& risk_data) { unmask_request_details_->risk_data = risk_data; + autofill_metrics::LogRiskBasedAuthAttempt(card_.record_type()); autofill_client_->GetPaymentsNetworkInterface()->UnmaskCard( *unmask_request_details_, base::BindOnce(
diff --git a/components/autofill/core/browser/payments/credit_card_risk_based_authenticator_unittest.cc b/components/autofill/core/browser/payments/credit_card_risk_based_authenticator_unittest.cc index e63f6e87..21c7809 100644 --- a/components/autofill/core/browser/payments/credit_card_risk_based_authenticator_unittest.cc +++ b/components/autofill/core/browser/payments/credit_card_risk_based_authenticator_unittest.cc
@@ -83,6 +83,16 @@ payments_network_interface()->unmask_request()->risk_data.empty()); } +// Ensures that ServerCard authentication attempts are logged correctly. +TEST_F(CreditCardRiskBasedAuthenticatorTest, + AuthServerCardAttemptLoggedCorrectly) { + base::HistogramTester histogram_tester; + authenticator_->Authenticate(card_, requester_->GetWeakPtr()); + + histogram_tester.ExpectUniqueSample( + "Autofill.RiskBasedAuth.ServerCard.Attempt", true, 1); +} + // Test that risk-based authentication returns the full PAN upon success. TEST_F(CreditCardRiskBasedAuthenticatorTest, AuthenticateServerCardSuccess) { base::HistogramTester histogram_tester; @@ -199,6 +209,17 @@ autofill_metrics::RiskBasedAuthEvent::kAuthenticationRequired, 1); } +// Ensures that VirtualCard authentication attempts are logged correctly. +TEST_F(CreditCardRiskBasedAuthenticatorTest, + AuthVirtualCardAttemptLoggedCorrectly) { + base::HistogramTester histogram_tester; + authenticator_->Authenticate(test::GetVirtualCard(), + requester_->GetWeakPtr()); + + histogram_tester.ExpectUniqueSample( + "Autofill.RiskBasedAuth.VirtualCard.Attempt", true, 1); +} + // Test a success risk based virtual card unmask request. TEST_F(CreditCardRiskBasedAuthenticatorTest, VirtualCardUnmaskSuccess) { // Name on Card: Lorem Ipsum;
diff --git a/components/autofill/core/browser/payments/payments_network_interface_unittest.cc b/components/autofill/core/browser/payments/payments_network_interface_unittest.cc index d589efd..445d179 100644 --- a/components/autofill/core/browser/payments/payments_network_interface_unittest.cc +++ b/components/autofill/core/browser/payments/payments_network_interface_unittest.cc
@@ -601,7 +601,7 @@ base::StringPiece state, base::StringPiece zip, base::StringPiece phone_number) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); profile.SetInfo(NAME_FIRST, base::ASCIIToUTF16(first_name), "en-US"); profile.SetInfo(NAME_LAST, base::ASCIIToUTF16(last_name), "en-US");
diff --git a/components/autofill/core/browser/payments/virtual_card_enroll_metrics_logger.h b/components/autofill/core/browser/payments/virtual_card_enroll_metrics_logger.h index 7310944..33e4f609 100644 --- a/components/autofill/core/browser/payments/virtual_card_enroll_metrics_logger.h +++ b/components/autofill/core/browser/payments/virtual_card_enroll_metrics_logger.h
@@ -72,4 +72,4 @@ } // namespace autofill -#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_VIRTUAL_CARD_ENROLL_METRICS_LOGGER_H_ +#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PAYMENTS_VIRTUAL_CARD_ENROLL_METRICS_LOGGER_H_
diff --git a/components/autofill/core/browser/personal_data_manager_cleaner_unittest.cc b/components/autofill/core/browser/personal_data_manager_cleaner_unittest.cc index e88ebb6..fbc665f 100644 --- a/components/autofill/core/browser/personal_data_manager_cleaner_unittest.cc +++ b/components/autofill/core/browser/personal_data_manager_cleaner_unittest.cc
@@ -148,7 +148,7 @@ TEST_F(PersonalDataManagerCleanerTest, ApplyDedupingRoutine_MergedProfileValues) { // Create a profile with a higher ranking score. - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Homer", "J", "Simpson", "homer.simpson@abc.com", "", "742. Evergreen Terrace", "", "Springfield", "IL", "91601", "US", ""); @@ -156,7 +156,7 @@ profile1.set_use_date(AutofillClock::Now() - base::Days(1)); // Create a profile with a medium ranking score. - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Homer", "Jay", "Simpson", "homer.simpson@abc.com", "", "742 Evergreen Terrace", "", "Springfield", "IL", "91601", "", "12345678910"); @@ -164,7 +164,7 @@ profile2.set_use_date(AutofillClock::Now() - base::Days(3)); // Create a profile with a lower ranking score. - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Homer", "J", "Simpson", "homer.simpson@abc.com", "Fox", "742 Evergreen Terrace.", "", "Springfield", "IL", "91601", "", ""); @@ -231,7 +231,7 @@ TEST_F(PersonalDataManagerCleanerTest, ApplyDedupingRoutine_MultipleDedupes) { // Create a Homer home profile with a higher ranking score than other Homer // profiles. - AutofillProfile Homer1; + AutofillProfile Homer1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&Homer1, "Homer", "J", "Simpson", "homer.simpson@abc.com", "", "742. Evergreen Terrace", "", "Springfield", "IL", "91601", "US", ""); @@ -240,7 +240,7 @@ // Create a Homer home profile with a medium ranking score compared to other // Homer profiles. - AutofillProfile Homer2; + AutofillProfile Homer2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&Homer2, "Homer", "Jay", "Simpson", "homer.simpson@abc.com", "", "742 Evergreen Terrace", "", "Springfield", "IL", "91601", "", "12345678910"); @@ -249,7 +249,7 @@ // Create a Homer home profile with a lower ranking score than other Homer // profiles. - AutofillProfile Homer3; + AutofillProfile Homer3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&Homer3, "Homer", "J", "Simpson", "homer.simpson@abc.com", "Fox", "742 Evergreen Terrace.", "", "Springfield", "IL", "91601", "", ""); @@ -257,7 +257,7 @@ Homer3.set_use_date(AutofillClock::Now() - base::Days(5)); // Create a Homer work profile (different address). - AutofillProfile Homer4; + AutofillProfile Homer4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&Homer4, "Homer", "J", "Simpson", "homer.simpson@abc.com", "Fox", "12 Nuclear Plant.", "", "Springfield", "IL", "91601", "US", "9876543"); @@ -265,7 +265,7 @@ Homer4.set_use_date(AutofillClock::Now() - base::Days(5)); // Create a Barney profile (guest user). - AutofillProfile Barney; + AutofillProfile Barney(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&Barney, "Barney", "", "Gumble", "barney.gumble@abc.com", "ABC", "123 Other Street", "", "Springfield", "IL", "91601", "", ""); @@ -342,7 +342,7 @@ TEST_F(PersonalDataManagerCleanerTest, ApplyDedupingRoutine_NopIfOneProfile) { // Create a profile to dedupe. - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Homer", "J", "Simpson", "homer.simpson@abc.com", "", "742. Evergreen Terrace", "", "Springfield", "IL", "91601", "US", ""); @@ -357,13 +357,13 @@ // version. TEST_F(PersonalDataManagerCleanerTest, ApplyDedupingRoutine_OncePerVersion) { // Create a profile to dedupe. - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Homer", "J", "Simpson", "homer.simpson@abc.com", "", "742. Evergreen Terrace", "", "Springfield", "IL", "91601", "US", ""); // Create a similar profile. - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Homer", "J", "Simpson", "homer.simpson@abc.com", "Fox", "742 Evergreen Terrace.", "", "Springfield", "IL", "91601", "", ""); @@ -383,7 +383,7 @@ EXPECT_EQ(1U, profiles.size()); // Add another duplicate profile. - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Homer", "J", "Simpson", "homer.simpson@abc.com", "Fox", "742 Evergreen Terrace.", "", "Springfield", "IL", "91601", "", ""); @@ -452,11 +452,11 @@ features::kAutofillRemoveInaccessibleProfileValuesOnStartup); // Add a German and a US profile. - AutofillProfile profile0; + AutofillProfile profile0(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile0, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "DE", "12345678910"); - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Josephine", "Alicia", "Saenz", "joewayne@me.xyz", "Fox", "903 Apple Ct.", nullptr, "Orlando", "FL", "32801", "US", "19482937549");
diff --git a/components/autofill/core/browser/personal_data_manager_unittest.cc b/components/autofill/core/browser/personal_data_manager_unittest.cc index b4c02468..4d8236f8 100644 --- a/components/autofill/core/browser/personal_data_manager_unittest.cc +++ b/components/autofill/core/browser/personal_data_manager_unittest.cc
@@ -157,7 +157,7 @@ } AutofillProfile GetDefaultProfile() { - AutofillProfile profile; + AutofillProfile profile(AddressCountryCode("US")); test::SetProfileInfo(&profile, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St", "unit 5", "Hollywood", "CA", "91601", "US", "12345678910", @@ -632,7 +632,7 @@ // Test filling profiles with unicode strings and crazy characters. TEST_F(PersonalDataManagerTest, AddProfile_CrazyCharacters) { std::vector<AutofillProfile> profiles; - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); profile1.SetRawInfo(NAME_FIRST, u"\u0623\u0648\u0628\u0627\u0645\u0627 " u"\u064a\u0639\u062a\u0630\u0631 " @@ -661,7 +661,7 @@ profile1.FinalizeAfterImport(); profiles.push_back(profile1); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); profile2.SetRawInfo(NAME_FIRST, u"\u4e0a\u6d77\u5e02\u91d1\u5c71\u533a " u"\u677e\u9690\u9547\u4ead\u67ab\u516c" @@ -671,13 +671,13 @@ profile2.FinalizeAfterImport(); profiles.push_back(profile2); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); profile3.SetRawInfo(EMAIL_ADDRESS, u"sue@example.com"); profile3.SetRawInfo(COMPANY_NAME, u"Company X"); profile3.FinalizeAfterImport(); profiles.push_back(profile3); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); profile4.SetRawInfo(NAME_FIRST, u"Joe 3254"); profile4.SetRawInfo(NAME_LAST, u"\u8bb0\u8d262\u5e74\u591a"); profile4.SetRawInfo(ADDRESS_HOME_ZIP, @@ -692,7 +692,7 @@ profile4.FinalizeAfterImport(); profiles.push_back(profile4); - AutofillProfile profile5; + AutofillProfile profile5(i18n_model_definition::kLegacyHierarchyCountryCode); profile5.SetRawInfo(NAME_FIRST, u"Larry"); profile5.SetRawInfo(NAME_LAST, u"\u0938\u094d\u091f\u093e\u0902\u092a " @@ -703,7 +703,7 @@ profile5.FinalizeAfterImport(); profiles.push_back(profile5); - AutofillProfile profile6; + AutofillProfile profile6(i18n_model_definition::kLegacyHierarchyCountryCode); profile6.SetRawInfo(NAME_FIRST, u"\u4e0a\u6d77\u5e02\u91d1\u5c71\u533a " u"\u677e\u9690\u9547\u4ead\u67ab\u516c" @@ -719,7 +719,7 @@ profile6.FinalizeAfterImport(); profiles.push_back(profile6); - AutofillProfile profile7; + AutofillProfile profile7(i18n_model_definition::kLegacyHierarchyCountryCode); profile7.SetRawInfo(NAME_FIRST, u"&$%$$$ TESTO *&*&^&^& MOKO"); profile7.SetRawInfo(NAME_MIDDLE, u"WOHOOOO$$$$$$$$****"); profile7.SetRawInfo(EMAIL_ADDRESS, u"yuvu@example.com"); @@ -747,7 +747,8 @@ // for duplicates. TEST_F(PersonalDataManagerTest, AddProfile_Invalid) { // First try profiles with invalid ZIP input. - AutofillProfile without_invalid; + AutofillProfile without_invalid( + i18n_model_definition::kLegacyHierarchyCountryCode); without_invalid.SetRawInfo(NAME_FIRST, u"Will"); without_invalid.SetRawInfo(ADDRESS_HOME_CITY, u"Sunnyvale"); without_invalid.SetRawInfo(ADDRESS_HOME_STATE, u"CA"); @@ -766,17 +767,17 @@ } TEST_F(PersonalDataManagerTest, AddUpdateRemoveProfiles) { - AutofillProfile profile0; + AutofillProfile profile0(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile0, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "12345678910"); - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Josephine", "Alicia", "Saenz", "joewayne@me.xyz", "Fox", "903 Apple Ct.", nullptr, "Orlando", "FL", "32801", "US", "19482937549"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Josephine", "Alicia", "Saenz", "joewayne@me.xyz", "Fox", "1212 Center.", "Bld. 5", "Orlando", "FL", "32801", "US", "19482937549"); @@ -1681,12 +1682,12 @@ #endif TEST_F(PersonalDataManagerTest, AddProfilesAndCreditCards) { - AutofillProfile profile0; + AutofillProfile profile0(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile0, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "12345678910"); - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Josephine", "Alicia", "Saenz", "joewayne@me.xyz", "Fox", "903 Apple Ct.", nullptr, "Orlando", "FL", "32801", "US", "19482937549"); @@ -1735,7 +1736,7 @@ // Test for http://crbug.com/50047. Makes sure that guids are populated // correctly on load. TEST_F(PersonalDataManagerTest, PopulateUniqueIDsOnLoad) { - AutofillProfile profile0; + AutofillProfile profile0(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile0, "y", "", "", "", "", "", "", "", "", "", "", ""); @@ -1748,7 +1749,7 @@ EXPECT_EQ(0, profile0.Compare(*results2[0])); // Add a new profile. - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "z", "", "", "", "", "", "", "", "", "", "", ""); AddProfileToPersonalDataManager(profile1); @@ -1805,7 +1806,7 @@ } TEST_F(PersonalDataManagerTest, SetEmptyProfile) { - AutofillProfile profile0; + AutofillProfile profile0(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile0, "", "", "", "", "", "", "", "", "", "", "", ""); @@ -1841,12 +1842,12 @@ } TEST_F(PersonalDataManagerTest, Refresh) { - AutofillProfile profile0; + AutofillProfile profile0(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile0, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "12345678910"); - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Josephine", "Alicia", "Saenz", "joewayne@me.xyz", "Fox", "903 Apple Ct.", nullptr, "Orlando", "FL", "32801", "US", "19482937549"); @@ -1860,7 +1861,7 @@ profiles.push_back(&profile1); ExpectSameElements(profiles, personal_data_->GetProfiles()); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Josephine", "Alicia", "Saenz", "joewayne@me.xyz", "Fox", "1212 Center.", "Bld. 5", "Orlando", "FL", "32801", "US", "19482937549"); @@ -1940,7 +1941,7 @@ EXPECT_EQ(0U, non_empty_types.size()); // Test with one profile stored. - AutofillProfile profile0; + AutofillProfile profile0(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile0, "Marion", nullptr, "Morrison", "johnwayne@me.xyz", nullptr, "123 Zoo St.", nullptr, "Hollywood", "CA", "91601", "US", "14155678910"); @@ -1979,12 +1980,12 @@ testing::UnorderedElementsAreArray(expected_types)); // Test with multiple profiles stored. - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Josephine", "Alicia", "Saenz", "joewayne@me.xyz", "Fox", "903 Apple Ct.", nullptr, "Orlando", "FL", "32801", "US", "16502937549"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Josephine", "Alicia", "Saenz", "joewayne@me.xyz", "Fox", "1212 Center.", "Bld. 5", "Orlando", "FL", "32801", "US", "16502937549"); @@ -2216,7 +2217,7 @@ } TEST_F(PersonalDataManagerTest, UpdateLanguageCodeInProfile) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "12345678910"); @@ -2242,7 +2243,8 @@ ASSERT_TRUE(TurnOnSyncFeature()); // Add two different profiles, a local and a server one. - AutofillProfile local_profile; + AutofillProfile local_profile( + i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&local_profile, "Josephine", "Alicia", "Saenz", "joewayne@me.xyz", "Fox", "1212 Center.", "Bld. 5", "Orlando", "FL", "32801", "US", "19482937549"); @@ -2267,7 +2269,8 @@ ASSERT_TRUE(TurnOnSyncFeature()); // Add two different profiles, a local and a server one. - AutofillProfile local_profile; + AutofillProfile local_profile( + i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&local_profile, "Josephine", "Alicia", "Saenz", "joewayne@me.xyz", "Fox", "1212 Center.", "Bld. 5", "Orlando", "FL", "32801", "US", "19482937549"); @@ -3351,7 +3354,7 @@ EXPECT_EQ(local_card.LastFourDigits(), cards[0]->LastFourDigits()); // Add a local profile - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St", "unit 5", "Hollywood", "CA", "91601", "US", "12345678910");
diff --git a/components/autofill/core/browser/profile_requirement_utils.cc b/components/autofill/core/browser/profile_requirement_utils.cc index 282ae5d..dec6521 100644 --- a/components/autofill/core/browser/profile_requirement_utils.cc +++ b/components/autofill/core/browser/profile_requirement_utils.cc
@@ -28,8 +28,7 @@ AddressImportRequirement::kStateRequirementViolated, AddressImportRequirement::kZipRequirementViolated, AddressImportRequirement::kZipOrStateRequirementViolated, - AddressImportRequirement::kLine1OrHouseNumberRequirementViolated, - AddressImportRequirement::kNameRequirementViolated}; + AddressImportRequirement::kLine1OrHouseNumberRequirementViolated}; } // anonymous namespace @@ -74,38 +73,28 @@ // Include the details of the country to the log. LOG_AF(import_log_buffer) << country; - bool is_valid = ValidateAndLog( - country.requires_line1(), {ADDRESS_HOME_LINE1, ADDRESS_HOME_STREET_NAME}, - AddressImportRequirement::kLine1RequirementFulfilled, - AddressImportRequirement::kLine1RequirementViolated); - is_valid &= - ValidateAndLog(country.requires_city(), {ADDRESS_HOME_CITY}, - AddressImportRequirement::kCityRequirementFulfilled, - AddressImportRequirement::kCityRequirementViolated); - is_valid &= - ValidateAndLog(country.requires_state(), {ADDRESS_HOME_STATE}, - AddressImportRequirement::kStateRequirementFulfilled, - AddressImportRequirement::kStateRequirementViolated); - is_valid &= ValidateAndLog(country.requires_zip(), {ADDRESS_HOME_ZIP}, - AddressImportRequirement::kZipRequirementFulfilled, - AddressImportRequirement::kZipRequirementViolated); - is_valid &= ValidateAndLog( - country.requires_zip_or_state(), {ADDRESS_HOME_ZIP, ADDRESS_HOME_STATE}, - AddressImportRequirement::kZipOrStateRequirementFulfilled, - AddressImportRequirement::kZipOrStateRequirementViolated); - is_valid &= ValidateAndLog( + ValidateAndLog(country.requires_line1(), + {ADDRESS_HOME_LINE1, ADDRESS_HOME_STREET_NAME}, + AddressImportRequirement::kLine1RequirementFulfilled, + AddressImportRequirement::kLine1RequirementViolated); + ValidateAndLog(country.requires_city(), {ADDRESS_HOME_CITY}, + AddressImportRequirement::kCityRequirementFulfilled, + AddressImportRequirement::kCityRequirementViolated); + ValidateAndLog(country.requires_state(), {ADDRESS_HOME_STATE}, + AddressImportRequirement::kStateRequirementFulfilled, + AddressImportRequirement::kStateRequirementViolated); + ValidateAndLog(country.requires_zip(), {ADDRESS_HOME_ZIP}, + AddressImportRequirement::kZipRequirementFulfilled, + AddressImportRequirement::kZipRequirementViolated); + ValidateAndLog(country.requires_zip_or_state(), + {ADDRESS_HOME_ZIP, ADDRESS_HOME_STATE}, + AddressImportRequirement::kZipOrStateRequirementFulfilled, + AddressImportRequirement::kZipOrStateRequirementViolated); + ValidateAndLog( country.requires_line1_or_house_number(), {ADDRESS_HOME_LINE1, ADDRESS_HOME_HOUSE_NUMBER}, AddressImportRequirement::kLine1OrHouseNumberRequirementFulfilled, AddressImportRequirement::kLine1OrHouseNumberRequirementViolated); - // TODO(crbug.com/1413205): Only check for the full name if all other - // requirements are fulfilled. This is relevant for feature-enrolement. - // Remove `is_valid` and check in every case once the feature is launched. - if (is_valid && country.requires_full_name()) { - ValidateAndLog(/*required=*/true, {NAME_FULL}, - AddressImportRequirement::kNameRequirementFulfilled, - AddressImportRequirement::kNameRequirementViolated); - } return address_import_requirements; }
diff --git a/components/autofill/core/browser/profile_token_quality_unittest.cc b/components/autofill/core/browser/profile_token_quality_unittest.cc index 78f2b1f..e371ad2 100644 --- a/components/autofill/core/browser/profile_token_quality_unittest.cc +++ b/components/autofill/core/browser/profile_token_quality_unittest.cc
@@ -84,7 +84,7 @@ }; TEST_F(ProfileTokenQualityTest, GetObservationTypesForFieldType) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); ProfileTokenQuality quality(&profile); EXPECT_TRUE(quality.GetObservationTypesForFieldType(NAME_FIRST).empty());
diff --git a/components/autofill/core/browser/strike_databases/strike_database.h b/components/autofill/core/browser/strike_databases/strike_database.h index 0bf9fd6..b583cde 100644 --- a/components/autofill/core/browser/strike_databases/strike_database.h +++ b/components/autofill/core/browser/strike_databases/strike_database.h
@@ -156,4 +156,4 @@ } // namespace autofill -#endif // COMPONENTS_AUTOFILL_CORE_STRIKE_DATABASES_BROWSER_STRIKE_DATABASE_H_ +#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_STRIKE_DATABASES_STRIKE_DATABASE_H_
diff --git a/components/autofill/core/browser/test_address_normalizer.h b/components/autofill/core/browser/test_address_normalizer.h index 311ff6c5..16819ca1 100644 --- a/components/autofill/core/browser/test_address_normalizer.h +++ b/components/autofill/core/browser/test_address_normalizer.h
@@ -44,7 +44,7 @@ void CompleteAddressNormalization(); private: - AutofillProfile profile_; + AutofillProfile profile_{i18n_model_definition::kLegacyHierarchyCountryCode}; AddressNormalizer::NormalizationCallback callback_; bool instantaneous_normalization_ = true;
diff --git a/components/autofill/core/browser/test_utils/test_profiles.cc b/components/autofill/core/browser/test_utils/test_profiles.cc index 0b9359a..39defcb 100644 --- a/components/autofill/core/browser/test_utils/test_profiles.cc +++ b/components/autofill/core/browser/test_utils/test_profiles.cc
@@ -47,13 +47,12 @@ } AutofillProfile StandardProfile() { - AutofillProfile profile; + AutofillProfile profile(AddressCountryCode("US")); const std::vector<ProfileTestData> observed_profile_test_data = { {NAME_FULL, "Pablo Diego de la Ruiz y Picasso", VerificationStatus::kUserVerified}, {ADDRESS_HOME_STREET_ADDRESS, "123 Mainstreet", VerificationStatus::kObserved}, - {ADDRESS_HOME_COUNTRY, "US", VerificationStatus::kObserved}, {ADDRESS_HOME_STATE, "CA", VerificationStatus::kObserved}, {ADDRESS_HOME_ZIP, "98765", VerificationStatus::kObserved}, {ADDRESS_HOME_CITY, "Mountainview", VerificationStatus::kObserved}}; @@ -62,13 +61,12 @@ } AutofillProfile UpdateableStandardProfile() { - AutofillProfile profile; + AutofillProfile profile(AddressCountryCode("US")); const std::vector<ProfileTestData> observed_profile_test_data = { {NAME_FULL, "Pablo Diego de la Ruiz y Picasso", VerificationStatus::kObserved}, {ADDRESS_HOME_STREET_ADDRESS, "123 Mainstreet", VerificationStatus::kObserved}, - {ADDRESS_HOME_COUNTRY, "US", VerificationStatus::kObserved}, {ADDRESS_HOME_STATE, "CA", VerificationStatus::kObserved}, {ADDRESS_HOME_ZIP, "98765", VerificationStatus::kObserved}, {ADDRESS_HOME_CITY, "Mountainview", VerificationStatus::kObserved}}; @@ -77,11 +75,10 @@ } AutofillProfile SubsetOfStandardProfile() { - AutofillProfile profile; + AutofillProfile profile(AddressCountryCode("US")); const std::vector<ProfileTestData> observed_profile_test_data = { {NAME_FULL, "Pablo Diego de la Ruiz y Picasso"}, {ADDRESS_HOME_STREET_ADDRESS, "123 Mainstreet"}, - {ADDRESS_HOME_COUNTRY, "US"}, {ADDRESS_HOME_STATE, "CA"}, {ADDRESS_HOME_ZIP, ""}, {ADDRESS_HOME_CITY, ""}}; @@ -90,11 +87,10 @@ } AutofillProfile DifferentFromStandardProfile() { - AutofillProfile profile; + AutofillProfile profile(AddressCountryCode("US")); const std::vector<ProfileTestData> observed_profile_test_data = { {NAME_FULL, "Neo Anderson"}, {ADDRESS_HOME_STREET_ADDRESS, "119 Some Avenue"}, - {ADDRESS_HOME_COUNTRY, "US"}, {ADDRESS_HOME_STATE, "CA"}, {ADDRESS_HOME_ZIP, "99666"}, {ADDRESS_HOME_CITY, "Los Angeles"}};
diff --git a/components/autofill/core/browser/ui/address_contact_form_label_formatter_unittest.cc b/components/autofill/core/browser/ui/address_contact_form_label_formatter_unittest.cc index b6ea8cf..4927701 100644 --- a/components/autofill/core/browser/ui/address_contact_form_label_formatter_unittest.cc +++ b/components/autofill/core/browser/ui/address_contact_form_label_formatter_unittest.cc
@@ -40,30 +40,30 @@ TEST(AddressContactFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedName) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Sarah", "", "Revere", "sarah.revere@aol.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", "16175232338"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "L", "Kennedy", "", "", "151 Irving Ave", "", "Hyannis", "MA", "02601", "US", "6175141600"); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Paul", "", "Revere", "paul1775@gmail.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", ""); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "Deborah", "", "Katabi", "deborah@mit.edu", "", "", "", "", "", "", "US", "6173240000"); - AutofillProfile profile5; + AutofillProfile profile5(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile5, "", "", "", "", "", "Old North Church", "193 Salem St", "Boston", "MA", "02113", "US", ""); - AutofillProfile profile6; + AutofillProfile profile6(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile6, "", "", "", "", "", "", "", "", "", "", "US", ""); @@ -84,30 +84,30 @@ TEST(AddressContactFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedStreetAddress) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Sarah", "", "Revere", "sarah.revere@aol.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", "16175232338"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "L", "Kennedy", "", "", "151 Irving Ave", "", "Hyannis", "MA", "02601", "US", "6175141600"); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Paul", "", "Revere", "paul1775@gmail.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", ""); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "Deborah", "", "Katabi", "deborah@mit.edu", "", "", "", "", "", "", "US", "6173240000"); - AutofillProfile profile5; + AutofillProfile profile5(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile5, "", "", "", "", "", "Old North Church", "193 Salem St", "Boston", "MA", "02113", "US", ""); - AutofillProfile profile6; + AutofillProfile profile6(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile6, "", "", "", "", "", "", "", "", "", "", "US", ""); @@ -129,30 +129,30 @@ TEST(AddressContactFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedNonStreetAddress) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Sarah", "", "Revere", "sarah.revere@aol.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", "16175232338"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "L", "Kennedy", "", "", "151 Irving Ave", "", "Hyannis", "MA", "02601", "US", "6175141600"); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Paul", "", "Revere", "paul1775@gmail.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", ""); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "Deborah", "", "Katabi", "deborah@mit.edu", "", "", "", "", "", "", "US", "6173240000"); - AutofillProfile profile5; + AutofillProfile profile5(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile5, "", "", "", "", "", "Old North Church", "193 Salem St", "Boston", "MA", "02113", "US", ""); - AutofillProfile profile6; + AutofillProfile profile6(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile6, "", "", "", "", "", "", "", "", "", "", "US", ""); @@ -173,30 +173,30 @@ TEST(AddressContactFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedEmail) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Sarah", "", "Revere", "sarah.revere@aol.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", "16175232338"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "L", "Kennedy", "", "", "151 Irving Ave", "", "Hyannis", "MA", "02601", "US", "6175141600"); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Paul", "", "Revere", "paul1775@gmail.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", ""); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "Deborah", "", "Katabi", "deborah@mit.edu", "", "", "", "", "", "", "US", "6173240000"); - AutofillProfile profile5; + AutofillProfile profile5(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile5, "", "", "", "", "", "Old North Church", "193 Salem St", "Boston", "MA", "02113", "US", ""); - AutofillProfile profile6; + AutofillProfile profile6(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile6, "", "", "", "", "", "", "", "", "", "", "US", ""); @@ -218,30 +218,30 @@ TEST(AddressContactFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedPhone) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Sarah", "", "Revere", "sarah.revere@aol.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", "16175232338"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "L", "Kennedy", "", "", "151 Irving Ave", "", "Hyannis", "MA", "02601", "US", "6175141600"); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Paul", "", "Revere", "paul1775@gmail.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", ""); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "Deborah", "", "Katabi", "deborah@mit.edu", "", "", "", "", "", "", "US", "6173240000"); - AutofillProfile profile5; + AutofillProfile profile5(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile5, "", "", "", "", "", "Old North Church", "193 Salem St", "Boston", "MA", "02113", "US", ""); - AutofillProfile profile6; + AutofillProfile profile6(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile6, "", "", "", "", "", "", "", "", "", "", "US", ""); @@ -263,13 +263,13 @@ TEST(AddressContactFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedName) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", " SP ", " 04094-050 ", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -290,13 +290,13 @@ TEST(AddressContactFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedStreetAddress) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", " SP ", " 04094-050 ", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -316,13 +316,13 @@ TEST(AddressContactFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedNonStreetAddress) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", " SP ", " 04094-050 ", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -343,13 +343,13 @@ TEST(AddressContactFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedEmail) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", " SP ", " 04094-050 ", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -370,13 +370,13 @@ TEST(AddressContactFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedPhone) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", " SP ", " 04094-050 ", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -397,7 +397,7 @@ TEST(AddressContactFormLabelFormatterTest, GetLabelsForFormWithPartialAddressFields) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Sarah", "", "Revere", "sarah.revere@aol.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", "16175232338"); @@ -414,7 +414,7 @@ TEST(AddressContactFormLabelFormatterTest, GetLabelsForFormWithoutName_FocusedStreetAddress) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Sarah", "", "Revere", "sarah.revere@aol.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", "16175232338"); @@ -438,7 +438,7 @@ EXPECT_THAT(formatter->GetLabels(), ElementsAre(u"(617) 523-2338", u"(617) 523-2338")); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Sarah", "", "Revere", "sarah@gmail.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", "16175232338");
diff --git a/components/autofill/core/browser/ui/address_email_form_label_formatter_unittest.cc b/components/autofill/core/browser/ui/address_email_form_label_formatter_unittest.cc index ad6022ac..826f50fd 100644 --- a/components/autofill/core/browser/ui/address_email_form_label_formatter_unittest.cc +++ b/components/autofill/core/browser/ui/address_email_form_label_formatter_unittest.cc
@@ -42,21 +42,21 @@ } TEST(AddressEmailFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedName) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "", "Kennedy", "", "", "151 Irving Ave", "", "Hyannis", "MA", "02601", "US", ""); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Paul", "", "Revere", "paul1775@gmail.com", "", "", "", "", "", "", "US", ""); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "John", "", "Adams", "", "", "", "", "Quincy", "MA", "02169", "US", ""); @@ -73,21 +73,21 @@ TEST(AddressEmailFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedStreetAddress) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "", "Kennedy", "", "", "151 Irving Ave", "", "Hyannis", "MA", "02601", "US", ""); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "", "", "", "paul1775@gmail.com", "", "", "", "", "", "", "US", ""); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "", "", "", "", "", "141 Franklin St", "", "Quincy", "MA", "02169", "US", ""); @@ -104,21 +104,21 @@ TEST(AddressEmailFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedNonStreetAddress) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "", "Kennedy", "", "", "151 Irving Ave", "", "Hyannis", "MA", "02601", "US", ""); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "", "", "", "paul1775@gmail.com", "", "", "", "", "", "", "US", ""); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "", "", "", "", "", "", "", "Quincy", "MA", "02169", "US", ""); @@ -135,20 +135,20 @@ TEST(AddressEmailFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedEmail) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "", "Kennedy", "jackie@outlook.com", "", "", "", "Hyannis", "MA", "02601", "US", ""); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "", "", "", "paul1775@gmail.com", "", "", "", "", "", "", "US", ""); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "", "", "", "", "", "141 Franklin St", "", "Quincy", "MA", "02169", "US", ""); @@ -164,13 +164,13 @@ } TEST(AddressEmailFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedName) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", "SP", "04094-050", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -189,13 +189,13 @@ TEST(AddressEmailFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedStreetAddress) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", "SP", "04094-050", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -214,13 +214,13 @@ TEST(AddressEmailFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedNonStreetAddress) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", "SP", "04094-050", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -239,13 +239,13 @@ TEST(AddressEmailFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedEmail) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", "SP", "04094-050", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -265,7 +265,7 @@ TEST(AddressEmailFormLabelFormatterTest, GetLabelsForFormWithAddressFieldsMinusStreetAddress) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); @@ -282,7 +282,7 @@ } TEST(AddressEmailFormLabelFormatterTest, GetLabelsForFormWithoutName) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Sarah", "", "Revere", "sarah.revere@aol.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", "16175232338");
diff --git a/components/autofill/core/browser/ui/address_form_label_formatter_unittest.cc b/components/autofill/core/browser/ui/address_form_label_formatter_unittest.cc index 7fa9b27..c87dbab 100644 --- a/components/autofill/core/browser/ui/address_form_label_formatter_unittest.cc +++ b/components/autofill/core/browser/ui/address_form_label_formatter_unittest.cc
@@ -38,21 +38,21 @@ TEST(AddressFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedStreetAddress) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "", "", "", "jackie@outlook.com", "", "151 Irving Ave", "", "Hyannis", "MA", "", "US", "5087717796"); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Paul", "", "Revere", "paul1775@gmail.com", "", "", "", "", "", "", "US", ""); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "", "", "", "", "", "", "", "", "", "", "US", ""); @@ -69,21 +69,21 @@ TEST(AddressFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedNonStreetAddress) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "", "", "", "jackie@outlook.com", "", "151 Irving Ave", "", "Hyannis", "MA", "", "US", "5087717796"); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Paul", "", "Revere", "paul1775@gmail.com", "", "", "", "", "", "", "US", ""); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "", "", "", "", "", "", "", "", "", "", "US", ""); @@ -99,12 +99,12 @@ } TEST(AddressFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedName) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "", "Kennedy", "jackie@outlook.com", "", "151 Irving Ave", "", "Hyannis", "MA", "02601", "US", "5087717796"); @@ -120,7 +120,7 @@ TEST(AddressFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedStreetAddress) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", "SP", "04094-050", "BR", ""); @@ -137,7 +137,7 @@ TEST(AddressFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedNonStreetAddress) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", "SP", "04094-050", "BR", ""); @@ -152,7 +152,7 @@ } TEST(AddressFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedName) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", "SP", "04094-050", "BR", ""); @@ -167,7 +167,7 @@ } TEST(AddressFormLabelFormatterTest, GetLabelsForFormWithoutName) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Sarah", "", "Revere", "sarah.revere@aol.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", "16175232338");
diff --git a/components/autofill/core/browser/ui/address_phone_form_label_formatter_unittest.cc b/components/autofill/core/browser/ui/address_phone_form_label_formatter_unittest.cc index 1ee5461f..4202a92 100644 --- a/components/autofill/core/browser/ui/address_phone_form_label_formatter_unittest.cc +++ b/components/autofill/core/browser/ui/address_phone_form_label_formatter_unittest.cc
@@ -36,21 +36,21 @@ } TEST(AddressPhoneFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedName) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "", "Kennedy", "", "", "151 Irving Ave", "", "Hyannis", "MA", "02601", "US", ""); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Paul", "", "Revere", "", "", "", "", "", "", "", "US", "6175232338"); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "John", "", "Adams", "", "", "", "", "", "", "", "US", ""); @@ -67,21 +67,21 @@ TEST(AddressPhoneFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedStreetAddress) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "", "Kennedy", "", "", "151 Irving Ave", "", "Hyannis", "MA", "02601", "US", ""); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "", "", "", "", "", "", "", "", "", "", "US", "6175232338"); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "", "", "", "", "", "141 Franklin St", "", "Quincy", "MA", "02169", "US", ""); @@ -98,21 +98,21 @@ TEST(AddressPhoneFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedNonStreetAddress) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "", "Kennedy", "", "", "151 Irving Ave", "", "Hyannis", "MA", "02601", "US", ""); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "", "", "", "", "", "", "", "", "", "", "US", "6175232338"); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "", "", "", "", "", "", "", "Quincy", "MA", "02169", "US", ""); @@ -129,21 +129,21 @@ TEST(AddressPhoneFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedPhone) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "", "Kennedy", "", "", "", "", "", "", "", "US", ""); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "", "", "", "", "", "Paul Revere House", "19 North Square", "Boston", "MA", "02113", "US", "6175232338"); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "", "", "", "", "", "", "", "", "", "", "US", ""); @@ -160,13 +160,13 @@ } TEST(AddressPhoneFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedName) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", "SP", "04094-050", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -186,13 +186,13 @@ TEST(AddressPhoneFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedStreetAddress) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", "SP", "04094-050", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -210,13 +210,13 @@ TEST(AddressPhoneFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedNonStreetAddress) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", "SP", "04094-050", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -235,13 +235,13 @@ TEST(AddressPhoneFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedPhone) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", "SP", "04094-050", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -261,7 +261,7 @@ TEST(AddressPhoneFormLabelFormatterTest, GetLabelsForFormWithAddressFieldsMinusStreetAddress) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); @@ -277,7 +277,7 @@ } TEST(AddressPhoneFormLabelFormatterTest, GetLabelsForFormWithoutName) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "Sarah", "", "Revere", "sarah.revere@aol.com", "", "19 North Sq", "", "Boston", "MA", "02113", "US", "16175232338");
diff --git a/components/autofill/core/browser/ui/contact_form_label_formatter_unittest.cc b/components/autofill/core/browser/ui/contact_form_label_formatter_unittest.cc index b02de70..88b19c6 100644 --- a/components/autofill/core/browser/ui/contact_form_label_formatter_unittest.cc +++ b/components/autofill/core/browser/ui/contact_form_label_formatter_unittest.cc
@@ -34,21 +34,21 @@ } TEST(ContactFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedName) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "", "Kennedy", "jackie@outlook.com", "", "151 Irving Ave", "", "Hyannis", "MA", "02601", "US", ""); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Paul", "", "Revere", "", "", "19 N Square", "", "Boston", "MA", "02113", "US", "+1 (617) 523-2338"); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "John", "", "Adams", "", "", "141 Franklin St.", "", "Quincy", "MA", "02169", "US", ""); @@ -65,21 +65,21 @@ } TEST(ContactFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedEmail) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "", "Kennedy", "jackie@outlook.com", "", "151 Irving Ave", "", "Hyannis", "MA", "02601", "US", ""); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Paul", "", "Revere", "", "", "19 N Square", "", "Boston", "MA", "02113", "US", "+1 (617) 523-2338"); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "", "", "", "", "", "141 Franklin St.", "", "Quincy", "MA", "02169", "US", ""); @@ -97,21 +97,21 @@ } TEST(ContactFormLabelFormatterTest, GetLabelsForUSProfilesAndFocusedPhone) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Jackie", "", "Kennedy", "jackie@outlook.com", "", "151 Irving Ave", "", "Hyannis", "MA", "02601", "US", ""); - AutofillProfile profile3; + AutofillProfile profile3(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile3, "Paul", "", "Revere", "", "", "19 N Square", "", "Boston", "MA", "02113", "US", "+1 (617) 523-2338"); - AutofillProfile profile4; + AutofillProfile profile4(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile4, "", "", "", "", "", "141 Franklin St.", "", "Quincy", "MA", "02169", "US", ""); @@ -130,13 +130,13 @@ } TEST(ContactFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedName) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", "SP", "04094-050", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -154,13 +154,13 @@ } TEST(ContactFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedEmail) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", "SP", "04094-050", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -177,13 +177,13 @@ } TEST(ContactFormLabelFormatterTest, GetLabelsForBRProfilesAndFocusedPhone) { - AutofillProfile profile1; + AutofillProfile profile1(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile1, "Tarsila", "do", "Amaral", "tarsila@aol.com", "", "Av. Pedro Álvares Cabral, 1301", "", "Vila Mariana", "São Paulo", "SP", "04094-050", "BR", "+55 11 2648-0254"); - AutofillProfile profile2; + AutofillProfile profile2(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile2, "Artur", "", "Avila", "aavila@uol.com.br", "", "Estr. Dona Castorina, 110", "", "Jardim Botânico", "Rio de Janeiro", "RJ", "22460-320", "BR", @@ -201,7 +201,7 @@ } TEST(ContactFormLabelFormatterTest, GetLabelsForNameAndPhoneWithFocusedName) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); @@ -217,7 +217,7 @@ } TEST(ContactFormLabelFormatterTest, GetLabelsForNameAndPhoneWithFocusedPhone) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); @@ -233,7 +233,7 @@ } TEST(ContactFormLabelFormatterTest, GetLabelsForNameAndEmailWithFocusedName) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000"); @@ -248,7 +248,7 @@ } TEST(ContactFormLabelFormatterTest, GetLabelsForNameAndEmailWithFocusedEmail) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); test::SetProfileInfo(&profile, "John", "F", "Kennedy", "jfk@gmail.com", "", "333 Washington St", "", "Brookline", "MA", "02445", "US", "16177302000");
diff --git a/components/autofill/core/browser/ui/suggestion.cc b/components/autofill/core/browser/ui/suggestion.cc index dcfb3a1..31880614 100644 --- a/components/autofill/core/browser/ui/suggestion.cc +++ b/components/autofill/core/browser/ui/suggestion.cc
@@ -53,6 +53,15 @@ } Suggestion::Suggestion(base::StringPiece main_text, + std::vector<std::vector<Text>> labels, + Icon icon, + PopupItemId popup_item_id) + : popup_item_id(popup_item_id), + main_text(base::UTF8ToUTF16(main_text), Text::IsPrimary(true)), + labels(std::move(labels)), + icon(icon) {} + +Suggestion::Suggestion(base::StringPiece main_text, base::StringPiece minor_text, base::StringPiece label, Icon icon,
diff --git a/components/autofill/core/browser/ui/suggestion.h b/components/autofill/core/browser/ui/suggestion.h index cabc4fb..ec1d363 100644 --- a/components/autofill/core/browser/ui/suggestion.h +++ b/components/autofill/core/browser/ui/suggestion.h
@@ -109,6 +109,10 @@ Icon icon, PopupItemId popup_item_id); Suggestion(base::StringPiece main_text, + std::vector<std::vector<Text>> labels, + Icon icon, + PopupItemId popup_item_id); + Suggestion(base::StringPiece main_text, base::StringPiece minor_text, base::StringPiece label, Icon icon,
diff --git a/components/autofill/core/browser/webdata/autofill_profile_sync_bridge_unittest.cc b/components/autofill/core/browser/webdata/autofill_profile_sync_bridge_unittest.cc index 184f09e..79622a2 100644 --- a/components/autofill/core/browser/webdata/autofill_profile_sync_bridge_unittest.cc +++ b/components/autofill/core/browser/webdata/autofill_profile_sync_bridge_unittest.cc
@@ -1221,7 +1221,9 @@ VerificationStatus::kParsed); // Remote data does not have a full name value. - AutofillProfile remote_profile(kGuidA); + AutofillProfile remote_profile( + kGuidA, AutofillProfile::Source::kLocalOrSyncable, + i18n_model_definition::kLegacyHierarchyCountryCode); remote_profile.SetRawInfoWithVerificationStatus( NAME_FIRST, u"John", VerificationStatus::kObserved); remote_profile.SetRawInfoWithVerificationStatus(
diff --git a/components/autofill/core/browser/webdata/autofill_sync_bridge_util.cc b/components/autofill/core/browser/webdata/autofill_sync_bridge_util.cc index f02ae07..764077f 100644 --- a/components/autofill/core/browser/webdata/autofill_sync_bridge_util.cc +++ b/components/autofill/core/browser/webdata/autofill_sync_bridge_util.cc
@@ -554,15 +554,15 @@ GURL(virtual_card_usage_data_specifics.merchant_url()))); } -void CopyRelevantWalletMetadataFromDisk( +void CopyRelevantWalletMetadataAndCvc( const AutofillTable& table, std::vector<CreditCard>* cards_from_server) { - std::vector<std::unique_ptr<CreditCard>> cards_on_disk; - table.GetServerCreditCards(cards_on_disk); + std::vector<std::unique_ptr<CreditCard>> cards_from_local_storage; + table.GetServerCreditCards(cards_from_local_storage); // Since the number of cards is fairly small, the brute-force search is good // enough. - for (const auto& saved_card : cards_on_disk) { + for (const auto& saved_card : cards_from_local_storage) { for (CreditCard& server_card : *cards_from_server) { if (saved_card->server_id() == server_card.server_id()) { // The wallet data doesn't have the use stats. Use the ones present on @@ -570,6 +570,11 @@ server_card.set_use_count(saved_card->use_count()); server_card.set_use_date(saved_card->use_date()); + // Wallet data from the server doesn't have the CVC data as it's + // decoupled. Use the data present in the local storage, to prevent + // CVC data deletion. + server_card.set_cvc(saved_card->cvc()); + // Keep the billing address id of the saved cards only if it points to // a local address. if (saved_card->billing_address_id().length() == kLocalGuidSize) {
diff --git a/components/autofill/core/browser/webdata/autofill_sync_bridge_util.h b/components/autofill/core/browser/webdata/autofill_sync_bridge_util.h index 8d6cb54..49395bd 100644 --- a/components/autofill/core/browser/webdata/autofill_sync_bridge_util.h +++ b/components/autofill/core/browser/webdata/autofill_sync_bridge_util.h
@@ -97,11 +97,13 @@ // TODO(sebsg): This should probably copy the converted state for the address // too. -// Copies the metadata from the local cards (if present) to the corresponding -// server cards so that they don't get overwritten. This is because the wallet -// data does not include those. They are handled by the -// AutofillWalletMetadataSyncBridge. -void CopyRelevantWalletMetadataFromDisk( +// Copies the metadata and the CVC data from the local cards (if +// present) to the corresponding server cards so that they don't get +// overwritten. This is needed as the incoming wallet data does not include +// those and for updates, we do a "Remove + Add", instead of "Update". The +// "Remove + Add" operation is handled by the AutofillWalletMetadataSyncBridge +// and AutofillWalletCredentialSyncBridge. +void CopyRelevantWalletMetadataAndCvc( const AutofillTable& table, std::vector<CreditCard>* cards_from_server);
diff --git a/components/autofill/core/browser/webdata/autofill_sync_bridge_util_unittest.cc b/components/autofill/core/browser/webdata/autofill_sync_bridge_util_unittest.cc index b41ce46..f05674e 100644 --- a/components/autofill/core/browser/webdata/autofill_sync_bridge_util_unittest.cc +++ b/components/autofill/core/browser/webdata/autofill_sync_bridge_util_unittest.cc
@@ -193,8 +193,8 @@ // Verify that the billing address id from the card saved on disk is kept if it // is a local profile guid. TEST_F(AutofillSyncBridgeUtilTest, - CopyRelevantWalletMetadataFromDisk_KeepLocalAddresses) { - std::vector<CreditCard> cards_on_disk; + CopyRelevantWalletMetadataAndCvc_KeepLocalAddresses) { + std::vector<CreditCard> cards_from_local_storage; std::vector<CreditCard> wallet_cards; // Create a local profile to be used as a billing address. @@ -202,50 +202,51 @@ // Create a card on disk that refers to that local profile as its billing // address. - cards_on_disk.push_back(CreditCard()); - cards_on_disk.back().set_billing_address_id(billing_address.guid()); + cards_from_local_storage.emplace_back(); + cards_from_local_storage.back().set_billing_address_id( + billing_address.guid()); // Create a card pulled from wallet with the same id, but a different billing // address id. - wallet_cards.push_back(CreditCard(cards_on_disk.back())); + wallet_cards.emplace_back(cards_from_local_storage.back()); wallet_cards.back().set_billing_address_id("1234"); - // Setup the TestAutofillTable with the cards_on_disk. - TestAutofillTable table(cards_on_disk); + // Setup the TestAutofillTable with the `cards_from_local_storage`. + TestAutofillTable table(cards_from_local_storage); - CopyRelevantWalletMetadataFromDisk(table, &wallet_cards); + CopyRelevantWalletMetadataAndCvc(table, &wallet_cards); ASSERT_EQ(1U, wallet_cards.size()); // Make sure the wallet card replace its billing address id for the one that // was saved on disk. - EXPECT_EQ(cards_on_disk.back().billing_address_id(), + EXPECT_EQ(cards_from_local_storage.back().billing_address_id(), wallet_cards.back().billing_address_id()); } // Verify that the billing address id from the card saved on disk is overwritten // if it does not refer to a local profile. TEST_F(AutofillSyncBridgeUtilTest, - CopyRelevantWalletMetadataFromDisk_OverwriteOtherAddresses) { + CopyRelevantWalletMetadataAndCvc_OverwriteOtherAddresses) { std::string old_billing_id = "1234"; std::string new_billing_id = "9876"; - std::vector<CreditCard> cards_on_disk; + std::vector<CreditCard> cards_from_local_storage; std::vector<CreditCard> wallet_cards; // Create a card on disk that does not refer to a local profile (which have 36 // chars ids). - cards_on_disk.push_back(CreditCard()); - cards_on_disk.back().set_billing_address_id(old_billing_id); + cards_from_local_storage.emplace_back(); + cards_from_local_storage.back().set_billing_address_id(old_billing_id); // Create a card pulled from wallet with the same id, but a different billing // address id. - wallet_cards.push_back(CreditCard(cards_on_disk.back())); + wallet_cards.emplace_back(cards_from_local_storage.back()); wallet_cards.back().set_billing_address_id(new_billing_id); - // Setup the TestAutofillTable with the cards_on_disk. - TestAutofillTable table(cards_on_disk); + // Setup the TestAutofillTable with the `cards_from_local_storage`. + TestAutofillTable table(cards_from_local_storage); - CopyRelevantWalletMetadataFromDisk(table, &wallet_cards); + CopyRelevantWalletMetadataAndCvc(table, &wallet_cards); ASSERT_EQ(1U, wallet_cards.size()); @@ -256,29 +257,29 @@ // Verify that the use stats on disk are kept when server cards are synced. TEST_F(AutofillSyncBridgeUtilTest, - CopyRelevantWalletMetadataFromDisk_KeepUseStats) { + CopyRelevantWalletMetadataAndCvc_KeepUseStats) { TestAutofillClock test_clock; base::Time arbitrary_time = base::Time::FromSecondsSinceUnixEpoch(25); base::Time disk_time = base::Time::FromSecondsSinceUnixEpoch(10); test_clock.SetNow(arbitrary_time); - std::vector<CreditCard> cards_on_disk; + std::vector<CreditCard> cards_from_local_storage; std::vector<CreditCard> wallet_cards; // Create a card on disk with specific use stats. - cards_on_disk.push_back(CreditCard()); - cards_on_disk.back().set_use_count(3U); - cards_on_disk.back().set_use_date(disk_time); + cards_from_local_storage.emplace_back(); + cards_from_local_storage.back().set_use_count(3U); + cards_from_local_storage.back().set_use_date(disk_time); // Create a card pulled from wallet with the same id, but a different billing // address id. - wallet_cards.push_back(CreditCard()); + wallet_cards.emplace_back(); wallet_cards.back().set_use_count(10U); - // Setup the TestAutofillTable with the cards_on_disk. - TestAutofillTable table(cards_on_disk); + // Setup the TestAutofillTable with the `cards_from_local_storage`. + TestAutofillTable table(cards_from_local_storage); - CopyRelevantWalletMetadataFromDisk(table, &wallet_cards); + CopyRelevantWalletMetadataAndCvc(table, &wallet_cards); ASSERT_EQ(1U, wallet_cards.size()); @@ -287,6 +288,31 @@ EXPECT_EQ(disk_time, wallet_cards.back().use_date()); } +// Verify that the credential data on disk are kept when server cards are +// synced. +TEST_F(AutofillSyncBridgeUtilTest, + CopyRelevantWalletMetadataAndCvc_KeepCredentialData) { + std::vector<CreditCard> cards_from_local_storage; + std::vector<CreditCard> wallet_cards; + + // Create a card on disk with specific use stats. + cards_from_local_storage.emplace_back(); + cards_from_local_storage.back().set_cvc(u"123"); + + // Create a card pulled from wallet with the same id, but with an empty CVC. + wallet_cards.emplace_back(); + + // Setup the TestAutofillTable with the `cards_from_local_storage`. + TestAutofillTable table(cards_from_local_storage); + + CopyRelevantWalletMetadataAndCvc(table, &wallet_cards); + + ASSERT_EQ(1U, wallet_cards.size()); + + // Verify the wallet credential (CVC) data. + EXPECT_EQ(u"123", wallet_cards.back().cvc()); +} + // Test to ensure the general-purpose fields from an AutofillOfferData are // correctly converted to an AutofillOfferSpecifics. TEST_F(AutofillSyncBridgeUtilTest, OfferSpecificsFromOfferData) {
diff --git a/components/autofill/core/browser/webdata/autofill_table_unittest.cc b/components/autofill/core/browser/webdata/autofill_table_unittest.cc index c106c3f..6ab4e5e 100644 --- a/components/autofill/core/browser/webdata/autofill_table_unittest.cc +++ b/components/autofill/core/browser/webdata/autofill_table_unittest.cc
@@ -1032,9 +1032,11 @@ // source. TEST_P(AutofillTableProfileTest, RemoveAllAutofillProfiles) { ASSERT_TRUE(table_->AddAutofillProfile( - AutofillProfile(AutofillProfile::Source::kLocalOrSyncable))); + AutofillProfile(AutofillProfile::Source::kLocalOrSyncable, + i18n_model_definition::kLegacyHierarchyCountryCode))); ASSERT_TRUE(table_->AddAutofillProfile( - AutofillProfile(AutofillProfile::Source::kAccount))); + AutofillProfile(AutofillProfile::Source::kAccount, + i18n_model_definition::kLegacyHierarchyCountryCode))); EXPECT_TRUE(table_->RemoveAllAutofillProfiles(profile_source()));
diff --git a/components/autofill/core/browser/webdata/autofill_wallet_sync_bridge.cc b/components/autofill/core/browser/webdata/autofill_wallet_sync_bridge.cc index 2f8f9e1..e85af2b 100644 --- a/components/autofill/core/browser/webdata/autofill_wallet_sync_bridge.cc +++ b/components/autofill/core/browser/webdata/autofill_wallet_sync_bridge.cc
@@ -328,9 +328,12 @@ // Users can set billing address of the server credit card locally, but that // information does not propagate to either Chrome Sync or Google Payments // server. To preserve user's preferred billing address and most recent use - // stats, copy them from disk into |wallet_cards|. + // stats, copy them from local storage into `wallet_cards`. + // Wallet CVC data is decoupled from the Wallet card data, so if + // CVC data is present on the locally saved server card, copy that onto + // `wallet_cards` to prevent deletion of CVC data. AutofillTable* table = GetAutofillTable(); - CopyRelevantWalletMetadataFromDisk(*table, &wallet_cards); + CopyRelevantWalletMetadataAndCvc(*table, &wallet_cards); std::vector<std::unique_ptr<CreditCard>> existing_cards; if (!table->GetServerCreditCards(existing_cards)) {
diff --git a/components/autofill/core/browser/webdata/contact_info_sync_bridge_unittest.cc b/components/autofill/core/browser/webdata/contact_info_sync_bridge_unittest.cc index fb1cdea..1f250a7 100644 --- a/components/autofill/core/browser/webdata/contact_info_sync_bridge_unittest.cc +++ b/components/autofill/core/browser/webdata/contact_info_sync_bridge_unittest.cc
@@ -65,7 +65,8 @@ } AutofillProfile TestProfile(base::StringPiece guid) { - return AutofillProfile(std::string(guid), AutofillProfile::Source::kAccount); + return AutofillProfile(std::string(guid), AutofillProfile::Source::kAccount, + i18n_model_definition::kLegacyHierarchyCountryCode); } } // namespace
diff --git a/components/autofill/core/browser/webdata/web_data_service_unittest.cc b/components/autofill/core/browser/webdata/web_data_service_unittest.cc index 9e72bff..b1fafbf 100644 --- a/components/autofill/core/browser/webdata/web_data_service_unittest.cc +++ b/components/autofill/core/browser/webdata/web_data_service_unittest.cc
@@ -284,7 +284,7 @@ } TEST_F(WebDataServiceAutofillTest, ProfileAdd) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); // Check that GUID-based notification was sent. const AutofillProfileChange expected_change(AutofillProfileChange::ADD, @@ -306,7 +306,7 @@ } TEST_F(WebDataServiceAutofillTest, ProfileRemove) { - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); // Add a profile. EXPECT_CALL(observer_, AutofillProfileChanged(_)) @@ -345,11 +345,15 @@ TEST_F(WebDataServiceAutofillTest, ProfileUpdate) { // The GUIDs are alphabetical for easier testing. - AutofillProfile profile1("6141084B-72D7-4B73-90CF-3D6AC154673B"); + AutofillProfile profile1("6141084B-72D7-4B73-90CF-3D6AC154673B", + AutofillProfile::Source::kLocalOrSyncable, + i18n_model_definition::kLegacyHierarchyCountryCode); profile1.SetRawInfo(NAME_FIRST, u"Abe"); profile1.FinalizeAfterImport(); - AutofillProfile profile2("087151C8-6AB1-487C-9095-28E80BE5DA15"); + AutofillProfile profile2("087151C8-6AB1-487C-9095-28E80BE5DA15", + AutofillProfile::Source::kLocalOrSyncable, + i18n_model_definition::kLegacyHierarchyCountryCode); profile2.SetRawInfo(NAME_FIRST, u"Alice"); profile2.FinalizeAfterImport(); @@ -471,7 +475,7 @@ // Add a profile. EXPECT_CALL(observer_, AutofillProfileChanged(_)) .WillOnce(SignalEvent(&done_event_)); - AutofillProfile profile; + AutofillProfile profile(i18n_model_definition::kLegacyHierarchyCountryCode); wds_->AddAutofillProfile(profile); done_event_.TimedWait(test_timeout_);
diff --git a/components/autofill/core/common/BUILD.gn b/components/autofill/core/common/BUILD.gn index 0092824..d489073 100644 --- a/components/autofill/core/common/BUILD.gn +++ b/components/autofill/core/common/BUILD.gn
@@ -157,6 +157,18 @@ ] } +static_library("fuzzer_support") { + sources = [ + "form_data_fuzzed_producer.cc", + "form_data_fuzzed_producer.h", + ] + + deps = [ + ":common", + "//url", + ] +} + fuzzer_test("autofill_autocomplete_parsing_util_fuzzer") { sources = [ "autocomplete_parsing_util_fuzzer.cc" ] deps = [ ":common" ]
diff --git a/components/autofill/core/common/autofill_features.cc b/components/autofill/core/common/autofill_features.cc index 87e557eb..d374889 100644 --- a/components/autofill/core/common/autofill_features.cc +++ b/components/autofill/core/common/autofill_features.cc
@@ -541,12 +541,6 @@ "AutofillRemoveInaccessibleProfileValuesOnStartup", base::FEATURE_DISABLED_BY_DEFAULT); -// Requires a profile to have non-empty full name to import it from a form. -// TODO(crbug.com/1413205): Cleanup when launched. -BASE_FEATURE(kAutofillRequireNameForProfileImport, - "AutofillRequireNameForProfileImport", - base::FEATURE_DISABLED_BY_DEFAULT); - // Controls non-default Autofill API predictions. See crbug.com/1331322. BASE_FEATURE(kAutofillServerBehaviors, "AutofillServerBehaviors",
diff --git a/components/autofill/core/common/autofill_features.h b/components/autofill/core/common/autofill_features.h index b1b1dca..fad4789 100644 --- a/components/autofill/core/common/autofill_features.h +++ b/components/autofill/core/common/autofill_features.h
@@ -183,8 +183,6 @@ BASE_DECLARE_FEATURE(kAutofillProbableFormSubmissionInBrowser); COMPONENT_EXPORT(AUTOFILL) BASE_DECLARE_FEATURE(kAutofillRemoveInaccessibleProfileValuesOnStartup); -COMPONENT_EXPORT(AUTOFILL) -BASE_DECLARE_FEATURE(kAutofillRequireNameForProfileImport); COMPONENT_EXPORT(AUTOFILL) BASE_DECLARE_FEATURE(kAutofillServerBehaviors); COMPONENT_EXPORT(AUTOFILL) extern const base::FeatureParam<int> kAutofillServerBehaviorsParam;
diff --git a/components/autofill/core/common/autofill_regex_constants.h b/components/autofill/core/common/autofill_regex_constants.h index 8c28e6d..4471a6d 100644 --- a/components/autofill/core/common/autofill_regex_constants.h +++ b/components/autofill/core/common/autofill_regex_constants.h
@@ -687,4 +687,4 @@ } // namespace autofill -#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_REGEX_CONSTANTS_H_ +#endif // COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_REGEX_CONSTANTS_H_
diff --git a/components/autofill/core/common/autofill_regexes.h b/components/autofill/core/common/autofill_regexes.h index c9eb699..2119483f 100644 --- a/components/autofill/core/common/autofill_regexes.h +++ b/components/autofill/core/common/autofill_regexes.h
@@ -84,4 +84,4 @@ } // namespace autofill -#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_REGEXES_H_ +#endif // COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_REGEXES_H_
diff --git a/components/autofill/core/common/form_data_fuzzed_producer.cc b/components/autofill/core/common/form_data_fuzzed_producer.cc new file mode 100644 index 0000000..7cef5b56 --- /dev/null +++ b/components/autofill/core/common/form_data_fuzzed_producer.cc
@@ -0,0 +1,91 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/autofill/core/common/form_data_fuzzed_producer.h" + +#include <string> + +#include <fuzzer/FuzzedDataProvider.h> + +#include "build/build_config.h" +#include "components/autofill/core/common/form_field_data.h" +#include "components/autofill/core/common/signatures.h" +#include "components/autofill/core/common/unique_ids.h" +#include "url/gurl.h" +#include "url/origin.h" + +namespace autofill { + +namespace { + +// A wrapper to get |std::u16string| from a |FuzzedDataProvider|. The result is +// arbitrary bytes, not necessarily valid UTF16. +std::u16string ConsumeU16String(FuzzedDataProvider& provider) { + // |FuzzedDataProvider| takes special steps to pick the length of the string + // to support evolution of the fuzzed input. Let's follow whatever it does. + const std::string s8 = provider.ConsumeRandomLengthString(); + return std::u16string( + reinterpret_cast<const std::u16string::value_type*>(s8.data()), + s8.size() / 2); +} + +} // namespace + +FormData GenerateFormData(FuzzedDataProvider& provider) { + FormData result; + + result.is_form_tag = provider.ConsumeBool(); + + // Determine how many fields this form will have. Pick a low value because + // after the fuzzer's seed is exhausted, all will be 0s anyway. + const size_t number_of_fields = + provider.ConsumeIntegralInRange<size_t>(0, 15); + result.fields.resize(number_of_fields); + + result.name = ConsumeU16String(provider); + result.action = GURL(provider.ConsumeRandomLengthString()); + result.url = GURL(provider.ConsumeRandomLengthString()); + result.main_frame_origin = + url::Origin::Create(GURL(provider.ConsumeRandomLengthString())); + + int first_field_with_same_value = -1; + for (size_t i = 0; i < number_of_fields; ++i) { + // Batch getting bits from the FuzzedDataProvider, because calling + // `ConsumeBool` throws out 7 bits and we need multiple Booleans for each + // iteration. + const auto packed_bools = provider.ConsumeIntegral<uint8_t>(); + // All instances with |same_value_field| true share the same value. + const bool same_value_field = packed_bools & 1; + // Empty values are interesting from the parsing perspective. Ensure that + // at least half of the cases ends up with an empty value. + const bool force_empty_value = packed_bools & (1 << 1); + result.fields[i].is_focusable = packed_bools & (1 << 2); + + result.fields[i].form_control_type = + provider.ConsumeEnum<FormControlType>(); + result.fields[i].autocomplete_attribute = + provider.ConsumeRandomLengthString(); + result.fields[i].label = ConsumeU16String(provider); + result.fields[i].name = ConsumeU16String(provider); + result.fields[i].name_attribute = result.fields[i].name; + result.fields[i].id_attribute = ConsumeU16String(provider); + result.fields[i].unique_renderer_id = + FieldRendererId(provider.ConsumeIntegralInRange(-32, 31)); + + if (same_value_field) { + if (first_field_with_same_value == -1) { + first_field_with_same_value = static_cast<int>(i); + } else { + result.fields[i].value = + result.fields[first_field_with_same_value].value; + } + } else if (!force_empty_value) { + result.fields[i].value = ConsumeU16String(provider); + } + } + + return result; +} + +} // namespace autofill
diff --git a/components/autofill/core/common/form_data_fuzzed_producer.h b/components/autofill/core/common/form_data_fuzzed_producer.h new file mode 100644 index 0000000..0068b258 --- /dev/null +++ b/components/autofill/core/common/form_data_fuzzed_producer.h
@@ -0,0 +1,20 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_FUZZED_PRODUCER_H_ +#define COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_FUZZED_PRODUCER_H_ + +#include "components/autofill/core/common/form_data.h" + +class FuzzedDataProvider; + +namespace autofill { + +// Generates a |FormData| object based on values obtained via |provider|. See +// https://goo.gl/29t6VH for a detailed design. +FormData GenerateFormData(FuzzedDataProvider& provider); + +} // namespace autofill + +#endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_DATA_FUZZED_PRODUCER_H_
diff --git a/components/autofill/core/common/form_interactions_flow.h b/components/autofill/core/common/form_interactions_flow.h index 7691c41..0789a382 100644 --- a/components/autofill/core/common/form_interactions_flow.h +++ b/components/autofill/core/common/form_interactions_flow.h
@@ -30,4 +30,4 @@ } // namespace autofill -#endif +#endif // COMPONENTS_AUTOFILL_CORE_COMMON_FORM_INTERACTIONS_FLOW_H_
diff --git a/components/autofill/ios/browser/BUILD.gn b/components/autofill/ios/browser/BUILD.gn index fadfc26..16e000d 100644 --- a/components/autofill/ios/browser/BUILD.gn +++ b/components/autofill/ios/browser/BUILD.gn
@@ -154,11 +154,6 @@ "//third_party/ocmock", "//ui/gfx:test_support", ] - - # TODO(crbug.com/1427365): Test currently fails on iOS blink. - if (is_ios && use_blink) { - sources -= [ "autofill_agent_unittests.mm" ] - } } bundle_data("autofill_test_bundle_data") {
diff --git a/components/autofill/ios/form_util/BUILD.gn b/components/autofill/ios/form_util/BUILD.gn index 4621488e..2f68a8c9 100644 --- a/components/autofill/ios/form_util/BUILD.gn +++ b/components/autofill/ios/form_util/BUILD.gn
@@ -208,15 +208,6 @@ "//ios/web/public/test/fakes", "//testing/gtest", ] - - # TODO(crbug.com/1427365): Test currently fails on iOS blink. - if (is_ios && use_blink) { - sources -= [ - "fill_js_unittest.mm", - "form_activity_tab_helper_unittest.mm", - "form_unittest.mm", - ] - } } if (is_ios) { fuzzer_test("form_activity_tab_helper_fuzzer") {
diff --git a/components/browsing_data/content/indexed_db_helper.cc b/components/browsing_data/content/indexed_db_helper.cc index 381fdb1..3f7723b2 100644 --- a/components/browsing_data/content/indexed_db_helper.cc +++ b/components/browsing_data/content/indexed_db_helper.cc
@@ -27,47 +27,13 @@ namespace browsing_data { -IndexedDBHelper::IndexedDBHelper(content::StoragePartition* storage_partition) +CannedIndexedDBHelper::CannedIndexedDBHelper( + content::StoragePartition* storage_partition) : storage_partition_(storage_partition) { DCHECK(storage_partition_); } -IndexedDBHelper::~IndexedDBHelper() {} - -void IndexedDBHelper::StartFetching(FetchCallback callback) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - DCHECK(!callback.is_null()); - storage_partition_->GetIndexedDBControl().GetUsage( - base::BindOnce(&IndexedDBHelper::IndexedDBUsageInfoReceived, - base::WrapRefCounted(this), std::move(callback))); -} - -void IndexedDBHelper::DeleteIndexedDB(const blink::StorageKey& storage_key, - base::OnceCallback<void(bool)> callback) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - storage_partition_->GetIndexedDBControl().DeleteForStorageKey( - storage_key, std::move(callback)); -} - -void IndexedDBHelper::IndexedDBUsageInfoReceived( - FetchCallback callback, - std::vector<storage::mojom::StorageUsageInfoPtr> usages) { - DCHECK(!callback.is_null()); - std::list<content::StorageUsageInfo> result; - for (const auto& usage : usages) { - if (!HasWebScheme(usage->storage_key.origin().GetURL())) - continue; // Non-websafe state is not considered browsing data. - result.emplace_back(usage->storage_key, usage->total_size_bytes, - usage->last_modified); - } - std::move(callback).Run(std::move(result)); -} - -CannedIndexedDBHelper::CannedIndexedDBHelper( - content::StoragePartition* storage_partition) - : IndexedDBHelper(storage_partition) {} - -CannedIndexedDBHelper::~CannedIndexedDBHelper() {} +CannedIndexedDBHelper::~CannedIndexedDBHelper() = default; void CannedIndexedDBHelper::Add(const blink::StorageKey& storage_key) { if (!HasWebScheme(storage_key.origin().GetURL())) @@ -109,7 +75,8 @@ const blink::StorageKey& storage_key, base::OnceCallback<void(bool)> callback) { pending_storage_keys_.erase(storage_key); - IndexedDBHelper::DeleteIndexedDB(storage_key, std::move(callback)); + storage_partition_->GetIndexedDBControl().DeleteForStorageKey( + storage_key, std::move(callback)); } } // namespace browsing_data
diff --git a/components/browsing_data/content/indexed_db_helper.h b/components/browsing_data/content/indexed_db_helper.h index f226b649..bd9ca21 100644 --- a/components/browsing_data/content/indexed_db_helper.h +++ b/components/browsing_data/content/indexed_db_helper.h
@@ -27,49 +27,18 @@ namespace browsing_data { -// IndexedDBHelper is an interface for classes dealing with +// CannedIndexedDBHelper is an interface for classes dealing with // aggregating and deleting browsing data stored in indexed databases. A // client of this class need to call StartFetching from the UI thread to // initiate the flow, and it'll be notified by the callback in its UI thread at -// some later point. -class IndexedDBHelper : public base::RefCountedThreadSafe<IndexedDBHelper> { +// some later point. The implementation does not actually fetch its information +// from the Indexed DB context, but gets them passed by a call when accessed. +class CannedIndexedDBHelper + : public base::RefCountedThreadSafe<CannedIndexedDBHelper> { public: using FetchCallback = base::OnceCallback<void(const std::list<content::StorageUsageInfo>&)>; - // Create a IndexedDBHelper instance for the indexed databases - // stored in |context|'s associated profile's user data directory. - explicit IndexedDBHelper(content::StoragePartition* storage_partition); - - IndexedDBHelper(const IndexedDBHelper&) = delete; - IndexedDBHelper& operator=(const IndexedDBHelper&) = delete; - - // Starts the fetching process, which will notify its completion via - // |callback|. This must be called only on the UI thread. - virtual void StartFetching(FetchCallback callback); - // Requests a single indexed database to be deleted in the IndexedDB thread. - virtual void DeleteIndexedDB(const blink::StorageKey& storage_key, - base::OnceCallback<void(bool)> callback); - - protected: - virtual ~IndexedDBHelper(); - - raw_ptr<content::StoragePartition> storage_partition_; - - private: - friend class base::RefCountedThreadSafe<IndexedDBHelper>; - - // Enumerates all indexed database files in the IndexedDB thread. - void IndexedDBUsageInfoReceived( - FetchCallback callback, - std::vector<storage::mojom::StorageUsageInfoPtr> usages); -}; - -// This class is an implementation of IndexedDBHelper that does -// not fetch its information from the Indexed DB context, but gets them -// passed by a call when accessed. -class CannedIndexedDBHelper : public IndexedDBHelper { - public: explicit CannedIndexedDBHelper(content::StoragePartition* storage_partition); CannedIndexedDBHelper(const CannedIndexedDBHelper&) = delete; @@ -91,13 +60,18 @@ // Returns the current list of indexed data bases. const std::set<blink::StorageKey>& GetStorageKeys() const; - // IndexedDBHelper methods. - void StartFetching(FetchCallback callback) override; - void DeleteIndexedDB(const blink::StorageKey& storage_key, - base::OnceCallback<void(bool)> callback) override; + // Virtual for testing. + virtual void StartFetching(FetchCallback callback); + virtual void DeleteIndexedDB(const blink::StorageKey& storage_key, + base::OnceCallback<void(bool)> callback); + + protected: + virtual ~CannedIndexedDBHelper(); private: - ~CannedIndexedDBHelper() override; + friend class base::RefCountedThreadSafe<CannedIndexedDBHelper>; + + raw_ptr<content::StoragePartition> storage_partition_; std::set<blink::StorageKey> pending_storage_keys_; };
diff --git a/components/browsing_data/content/mock_indexed_db_helper.cc b/components/browsing_data/content/mock_indexed_db_helper.cc index 9c802abb..af73c46 100644 --- a/components/browsing_data/content/mock_indexed_db_helper.cc +++ b/components/browsing_data/content/mock_indexed_db_helper.cc
@@ -15,7 +15,7 @@ MockIndexedDBHelper::MockIndexedDBHelper( content::StoragePartition* storage_partition) - : IndexedDBHelper(storage_partition) {} + : CannedIndexedDBHelper(storage_partition) {} MockIndexedDBHelper::~MockIndexedDBHelper() {}
diff --git a/components/browsing_data/content/mock_indexed_db_helper.h b/components/browsing_data/content/mock_indexed_db_helper.h index ba95160d..2ea56d16 100644 --- a/components/browsing_data/content/mock_indexed_db_helper.h +++ b/components/browsing_data/content/mock_indexed_db_helper.h
@@ -24,7 +24,7 @@ // Mock for IndexedDBHelper. // Use AddIndexedDBSamples() or add directly to response_ list, then // call Notify(). -class MockIndexedDBHelper : public IndexedDBHelper { +class MockIndexedDBHelper : public CannedIndexedDBHelper { public: explicit MockIndexedDBHelper(content::StoragePartition* storage_partition);
diff --git a/components/browsing_topics/candidate_topic.h b/components/browsing_topics/candidate_topic.h index 09aa406..feb3f91 100644 --- a/components/browsing_topics/candidate_topic.h +++ b/components/browsing_topics/candidate_topic.h
@@ -61,4 +61,4 @@ } // namespace browsing_topics -#endif // COMPONENTS_BROWSING_TOPICS_UTIL_H_ +#endif // COMPONENTS_BROWSING_TOPICS_CANDIDATE_TOPIC_H_
diff --git a/components/cast_streaming/renderer/common/buffer_requester.h b/components/cast_streaming/renderer/common/buffer_requester.h index 9f515b66..065e188 100644 --- a/components/cast_streaming/renderer/common/buffer_requester.h +++ b/components/cast_streaming/renderer/common/buffer_requester.h
@@ -147,4 +147,4 @@ } // namespace cast_streaming -#endif // COMPONENTS_CAST_STREAMING_RENDERER_BUFFER_REQUESTER_H_ +#endif // COMPONENTS_CAST_STREAMING_RENDERER_COMMON_BUFFER_REQUESTER_H_
diff --git a/components/commerce/content/browser/web_extractor_impl.h b/components/commerce/content/browser/web_extractor_impl.h index 6d70c210..9222952 100644 --- a/components/commerce/content/browser/web_extractor_impl.h +++ b/components/commerce/content/browser/web_extractor_impl.h
@@ -36,4 +36,4 @@ } // namespace commerce -#endif // CHROME_BROWSER_COMMERCE_WEB_EXTRACTOR_IMPL_H_ +#endif // COMPONENTS_COMMERCE_CONTENT_BROWSER_WEB_EXTRACTOR_IMPL_H_
diff --git a/components/compose_strings.grdp b/components/compose_strings.grdp index 043872a..c6264f50 100644 --- a/components/compose_strings.grdp +++ b/components/compose_strings.grdp
@@ -36,6 +36,11 @@ Yes I'm in </message> + <!-- Disclaimer dialog --> + <message name="IDS_COMPOSE_DISCLAIMER_BUTTON" desc="The button to acknowledge the disclaimer message." translateable="false"> + Let's go + </message> + <!-- Input dialog --> <message name="IDS_COMPOSE_DIALOG_TITLE" desc="Compose input dialog title." translateable="false"> Lorem ipsum @@ -102,9 +107,9 @@ <!-- Cross-dialog --> <message name="IDS_COMPOSE_FOOTER_FISHFOOD" desc="The footer text used for Fishfood in the input and result dialogs." translateable="false"> This feature is experimental. - </message> - <message name="IDS_COMPOSE_FILE_BUG" desc="The text used as a clickable link to open the Compose bug-reporting page. Used for Fishfood only." translateable="false"> - File a bug + <ph name="BEGIN_BUG_LINK"><a href="#" id="bugLink" role="button"></ph>File a bug<ph name="END_BUG_LINK"></a></ph> + or fill out our + <ph name="BEGIN_SURVEY_LINK"><a href="#" id="surveyLink" role="button"></ph>survey<ph name="END_SURVEY_LINK"></a></ph> </message> </grit-part>
diff --git a/components/content_settings/browser/DEPS b/components/content_settings/browser/DEPS index 756dad3..6caa9bb 100644 --- a/components/content_settings/browser/DEPS +++ b/components/content_settings/browser/DEPS
@@ -15,7 +15,7 @@ "+third_party/blink/public", "+components/privacy_sandbox", "+components/site_engagement/content", - "+services/metrics/public", + "+services/metrics/public", "+components/strings", "+components/vector_icons", "+ui/base",
diff --git a/components/content_settings/browser/page_specific_content_settings.cc b/components/content_settings/browser/page_specific_content_settings.cc index bf18669..37f1c6a5 100644 --- a/components/content_settings/browser/page_specific_content_settings.cc +++ b/components/content_settings/browser/page_specific_content_settings.cc
@@ -50,6 +50,7 @@ #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" #include "content/public/common/content_constants.h" +#include "content/public/common/content_features.h" #include "net/base/schemeful_site.h" #include "services/network/public/mojom/shared_dictionary_access_observer.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -828,6 +829,8 @@ content_type == ContentSettingsType::MIXEDSCRIPT || content_type == ContentSettingsType::MEDIASTREAM_MIC || content_type == ContentSettingsType::MEDIASTREAM_CAMERA || + (base::FeatureList::IsEnabled(::features::kBlockMidiByDefault) && + content_type == ContentSettingsType::MIDI) || content_type == ContentSettingsType::MIDI_SYSEX || content_type == ContentSettingsType::ADS || content_type == ContentSettingsType::SOUND || @@ -855,6 +858,8 @@ if (content_type != ContentSettingsType::COOKIES && content_type != ContentSettingsType::MEDIASTREAM_MIC && content_type != ContentSettingsType::MEDIASTREAM_CAMERA && + (!base::FeatureList::IsEnabled(::features::kBlockMidiByDefault) || + content_type != ContentSettingsType::MIDI) && content_type != ContentSettingsType::MIDI_SYSEX && content_type != ContentSettingsType::CLIPBOARD_READ_WRITE && content_type != ContentSettingsType::SENSORS && @@ -1400,6 +1405,7 @@ case ContentSettingsType::COOKIES: case ContentSettingsType::POPUPS: case ContentSettingsType::MIXEDSCRIPT: + case ContentSettingsType::MIDI: case ContentSettingsType::MIDI_SYSEX: case ContentSettingsType::ADS: case ContentSettingsType::SOUND:
diff --git a/components/content_settings/content/BUILD.gn b/components/content_settings/content/BUILD.gn new file mode 100644 index 0000000..36c5add --- /dev/null +++ b/components/content_settings/content/BUILD.gn
@@ -0,0 +1,16 @@ +# Copyright 2023 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("content") { + sources = [ + "content_settings_partition_key_utils.cc", + "content_settings_partition_key_utils.h", + ] + + public_deps = [ "//components/content_settings/core/common" ] + deps = [ + "//base", + "//content/public/browser", + ] +}
diff --git a/components/content_settings/content/DEPS b/components/content_settings/content/DEPS new file mode 100644 index 0000000..fe7bb13 --- /dev/null +++ b/components/content_settings/content/DEPS
@@ -0,0 +1,3 @@ +include_rules = [ + "+content/public", +]
diff --git a/components/content_settings/content/content_settings_partition_key_utils.cc b/components/content_settings/content/content_settings_partition_key_utils.cc new file mode 100644 index 0000000..d5b1f69 --- /dev/null +++ b/components/content_settings/content/content_settings_partition_key_utils.cc
@@ -0,0 +1,28 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/content_settings/content/content_settings_partition_key_utils.h" + +#include "base/feature_list.h" +#include "components/content_settings/core/common/content_settings_partition_key.h" +#include "components/content_settings/core/common/features.h" +#include "content/public/browser/storage_partition.h" +#include "content/public/browser/storage_partition_config.h" + +namespace content_settings { + +PartitionKey GetPartitionKey(const content::StoragePartitionConfig& config) { + if (base::FeatureList::IsEnabled( + content_settings::features::kContentSettingsPartitioning)) { + return PartitionKey(config.partition_domain(), config.partition_name(), + config.in_memory()); + } + return PartitionKey(); +} + +PartitionKey GetPartitionKey(const content::StoragePartition& partition) { + return GetPartitionKey(partition.GetConfig()); +} + +} // namespace content_settings
diff --git a/components/content_settings/content/content_settings_partition_key_utils.h b/components/content_settings/content/content_settings_partition_key_utils.h new file mode 100644 index 0000000..f5c7ae2 --- /dev/null +++ b/components/content_settings/content/content_settings_partition_key_utils.h
@@ -0,0 +1,23 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_CONTENT_SETTINGS_CONTENT_CONTENT_SETTINGS_PARTITION_KEY_UTILS_H_ +#define COMPONENTS_CONTENT_SETTINGS_CONTENT_CONTENT_SETTINGS_PARTITION_KEY_UTILS_H_ + +#include "components/content_settings/core/common/content_settings_partition_key.h" + +namespace content { +class StoragePartitionConfig; +class StoragePartition; +} // namespace content + +namespace content_settings { + +PartitionKey GetPartitionKey(const content::StoragePartitionConfig& config); + +PartitionKey GetPartitionKey(const content::StoragePartition& partition); + +} // namespace content_settings + +#endif // COMPONENTS_CONTENT_SETTINGS_CONTENT_CONTENT_SETTINGS_PARTITION_KEY_UTILS_H_
diff --git a/components/content_settings/core/common/BUILD.gn b/components/content_settings/core/common/BUILD.gn index 34d42fe24..1878bacb 100644 --- a/components/content_settings/core/common/BUILD.gn +++ b/components/content_settings/core/common/BUILD.gn
@@ -16,6 +16,8 @@ "content_settings_metadata.h", "content_settings_param_traits.cc", "content_settings_param_traits.h", + "content_settings_partition_key.cc", + "content_settings_partition_key.h", "content_settings_pattern.cc", "content_settings_pattern.h", "content_settings_pattern_parser.cc",
diff --git a/components/content_settings/core/common/content_settings_partition_key.cc b/components/content_settings/core/common/content_settings_partition_key.cc new file mode 100644 index 0000000..2c98bf95 --- /dev/null +++ b/components/content_settings/core/common/content_settings_partition_key.cc
@@ -0,0 +1,35 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/content_settings/core/common/content_settings_partition_key.h" + +#include "base/check.h" + +namespace content_settings { + +#if BUILDFLAG(IS_IOS) +// static +const PartitionKey& PartitionKey::GetDefault() { + static const base::NoDestructor<PartitionKey> key; + return *key; +} +#endif // BUILDFLAG(IS_IOS) + +PartitionKey::PartitionKey(const PartitionKey& key) = default; +PartitionKey::PartitionKey(PartitionKey&& key) = default; + +PartitionKey::PartitionKey() : PartitionKey("", "", false) {} + +PartitionKey::PartitionKey(const std::string& domain, + const std::string& name, + bool in_memory) + : domain_{domain}, name_{name}, in_memory_{in_memory} { + if (domain_.empty()) { + // This is a default partition key. + CHECK(name_.empty()); + CHECK(!in_memory_); + } +} + +} // namespace content_settings
diff --git a/components/content_settings/core/common/content_settings_partition_key.h b/components/content_settings/core/common/content_settings_partition_key.h new file mode 100644 index 0000000..19d21979 --- /dev/null +++ b/components/content_settings/core/common/content_settings_partition_key.h
@@ -0,0 +1,68 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PARTITION_KEY_H_ +#define COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PARTITION_KEY_H_ + +#include <string> + +#include "build/build_config.h" + +#if BUILDFLAG(IS_IOS) +#include "base/no_destructor.h" +#else +namespace content { +class StoragePartitionConfig; +} // namespace content +#endif // BUILDFLAG(IS_IOS) + +namespace content_settings { + +// The partition key for content settings. Each of the partition is identified +// by the combination of `domain`, `name` and `in_memory`. `in_memory` means +// that the content settings should not be persisted to disk. +// +// The partitioning only applies to user-modifiable content settings (e.g. +// content settings managed by `content_settings::PrefProvider`) but not the +// others (e.g. content settings controlled by policy or extension ). +// +// For non-ios platforms, the partition key is computed directly or indirectly +// from `content::StoragePartitionConfig`. For ios, since partitioning is not +// supported, you can only get the default partition key. +class PartitionKey { + public: +#if BUILDFLAG(IS_IOS) + friend base::NoDestructor<PartitionKey>; + static const PartitionKey& GetDefault(); +#else + friend PartitionKey GetPartitionKey( + const content::StoragePartitionConfig& config); +#endif // BUILDFLAG(IS_IOS) + + PartitionKey(const PartitionKey& key); + PartitionKey(PartitionKey&& key); + + // When partitioning is enabled, `domain` and `name` are set to the same + // values as the StoragePartitionConfig. + const std::string& domain() const { return domain_; } + const std::string& name() const { return name_; } + + bool in_memory() const { return in_memory_; } + + bool is_default() const { return domain_.empty(); } + + private: + PartitionKey(); + PartitionKey(const std::string& domain, + const std::string& name, + bool in_memory); + + const std::string domain_; + const std::string name_; + const bool in_memory_; +}; + +} // namespace content_settings + +#endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_CONTENT_SETTINGS_PARTITION_KEY_H_
diff --git a/components/content_settings/core/common/content_settings_types.h b/components/content_settings/core/common/content_settings_types.h index a1f8e4c..fd86706 100644 --- a/components/content_settings/core/common/content_settings_types.h +++ b/components/content_settings/core/common/content_settings_types.h
@@ -11,7 +11,7 @@ // A particular type of content to care about. We give the user various types // of controls over each of these. // When adding/removing values from this enum, be sure to update the -// kHistogramValue array in content_settings.cc as well. +// kHistogramValue array in c/c/c/browser/content_settings_uma_util.cc as well. // A Java counterpart will be generated for this enum. // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.components.content_settings enum class ContentSettingsType : int32_t {
diff --git a/components/cronet/android/cronet_context_adapter.h b/components/cronet/android/cronet_context_adapter.h index 55619e5..ba7456a 100644 --- a/components/cronet/android/cronet_context_adapter.h +++ b/components/cronet/android/cronet_context_adapter.h
@@ -155,4 +155,4 @@ } // namespace cronet -#endif // COMPONENTS_CRONET_ANDROID_CRONET_ADAPTER_H_ +#endif // COMPONENTS_CRONET_ANDROID_CRONET_CONTEXT_ADAPTER_H_
diff --git a/components/cronet/cronet_global_state_stubs.cc b/components/cronet/cronet_global_state_stubs.cc index dff15ee..e1162a78 100644 --- a/components/cronet/cronet_global_state_stubs.cc +++ b/components/cronet/cronet_global_state_stubs.cc
@@ -30,7 +30,7 @@ std::ignore = new base::AtExitManager; #endif - base::FeatureList::InitializeInstance(std::string(), std::string()); + base::FeatureList::InitInstance(std::string(), std::string()); // Note that in component builds this ThreadPoolInstance will be shared with // the calling process, if it also depends on //base. In particular this means
diff --git a/components/custom_handlers/register_protocol_handler_permission_request.h b/components/custom_handlers/register_protocol_handler_permission_request.h index 0fd9112..7186fadd 100644 --- a/components/custom_handlers/register_protocol_handler_permission_request.h +++ b/components/custom_handlers/register_protocol_handler_permission_request.h
@@ -57,4 +57,4 @@ } // namespace custom_handlers -#endif // COMONENTS_CUSTOM_HANDLERS_REGISTER_PROTOCOL_HANDLER_PERMISSION_REQUEST_H_ +#endif // COMPONENTS_CUSTOM_HANDLERS_REGISTER_PROTOCOL_HANDLER_PERMISSION_REQUEST_H_
diff --git a/components/custom_handlers/simple_protocol_handler_registry_factory.h b/components/custom_handlers/simple_protocol_handler_registry_factory.h index 90a6d9d..5785c56 100644 --- a/components/custom_handlers/simple_protocol_handler_registry_factory.h +++ b/components/custom_handlers/simple_protocol_handler_registry_factory.h
@@ -64,4 +64,4 @@ } // namespace custom_handlers -#endif // COMPONENTS_CUSTOM_HANDLERS_SIMPLE_PROTOCOL_HANDLER_REGISTRY_FACTORY_H +#endif // COMPONENTS_CUSTOM_HANDLERS_SIMPLE_PROTOCOL_HANDLER_REGISTRY_FACTORY_H_
diff --git a/components/desks_storage/core/desk_model_wrapper.h b/components/desks_storage/core/desk_model_wrapper.h index f61816b..461e355 100644 --- a/components/desks_storage/core/desk_model_wrapper.h +++ b/components/desks_storage/core/desk_model_wrapper.h
@@ -81,4 +81,4 @@ } // namespace desks_storage -#endif // COMPONENTS_DESKS_STORAGE_CORE_LOCAL_DESK_DATA_MANAGER_H_ +#endif // COMPONENTS_DESKS_STORAGE_CORE_DESK_MODEL_WRAPPER_H_
diff --git a/components/device_reauth/device_authenticator_common.cc b/components/device_reauth/device_authenticator_common.cc index a73caa8..62626a2f 100644 --- a/components/device_reauth/device_authenticator_common.cc +++ b/components/device_reauth/device_authenticator_common.cc
@@ -32,12 +32,17 @@ if (!success) { return; } - device_authenticator_proxy_->UpdateLastGoodAuthTimestamp(); + if (device_authenticator_proxy_) { + device_authenticator_proxy_->UpdateLastGoodAuthTimestamp(); + } } bool DeviceAuthenticatorCommon::NeedsToAuthenticate() const { - auto last_good_auth_timestamp = - device_authenticator_proxy_->GetLastGoodAuthTimestamp(); + absl::optional<base::TimeTicks> last_good_auth_timestamp; + if (device_authenticator_proxy_) { + last_good_auth_timestamp = + device_authenticator_proxy_->GetLastGoodAuthTimestamp(); + } return !last_good_auth_timestamp.has_value() || base::TimeTicks::Now() - last_good_auth_timestamp.value() >=
diff --git a/components/device_signals/core/browser/mock_system_signals_service_host.h b/components/device_signals/core/browser/mock_system_signals_service_host.h index ce33961..7c1189f59 100644 --- a/components/device_signals/core/browser/mock_system_signals_service_host.h +++ b/components/device_signals/core/browser/mock_system_signals_service_host.h
@@ -42,4 +42,4 @@ } // namespace device_signals -#endif // COMPONENTS_DEVICE_SIGNALS_CORE_COMMON_MOCK_SYSTEM_SIGNALS_SERVICE_HOST_H_ +#endif // COMPONENTS_DEVICE_SIGNALS_CORE_BROWSER_MOCK_SYSTEM_SIGNALS_SERVICE_HOST_H_
diff --git a/components/device_signals/core/browser/system_signals_service_host.h b/components/device_signals/core/browser/system_signals_service_host.h index 38bcd07..f12f5b4 100644 --- a/components/device_signals/core/browser/system_signals_service_host.h +++ b/components/device_signals/core/browser/system_signals_service_host.h
@@ -23,4 +23,4 @@ } // namespace device_signals -#endif // COMPONENTS_DEVICE_SIGNALS_CORE_COMMON_SYSTEM_SIGNALS_SERVICE_HOST_H_ +#endif // COMPONENTS_DEVICE_SIGNALS_CORE_BROWSER_SYSTEM_SIGNALS_SERVICE_HOST_H_
diff --git a/components/enterprise/data_controls/verdict.cc b/components/enterprise/data_controls/verdict.cc index 7cf949d..6fc8476 100644 --- a/components/enterprise/data_controls/verdict.cc +++ b/components/enterprise/data_controls/verdict.cc
@@ -47,6 +47,8 @@ } Verdict::~Verdict() = default; +Verdict::Verdict(Verdict&& other) = default; +Verdict& Verdict::operator=(Verdict&& other) = default; Rule::Level Verdict::level() const { return level_;
diff --git a/components/enterprise/data_controls/verdict.h b/components/enterprise/data_controls/verdict.h index e2bab53f..a05a3815 100644 --- a/components/enterprise/data_controls/verdict.h +++ b/components/enterprise/data_controls/verdict.h
@@ -25,6 +25,8 @@ static Verdict Allow(); ~Verdict(); + Verdict(Verdict&&); + Verdict& operator=(Verdict&&); Rule::Level level() const;
diff --git a/components/exo/client_controlled_shell_surface.cc b/components/exo/client_controlled_shell_surface.cc index f7a5c8f..9a86dd9 100644 --- a/components/exo/client_controlled_shell_surface.cc +++ b/components/exo/client_controlled_shell_surface.cc
@@ -22,6 +22,7 @@ #include "ash/wm/client_controlled_state.h" #include "ash/wm/collision_detection/collision_detection_utils.h" #include "ash/wm/drag_details.h" +#include "ash/wm/pip/pip_controller.h" #include "ash/wm/pip/pip_positioner.h" #include "ash/wm/splitview/split_view_controller.h" #include "ash/wm/toplevel_window_event_handler.h" @@ -981,7 +982,8 @@ // resting postiion. The resting position should be fully controlled by // chrome afterwards because Android isn't aware of Chrome OS System UI. bool is_resizing_without_rotation = - !display_rotating_with_pip_ && + !display_rotating_with_pip_ && !IsDragging() && + !ash::Shell::Get()->pip_controller()->is_tucked() && GetWindowState()->GetCurrentBoundsInScreen().size() != bounds.size(); if (GetWindowState()->IsPip() && (!ash::PipPositioner::HasSnapFraction(GetWindowState()) ||
diff --git a/components/exo/client_controlled_shell_surface_unittest.cc b/components/exo/client_controlled_shell_surface_unittest.cc index 865ce13..3a40863b 100644 --- a/components/exo/client_controlled_shell_surface_unittest.cc +++ b/components/exo/client_controlled_shell_surface_unittest.cc
@@ -14,6 +14,7 @@ #include "ash/shell.h" #include "ash/system/unified/unified_system_tray.h" #include "ash/test/test_widget_builder.h" +#include "ash/wm/pip/pip_controller.h" #include "ash/wm/pip/pip_positioner.h" #include "ash/wm/splitview/split_view_controller.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" @@ -2245,7 +2246,7 @@ } TEST_P(ClientControlledShellSurfaceTest, - DoNotApplyCollisionDetectionWhileDragged) { + DoNotApplyCollisionDetectionWhileDraggedOrTucked) { constexpr gfx::Size buffer_size(256, 256); constexpr gfx::Rect original_bounds({8, 50}, buffer_size); auto shell_surface = exo::test::ShellSurfaceBuilder(buffer_size) @@ -2266,6 +2267,13 @@ shell_surface->SetGeometry(gfx::Rect(gfx::Point(20, 50), buffer_size)); surface->Commit(); EXPECT_EQ(gfx::Rect(20, 50, 256, 256), window->bounds()); + window_state->DeleteDragDetails(); + ASSERT_FALSE(window_state->is_dragged()); + + ash::Shell::Get()->pip_controller()->TuckWindow(/*left=*/true); + shell_surface->SetGeometry(gfx::Rect(gfx::Point(-20, 50), buffer_size)); + surface->Commit(); + EXPECT_EQ(gfx::Rect(-20, 50, 256, 256), window->bounds()); } TEST_P(ClientControlledShellSurfaceTest, EnteringPipSavesPipSnapFraction) {
diff --git a/components/exo/shell_surface_base.cc b/components/exo/shell_surface_base.cc index c14aa19..16c9e6d 100644 --- a/components/exo/shell_surface_base.cc +++ b/components/exo/shell_surface_base.cc
@@ -524,8 +524,9 @@ pending_top_inset_height_ = height; } -void ShellSurfaceBase::SetWindowCornerRadii(const gfx::RoundedCornersF& radii) { - TRACE_EVENT1("exo", "ShellSurfaceBase::SetWindowCornerRadii", "window_radii", +void ShellSurfaceBase::SetWindowCornersRadii( + const gfx::RoundedCornersF& radii) { + TRACE_EVENT1("exo", "ShellSurfaceBase::SetWindowCornerRadii", "radii", radii.ToString()); pending_window_corners_radii_dp_ = radii; }
diff --git a/components/exo/shell_surface_base.h b/components/exo/shell_surface_base.h index b04060fd..3b5f4475 100644 --- a/components/exo/shell_surface_base.h +++ b/components/exo/shell_surface_base.h
@@ -155,7 +155,7 @@ void SetPersistable(bool persistable); // Sets the window corner radii. - void SetWindowCornerRadii(const gfx::RoundedCornersF& radii); + void SetWindowCornersRadii(const gfx::RoundedCornersF& radii); // Sets the shadow corner radii. void SetShadowCornersRadii(const gfx::RoundedCornersF& radii);
diff --git a/components/exo/shell_surface_unittest.cc b/components/exo/shell_surface_unittest.cc index 9d39e35..9b7823b 100644 --- a/components/exo/shell_surface_unittest.cc +++ b/components/exo/shell_surface_unittest.cc
@@ -2881,7 +2881,7 @@ EXPECT_EQ(gfx::Rect(0, 0, 256, 256), shadow->content_bounds()); } -TEST_F(ShellSurfaceTest, ShadowRoundedCornersForRoundedWindows) { +TEST_F(ShellSurfaceTest, ShadowRoundedCorners) { constexpr gfx::Point kOrigin(20, 20); constexpr int kWindowCornerRadius = 12; @@ -2909,7 +2909,7 @@ EXPECT_EQ(shadow->rounded_corner_radius_for_testing(), 0); // Have a window with radius of 12dp. - shell_surface->SetWindowCornerRadii( + shell_surface->SetWindowCornersRadii( gfx::RoundedCornersF(kWindowCornerRadius)); root_surface->Commit(); @@ -2918,7 +2918,7 @@ EXPECT_EQ(shadow->rounded_corner_radius_for_testing(), kWindowCornerRadius); // Have a window with radius of 0dp. - shell_surface->SetWindowCornerRadii(gfx::RoundedCornersF()); + shell_surface->SetWindowCornersRadii(gfx::RoundedCornersF()); root_surface->Commit(); shadow = wm::ShadowController::GetShadowForWindow(window);
diff --git a/components/exo/sub_surface_observer.h b/components/exo/sub_surface_observer.h index ee93642..ded9720 100644 --- a/components/exo/sub_surface_observer.h +++ b/components/exo/sub_surface_observer.h
@@ -23,4 +23,4 @@ } // namespace exo -#endif // COMPONENTS_EXO_SURFACE_OBSERVER_H_ +#endif // COMPONENTS_EXO_SUB_SURFACE_OBSERVER_H_
diff --git a/components/exo/wayland/zaura_shell.cc b/components/exo/wayland/zaura_shell.cc index 33f5e61c..aef7986 100644 --- a/components/exo/wayland/zaura_shell.cc +++ b/components/exo/wayland/zaura_shell.cc
@@ -820,9 +820,8 @@ shell_surface_->SetOrientationLock(OrientationLock(lock_type)); } -void AuraToplevel::SetWindowRoundedCornerRadius( - const gfx::RoundedCornersF& radii) { - shell_surface_->SetWindowCornerRadii(radii); +void AuraToplevel::SetWindowCornersRadii(const gfx::RoundedCornersF& radii) { + shell_surface_->SetWindowCornersRadii(radii); } void AuraToplevel::SetClientSubmitsSurfacesInPixelCoordinates(bool enable) { @@ -1451,7 +1450,7 @@ uint32_t upper_right_radius, uint32_t lower_right_radius, uint32_t lower_left_radius) { - GetUserDataAs<AuraToplevel>(resource)->SetWindowRoundedCornerRadius( + GetUserDataAs<AuraToplevel>(resource)->SetWindowCornersRadii( gfx::RoundedCornersF(upper_left_radius, upper_right_radius, lower_right_radius, lower_left_radius)); }
diff --git a/components/exo/wayland/zaura_shell.h b/components/exo/wayland/zaura_shell.h index 0805bb09..aff04c74 100644 --- a/components/exo/wayland/zaura_shell.h +++ b/components/exo/wayland/zaura_shell.h
@@ -80,7 +80,6 @@ void Pin(bool trusted); void Unpin(); void SetOrientationLock(uint32_t orientation_lock); - void SetWindowRoundedCornerRadius(const gfx::RoundedCornersF& radii); void ShowTooltip(const char* text, const gfx::Point& position, uint32_t trigger, @@ -141,7 +140,7 @@ virtual ~AuraToplevel(); void SetOrientationLock(uint32_t lock_type); - void SetWindowRoundedCornerRadius(const gfx::RoundedCornersF& radii); + void SetWindowCornersRadii(const gfx::RoundedCornersF& radii); void SetClientSubmitsSurfacesInPixelCoordinates(bool enable); void SetClientUsesScreenCoordinates(); void SetWindowBounds(int32_t x,
diff --git a/components/exo/wayland/zcr_remote_shell_impl.cc b/components/exo/wayland/zcr_remote_shell_impl.cc index 7c97392..ab30d1ce 100644 --- a/components/exo/wayland/zcr_remote_shell_impl.cc +++ b/components/exo/wayland/zcr_remote_shell_impl.cc
@@ -1486,7 +1486,7 @@ uint32_t upper_right_radius, uint32_t lower_right_radius, uint32_t lower_left_radius) { - GetUserDataAs<ClientControlledShellSurface>(resource)->SetWindowCornerRadii( + GetUserDataAs<ClientControlledShellSurface>(resource)->SetWindowCornersRadii( gfx::RoundedCornersF(upper_left_radius, upper_right_radius, lower_right_radius, lower_left_radius)); }
diff --git a/components/feature_engagement/public/event_constants.cc b/components/feature_engagement/public/event_constants.cc index d571739..f32ea81 100644 --- a/components/feature_engagement/public/event_constants.cc +++ b/components/feature_engagement/public/event_constants.cc
@@ -24,9 +24,6 @@ const char kMediaBackgrounded[] = "media_backgrounded"; const char kGlobalMediaControlsOpened[] = "global_media_controls_opened"; -const char kFocusModeOpened[] = "focus_mode_opened"; -const char kFocusModeConditionsMet[] = "focus_mode_conditions_met"; - const char kSideSearchAutoTriggered[] = "side_search_auto_triggered"; const char kSideSearchOpened[] = "side_search_opened"; const char kSideSearchPageActionLabelShown[] =
diff --git a/components/feature_engagement/public/event_constants.h b/components/feature_engagement/public/event_constants.h index efb19893..2b032eaf 100644 --- a/components/feature_engagement/public/event_constants.h +++ b/components/feature_engagement/public/event_constants.h
@@ -39,14 +39,6 @@ // The user opened the Global Media Controls dialog. extern const char kGlobalMediaControlsOpened[]; -// All the events declared below are the string names of deferred onboarding -// events for the Focus Mode feature. - -// The user has opened a Focus Mode window. -extern const char kFocusModeOpened[]; -// All conditions for show Focus Mode IPH were met. -extern const char kFocusModeConditionsMet[]; - // The side search panel was automatically triggered. extern const char kSideSearchAutoTriggered[]; // The side search panel was opened by the user.
diff --git a/components/feature_engagement/public/feature_constants.cc b/components/feature_engagement/public/feature_constants.cc index 2608041..d51b500e 100644 --- a/components/feature_engagement/public/feature_constants.cc +++ b/components/feature_engagement/public/feature_constants.cc
@@ -478,7 +478,7 @@ base::FEATURE_DISABLED_BY_DEFAULT); BASE_FEATURE(kIPHWhatsNewFeature, "IPH_WhatsNew", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); BASE_FEATURE(kIPHReadingListMessagesFeature, "IPH_ReadingListMessages", base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/components/feature_engagement/public/stats.h b/components/feature_engagement/public/stats.h index 4280d2a..086fc4f1 100644 --- a/components/feature_engagement/public/stats.h +++ b/components/feature_engagement/public/stats.h
@@ -87,4 +87,4 @@ } // namespace feature_engagement::stats -#endif // COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_STATS_H_ +#endif // COMPONENTS_FEATURE_ENGAGEMENT_PUBLIC_STATS_H_
diff --git a/components/feedback/redaction_tool/inprocess_metrics_recorder.h b/components/feedback/redaction_tool/inprocess_metrics_recorder.h index 432bf36..2106bce 100644 --- a/components/feedback/redaction_tool/inprocess_metrics_recorder.h +++ b/components/feedback/redaction_tool/inprocess_metrics_recorder.h
@@ -27,4 +27,4 @@ } // namespace redaction -#endif +#endif // COMPONENTS_FEEDBACK_REDACTION_TOOL_INPROCESS_METRICS_RECORDER_H_
diff --git a/components/feedback/redaction_tool/inprocess_metrics_tester.h b/components/feedback/redaction_tool/inprocess_metrics_tester.h index a66a5ac..168844a1 100644 --- a/components/feedback/redaction_tool/inprocess_metrics_tester.h +++ b/components/feedback/redaction_tool/inprocess_metrics_tester.h
@@ -31,4 +31,4 @@ } // namespace redaction -#endif +#endif // COMPONENTS_FEEDBACK_REDACTION_TOOL_INPROCESS_METRICS_TESTER_H_
diff --git a/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java b/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java index f53f557e..82ab3f7 100644 --- a/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java +++ b/components/gcm_driver/instance_id/android/java/src/org/chromium/components/gcm_driver/instance_id/InstanceIDBridge.java
@@ -14,7 +14,6 @@ import org.chromium.components.gcm_driver.SubscriptionFlagManager; import java.io.IOException; -import java.util.concurrent.ExecutionException; /** * Wraps InstanceIDWithSubtype so it can be used over JNI. @@ -210,12 +209,17 @@ /** * Custom {@link AsyncTask} wrapper. As usual, this performs work on a background thread, then * sends the result back on the UI thread. Key differences: - * 1. Lazily initializes mInstanceID before running doBackgroundWork. - * 2. sendResultToNative will be skipped if the C++ counterpart has been destroyed. - * 3. Tasks run in parallel (using THREAD_POOL_EXECUTOR) to avoid blocking other Chrome tasks. - * 4. If setBlockOnAsyncTasksForTesting has been enabled, executing the task will block the UI - * thread, then directly call sendResultToNative. This is a workaround for use in tests - * that lack a nested Java message loop (which prevents onPostExecute from running). + * + * <p>1. Lazily initializes mInstanceID before running doBackgroundWork. + * + * <p>2. sendResultToNative will be skipped if the C++ counterpart has been destroyed. + * + * <p>3. Tasks run in parallel (using THREAD_POOL_EXECUTOR) to avoid blocking other Chrome + * tasks. + * + * <p>4. If setBlockOnAsyncTasksForTesting has been enabled, the work will skip the thread pool + * executor and run directly on the main thread. This is necessary because there are some + * complex behaviors around executor lifecycle in unit tests. */ private abstract class BridgeAsyncTask<Result> { protected abstract Result doBackgroundWork(); @@ -223,6 +227,13 @@ protected abstract void sendResultToNative(Result result); public void execute() { + if (sBlockOnAsyncTasksForTesting) { + if (mInstanceID == null) { + mInstanceID = InstanceIDWithSubtype.getInstance(mSubtype); + } + sendResultToNative(doBackgroundWork()); + return; + } AsyncTask<Result> task = new AsyncTask<Result>() { @Override @@ -239,22 +250,12 @@ @Override protected void onPostExecute(Result result) { - if (!sBlockOnAsyncTasksForTesting && mNativeInstanceIDAndroid != 0) { + if (mNativeInstanceIDAndroid != 0) { sendResultToNative(result); } } }; task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - if (sBlockOnAsyncTasksForTesting) { - Result result; - try { - // Synchronously block the UI thread until doInBackground returns result. - result = task.get(); - } catch (InterruptedException | ExecutionException e) { - throw new IllegalStateException(e); // Shouldn't happen in tests. - } - sendResultToNative(result); - } } }
diff --git a/components/gcm_driver/instance_id/android/javatests/src/org/chromium/components/gcm_driver/instance_id/FakeInstanceIDWithSubtype.java b/components/gcm_driver/instance_id/android/javatests/src/org/chromium/components/gcm_driver/instance_id/FakeInstanceIDWithSubtype.java index 219fb8f..d88c1c80 100644 --- a/components/gcm_driver/instance_id/android/javatests/src/org/chromium/components/gcm_driver/instance_id/FakeInstanceIDWithSubtype.java +++ b/components/gcm_driver/instance_id/android/javatests/src/org/chromium/components/gcm_driver/instance_id/FakeInstanceIDWithSubtype.java
@@ -4,11 +4,8 @@ package org.chromium.components.gcm_driver.instance_id; -import android.os.Looper; import android.util.Pair; -import com.google.android.gms.iid.InstanceID; - import org.jni_zero.CalledByNative; import org.jni_zero.JNINamespace; @@ -92,17 +89,11 @@ } } + // The real InstanceID function calls should not be made from the main thread + // due to strict mode violations. However, we don't enforce that in this fake. private FakeInstanceIDWithSubtype(String subtype) { super(null); mSubtype = subtype; - - // The first call to InstanceIDWithSubtype.getInstance calls InstanceID.getInstance which - // triggers a strict mode violation if it's called on the main thread, by reading from - // SharedPreferences. Since we can't override those static methods to simulate the strict - // mode violation in tests, check the thread here (which is only called from getInstance). - if (Looper.getMainLooper() == Looper.myLooper()) { - throw new AssertionError(InstanceID.ERROR_MAIN_THREAD); - } } @Override @@ -112,12 +103,6 @@ @Override public String getId() { - // InstanceID.getId sometimes triggers a strict mode violation if it's called on the main - // thread, by reading from SharedPreferences. - if (Looper.getMainLooper() == Looper.myLooper()) { - throw new AssertionError(InstanceID.ERROR_MAIN_THREAD); - } - if (mId == null) { mCreationTime = System.currentTimeMillis(); mId = randomBase64(/* encodedLength= */ 11); @@ -127,22 +112,11 @@ @Override public long getCreationTime() { - // InstanceID.getCreationTime sometimes triggers a strict mode violation if it's called on - // the main thread, by reading from SharedPreferences. - if (Looper.getMainLooper() == Looper.myLooper()) { - throw new AssertionError(InstanceID.ERROR_MAIN_THREAD); - } - return mCreationTime; } @Override public String getToken(String authorizedEntity, String scope) throws IOException { - // InstanceID.getToken enforces this. - if (Looper.getMainLooper() == Looper.myLooper()) { - throw new IOException(InstanceID.ERROR_MAIN_THREAD); - } - String key = getSubtype() + ',' + authorizedEntity + ',' + scope; String token = mTokens.get(key); if (token == null) { @@ -155,11 +129,6 @@ @Override public void deleteToken(String authorizedEntity, String scope) throws IOException { - // InstanceID.deleteToken enforces this. - if (Looper.getMainLooper() == Looper.myLooper()) { - throw new IOException(InstanceID.ERROR_MAIN_THREAD); - } - String key = getSubtype() + ',' + authorizedEntity + ',' + scope; mTokens.remove(key); // Calling deleteToken causes ID to be generated; can be observed though getCreationTime. @@ -171,11 +140,6 @@ synchronized (sSubtypeInstancesLock) { sSubtypeInstances.remove(getSubtype()); - // InstanceID.deleteInstanceID calls InstanceID.deleteToken which enforces this. - if (Looper.getMainLooper() == Looper.myLooper()) { - throw new IOException(InstanceID.ERROR_MAIN_THREAD); - } - mTokens.clear(); mCreationTime = 0; mId = null;
diff --git a/components/global_media_controls/public/test/mock_device_service.h b/components/global_media_controls/public/test/mock_device_service.h index 0dfb953e..e41c091 100644 --- a/components/global_media_controls/public/test/mock_device_service.h +++ b/components/global_media_controls/public/test/mock_device_service.h
@@ -119,4 +119,4 @@ } // namespace global_media_controls::test -#endif // COMPONENTS_GLOBAL_MEDIA_CONTROLS_PUBLIC_MOCK_DEVICE_SERVICE_H_ +#endif // COMPONENTS_GLOBAL_MEDIA_CONTROLS_PUBLIC_TEST_MOCK_DEVICE_SERVICE_H_
diff --git a/components/javascript_dialogs/app_modal_dialog_manager_delegate.h b/components/javascript_dialogs/app_modal_dialog_manager_delegate.h index 9bbb720..6c0c2c1 100644 --- a/components/javascript_dialogs/app_modal_dialog_manager_delegate.h +++ b/components/javascript_dialogs/app_modal_dialog_manager_delegate.h
@@ -29,4 +29,4 @@ } // namespace javascript_dialogs -#endif +#endif // COMPONENTS_JAVASCRIPT_DIALOGS_APP_MODAL_DIALOG_MANAGER_DELEGATE_H_
diff --git a/components/js_injection/common/features.h b/components/js_injection/common/features.h index 3adc2c0..74ddffa10 100644 --- a/components/js_injection/common/features.h +++ b/components/js_injection/common/features.h
@@ -16,4 +16,4 @@ } // namespace js_injection -#endif +#endif // COMPONENTS_JS_INJECTION_COMMON_FEATURES_H_
diff --git a/components/js_injection/common/web_message_mojom_traits.h b/components/js_injection/common/web_message_mojom_traits.h index c378a22..e50baef 100644 --- a/components/js_injection/common/web_message_mojom_traits.h +++ b/components/js_injection/common/web_message_mojom_traits.h
@@ -65,4 +65,4 @@ } // namespace mojo -#endif +#endif // COMPONENTS_JS_INJECTION_COMMON_WEB_MESSAGE_MOJOM_TRAITS_H_
diff --git a/components/lens/lens_metadata.h b/components/lens/lens_metadata.h index 2ac9e9f..d9ab531 100644 --- a/components/lens/lens_metadata.h +++ b/components/lens/lens_metadata.h
@@ -14,4 +14,4 @@ const std::vector<lens::mojom::LatencyLogPtr>& log_data); } -#endif // COMPONENTS_LENS_LENS_ENTRYPOINTS_H_ +#endif // COMPONENTS_LENS_LENS_METADATA_H_
diff --git a/components/metrics/metrics_logs_event_manager.h b/components/metrics/metrics_logs_event_manager.h index 883860f..2623644c 100644 --- a/components/metrics/metrics_logs_event_manager.h +++ b/components/metrics/metrics_logs_event_manager.h
@@ -138,4 +138,4 @@ } // namespace metrics -#endif // COMPONENTS_METRICS_METRICS_LOG_EVENT_MANAGER_H_ +#endif // COMPONENTS_METRICS_METRICS_LOGS_EVENT_MANAGER_H_
diff --git a/components/omnibox/browser/autocomplete_match.cc b/components/omnibox/browser/autocomplete_match.cc index e5b6ec2..c576b2b 100644 --- a/components/omnibox/browser/autocomplete_match.cc +++ b/components/omnibox/browser/autocomplete_match.cc
@@ -126,6 +126,10 @@ // 2) They may display enhanced information such as the bookmark // folders path. {AutocompleteProvider::TYPE_BOOKMARK, 1}, + // Don't let bookmarks override builtins, as that interferes with + // starter pack matches when user has bookmarked their destination. + {AutocompleteProvider::TYPE_BUILTIN, + OmniboxFieldTrial::IsKeywordModeRefreshEnabled() ? 1 : 0}, // Prefer non-shorcut matches over shortcuts, the latter of which may // have stale or missing URL titles (the latter from what-you-typed // matches). @@ -642,6 +646,18 @@ // static bool AutocompleteMatch::BetterDuplicate(const AutocompleteMatch& match1, const AutocompleteMatch& match2) { + if (OmniboxFieldTrial::IsKeywordModeRefreshEnabled()) { + // Prefer starter pack matches. + if (match1.type == AutocompleteMatchType::STARTER_PACK && + match2.type != AutocompleteMatchType::STARTER_PACK) { + return true; + } + if (match1.type != AutocompleteMatchType::STARTER_PACK && + match2.type == AutocompleteMatchType::STARTER_PACK) { + return false; + } + } + // Prefer the Entity Match over the non-entity match, if they have the same // |fill_into_edit| value. if (match1.type == AutocompleteMatchType::SEARCH_SUGGEST_ENTITY &&
diff --git a/components/onc/docs/onc_spec.md b/components/onc/docs/onc_spec.md index ca5332e1a..a18a0072 100644 --- a/components/onc/docs/onc_spec.md +++ b/components/onc/docs/onc_spec.md
@@ -1325,6 +1325,12 @@ presented to the outer protocol. This value is subject to string expansions. If not specified, use empty string. +* **ClientCertKeyPairAlias** + * (required if **ClientCertType** is *KeyPairAlias*, otherwise ignored) - + **string** + * Key pair alias specifies the client certificate stored in Android keychain + and allowed for Wi-Fi authentication. + * **ClientCertPKCS11Id** * (required if **ClientCertType** is *PKCS11Id*, otherwise ignored) - * PKCS#11 identifier in the format slot:key_id. @@ -1341,12 +1347,13 @@ * **ClientCertType** * (optional) - **string** * Allowed values are: + * *KeyPairAlias* (Android only) * *PKCS11Id* * *Pattern* * *Ref* * *None* - * *Ref* and *Pattern* indicate that the associated property should be used - to identify the client certificate. + * *KeyPairAlias*, *Ref* and *Pattern* indicate that the associated property + should be used to identify the client certificate. * *PKCS11Id* is used when representing a certificate in a local store and is only valid when describing a local configuration. * *None* indicates that the server is configured to not require client
diff --git a/components/optimization_guide/core/model_enums.h b/components/optimization_guide/core/model_enums.h index 71b4b06..3c490be 100644 --- a/components/optimization_guide/core/model_enums.h +++ b/components/optimization_guide/core/model_enums.h
@@ -85,4 +85,4 @@ } // namespace optimization_guide -#endif // COMPONENTS_OPTIMIZATION_GUIDE_CORE_OPTIMIZATION_GUIDE_ENUMS_H_ +#endif // COMPONENTS_OPTIMIZATION_GUIDE_CORE_MODEL_ENUMS_H_
diff --git a/components/optimization_guide/core/model_execution/model_execution_manager.cc b/components/optimization_guide/core/model_execution/model_execution_manager.cc index 125ef165..2a0cbd29 100644 --- a/components/optimization_guide/core/model_execution/model_execution_manager.cc +++ b/components/optimization_guide/core/model_execution/model_execution_manager.cc
@@ -284,8 +284,8 @@ base::BindRepeating(&ModelExecutionManager::ExecuteModelWithStreaming, base::Unretained(this)); if (on_device_model_service_controller_) { - auto session = - on_device_model_service_controller_->CreateSession(feature, execute_fn); + auto session = on_device_model_service_controller_->CreateSession( + feature, execute_fn, optimization_guide_logger_.get()); if (session) { RecordSessionUsedRemoteExecutionHistogram(feature, /*is_remote=*/false); return session; @@ -294,7 +294,8 @@ RecordSessionUsedRemoteExecutionHistogram(feature, /*is_remote=*/true); return std::make_unique<SessionImpl>(base::DoNothing(), feature, nullptr, - nullptr, std::move(execute_fn)); + nullptr, std::move(execute_fn), + optimization_guide_logger_.get()); } void ModelExecutionManager::OnModelExecuteResponse(
diff --git a/components/optimization_guide/core/model_execution/on_device_model_service_controller.cc b/components/optimization_guide/core/model_execution/on_device_model_service_controller.cc index 5e69969..376bc64 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_service_controller.cc +++ b/components/optimization_guide/core/model_execution/on_device_model_service_controller.cc
@@ -91,7 +91,8 @@ std::unique_ptr<OptimizationGuideModelExecutor::Session> OnDeviceModelServiceController::CreateSession( proto::ModelExecutionFeature feature, - ExecuteRemoteFn execute_remote_fn) { + ExecuteRemoteFn execute_remote_fn, + OptimizationGuideLogger* optimization_guide_logger) { ScopedEligibilityReasonLogger logger(feature); if (!base::FeatureList::IsEnabled( features::kOptimizationGuideOnDeviceModel)) { @@ -119,7 +120,7 @@ base::BindRepeating(&OnDeviceModelServiceController::StartMojoSession, weak_ptr_factory_.GetWeakPtr()), feature, config_interpreter_.get(), weak_ptr_factory_.GetWeakPtr(), - std::move(execute_remote_fn)); + std::move(execute_remote_fn), optimization_guide_logger); } void OnDeviceModelServiceController::GetEstimatedPerformanceClass(
diff --git a/components/optimization_guide/core/model_execution/on_device_model_service_controller.h b/components/optimization_guide/core/model_execution/on_device_model_service_controller.h index dd5cec1..e55625b 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_service_controller.h +++ b/components/optimization_guide/core/model_execution/on_device_model_service_controller.h
@@ -21,6 +21,8 @@ #include "services/on_device_model/public/mojom/on_device_model_service.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" +class OptimizationGuideLogger; + namespace base { class FilePath; } // namespace base @@ -59,7 +61,8 @@ // context, executing input, and sending the response. std::unique_ptr<OptimizationGuideModelExecutor::Session> CreateSession( proto::ModelExecutionFeature feature, - ExecuteRemoteFn execute_remote_fn); + ExecuteRemoteFn execute_remote_fn, + OptimizationGuideLogger* logger); // Launches the on-device model-service. virtual void LaunchService() = 0;
diff --git a/components/optimization_guide/core/model_execution/on_device_model_service_controller_unittest.cc b/components/optimization_guide/core/model_execution/on_device_model_service_controller_unittest.cc index 11587e3..e4114bc0 100644 --- a/components/optimization_guide/core/model_execution/on_device_model_service_controller_unittest.cc +++ b/components/optimization_guide/core/model_execution/on_device_model_service_controller_unittest.cc
@@ -15,6 +15,7 @@ #include "components/optimization_guide/core/model_execution/on_device_model_access_controller.h" #include "components/optimization_guide/core/model_execution/on_device_model_execution_config_interpreter.h" #include "components/optimization_guide/core/optimization_guide_features.h" +#include "components/optimization_guide/core/optimization_guide_logger.h" #include "components/optimization_guide/core/optimization_guide_prefs.h" #include "components/optimization_guide/core/optimization_guide_util.h" #include "components/optimization_guide/proto/features/compose.pb.h" @@ -29,6 +30,7 @@ using ::testing::ElementsAreArray; using on_device_model::mojom::LoadModelResult; +using ExecuteModelResult = SessionImpl::ExecuteModelResult; namespace { // If non-zero this amount of delay is added before the response is sent. @@ -332,12 +334,14 @@ base::test::ScopedFeatureList feature_list_; bool remote_execute_called_ = false; std::unique_ptr<google::protobuf::MessageLite> last_remote_message_; + OptimizationGuideLogger logger_; }; TEST_F(OnDeviceModelServiceControllerTest, ModelExecutionSuccess) { base::HistogramTester histogram_tester; - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session); ExecuteModel(*session, "foo"); task_environment_.RunUntilIdle(); @@ -352,9 +356,16 @@ } TEST_F(OnDeviceModelServiceControllerTest, ModelExecutionWithContext) { - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session); - AddContext(*session, "foo"); + { + base::HistogramTester histogram_tester; + AddContext(*session, "foo"); + histogram_tester.ExpectUniqueSample( + "OptimizationGuide.ModelExecution.OnDeviceAddContextResult.Compose", + SessionImpl::AddContextResult::kUsingOnDevice, 1); + } task_environment_.RunUntilIdle(); AddContext(*session, "bar"); @@ -371,7 +382,8 @@ TEST_F(OnDeviceModelServiceControllerTest, ModelExecutionLoadsSingleContextChunk) { - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session); AddContext(*session, "context"); @@ -391,7 +403,8 @@ TEST_F(OnDeviceModelServiceControllerTest, ModelExecutionLoadsLongContextInChunks) { - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session); AddContext(*session, "this is long context"); @@ -413,7 +426,8 @@ TEST_F(OnDeviceModelServiceControllerTest, ModelExecutionCancelsOptionalContext) { - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session); AddContext(*session, "this is long context"); @@ -434,7 +448,7 @@ EXPECT_FALSE(test_controller_->CreateSession( proto::ModelExecutionFeature::MODEL_EXECUTION_FEATURE_TAB_ORGANIZATION, - base::DoNothing())); + base::DoNothing(), &logger_)); histogram_tester.ExpectUniqueSample( "OptimizationGuide.ModelExecution.OnDeviceModelEligibilityReason." @@ -450,7 +464,8 @@ {"on_device_model_max_tokens_for_context", "22"}, {"on_device_model_context_token_chunk_size", "4"}}); - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session); AddContext(*session, "context"); @@ -470,13 +485,22 @@ } TEST_F(OnDeviceModelServiceControllerTest, ReturnsErrorOnServiceDisconnect) { - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeatureWithParameters( + features::kOptimizationGuideOnDeviceModel, + {{"on_device_fallback_to_server_on_disconnect", "false"}}); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session); task_environment_.RunUntilIdle(); test_controller_->LaunchService(); ExecuteModel(*session, "foo"); + base::HistogramTester histogram_tester; task_environment_.RunUntilIdle(); + histogram_tester.ExpectUniqueSample( + "OptimizationGuide.ModelExecution.OnDeviceExecuteModelResult.Compose", + ExecuteModelResult::kDisconnectAndCancel, 1); ASSERT_TRUE(response_error_); EXPECT_EQ( @@ -485,12 +509,17 @@ } TEST_F(OnDeviceModelServiceControllerTest, CancelsExecuteOnAddContext) { - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session); task_environment_.RunUntilIdle(); ExecuteModel(*session, "foo"); + base::HistogramTester histogram_tester; AddContext(*session, "bar"); + histogram_tester.ExpectUniqueSample( + "OptimizationGuide.ModelExecution.OnDeviceExecuteModelResult.Compose", + ExecuteModelResult::kCancelled, 1); task_environment_.RunUntilIdle(); EXPECT_TRUE(response_error_); @@ -500,7 +529,8 @@ } TEST_F(OnDeviceModelServiceControllerTest, CancelsExecuteOnExecute) { - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session); task_environment_.RunUntilIdle(); @@ -519,7 +549,8 @@ TEST_F(OnDeviceModelServiceControllerTest, WontStartSessionAfterGpuBlocked) { // Start a session. test_controller_->set_load_model_result(LoadModelResult::kGpuBlocked); - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session); // Wait for the service to launch, and be shut down. @@ -529,7 +560,8 @@ base::HistogramTester histogram_tester; // Because the model returned kGpuBlocked, no more sessions should start. - EXPECT_FALSE(test_controller_->CreateSession(kFeature, base::DoNothing())); + EXPECT_FALSE( + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_)); histogram_tester.ExpectUniqueSample( "OptimizationGuide.ModelExecution.OnDeviceModelEligibilityReason." @@ -540,7 +572,8 @@ TEST_F(OnDeviceModelServiceControllerTest, DontRecreateSessionIfGpuBlocked) { test_controller_->set_load_model_result(LoadModelResult::kGpuBlocked); - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); ASSERT_TRUE(session); // Wait for the service to launch, and be shut down. @@ -557,14 +590,16 @@ test_controller_->set_drop_connection_request(true); for (int i = 0; i < features::GetOnDeviceModelCrashCountBeforeDisable(); ++i) { - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session) << i; task_environment_.RunUntilIdle(); } { base::HistogramTester histogram_tester; - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_FALSE(session); histogram_tester.ExpectUniqueSample( @@ -578,7 +613,8 @@ // Start a session. for (int i = 0; i < 10; ++i) { test_controller_->set_drop_connection_request(i % 2 == 1); - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session) << i; task_environment_.RunUntilIdle(); } @@ -590,11 +626,13 @@ test_controller_->set_drop_connection_request(true); for (int i = 0; i < features::GetOnDeviceModelCrashCountBeforeDisable(); ++i) { - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session) << i; task_environment_.RunUntilIdle(); } - EXPECT_FALSE(test_controller_->CreateSession(kFeature, base::DoNothing())); + EXPECT_FALSE( + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_)); // Change the pref to a different value and recreate the service. access_controller_ = nullptr; @@ -604,12 +642,14 @@ RecreateServiceController(); // A new session should be started because the version changed. - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session); } TEST_F(OnDeviceModelServiceControllerTest, AddContextDisconnectExecute) { - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session); AddContext(*session, "foo"); task_environment_.RunUntilIdle(); @@ -620,7 +660,11 @@ // Send some text, ensuring the context is received. ExecuteModel(*session, "baz"); + base::HistogramTester histogram_tester; task_environment_.RunUntilIdle(); + histogram_tester.ExpectUniqueSample( + "OptimizationGuide.ModelExecution.OnDeviceExecuteModelResult.Compose", + ExecuteModelResult::kUsedOnDevice, 1); ASSERT_TRUE(response_received_); const std::vector<std::string> expected_responses = ConcatResponses({ "Context: ctx:foo off:0 max:10\n", @@ -631,7 +675,8 @@ } TEST_F(OnDeviceModelServiceControllerTest, AddContextExecuteDisconnect) { - auto session = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session); AddContext(*session, "foo"); task_environment_.RunUntilIdle(); @@ -644,13 +689,15 @@ } TEST_F(OnDeviceModelServiceControllerTest, ExecuteDisconnectedSession) { - auto session1 = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session1 = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session1); AddContext(*session1, "foo"); task_environment_.RunUntilIdle(); // Start another session. - auto session2 = test_controller_->CreateSession(kFeature, base::DoNothing()); + auto session2 = + test_controller_->CreateSession(kFeature, base::DoNothing(), &logger_); EXPECT_TRUE(session2); AddContext(*session2, "bar"); task_environment_.RunUntilIdle(); @@ -680,8 +727,8 @@ TEST_F(OnDeviceModelServiceControllerTest, CallsRemoteExecute) { test_controller_->set_load_model_result(LoadModelResult::kGpuBlocked); - auto session = - test_controller_->CreateSession(kFeature, CreateExecuteRemoteFn()); + auto session = test_controller_->CreateSession( + kFeature, CreateExecuteRemoteFn(), &logger_); ASSERT_TRUE(session); // Wait for the service to launch, and be shut down. @@ -689,7 +736,13 @@ test_controller_->clear_did_launch_service(); // Adding context should not trigger launching the service again. - AddContext(*session, "baz"); + { + base::HistogramTester histogram_tester; + AddContext(*session, "baz"); + histogram_tester.ExpectUniqueSample( + "OptimizationGuide.ModelExecution.OnDeviceAddContextResult.Compose", + SessionImpl::AddContextResult::kUsingServer, 1); + } ExecuteModel(*session, "2"); EXPECT_TRUE(remote_execute_called_); EXPECT_FALSE(test_controller_->did_launch_service()); @@ -714,12 +767,24 @@ std::move(config_interpreter)); config_interpreter_raw->OverrideFeatureConfigForTesting(config); - auto session = - test_controller_->CreateSession(kFeature, CreateExecuteRemoteFn()); + auto session = test_controller_->CreateSession( + kFeature, CreateExecuteRemoteFn(), &logger_); ASSERT_TRUE(session); - AddContext(*session, "foo"); + { + base::HistogramTester histogram_tester; + AddContext(*session, "foo"); + histogram_tester.ExpectUniqueSample( + "OptimizationGuide.ModelExecution.OnDeviceAddContextResult.Compose", + SessionImpl::AddContextResult::kFailedConstructingInput, 1); + } task_environment_.RunUntilIdle(); - ExecuteModel(*session, "2"); + { + base::HistogramTester histogram_tester; + ExecuteModel(*session, "2"); + histogram_tester.ExpectUniqueSample( + "OptimizationGuide.ModelExecution.OnDeviceExecuteModelResult.Compose", + ExecuteModelResult::kUsedServer, 1); + } EXPECT_TRUE(remote_execute_called_); } @@ -742,23 +807,31 @@ std::move(config_interpreter)); config_interpreter_raw->OverrideFeatureConfigForTesting(config); - auto session = - test_controller_->CreateSession(kFeature, CreateExecuteRemoteFn()); + auto session = test_controller_->CreateSession( + kFeature, CreateExecuteRemoteFn(), &logger_); ASSERT_TRUE(session); + base::HistogramTester histogram_tester; ExecuteModel(*session, "2"); + histogram_tester.ExpectUniqueSample( + "OptimizationGuide.ModelExecution.OnDeviceExecuteModelResult.Compose", + ExecuteModelResult::kFailedConstructingMessage, 1); EXPECT_TRUE(remote_execute_called_); } TEST_F(OnDeviceModelServiceControllerTest, FallbackToServerAfterDelay) { g_execute_delay = features::GetOnDeviceModelTimeForInitialResponse() * 2; - auto session = - test_controller_->CreateSession(kFeature, CreateExecuteRemoteFn()); + auto session = test_controller_->CreateSession( + kFeature, CreateExecuteRemoteFn(), &logger_); ASSERT_TRUE(session); ExecuteModel(*session, "2z"); + base::HistogramTester histogram_tester; task_environment_.FastForwardBy( features::GetOnDeviceModelTimeForInitialResponse() + base::Milliseconds(1)); + histogram_tester.ExpectUniqueSample( + "OptimizationGuide.ModelExecution.OnDeviceExecuteModelResult.Compose", + ExecuteModelResult::kTimedOut, 1); EXPECT_TRUE(streamed_responses_.empty()); EXPECT_FALSE(response_received_); EXPECT_TRUE(remote_execute_called_); @@ -769,4 +842,20 @@ EXPECT_EQ("2z", compose_request.page_metadata().page_url()); } +TEST_F(OnDeviceModelServiceControllerTest, + FallbackToServerOnDisconnectWhileWaitingForExecute) { + auto session = test_controller_->CreateSession( + kFeature, CreateExecuteRemoteFn(), &logger_); + EXPECT_TRUE(session); + task_environment_.RunUntilIdle(); + test_controller_->LaunchService(); + ExecuteModel(*session, "foo"); + base::HistogramTester histogram_tester; + task_environment_.RunUntilIdle(); + histogram_tester.ExpectUniqueSample( + "OptimizationGuide.ModelExecution.OnDeviceExecuteModelResult.Compose", + ExecuteModelResult::kDisconnectAndFallbackToServer, 1); + EXPECT_TRUE(remote_execute_called_); +} + } // namespace optimization_guide
diff --git a/components/optimization_guide/core/model_execution/session_impl.cc b/components/optimization_guide/core/model_execution/session_impl.cc index 8edbb87..cf05b9d 100644 --- a/components/optimization_guide/core/model_execution/session_impl.cc +++ b/components/optimization_guide/core/model_execution/session_impl.cc
@@ -5,9 +5,11 @@ #include "components/optimization_guide/core/model_execution/session_impl.h" #include "base/metrics/histogram_functions.h" +#include "base/strings/stringprintf.h" #include "components/optimization_guide/core/model_execution/on_device_model_execution_config_interpreter.h" #include "components/optimization_guide/core/model_execution/on_device_model_service_controller.h" #include "components/optimization_guide/core/optimization_guide_features.h" +#include "components/optimization_guide/core/optimization_guide_logger.h" #include "components/optimization_guide/core/optimization_guide_util.h" namespace optimization_guide { @@ -58,6 +60,8 @@ } } + std::string& input() { return input_; } + uint32_t tokens_processed() const { return tokens_processed_; } private: @@ -86,42 +90,58 @@ proto::ModelExecutionFeature feature, const OnDeviceModelExecutionConfigInterpreter* config_interpreter, base::WeakPtr<OnDeviceModelServiceController> controller, - ExecuteRemoteFn execute_remote_fn) + ExecuteRemoteFn execute_remote_fn, + OptimizationGuideLogger* optimization_guide_logger) : controller_(controller), feature_(feature), - execute_remote_fn_(std::move(execute_remote_fn)) { + execute_remote_fn_(std::move(execute_remote_fn)), + optimization_guide_logger_(optimization_guide_logger) { if (controller_ && controller_->ShouldStartNewSession()) { on_device_state_.emplace(std::move(start_session_fn), this); on_device_state_->config_interpreter = config_interpreter; // Prewarm the initial session to make sure the service is started. GetOrCreateSession(); } + OPTIMIZATION_GUIDE_LOGGER( + optimization_guide_common::mojom::LogSource::MODEL_EXECUTION, + optimization_guide_logger_) + << "Starting on-device session for " + << std::string(GetStringNameForModelExecutionFeature(feature_)); } SessionImpl::~SessionImpl() = default; void SessionImpl::AddContext( const google::protobuf::MessageLite& request_metadata) { + const auto result = AddContextImpl(request_metadata); + base::UmaHistogramEnumeration( + base::StrCat( + {"OptimizationGuide.ModelExecution.OnDeviceAddContextResult.", + GetStringNameForModelExecutionFeature(feature_)}), + result); +} + +SessionImpl::AddContextResult SessionImpl::AddContextImpl( + const google::protobuf::MessageLite& request_metadata) { context_.reset(request_metadata.New()); context_->CheckTypeAndMergeFrom(request_metadata); if (!ShouldUseOnDeviceModel()) { DestroyOnDeviceState(); - return; + return AddContextResult::kUsingServer; } on_device_state_->add_context_before_execute = false; auto input = on_device_state_->config_interpreter->ConstructInputString( feature_, *context_, /*want_input_context=*/true); if (!input) { - // TODO(b/313666843): add metrics. // Use server if can't construct input. DestroyOnDeviceState(); - return; + return AddContextResult::kFailedConstructingInput; } // Cancel any pending response. - CancelPendingResponse(); + CancelPendingResponse(ExecuteModelResult::kCancelled); // Only the latest context is used, so restart the mojo session here. on_device_state_->session.reset(); @@ -133,12 +153,15 @@ on_device_state_->context_processor = std::make_unique<ContextProcessor>(*this, input->input_string); + return AddContextResult::kUsingOnDevice; } void SessionImpl::ExecuteModel( const google::protobuf::MessageLite& request_metadata, optimization_guide::OptimizationGuideModelExecutionResultStreamingCallback callback) { + std::unique_ptr<ExecuteModelHistogramLogger> logger = + std::make_unique<ExecuteModelHistogramLogger>(feature_); last_message_ = MergeContext(request_metadata); if (!ShouldUseOnDeviceModel()) { @@ -158,15 +181,16 @@ auto input = on_device_state_->config_interpreter->ConstructInputString( feature_, *last_message_, /*want_input_context=*/false); if (!input) { - // TODO(b/313666843): add metrics. // Use server if can't construct input. + on_device_state_->histogram_logger = std::move(logger); on_device_state_->callback = std::move(callback); - FallbackToRemote(); + DestroyOnDeviceStateAndFallbackToRemote( + ExecuteModelResult::kFailedConstructingMessage); return; } // Make sure to cancel any pending response. - CancelPendingResponse(); + CancelPendingResponse(ExecuteModelResult::kCancelled); // Cancel any optional context still processing. if (on_device_state_->context_processor) { @@ -178,11 +202,36 @@ on_device_state_->context_processor->tokens_processed()); } + // Note: if on-device fails for some reason, the result will be changed. + logger->set_result(ExecuteModelResult::kUsedOnDevice); + on_device_state_->histogram_logger = std::move(logger); + + if (optimization_guide_logger_->ShouldEnableDebugLogs()) { + OPTIMIZATION_GUIDE_LOGGER( + optimization_guide_common::mojom::LogSource::MODEL_EXECUTION, + optimization_guide_logger_) + << "Executing model " + << (input->should_ignore_input_context + ? "" + : base::StringPrintf("with input context of %d tokens:\n", + on_device_state_->context_processor + ? on_device_state_->context_processor + ->tokens_processed() + : 0)) + << (!input->should_ignore_input_context && + on_device_state_->context_processor + ? (on_device_state_->context_processor->input() + "\n") + : "") + << "with string:\n" + << input->input_string; + } + on_device_state_->callback = std::move(callback); on_device_state_->start = base::TimeTicks::Now(); on_device_state_->timer_for_first_response.Start( - FROM_HERE, features::GetOnDeviceModelTimeForInitialResponse(), this, - &SessionImpl::FallbackToRemote); + FROM_HERE, features::GetOnDeviceModelTimeForInitialResponse(), + base::BindOnce(&SessionImpl::DestroyOnDeviceStateAndFallbackToRemote, + base::Unretained(this), ExecuteModelResult::kTimedOut)); GetOrCreateSession().Execute( on_device_model::mojom::InputOptions::New( input->input_string, features::GetOnDeviceModelMaxTokensForExecute(), @@ -207,6 +256,7 @@ } void SessionImpl::OnComplete(on_device_model::mojom::ResponseStatus status) { + on_device_state_->histogram_logger.reset(); // TODO(b/302395507): Handle a retracted response. base::UmaHistogramMediumTimes( base::StrCat( @@ -217,7 +267,7 @@ controller_->OnResponseCompleted({}, *this); } SendResponse(/*is_complete=*/true); - ResetResponse(); + on_device_state_->ResetRequestState(); } on_device_model::mojom::Session& SessionImpl::GetOrCreateSession() { @@ -232,26 +282,29 @@ } void SessionImpl::OnDisconnect() { + if (on_device_state_->did_execute_and_waiting_for_on_complete() && + features::GetOnDeviceFallbackToServerOnDisconnect()) { + DestroyOnDeviceStateAndFallbackToRemote( + ExecuteModelResult::kDisconnectAndFallbackToServer); + return; + } + if (context_) { // Persist the current context, so that ExecuteModel() can be called // without adding the same context. on_device_state_->add_context_before_execute = true; } on_device_state_->session.reset(); - CancelPendingResponse(); + CancelPendingResponse(ExecuteModelResult::kDisconnectAndCancel); } -void SessionImpl::ResetResponse() { - on_device_state_->receiver.reset(); - on_device_state_->callback.Reset(); - on_device_state_->current_response.clear(); - on_device_state_->start = base::TimeTicks(); - on_device_state_->timer_for_first_response.Stop(); -} - -void SessionImpl::CancelPendingResponse(ModelExecutionError error) { +void SessionImpl::CancelPendingResponse(ExecuteModelResult result, + ModelExecutionError error) { + if (on_device_state_->histogram_logger) { + on_device_state_->histogram_logger->set_result(result); + } auto callback = std::move(on_device_state_->callback); - ResetResponse(); + on_device_state_->ResetRequestState(); if (callback) { callback.Run( base::unexpected( @@ -270,12 +323,17 @@ auto output = on_device_state_->config_interpreter->ConstructOutputMetadata( feature_, on_device_state_->current_response); if (!output) { - // TODO(b/313666843): add metrics. - CancelPendingResponse(ModelExecutionError::kGenericFailure); + if (on_device_state_->histogram_logger) { + on_device_state_->histogram_logger->set_result( + ExecuteModelResult::kFailedConstructingResponseMessage); + on_device_state_->histogram_logger.reset(); + } + CancelPendingResponse( + ExecuteModelResult::kFailedConstructingResponseMessage, + ModelExecutionError::kGenericFailure); return; } - // TODO(b/302327957): Add logging. on_device_state_->callback.Run( StreamingResponse{ .response = *output, @@ -289,8 +347,11 @@ on_device_state_; } -void SessionImpl::FallbackToRemote() { - // TODO(b/313666843): add metrics. +void SessionImpl::DestroyOnDeviceStateAndFallbackToRemote( + ExecuteModelResult result) { + if (on_device_state_->histogram_logger) { + on_device_state_->histogram_logger->set_result(result); + } auto callback = std::move(on_device_state_->callback); DestroyOnDeviceState(); execute_remote_fn_.Run(feature_, *last_message_, std::move(callback)); @@ -320,4 +381,21 @@ SessionImpl::OnDeviceState::~OnDeviceState() = default; +void SessionImpl::OnDeviceState::ResetRequestState() { + receiver.reset(); + callback.Reset(); + current_response.clear(); + start = base::TimeTicks(); + timer_for_first_response.Stop(); + histogram_logger.reset(); +} + +SessionImpl::ExecuteModelHistogramLogger::~ExecuteModelHistogramLogger() { + base::UmaHistogramEnumeration( + base::StrCat( + {"OptimizationGuide.ModelExecution.OnDeviceExecuteModelResult.", + GetStringNameForModelExecutionFeature(feature_)}), + result_); +} + } // namespace optimization_guide
diff --git a/components/optimization_guide/core/model_execution/session_impl.h b/components/optimization_guide/core/model_execution/session_impl.h index cbb70a8..9d5a533 100644 --- a/components/optimization_guide/core/model_execution/session_impl.h +++ b/components/optimization_guide/core/model_execution/session_impl.h
@@ -15,6 +15,8 @@ #include "mojo/public/cpp/bindings/remote.h" #include "services/on_device_model/public/mojom/on_device_model.mojom.h" +class OptimizationGuideLogger; + namespace optimization_guide { class OnDeviceModelExecutionConfigInterpreter; class OnDeviceModelServiceController; @@ -32,12 +34,48 @@ using StartSessionFn = base::RepeatingCallback<void( mojo::PendingReceiver<on_device_model::mojom::Session>)>; - SessionImpl( - StartSessionFn start_session_fn, - proto::ModelExecutionFeature feature, - const OnDeviceModelExecutionConfigInterpreter* config_interpreter, - base::WeakPtr<OnDeviceModelServiceController> controller, - ExecuteRemoteFn execute_remote_fn); + // Possible outcomes of AddContext(). Maps to histogram enum + // "OptimizationGuideOnDeviceAddContextResult". + // These values are persisted to logs. Entries should not be renumbered and + // numeric values should never be reused. + enum class AddContextResult { + kUsingServer = 0, + kUsingOnDevice = 1, + kFailedConstructingInput = 2, + kMaxValue = kFailedConstructingInput, + }; + + // Possible outcomes of ExecuteModel(). Maps to histogram enum + // "OptimizationGuideOnDeviceExecuteModelResult". + // These values are persisted to logs. Entries should not be renumbered and + // numeric values should never be reused. + enum class ExecuteModelResult { + // The server was used. + kUsedServer = 0, + // On-device was used, and it completed successfully. + kUsedOnDevice = 1, + // Failed constructing message, and used server. + kFailedConstructingMessage = 2, + // Got a response from on-device, but failed constructing the message. + kFailedConstructingResponseMessage = 3, + // Timed out and used server. + kTimedOut = 4, + // Received a disconnect while waiting for response and used server. + kDisconnectAndFallbackToServer = 5, + // Received a disconnect whiel waiting for response and cancelled. + kDisconnectAndCancel = 6, + // Response was cancelled because ExecuteModel() was called while waiting + // for response. + kCancelled = 7, + kMaxValue = kCancelled, + }; + + SessionImpl(StartSessionFn start_session_fn, + proto::ModelExecutionFeature feature, + const OnDeviceModelExecutionConfigInterpreter* config_interpreter, + base::WeakPtr<OnDeviceModelServiceController> controller, + ExecuteRemoteFn execute_remote_fn, + OptimizationGuideLogger* optimization_guide_logger); ~SessionImpl() override; // optimization_guide::OptimizationGuideModelExecutor::Session: @@ -57,12 +95,35 @@ private: class ContextProcessor; + // Used to log the result of ExecuteModel. + class ExecuteModelHistogramLogger { + public: + explicit ExecuteModelHistogramLogger(proto::ModelExecutionFeature feature) + : feature_(feature) {} + ~ExecuteModelHistogramLogger(); + + void set_result(ExecuteModelResult result) { result_ = result; } + + private: + const proto::ModelExecutionFeature feature_; + ExecuteModelResult result_ = ExecuteModelResult::kUsedServer; + }; + // Captures all state used for the on device model. struct OnDeviceState { OnDeviceState(StartSessionFn start_session_fn, on_device_model::mojom::StreamingResponder* session); ~OnDeviceState(); + // Returns true if ExecuteModel() was called and the complete response + // has not been received. + bool did_execute_and_waiting_for_on_complete() const { + return start != base::TimeTicks(); + } + + // Resets all state related to a request. + void ResetRequestState(); + mojo::Remote<on_device_model::mojom::Session> session; raw_ptr<const OnDeviceModelExecutionConfigInterpreter> config_interpreter; StartSessionFn start_session_fn; @@ -78,16 +139,19 @@ // Timer used to detect when no response has been received and fallback // to remote execution. base::OneShotTimer timer_for_first_response; + // Used to log the result of ExecuteModel(). + std::unique_ptr<ExecuteModelHistogramLogger> histogram_logger; }; + AddContextResult AddContextImpl( + const google::protobuf::MessageLite& request_metadata); + // Gets the active session or restarts a session if the session is reset. on_device_model::mojom::Session& GetOrCreateSession(); - // Resets response state. - void ResetResponse(); - // Cancels any pending response and resets response state. void CancelPendingResponse( + ExecuteModelResult result, OptimizationGuideModelExecutionError::ModelExecutionError error = OptimizationGuideModelExecutionError::ModelExecutionError:: kCancelled); @@ -98,7 +162,7 @@ // Sends `current_response_` to the client. void SendResponse(bool is_complete); - void FallbackToRemote(); + void DestroyOnDeviceStateAndFallbackToRemote(ExecuteModelResult result); void DestroyOnDeviceState(); @@ -119,6 +183,10 @@ // Has a value when using the on device model. std::optional<OnDeviceState> on_device_state_; + + // Logger is owned by the Optimization Guide Keyed Service, which should + // outlive this session. + raw_ptr<OptimizationGuideLogger> optimization_guide_logger_; }; } // namespace optimization_guide
diff --git a/components/optimization_guide/core/optimization_guide_features.cc b/components/optimization_guide/core/optimization_guide_features.cc index c884be3..f3458e6e 100644 --- a/components/optimization_guide/core/optimization_guide_features.cc +++ b/components/optimization_guide/core/optimization_guide_features.cc
@@ -982,5 +982,13 @@ return kOnDeviceModelTimeForInitialResponse.Get(); } +bool GetOnDeviceFallbackToServerOnDisconnect() { + static const base::FeatureParam<bool> + kOnDeviceModelFallbackToServerOnDisconnect{ + &features::kOptimizationGuideOnDeviceModel, + "on_device_fallback_to_server_on_disconnect", true}; + return kOnDeviceModelFallbackToServerOnDisconnect.Get(); +} + } // namespace features } // namespace optimization_guide
diff --git a/components/optimization_guide/core/optimization_guide_features.h b/components/optimization_guide/core/optimization_guide_features.h index be5e99ce6..7c3f114 100644 --- a/components/optimization_guide/core/optimization_guide_features.h +++ b/components/optimization_guide/core/optimization_guide_features.h
@@ -396,6 +396,10 @@ // from the on-device model before falling back to the server. base::TimeDelta GetOnDeviceModelTimeForInitialResponse(); +// Returns true if during execution a disconnect is received (which generally +// means a crash) the message should be sent to the server for processing. +bool GetOnDeviceFallbackToServerOnDisconnect(); + } // namespace features } // namespace optimization_guide
diff --git a/components/optimization_guide/internal b/components/optimization_guide/internal index a7c5748..83caffe 160000 --- a/components/optimization_guide/internal +++ b/components/optimization_guide/internal
@@ -1 +1 @@ -Subproject commit a7c5748d8b64f469eddd7b4beebc55267eda8f7e +Subproject commit 83caffe8cb8abb5143134df88373014063133602
diff --git a/components/page_image_service/image_service_handler.h b/components/page_image_service/image_service_handler.h index 4e887453..76182d7 100644 --- a/components/page_image_service/image_service_handler.h +++ b/components/page_image_service/image_service_handler.h
@@ -47,4 +47,4 @@ } // namespace page_image_service -#endif // CHROME_BROWSER_COMPONENTS_PAGE_IMAGE_SERVICE_IMAGE_SERVICE_HANDLER_H_ +#endif // COMPONENTS_PAGE_IMAGE_SERVICE_IMAGE_SERVICE_HANDLER_H_
diff --git a/components/password_manager/core/browser/BUILD.gn b/components/password_manager/core/browser/BUILD.gn index de92ed5d..b73e679 100644 --- a/components/password_manager/core/browser/BUILD.gn +++ b/components/password_manager/core/browser/BUILD.gn
@@ -184,7 +184,6 @@ "//components/autofill/core/common", "//components/device_reauth", "//components/favicon/core", - "//components/os_crypt/sync:os_crypt", "//components/password_manager/core/browser/features:password_features", "//components/password_manager/core/browser/form_parsing", "//components/password_manager/core/browser/generation",
diff --git a/components/password_manager/core/browser/affiliation/mock_affiliation_service.h b/components/password_manager/core/browser/affiliation/mock_affiliation_service.h index 61ca1c7..c299bb3 100644 --- a/components/password_manager/core/browser/affiliation/mock_affiliation_service.h +++ b/components/password_manager/core/browser/affiliation/mock_affiliation_service.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_SITE_AFFILIATION_MOCK_AFFILIATION_SERVICE_H_ -#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_SITE_AFFILIATION_MOCK_AFFILIATION_SERVICE_H_ +#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_MOCK_AFFILIATION_SERVICE_H_ +#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_MOCK_AFFILIATION_SERVICE_H_ #include "components/password_manager/core/browser/affiliation/affiliation_service.h" #include "components/password_manager/core/browser/affiliation/affiliation_utils.h" @@ -58,4 +58,4 @@ } // namespace password_manager -#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_SITE_AFFILIATION_MOCK_AFFILIATION_SERVICE_H_ +#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_MOCK_AFFILIATION_SERVICE_H_
diff --git a/components/password_manager/core/browser/credential_manager_impl_unittest.cc b/components/password_manager/core/browser/credential_manager_impl_unittest.cc index dfe63167..787151d2 100644 --- a/components/password_manager/core/browser/credential_manager_impl_unittest.cc +++ b/components/password_manager/core/browser/credential_manager_impl_unittest.cc
@@ -118,10 +118,6 @@ true); prefs_->registry()->RegisterBooleanPref(::prefs::kSafeBrowsingEnhanced, false); -#if BUILDFLAG(IS_MAC) - prefs_->registry()->RegisterIntegerPref( - password_manager::prefs::kRelaunchChromeBubbleDismissedCounter, 0); -#endif } MockPasswordManagerClient(const MockPasswordManagerClient&) = delete; MockPasswordManagerClient& operator=(const MockPasswordManagerClient&) =
diff --git a/components/password_manager/core/browser/features/password_features.cc b/components/password_manager/core/browser/features/password_features.cc index 9249f1fe..f6af60ec 100644 --- a/components/password_manager/core/browser/features/password_features.cc +++ b/components/password_manager/core/browser/features/password_features.cc
@@ -51,7 +51,7 @@ // affiliated website. BASE_FEATURE(kFillingAcrossAffiliatedWebsitesAndroid, "FillingAcrossAffiliatedWebsitesAndroid", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); // Enables reading credentials from SharedPreferences. BASE_FEATURE(kFetchGaiaHashOnSignIn, "FetchGaiaHashOnSignIn",
diff --git a/components/password_manager/core/browser/form_parsing/fuzzer/BUILD.gn b/components/password_manager/core/browser/form_parsing/fuzzer/BUILD.gn index 97311687..dfa1721 100644 --- a/components/password_manager/core/browser/form_parsing/fuzzer/BUILD.gn +++ b/components/password_manager/core/browser/form_parsing/fuzzer/BUILD.gn
@@ -11,8 +11,8 @@ static_library("fuzzer_support") { sources = [ - "form_data_producer.cc", - "form_data_producer.h", + "form_predictions_producer.cc", + "form_predictions_producer.h", ] deps = [ @@ -51,6 +51,7 @@ "//base", "//base:i18n", "//components/autofill/core/common", + "//components/autofill/core/common:fuzzer_support", "//components/password_manager/core/browser/form_parsing", ]
diff --git a/components/password_manager/core/browser/form_parsing/fuzzer/form_data_parser_fuzzer.cc b/components/password_manager/core/browser/form_parsing/fuzzer/form_data_parser_fuzzer.cc index e86969c..20a47f0 100644 --- a/components/password_manager/core/browser/form_parsing/fuzzer/form_data_parser_fuzzer.cc +++ b/components/password_manager/core/browser/form_parsing/fuzzer/form_data_parser_fuzzer.cc
@@ -11,8 +11,9 @@ #include "base/at_exit.h" #include "base/i18n/icu_util.h" +#include "components/autofill/core/common/form_data_fuzzed_producer.h" #include "components/password_manager/core/browser/form_parsing/form_data_parser.h" -#include "components/password_manager/core/browser/form_parsing/fuzzer/form_data_producer.h" +#include "components/password_manager/core/browser/form_parsing/fuzzer/form_predictions_producer.h" #include "components/password_manager/core/browser/password_form.h" namespace password_manager { @@ -32,13 +33,11 @@ : FormDataParser::Mode::kSaving; const bool use_predictions = data_provider.ConsumeBool(); - FormPredictions predictions; - autofill::FormData form_data = - GenerateFormData(data_provider, use_predictions ? &predictions : nullptr); + autofill::FormData form_data = autofill::GenerateFormData(data_provider); FormDataParser parser; if (use_predictions) - parser.set_predictions(predictions); + parser.set_predictions(GenerateFormPredictions(form_data, data_provider)); std::unique_ptr<PasswordForm> result = parser.Parse(form_data, mode, /*stored_usernames=*/{});
diff --git a/components/password_manager/core/browser/form_parsing/fuzzer/form_data_producer.cc b/components/password_manager/core/browser/form_parsing/fuzzer/form_data_producer.cc deleted file mode 100644 index d629e3b..0000000 --- a/components/password_manager/core/browser/form_parsing/fuzzer/form_data_producer.cc +++ /dev/null
@@ -1,152 +0,0 @@ -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/password_manager/core/browser/form_parsing/fuzzer/form_data_producer.h" - -#include <string> -#include <utility> - -#include <fuzzer/FuzzedDataProvider.h> - -#include "build/build_config.h" -#include "components/autofill/core/browser/field_types.h" -#include "components/autofill/core/common/form_field_data.h" -#include "components/autofill/core/common/signatures.h" -#include "components/autofill/core/common/unique_ids.h" -#include "components/password_manager/core/browser/form_parsing/password_field_prediction.h" -#include "url/gurl.h" -#include "url/origin.h" - -using autofill::FormData; -using autofill::FormFieldData; -using autofill::ServerFieldType; - -namespace password_manager { - -namespace { - -constexpr ServerFieldType kPasswordRelatedServerTypes[] = { - autofill::USERNAME, autofill::USERNAME_AND_EMAIL_ADDRESS, - autofill::PASSWORD, autofill::ACCOUNT_CREATION_PASSWORD, - autofill::NEW_PASSWORD, autofill::CONFIRMATION_PASSWORD, - autofill::NOT_PASSWORD}; - -void SetPredictionType(bool pick_meaningful_type, - FuzzedDataProvider& provider, - PasswordFieldPrediction& prediction) { - if (pick_meaningful_type) { - prediction.type = provider.PickValueInArray(kPasswordRelatedServerTypes); - } else { - // Set a random type, probably even invalid. - prediction.type = - static_cast<ServerFieldType>(provider.ConsumeIntegral<uint8_t>()); - } -} - -// A wrapper to get |std::u16string| from a |FuzzedDataProvider|. The result is -// arbitrary bytes, not necessarily valid UTF16. -std::u16string ConsumeU16String(FuzzedDataProvider& provider) { - // |FuzzedDataProvider| takes special steps to pick the length of the string - // to support evolution of the fuzzed input. Let's follow whatever it does. - const std::string s8 = provider.ConsumeRandomLengthString(); - return std::u16string( - reinterpret_cast<const std::u16string::value_type*>(s8.data()), - s8.size() / 2); -} - -} // namespace - -autofill::FormData GenerateFormData(FuzzedDataProvider& provider, - FormPredictions* predictions) { - FormData result; - - result.is_form_tag = provider.ConsumeBool(); - - // Determine how many fields this form will have. Pick a low value because - // after the fuzzer's seed is exhausted, all will be 0s anyway. - const size_t number_of_fields = - provider.ConsumeIntegralInRange<size_t>(0, 15); - result.fields.resize(number_of_fields); - - result.name = ConsumeU16String(provider); - result.action = GURL(provider.ConsumeRandomLengthString()); - result.url = GURL(provider.ConsumeRandomLengthString()); - result.main_frame_origin = - url::Origin::Create(GURL(provider.ConsumeRandomLengthString())); - - if (predictions) { - predictions->driver_id = provider.ConsumeIntegral<int>(); - predictions->form_signature = - autofill::FormSignature(provider.ConsumeIntegral<uint64_t>()); - } - - int first_field_with_same_value = -1; - for (size_t i = 0; i < number_of_fields; ++i) { - // Batch getting bits from the FuzzedDataProvider, because calling - // `ConsumeBool` throws out 7 bits and we need many Booleans for each - // iteration. - const auto packed_bools = provider.ConsumeIntegral<uint8_t>(); - // All instances with |same_value_field| true share the same value. - const bool same_value_field = packed_bools & 1; - // Empty values are interesting from the parsing perspective. Ensure that - // at least half of the cases ends up with an empty value. - const bool force_empty_value = packed_bools & (1 << 1); - result.fields[i].is_focusable = packed_bools & (1 << 2); - const bool generate_prediction = packed_bools & (1 << 3); - const bool pick_meaningful_type = packed_bools & (1 << 4); - const bool use_placeholder = packed_bools & (1 << 5); - - result.fields[i].form_control_type = - provider.ConsumeEnum<autofill::FormControlType>(); - result.fields[i].autocomplete_attribute = - provider.ConsumeRandomLengthString(); - result.fields[i].label = ConsumeU16String(provider); - result.fields[i].name = ConsumeU16String(provider); - result.fields[i].name_attribute = result.fields[i].name; - result.fields[i].id_attribute = ConsumeU16String(provider); - result.fields[i].unique_renderer_id = - autofill::FieldRendererId(provider.ConsumeIntegralInRange(-32, 31)); - if (predictions && generate_prediction) { - PasswordFieldPrediction field_prediction; - SetPredictionType(pick_meaningful_type, provider, field_prediction); - field_prediction.may_use_prefilled_placeholder = use_placeholder; - field_prediction.renderer_id = result.fields[i].unique_renderer_id; - predictions->fields.push_back(std::move(field_prediction)); - } - - if (same_value_field) { - if (first_field_with_same_value == -1) { - first_field_with_same_value = static_cast<int>(i); - } else { - result.fields[i].value = - result.fields[first_field_with_same_value].value; - } - } else if (!force_empty_value) { - result.fields[i].value = ConsumeU16String(provider); - } - } - - if (!predictions) { - return result; - } - - // Generate predictions for non-existing fields. - const size_t num_predictions = provider.ConsumeIntegralInRange(0, 15); - for (size_t i = 0; i < num_predictions; ++i) { - const auto packed_bools = provider.ConsumeIntegral<uint8_t>(); - const bool pick_meaningful_type = packed_bools & 1; - const bool use_placeholder = packed_bools & (1 << 2); - - PasswordFieldPrediction field_prediction; - SetPredictionType(pick_meaningful_type, provider, field_prediction); - field_prediction.may_use_prefilled_placeholder = use_placeholder; - field_prediction.renderer_id = - autofill::FieldRendererId(provider.ConsumeIntegralInRange(-32, 31)); - predictions->fields.push_back(std::move(field_prediction)); - } - - return result; -} - -} // namespace password_manager
diff --git a/components/password_manager/core/browser/form_parsing/fuzzer/form_predictions_producer.cc b/components/password_manager/core/browser/form_parsing/fuzzer/form_predictions_producer.cc new file mode 100644 index 0000000..5434396 --- /dev/null +++ b/components/password_manager/core/browser/form_parsing/fuzzer/form_predictions_producer.cc
@@ -0,0 +1,91 @@ +// Copyright 2018 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/password_manager/core/browser/form_parsing/fuzzer/form_predictions_producer.h" + +#include <string> +#include <utility> + +#include <fuzzer/FuzzedDataProvider.h> + +#include "build/build_config.h" +#include "components/autofill/core/browser/field_types.h" +#include "components/autofill/core/common/signatures.h" +#include "components/autofill/core/common/unique_ids.h" +#include "components/password_manager/core/browser/form_parsing/password_field_prediction.h" +#include "url/gurl.h" +#include "url/origin.h" + +using autofill::FormData; +using autofill::ServerFieldType; + +namespace password_manager { + +namespace { + +constexpr ServerFieldType kPasswordRelatedServerTypes[] = { + autofill::USERNAME, autofill::USERNAME_AND_EMAIL_ADDRESS, + autofill::PASSWORD, autofill::ACCOUNT_CREATION_PASSWORD, + autofill::NEW_PASSWORD, autofill::CONFIRMATION_PASSWORD, + autofill::NOT_PASSWORD}; + +void SetPredictionType(bool pick_meaningful_type, + FuzzedDataProvider& provider, + PasswordFieldPrediction& prediction) { + if (pick_meaningful_type) { + prediction.type = provider.PickValueInArray(kPasswordRelatedServerTypes); + } else { + // Set a random type, probably even invalid. + prediction.type = + static_cast<ServerFieldType>(provider.ConsumeIntegral<uint8_t>()); + } +} + +} // namespace + +FormPredictions GenerateFormPredictions(const FormData& form_data, + FuzzedDataProvider& provider) { + FormPredictions predictions; + + predictions.driver_id = provider.ConsumeIntegral<int>(); + predictions.form_signature = + autofill::FormSignature(provider.ConsumeIntegral<uint64_t>()); + + for (const auto& field : form_data.fields) { + // Batch getting bits from the FuzzedDataProvider, because calling + // `ConsumeBool` throws out 7 bits and we need multiple Booleans for each + // iteration. + const auto packed_bools = provider.ConsumeIntegral<uint8_t>(); + const bool generate_prediction = packed_bools & 1; + const bool pick_meaningful_type = packed_bools & (1 << 1); + const bool use_placeholder = packed_bools & (1 << 2); + + if (generate_prediction) { + PasswordFieldPrediction field_prediction; + SetPredictionType(pick_meaningful_type, provider, field_prediction); + field_prediction.may_use_prefilled_placeholder = use_placeholder; + field_prediction.renderer_id = field.unique_renderer_id; + predictions.fields.push_back(std::move(field_prediction)); + } + } + + // Generate predictions for non-existing fields. + const size_t num_predictions = provider.ConsumeIntegralInRange(0, 15); + for (size_t i = 0; i < num_predictions; ++i) { + const auto packed_bools = provider.ConsumeIntegral<uint8_t>(); + const bool pick_meaningful_type = packed_bools & 1; + const bool use_placeholder = packed_bools & (1 << 2); + + PasswordFieldPrediction field_prediction; + SetPredictionType(pick_meaningful_type, provider, field_prediction); + field_prediction.may_use_prefilled_placeholder = use_placeholder; + field_prediction.renderer_id = + autofill::FieldRendererId(provider.ConsumeIntegralInRange(-32, 31)); + predictions.fields.push_back(std::move(field_prediction)); + } + + return predictions; +} + +} // namespace password_manager
diff --git a/components/password_manager/core/browser/form_parsing/fuzzer/form_data_producer.h b/components/password_manager/core/browser/form_parsing/fuzzer/form_predictions_producer.h similarity index 64% rename from components/password_manager/core/browser/form_parsing/fuzzer/form_data_producer.h rename to components/password_manager/core/browser/form_parsing/fuzzer/form_predictions_producer.h index fcc52065..ab946add 100644 --- a/components/password_manager/core/browser/form_parsing/fuzzer/form_data_producer.h +++ b/components/password_manager/core/browser/form_parsing/fuzzer/form_predictions_producer.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FORM_PARSING_FUZZER_FORM_DATA_PRODUCER_H_ -#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FORM_PARSING_FUZZER_FORM_DATA_PRODUCER_H_ +#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FORM_PARSING_FUZZER_FORM_PREDICTIONS_PRODUCER_H_ +#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FORM_PARSING_FUZZER_FORM_PREDICTIONS_PRODUCER_H_ #include "components/autofill/core/common/form_data.h" @@ -13,11 +13,11 @@ struct FormPredictions; -// Generates a |FormData| and (optionally) |predictions| object based on values +// Generates a |FormPredictions| for the given form data, based on values // obtained via |provider|. See https://goo.gl/29t6VH for a detailed design. -autofill::FormData GenerateFormData(FuzzedDataProvider& provider, - FormPredictions* predictions); +FormPredictions GenerateFormPredictions(const autofill::FormData& form_data, + FuzzedDataProvider& provider); } // namespace password_manager -#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FORM_PARSING_FUZZER_FORM_DATA_PRODUCER_H_ +#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FORM_PARSING_FUZZER_FORM_PREDICTIONS_PRODUCER_H_
diff --git a/components/password_manager/core/browser/http_auth_manager_unittest.cc b/components/password_manager/core/browser/http_auth_manager_unittest.cc index 6e22a61..6f8cb88 100644 --- a/components/password_manager/core/browser/http_auth_manager_unittest.cc +++ b/components/password_manager/core/browser/http_auth_manager_unittest.cc
@@ -28,10 +28,6 @@ #include "components/password_manager/core/browser/password_store/password_store_consumer.h" #include "components/password_manager/core/browser/password_store/password_store_interface.h" #include "components/password_manager/core/browser/stub_password_manager_client.h" -#include "components/password_manager/core/common/password_manager_pref_names.h" -#include "components/prefs/pref_registry_simple.h" -#include "components/prefs/pref_service.h" -#include "components/prefs/testing_pref_service.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -69,7 +65,6 @@ (), (const, override)); MOCK_METHOD(void, PromptUserToSaveOrUpdatePasswordPtr, (), ()); - MOCK_METHOD(PrefService*, GetPrefs, (), (const, override)); // Workaround for std::unique_ptr<> lacking a copy constructor. bool PromptUserToSaveOrUpdatePassword( @@ -121,18 +116,12 @@ WithArg<1>(InvokeEmptyConsumerWithForms(account_store_.get()))); } -#if BUILDFLAG(IS_MAC) - pref_service_.registry()->RegisterIntegerPref( - password_manager::prefs::kRelaunchChromeBubbleDismissedCounter, 0); -#endif - ON_CALL(client_, GetProfilePasswordStore()) .WillByDefault(Return(store_.get())); ON_CALL(client_, GetAccountPasswordStore()) .WillByDefault(Return(account_store_.get())); EXPECT_CALL(*store_, GetSmartBubbleStatsStore) .WillRepeatedly(Return(&smart_bubble_stats_store_)); - ON_CALL(client_, GetPrefs()).WillByDefault(Return(&pref_service_)); httpauth_manager_ = std::make_unique<HttpAuthManagerImpl>(&client_); @@ -148,7 +137,6 @@ base::test::TaskEnvironment task_environment_; scoped_refptr<MockPasswordStoreInterface> store_; scoped_refptr<MockPasswordStoreInterface> account_store_; - TestingPrefServiceSimple pref_service_; testing::NiceMock<MockPasswordManagerClient> client_; testing::NiceMock<MockSmartBubbleStatsStore> smart_bubble_stats_store_; std::unique_ptr<HttpAuthManagerImpl> httpauth_manager_;
diff --git a/components/password_manager/core/browser/password_form_manager.cc b/components/password_manager/core/browser/password_form_manager.cc index 9101432..0629dc7a 100644 --- a/components/password_manager/core/browser/password_form_manager.cc +++ b/components/password_manager/core/browser/password_form_manager.cc
@@ -56,10 +56,6 @@ #include "components/webauthn/android/webauthn_cred_man_delegate.h" #endif // BUILDFLAG(IS_ANDROID) -#if BUILDFLAG(IS_MAC) -#include "components/os_crypt/sync/os_crypt.h" -#endif - using autofill::FieldDataManager; using autofill::FieldRendererId; using autofill::FormData; @@ -220,16 +216,6 @@ FormDataParser::UsernameDetectionMethod::kServerSidePrediction); } -#if BUILDFLAG(IS_MAC) -bool ShouldShowKeychainErrorBubble( - absl::optional<PasswordStoreBackendError> backend_error) { - if (!backend_error.has_value()) { - return false; - } - return backend_error.value().type == - PasswordStoreBackendErrorType::kKeychainError; -} -#endif } // namespace PasswordFormManager::PasswordFormManager( @@ -768,16 +754,6 @@ : password_manager::ErrorMessageFlowType::kFillFlow, error_type); } -#elif BUILDFLAG(IS_MAC) - if (ShouldShowKeychainErrorBubble( - form_fetcher_->GetProfileStoreBackendError())) { - client_->NotifyKeychainError(); - } else { - if (OSCrypt::IsEncryptionAvailable() && client_->GetPrefs()) { - client_->GetPrefs()->SetInteger( - password_manager::prefs::kRelaunchChromeBubbleDismissedCounter, 0); - } - } #endif if (IsCredentialAPISave()) {
diff --git a/components/password_manager/core/browser/password_form_manager_unittest.cc b/components/password_manager/core/browser/password_form_manager_unittest.cc index 0e5b391..ee9c863 100644 --- a/components/password_manager/core/browser/password_form_manager_unittest.cc +++ b/components/password_manager/core/browser/password_form_manager_unittest.cc
@@ -174,7 +174,6 @@ GetWebAuthnCredentialsDelegateForDriver, (PasswordManagerDriver*), (override)); - MOCK_METHOD(void, NotifyKeychainError, (), (override)); #if BUILDFLAG(IS_ANDROID) MOCK_METHOD(void, ShowPasswordManagerErrorMessage, @@ -337,10 +336,7 @@ pref_service_.registry()->RegisterBooleanPref( password_manager::prefs::kBiometricAuthenticationBeforeFilling, true); #endif -#if BUILDFLAG(IS_MAC) - pref_service_.registry()->RegisterIntegerPref( - password_manager::prefs::kRelaunchChromeBubbleDismissedCounter, 0); -#endif + form_manager_->set_wait_for_server_predictions_for_filling(true); GURL origin = GURL("https://accounts.google.com/a/ServiceLoginAuth"); @@ -4122,37 +4118,6 @@ } #endif -#if BUILDFLAG(IS_MAC) -TEST_P(PasswordFormManagerTest, ClientShouldShowKeychainErrorMessage) { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature( - password_manager::features::kRestartToGainAccessToKeychain); - - fetcher_->SetProfileStoreBackendError(PasswordStoreBackendError( - PasswordStoreBackendErrorType::kKeychainError, - PasswordStoreBackendErrorRecoveryType::kRecoverable)); - - EXPECT_CALL(client_, NotifyKeychainError); - fetcher_->NotifyFetchCompleted(); -} - -TEST_P(PasswordFormManagerTest, ClientShouldNotShowKeychainErrorMessage) { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature( - password_manager::features::kRestartToGainAccessToKeychain); - - fetcher_->SetProfileStoreBackendError(absl::nullopt); - - EXPECT_CALL(client_, NotifyKeychainError).Times(0); - fetcher_->NotifyFetchCompleted(); - - // If the bubble shouldn't be shown, the counter should be reset. - EXPECT_EQ(client_.GetPrefs()->GetInteger( - password_manager::prefs::kRelaunchChromeBubbleDismissedCounter), - 0); -} -#endif - INSTANTIATE_TEST_SUITE_P(All, PasswordFormManagerTest, testing::Values(false, true));
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc index aa88766..16bb0817 100644 --- a/components/password_manager/core/browser/password_manager.cc +++ b/components/password_manager/core/browser/password_manager.cc
@@ -489,6 +489,8 @@ } form_managers_.clear(); + // TODO(crbug/1470586): Decide on whether to keep or clean-up calls of + // `TryToFindPredictionsToPossibleUsernames`. TryToFindPredictionsToPossibleUsernames(); predictions_.clear(); store_password_called_ = false; @@ -529,6 +531,8 @@ form_managers_.clear(); owned_submitted_form_manager_.reset(); visible_forms_data_.clear(); + // TODO(crbug/1470586): Decide on whether to keep or clean-up calls of + // `TryToFindPredictionsToPossibleUsernames`. TryToFindPredictionsToPossibleUsernames(); predictions_.clear(); } @@ -651,11 +655,21 @@ bool is_likely_otp) { // |driver| might be empty on iOS or in tests. int driver_id = driver ? driver->GetId() : 0; - possible_usernames_.Put( - PossibleUsernameFieldIdentifier(driver_id, renderer_id), - PossibleUsernameData(GetSignonRealm(driver->GetLastCommittedURL()), - renderer_id, value, base::Time::Now(), driver_id, - autocomplete_attribute_has_username, is_likely_otp)); + + // Add user modified text field as a username candidate outside of the + // password form. + auto it = possible_usernames_.Get({driver_id, renderer_id}); + if (it != possible_usernames_.end()) { + it->second.value = value; + it->second.last_change = base::Time::Now(); + } else { + possible_usernames_.Put( + PossibleUsernameFieldIdentifier(driver_id, renderer_id), + PossibleUsernameData(GetSignonRealm(driver->GetLastCommittedURL()), + renderer_id, value, base::Time::Now(), driver_id, + autocomplete_attribute_has_username, + is_likely_otp)); + } if (base::FeatureList::IsEnabled( password_manager::features::kForgotPasswordFormSupport)) { @@ -828,6 +842,8 @@ return nullptr; } + // TODO(crbug/1470586): Decide on whether to keep or clean-up calls of + // `TryToFindPredictionsToPossibleUsernames`. TryToFindPredictionsToPossibleUsernames(); if (!matched_manager->ProvisionallySave(submitted_form, driver, &possible_usernames_)) { @@ -1295,6 +1311,7 @@ if (FieldInfoManager* field_info_manager = client_->GetFieldInfoManager()) { field_info_manager->ProcessServerPredictions(predictions_); } + TryToFindPredictionsToPossibleUsernames(); // Create or update the `PasswordFormManager` corresponding to `form`. PasswordFormManager* manager =
diff --git a/components/password_manager/core/browser/password_manager_client.h b/components/password_manager/core/browser/password_manager_client.h index aa365c6..749494b 100644 --- a/components/password_manager/core/browser/password_manager_client.h +++ b/components/password_manager/core/browser/password_manager_client.h
@@ -252,9 +252,6 @@ virtual void NotifyOnSuccessfulLogin( const std::u16string& submitted_username) {} - // Informs that that Keychain is not available. - virtual void NotifyKeychainError() = 0; - // Informs that a credential filled by Touch To Fill can be submitted. // TODO(crbug.com/1299394): Remove when the TimeToSuccessfulLogin metric is // deprecated.
diff --git a/components/password_manager/core/browser/password_manager_settings_service.h b/components/password_manager/core/browser/password_manager_settings_service.h index a9995cc4..9b48154 100644 --- a/components/password_manager/core/browser/password_manager_settings_service.h +++ b/components/password_manager/core/browser/password_manager_settings_service.h
@@ -26,4 +26,4 @@ ~PasswordManagerSettingsService() override = default; }; -#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_SETTINGS_SERVICE_H_ +#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_SETTINGS_SERVICE_H_
diff --git a/components/password_manager/core/browser/password_manager_unittest.cc b/components/password_manager/core/browser/password_manager_unittest.cc index b8f69a9..7499a2b 100644 --- a/components/password_manager/core/browser/password_manager_unittest.cc +++ b/components/password_manager/core/browser/password_manager_unittest.cc
@@ -439,10 +439,6 @@ prefs_->registry()->RegisterBooleanPref( password_manager::prefs::kBiometricAuthenticationBeforeFilling, true); #endif -#if BUILDFLAG(IS_MAC) - prefs_->registry()->RegisterIntegerPref( - password_manager::prefs::kRelaunchChromeBubbleDismissedCounter, 0); -#endif ON_CALL(client_, GetPrefs()).WillByDefault(Return(prefs_.get())); field_info_manager_ = std::make_unique<FieldInfoManager>(task_runner_); @@ -4454,6 +4450,45 @@ ElementsAre(FormMatches(saved_form))))); } +// Tests that LRU cache entries storing username candidates outside of the +// password form are not cleared up after user keystroke. +TEST_F(PasswordManagerTest, UsernameFirstFlowKeepServerPredictions) { + EXPECT_CALL(client_, IsSavingAndFillingEnabled(test_form_url_)) + .WillRepeatedly(Return(true)); + + // Simulate the user typed in a username form. + PasswordForm username_form(MakeSimpleFormWithOnlyUsernameField()); + std::u16string username = u"newusername@gmail.com"; + EXPECT_CALL(driver_, GetLastCommittedURL) + .WillRepeatedly(ReturnRef(username_form.url)); + manager()->OnUserModifiedNonPasswordField( + &driver_, username_form.form_data.fields[0].unique_renderer_id, + /*value=*/username, + /*autocomplete_attribute_has_username=*/false, + /*is_likely_otp=*/false); + // Received server prediction. + manager()->ProcessAutofillPredictions( + &driver_, username_form.form_data, + CreateServerPredictions(username_form.form_data, + {{0, ServerFieldType::SINGLE_USERNAME}}, + /*is_override=*/false)); + + // User modifies the string further. + username = u"newusername+spam@gmail.com"; + manager()->OnUserModifiedNonPasswordField( + &driver_, username_form.form_data.fields[0].unique_renderer_id, + /*value=*/username, + /*autocomplete_attribute_has_username=*/false, + /*is_likely_otp=*/false); + + // Check that server predictions are written to the candidate and kept. + ASSERT_FALSE(manager()->possible_usernames().empty()); + EXPECT_TRUE(manager() + ->possible_usernames() + .begin() + ->second.HasSingleUsernameServerPrediction()); +} + // Tests that Password Manager's behavior on usernames outside of the password // form can be controlled by Finch config param. Modifies LRU cache's size that // stores possible single usernames by a finch param. Then, single username
diff --git a/components/password_manager/core/browser/password_store/BUILD.gn b/components/password_manager/core/browser/password_store/BUILD.gn index 536d463d..29de0a6 100644 --- a/components/password_manager/core/browser/password_store/BUILD.gn +++ b/components/password_manager/core/browser/password_store/BUILD.gn
@@ -115,6 +115,8 @@ "mock_password_store_interface.h", "mock_smart_bubble_stats_store.cc", "mock_smart_bubble_stats_store.h", + "password_store_results_observer.cc", + "password_store_results_observer.h", "test_password_store.cc", "test_password_store.h", ]
diff --git a/components/password_manager/core/browser/password_store/login_database_async_helper.cc b/components/password_manager/core/browser/password_store/login_database_async_helper.cc index 04c795b..0029a87 100644 --- a/components/password_manager/core/browser/password_store/login_database_async_helper.cc +++ b/components/password_manager/core/browser/password_store/login_database_async_helper.cc
@@ -133,20 +133,10 @@ std::vector<PasswordForm> results; for (const auto& form : forms) { std::vector<PasswordForm> matched_forms; - if (!login_db_ || - !login_db_->GetLogins(form, include_psl, &matched_forms)) { -#if BUILDFLAG(IS_MAC) - return PasswordStoreBackendError( - OSCrypt::IsEncryptionAvailable() - ? PasswordStoreBackendErrorType::kUncategorized - : PasswordStoreBackendErrorType::kKeychainError, - PasswordStoreBackendErrorRecoveryType::kUnrecoverable); -#else + if (!login_db_ || !login_db_->GetLogins(form, include_psl, &matched_forms)) return PasswordStoreBackendError( PasswordStoreBackendErrorType::kUncategorized, PasswordStoreBackendErrorRecoveryType::kUnrecoverable); -#endif - } results.insert(results.end(), std::make_move_iterator(matched_forms.begin()), std::make_move_iterator(matched_forms.end()));
diff --git a/components/password_manager/core/browser/password_store/password_store_backend_error.h b/components/password_manager/core/browser/password_store/password_store_backend_error.h index a9687667..677e534 100644 --- a/components/password_manager/core/browser/password_store/password_store_backend_error.h +++ b/components/password_manager/core/browser/password_store/password_store_backend_error.h
@@ -21,10 +21,7 @@ // passwords, for which no resolution intent has been received. Used on // Android. kAuthErrorUnresolvable = 2, - // A Keychain error that prevents the password store from decrypting the - // passwords. Used on Mac. - kKeychainError = 3, - kMaxValue = kKeychainError, + kMaxValue = kAuthErrorUnresolvable, }; enum class PasswordStoreBackendErrorRecoveryType {
diff --git a/components/password_manager/core/browser/password_store/password_store_built_in_backend.cc b/components/password_manager/core/browser/password_store/password_store_built_in_backend.cc index 42a9740..61175168 100644 --- a/components/password_manager/core/browser/password_store/password_store_built_in_backend.cc +++ b/components/password_manager/core/browser/password_store/password_store_built_in_backend.cc
@@ -158,6 +158,7 @@ forms, include_psl), ReportMetricsForResultCallback<LoginsResultOrError>( MetricInfix("FillMatchingLoginsAsync")) + .Then(base::BindOnce(&GetLoginsOrEmptyListOnFailure)) .Then(std::move(callback))); }
diff --git a/components/password_manager/core/browser/password_store/password_store_results_observer.cc b/components/password_manager/core/browser/password_store/password_store_results_observer.cc new file mode 100644 index 0000000..9d2d4f3 --- /dev/null +++ b/components/password_manager/core/browser/password_store/password_store_results_observer.cc
@@ -0,0 +1,33 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/password_manager/core/browser/password_store/password_store_results_observer.h" + +#include <utility> + +#include "components/password_manager/core/browser/password_form.h" + +namespace password_manager { + +PasswordStoreResultsObserver::PasswordStoreResultsObserver() = default; +PasswordStoreResultsObserver::~PasswordStoreResultsObserver() = default; + +void PasswordStoreResultsObserver::OnGetPasswordStoreResults( + std::vector<std::unique_ptr<password_manager::PasswordForm>> results) { + results_ = std::move(results); + run_loop_.Quit(); +} + +base::WeakPtr<password_manager::PasswordStoreConsumer> +PasswordStoreResultsObserver::GetWeakPtr() { + return weak_ptr_factory_.GetWeakPtr(); +} + +std::vector<std::unique_ptr<password_manager::PasswordForm>> +PasswordStoreResultsObserver::WaitForResults() { + run_loop_.Run(); + return std::move(results_); +} + +} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_store/password_store_results_observer.h b/components/password_manager/core/browser/password_store/password_store_results_observer.h new file mode 100644 index 0000000..8c3a6f2c --- /dev/null +++ b/components/password_manager/core/browser/password_store/password_store_results_observer.h
@@ -0,0 +1,47 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_PASSWORD_STORE_RESULTS_OBSERVER_H_ +#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_PASSWORD_STORE_RESULTS_OBSERVER_H_ + +#include <memory> +#include <vector> + +#include "base/memory/weak_ptr.h" +#include "base/run_loop.h" +#include "components/password_manager/core/browser/password_store/password_store_consumer.h" + +namespace password_manager { + +struct PasswordForm; + +// A helper class that synchronously waits until the password store handles a +// GetLogins() request. +class PasswordStoreResultsObserver : public PasswordStoreConsumer { + public: + PasswordStoreResultsObserver(); + + PasswordStoreResultsObserver(const PasswordStoreResultsObserver&) = delete; + PasswordStoreResultsObserver& operator=(const PasswordStoreResultsObserver&) = + delete; + + ~PasswordStoreResultsObserver() override; + + // Waits for OnGetPasswordStoreResults() and returns the result. + std::vector<std::unique_ptr<PasswordForm>> WaitForResults(); + + base::WeakPtr<PasswordStoreConsumer> GetWeakPtr(); + + private: + void OnGetPasswordStoreResults( + std::vector<std::unique_ptr<PasswordForm>> results) override; + + base::RunLoop run_loop_; + std::vector<std::unique_ptr<PasswordForm>> results_; + base::WeakPtrFactory<PasswordStoreResultsObserver> weak_ptr_factory_{this}; +}; + +} // namespace password_manager + +#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_PASSWORD_STORE_RESULTS_OBSERVER_H_
diff --git a/components/password_manager/core/browser/stub_password_manager_client.cc b/components/password_manager/core/browser/stub_password_manager_client.cc index 8548445..432d81dd 100644 --- a/components/password_manager/core/browser/stub_password_manager_client.cc +++ b/components/password_manager/core/browser/stub_password_manager_client.cc
@@ -60,8 +60,6 @@ void StubPasswordManagerClient::NotifyStorePasswordCalled() {} -void StubPasswordManagerClient::NotifyKeychainError() {} - void StubPasswordManagerClient::AutomaticPasswordSave( std::unique_ptr<PasswordFormManagerForUI> saved_manager, bool is_update_confirmation) {}
diff --git a/components/password_manager/core/browser/stub_password_manager_client.h b/components/password_manager/core/browser/stub_password_manager_client.h index d1d5dcce..3ccce8e 100644 --- a/components/password_manager/core/browser/stub_password_manager_client.h +++ b/components/password_manager/core/browser/stub_password_manager_client.h
@@ -55,7 +55,6 @@ void NotifySuccessfulLoginWithExistingPassword( std::unique_ptr<PasswordFormManagerForUI> submitted_manager) override; void NotifyStorePasswordCalled() override; - void NotifyKeychainError() override; void AutomaticPasswordSave( std::unique_ptr<PasswordFormManagerForUI> saved_manager, bool is_update_confirmation) override;
diff --git a/components/password_manager/core/browser/ui/passwords_grouper.h b/components/password_manager/core/browser/ui/passwords_grouper.h index bc62014..b77f91c 100644 --- a/components/password_manager/core/browser/ui/passwords_grouper.h +++ b/components/password_manager/core/browser/ui/passwords_grouper.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_UI_PASSWORD_GROUPING_UTIL_H_ -#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_UI_PASSWORD_GROUPING_UTIL_H_ +#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_UI_PASSWORDS_GROUPER_H_ +#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_UI_PASSWORDS_GROUPER_H_ #include "base/functional/callback_forward.h" #include "base/memory/weak_ptr.h" @@ -118,4 +118,4 @@ } // namespace password_manager -#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_UI_PASSWORD_GROUPING_UTIL_H_ +#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_UI_PASSWORDS_GROUPER_H_
diff --git a/components/password_manager/core/common/password_manager_features.cc b/components/password_manager/core/common/password_manager_features.cc index 45407bd..9012d4e 100644 --- a/components/password_manager/core/common/password_manager_features.cc +++ b/components/password_manager/core/common/password_manager_features.cc
@@ -33,12 +33,6 @@ base::FEATURE_DISABLED_BY_DEFAULT); #if BUILDFLAG(IS_IOS) -// Removes the list of passwords from the Settings UI and adds a separate -// Password Manager view. -BASE_FEATURE(kIOSPasswordUISplit, - "IOSPasswordUISplit", - base::FEATURE_ENABLED_BY_DEFAULT); - // Enables password bottom sheet to be displayed (on iOS) when a user is // signed-in and taps on a username or password field on a website that has at // least one credential saved in their password manager.
diff --git a/components/password_manager/core/common/password_manager_features.h b/components/password_manager/core/common/password_manager_features.h index 43e2e156..cdd5928 100644 --- a/components/password_manager/core/common/password_manager_features.h +++ b/components/password_manager/core/common/password_manager_features.h
@@ -24,7 +24,6 @@ #endif BASE_DECLARE_FEATURE(kForgotPasswordFormSupport); #if BUILDFLAG(IS_IOS) -BASE_DECLARE_FEATURE(kIOSPasswordUISplit); BASE_DECLARE_FEATURE(kIOSPasswordBottomSheet); BASE_DECLARE_FEATURE(kIOSPasswordSettingsBulkUploadLocalPasswords); #endif // IS_IOS
diff --git a/components/password_manager/core/common/password_manager_ui.h b/components/password_manager/core/common/password_manager_ui.h index 4c54fbf..c80e2cdd 100644 --- a/components/password_manager/core/common/password_manager_ui.h +++ b/components/password_manager/core/common/password_manager_ui.h
@@ -66,9 +66,6 @@ // current domain. GENERATED_PASSWORD_CONFIRMATION_STATE, - // Saved credentials cannot be filled because of a Keychain error. - KEYCHAIN_ERROR_STATE, - // For the current sign-in form, one of the stored credentials is shared by // another user. The user is notified about the existence of that credential // using a native bubble. The bubble keeps showing every time the user visits
diff --git a/components/password_manager/ios/BUILD.gn b/components/password_manager/ios/BUILD.gn index 6ad4b42..b2eea54 100644 --- a/components/password_manager/ios/BUILD.gn +++ b/components/password_manager/ios/BUILD.gn
@@ -123,7 +123,9 @@ "ios_password_manager_driver_factory_unittest.mm", "ios_password_manager_driver_unittest.mm", "password_controller_driver_helper_unittest.mm", + "password_form_helper_unittest.mm", "password_suggestion_helper_unittest.mm", + "shared_password_controller_unittest.mm", ] deps = [ ":account_select_fill_data", @@ -154,17 +156,6 @@ "//testing/gtest", "//third_party/ocmock", ] - - # TODO(crbug.com/1427365): Test currently fails on iOS blink. - if (!use_blink) { - sources += [ - "password_form_helper_unittest.mm", - - # TODO(crbug.com/1481427): SharedPasswordControllerTest fails on iOS - # blink. - "shared_password_controller_unittest.mm", - ] - } } source_set("fake_bulk_leak_check_service") {
diff --git a/components/password_manager/ios/fake_bulk_leak_check_service.h b/components/password_manager/ios/fake_bulk_leak_check_service.h index e111890..5468746e 100644 --- a/components/password_manager/ios/fake_bulk_leak_check_service.h +++ b/components/password_manager/ios/fake_bulk_leak_check_service.h
@@ -52,4 +52,4 @@ } // namespace password_manager -#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FAKE_BULK_LEAK_CHECK_SERVICE_H_ +#endif // COMPONENTS_PASSWORD_MANAGER_IOS_FAKE_BULK_LEAK_CHECK_SERVICE_H_
diff --git a/components/payments/content/payment_request_state_unittest.cc b/components/payments/content/payment_request_state_unittest.cc index 0d56dfb..2cc3337 100644 --- a/components/payments/content/payment_request_state_unittest.cc +++ b/components/payments/content/payment_request_state_unittest.cc
@@ -13,6 +13,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/uuid.h" #include "components/autofill/core/browser/autofill_test_utils.h" +#include "components/autofill/core/browser/country_type.h" #include "components/autofill/core/browser/data_model/autofill_profile.h" #include "components/autofill/core/browser/test_personal_data_manager.h" #include "components/payments/content/payment_app_factory.h" @@ -473,7 +474,7 @@ // Select an address, nothing should happen until the normalization is // completed and the merchant has validated the address. - autofill::AutofillProfile profile; + autofill::AutofillProfile profile(AddressCountryCode("JP")); autofill::test::SetProfileInfo(&profile, "Jon", "V.", "Doe", "jon.doe@exampl.com", "Example Inc", "Roppongi", "6 Chrome-10-1", "Tokyo", "",
diff --git a/components/payments/core/payments_profile_comparator_unittest.cc b/components/payments/core/payments_profile_comparator_unittest.cc index 90cbc3a..643dff8 100644 --- a/components/payments/core/payments_profile_comparator_unittest.cc +++ b/components/payments/core/payments_profile_comparator_unittest.cc
@@ -51,7 +51,8 @@ AutofillProfile CreateProfileWithContactInfo(const char* name, const char* email, const char* phone) { - AutofillProfile profile; + AutofillProfile profile( + autofill::i18n_model_definition::kLegacyHierarchyCountryCode); autofill::test::SetProfileInfo(&profile, name, "", "", email, "", "", "", "", "", "", "", phone); return profile; @@ -59,7 +60,8 @@ AutofillProfile CreateProfileWithCompleteAddress(const char* name, const char* phone) { - AutofillProfile profile; + AutofillProfile profile( + autofill::i18n_model_definition::kLegacyHierarchyCountryCode); autofill::test::SetProfileInfo(&profile, name, "", "", "", "", "123 Fake St.", "", "Fakesville", "MN", "54000", "US", phone); return profile; @@ -67,7 +69,8 @@ AutofillProfile CreateProfileWithPartialAddress(const char* name, const char* phone) { - AutofillProfile profile; + AutofillProfile profile( + autofill::i18n_model_definition::kLegacyHierarchyCountryCode); autofill::test::SetProfileInfo(&profile, name, "", "", "", "", "123 Fake St.", "", "", "", "54000", "", phone); return profile;
diff --git a/components/performance_manager/BUILD.gn b/components/performance_manager/BUILD.gn index 4591bdf6..e7b64c25 100644 --- a/components/performance_manager/BUILD.gn +++ b/components/performance_manager/BUILD.gn
@@ -209,8 +209,6 @@ "resource_attribution/worker_client_pages.cc", "resource_attribution/worker_client_pages.h", "resource_attribution/worker_context.cc", - "service_worker_client.cc", - "service_worker_client.h", "service_worker_context_adapter.cc", "service_worker_context_adapter.h", "tab_helper_frame_node_source.cc",
diff --git a/components/performance_manager/features.cc b/components/performance_manager/features.cc index dddf913..848348b 100644 --- a/components/performance_manager/features.cc +++ b/components/performance_manager/features.cc
@@ -122,6 +122,32 @@ "PerformanceControlsSidePanel", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kPerformanceCPUIntervention, + "PerformanceCPUIntervention", + base::FEATURE_DISABLED_BY_DEFAULT); + +const base::FeatureParam<base::TimeDelta> kCPUTimeOverThreshold{ + &kPerformanceCPUIntervention, "cpu_time_over_threshold", base::Seconds(60)}; + +const base::FeatureParam<int> kCPUSystemPercentThreshold{ + &kPerformanceCPUIntervention, "cpu_system_percent_threshold", 90}; +const base::FeatureParam<int> kCPUChromePercentThreshold{ + &kPerformanceCPUIntervention, "cpu_chrome_percent_threshold", 20}; + +BASE_FEATURE(kPerformanceMemoryIntervention, + "PerformanceMemoryIntervention", + base::FEATURE_DISABLED_BY_DEFAULT); + +const base::FeatureParam<base::TimeDelta> kMemoryTimeOverThreshold{ + &kPerformanceMemoryIntervention, "memory_time_over_threshold", + base::Seconds(60)}; + +const base::FeatureParam<int> kMemoryFreePercentThreshold{ + &kPerformanceMemoryIntervention, "memory_free_percent_threshold", 10}; +const base::FeatureParam<int> kMemoryFreeBytesThreshold{ + &kPerformanceMemoryIntervention, "memory_free_bytes_threshold", + 1024 * 1024 * 1024}; + #if BUILDFLAG(IS_CHROMEOS_ASH) BASE_FEATURE(kAshUrgentDiscardingFromPerformanceManager, "AshUrgentDiscardingFromPerformanceManager",
diff --git a/components/performance_manager/public/features.h b/components/performance_manager/public/features.h index b90c945..ce99d57 100644 --- a/components/performance_manager/public/features.h +++ b/components/performance_manager/public/features.h
@@ -127,6 +127,30 @@ // configuring performance settings. BASE_DECLARE_FEATURE(kPerformanceControlsSidePanel); +// This enables the CPU performance interventions within the side panel. +BASE_DECLARE_FEATURE(kPerformanceCPUIntervention); + +// This represents the duration that CPU must be over the threshold before +// an intervention is triggered. +extern const base::FeatureParam<base::TimeDelta> kCPUTimeOverThreshold; + +// If Chrome CPU utilization and System CPU utilization are both over the +// specified percent thresholds then we will trigger an intervention. +extern const base::FeatureParam<int> kCPUSystemPercentThreshold; +extern const base::FeatureParam<int> kCPUChromePercentThreshold; + +// This enables the Memory performance interventions within the side panel. +BASE_DECLARE_FEATURE(kPerformanceMemoryIntervention); + +// This represents the duration that Memory must be over the threshold before +// an intervention is triggered. +extern const base::FeatureParam<base::TimeDelta> kMemoryTimeOverThreshold; + +// If available Memory percent and bytes are both under the specified thresholds +// then we will trigger an intervention. +extern const base::FeatureParam<int> kMemoryFreePercentThreshold; +extern const base::FeatureParam<int> kMemoryFreeBytesThreshold; + #endif BASE_DECLARE_FEATURE(kPMProcessPriorityPolicy);
diff --git a/components/performance_manager/service_worker_client.cc b/components/performance_manager/service_worker_client.cc deleted file mode 100644 index b30f153..0000000 --- a/components/performance_manager/service_worker_client.cc +++ /dev/null
@@ -1,59 +0,0 @@ -// Copyright 2020 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/performance_manager/service_worker_client.h" - -ServiceWorkerClient::ServiceWorkerClient( - content::GlobalRenderFrameHostId render_frame_host_id) - : type_(blink::mojom::ServiceWorkerClientType::kWindow), - render_frame_host_id_(render_frame_host_id) {} -ServiceWorkerClient::ServiceWorkerClient( - blink::DedicatedWorkerToken dedicated_worker_token) - : type_(blink::mojom::ServiceWorkerClientType::kDedicatedWorker), - worker_token_(dedicated_worker_token) {} -ServiceWorkerClient::ServiceWorkerClient( - blink::SharedWorkerToken shared_worker_token) - : type_(blink::mojom::ServiceWorkerClientType::kSharedWorker), - worker_token_(shared_worker_token) {} - -ServiceWorkerClient::ServiceWorkerClient(const ServiceWorkerClient& other) = - default; -ServiceWorkerClient& ServiceWorkerClient::operator=( - const ServiceWorkerClient& other) = default; - -ServiceWorkerClient::~ServiceWorkerClient() = default; - -content::GlobalRenderFrameHostId ServiceWorkerClient::GetRenderFrameHostId() - const { - DCHECK_EQ(type_, blink::mojom::ServiceWorkerClientType::kWindow); - return render_frame_host_id_; -} - -blink::DedicatedWorkerToken ServiceWorkerClient::GetDedicatedWorkerToken() - const { - DCHECK_EQ(type_, blink::mojom::ServiceWorkerClientType::kDedicatedWorker); - return worker_token_.GetAs<blink::DedicatedWorkerToken>(); -} - -blink::SharedWorkerToken ServiceWorkerClient::GetSharedWorkerToken() const { - DCHECK_EQ(type_, blink::mojom::ServiceWorkerClientType::kSharedWorker); - return worker_token_.GetAs<blink::SharedWorkerToken>(); -} - -bool ServiceWorkerClient::operator<(const ServiceWorkerClient& o) const { - if (type() == o.type()) { - switch (type()) { - case blink::mojom::ServiceWorkerClientType::kWindow: - return GetRenderFrameHostId() < o.GetRenderFrameHostId(); - case blink::mojom::ServiceWorkerClientType::kDedicatedWorker: - return GetDedicatedWorkerToken() < o.GetDedicatedWorkerToken(); - case blink::mojom::ServiceWorkerClientType::kSharedWorker: - return GetSharedWorkerToken() < o.GetSharedWorkerToken(); - case blink::mojom::ServiceWorkerClientType::kAll: - NOTREACHED(); - return false; - } - } - return type() < o.type(); -}
diff --git a/components/performance_manager/service_worker_client.h b/components/performance_manager/service_worker_client.h deleted file mode 100644 index 2f10c4c..0000000 --- a/components/performance_manager/service_worker_client.h +++ /dev/null
@@ -1,51 +0,0 @@ -// Copyright 2020 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_PERFORMANCE_MANAGER_SERVICE_WORKER_CLIENT_H_ -#define COMPONENTS_PERFORMANCE_MANAGER_SERVICE_WORKER_CLIENT_H_ - -#include "content/public/browser/global_routing_id.h" -#include "content/public/browser/service_worker_client_info.h" -#include "third_party/blink/public/common/tokens/tokens.h" -#include "third_party/blink/public/mojom/service_worker/service_worker_client.mojom.h" - -// Represents a client of a service worker node. -// -// This class is essentially a tagged union where only the field corresponding -// to the |type()| can be accessed. -class ServiceWorkerClient { - public: - explicit ServiceWorkerClient( - content::GlobalRenderFrameHostId render_frame_host_id); - explicit ServiceWorkerClient( - blink::DedicatedWorkerToken dedicated_worker_token); - explicit ServiceWorkerClient(blink::SharedWorkerToken shared_worker_token); - - ServiceWorkerClient(const ServiceWorkerClient& other); - ServiceWorkerClient& operator=(const ServiceWorkerClient& other); - - ~ServiceWorkerClient(); - - blink::mojom::ServiceWorkerClientType type() const { return type_; } - - content::GlobalRenderFrameHostId GetRenderFrameHostId() const; - blink::DedicatedWorkerToken GetDedicatedWorkerToken() const; - blink::SharedWorkerToken GetSharedWorkerToken() const; - - bool operator<(const ServiceWorkerClient& other) const; - - private: - // The client type. - blink::mojom::ServiceWorkerClientType type_; - - union { - // The frame tree node ID, if this is a window client. - content::GlobalRenderFrameHostId render_frame_host_id_; - - // The token of the client, if this is a worker client. - content::DedicatedOrSharedWorkerToken worker_token_; - }; -}; - -#endif // COMPONENTS_PERFORMANCE_MANAGER_SERVICE_WORKER_CLIENT_H_
diff --git a/components/performance_manager/service_worker_context_adapter.h b/components/performance_manager/service_worker_context_adapter.h index 6be8a84..666c6f9 100644 --- a/components/performance_manager/service_worker_context_adapter.h +++ b/components/performance_manager/service_worker_context_adapter.h
@@ -20,6 +20,10 @@ class StorageKey; } // namespace blink +namespace content { +class RenderProcessHost; +} + namespace performance_manager { // This class adapts an existing ServiceWorkerContext to ensure that the
diff --git a/components/performance_manager/worker_watcher.cc b/components/performance_manager/worker_watcher.cc index 7c6868e..43a302b6 100644 --- a/components/performance_manager/worker_watcher.cc +++ b/components/performance_manager/worker_watcher.cc
@@ -288,7 +288,7 @@ // If this is a service worker client, mark it as a missing client. if (IsServiceWorkerNode(worker)) { DCHECK(missing_service_worker_clients_[worker] - .insert(ServiceWorkerClient(dedicated_worker_token)) + .insert(dedicated_worker_token) .second); } } @@ -350,7 +350,7 @@ // If this is a service worker client, mark it as a missing client. if (IsServiceWorkerNode(worker)) { DCHECK(missing_service_worker_clients_[worker] - .insert(ServiceWorkerClient(shared_worker_token)) + .insert(shared_worker_token) .second); } } @@ -445,51 +445,47 @@ int64_t version_id, const std::string& client_uuid, const content::ServiceWorkerClientInfo& client_info) { - switch (client_info.type()) { - case blink::mojom::ServiceWorkerClientType::kWindow: { - // For window clients, it is necessary to wait until the navigation has - // committed to a RenderFrameHost. - bool inserted = client_frames_awaiting_commit_ - .insert(AwaitingKey(version_id, client_uuid)) - .second; - DCHECK(inserted); - break; - } - case blink::mojom::ServiceWorkerClientType::kDedicatedWorker: { - blink::DedicatedWorkerToken dedicated_worker_token = - client_info.GetDedicatedWorkerToken(); + absl::visit( + base::Overloaded( + [&, this](content::GlobalRenderFrameHostId render_frame_host_id) { + // For window clients, it is necessary to wait until the navigation + // has committed to a RenderFrameHost. + bool inserted = client_frames_awaiting_commit_ + .insert(AwaitingKey(version_id, client_uuid)) + .second; + DCHECK(inserted); + }, + [&, this](blink::DedicatedWorkerToken dedicated_worker_token) { + bool inserted = service_worker_clients_[version_id] + .emplace(client_uuid, dedicated_worker_token) + .second; + DCHECK(inserted); - bool inserted = service_worker_clients_[version_id] - .emplace(client_uuid, dedicated_worker_token) - .second; - DCHECK(inserted); + // If the service worker is already started, connect it to the + // client. + WorkerNodeImpl* service_worker_node = + GetServiceWorkerNode(version_id); + if (service_worker_node) { + ConnectDedicatedWorkerClient(service_worker_node, + dedicated_worker_token); + } + }, + [&, this](blink::SharedWorkerToken shared_worker_token) { + bool inserted = service_worker_clients_[version_id] + .emplace(client_uuid, shared_worker_token) + .second; + DCHECK(inserted); - // If the service worker is already started, connect it to the client. - WorkerNodeImpl* service_worker_node = GetServiceWorkerNode(version_id); - if (service_worker_node) - ConnectDedicatedWorkerClient(service_worker_node, - dedicated_worker_token); - break; - } - case blink::mojom::ServiceWorkerClientType::kSharedWorker: { - blink::SharedWorkerToken shared_worker_token = - client_info.GetSharedWorkerToken(); - - bool inserted = service_worker_clients_[version_id] - .emplace(client_uuid, shared_worker_token) - .second; - DCHECK(inserted); - - // If the service worker is already started, connect it to the client. - WorkerNodeImpl* service_worker_node = GetServiceWorkerNode(version_id); - if (service_worker_node) - ConnectSharedWorkerClient(service_worker_node, shared_worker_token); - break; - } - case blink::mojom::ServiceWorkerClientType::kAll: - NOTREACHED(); - break; - } + // If the service worker is already started, connect it to the + // client. + WorkerNodeImpl* service_worker_node = + GetServiceWorkerNode(version_id); + if (service_worker_node) { + ConnectSharedWorkerClient(service_worker_node, + shared_worker_token); + } + }), + client_info); } void WorkerWatcher::OnControlleeRemoved(int64_t version_id, @@ -511,12 +507,12 @@ auto it = service_worker_clients_.find(version_id); DCHECK(it != service_worker_clients_.end()); - base::flat_map<std::string /*client_uuid*/, ServiceWorkerClient>& clients = - it->second; + base::flat_map<std::string /*client_uuid*/, content::ServiceWorkerClientInfo>& + clients = it->second; auto it2 = clients.find(client_uuid); DCHECK(it2 != clients.end()); - const ServiceWorkerClient client = it2->second; + const content::ServiceWorkerClientInfo client = it2->second; clients.erase(it2); if (clients.empty()) @@ -527,21 +523,19 @@ if (!worker_node) return; - switch (client.type()) { - case blink::mojom::ServiceWorkerClientType::kWindow: - RemoveFrameClientConnection(worker_node, client.GetRenderFrameHostId()); - break; - case blink::mojom::ServiceWorkerClientType::kDedicatedWorker: - DisconnectDedicatedWorkerClient(worker_node, - client.GetDedicatedWorkerToken()); - break; - case blink::mojom::ServiceWorkerClientType::kSharedWorker: - DisconnectSharedWorkerClient(worker_node, client.GetSharedWorkerToken()); - break; - case blink::mojom::ServiceWorkerClientType::kAll: - NOTREACHED(); - break; - } + absl::visit( + base::Overloaded( + [&, this](content::GlobalRenderFrameHostId render_frame_host_id) { + RemoveFrameClientConnection(worker_node, render_frame_host_id); + }, + [&, this](blink::DedicatedWorkerToken dedicated_worker_token) { + DisconnectDedicatedWorkerClient(worker_node, + dedicated_worker_token); + }, + [&, this](blink::SharedWorkerToken shared_worker_token) { + DisconnectSharedWorkerClient(worker_node, shared_worker_token); + }), + client); } void WorkerWatcher::OnControlleeNavigationCommitted( @@ -684,10 +678,9 @@ if (!client_dedicated_worker_node) { #if DCHECK_IS_ON() if (IsServiceWorkerNode(worker_node)) { - bool inserted = - missing_service_worker_clients_[worker_node] - .insert(ServiceWorkerClient(client_dedicated_worker_token)) - .second; + bool inserted = missing_service_worker_clients_[worker_node] + .insert(client_dedicated_worker_token) + .second; DCHECK(inserted); } #endif @@ -715,8 +708,8 @@ if (IsServiceWorkerNode(worker_node)) { auto it = missing_service_worker_clients_.find(worker_node); DCHECK(it != missing_service_worker_clients_.end()); - DCHECK_EQ(1u, it->second.erase( - ServiceWorkerClient(client_dedicated_worker_token))); + DCHECK_EQ(1u, it->second.erase(content::ServiceWorkerClientInfo( + client_dedicated_worker_token))); if (it->second.empty()) { missing_service_worker_clients_.erase(it); } @@ -751,7 +744,7 @@ #if DCHECK_IS_ON() DCHECK(IsServiceWorkerNode(worker_node)); bool inserted = missing_service_worker_clients_[worker_node] - .insert(ServiceWorkerClient(client_shared_worker_token)) + .insert(client_shared_worker_token) .second; DCHECK(inserted); #endif @@ -784,8 +777,8 @@ DCHECK(IsServiceWorkerNode(worker_node)); auto it = missing_service_worker_clients_.find(worker_node); DCHECK(it != missing_service_worker_clients_.end()); - DCHECK_EQ( - 1u, it->second.erase(ServiceWorkerClient(client_shared_worker_token))); + DCHECK_EQ(1u, it->second.erase(content::ServiceWorkerClientInfo( + client_shared_worker_token))); if (it->second.empty()) missing_service_worker_clients_.erase(it); #endif @@ -816,25 +809,21 @@ return; for (const auto& kv : it->second) { - const ServiceWorkerClient& client = kv.second; - - switch (client.type()) { - case blink::mojom::ServiceWorkerClientType::kWindow: - AddFrameClientConnection(service_worker_node, - client.GetRenderFrameHostId()); - break; - case blink::mojom::ServiceWorkerClientType::kDedicatedWorker: - ConnectDedicatedWorkerClient(service_worker_node, - client.GetDedicatedWorkerToken()); - break; - case blink::mojom::ServiceWorkerClientType::kSharedWorker: - ConnectSharedWorkerClient(service_worker_node, - client.GetSharedWorkerToken()); - break; - case blink::mojom::ServiceWorkerClientType::kAll: - NOTREACHED(); - break; - } + absl::visit( + base::Overloaded( + [&, this](content::GlobalRenderFrameHostId render_frame_host_id) { + AddFrameClientConnection(service_worker_node, + render_frame_host_id); + }, + [&, this](blink::DedicatedWorkerToken dedicated_worker_token) { + ConnectDedicatedWorkerClient(service_worker_node, + dedicated_worker_token); + }, + [&, this](blink::SharedWorkerToken shared_worker_token) { + ConnectSharedWorkerClient(service_worker_node, + shared_worker_token); + }), + kv.second); } } @@ -847,25 +836,23 @@ return; for (const auto& kv : it->second) { - const ServiceWorkerClient& client = kv.second; - - switch (client.type()) { - case blink::mojom::ServiceWorkerClientType::kWindow: - RemoveFrameClientConnection(service_worker_node, - client.GetRenderFrameHostId()); - break; - case blink::mojom::ServiceWorkerClientType::kDedicatedWorker: - DisconnectDedicatedWorkerClient(service_worker_node, - client.GetDedicatedWorkerToken()); - break; - case blink::mojom::ServiceWorkerClientType::kSharedWorker: - DisconnectSharedWorkerClient(service_worker_node, - client.GetSharedWorkerToken()); - break; - case blink::mojom::ServiceWorkerClientType::kAll: - NOTREACHED(); - break; - } + absl::visit( + base::Overloaded( + [&, this]( + const content::GlobalRenderFrameHostId& render_frame_host_id) { + RemoveFrameClientConnection(service_worker_node, + render_frame_host_id); + }, + [&, + this](const blink::DedicatedWorkerToken& dedicated_worker_token) { + DisconnectDedicatedWorkerClient(service_worker_node, + dedicated_worker_token); + }, + [&, this](const blink::SharedWorkerToken& shared_worker_token) { + DisconnectSharedWorkerClient(service_worker_node, + shared_worker_token); + }), + kv.second); } }
diff --git a/components/performance_manager/worker_watcher.h b/components/performance_manager/worker_watcher.h index 4aebde1..5b6093a 100644 --- a/components/performance_manager/worker_watcher.h +++ b/components/performance_manager/worker_watcher.h
@@ -15,7 +15,6 @@ #include "base/memory/raw_ptr.h" #include "base/scoped_observation.h" #include "base/sequence_checker.h" -#include "components/performance_manager/service_worker_client.h" #include "content/public/browser/dedicated_worker_service.h" #include "content/public/browser/global_routing_id.h" #include "content/public/browser/service_worker_context.h" @@ -48,7 +47,7 @@ // Service workers are more complicated to handle. They also can have any number // of clients, but they aren't only frames. They could also be dedicated worker // and shared worker clients. These different types of clients are tracked using -// the ServiceWorkerClient class. Also, because of the important role the +// the ServiceWorkerClientInfo type. Also, because of the important role the // service worker plays with frame navigations, the service worker can be // created before its first client's navigation has committed to a // RenderFrameHost. So when a OnControlleeAdded() notification is received for @@ -254,9 +253,9 @@ base::flat_set<AwaitingKey> client_frames_awaiting_commit_; // Maps each service worker to its clients. - base::flat_map< - int64_t /*version_id*/, - base::flat_map<std::string /*client_uuid*/, ServiceWorkerClient>> + base::flat_map<int64_t /*version_id*/, + base::flat_map<std::string /*client_uuid*/, + content::ServiceWorkerClientInfo>> service_worker_clients_; // Maps each frame to the number of connections to each worker that this frame @@ -286,7 +285,8 @@ // Keeps track of shared and dedicated workers that were not present when // a service worker tried to add a client relationship for them. - base::flat_map<WorkerNodeImpl*, base::flat_set<ServiceWorkerClient>> + base::flat_map<WorkerNodeImpl*, + base::flat_set<content::ServiceWorkerClientInfo>> missing_service_worker_clients_; #endif // DCHECK_IS_ON() };
diff --git a/components/permissions/add_new_permission.md b/components/permissions/add_new_permission.md index 940071e..7bad23e 100644 --- a/components/permissions/add_new_permission.md +++ b/components/permissions/add_new_permission.md
@@ -97,9 +97,9 @@ 1. In [content_settings_types.h](https://source.chromium.org/chromium/chromium/src/+/main:components/content_settings/core/common/content_settings_types.h) update [ContentSettingsType](https://source.chromium.org/chromium/chromium/src/+/main:components/content_settings/core/common/content_settings_types.h;l=17;drc=0c2e6d2e27af976e1b28eebd7dacc7a0296bb1cc) -2. In [content_settings.cc](https://source.chromium.org/chromium/chromium/src/+/main:components/content_settings/core/common/content_settings.cc) +2. In [content_settings_uma_util.cc](https://source.chromium.org/chromium/chromium/src/+/main:components/content_settings/core/browser/content_settings_uma_util.cc) update -[kHistogramValue](https://source.chromium.org/chromium/chromium/src/+/main:components/content_settings/core/common/content_settings.cc;l=31;drc=0c2e6d2e27af976e1b28eebd7dacc7a0296bb1cc) +[kHistogramValue](https://source.chromium.org/chromium/chromium/src/+/main:components/content_settings/core/browser/content_settings_uma_util.cc;drc=c6239d599e27bb680984bd6e86e69321b3fe5a9d;l=16) 3. In [content_settings_registry.cc](https://source.chromium.org/chromium/chromium/src/+/main:components/content_settings/core/browser/content_settings_registry.cc) update method [ContentSettingsRegistry::Init()](https://source.chromium.org/chromium/chromium/src/+/main:components/content_settings/core/browser/content_settings_registry.cc;l=122;drc=0c2e6d2e27af976e1b28eebd7dacc7a0296bb1cc)
diff --git a/components/policy/test/data/pref_mapping/BatterySaverModeAvailability.json b/components/policy/test/data/pref_mapping/BatterySaverModeAvailability.json index 30a6116..557bc37 100644 --- a/components/policy/test/data/pref_mapping/BatterySaverModeAvailability.json +++ b/components/policy/test/data/pref_mapping/BatterySaverModeAvailability.json
@@ -41,5 +41,45 @@ } } ] + }, + { + "os": [ + "chromeos_ash" + ], + "policy_pref_mapping_tests": [ + { + "policies": { + "BatterySaverModeAvailability": 0 + }, + "prefs": { + "power.cros_battery_saver_active": { + "location": "local_state", + "value": false + } + } + }, + { + "policies": { + "BatterySaverModeAvailability": 1 + }, + "prefs": { + "power.cros_battery_saver_active": { + "location": "local_state", + "default_value": false + } + } + }, + { + "policies": { + "BatterySaverModeAvailability": 2 + }, + "prefs": { + "power.cros_battery_saver_active": { + "location": "local_state", + "default_value": false + } + } + } + ] } ]
diff --git a/components/privacy_sandbox/mock_privacy_sandbox_settings.h b/components/privacy_sandbox/mock_privacy_sandbox_settings.h index 60e5e2e..51ce8007 100644 --- a/components/privacy_sandbox/mock_privacy_sandbox_settings.h +++ b/components/privacy_sandbox/mock_privacy_sandbox_settings.h
@@ -127,4 +127,4 @@ } // namespace privacy_sandbox_test_util -#endif // COMPONENTS_PRIVACY_SANDBOX_PRIVACY_SANDBOX_TEST_UTIL_H_ +#endif // COMPONENTS_PRIVACY_SANDBOX_MOCK_PRIVACY_SANDBOX_SETTINGS_H_
diff --git a/components/reading_list/features/reading_list_switches.cc b/components/reading_list/features/reading_list_switches.cc index 172b3ea..07b402c 100644 --- a/components/reading_list/features/reading_list_switches.cc +++ b/components/reading_list/features/reading_list_switches.cc
@@ -19,8 +19,6 @@ bool IsReadingListAccountStorageUIEnabled() { return base::FeatureList::IsEnabled( - syncer::kReadingListEnableDualReadingListModel) && - base::FeatureList::IsEnabled( syncer::kReadingListEnableSyncTransportModeUponSignIn); }
diff --git a/components/reading_list/features/reading_list_switches.h b/components/reading_list/features/reading_list_switches.h index 0305c535..24835fb1 100644 --- a/components/reading_list/features/reading_list_switches.h +++ b/components/reading_list/features/reading_list_switches.h
@@ -20,8 +20,7 @@ BASE_DECLARE_FEATURE(kReadLaterBackendMigration); // Returns whether reading list storage related UI can be enabled, by testing -// `kReadingListEnableSyncTransportModeUponSignIn` and -// `kReadingListEnableDualReadingListModel`. +// `kReadingListEnableSyncTransportModeUponSignIn`. bool IsReadingListAccountStorageUIEnabled(); } // namespace reading_list::switches
diff --git a/components/remote_cocoa/app_shim/immersive_mode_tabbed_controller_cocoa.h b/components/remote_cocoa/app_shim/immersive_mode_tabbed_controller_cocoa.h index 1f0d988..b069a18 100644 --- a/components/remote_cocoa/app_shim/immersive_mode_tabbed_controller_cocoa.h +++ b/components/remote_cocoa/app_shim/immersive_mode_tabbed_controller_cocoa.h
@@ -59,4 +59,4 @@ } // namespace remote_cocoa -#endif // COMPONENTS_REMOTE_COCOA_APP_SHIM_IMMERSIVE_MODE_TABBED_CONTROLLER__COCOA_H_ +#endif // COMPONENTS_REMOTE_COCOA_APP_SHIM_IMMERSIVE_MODE_TABBED_CONTROLLER_COCOA_H_
diff --git a/components/reporting/metrics/manual_collector.h b/components/reporting/metrics/manual_collector.h index 66fff09..b05584d 100644 --- a/components/reporting/metrics/manual_collector.h +++ b/components/reporting/metrics/manual_collector.h
@@ -45,4 +45,4 @@ }; } // namespace reporting -#endif // COMPONENTS_REPORTING_METRICS_ONE_SHOT_COLLECTOR_H_ +#endif // COMPONENTS_REPORTING_METRICS_MANUAL_COLLECTOR_H_
diff --git a/components/safe_browsing/content/browser/base_ui_manager.cc b/components/safe_browsing/content/browser/base_ui_manager.cc index 3f6621e..22d92387 100644 --- a/components/safe_browsing/content/browser/base_ui_manager.cc +++ b/components/safe_browsing/content/browser/base_ui_manager.cc
@@ -277,6 +277,10 @@ // TODO(vakh): crbug/883462: The reports for SB_THREAT_TYPE_BILLING should // be disabled for M70 but enabled for a later release (M71?). CreateAndSendHitReport(resource); + if (base::FeatureList::IsEnabled( + safe_browsing::kCreateWarningShownClientSafeBrowsingReports)) { + CreateAndSendClientSafeBrowsingWarningShownReport(resource); + } } AddToAllowlistUrlSet(GetMainFrameAllowlistUrlForResource(resource),
diff --git a/components/safe_browsing/content/browser/browser_url_loader_throttle.cc b/components/safe_browsing/content/browser/browser_url_loader_throttle.cc index 8b46704..f4de424 100644 --- a/components/safe_browsing/content/browser/browser_url_loader_throttle.cc +++ b/components/safe_browsing/content/browser/browser_url_loader_throttle.cc
@@ -73,6 +73,53 @@ namespace safe_browsing { +BrowserURLLoaderThrottle::SkipCheckCheckerOnSB::SkipCheckCheckerOnSB( + UrlCheckerOnSB::GetDelegateCallback delegate_getter, + int frame_tree_node_id) + : delegate_getter_(std::move(delegate_getter)), + frame_tree_node_id_(frame_tree_node_id) {} + +BrowserURLLoaderThrottle::SkipCheckCheckerOnSB::~SkipCheckCheckerOnSB() = + default; + +void BrowserURLLoaderThrottle::SkipCheckCheckerOnSB::CheckOriginalUrl( + OnCompleteCheckCallback callback, + const GURL& url, + bool originated_from_service_worker) { + DCHECK_CURRENTLY_ON( + base::FeatureList::IsEnabled(safe_browsing::kSafeBrowsingOnUIThread) + ? content::BrowserThread::UI + : content::BrowserThread::IO); + scoped_refptr<UrlCheckerDelegate> url_checker_delegate = + std::move(delegate_getter_).Run(); + should_skip_checks_ = + !url_checker_delegate || + url_checker_delegate->ShouldSkipRequestCheck( + url, frame_tree_node_id_, + /*render_process_id=*/content::ChildProcessHost::kInvalidUniqueID, + /*render_frame_token=*/std::nullopt, originated_from_service_worker); + if (base::FeatureList::IsEnabled(safe_browsing::kSafeBrowsingOnUIThread)) { + std::move(callback).Run(should_skip_checks_); + } else { + content::GetUIThreadTaskRunner({})->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), should_skip_checks_)); + } +} + +void BrowserURLLoaderThrottle::SkipCheckCheckerOnSB::CheckRedirectUrl( + OnCompleteCheckCallback callback) { + DCHECK_CURRENTLY_ON( + base::FeatureList::IsEnabled(safe_browsing::kSafeBrowsingOnUIThread) + ? content::BrowserThread::UI + : content::BrowserThread::IO); + if (base::FeatureList::IsEnabled(safe_browsing::kSafeBrowsingOnUIThread)) { + std::move(callback).Run(should_skip_checks_); + } else { + content::GetUIThreadTaskRunner({})->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), should_skip_checks_)); + } +} + // static std::unique_ptr<BrowserURLLoaderThrottle> BrowserURLLoaderThrottle::Create( UrlCheckerOnSB::GetDelegateCallback delegate_getter, @@ -137,13 +184,10 @@ : kNoRealTimeURLLookupService; sync_sb_checker_ = std::make_unique<UrlCheckerOnSB>( - std::move(delegate_getter), frame_tree_node_id, web_contents_getter, + delegate_getter, frame_tree_node_id, web_contents_getter, /*complete_callback=*/ base::BindRepeating(&BrowserURLLoaderThrottle::OnCompleteSyncCheck, weak_factory_.GetWeakPtr()), - /*skip_checks_callback=*/ - base::BindRepeating(&BrowserURLLoaderThrottle::SkipChecks, - weak_factory_.GetWeakPtr()), /*slow_check_callback=*/ base::BindRepeating(&BrowserURLLoaderThrottle::NotifySyncSlowCheck, weak_factory_.GetWeakPtr()), @@ -152,6 +196,9 @@ url_lookup_service_metric_suffix_, url_lookup_service, hash_realtime_service, ping_manager, is_mechanism_experiment_allowed, hash_realtime_selection); + + skip_check_checker_ = std::make_unique<SkipCheckCheckerOnSB>( + std::move(delegate_getter), frame_tree_node_id); } BrowserURLLoaderThrottle::~BrowserURLLoaderThrottle() { @@ -197,19 +244,53 @@ pending_sync_checks_++; start_request_time_ = base::TimeTicks::Now(); is_start_request_called_ = true; + + if (base::FeatureList::IsEnabled(safe_browsing::kSafeBrowsingOnUIThread)) { + skip_check_checker_->CheckOriginalUrl( + base::BindOnce( + &BrowserURLLoaderThrottle::OnSkipCheckCompleteOnOriginalUrl, + weak_factory_.GetWeakPtr(), request->headers, request->load_flags, + request->destination, request->has_user_gesture, request->url, + request->method), + request->url, request->originated_from_service_worker); + } else { + content::GetIOThreadTaskRunner({})->PostTask( + FROM_HERE, + base::BindOnce( + &SkipCheckCheckerOnSB::CheckOriginalUrl, + skip_check_checker_->AsWeakPtr(), + base::BindOnce( + &BrowserURLLoaderThrottle::OnSkipCheckCompleteOnOriginalUrl, + weak_factory_.GetWeakPtr(), request->headers, + request->load_flags, request->destination, + request->has_user_gesture, request->url, request->method), + request->url, request->originated_from_service_worker)); + } +} + +void BrowserURLLoaderThrottle::OnSkipCheckCompleteOnOriginalUrl( + const net::HttpRequestHeaders& headers, + int load_flags, + network::mojom::RequestDestination request_destination, + bool has_user_gesture, + const GURL& url, + const std::string& method, + bool should_skip) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + if (should_skip) { + SkipChecks(); + return; + } + if (base::FeatureList::IsEnabled(kSafeBrowsingOnUIThread)) { - sync_sb_checker_->Start(request->headers, request->load_flags, - request->destination, request->has_user_gesture, - request->originated_from_service_worker, - request->url, request->method); + sync_sb_checker_->Start(headers, load_flags, request_destination, + has_user_gesture, url, method); } else { content::GetIOThreadTaskRunner({})->PostTask( FROM_HERE, base::BindOnce(&UrlCheckerOnSB::Start, sync_sb_checker_->AsWeakPtr(), - request->headers, request->load_flags, - request->destination, request->has_user_gesture, - request->originated_from_service_worker, request->url, - request->method)); + headers, load_flags, request_destination, + has_user_gesture, url, method)); } } @@ -235,14 +316,44 @@ } pending_sync_checks_++; - if (base::FeatureList::IsEnabled(kSafeBrowsingOnUIThread)) { - sync_sb_checker_->CheckUrl(redirect_info->new_url, - redirect_info->new_method); + + // The check to |skip_check_checker| cannot be skipped because + // WillRedirectRequest may be called while |skip_check_checker| is still in + // progress. + if (base::FeatureList::IsEnabled(safe_browsing::kSafeBrowsingOnUIThread)) { + skip_check_checker_->CheckRedirectUrl(base::BindOnce( + &BrowserURLLoaderThrottle::OnSkipCheckCompleteOnRedirectUrl, + weak_factory_.GetWeakPtr(), redirect_info->new_url, + redirect_info->new_method)); } else { content::GetIOThreadTaskRunner({})->PostTask( FROM_HERE, - base::BindOnce(&UrlCheckerOnSB::CheckUrl, sync_sb_checker_->AsWeakPtr(), - redirect_info->new_url, redirect_info->new_method)); + base::BindOnce( + &SkipCheckCheckerOnSB::CheckRedirectUrl, + skip_check_checker_->AsWeakPtr(), + base::BindOnce( + &BrowserURLLoaderThrottle::OnSkipCheckCompleteOnRedirectUrl, + weak_factory_.GetWeakPtr(), redirect_info->new_url, + redirect_info->new_method))); + } +} + +void BrowserURLLoaderThrottle::OnSkipCheckCompleteOnRedirectUrl( + const GURL& url, + const std::string& method, + bool should_skip) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + if (should_skip) { + SkipChecks(); + return; + } + + if (base::FeatureList::IsEnabled(kSafeBrowsingOnUIThread)) { + sync_sb_checker_->CheckUrl(url, method); + } else { + content::GetIOThreadTaskRunner({})->PostTask( + FROM_HERE, base::BindOnce(&UrlCheckerOnSB::CheckUrl, + sync_sb_checker_->AsWeakPtr(), url, method)); } } @@ -427,9 +538,12 @@ void BrowserURLLoaderThrottle::DeleteUrlCheckerOnSB() { if (base::FeatureList::IsEnabled(kSafeBrowsingOnUIThread)) { sync_sb_checker_.reset(); + skip_check_checker_.reset(); } else { content::GetIOThreadTaskRunner({})->DeleteSoon(FROM_HERE, std::move(sync_sb_checker_)); + content::GetIOThreadTaskRunner({})->DeleteSoon( + FROM_HERE, std::move(skip_check_checker_)); } }
diff --git a/components/safe_browsing/content/browser/browser_url_loader_throttle.h b/components/safe_browsing/content/browser/browser_url_loader_throttle.h index 3894002..5206902 100644 --- a/components/safe_browsing/content/browser/browser_url_loader_throttle.h +++ b/components/safe_browsing/content/browser/browser_url_loader_throttle.h
@@ -45,6 +45,29 @@ // the load if any URLs turn out to be bad. class BrowserURLLoaderThrottle : public blink::URLLoaderThrottle { public: + // Helper class to perform whether the check can be skipped on the SB thread. + class SkipCheckCheckerOnSB + : public base::SupportsWeakPtr< + BrowserURLLoaderThrottle::SkipCheckCheckerOnSB> { + public: + using OnCompleteCheckCallback = + base::OnceCallback<void(bool /* should_skip */)>; + + SkipCheckCheckerOnSB(UrlCheckerOnSB::GetDelegateCallback delegate_getter, + int frame_tree_node_id); + ~SkipCheckCheckerOnSB(); + + void CheckOriginalUrl(OnCompleteCheckCallback callback, + const GURL& url, + bool originated_from_service_worker); + void CheckRedirectUrl(OnCompleteCheckCallback callback); + + private: + UrlCheckerOnSB::GetDelegateCallback delegate_getter_; + int frame_tree_node_id_; + bool should_skip_checks_ = false; + }; + static std::unique_ptr<BrowserURLLoaderThrottle> Create( UrlCheckerOnSB::GetDelegateCallback delegate_getter, const base::RepeatingCallback<content::WebContents*()>& @@ -92,6 +115,18 @@ hash_realtime_utils::HashRealTimeSelection hash_realtime_selection, base::WeakPtr<AsyncCheckTracker> async_check_tracker); + void OnSkipCheckCompleteOnOriginalUrl( + const net::HttpRequestHeaders& headers, + int load_flags, + network::mojom::RequestDestination request_destination, + bool has_user_gesture, + const GURL& url, + const std::string& method, + bool should_skip); + void OnSkipCheckCompleteOnRedirectUrl(const GURL& url, + const std::string& method, + bool should_skip); + // |slow_check| indicates whether it reports the result of a slow check. // (Please see comments of UrlCheckerOnSB::OnCheckUrlResult() for what slow // check means). @@ -143,6 +178,9 @@ std::unique_ptr<UrlCheckerOnSB> sync_sb_checker_; + // Used to decide whether the check can be skipped on the SB thread. + std::unique_ptr<SkipCheckCheckerOnSB> skip_check_checker_; + // Metric suffix for the URL lookup service. std::string url_lookup_service_metric_suffix_;
diff --git a/components/safe_browsing/content/browser/browser_url_loader_throttle_unittest.cc b/components/safe_browsing/content/browser/browser_url_loader_throttle_unittest.cc index 6f8707c..2483128 100644 --- a/components/safe_browsing/content/browser/browser_url_loader_throttle_unittest.cc +++ b/components/safe_browsing/content/browser/browser_url_loader_throttle_unittest.cc
@@ -292,7 +292,7 @@ } void SetUpTest(bool url_real_time_lookup_enabled = false) { - auto url_checker_delegate_getter = base::BindOnce( + auto url_checker_delegate_getter = base::BindRepeating( [](SBBrowserUrlLoaderThrottleTest* test) { return test->GetUrlCheckerDelegate(); },
diff --git a/components/safe_browsing/content/browser/client_side_detection_feature_cache.h b/components/safe_browsing/content/browser/client_side_detection_feature_cache.h index 00f9ab4..b9eaeeff 100644 --- a/components/safe_browsing/content/browser/client_side_detection_feature_cache.h +++ b/components/safe_browsing/content/browser/client_side_detection_feature_cache.h
@@ -62,4 +62,4 @@ } // namespace safe_browsing -#endif // COMPONENTS_SAFE_BROWSING_CONTENT_BROWSER_CLIENT_SIDE_DETECTION_FEATURES_H_ +#endif // COMPONENTS_SAFE_BROWSING_CONTENT_BROWSER_CLIENT_SIDE_DETECTION_FEATURE_CACHE_H_
diff --git a/components/safe_browsing/content/browser/url_checker_on_sb.cc b/components/safe_browsing/content/browser/url_checker_on_sb.cc index 76e7133..6f9b1c4 100644 --- a/components/safe_browsing/content/browser/url_checker_on_sb.cc +++ b/components/safe_browsing/content/browser/url_checker_on_sb.cc
@@ -30,7 +30,6 @@ int frame_tree_node_id, base::RepeatingCallback<content::WebContents*()> web_contents_getter, OnCompleteCheckCallback complete_callback, - OnSkipChecksCallback skip_checks_callback, OnNotifySlowCheckCallback slow_check_callback, bool url_real_time_lookup_enabled, bool can_urt_check_subresource_url, @@ -46,7 +45,6 @@ frame_tree_node_id_(frame_tree_node_id), web_contents_getter_(web_contents_getter), complete_callback_(std::move(complete_callback)), - skip_checks_callback_(std::move(skip_checks_callback)), slow_check_callback_(std::move(slow_check_callback)), url_real_time_lookup_enabled_(url_real_time_lookup_enabled), can_urt_check_subresource_url_(can_urt_check_subresource_url), @@ -79,7 +77,6 @@ int load_flags, network::mojom::RequestDestination request_destination, bool has_user_gesture, - bool originated_from_service_worker, const GURL& url, const std::string& method) { DCHECK_CURRENTLY_ON( @@ -88,21 +85,6 @@ : content::BrowserThread::IO); scoped_refptr<UrlCheckerDelegate> url_checker_delegate = std::move(delegate_getter_).Run(); - skip_checks_ = - !url_checker_delegate || - url_checker_delegate->ShouldSkipRequestCheck( - url, frame_tree_node_id_, - /*render_process_id=*/content::ChildProcessHost::kInvalidUniqueID, - /*render_frame_token=*/std::nullopt, originated_from_service_worker); - if (skip_checks_) { - if (base::FeatureList::IsEnabled(safe_browsing::kSafeBrowsingOnUIThread)) { - skip_checks_callback_.Run(); - } else { - content::GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(skip_checks_callback_)); - } - return; - } if (is_mechanism_experiment_allowed_ && request_destination == network::mojom::RequestDestination::kDocument) { @@ -136,16 +118,6 @@ base::FeatureList::IsEnabled(safe_browsing::kSafeBrowsingOnUIThread) ? content::BrowserThread::UI : content::BrowserThread::IO); - if (skip_checks_) { - if (base::FeatureList::IsEnabled(safe_browsing::kSafeBrowsingOnUIThread)) { - skip_checks_callback_.Run(); - } else { - content::GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, base::BindOnce(skip_checks_callback_)); - } - return; - } - DCHECK(url_checker_); url_checker_->CheckUrl(url, method, base::BindOnce(&UrlCheckerOnSB::OnCheckUrlResult,
diff --git a/components/safe_browsing/content/browser/url_checker_on_sb.h b/components/safe_browsing/content/browser/url_checker_on_sb.h index 6270d37..559232a 100644 --- a/components/safe_browsing/content/browser/url_checker_on_sb.h +++ b/components/safe_browsing/content/browser/url_checker_on_sb.h
@@ -46,12 +46,10 @@ SafeBrowsingUrlCheckerImpl::PerformedCheck /* performed_check */, bool /* did_check_url_real_time_allowlist */)>; - using OnSkipChecksCallback = base::RepeatingCallback<void()>; - using OnNotifySlowCheckCallback = base::RepeatingCallback<void()>; using GetDelegateCallback = - base::OnceCallback<scoped_refptr<UrlCheckerDelegate>()>; + base::RepeatingCallback<scoped_refptr<UrlCheckerDelegate>()>; using NativeUrlCheckNotifier = base::OnceCallback<void( bool /* proceed */, @@ -64,7 +62,6 @@ int frame_tree_node_id, base::RepeatingCallback<content::WebContents*()> web_contents_getter, OnCompleteCheckCallback complete_callback, - OnSkipChecksCallback skip_checks_callback, OnNotifySlowCheckCallback slow_check_callback, bool url_real_time_lookup_enabled, bool can_urt_check_subresource_url, @@ -79,13 +76,11 @@ ~UrlCheckerOnSB(); - // Starts the initial safe browsing check. This check and future checks may - // be skipped after checking with the UrlCheckerDelegate. + // Starts the initial safe browsing check. void Start(const net::HttpRequestHeaders& headers, int load_flags, network::mojom::RequestDestination request_destination, bool has_user_gesture, - bool originated_from_service_worker, const GURL& url, const std::string& method); @@ -129,9 +124,7 @@ mechanism_experimenter_; base::RepeatingCallback<content::WebContents*()> web_contents_getter_; OnCompleteCheckCallback complete_callback_; - OnSkipChecksCallback skip_checks_callback_; OnNotifySlowCheckCallback slow_check_callback_; - bool skip_checks_ = false; bool url_real_time_lookup_enabled_ = false; bool can_urt_check_subresource_url_ = false; bool can_check_db_ = true;
diff --git a/components/safe_browsing/content/resources/download_file_types.asciipb b/components/safe_browsing/content/resources/download_file_types.asciipb index a0e9bdb..f8a806f 100644 --- a/components/safe_browsing/content/resources/download_file_types.asciipb +++ b/components/safe_browsing/content/resources/download_file_types.asciipb
@@ -8,7 +8,7 @@ ## ## Top level settings ## -version_id: 62 +version_id: 63 sampled_ping_probability: 0.01 max_archived_binaries_to_report: 10 default_file_type { @@ -1447,7 +1447,7 @@ file_types { extension: "pdf" uma_value: 14 - ping_setting: FULL_PING + ping_setting: SAMPLED_PING } file_types { extension: "pot"
diff --git a/components/safe_browsing/core/common/features.cc b/components/safe_browsing/core/common/features.cc index b4dc35a..3afc177 100644 --- a/components/safe_browsing/core/common/features.cc +++ b/components/safe_browsing/core/common/features.cc
@@ -49,6 +49,10 @@ "ClientSideDetectionTypeForceRequest", base::FEATURE_ENABLED_BY_DEFAULT); +BASE_FEATURE(kCreateWarningShownClientSafeBrowsingReports, + "CreateWarningShownClientSafeBrowsingReports", + base::FEATURE_DISABLED_BY_DEFAULT); + BASE_FEATURE(kDeepScanningEncryptedArchives, "SafeBrowsingDeepScanningEncryptedArchives", base::FEATURE_ENABLED_BY_DEFAULT); @@ -361,6 +365,7 @@ {&kClientSideDetectionKillswitch, true}, {&kClientSideDetectionModelIsFlatBuffer, true}, {&kClientSideDetectionTypeForceRequest, true}, + {&kCreateWarningShownClientSafeBrowsingReports, false}, {&kDelayedWarnings, true}, {&kDownloadBubble, true}, {&kDownloadTailoredWarnings, true},
diff --git a/components/safe_browsing/core/common/features.h b/components/safe_browsing/core/common/features.h index 015063d..63301fdc 100644 --- a/components/safe_browsing/core/common/features.h +++ b/components/safe_browsing/core/common/features.h
@@ -47,6 +47,9 @@ // the client_side_detection_type field BASE_DECLARE_FEATURE(kClientSideDetectionTypeForceRequest); +// Creates and sends CSBRRs when warnings are first shown to users. +BASE_DECLARE_FEATURE(kCreateWarningShownClientSafeBrowsingReports); + // Controls whether we prompt encrypted archive deep scans to provide a // password. BASE_DECLARE_FEATURE(kDeepScanningEncryptedArchives);
diff --git a/components/safe_browsing/core/common/safebrowsing_referral_methods.h b/components/safe_browsing/core/common/safebrowsing_referral_methods.h index e8e03507..d27bb2b 100644 --- a/components/safe_browsing/core/common/safebrowsing_referral_methods.h +++ b/components/safe_browsing/core/common/safebrowsing_referral_methods.h
@@ -19,4 +19,4 @@ } // namespace safe_browsing -#endif // COMPONENTS_SAFE_BROWSING_CORE_COMMON_SAFE_BROWSING_REFERRAL_METHODS_H_ +#endif // COMPONENTS_SAFE_BROWSING_CORE_COMMON_SAFEBROWSING_REFERRAL_METHODS_H_
diff --git a/components/saved_tab_groups/saved_tab_group_model.cc b/components/saved_tab_groups/saved_tab_group_model.cc index 84c7a2b..ce57072 100644 --- a/components/saved_tab_groups/saved_tab_group_model.cc +++ b/components/saved_tab_groups/saved_tab_group_model.cc
@@ -262,7 +262,13 @@ const base::Uuid tab_id = tab.saved_tab_guid(); absl::optional<int> group_index = GetIndexOf(group_id); - saved_tab_groups_[group_index.value()].AddTabFromSync(tab); + + if (saved_tab_groups_[group_index.value()].ContainsTab(tab_id)) { + // This can happen when an out of sync SavedTabGroup sends a tab update. + saved_tab_groups_[group_index.value()].ReplaceTabAt(tab_id, tab); + } else { + saved_tab_groups_[group_index.value()].AddTabFromSync(tab); + } for (auto& observer : observers_) { observer.SavedTabGroupUpdatedFromSync(group_id, tab_id);
diff --git a/components/saved_tab_groups/saved_tab_group_sync_bridge_unittest.cc b/components/saved_tab_groups/saved_tab_group_sync_bridge_unittest.cc index 3f9a33b..114deb3 100644 --- a/components/saved_tab_groups/saved_tab_group_sync_bridge_unittest.cc +++ b/components/saved_tab_groups/saved_tab_group_sync_bridge_unittest.cc
@@ -644,6 +644,40 @@ saved_tab_group_model_.UpdateVisualData(group_guid, &visual_data); } +// Verify duplicate tab added from sync is merged with the correct tab and not +// added again to the model. +TEST_F(SavedTabGroupSyncBridgeTest, AddTabFromSync) { + EXPECT_TRUE(saved_tab_group_model_.saved_tab_groups().empty()); + + SavedTabGroup group(u"Test Title", tab_groups::TabGroupColorId::kBlue, {}, + /*position=*/absl::nullopt); + SavedTabGroupTab tab_1(GURL("https://website.com"), u"Website Title", + group.saved_guid(), /*position=*/absl::nullopt); + SavedTabGroupTab tab_2(GURL("https://google.com"), u"Google", + group.saved_guid(), /*position=*/absl::nullopt); + SavedTabGroupTab tab_3(tab_2); + tab_3.SetPosition(0); + + group.AddTabLocally(tab_1).AddTabLocally(tab_2); + + base::Uuid group_guid = group.saved_guid(); + base::Uuid tab_1_guid = tab_1.saved_tab_guid(); + base::Uuid tab_2_guid = tab_2.saved_tab_guid(); + base::Uuid tab_3_guid = tab_3.saved_tab_guid(); + saved_tab_group_model_.Add(std::move(group)); + EXPECT_CALL(processor_, Put(tab_3_guid.AsLowercaseString(), _, _)).Times(0); + EXPECT_CALL(processor_, Put(tab_1_guid.AsLowercaseString(), _, _)).Times(0); + EXPECT_CALL(processor_, Put(tab_2_guid.AsLowercaseString(), _, _)).Times(0); + EXPECT_CALL(processor_, Put(group_guid.AsLowercaseString(), _, _)).Times(0); + + saved_tab_group_model_.AddTabToGroupFromSync(group_guid, tab_3); + + EXPECT_EQ(tab_2_guid, tab_3_guid); + EXPECT_EQ( + saved_tab_group_model_.Get(group_guid)->GetTab(tab_2_guid)->position(), + saved_tab_group_model_.Get(group_guid)->GetTab(tab_3_guid)->position()); +} + // Verify that locally added tabs call put on the processor. TEST_F(SavedTabGroupSyncBridgeTest, AddTabLocally) { EXPECT_TRUE(saved_tab_group_model_.saved_tab_groups().empty()); @@ -669,10 +703,6 @@ EXPECT_CALL(processor_, Put(tab_2_guid.AsLowercaseString(), _, _)).Times(0); EXPECT_CALL(processor_, Put(group_guid.AsLowercaseString(), _, _)).Times(0); - // TODO(dljames): Because `tab_3` was added to the middle of the group, only - // `tab_2` will have its position updated. Once tab ordering is implemented, - // only the affected tabs will need to be updated. In that case, the Put() - // call for tab_1 can be removed. saved_tab_group_model_.AddTabToGroupLocally(group_guid, tab_3); }
diff --git a/components/search_engine_choice_strings.grdp b/components/search_engine_choice_strings.grdp index ec5f47e..737f8f6 100644 --- a/components/search_engine_choice_strings.grdp +++ b/components/search_engine_choice_strings.grdp
@@ -72,11 +72,12 @@ Change </message> - <message name="IDS_SEARCH_ENGINE_FALLBACK_MARKETING_SNIPPET" translateable="false" desc="The fallback marketing snippet used when a search engine doesn't provide its own."> - Lorem ipsum dolor sit amet, consectetur adipiscing elit. + <message name="IDS_SEARCH_ENGINE_FALLBACK_MARKETING_SNIPPET" desc="This string describes what a search engine can do. The string is only shown if a search engine does not provide their own marketing snippet. The string is ambiguous and has a neutral, unopinionated tone."> + You can use <ph name="SEARCH_ENGINE_NAME">$1<ex>Google</ex></ph> to search the web. + </message> + + <message name="IDS_SEARCH_ENGINE_CHOICE_MORE_BUTTON" desc="Title of the button to scroll the choice screen when it is too small to show everything at once."> + More </message> </if> -<message name="IDS_SEARCH_ENGINE_CHOICE_MORE_BUTTON" desc="Title of the button to scroll the choice screen when it is too small to show everything at once."> - More -</message> </grit-part>
diff --git a/components/search_engine_choice_strings_grdp/IDS_SEARCH_ENGINE_FALLBACK_MARKETING_SNIPPET.png.sha1 b/components/search_engine_choice_strings_grdp/IDS_SEARCH_ENGINE_FALLBACK_MARKETING_SNIPPET.png.sha1 new file mode 100644 index 0000000..caedeabf --- /dev/null +++ b/components/search_engine_choice_strings_grdp/IDS_SEARCH_ENGINE_FALLBACK_MARKETING_SNIPPET.png.sha1
@@ -0,0 +1 @@ +2ded22eac728b3c34f99d48391e89d044fe72253 \ No newline at end of file
diff --git a/components/search_engine_descriptions_strings.grd b/components/search_engine_descriptions_strings.grd index 460ac2e..cbd29466 100644 --- a/components/search_engine_descriptions_strings.grd +++ b/components/search_engine_descriptions_strings.grd
@@ -113,14 +113,156 @@ <output filename="search_engine_descriptions_strings_en-XA.pak" type="data_package" lang="en-XA" /> </outputs> <translations> - <!-- The below files are generated using a script. Do not modify them manually. --> + <!-- The below files are generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify them manually. --> + <file path="strings/search_engine_descriptions_strings_af.xtb" lang="af" /> + <file path="strings/search_engine_descriptions_strings_am.xtb" lang="am" /> + <file path="strings/search_engine_descriptions_strings_ar.xtb" lang="ar" /> + <file path="strings/search_engine_descriptions_strings_as.xtb" lang="as" /> + <file path="strings/search_engine_descriptions_strings_az.xtb" lang="az" /> + <file path="strings/search_engine_descriptions_strings_be.xtb" lang="be" /> + <file path="strings/search_engine_descriptions_strings_bg.xtb" lang="bg" /> + <file path="strings/search_engine_descriptions_strings_bn.xtb" lang="bn" /> + <file path="strings/search_engine_descriptions_strings_bs.xtb" lang="bs" /> + <file path="strings/search_engine_descriptions_strings_ca.xtb" lang="ca" /> + <file path="strings/search_engine_descriptions_strings_cs.xtb" lang="cs" /> + <file path="strings/search_engine_descriptions_strings_da.xtb" lang="da" /> + <file path="strings/search_engine_descriptions_strings_de.xtb" lang="de" /> + <file path="strings/search_engine_descriptions_strings_de-AT.xtb" lang="de-AT" /> + <file path="strings/search_engine_descriptions_strings_el.xtb" lang="el" /> <file path="strings/search_engine_descriptions_strings_en-GB.xtb" lang="en-GB" /> + <file path="strings/search_engine_descriptions_strings_es.xtb" lang="es" /> + <file path="strings/search_engine_descriptions_strings_es-US.xtb" lang="es-US" /> + <file path="strings/search_engine_descriptions_strings_et.xtb" lang="et" /> + <file path="strings/search_engine_descriptions_strings_eu.xtb" lang="eu" /> + <file path="strings/search_engine_descriptions_strings_fa.xtb" lang="fa" /> + <file path="strings/search_engine_descriptions_strings_fi.xtb" lang="fi" /> + <file path="strings/search_engine_descriptions_strings_fil.xtb" lang="fil" /> + <file path="strings/search_engine_descriptions_strings_fr.xtb" lang="fr" /> + <file path="strings/search_engine_descriptions_strings_fr-CA.xtb" lang="fr-CA" /> + <file path="strings/search_engine_descriptions_strings_gl.xtb" lang="gl" /> + <file path="strings/search_engine_descriptions_strings_gsw.xtb" lang="gsw" /> + <file path="strings/search_engine_descriptions_strings_gu.xtb" lang="gu" /> + <file path="strings/search_engine_descriptions_strings_he.xtb" lang="he" /> + <file path="strings/search_engine_descriptions_strings_hi.xtb" lang="hi" /> + <file path="strings/search_engine_descriptions_strings_hr.xtb" lang="hr" /> + <file path="strings/search_engine_descriptions_strings_hu.xtb" lang="hu" /> + <file path="strings/search_engine_descriptions_strings_hy.xtb" lang="hy" /> + <file path="strings/search_engine_descriptions_strings_id.xtb" lang="id" /> + <file path="strings/search_engine_descriptions_strings_in.xtb" lang="in" /> + <file path="strings/search_engine_descriptions_strings_is.xtb" lang="is" /> + <file path="strings/search_engine_descriptions_strings_it.xtb" lang="it" /> + <file path="strings/search_engine_descriptions_strings_iw.xtb" lang="iw" /> + <file path="strings/search_engine_descriptions_strings_ja.xtb" lang="ja" /> + <file path="strings/search_engine_descriptions_strings_ka.xtb" lang="ka" /> + <file path="strings/search_engine_descriptions_strings_kk.xtb" lang="kk" /> + <file path="strings/search_engine_descriptions_strings_km.xtb" lang="km" /> + <file path="strings/search_engine_descriptions_strings_kn.xtb" lang="kn" /> + <file path="strings/search_engine_descriptions_strings_ko.xtb" lang="ko" /> + <file path="strings/search_engine_descriptions_strings_ky.xtb" lang="ky" /> + <file path="strings/search_engine_descriptions_strings_lo.xtb" lang="lo" /> + <file path="strings/search_engine_descriptions_strings_lt.xtb" lang="lt" /> + <file path="strings/search_engine_descriptions_strings_lv.xtb" lang="lv" /> + <file path="strings/search_engine_descriptions_strings_mk.xtb" lang="mk" /> + <file path="strings/search_engine_descriptions_strings_ml.xtb" lang="ml" /> + <file path="strings/search_engine_descriptions_strings_mn.xtb" lang="mn" /> + <file path="strings/search_engine_descriptions_strings_mr.xtb" lang="mr" /> + <file path="strings/search_engine_descriptions_strings_ms.xtb" lang="ms" /> + <file path="strings/search_engine_descriptions_strings_my.xtb" lang="my" /> + <file path="strings/search_engine_descriptions_strings_nb.xtb" lang="nb" /> + <file path="strings/search_engine_descriptions_strings_ne.xtb" lang="ne" /> + <file path="strings/search_engine_descriptions_strings_nl.xtb" lang="nl" /> + <file path="strings/search_engine_descriptions_strings_no.xtb" lang="no" /> + <file path="strings/search_engine_descriptions_strings_or.xtb" lang="or" /> + <file path="strings/search_engine_descriptions_strings_pa.xtb" lang="pa" /> + <file path="strings/search_engine_descriptions_strings_pl.xtb" lang="pl" /> + <file path="strings/search_engine_descriptions_strings_pt.xtb" lang="pt" /> + <file path="strings/search_engine_descriptions_strings_pt-BR.xtb" lang="pt-BR" /> + <file path="strings/search_engine_descriptions_strings_pt-PT.xtb" lang="pt-PT" /> + <file path="strings/search_engine_descriptions_strings_ro.xtb" lang="ro" /> + <file path="strings/search_engine_descriptions_strings_ru.xtb" lang="ru" /> + <file path="strings/search_engine_descriptions_strings_si.xtb" lang="si" /> + <file path="strings/search_engine_descriptions_strings_sk.xtb" lang="sk" /> + <file path="strings/search_engine_descriptions_strings_sl.xtb" lang="sl" /> + <file path="strings/search_engine_descriptions_strings_sq.xtb" lang="sq" /> + <file path="strings/search_engine_descriptions_strings_sr.xtb" lang="sr" /> + <file path="strings/search_engine_descriptions_strings_sv.xtb" lang="sv" /> + <file path="strings/search_engine_descriptions_strings_sw.xtb" lang="sw" /> + <file path="strings/search_engine_descriptions_strings_ta.xtb" lang="ta" /> + <file path="strings/search_engine_descriptions_strings_te.xtb" lang="te" /> + <file path="strings/search_engine_descriptions_strings_th.xtb" lang="th" /> + <file path="strings/search_engine_descriptions_strings_tr.xtb" lang="tr" /> + <file path="strings/search_engine_descriptions_strings_uk.xtb" lang="uk" /> + <file path="strings/search_engine_descriptions_strings_ur.xtb" lang="ur" /> + <file path="strings/search_engine_descriptions_strings_uz.xtb" lang="uz" /> + <file path="strings/search_engine_descriptions_strings_vi.xtb" lang="vi" /> + <file path="strings/search_engine_descriptions_strings_zh.xtb" lang="zh" /> + <file path="strings/search_engine_descriptions_strings_zh-CN.xtb" lang="zh-CN" /> + <file path="strings/search_engine_descriptions_strings_zh-HK.xtb" lang="zh-HK" /> + <file path="strings/search_engine_descriptions_strings_zh-TW.xtb" lang="zh-TW" /> + <file path="strings/search_engine_descriptions_strings_zu.xtb" lang="zu" /> </translations> <release seq="1"> <messages fallback_to_english="true"> - <!-- The below strings are generated using a script. Do not modify them manually. --> + <!-- The below strings are generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify them manually. --> + <message name="IDS_BING_SEARCH_DESCRIPTION" use_name_for_id="true"> + Fast, accurate, and private search from Microsoft + </message> + <message name="IDS_BRAVE_SEARCH_DESCRIPTION" use_name_for_id="true"> + Doesn’t track you, your searches, or clicks. Independent of Big Tech. + </message> + <message name="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION" use_name_for_id="true"> + We don't track you. Privacy, simplified. + </message> + <message name="IDS_ECOSIA_SEARCH_DESCRIPTION" use_name_for_id="true"> + Plant trees and protect your privacy as you search. + </message> <message name="IDS_GOOGLE_SEARCH_DESCRIPTION" use_name_for_id="true"> - Google US + Find what you need with the world's most used search engine. + </message> + <message name="IDS_INFOCOM_SEARCH_DESCRIPTION" use_name_for_id="true"> + Fast and easy search + </message> + <message name="IDS_KARMA_SEARCH_DESCRIPTION" use_name_for_id="true"> + Search and support biodiversity and animal welfare + </message> + <message name="IDS_LILO_SEARCH_DESCRIPTION" use_name_for_id="true"> + Search the web and do some good at the same time. + </message> + <message name="IDS_METAGER_SEARCH_DESCRIPTION" use_name_for_id="true"> + Search safely while having your privacy respected. + </message> + <message name="IDS_MOJEEK_SEARCH_DESCRIPTION" use_name_for_id="true"> + Independent, European, no-tracking search engine + </message> + <message name="IDS_NONA_SEARCH_DESCRIPTION" use_name_for_id="true"> + A search engine from Germany for Europe. + </message> + <message name="IDS_OCEANHERO_SEARCH_DESCRIPTION" use_name_for_id="true"> + Help to stop ocean plastic pollution together with OceanHero. + </message> + <message name="IDS_PANDA_SEARCH_DESCRIPTION" use_name_for_id="true"> + Search with Panda and support WWF projects and campaigns. + </message> + <message name="IDS_PRIVACYWALL_SEARCH_DESCRIPTION" use_name_for_id="true"> + A search engine that protects your privacy. + </message> + <message name="IDS_QUENDU_SEARCH_DESCRIPTION" use_name_for_id="true"> + A search engine for pragmatic minds + </message> + <message name="IDS_QWANT_SEARCH_DESCRIPTION" use_name_for_id="true"> + A European search engine that protects your privacy + </message> + <message name="IDS_SEZNAM_SEARCH_DESCRIPTION" use_name_for_id="true"> + Czech search engine. + </message> + <message name="IDS_YAHOO_SEARCH_DESCRIPTION" use_name_for_id="true"> + Discover more. Get answers fast. And explore more with Yahoo. + </message> + <message name="IDS_YANDEX_SEARCH_DESCRIPTION" use_name_for_id="true"> + Fast and secure search for sites, images and videos + </message> + <message name="IDS_YEP_SEARCH_DESCRIPTION" use_name_for_id="true"> + Web search engine that aims to share ad revenue with creators. </message> </messages> </release>
diff --git a/components/search_engines/generated_marketing_snippets.cc b/components/search_engines/generated_marketing_snippets.cc index 9e98fad..c08eb99 100644 --- a/components/search_engines/generated_marketing_snippets.cc +++ b/components/search_engines/generated_marketing_snippets.cc
@@ -9,12 +9,226 @@ #include "components/strings/grit/search_engine_descriptions_strings.h" namespace search_engines { -// This file will be generated. Don't modify it manually. +// This file is generated using +// tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify +// it manually. int GetMarketingSnippetResourceId(const std::u16string& engine_keyword) { if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::bing.keyword)) { + return IDS_BING_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::brave.keyword)) { + return IDS_BRAVE_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::duckduckgo.keyword)) { + return IDS_DUCKDUCKGO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::ecosia.keyword)) { + return IDS_ECOSIA_SEARCH_DESCRIPTION; + } + if (engine_keyword == base::WideToUTF16(TemplateURLPrepopulateData::google.keyword)) { return IDS_GOOGLE_SEARCH_DESCRIPTION; } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::info_com.keyword)) { + return IDS_INFOCOM_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::karma.keyword)) { + return IDS_KARMA_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::lilo.keyword)) { + return IDS_LILO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::metager_de.keyword)) { + return IDS_METAGER_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::mojeek.keyword)) { + return IDS_MOJEEK_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::nona.keyword)) { + return IDS_NONA_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::oceanhero.keyword)) { + return IDS_OCEANHERO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::panda.keyword)) { + return IDS_PANDA_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::privacywall.keyword)) { + return IDS_PRIVACYWALL_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::quendu.keyword)) { + return IDS_QUENDU_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::qwant.keyword)) { + return IDS_QWANT_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::seznam_cz.keyword)) { + return IDS_SEZNAM_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::seznam_sk.keyword)) { + return IDS_SEZNAM_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_ar.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_at.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_au.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_br.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_ca.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_ch.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_cl.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_co.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_de.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_dk.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_es.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_fi.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_fr.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_hk.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_id.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_in.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_jp.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_mx.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_my.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_nl.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_nz.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_pe.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_ph.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_se.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_sg.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_th.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_tr.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_tw.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yahoo_uk.keyword)) { + return IDS_YAHOO_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yandex_by.keyword)) { + return IDS_YANDEX_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yandex_com.keyword)) { + return IDS_YANDEX_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yandex_kz.keyword)) { + return IDS_YANDEX_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yandex_ru.keyword)) { + return IDS_YANDEX_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yandex_tr.keyword)) { + return IDS_YANDEX_SEARCH_DESCRIPTION; + } + if (engine_keyword == + base::WideToUTF16(TemplateURLPrepopulateData::yep.keyword)) { + return IDS_YEP_SEARCH_DESCRIPTION; + } return -1; } } // namespace search_engines
diff --git a/components/search_engines/search_engine_choice_utils.cc b/components/search_engines/search_engine_choice_utils.cc index 42b5090..14acc9c 100644 --- a/components/search_engines/search_engine_choice_utils.cc +++ b/components/search_engines/search_engine_choice_utils.cc
@@ -357,9 +357,12 @@ const TemplateURLData& template_url_data) { int snippet_resource_id = GetMarketingSnippetResourceId(template_url_data.keyword()); - return l10n_util::GetStringUTF16( - snippet_resource_id == -1 ? IDS_SEARCH_ENGINE_FALLBACK_MARKETING_SNIPPET - : snippet_resource_id); + + return snippet_resource_id == -1 + ? l10n_util::GetStringFUTF16( + IDS_SEARCH_ENGINE_FALLBACK_MARKETING_SNIPPET, + template_url_data.short_name()) + : l10n_util::GetStringUTF16(snippet_resource_id); } #endif
diff --git a/components/security_interstitials/core/https_only_mode_enforcelist.h b/components/security_interstitials/core/https_only_mode_enforcelist.h index 151deeb7..23f7be3 100644 --- a/components/security_interstitials/core/https_only_mode_enforcelist.h +++ b/components/security_interstitials/core/https_only_mode_enforcelist.h
@@ -93,4 +93,4 @@ } // namespace security_interstitials -#endif // COMPONENTS_SECURITY_INTERSTITIALS_CORE_HTTPS_ONLY_MODE_ALLOWLIST_H_ +#endif // COMPONENTS_SECURITY_INTERSTITIALS_CORE_HTTPS_ONLY_MODE_ENFORCELIST_H_
diff --git a/components/security_state/ios/BUILD.gn b/components/security_state/ios/BUILD.gn index bc3168b..27563c3 100644 --- a/components/security_state/ios/BUILD.gn +++ b/components/security_state/ios/BUILD.gn
@@ -31,9 +31,4 @@ "//ios/web/public/test", "//ios/web/public/test:test_fixture", ] - - # TODO(crbug.com/1427365): Test currently fails on iOS blink. - if (is_ios && use_blink) { - sources -= [ "security_state_utils_unittest.mm" ] - } }
diff --git a/components/segmentation_platform/internal/data_collection/training_data_collector.h b/components/segmentation_platform/internal/data_collection/training_data_collector.h index 17c2211..c893441a 100644 --- a/components/segmentation_platform/internal/data_collection/training_data_collector.h +++ b/components/segmentation_platform/internal/data_collection/training_data_collector.h
@@ -108,4 +108,4 @@ } // namespace segmentation_platform -#endif // COMPONENTS_SEGMENTATION_PLATFORM_INTERNAL_DATABASE_DATABASE_MAINTENANCE_IMPL_H_ +#endif // COMPONENTS_SEGMENTATION_PLATFORM_INTERNAL_DATA_COLLECTION_TRAINING_DATA_COLLECTOR_H_
diff --git a/components/segmentation_platform/internal/selection/selection_utils.h b/components/segmentation_platform/internal/selection/selection_utils.h index 261ea23..d75624d 100644 --- a/components/segmentation_platform/internal/selection/selection_utils.h +++ b/components/segmentation_platform/internal/selection/selection_utils.h
@@ -20,4 +20,4 @@ } // namespace selection_utils } // namespace segmentation_platform -#endif // COMPONENTS_SEGMENTATION_PLATFORM_INTERNAL_SELECTION_SELECTIONUTILS_H_ +#endif // COMPONENTS_SEGMENTATION_PLATFORM_INTERNAL_SELECTION_SELECTION_UTILS_H_
diff --git a/components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_database.cc b/components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_database.cc index 7f70294..74d98a1 100644 --- a/components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_database.cc +++ b/components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_database.cc
@@ -100,7 +100,6 @@ db()->Put(write_options, leveldb_env::MakeSlice(key), leveldb_env::MakeSlice(*value)); EvictAllIterators(); - last_modified_ = clock_->Now(); return s; } @@ -112,7 +111,6 @@ db()->Delete(write_options, leveldb_env::MakeSlice(key)); EvictAllIterators(); - last_modified_ = clock_->Now(); return s; } @@ -145,7 +143,6 @@ UMA_HISTOGRAM_TIMES("WebCore.IndexedDB.LevelDB.WriteTime", base::TimeTicks::Now() - begin_time); EvictAllIterators(); - last_modified_ = clock_->Now(); return s; }
diff --git a/components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_database.h b/components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_database.h index 5437819..8b7bafb 100644 --- a/components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_database.h +++ b/components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_database.h
@@ -17,7 +17,6 @@ #include "base/strings/string_piece.h" #include "base/task/sequenced_task_runner.h" #include "base/time/clock.h" -#include "base/time/time.h" #include "base/trace_event/memory_dump_provider.h" #include "components/services/storage/indexed_db/leveldb/leveldb_state.h" #include "third_party/leveldatabase/src/include/leveldb/options.h" @@ -91,7 +90,6 @@ leveldb::DB* db() { return level_db_state_->db(); } leveldb::Env* env() { return level_db_state_->in_memory_env(); } LevelDBScopes* scopes() { return scopes_.get(); } - base::Time LastModified() const { return last_modified_; } TransactionalLevelDBFactory* class_factory() const { return class_factory_; } @@ -136,7 +134,6 @@ scoped_refptr<LevelDBState> level_db_state_; std::unique_ptr<LevelDBScopes> scopes_; raw_ptr<TransactionalLevelDBFactory> class_factory_; - base::Time last_modified_; std::unique_ptr<base::Clock> clock_; // Contains all iterators created by this database directly through
diff --git a/components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_unittest.cc b/components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_unittest.cc index 66ce556..bb6565ad 100644 --- a/components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_unittest.cc +++ b/components/services/storage/indexed_db/transactional_leveldb/transactional_leveldb_unittest.cc
@@ -171,42 +171,5 @@ EXPECT_TRUE(status.ok()); } -TEST_F(TransactionalLevelDBDatabaseTest, LastModified) { - SetUpRealDatabase(); - const std::string key("key"); - const std::string value("value"); - std::string put_value; - auto test_clock = std::make_unique<base::SimpleTestClock>(); - base::SimpleTestClock* clock_ptr = test_clock.get(); - clock_ptr->Advance(base::Hours(2)); - - leveldb::Status status = OpenLevelDBDatabase(); - ASSERT_TRUE(status.ok()); - transactional_leveldb_database_->SetClockForTesting(std::move(test_clock)); - // Calling |Put| sets time modified. - put_value = value; - base::Time now_time = clock_ptr->Now(); - status = transactional_leveldb_database_->Put(key, &put_value); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(now_time, transactional_leveldb_database_->LastModified()); - - // Calling |Remove| sets time modified. - clock_ptr->Advance(base::Seconds(200)); - now_time = clock_ptr->Now(); - status = transactional_leveldb_database_->Remove(key); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(now_time, transactional_leveldb_database_->LastModified()); - - // Calling |Write| sets time modified - clock_ptr->Advance(base::Minutes(15)); - now_time = clock_ptr->Now(); - auto batch = LevelDBWriteBatch::Create(); - batch->Put(key, value); - batch->Remove(key); - status = transactional_leveldb_database_->Write(batch.get()); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(now_time, transactional_leveldb_database_->LastModified()); -} - } // namespace leveldb_unittest } // namespace content
diff --git a/components/services/storage/privileged/mojom/indexed_db_control.mojom b/components/services/storage/privileged/mojom/indexed_db_control.mojom index f66180df..a3977a1 100644 --- a/components/services/storage/privileged/mojom/indexed_db_control.mojom +++ b/components/services/storage/privileged/mojom/indexed_db_control.mojom
@@ -58,11 +58,6 @@ client_state_checker_remote, pending_receiver<blink.mojom.IDBFactory> receiver); - // Retrieves some basic usage information about the IndexedDB state. The - // returned array has one StorageUsageInfo per `storage_key` in the - // partition that has IndexedDB usage data. - GetUsage() => (array<StorageUsageInfo> info); - // Deletes all indexed db files (across all buckets) for the given // `storage_key`. DeleteForStorageKey(blink.mojom.StorageKey storage_key) => (bool success);
diff --git a/components/services/storage/privileged/mojom/indexed_db_control_test.mojom b/components/services/storage/privileged/mojom/indexed_db_control_test.mojom index 2d5adf77..2a62a0c 100644 --- a/components/services/storage/privileged/mojom/indexed_db_control_test.mojom +++ b/components/services/storage/privileged/mojom/indexed_db_control_test.mojom
@@ -79,6 +79,9 @@ CompactBackingStoreForTesting(storage.mojom.BucketLocator bucket_locator) => (); + // Gets the total usage in bytes across all buckets. + GetUsageForTesting() => (int64 total_usage); + // Overrides IndexedDB with a mock class factory that can inject failures // at specific points. For now, because this is static, there can only // be one of these bound at a single time.
diff --git a/components/sessions/core/session_service_commands.cc b/components/sessions/core/session_service_commands.cc index 9e97787..70781f59 100644 --- a/components/sessions/core/session_service_commands.cc +++ b/components/sessions/core/session_service_commands.cc
@@ -170,6 +170,13 @@ PERSISTED_SHOW_STATE_END = 8, }; +// TODO(crbug.com/1506068): Remove this around December 2024. This is part of a +// workaround added to support the transition from storing the last_active_time +// as TimeTicks to Time that was added in December 2023. This is the threshold +// at which we consider that if a tab is so far in the past, it must be a tab +// serialized with TimeTicks and not Time. +const base::TimeDelta kLastActiveWorkaroundThreshold = base::Days(366 * 15); + // Assert to ensure PersistedWindowShowState is updated if ui::WindowShowState // is changed. static_assert(ui::SHOW_STATE_END == @@ -791,8 +798,33 @@ } SessionTab* tab = GetTab(SessionID::FromSerializedValue(payload.tab_id), tabs); - tab->last_active_time = base::Time::FromDeltaSinceWindowsEpoch( + base::Time deserialized_time = base::Time::FromDeltaSinceWindowsEpoch( base::Microseconds(payload.last_active_time)); + + if (base::Time::Now() - deserialized_time > + kLastActiveWorkaroundThreshold) { + // TODO(crbug.com/1506068): Remove this once enough time has passed + // (added in December 2023, can be removed after ~1 year). This is a + // workaround put in place during the migration from base::TimeTicks + // internal representation to microseconds since Windows epoch. As the + // origin point may be vastely different, the values stored in the old + // format appear as really old when deserialized in the new format. So + // checking all value older than 15 years should be a good enough + // filter to catch them. If it is a value stored in the old format, it + // should be correctly decoded. + base::TimeTicks time_tick_value = + base::TimeTicks::FromInternalValue(payload.last_active_time); + base::TimeDelta delta_since_epoch = + time_tick_value - base::TimeTicks::UnixEpoch(); + base::Time corrected_time = + base::Time::UnixEpoch() + delta_since_epoch; + if (base::Time::Now() < corrected_time) { + // If the correction is giving a time in the future, set it to now. + corrected_time = base::Time::Now(); + } + deserialized_time = corrected_time; + } + tab->last_active_time = deserialized_time; break; }
diff --git a/components/signin/ios/browser/BUILD.gn b/components/signin/ios/browser/BUILD.gn index a94a686..b5d328d 100644 --- a/components/signin/ios/browser/BUILD.gn +++ b/components/signin/ios/browser/BUILD.gn
@@ -87,12 +87,4 @@ "//testing/gtest", "//third_party/ocmock", ] - - # TODO(crbug.com/1427365): Test currently fails on iOS blink. - if (is_ios && use_blink) { - sources -= [ - "account_consistency_service_unittest.mm", - "active_state_manager_impl_unittest.mm", - ] - } }
diff --git a/components/strings/search_engine_descriptions_strings_af.xtb b/components/strings/search_engine_descriptions_strings_af.xtb new file mode 100644 index 0000000..da5bc69 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_af.xtb
@@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="af"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Vinnige, akkurate en privaat soektog met Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Kry wat jy nodig het met die soekenjin wat die meeste ter wêreld gebruik word.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Vinnige en maklike soekenjin</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Onafhanklike, Europese, nie-opspoor-soekenjin</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_am.xtb b/components/strings/search_engine_descriptions_strings_am.xtb new file mode 100644 index 0000000..b7ce3e4f --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_am.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="am"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">ፈጣን፣ ትክክለኛ, እና ከማይክሮሶፍት የግል ፍለጋ</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">በዓለም በጣም ጥቅም ላይ በሚውለው የፍለጋ ፕሮግራም አማካኝነት የሚያስፈልገዎትን ነገር ያግኙ።</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">ኢንዲፔንደንት, የአውሮፓ, ምንም-የክትትል የፍለጋ ፕሮግራም</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_ar.xtb b/components/strings/search_engine_descriptions_strings_ar.xtb new file mode 100644 index 0000000..3e0e5a50 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_ar.xtb
@@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="ar"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">بحث سريع ودقيق وخاص من Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">اعثر على ما تحتاجه مع محرك البحث الأكثر استخدامًا في العالم.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">محرك بحث سريع وسهل</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">محرك بحث مستقل ، أوروبي ، بدون تتبع</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_as.xtb b/components/strings/search_engine_descriptions_strings_as.xtb new file mode 100644 index 0000000..f036421 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_as.xtb
@@ -0,0 +1,7 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="as"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft-ৰ পৰা দ্ৰুত, সঠিক আৰু গোপনীয় অনুসন্ধান</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">বিশ্বৰ সৰ্বাধিক ব্যৱহৃত সন্ধান ইঞ্জিনটোৰ জৰিয়তে আপোনাক যি লাগে সেয়া বিচাৰক।</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_az.xtb b/components/strings/search_engine_descriptions_strings_az.xtb new file mode 100644 index 0000000..238c328fac --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_az.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="az"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft-dan sürətli, dəqiq və məxfi axtarış</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Dünyada ən çox istifadə edilən axtarış sistemi ilə istədiklərinizi tapın.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Independent, Avropa, heç izleme search engine</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_be.xtb b/components/strings/search_engine_descriptions_strings_be.xtb new file mode 100644 index 0000000..bec1843 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_be.xtb
@@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="be"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Хуткі, дакладны і прыватны пошук ад Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Знаходзьце тое, што вас цікавіць, з дапамогай самай папулярнай пошукавай сістэмы ў свеце.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Хуткая і простая пошукавая сістэма</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Незалежны, еўрапейскі пошукавік без адсочвання</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_bg.xtb b/components/strings/search_engine_descriptions_strings_bg.xtb new file mode 100644 index 0000000..5a673489 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_bg.xtb
@@ -0,0 +1,14 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="bg"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Бързо, точно и поверително търсене от Microsoft</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Ние не те следим. Поверителност, опростена.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Намирайте това, което ви е необходимо, с помощта на най-използваната в света търсеща машина.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Бързо и лесно търсене</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Независима, европейска търсачка без проследяване</translation> + <translation id="IDS_OCEANHERO_SEARCH_DESCRIPTION">Помогнете за спиране на замърсяването на океана заедно с OceanHero.</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Търсачка, която защитава вашата поверителност.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Бързо и надеждно търсене на сайтове, изображения и видеоклипове</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Уеб търсачка, която има за цел споделя приходи от реклами с създателите.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_bn.xtb b/components/strings/search_engine_descriptions_strings_bn.xtb new file mode 100644 index 0000000..98a96eb --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_bn.xtb
@@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="bn"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft দ্বারা প্রদত্ত দ্রুত, সঠিক এবং ব্যক্তিগত সন্ধান</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">বিশ্বের সবথেকে বেশি ব্যবহৃত সার্চ ইঞ্জিনে আপনি যা চান, তাই খুঁজে দেখুন।</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">দ্রুত এবং সহজ অনুসন্ধান ইঞ্জিন</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">ইন্ডিপেন্ডেন্ট, ইউরোপীয়, নো-ট্র্যাকিং সার্চ ইঞ্জিন</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_bs.xtb b/components/strings/search_engine_descriptions_strings_bs.xtb new file mode 100644 index 0000000..044fd2b --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_bs.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="bs"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Brzo, tačno i privatno Microsoft pretraživanje</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Pronađite ono što vam treba s najviše korištenim pretraživačem u svijetu.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Nezavisnu evropsku, ne-praćenje search engine</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_ca.xtb b/components/strings/search_engine_descriptions_strings_ca.xtb new file mode 100644 index 0000000..96f7a8d --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_ca.xtb
@@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="ca"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Cerca ràpida, precisa i privada de Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Troba el que necessites amb el motor de cerca més utilitzat de tot el món.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Motor de cerca fàcil i ràpid</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Motor de cerca independent, europeu i sense rastreig</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_cs.xtb b/components/strings/search_engine_descriptions_strings_cs.xtb new file mode 100644 index 0000000..f412a7c --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_cs.xtb
@@ -0,0 +1,15 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="cs"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Rychlé, přesné a soukromé vyhledávání od Microsoftu</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Nesledujeme vás. Soukromí, zjednodušeno.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Najděte vše potřebné pomocí nejpoužívanějšího vyhledávače na světě.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Rychlé a snadné vyhledávání</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Nezávislý, evropské, ne-tracking vyhledávač</translation> + <translation id="IDS_OCEANHERO_SEARCH_DESCRIPTION">Pomozte spolu s OceanHero zastavit znečišťování oceánů plasty.</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Vyhledávací stroj, který chrání vaše soukromí.</translation> + <translation id="IDS_SEZNAM_SEARCH_DESCRIPTION">Český vyhledávač.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Rychlé a bezpečné vyhledávání stránek, obrázků a videí</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Webový vyhledávač s cílem sdílet příjmy z reklamy s tvůrci obsahu.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_da.xtb b/components/strings/search_engine_descriptions_strings_da.xtb new file mode 100644 index 0000000..52933d5 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_da.xtb
@@ -0,0 +1,14 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="da"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Hurtig, præcis og privat søgning fra Microsoft</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Vi sporer dig ikke. Privatliv, forenklet.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Find det, du leder efter, med verdens mest anvendte søgemaskine.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Hurtig og nem søgning</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Uafhængig, europæisk søgemaskine uden sporing</translation> + <translation id="IDS_OCEANHERO_SEARCH_DESCRIPTION">Hjælp med at stoppe plastikforurening af havet med OceanHero.</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">En søgemaskine der beskytter dit privatliv.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Hurtig og sikker søgning efter websteder, billeder og videoer</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Web-søgemaskine, der sigter mod at dele annonceindtægter med skabere.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_de-AT.xtb b/components/strings/search_engine_descriptions_strings_de-AT.xtb new file mode 100644 index 0000000..be2c200d --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_de-AT.xtb
@@ -0,0 +1,7 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="de-AT"> + <translation id="IDS_ECOSIA_SEARCH_DESCRIPTION">Mit Ecosia pflanzt du Bäume und schützt deine Daten.</translation> + <translation id="IDS_NONA_SEARCH_DESCRIPTION">Eine Suchmaschine aus Deutschland, bei der Du an erster Stelle stehst.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_de.xtb b/components/strings/search_engine_descriptions_strings_de.xtb new file mode 100644 index 0000000..4e9e223 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_de.xtb
@@ -0,0 +1,22 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="de"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Schnelle, genaue Suche von Microsoft mit integriertem Datenschutz</translation> + <translation id="IDS_BRAVE_SEARCH_DESCRIPTION">Überwacht keine Suchbegriffe oder Klicks. Unabhängig von Big Tech.</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Wir verfolgen dich nicht. Privatsphäre, einfach gemacht.</translation> + <translation id="IDS_ECOSIA_SEARCH_DESCRIPTION">Mit Ecosia pflanzt du Bäume und schützt deine Daten.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Mit der meistgenutzten Suchmaschine der Welt findest du alles, was du brauchst.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Schnelle und einfache Suche</translation> + <translation id="IDS_METAGER_SEARCH_DESCRIPTION">Sicher suchen und finden unter Wahrung der Privatsphäre.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Unabhängig, europäisch, no-Tracking-Suchmaschine</translation> + <translation id="IDS_NONA_SEARCH_DESCRIPTION">Eine Suchmaschine aus Deutschland, bei der Du an erster Stelle stehst.</translation> + <translation id="IDS_OCEANHERO_SEARCH_DESCRIPTION">Hilf gemeinsam mit OceanHero Plastikmüll im Meer zu stoppen.</translation> + <translation id="IDS_PANDA_SEARCH_DESCRIPTION">Suche mit Panda und unterstütze Projekte und Kampagnen des WWF.</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Eine Suchmaschine, die Ihre Privatsphäre schützt.</translation> + <translation id="IDS_QUENDU_SEARCH_DESCRIPTION">Eine Suchmaschine für pragmatische Menschen</translation> + <translation id="IDS_QWANT_SEARCH_DESCRIPTION">Eine europäische Suchmaschine, die Ihre Privatsphäre respektiert.</translation> + <translation id="IDS_YAHOO_SEARCH_DESCRIPTION">Mehr herausfinden. Schnellere Antworten. Neues entdecken – mit Yahoo.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Schnelle und sichere Suche nach Websites, Bildern und Videos</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Websuchmaschine mit der Zielsetzung Anzeigeneinnahmen mit den Urhebern zu teilen.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_el.xtb b/components/strings/search_engine_descriptions_strings_el.xtb new file mode 100644 index 0000000..4c5797d --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_el.xtb
@@ -0,0 +1,14 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="el"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Γρήγορη, ακριβής και ιδιωτική αναζήτηση από τη Microsoft</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Δεν σε παρακολουθούμε. Απόρρητο, απλοποιημένο.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Βρείτε αυτό που χρειάζεστε με τη μηχανή αναζήτησης που χρησιμοποιείται πιο συχνά παγκοσμίως.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Γρήγορη και εύκολη αναζήτηση</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Μια ανεξάρτητη ευρωπαϊκή μηχανή αναζήτησης χωρίς παρακολούθηση</translation> + <translation id="IDS_OCEANHERO_SEARCH_DESCRIPTION">Σταματήστε τη ρύπανση των ωκεανών από πλαστικά μαζί με το OceanHero.</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Μια μηχανή αναζήτησης που προστατεύει το απόρρητό σας.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Γρήγορη και ασφαλής αναζήτηση για ιστοσελίδες, εικόνες και βίντεο</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Μηχανή αναζήτησης Ιστού που στοχεύει να μοιράζεται το έσοδα διαφήμισης με δημιουργούς.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_en-GB.xtb b/components/strings/search_engine_descriptions_strings_en-GB.xtb index 9fd3229..f41414b 100644 --- a/components/strings/search_engine_descriptions_strings_en-GB.xtb +++ b/components/strings/search_engine_descriptions_strings_en-GB.xtb
@@ -1,5 +1,6 @@ <?xml version="1.0" ?> <!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> <translationbundle lang="en-GB"> -<translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Google GB</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Independent, British, no-tracking search engine</translation> </translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_es-US.xtb b/components/strings/search_engine_descriptions_strings_es-US.xtb new file mode 100644 index 0000000..316422fa1f --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_es-US.xtb
@@ -0,0 +1,6 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="es-US"> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Motor de búsqueda independiente, europeo, sin seguimiento</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_es.xtb b/components/strings/search_engine_descriptions_strings_es.xtb new file mode 100644 index 0000000..b342a8c --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_es.xtb
@@ -0,0 +1,19 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="es"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Búsqueda rápida, precisa y privada de Microsoft</translation> + <translation id="IDS_BRAVE_SEARCH_DESCRIPTION">No te rastrea, ni búsquedas, ni clics. Independiente de las Big Tech.</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">No te rastreamos. La privacidad, simplificada.</translation> + <translation id="IDS_ECOSIA_SEARCH_DESCRIPTION">Planta árboles y protege tu privacidad al buscar.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Encuentra lo que necesitas con el buscador más utilizado del mundo.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Búsqueda rápida y fácil</translation> + <translation id="IDS_KARMA_SEARCH_DESCRIPTION">Proteger la biodiversidad y el bienestar animal gracias a tus búsquedas</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Motor de búsqueda independiente, europeo, sin seguimiento</translation> + <translation id="IDS_OCEANHERO_SEARCH_DESCRIPTION">Ayuda a parar la contaminación de plástico del océano con OceanHero.</translation> + <translation id="IDS_PANDA_SEARCH_DESCRIPTION">Consulta con Panda y apoya los proyectos y campañas de WWF.</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Un motor de búsqueda que protege tu privacidad.</translation> + <translation id="IDS_YAHOO_SEARCH_DESCRIPTION">Descubre más. Obtén respuestas rápidamente. Y explora más con Yahoo.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Búsqueda rápida y segura de sitios web, imágenes y videos</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Buscador web que tiene como objetivo compartir los ingresos publicitarias con los creadores.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_et.xtb b/components/strings/search_engine_descriptions_strings_et.xtb new file mode 100644 index 0000000..8f140dd --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_et.xtb
@@ -0,0 +1,13 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="et"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Kiire, täpne ja privaatne otsing Microsoftilt</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Me ei jälita sind. Privaatsus lihtsustatud kujul.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Leidke maailma enim kasutatava otsingumootori abil seda, mida vajate.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Kiire ja lihtne otsimootor</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Sõltumatu Euroopa otsingumootor ilma jälgimiseta</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Teie privaatsust kaitsev otsimootor.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Saitide, piltide ja videote kiire ja turvaline otsing</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Veebiotsingumootor, mille eesmärk on jagada reklaamitulu loojatega.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_eu.xtb b/components/strings/search_engine_descriptions_strings_eu.xtb new file mode 100644 index 0000000..b6d406ac --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_eu.xtb
@@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="eu"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Bilaketa bizkorrak, zehatzak eta pribatuak Microsoft-en eskutik</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Bilatu behar duzun guztia munduan gehien erabiltzen den bilatzailean.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Bilatzaile azkarra eta erraza</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Independent, Europako, no-segimendua bilatzailea</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_fa.xtb b/components/strings/search_engine_descriptions_strings_fa.xtb new file mode 100644 index 0000000..3ad3cde --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_fa.xtb
@@ -0,0 +1,7 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="fa"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">جستجوی سریع، دقیق و خصوصی با فناوری Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">با استفاده از پرکاربردترین موتور جستجوی دنیا، آنچه را میخواهید پیدا کنید.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_fi.xtb b/components/strings/search_engine_descriptions_strings_fi.xtb new file mode 100644 index 0000000..0a3ffae --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_fi.xtb
@@ -0,0 +1,14 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="fi"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoftin tarjoama nopea, tarkka ja yksityinen haku</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Emme seuraa sinua. Yksinkertaistettua yksityisyyttä.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Löydä etsimäsi hakukoneella, jota käytetään eniten maailmassa.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Nopea ja helppo haku</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Riippumaton, eurooppalainen, ei-seurattava hakukone</translation> + <translation id="IDS_OCEANHERO_SEARCH_DESCRIPTION">Estä muovijätteen päätyminen meriin yhdessä OceanHeron kanssa.</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Hakukone, joka suojaa yksityisyyttäsi.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Sivustojen, kuvien ja videoiden nopea ja turvallinen haku</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Verkkohakukone, jonka tavoitteena on jakaa mainostuloja luojien kanssa.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_fil.xtb b/components/strings/search_engine_descriptions_strings_fil.xtb new file mode 100644 index 0000000..4c37806 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_fil.xtb
@@ -0,0 +1,7 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="fil"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Mabilis, tumpak, at pribadong paghahanap mula sa Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Hanapin ang kailangan mo sa pamamagitan ng pinakamadalas na ginagamit na search engine sa buong mundo.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_fr-CA.xtb b/components/strings/search_engine_descriptions_strings_fr-CA.xtb new file mode 100644 index 0000000..89e1e4c8 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_fr-CA.xtb
@@ -0,0 +1,6 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="fr-CA"> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Trouvez ce dont vous avez besoin au moyen du moteur de recherche le plus utilisé au monde.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_fr.xtb b/components/strings/search_engine_descriptions_strings_fr.xtb new file mode 100644 index 0000000..0e3a0f23 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_fr.xtb
@@ -0,0 +1,21 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="fr"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Recherche rapide, précise et privée de Microsoft</translation> + <translation id="IDS_BRAVE_SEARCH_DESCRIPTION">Ne traque ni vos recherches, ni vos clics. Indépendant de Big Tech.</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Nous ne vous pistons pas. Confidentialité, simplifiée.</translation> + <translation id="IDS_ECOSIA_SEARCH_DESCRIPTION">Plantez des arbres et protégez votre vie privée en recherchant.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Trouvez ce dont vous avez besoin avec le moteur de recherche le plus utilisé du monde.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Recherche rapide et facile</translation> + <translation id="IDS_KARMA_SEARCH_DESCRIPTION">Protégez la biodiversité et le bien-être animal grâce à vos recherches internet</translation> + <translation id="IDS_LILO_SEARCH_DESCRIPTION">Financez des projets solidaires gratuitement grâce à vos recherches internet.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Indépendant, moteur de recherche européen, sans suivi</translation> + <translation id="IDS_OCEANHERO_SEARCH_DESCRIPTION">Contribuez à stopper la pollution plastique des océans avec OceanHero.</translation> + <translation id="IDS_PANDA_SEARCH_DESCRIPTION">Lancez des recherches avec Panda et soutenez les projets et les campagnes du WWF.</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Un moteur de recherche qui protège votre vie privée.</translation> + <translation id="IDS_QWANT_SEARCH_DESCRIPTION">Un moteur de recherche européen qui protège votre vie privée</translation> + <translation id="IDS_YAHOO_SEARCH_DESCRIPTION">Élargissez votre horizon. Obtenez vos réponses plus vite avec Yahoo.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Recherche rapide et sécurisée de sites web, d’images et de vidéos</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Moteur de recherche Web qui vise à partager les revenus publicitaires avec les créateurs.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_gl.xtb b/components/strings/search_engine_descriptions_strings_gl.xtb new file mode 100644 index 0000000..122c9ee --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_gl.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="gl"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Busca rápida, precisa e privada de Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Atopa o que necesites co motor de busca máis utilizado do mundo.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Motor de busca independente, europeo e sen rastrexo</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_gsw.xtb b/components/strings/search_engine_descriptions_strings_gsw.xtb new file mode 100644 index 0000000..81fc42e4 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_gsw.xtb
@@ -0,0 +1,10 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="gsw"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Schnelle, genaue Suche von Microsoft mit integriertem Datenschutz</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Schnelle und einfache Suche</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Unabhängig, europäisch, no-Tracking-Suchmaschine</translation> + <translation id="IDS_NONA_SEARCH_DESCRIPTION">Eine deutschsprachige Suchmaschine, bei der Du an erster Stelle stehst.</translation> + <translation id="IDS_PANDA_SEARCH_DESCRIPTION">Suche mit Panda und unterstütze Projekte und Kampagnen des WWF.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_gu.xtb b/components/strings/search_engine_descriptions_strings_gu.xtb new file mode 100644 index 0000000..78aee7f --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_gu.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="gu"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft તરફથી ઝડપી, ચોક્કસ અને ખાનગી શોધ</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">દુનિયાના સૌથી વધુ ઉપયોગમાં લેવાતા શોધ એન્જિન વડે તમારી જરૂરત મુજબનું બધું શોધો.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">સ્વતંત્ર, યુરોપિયન, નો-ટ્રેકિંગ સર્ચ એન્જીન</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_he.xtb b/components/strings/search_engine_descriptions_strings_he.xtb new file mode 100644 index 0000000..35e573f --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_he.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="he"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">חיפוש מהיר, מדויק ופרטי מבית Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">מוצאים את מה שצריכים באמצעות מנוע החיפוש הפופולרי ביותר בעולם.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">מנוע חיפוש מהיר וקל</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_hi.xtb b/components/strings/search_engine_descriptions_strings_hi.xtb new file mode 100644 index 0000000..06df0d1 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_hi.xtb
@@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="hi"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft की ओर से तेज़, अचूक और निजी खोज</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">दुनिया में सबसे ज़्यादा इस्तेमाल होने वाले सर्च इंजन की मदद से अपने काम की हर चीज़ खोजें.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">तेज और आसान खोज इंजन</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">स्वतंत्र, यूरोपीय, गैर-ट्रैकिंग खोज इंजन</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_hr.xtb b/components/strings/search_engine_descriptions_strings_hr.xtb new file mode 100644 index 0000000..9dce81f --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_hr.xtb
@@ -0,0 +1,13 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="hr"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Brzo, točno i privatno pretraživanje koje vam pruža Microsoft</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Ne pratimo Vas. Privatnost, u pojednostavljenom obliku.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Pronađite ono što tražite uz najčešće korištenu tražilicu na svijetu.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Brzo i jednostavno pretraživanje</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Nezavisni, europska, ne-praćenje tražilica</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Tražilica koja štiti vašu privatnost.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Brzo i sigurno traženje web-mjesta, slika i videozapisa</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Internetska tražilica koja ima za cilj dijeliti prihod od oglasa s autorima.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_hu.xtb b/components/strings/search_engine_descriptions_strings_hu.xtb new file mode 100644 index 0000000..bd7aa7a --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_hu.xtb
@@ -0,0 +1,14 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="hu"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Gyors, pontos és privát keresés a Microsofttól</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Mi nem követünk. Adatvédelem, leegyszerűsítve.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Találja meg, amire szüksége van a világ leggyakrabban használt keresője segítségével.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Gyors és egyszerű keresés</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Független, európai, nem-tracking kereső</translation> + <translation id="IDS_OCEANHERO_SEARCH_DESCRIPTION">Segíts megállítani az óceánok műanyagszennyezését az OceanHeróval.</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Keresőmotor, amely védi az Ön személyes adatait.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Webhelyek, képek és videók gyors és biztonságos keresése</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">A webes keresőmotor, amelynek célja a hirdetések bevételeinek megosztása az alkotókkal.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_hy.xtb b/components/strings/search_engine_descriptions_strings_hy.xtb new file mode 100644 index 0000000..0fd92ad --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_hy.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="hy"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Արագ, ստույգ և մասնավոր որոնում՝ տրամադրված Microsoft-ի կողմից</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Գտեք այն ամենն, ինչ ձեզ պետք է աշխարհի ամենաօգտագործվող որոնիչի օգնությամբ:</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Անկախ, Եվրոպական, ոչ հետեւող որոնման շարժիչ</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_id.xtb b/components/strings/search_engine_descriptions_strings_id.xtb new file mode 100644 index 0000000..3d415132 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_id.xtb
@@ -0,0 +1,7 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="id"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Pencarian yang cepat, akurat, dan pribadi dari Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Temukan yang Anda butuhkan dengan mesin telusur yang paling sering digunakan di dunia.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_in.xtb b/components/strings/search_engine_descriptions_strings_in.xtb new file mode 100644 index 0000000..fa64274 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_in.xtb
@@ -0,0 +1,6 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="in"> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Mesin pencari independen, Eropa, non-pelacakan</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_is.xtb b/components/strings/search_engine_descriptions_strings_is.xtb new file mode 100644 index 0000000..0341dc66 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_is.xtb
@@ -0,0 +1,13 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="is"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Hraðvirk, nákvæm og ópersónugreinanleg leitarvél frá Microsoft</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Við fylgjumst ekki með þér. Persónuvernd, einfölduð.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Finndu það sem þú þarft með mest notuðu leitarvél heims.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Fljótleg og auðveld leit</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Independent, European, enginn mælingar leitarvél</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Leitarvél sem verndar friðhelgi þína.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Hröð og örugg leit að vefsvæðum, myndum og myndböndum</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Vefsleitarvélin sem miðar að því að deila auglýsingatekjum með höfundum.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_it.xtb b/components/strings/search_engine_descriptions_strings_it.xtb new file mode 100644 index 0000000..d09c862 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_it.xtb
@@ -0,0 +1,18 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="it"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Ricerca rapida, precisa e privata di Microsoft</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Noi non ti monitoriamo. Privacy, semplificata.</translation> + <translation id="IDS_ECOSIA_SEARCH_DESCRIPTION">Pianta alberi e proteggi la tua privacy mentre fai ricerche.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Trova ciò che ti serve con il motore di ricerca più usato al mondo.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Ricerca facile e veloce</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Motore di ricerca indipendente, europeo, senza tracciabilità</translation> + <translation id="IDS_OCEANHERO_SEARCH_DESCRIPTION">Aiuta a fermare l'inquinamento da plastica negli oceani con OceanHero.</translation> + <translation id="IDS_PANDA_SEARCH_DESCRIPTION">Fai delle ricerche con Panda e sostieni i progetti e le campagne del WWF.</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Un motore di ricerca che protegge la tua privacy.</translation> + <translation id="IDS_QWANT_SEARCH_DESCRIPTION">Un motore di ricerca europeo che rispetta la tua privacy.</translation> + <translation id="IDS_YAHOO_SEARCH_DESCRIPTION">Scopri di più. Ricevi risposte velocemente. Esplora di più con Yahoo.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Ricerca rapida e sicura per siti Web, immagini e video</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Motore di ricerca Web che mira a condividere le entrate pubblicitarie con i creatori.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_iw.xtb b/components/strings/search_engine_descriptions_strings_iw.xtb new file mode 100644 index 0000000..e5f316524 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_iw.xtb
@@ -0,0 +1,6 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="iw"> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">מנוע חיפוש עצמאי, אירופי, שאינו מעקב</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_ja.xtb b/components/strings/search_engine_descriptions_strings_ja.xtb new file mode 100644 index 0000000..248732e --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_ja.xtb
@@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="ja"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft が提供する速くて正確なプライベート検索</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">世界中で最も多く使われている検索エンジンで知りたい情報を探そう。</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">高速で簡単な検索エンジン</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">独立したヨーロッパの非追跡検索エンジン</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_ka.xtb b/components/strings/search_engine_descriptions_strings_ka.xtb new file mode 100644 index 0000000..5c43e52 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_ka.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="ka"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">სწრაფი, ზუსტი და პირადი ძიება Microsoft-ისგან</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">იპოვნეთ რაც გჭირდებათ მსოფლიოს ყველაზე ხშირად გამოყენებად საძიებო სოსტემაში.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">დამოუკიდებელი, ევროპული, არ თვალთვალის საძიებო</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_kk.xtb b/components/strings/search_engine_descriptions_strings_kk.xtb new file mode 100644 index 0000000..59a49261 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_kk.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="kk"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft-тан жылдам, нақты және жеке іздеу қызметі</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Әлемнің ең көп пайдаланылатын іздеу жүйесімен керегіңізді табыңыз.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Тәуелсіз, еуропалық, бақылаусыз іздеу жүйесі</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_km.xtb b/components/strings/search_engine_descriptions_strings_km.xtb new file mode 100644 index 0000000..7e8bd70 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_km.xtb
@@ -0,0 +1,6 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="km"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">ការស្វែងរករហ័ស មានភាពត្រឹមត្រូវ និងមានលក្ខណៈឯកជនពី Microsoft</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_kn.xtb b/components/strings/search_engine_descriptions_strings_kn.xtb new file mode 100644 index 0000000..6f3264e --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_kn.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="kn"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft ನಿಂದ ವೇಗವಾದ, ನಿಖರವಾದ, ಮತ್ತು ಖಾಸಗಿ ಶೋಧ</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">ಪ್ರಪಂಚದಾದ್ಯಂತ ಹೆಚ್ಚು ಬಳಕೆಯಾಗುತ್ತಿರುವ ಹುಡುಕಾಟ ಎಂಜಿನ್ ಮೂಲಕ ನಿಮಗೆ ಅಗತ್ಯವಿರುವುದನ್ನು ಹುಡುಕಿ.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">ಸ್ವತಂತ್ರ, ಯುರೋಪಿಯನ್, ಟ್ರ್ಯಾಕಿಂಗ್ ಇಲ್ಲ ಸರ್ಚ್ ಎಂಜಿನ್</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_ko.xtb b/components/strings/search_engine_descriptions_strings_ko.xtb new file mode 100644 index 0000000..51c3f14 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_ko.xtb
@@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="ko"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft의 빠르고 정확한 비공개 검색</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">전 세계에서 가장 많이 사용하는 검색엔진으로 원하는 정보를 찾으세요.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">빠르고 쉬운 검색 엔진</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">독립적인 유럽 비추적 검색 엔진</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_ky.xtb b/components/strings/search_engine_descriptions_strings_ky.xtb new file mode 100644 index 0000000..4104f0c --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_ky.xtb
@@ -0,0 +1,7 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="ky"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft'тон ыкчам, так жана купуя издөө</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Дүйнөдөгү эң көп колдонулган издөө каражаты менен керектүү нерселерди таап алыңыз.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_lo.xtb b/components/strings/search_engine_descriptions_strings_lo.xtb new file mode 100644 index 0000000..77ee03c4 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_lo.xtb
@@ -0,0 +1,6 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="lo"> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">ເອກະລາດ, ປະເທດເອີຣົບ, ເຄື່ອງຈັກຊອກຫາບໍ່ແມ່ນການຕິດຕາມ</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_lt.xtb b/components/strings/search_engine_descriptions_strings_lt.xtb new file mode 100644 index 0000000..ac511c01 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_lt.xtb
@@ -0,0 +1,13 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="lt"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Sparti, tiksli ir privati „Microsoft“ ieška</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Nesekame jūsų. Privatumas paprasčiau.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Raskite viską naudodami pasaulyje populiariausią paieškos variklį.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Greita ir lengva paieška</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Nepriklausoma, Europos, ne sekimas paieškos sistema</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Paieškos sistema, sauganti jūsų privatumą.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Greita ir saugi svetainių, vaizdų ir vaizdo įrašų ieška</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Žiniatinklio paieškos variklis, kurio tikslas - dalytis skelbimų pajamomis su kūrėjais.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_lv.xtb b/components/strings/search_engine_descriptions_strings_lv.xtb new file mode 100644 index 0000000..61fa27d --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_lv.xtb
@@ -0,0 +1,13 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="lv"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Ātra, precīza un privāta meklēšana no Microsoft</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Mēs jūs neizsekojam. Privātums, vienkāršots.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Atrodiet meklēto, lietojot pasaulē visvairāk izmantoto meklētājprogrammu.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Ātra un ērta meklēšana</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Neatkarīga, Eiropas, bez uzskaites meklētājprogrammu</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Meklētājprogramma, kas aizsargā jūsu privātumu.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Ātra un droša vietņu, attēlu un video meklēšana</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Tīmekļa meklētājprogramma, kuras mērķis ir dalīties ar reklāmas ieņēmumiem ar veidotājiem.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_mk.xtb b/components/strings/search_engine_descriptions_strings_mk.xtb new file mode 100644 index 0000000..72e2480 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_mk.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="mk"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Брзо, прецизно и приватно пребарување од Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Најдете го она што ви треба со најкористениот пребарувач во светот.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Независен, европски, пребарувач што не следи</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_ml.xtb b/components/strings/search_engine_descriptions_strings_ml.xtb new file mode 100644 index 0000000..141b3b0 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_ml.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="ml"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft-ൽ നിന്നുള്ള അതിവേഗവും കൃത്യതയുള്ള, സ്വകാര്യ തിരയൽ</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">ലോകത്ത് ഏറ്റവും കൂടുതൽ ഉപയോഗിക്കപ്പെടുന്ന തിരയൽ യന്ത്രമുപയോഗിച്ച് നിങ്ങൾക്ക് വേണ്ടത് കണ്ടെത്തൂ.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">സ്വതന്ത്ര, യൂറോപ്യൻ, നോൺ-ട്രാക്കിംഗ് സെർച്ച് എഞ്ചിൻ</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_mn.xtb b/components/strings/search_engine_descriptions_strings_mn.xtb new file mode 100644 index 0000000..b20a4dff --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_mn.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="mn"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft-ын хурдан, нарийвчлалтай, нууцлал хадгалсан хайлт</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Дэлхийд хамгийн их ашиглагддаг хайлтын системээр хэрэгтэй зүйлээ олоорой.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Бие даасан, Европ, ямар ч дагаж хайлтын систем</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_mr.xtb b/components/strings/search_engine_descriptions_strings_mr.xtb new file mode 100644 index 0000000..178c7d2b --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_mr.xtb
@@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="mr"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft कडून जलद, अचूक आणि खाजगी शोध</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">जगातील सर्वाधिक वापरल्या जाणार्या शोध इंजीनवरून तुम्हाला काय हवे आहे ते शोधा.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">वेगवान आणि सुलभ शोध इंजिन</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">स्वतंत्र, युरोपियन, नॉन-ट्रॅकिंग शोध इंजिन</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_ms.xtb b/components/strings/search_engine_descriptions_strings_ms.xtb new file mode 100644 index 0000000..e30500c4 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_ms.xtb
@@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="ms"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Carian pantas, tepat dan peribadi daripada Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Cari perkara yang anda perlukan menggunakan enjin carian yang paling banyak digunakan di dunia.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Enjin carian yang cepat dan mudah</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Enjin carian bebas, Eropah, tanpa penjejakan</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_my.xtb b/components/strings/search_engine_descriptions_strings_my.xtb new file mode 100644 index 0000000..ad4da18 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_my.xtb
@@ -0,0 +1,6 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="my"> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">ကမ္ဘာ့အသုံးအများဆုံး ရှာဖွေရေး အင်ဂျင်ဖြင့် သင်လိုအပ်သည်များကို ရှာဖွေပါ။</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_nb.xtb b/components/strings/search_engine_descriptions_strings_nb.xtb new file mode 100644 index 0000000..9b3d656e --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_nb.xtb
@@ -0,0 +1,13 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="nb"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Raske, nøyaktige og private søk fra Microsoft</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Vi sporer deg ikke. Personvern gjort enkelt.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Finn det du leter etter, med verdens mest brukte søkemotor.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Raskt og enkelt søk</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Uavhenging søkemotor, helt uten sporing</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">En søkemotor som beskytter ditt personvern.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Rask og sikker søking etter nettsteder, bilder og videoer</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Nettsøkemotor som tar sikte på å dele annonseinntekter med skaperne.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_ne.xtb b/components/strings/search_engine_descriptions_strings_ne.xtb new file mode 100644 index 0000000..f239a0e --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_ne.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="ne"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft द्वारा प्रायोजित द्रुत, सही र निजी खोज</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">विश्वको सबैभन्दा धेरै प्रयोग हुने खोज इन्जिनको सहायताले आफूलाई चाहिने कुरा फेला पार्नुहोस्।</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Бие даасан, Европ, ямар ч дагаж хайлтын систем</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_nl.xtb b/components/strings/search_engine_descriptions_strings_nl.xtb new file mode 100644 index 0000000..bd3a0786 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_nl.xtb
@@ -0,0 +1,15 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="nl"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Snel, nauwkeurig en veilig zoeken met Microsoft</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">We volgen je niet. Privacy, zo simpel kan het zijn.</translation> + <translation id="IDS_ECOSIA_SEARCH_DESCRIPTION">Plant bomen en bescherm je privacy terwijl je zoekt.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Vind wat je zoekt met de meestgebruikte zoekmachine ter wereld.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Snel en gemakkelijk zoeken</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Onafhankelijke, Europese, no-tracking zoekmachine</translation> + <translation id="IDS_OCEANHERO_SEARCH_DESCRIPTION">Help samen met OceanHero om plastic in de oceaan te voorkomen.</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Een zoekmachine die uw privacy beschermt.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Snel en veilig zoeken naar sites, afbeeldingen en video's</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Webzoekmachine die de advertentie-inkomsten wil delen met makers.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_no.xtb b/components/strings/search_engine_descriptions_strings_no.xtb new file mode 100644 index 0000000..93e89bd --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_no.xtb
@@ -0,0 +1,14 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="no"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Raske, nøyaktige og private søk fra Microsoft</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Vi sporer deg ikke. Personvern gjort enkelt.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Finn det du leter etter, med verdens mest brukte søkemotor.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Raskt og enkelt søk</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Sjølvstendig søkjemotor, heilt utan sporing</translation> + <translation id="IDS_OCEANHERO_SEARCH_DESCRIPTION">Hjelp til med å stanse plastikkforurensningen i havet med OceanHero.</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">En søkemotor som beskytter ditt personvern.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Rask og sikker søking etter nettsteder, bilder og videoer</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Nettsøkemotor som tar sikte på å dele annonseinntekter med skaperne.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_or.xtb b/components/strings/search_engine_descriptions_strings_or.xtb new file mode 100644 index 0000000..f29fd9b --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_or.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="or"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoftରୁ ଦ୍ରୁତ, ସଠିକ, ଏବଂ ବ୍ୟକ୍ତିଗତ ସନ୍ଧାନ</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">ବିଶ୍ୱର ସର୍ବାଧିକ ବ୍ୟବହୃତ ସନ୍ଧାନ ଇଞ୍ଜିନ୍ ମାଧ୍ୟମରେ ଆପଣଙ୍କୁ ଯାହା ଆବଶ୍ୟକ ତାହା ଖୋଜନ୍ତୁ।</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">ସ୍ଵାଧୀନ, ୟୁରୋପୀୟ, ଅଣ-ଟ୍ରାକିଂ ସନ୍ଧାନ ଇଞ୍ଜିନ୍</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_pa.xtb b/components/strings/search_engine_descriptions_strings_pa.xtb new file mode 100644 index 0000000..a405e99 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_pa.xtb
@@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="pa"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft ਤੋਂ ਤੇਜ਼, ਸਟੀਕ, ਅਤੇ ਨਿੱਜੀ ਖੋਜ</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">ਦੁਨੀਆ ਦੇ ਸਭ ਤੋਂ ਵੱਧ ਵਰਤੇ ਜਾਣ ਵਾਲੇ ਖੋਜ ਇੰਜਣ ਨਾਲ ਹਰ ਉਹ ਚੀਜ਼ ਲੱਭੋ ਜਿਸਦੀ ਤੁਹਾਨੂੰ ਲੋੜ ਹੈ।</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">ਤੇਜ਼ ਅਤੇ ਆਸਾਨ ਸਰਚ ਇੰਜਨ</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">ਸੁਤੰਤਰ, ਯੂਰਪੀਅਨ, ਨਾਨ-ਟਰੈਕਿੰਗ ਸਰਚ ਇੰਜਨ</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_pl.xtb b/components/strings/search_engine_descriptions_strings_pl.xtb new file mode 100644 index 0000000..43ad78c --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_pl.xtb
@@ -0,0 +1,14 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="pl"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Szybkie, dokładne i bezpieczne wyszukiwanie z Microsoft</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Nie śledzimy Cię. Prywatność, po prostu.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Skorzystaj z najczęściej używanej wyszukiwarki na świecie, by znaleźć to, czego potrzebujesz.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Szybka i prosta wyszukiwarka</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Niezależny, europejski, bez śledzenia wyszukiwarka</translation> + <translation id="IDS_OCEANHERO_SEARCH_DESCRIPTION">Pomóż zatrzymać zanieczyszczenie oceanu plastykiem wraz z OceanHero.</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Wyszukiwarka, która chroni Twoją prywatność.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Szybkie i bezpieczne wyszukiwanie witryn, obrazów i filmów</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Wyszukiwarka internetowa, której celem jest dzielenie się przychodami z reklam z twórcami.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_pt-BR.xtb b/components/strings/search_engine_descriptions_strings_pt-BR.xtb new file mode 100644 index 0000000..8a6e8ec --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_pt-BR.xtb
@@ -0,0 +1,7 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="pt-BR"> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">mecanismo de busca rápido e fácil</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Mecanismo de pesquisa independente, europeu, sem rastreamento</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_pt-PT.xtb b/components/strings/search_engine_descriptions_strings_pt-PT.xtb new file mode 100644 index 0000000..0dd2598 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_pt-PT.xtb
@@ -0,0 +1,7 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="pt-PT"> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Encontre o que precisa com o motor de pesquisa mais utilizado em todo o mundo.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Mecanismo de pesquisa independente, europeu, sem rastreamento</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_pt.xtb b/components/strings/search_engine_descriptions_strings_pt.xtb new file mode 100644 index 0000000..23b8f73 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_pt.xtb
@@ -0,0 +1,15 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="pt"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Pesquisa rápida, precisa e privada da Microsoft</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Nós não o monitorizamos. Privacidade, simplificada.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Encontre o que precisa com o mecanismo de pesquisa mais usado do mundo.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Pesquisa rápida e fácil</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Mecanismo de pesquisa independente, europeu, sem rastreamento</translation> + <translation id="IDS_OCEANHERO_SEARCH_DESCRIPTION">Ajude a parar a poluição de plástico nos oceanos com a OceanHero.</translation> + <translation id="IDS_PANDA_SEARCH_DESCRIPTION">Pesquise com o Panda e apoie projectos e campanhas da WWF.</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Um mecanismo de pesquisa que protege sua privacidade.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Pesquisa rápida e segura de sites, imagens e vídeos</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Motor de busca da Internet que visa compartilhar receita de anúncios com os criadores.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_ro.xtb b/components/strings/search_engine_descriptions_strings_ro.xtb new file mode 100644 index 0000000..fe0ce1a --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_ro.xtb
@@ -0,0 +1,13 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="ro"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Căutare rapidă, precisă și confidențială de la Microsoft</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Noi nu iți urmărim activitatea. Confidențialitatea, simplificată.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Găsiți ce vă trebuie folosind cel mai popular motor de căutare din lume.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Navigare rapidă și ușoară</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Motor de căutare independent, european, fără urmărire</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Un motor de căutare care vă protejează confidențialitatea.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Căutați rapid și sigur site-uri, imagini și videoclipuri</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Motor de căutare web care își propune să partajeze veniturile publicitare cu creatorii.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_ru.xtb b/components/strings/search_engine_descriptions_strings_ru.xtb new file mode 100644 index 0000000..f8687525 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_ru.xtb
@@ -0,0 +1,13 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="ru"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Быстрый, конфиденциальный и точный поиск от Майкрософт</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Мы не отслеживаем вас. Проще говоря, приватность.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Находите нужную информацию с помощью самой популярной поисковой системы в мире.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Быстрый и простой поиск</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Независимая европейская поисковая система без отслеживания</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Поисковая система, которая защищает вашу конфиденциальность.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Быстрый и безопасный поиск по сайтам, картинкам, видео</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Система веб-поиска, цель которой - делиться доходами от рекламы с создателями.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_si.xtb b/components/strings/search_engine_descriptions_strings_si.xtb new file mode 100644 index 0000000..6132aeb --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_si.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="si"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft වෙතින් වේගවත්, නිවැරදි සහ පුද්ගලික සෙවුම</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">ලෝකයේ වැඩිම භාවිත කෙරෙන සෙවුම් යන්ත්රය සමඟ ඔබට අවශ්ය දෙය සොයා ගන්න.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">ස්වාධීන, යුරෝපීය, ලුහුබැඳ නොයන සෙවුම් යන්ත්රය</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_sk.xtb b/components/strings/search_engine_descriptions_strings_sk.xtb new file mode 100644 index 0000000..1b6217e4 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_sk.xtb
@@ -0,0 +1,14 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="sk"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Rýchle, presné a súkromné vyhľadávanie od spoločnosti Microsoft</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Nesledujeme vás. Súkromie, zjednodušene.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Nájdite všetko potrebné najpoužívanejším vyhľadávačom na svete.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Rýchle a jednoduché vyhľadávanie</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Nezávislý, európskej, ne-tracking vyhľadávač</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Vyhľadávací nástroj, ktorý chráni vaše súkromie.</translation> + <translation id="IDS_SEZNAM_SEARCH_DESCRIPTION">Český vyhľadávač.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Rýchle a bezpečné vyhľadávanie stránok, obrázkov a videí</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Webový vyhľadávač, ktorého cieľom je rozdelenie príjmy z reklamy s tvorcami.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_sl.xtb b/components/strings/search_engine_descriptions_strings_sl.xtb new file mode 100644 index 0000000..fe80dabb --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_sl.xtb
@@ -0,0 +1,13 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="sl"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoftov iskalnik za hitro, natančno in zasebno iskanje.</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Ne sledimo vam. Poenostavljena zasebnost.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Poiščite, kar potrebujete, z najpogosteje uporabljanim iskalnikom na svetu.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Hitro in enostavno iskanje</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Independent, evropska, ne-sledenje iskalnik</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Iskalnik, ki varuje vašo zasebnost.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Hitro in varno iskanje spletnih mest, slik ter videoposnetkov</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Spletni iskalnik, katerega cilj je deliti prihodke od oglasov z ustvarjalci.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_sq.xtb b/components/strings/search_engine_descriptions_strings_sq.xtb new file mode 100644 index 0000000..0d07e6b9 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_sq.xtb
@@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="sq"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Kërkimi i shpejtë, i saktë dhe privat nga Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Gjej atë që të nevojitet me motorin e kërkimit më të përdorur në botë.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Motori i shpejtë dhe i lehtë i kërkimit</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">I pavarur, evropiane, jo-ndjekja motor kërkimi</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_sr.xtb b/components/strings/search_engine_descriptions_strings_sr.xtb new file mode 100644 index 0000000..35be37d --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_sr.xtb
@@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="sr"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Брза, тачна и приватна претрага коју пружа Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Пронађите оно што вам је потребно помоћу претраживача који се најчешће користи на свету.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Брз и лаган претраживач</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Независна, европска, не праћење претраживач</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_sv.xtb b/components/strings/search_engine_descriptions_strings_sv.xtb new file mode 100644 index 0000000..3de49e2 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_sv.xtb
@@ -0,0 +1,14 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="sv"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Snabb, korrekt och privat sökning från Microsoft</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Vi spårar dig inte. Integritet, helt enkelt.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Hitta det du letar efter med världens mest använda sökmotor.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Snabb och enkel sökmotor</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Oberoende, europeiska, no-tracking sökmotor</translation> + <translation id="IDS_OCEANHERO_SEARCH_DESCRIPTION">Stoppa föroreningarna av plast i haven tillsammans med OceanHero.</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">En sökmotor som skyddar din integritet.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Snabb och säker sökning efter webbplatser, bilder och videoklipp</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Webbsökmotor som syftar till att dela annonsintäkter med skapare.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_sw.xtb b/components/strings/search_engine_descriptions_strings_sw.xtb new file mode 100644 index 0000000..361f6ba --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_sw.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="sw"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Utafutaji sahihi, wenye upesi na faragha unaotoka kwa Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Tafuta unachohitaji ukitumia mtambo wa kutafuta unaotumiwa sana kote ulimwenguni.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Independent, Ulaya, mashirika yasiyo ya kufuatilia injini</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_ta.xtb b/components/strings/search_engine_descriptions_strings_ta.xtb new file mode 100644 index 0000000..03c195e --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_ta.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="ta"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft-இலிருந்து விரைவான, துல்லியமான மற்றும் தனிப்பட்ட தேடல்</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">உலகில் அதிகமாகப் பயன்படுத்தப்படும் தேடல் இன்ஜின் மூலம் உங்களுக்குத் தேவையானதைக் கண்டறியுங்கள்.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">சுதந்திர, ஐரோப்பிய, அல்லாத கண்காணிப்பு தேடுபொறி</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_te.xtb b/components/strings/search_engine_descriptions_strings_te.xtb new file mode 100644 index 0000000..c295ac4 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_te.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="te"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft నుండి వేగవంతమైన, ఖచ్చితమైన, ప్రైవేట్ శోధన</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">ప్రపంచంలో అత్యధికంగా ఉపయోగించే శోధన ఇంజిన్తో మీకు కావలసిన వాటిని కనుగొనండి.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">స్వతంత్ర, యూరోపియన్, ట్రాకింగ్ కాని శోధన ఇంజిన్</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_th.xtb b/components/strings/search_engine_descriptions_strings_th.xtb new file mode 100644 index 0000000..cc1abcab --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_th.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="th"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">การค้นหาที่รวดเร็ว แม่นยำ และเป็นส่วนตัวจาก Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">ค้นหาสิ่งที่คุณต้องการ ด้วยเครื่องมือค้นหาที่มีผู้ใช้มากที่สุดในโลก</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">เสิร์ชเอ็นจิ้นอิสระแบบยุโรปไม่มีการติดตาม</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_tr.xtb b/components/strings/search_engine_descriptions_strings_tr.xtb new file mode 100644 index 0000000..5c4cd0a --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_tr.xtb
@@ -0,0 +1,13 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="tr"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft’un hızlı, doğru ve özel arama hizmeti</translation> + <translation id="IDS_DUCKDUCKGO_SEARCH_DESCRIPTION">Sizi takip etmeyiz. Gizlilik, basitleştirildi.</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Dünyanın en çok kullanılan arama motoruyla aradığınızı bulun.</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">Hızlı ve kolay arama</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">İzleme olmadan bağımsız bir Avrupa arama motoru</translation> + <translation id="IDS_PRIVACYWALL_SEARCH_DESCRIPTION">Gizliliğinizi koruyan bir arama motoru.</translation> + <translation id="IDS_YANDEX_SEARCH_DESCRIPTION">Hızlı ve güvenli site, görüntü ve video araması</translation> + <translation id="IDS_YEP_SEARCH_DESCRIPTION">Reklam gelirlerini içerik oluşturucularla paylaşmayı amaçlayan web arama motoru.</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_uk.xtb b/components/strings/search_engine_descriptions_strings_uk.xtb new file mode 100644 index 0000000..95fc214 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_uk.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="uk"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Швидкий, точний і приватний пошук від Майкрософт</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Шукайте все, що вам потрібно, у найпопулярнішій пошуковій системі.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Незалежна європейська пошукова система без відстеження</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_ur.xtb b/components/strings/search_engine_descriptions_strings_ur.xtb new file mode 100644 index 0000000..4f65e29 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_ur.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="ur"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoft کی تیز، مناسب اور ذاتی تلاش</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">دنیا کے سب سے زیادہ استعمال کیے جانے والے سرچ انجن کی مدد سے آپ کو جن چیزوں کی ضرورت ہے انہیں تلاش کریں۔</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">آزاد ، یورپی ، کوئی ٹریکنگ سرچ انجن</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_uz.xtb b/components/strings/search_engine_descriptions_strings_uz.xtb new file mode 100644 index 0000000..d35fa2f --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_uz.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="uz"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Microsoftdan tezkor, aniq va shaxsiy qidiruv xizmati</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Istalgan narsani dunyodagi eng ommabop qidiruv tizimi orqali toping.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Mustaqil, Evropa, no-kuzatish qidiruvi,</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_vi.xtb b/components/strings/search_engine_descriptions_strings_vi.xtb new file mode 100644 index 0000000..2679344 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_vi.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="vi"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Tìm kiếm nhanh chóng, chính xác và riêng tư từ Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Tìm thấy mọi thứ bạn cần bằng công cụ tìm kiếm được tin dùng nhất trên thế giới.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Độc lập, Search Engine châu Âu không có theo dõi</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_zh-CN.xtb b/components/strings/search_engine_descriptions_strings_zh-CN.xtb new file mode 100644 index 0000000..676abc2 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_zh-CN.xtb
@@ -0,0 +1,9 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="zh-CN"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">由 Microsoft 提供的快速且准确的无痕搜索功能</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">无论你想查找什么,世界上使用人数最多的搜索引擎都可以为你效劳。</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">快速简便的搜索引擎</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">独立的、欧洲的、无跟踪的搜索引擎</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_zh-HK.xtb b/components/strings/search_engine_descriptions_strings_zh-HK.xtb new file mode 100644 index 0000000..7e8a22f --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_zh-HK.xtb
@@ -0,0 +1,7 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="zh-HK"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">透過 Microsoft 進行快速、精準、私密的搜尋</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">透過全球最使用率最高的搜尋引擎尋找所需資料。</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_zh-TW.xtb b/components/strings/search_engine_descriptions_strings_zh-TW.xtb new file mode 100644 index 0000000..400ec13 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_zh-TW.xtb
@@ -0,0 +1,7 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="zh-TW"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">透過 Microsoft 進行快速、精準、私密的搜尋</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">無論你要尋找什麼,統統交給世界上最多人使用的搜尋引擎吧!</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_zh.xtb b/components/strings/search_engine_descriptions_strings_zh.xtb new file mode 100644 index 0000000..e94736a9 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_zh.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="zh"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">由 Microsoft 提供的快速且准确的无痕搜索功能</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">无论你想查找什么,世界上使用人数最多的搜索引擎都可以为你效劳。</translation> + <translation id="IDS_INFOCOM_SEARCH_DESCRIPTION">快速简便的搜索引擎</translation> +</translationbundle>
diff --git a/components/strings/search_engine_descriptions_strings_zu.xtb b/components/strings/search_engine_descriptions_strings_zu.xtb new file mode 100644 index 0000000..cb3af69 --- /dev/null +++ b/components/strings/search_engine_descriptions_strings_zu.xtb
@@ -0,0 +1,8 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<!-- This file is generated using tools/search_engine_choice/generate_search_engine_snippets.py. Do not modify it manually. --> +<translationbundle lang="zu"> + <translation id="IDS_BING_SEARCH_DESCRIPTION">Usesho olusheshayo, olunembile, noluyimfihlo lakwa-Microsoft</translation> + <translation id="IDS_GOOGLE_SEARCH_DESCRIPTION">Thola okudingayo ngenjini yosesho esetshenziswe kakhulu emhlabeni.</translation> + <translation id="IDS_MOJEEK_SEARCH_DESCRIPTION">Independent, European, akukho-ethungatha Search Engine</translation> +</translationbundle>
diff --git a/components/supervised_user/core/browser/kids_management_url_checker_client.cc b/components/supervised_user/core/browser/kids_management_url_checker_client.cc index 5438c8c..72d0a6d 100644 --- a/components/supervised_user/core/browser/kids_management_url_checker_client.cc +++ b/components/supervised_user/core/browser/kids_management_url_checker_client.cc
@@ -86,7 +86,7 @@ void OnResponse( const GURL& url, safe_search_api::URLCheckerClient::ClientCheckCallback client_callback, - supervised_user::ProtoFetcherStatus status, + const supervised_user::ProtoFetcherStatus& status, std::unique_ptr<kids_chrome_management::ClassifyUrlResponse> classify_url_response) { DVLOG(1) << "URL classification = "
diff --git a/components/supervised_user/core/browser/list_family_members_service.cc b/components/supervised_user/core/browser/list_family_members_service.cc index 88dfbd39..69b6529 100644 --- a/components/supervised_user/core/browser/list_family_members_service.cc +++ b/components/supervised_user/core/browser/list_family_members_service.cc
@@ -23,7 +23,7 @@ constexpr base::TimeDelta kDefaultUpdateInterval = base::Days(1); constexpr base::TimeDelta kOnErrorUpdateInterval = base::Hours(4); -base::TimeDelta NextUpdate(ProtoFetcherStatus status) { +base::TimeDelta NextUpdate(const ProtoFetcherStatus& status) { if (status.IsOk()) { return kDefaultUpdateInterval; } @@ -59,7 +59,7 @@ } void ListFamilyMembersService::OnResponse( - ProtoFetcherStatus status, + const ProtoFetcherStatus& status, std::unique_ptr<kids_chrome_management::ListFamilyMembersResponse> response) { // Built-in mechanism for retrying will take care of internal retrying, but
diff --git a/components/supervised_user/core/browser/list_family_members_service.h b/components/supervised_user/core/browser/list_family_members_service.h index 7df4e7b..d97eb12 100644 --- a/components/supervised_user/core/browser/list_family_members_service.h +++ b/components/supervised_user/core/browser/list_family_members_service.h
@@ -51,12 +51,12 @@ private: void OnResponse( - ProtoFetcherStatus status, + const ProtoFetcherStatus& status, std::unique_ptr<kids_chrome_management::ListFamilyMembersResponse> response); void OnSuccess( const kids_chrome_management::ListFamilyMembersResponse& response); - void OnFailure(ProtoFetcherStatus status); + void OnFailure(const ProtoFetcherStatus& status); void ScheduleNextUpdate(base::TimeDelta delay); // Dependencies.
diff --git a/components/supervised_user/core/browser/permission_request_creator_impl.cc b/components/supervised_user/core/browser/permission_request_creator_impl.cc index 3516ad3..6831b1c 100644 --- a/components/supervised_user/core/browser/permission_request_creator_impl.cc +++ b/components/supervised_user/core/browser/permission_request_creator_impl.cc
@@ -42,14 +42,14 @@ DispatchResult(ValidateResponse(response), std::move(callback)); } -void OnFailure(ProtoFetcherStatus error, +void OnFailure(const ProtoFetcherStatus& error, PermissionRequestCreator::SuccessCallback callback) { DispatchResult(false, std::move(callback)); } void OnResponse( PermissionRequestCreator::SuccessCallback callback, - ProtoFetcherStatus status, + const ProtoFetcherStatus& status, std::unique_ptr<kids_chrome_management::CreatePermissionRequestResponse> response) { if (!status.IsOk()) {
diff --git a/components/supervised_user/core/browser/proto_fetcher.cc b/components/supervised_user/core/browser/proto_fetcher.cc index 8d1bf83..e9a7aa7 100644 --- a/components/supervised_user/core/browser/proto_fetcher.cc +++ b/components/supervised_user/core/browser/proto_fetcher.cc
@@ -166,7 +166,7 @@ Metrics() = delete; explicit Metrics(StringPiece basename) : basename_(basename) {} - void RecordStatus(ProtoFetcherStatus status) const { + void RecordStatus(const ProtoFetcherStatus& status) const { base::UmaHistogramEnumeration(GetFullHistogramName(MetricType::kStatus), status.state()); } @@ -190,12 +190,12 @@ stopwatch_.Lap()); } - virtual void RecordStatusLatency(ProtoFetcherStatus status) const { + virtual void RecordStatusLatency(const ProtoFetcherStatus& status) const { base::UmaHistogramTimes(GetFullHistogramName(MetricType::kLatency, status), stopwatch_.Elapsed()); } - void RecordHttpStatusOrNetError(ProtoFetcherStatus status) const { + void RecordHttpStatusOrNetError(const ProtoFetcherStatus& status) const { CHECK(status.state() == ProtoFetcherStatus::State::HTTP_STATUS_OR_NET_ERROR); base::UmaHistogramSparse( @@ -265,7 +265,7 @@ // and should be reflected in tokens in histogram defined for this fetcher. // See example at // tools/metrics/histograms/metadata/signin/histograms.xml://histogram[@name='Signin.ListFamilyMembersRequest.{Status}.*'] - static std::string ToMetricEnumLabel(ProtoFetcherStatus status) { + static std::string ToMetricEnumLabel(const ProtoFetcherStatus& status) { switch (status.state()) { case ProtoFetcherStatus::OK: return "NoError"; @@ -294,7 +294,7 @@ explicit OverallMetrics(StringPiece basename) : Metrics(basename) {} // Per-status latency is not defined for OverallMetrics. - void RecordStatusLatency(ProtoFetcherStatus status) const override { + void RecordStatusLatency(const ProtoFetcherStatus& status) const override { NOTIMPLEMENTED(); } @@ -376,7 +376,7 @@ } private: - void RecordMetrics(ProtoFetcherStatus status) { + void RecordMetrics(const ProtoFetcherStatus& status) { metrics_.RecordStatus(status); metrics_.RecordLatency(); metrics_.RecordStatusLatency(status); @@ -544,11 +544,11 @@ &RetryingFetcherImpl<Response>::OnResponse, Unretained(this))); } - bool ShouldRetry(ProtoFetcherStatus status) { + bool ShouldRetry(const ProtoFetcherStatus& status) { return status.IsTransientError(); } - void OnResponse(ProtoFetcherStatus status, + void OnResponse(const ProtoFetcherStatus& status, std::unique_ptr<Response> response) { if (ShouldRetry(status)) { backoff_entry_.InformOfRequest(/*succeeded=*/false);
diff --git a/components/supervised_user/core/browser/proto_fetcher.h b/components/supervised_user/core/browser/proto_fetcher.h index 8266c99d7..1650e778 100644 --- a/components/supervised_user/core/browser/proto_fetcher.h +++ b/components/supervised_user/core/browser/proto_fetcher.h
@@ -126,8 +126,8 @@ template <typename Response> class ProtoFetcher { public: - using Callback = - base::OnceCallback<void(ProtoFetcherStatus, std::unique_ptr<Response>)>; + using Callback = base::OnceCallback<void(const ProtoFetcherStatus&, + std::unique_ptr<Response>)>; virtual ~ProtoFetcher() = default; };
diff --git a/components/supervised_user/core/browser/proto_fetcher_unittest.cc b/components/supervised_user/core/browser/proto_fetcher_unittest.cc index feb0377e..0db4959 100644 --- a/components/supervised_user/core/browser/proto_fetcher_unittest.cc +++ b/components/supervised_user/core/browser/proto_fetcher_unittest.cc
@@ -125,7 +125,7 @@ } bool HasResultOrError() const { return result_.has_value(); } - void Receive(ProtoFetcherStatus fetch_status, + void Receive(const ProtoFetcherStatus& fetch_status, std::unique_ptr<Response> response) { if (!fetch_status.IsOk()) { result_ = base::unexpected(fetch_status); @@ -689,7 +689,8 @@ class FetchManagerTest : public testing::Test { public: MOCK_METHOD2(Done, - void(ProtoFetcherStatus, std::unique_ptr<ClassifyUrlResponse>)); + void(const ProtoFetcherStatus&, + std::unique_ptr<ClassifyUrlResponse>)); protected: void SetUp() override { @@ -787,7 +788,7 @@ class DeferredFetcherTest : public ::testing::Test { protected: - using CallbackType = void(ProtoFetcherStatus, + using CallbackType = void(const ProtoFetcherStatus&, std::unique_ptr<CreatePermissionRequestResponse>); public: @@ -807,7 +808,7 @@ std::unique_ptr<DeferredProtoFetcher<CreatePermissionRequestResponse>> fetcher, base::OnceCallback<CallbackType> callback, - ProtoFetcherStatus status, + const ProtoFetcherStatus& status, std::unique_ptr<CreatePermissionRequestResponse> response) { std::move(callback).Run(status, std::move(response)); }
diff --git a/components/sync/base/features.cc b/components/sync/base/features.cc index 651a6e7..4287741 100644 --- a/components/sync/base/features.cc +++ b/components/sync/base/features.cc
@@ -141,10 +141,6 @@ base::FEATURE_DISABLED_BY_DEFAULT); #endif // !BUILDFLAG(IS_IOS) -BASE_FEATURE(kReadingListEnableDualReadingListModel, - "ReadingListEnableDualReadingListModel", - base::FEATURE_ENABLED_BY_DEFAULT); - BASE_FEATURE(kReadingListEnableSyncTransportModeUponSignIn, "ReadingListEnableSyncTransportModeUponSignIn", #if BUILDFLAG(IS_IOS)
diff --git a/components/sync/base/features.h b/components/sync/base/features.h index bbd1815b..c59143a6 100644 --- a/components/sync/base/features.h +++ b/components/sync/base/features.h
@@ -151,11 +151,6 @@ BASE_DECLARE_FEATURE(kEnableBookmarkFoldersForAccountStorage); #endif // !BUILDFLAG(IS_IOS) -// Feature flag that controls a technical rollout of a new codepath that doesn't -// itself cause user-facing changes but sets the foundation for later rollouts -// namely, `kReadingListEnableSyncTransportModeUponSignIn` below). -BASE_DECLARE_FEATURE(kReadingListEnableDualReadingListModel); - // Feature flag used for enabling sync (transport mode) for signed-in users that // haven't turned on full sync. BASE_DECLARE_FEATURE(kReadingListEnableSyncTransportModeUponSignIn);
diff --git a/components/sync/service/sync_prefs.cc b/components/sync/service/sync_prefs.cc index 7bc7613..d55f7ca 100644 --- a/components/sync/service/sync_prefs.cc +++ b/components/sync/service/sync_prefs.cc
@@ -594,8 +594,6 @@ return base::FeatureList::IsEnabled(kEnableBookmarksAccountStorage); case UserSelectableType::kReadingList: return base::FeatureList::IsEnabled( - kReadingListEnableDualReadingListModel) && - base::FeatureList::IsEnabled( kReadingListEnableSyncTransportModeUponSignIn); case UserSelectableType::kPreferences: return base::FeatureList::IsEnabled(kReplaceSyncPromosWithSignInPromos) &&
diff --git a/components/sync/service/sync_prefs.h b/components/sync/service/sync_prefs.h index 96a2ce42..3299ce77 100644 --- a/components/sync/service/sync_prefs.h +++ b/components/sync/service/sync_prefs.h
@@ -134,11 +134,10 @@ #if BUILDFLAG(IS_IOS) // Sets the opt-in for bookmarks & reading list in transport mode. - // Note that this only has an effect if `kEnableBookmarksAccountStorage` - // and/or `kReadingListEnableDualReadingListModel` are enabled, but - // `kReplaceSyncPromosWithSignInPromos` is NOT enabled. (It should still be - // called if `kReplaceSyncPromosWithSignInPromos` is enabled though, to better - // support rollbacks.) + // Note that this only has an effect if `kReplaceSyncPromosWithSignInPromos` + // is NOT enabled. (It should still be called if + // `kReplaceSyncPromosWithSignInPromos` is enabled though, to better support + // rollbacks.) void SetBookmarksAndReadingListAccountStorageOptIn(bool value); // Gets the opt-in state for bookmarks & reading list in transport mode, for
diff --git a/components/sync/service/sync_prefs_unittest.cc b/components/sync/service/sync_prefs_unittest.cc index 7e01d8e..5fe248de 100644 --- a/components/sync/service/sync_prefs_unittest.cc +++ b/components/sync/service/sync_prefs_unittest.cc
@@ -300,7 +300,6 @@ base::test::ScopedFeatureList features; features.InitWithFeatures( /*enabled_features=*/{kEnableBookmarksAccountStorage, - kReadingListEnableDualReadingListModel, kReadingListEnableSyncTransportModeUponSignIn, password_manager::features:: kEnablePasswordsAccountStorage, @@ -342,7 +341,6 @@ features.InitWithFeatures( /*enabled_features=*/{kReplaceSyncPromosWithSignInPromos, kEnableBookmarksAccountStorage, - kReadingListEnableDualReadingListModel, kReadingListEnableSyncTransportModeUponSignIn, password_manager::features:: kEnablePasswordsAccountStorage, @@ -664,7 +662,6 @@ // in transport mode. feature_list_.InitWithFeatures( /*enabled_features=*/{kEnableBookmarksAccountStorage, - kReadingListEnableDualReadingListModel, kReadingListEnableSyncTransportModeUponSignIn, password_manager::features:: kEnablePasswordsAccountStorage,
diff --git a/components/sync/service/sync_user_settings_impl_unittest.cc b/components/sync/service/sync_user_settings_impl_unittest.cc index 9d4ef7b19..19418c8 100644 --- a/components/sync/service/sync_user_settings_impl_unittest.cc +++ b/components/sync/service/sync_user_settings_impl_unittest.cc
@@ -156,7 +156,6 @@ feature_list.InitWithFeatures( /*enabled_features=*/{kReplaceSyncPromosWithSignInPromos, kEnableBookmarksAccountStorage, - kReadingListEnableDualReadingListModel, kReadingListEnableSyncTransportModeUponSignIn, password_manager::features:: kEnablePasswordsAccountStorage,
diff --git a/components/translate/content/common/translate.mojom b/components/translate/content/common/translate.mojom index 227d2f6..624252ea 100644 --- a/components/translate/content/common/translate.mojom +++ b/components/translate/content/common/translate.mojom
@@ -47,9 +47,8 @@ // All the elements below are used only for debugging and metrics purposes, // e.g., translate-internals. // - // Whether language detection has been run on the page. Under - // kSkipLanguageDetectionOnEmptyContent, this is only done if page content was - // captured. + // Whether language detection has been run on the page; only true if page + // content was captured. bool has_run_lang_detection; // The time at which language the language detection was performed. Used only // for debugging.
diff --git a/components/translate/content/renderer/translate_agent.cc b/components/translate/content/renderer/translate_agent.cc index a7a6308..245c725d1 100644 --- a/components/translate/content/renderer/translate_agent.cc +++ b/components/translate/content/renderer/translate_agent.cc
@@ -161,16 +161,11 @@ } void TranslateAgent::PrepareForUrl(const GURL& url) { - // Navigated to a new url, reset current page translation and related state. - page_contents_length_ = 0; + // Navigated to a new url, reset current page translation. ResetPage(); } void TranslateAgent::PageCaptured(const std::u16string& contents) { - // This method should only be called if it was not already run on captured - // content on the page. - DCHECK(!WasPageContentCapturedForUrl()); - // Get the document language as set by WebKit from the http-equiv // meta tag for "content-language". This may or may not also // have a value derived from the actual Content-Language HTTP @@ -228,15 +223,13 @@ LanguageDetectionDetails details; std::string language; - // Under kSkipLanguageDetectionOnEmptyContent, if captured content is empty, - // default to using "und" instead of attempting language detection. - if (base::FeatureList::IsEnabled( - translate::kSkipLanguageDetectionOnEmptyContent) && - page_contents_length_ == 0) { - // Use the page-provided language if available. + if (page_contents_length_ == 0) { + // If captured content is empty do not run language detection and pass "und" + // as the model defined language along with page-provided languages. language = translate::DeterminePageLanguage( content_language, html_lang, translate::kUnknownLanguageCode, false); } else if (translate::IsTFLiteLanguageDetectionEnabled()) { + // Use TFLite and page contents to assist with language detection. translate::LanguageDetectionModel& language_detection_model = GetLanguageDetectionModel(); bool is_available = language_detection_model.IsAvailable(); @@ -254,6 +247,7 @@ detection_model_version = language_detection_model.GetModelVersion(); details.has_run_lang_detection = true; } else { + // Use CLD3 and page contents to assist with language detection. language = DeterminePageLanguage( content_language, html_lang, contents, &model_detected_language, &is_model_reliable, model_reliability_score);
diff --git a/components/translate/content/renderer/translate_agent.h b/components/translate/content/renderer/translate_agent.h index e746f66..e8a0465 100644 --- a/components/translate/content/renderer/translate_agent.h +++ b/components/translate/content/renderer/translate_agent.h
@@ -49,11 +49,6 @@ // this URL loads, this is the time to prepare for it. void PrepareForUrl(const GURL& url); - // Under kRetryLanguageDetection, this is true if a previous call to - // PageCaptured has been made with captured page content and language - // detection was run. - bool WasPageContentCapturedForUrl() { return page_contents_length_; } - // mojom::TranslateAgent implementation. void TranslateFrame(const std::string& translate_script, const std::string& source_lang,
diff --git a/components/translate/core/common/translate_util.cc b/components/translate/core/common/translate_util.cc index 2a25e8f..4717ed1f 100644 --- a/components/translate/core/common/translate_util.cc +++ b/components/translate/core/common/translate_util.cc
@@ -32,13 +32,6 @@ "TFLiteLanguageDetectionIgnoreEnabled", base::FEATURE_DISABLED_BY_DEFAULT); -BASE_FEATURE(kRetryLanguageDetection, - "RetryLanguageDetection", - base::FEATURE_DISABLED_BY_DEFAULT); -BASE_FEATURE(kSkipLanguageDetectionOnEmptyContent, - "SkipLanguageDetectionOnEmptyContent", - base::FEATURE_ENABLED_BY_DEFAULT); - #if !BUILDFLAG(IS_WIN) BASE_FEATURE(kMmapLanguageDetectionModel, "MmapLanguageDetectionModel",
diff --git a/components/translate/core/common/translate_util.h b/components/translate/core/common/translate_util.h index 3da39c6..28f0089 100644 --- a/components/translate/core/common/translate_util.h +++ b/components/translate/core/common/translate_util.h
@@ -18,13 +18,6 @@ // and the CLD3 version is used instead. BASE_DECLARE_FEATURE(kTFLiteLanguageDetectionIgnoreEnabled); -// When enabled, language detection is attempted when the page finishes loading -// if no page content is captured when parsing completes. -BASE_DECLARE_FEATURE(kRetryLanguageDetection); -// When enabled, language detection is skipped if no page content was captured -// and chrome://translate-internals logs are updated to reflect this. -BASE_DECLARE_FEATURE(kSkipLanguageDetectionOnEmptyContent); - #if !BUILDFLAG(IS_WIN) // Controls whether mmap is used to load the language detection model. BASE_DECLARE_FEATURE(kMmapLanguageDetectionModel);
diff --git a/components/translate/ios/browser/BUILD.gn b/components/translate/ios/browser/BUILD.gn index 56027b4..1741f101 100644 --- a/components/translate/ios/browser/BUILD.gn +++ b/components/translate/ios/browser/BUILD.gn
@@ -78,12 +78,4 @@ "//ui/base", "//url", ] - - # TODO(crbug.com/1427365): Test currently fails on iOS blink. - if (is_ios && use_blink) { - sources -= [ - "js_translate_web_frame_manager_unittest.mm", - "translate_controller_unittest.mm", - ] - } }
diff --git a/components/ukm/ios/BUILD.gn b/components/ukm/ios/BUILD.gn index 867e63b..b6e980f 100644 --- a/components/ukm/ios/BUILD.gn +++ b/components/ukm/ios/BUILD.gn
@@ -47,9 +47,4 @@ "//services/metrics/public/cpp:metrics_cpp", "//testing/gtest", ] - - # TODO(crbug.com/1427365): Test currently fails on iOS blink. - if (is_ios && use_blink) { - sources -= [ "ukm_url_recorder_unittest.mm" ] - } }
diff --git a/components/unified_consent/consent_throttle.h b/components/unified_consent/consent_throttle.h index a822d48..97f4df1 100644 --- a/components/unified_consent/consent_throttle.h +++ b/components/unified_consent/consent_throttle.h
@@ -72,4 +72,4 @@ } // namespace unified_consent -#endif // CHROME_BROWSER_COMPONENTS_UNIFIED_CONSENT_CONSENT_THROTTLE_H_ +#endif // COMPONENTS_UNIFIED_CONSENT_CONSENT_THROTTLE_H_
diff --git a/components/url_formatter/spoof_checks/idna_metrics.h b/components/url_formatter/spoof_checks/idna_metrics.h index 7d18c6b..3da6ff7b 100644 --- a/components/url_formatter/spoof_checks/idna_metrics.h +++ b/components/url_formatter/spoof_checks/idna_metrics.h
@@ -16,4 +16,4 @@ kZeroWidthNonJoiner, }; -#endif +#endif // COMPONENTS_URL_FORMATTER_SPOOF_CHECKS_IDNA_METRICS_H_
diff --git a/components/user_education/views/help_bubble_delegate.h b/components/user_education/views/help_bubble_delegate.h index 1d2ae84..0c6cfb4 100644 --- a/components/user_education/views/help_bubble_delegate.h +++ b/components/user_education/views/help_bubble_delegate.h
@@ -49,4 +49,4 @@ } // namespace user_education -#endif // COMPONENTS_USER_EDUCATION_VIEWS_HELP_BUBBLE_FACTORY_DELEGATE_H_ \ No newline at end of file +#endif // COMPONENTS_USER_EDUCATION_VIEWS_HELP_BUBBLE_DELEGATE_H_
diff --git a/components/user_education/views/help_bubble_view.cc b/components/user_education/views/help_bubble_view.cc index c168167..7dcf6da 100644 --- a/components/user_education/views/help_bubble_view.cc +++ b/components/user_education/views/help_bubble_view.cc
@@ -122,7 +122,7 @@ PressedCallback callback, const std::u16string& text, bool is_default_button) - : MdTextButton(callback, text), + : MdTextButton(std::move(callback), text), delegate_(delegate), is_default_button_(is_default_button) { // Prominent style gives a button hover highlight. @@ -210,7 +210,7 @@ const std::u16string accessible_name, PressedCallback callback) : delegate_(delegate) { - SetCallback(callback); + SetCallback(std::move(callback)); views::ConfigureVectorImageButton(this); views::HighlightPathGenerator::Install( this,
diff --git a/components/user_education/views/help_bubble_views_test_util.h b/components/user_education/views/help_bubble_views_test_util.h index 97ec7fb2..a3bc61ae 100644 --- a/components/user_education/views/help_bubble_views_test_util.h +++ b/components/user_education/views/help_bubble_views_test_util.h
@@ -80,4 +80,4 @@ } // namespace user_education::test -#endif // COMPONENTS_USER_EDUCATION_VIEWS_HELP_BUBBLE_FACTORY_VIEWS_TEST_UTIL_H_ \ No newline at end of file +#endif // COMPONENTS_USER_EDUCATION_VIEWS_HELP_BUBBLE_VIEWS_TEST_UTIL_H_
diff --git a/components/variations/field_trial_config/field_trial_util_unittest.cc b/components/variations/field_trial_config/field_trial_util_unittest.cc index b2c6621..cb2d92852 100644 --- a/components/variations/field_trial_config/field_trial_util_unittest.cc +++ b/components/variations/field_trial_config/field_trial_util_unittest.cc
@@ -338,8 +338,8 @@ // Enable feature "A" and disable feature "B" as if they were enabled/disabled // using the |--enable-features| and |--disable-features| switches. base::FieldTrialList::CreateFieldTrial("Study", "Experiment"); - feature_list.InitializeFromCommandLine(/*enable_features=*/"A<Study", - /*disable_features=*/"B"); + feature_list.InitFromCommandLine(/*enable_features=*/"A<Study", + /*disable_features=*/"B"); // Associate the |kConfig| field trial config. AssociateParamsFromFieldTrialConfig(
diff --git a/components/variations/service/variations_field_trial_creator_base.cc b/components/variations/service/variations_field_trial_creator_base.cc index d6624ed..1bf8758 100644 --- a/components/variations/service/variations_field_trial_creator_base.cc +++ b/components/variations/service/variations_field_trial_creator_base.cc
@@ -261,11 +261,11 @@ switches::kForceDisableVariationIds)); } - feature_list->InitializeFromCommandLine( + feature_list->InitFromCommandLine( command_line->GetSwitchValueASCII(::switches::kEnableFeatures), command_line->GetSwitchValueASCII(::switches::kDisableFeatures)); - // This needs to happen here: After the InitializeFromCommandLine() call, + // This needs to happen here: After the InitFromCommandLine() call, // because the explicit cmdline --disable-features and --enable-features // should take precedence over these extra overrides. Before the call to // SetInstance(), because overrides cannot be registered after the FeatureList
diff --git a/components/variations/variations_seed_processor_unittest.cc b/components/variations/variations_seed_processor_unittest.cc index 9f8439336..94e5500e 100644 --- a/components/variations/variations_seed_processor_unittest.cc +++ b/components/variations/variations_seed_processor_unittest.cc
@@ -727,9 +727,8 @@ base_scoped_feature_list.Init(); std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->InitializeFromCommandLine( - test_case.enable_features_command_line, - test_case.disable_features_command_line); + feature_list->InitFromCommandLine(test_case.enable_features_command_line, + test_case.disable_features_command_line); VariationsSeed seed; Study* study = seed.add_study();
diff --git a/components/viz/demo/demo_main.cc b/components/viz/demo/demo_main.cc index 2d336ac..c587f54e 100644 --- a/components/viz/demo/demo_main.cc +++ b/components/viz/demo/demo_main.cc
@@ -217,7 +217,7 @@ #if BUILDFLAG(IS_OZONE) base::CommandLine command_line(argc, argv); auto feature_list = std::make_unique<base::FeatureList>(); - feature_list->InitializeFromCommandLine( + feature_list->InitFromCommandLine( command_line.GetSwitchValueASCII(switches::kEnableFeatures), command_line.GetSwitchValueASCII(switches::kDisableFeatures)); base::FeatureList::SetInstance(std::move(feature_list));
diff --git a/components/viz/service/debugger/viz_debugger_unittests/viz_debugger_unittest_base.h b/components/viz/service/debugger/viz_debugger_unittests/viz_debugger_unittest_base.h index 5c788c3..2985131 100644 --- a/components/viz/service/debugger/viz_debugger_unittests/viz_debugger_unittest_base.h +++ b/components/viz/service/debugger/viz_debugger_unittests/viz_debugger_unittest_base.h
@@ -94,4 +94,4 @@ } // namespace viz #endif // BUILDFLAG(USE_VIZ_DEBUGGER) -#endif +#endif // COMPONENTS_VIZ_SERVICE_DEBUGGER_VIZ_DEBUGGER_UNITTESTS_VIZ_DEBUGGER_UNITTEST_BASE_H_
diff --git a/components/webapps/browser/test/service_worker_registration_waiter.h b/components/webapps/browser/test/service_worker_registration_waiter.h index f876b9a5..710e69d8 100644 --- a/components/webapps/browser/test/service_worker_registration_waiter.h +++ b/components/webapps/browser/test/service_worker_registration_waiter.h
@@ -14,6 +14,7 @@ namespace content { class BrowserContext; class ServiceWorkerContext; +class StoragePartition; } // namespace content namespace web_app {
diff --git a/components/webauthn/core/browser/test_passkey_model.h b/components/webauthn/core/browser/test_passkey_model.h index a10dc8f..d9801cca 100644 --- a/components/webauthn/core/browser/test_passkey_model.h +++ b/components/webauthn/core/browser/test_passkey_model.h
@@ -53,4 +53,4 @@ } // namespace webauthn -#endif // COMPONENTS_WEBAUTHN_CORE_BROWSER__TEST_PASSKEY_MODEL_H_ +#endif // COMPONENTS_WEBAUTHN_CORE_BROWSER_TEST_PASSKEY_MODEL_H_
diff --git a/content/browser/attribution_reporting/aggregatable_attribution_utils.cc b/content/browser/attribution_reporting/aggregatable_attribution_utils.cc index 9eed72fc..b64eda12 100644 --- a/content/browser/attribution_reporting/aggregatable_attribution_utils.cc +++ b/content/browser/attribution_reporting/aggregatable_attribution_utils.cc
@@ -17,6 +17,7 @@ #include "base/strings/string_number_conversions.h" #include "base/time/time.h" #include "base/values.h" +#include "components/attribution_reporting/aggregatable_trigger_config.h" #include "components/attribution_reporting/aggregatable_trigger_data.h" #include "components/attribution_reporting/aggregatable_values.h" #include "components/attribution_reporting/aggregation_keys.h" @@ -162,7 +163,8 @@ base::Value::Dict additional_fields; std::string serialized_source_time; - switch (common_aggregatable_data->source_registration_time_config) { + switch (common_aggregatable_data->aggregatable_trigger_config + .source_registration_time_config()) { case attribution_reporting::mojom::SourceRegistrationTimeConfig::kInclude: serialized_source_time = SerializeTimeRoundedDownToWholeDayInSeconds(source_time);
diff --git a/content/browser/attribution_reporting/attribution_aggregatable_report_golden_unittest.cc b/content/browser/attribution_reporting/attribution_aggregatable_report_golden_unittest.cc index 04ce447..fb41bdb8 100644 --- a/content/browser/attribution_reporting/attribution_aggregatable_report_golden_unittest.cc +++ b/content/browser/attribution_reporting/attribution_aggregatable_report_golden_unittest.cc
@@ -453,6 +453,23 @@ .cleartext_payloads_file = "report_8_cleartext_payloads.json"}, {.report = ReportBuilder( + AttributionInfoBuilder().Build(), + SourceBuilder( + base::Time::FromMillisecondsSinceUnixEpoch(1234483200000)) + .BuildStored()) + .SetAggregatableHistogramContributions( + {AggregatableHistogramContribution(/*key=*/0, /*value=*/1)}) + .SetReportTime( + base::Time::FromMillisecondsSinceUnixEpoch(1234486400000)) + .SetSourceRegistrationTimeConfig( + attribution_reporting::mojom::SourceRegistrationTimeConfig:: + kExclude) + .SetTriggerContextId("example") + .BuildAggregatableAttribution(), + .report_file = "report_9.json", + .cleartext_payloads_file = "report_9_cleartext_payloads.json"}, + {.report = + ReportBuilder( AttributionInfoBuilder().SetDebugKey(456).Build(), SourceBuilder( base::Time::FromMillisecondsSinceUnixEpoch(1234483200000)) @@ -574,6 +591,24 @@ .BuildNullAggregatable(), .report_file = "report_gcp_8.json", .cleartext_payloads_file = "report_gcp_8_cleartext_payloads.json"}, + {.report = + ReportBuilder( + AttributionInfoBuilder().Build(), + SourceBuilder( + base::Time::FromMillisecondsSinceUnixEpoch(1234483200000)) + .BuildStored()) + .SetAggregatableHistogramContributions( + {AggregatableHistogramContribution(/*key=*/0, /*value=*/1)}) + .SetReportTime( + base::Time::FromMillisecondsSinceUnixEpoch(1234486400000)) + .SetSourceRegistrationTimeConfig( + attribution_reporting::mojom::SourceRegistrationTimeConfig:: + kExclude) + .SetTriggerContextId("example") + .SetAggregationCoordinatorOrigin(kGcpCoordinatorOrigin) + .BuildAggregatableAttribution(), + .report_file = "report_gcp_9.json", + .cleartext_payloads_file = "report_gcp_9_cleartext_payloads.json"}, }; for (auto& test_case : kTestCases) {
diff --git a/content/browser/attribution_reporting/attribution_internals_browsertest.cc b/content/browser/attribution_reporting/attribution_internals_browsertest.cc index c1c7a71..7580204 100644 --- a/content/browser/attribution_reporting/attribution_internals_browsertest.cc +++ b/content/browser/attribution_reporting/attribution_internals_browsertest.cc
@@ -17,12 +17,12 @@ #include "base/time/time.h" #include "base/uuid.h" #include "components/attribution_reporting/aggregatable_dedup_key.h" +#include "components/attribution_reporting/aggregatable_trigger_config.h" #include "components/attribution_reporting/aggregatable_trigger_data.h" #include "components/attribution_reporting/aggregatable_values.h" #include "components/attribution_reporting/aggregation_keys.h" #include "components/attribution_reporting/event_trigger_data.h" #include "components/attribution_reporting/filters.h" -#include "components/attribution_reporting/source_registration_time_config.mojom.h" #include "components/attribution_reporting/source_type.mojom.h" #include "components/attribution_reporting/suitable_origin.h" #include "components/attribution_reporting/trigger_registration.h" @@ -1202,8 +1202,7 @@ {{"a", 123}, {"b", 456}}), /*debug_reporting=*/false, /*aggregation_coordinator_origin=*/absl::nullopt, - attribution_reporting::mojom::SourceRegistrationTimeConfig:: - kInclude), + attribution_reporting::AggregatableTriggerConfig()), *SuitableOrigin::Deserialize("https://d.test"), std::move(verifications), /*is_within_fenced_frame=*/false);
diff --git a/content/browser/attribution_reporting/attribution_interop_unittest.cc b/content/browser/attribution_reporting/attribution_interop_unittest.cc index 2ca2316..40d0bf0 100644 --- a/content/browser/attribution_reporting/attribution_interop_unittest.cc +++ b/content/browser/attribution_reporting/attribution_interop_unittest.cc
@@ -115,11 +115,19 @@ AttributionConfig config = GetConfig(); base::Value::Dict dict = base::test::ParseJsonDictFromFile(GetParam()); - base::test::ScopedFeatureList scoped_feature_list; + std::vector<base::test::FeatureRef> enabled_features; if (dict.FindBool("needs_trigger_config").value_or(false)) { - scoped_feature_list.InitAndEnableFeature( + enabled_features.emplace_back( attribution_reporting::features::kAttributionReportingTriggerConfig); } + if (dict.FindBool("needs_trigger_context_id").value_or(false)) { + enabled_features.emplace_back( + attribution_reporting::features::kAttributionReportingTriggerContextId); + } + + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitWithFeatures(enabled_features, + /*disabled_features=*/{}); if (const base::Value* api_config = dict.Find("api_config")) { ASSERT_TRUE(api_config->is_dict());
diff --git a/content/browser/attribution_reporting/attribution_manager_impl.cc b/content/browser/attribution_reporting/attribution_manager_impl.cc index b1f519336..c0e14d0 100644 --- a/content/browser/attribution_reporting/attribution_manager_impl.cc +++ b/content/browser/attribution_reporting/attribution_manager_impl.cc
@@ -645,6 +645,7 @@ if (const auto* success_noised = absl::get_if<StoreSourceResult::SuccessNoised>(&result.result())) { scheduler_timer_->MaybeSet(success_noised->min_fake_report_time); + NotifyReportsChanged(); } NotifySourcesChanged();
diff --git a/content/browser/attribution_reporting/attribution_manager_impl_unittest.cc b/content/browser/attribution_reporting/attribution_manager_impl_unittest.cc index b934ab0..bb3a9cd 100644 --- a/content/browser/attribution_reporting/attribution_manager_impl_unittest.cc +++ b/content/browser/attribution_reporting/attribution_manager_impl_unittest.cc
@@ -2312,6 +2312,27 @@ task_environment_.FastForwardBy(kImpressionExpiry); } +// Regression test for https://crbug.com/1506245. +TEST_F(AttributionManagerImplFakeReportTest, FakeReport_NotifiesObservers) { + MockAttributionObserver observer; + base::ScopedObservation<AttributionManager, AttributionObserver> observation( + &observer); + observation.Observe(attribution_manager_.get()); + + Checkpoint checkpoint; + { + InSequence seq; + + EXPECT_CALL(observer, OnReportsChanged).Times(0); + EXPECT_CALL(checkpoint, Call(1)); + EXPECT_CALL(observer, OnReportsChanged); + } + + attribution_manager_->HandleSource(SourceBuilder().Build(), kFrameId); + checkpoint.Call(1); + task_environment_.FastForwardBy(base::TimeDelta()); +} + // Test that multiple source and trigger registrations, with and without debug // keys present, are handled in the order they are received by the manager. TEST_F(AttributionManagerImplTest, RegistrationsHandledInOrder) {
diff --git a/content/browser/attribution_reporting/attribution_report.cc b/content/browser/attribution_reporting/attribution_report.cc index c09faac..4afae70 100644 --- a/content/browser/attribution_reporting/attribution_report.cc +++ b/content/browser/attribution_reporting/attribution_report.cc
@@ -15,6 +15,7 @@ #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" #include "base/values.h" +#include "components/attribution_reporting/aggregatable_trigger_config.h" #include "components/attribution_reporting/source_type.h" #include "components/attribution_reporting/suitable_origin.h" #include "content/browser/attribution_reporting/common_source_info.h" @@ -49,6 +50,12 @@ dict.Set("trigger_debug_key", base::NumberToString(*trigger_debug_key)); } + if (const auto& trigger_context_id = + data.aggregatable_trigger_config.trigger_context_id(); + trigger_context_id.has_value()) { + dict.Set("trigger_context_id", *trigger_context_id); + } + return dict; } @@ -78,11 +85,11 @@ absl::optional<attribution_reporting::SuitableOrigin> aggregation_coordinator_origin, absl::optional<std::string> verification_token, - attribution_reporting::mojom::SourceRegistrationTimeConfig - source_registration_time_config) + attribution_reporting::AggregatableTriggerConfig + aggregatable_trigger_config) : aggregation_coordinator_origin(std::move(aggregation_coordinator_origin)), verification_token(std::move(verification_token)), - source_registration_time_config(source_registration_time_config) {} + aggregatable_trigger_config(std::move(aggregatable_trigger_config)) {} AttributionReport::CommonAggregatableData::CommonAggregatableData() = default;
diff --git a/content/browser/attribution_reporting/attribution_report.h b/content/browser/attribution_reporting/attribution_report.h index ce9a8ad..38d3f34 100644 --- a/content/browser/attribution_reporting/attribution_report.h +++ b/content/browser/attribution_reporting/attribution_report.h
@@ -15,7 +15,7 @@ #include "base/types/strong_alias.h" #include "base/uuid.h" #include "base/values.h" -#include "components/attribution_reporting/source_registration_time_config.mojom.h" +#include "components/attribution_reporting/aggregatable_trigger_config.h" #include "components/attribution_reporting/suitable_origin.h" #include "content/browser/aggregation_service/aggregatable_report.h" #include "content/browser/attribution_reporting/aggregatable_histogram_contribution.h" @@ -66,11 +66,10 @@ }; struct CONTENT_EXPORT CommonAggregatableData { - CommonAggregatableData( - absl::optional<attribution_reporting::SuitableOrigin> - aggregation_coordinator_origin, - absl::optional<std::string> verification_token, - attribution_reporting::mojom::SourceRegistrationTimeConfig); + CommonAggregatableData(absl::optional<attribution_reporting::SuitableOrigin> + aggregation_coordinator_origin, + absl::optional<std::string> verification_token, + attribution_reporting::AggregatableTriggerConfig); CommonAggregatableData(); CommonAggregatableData(const CommonAggregatableData&); CommonAggregatableData(CommonAggregatableData&&); @@ -96,9 +95,8 @@ // verification. absl::optional<std::string> verification_token; - attribution_reporting::mojom::SourceRegistrationTimeConfig - source_registration_time_config = attribution_reporting::mojom:: - SourceRegistrationTimeConfig::kInclude; + attribution_reporting::AggregatableTriggerConfig + aggregatable_trigger_config; // When adding new members, the corresponding `operator==()` definition in // `attribution_test_utils.h` should also be updated.
diff --git a/content/browser/attribution_reporting/attribution_report_unittest.cc b/content/browser/attribution_reporting/attribution_report_unittest.cc index 2b8f42fb..1d2a1dd 100644 --- a/content/browser/attribution_reporting/attribution_report_unittest.cc +++ b/content/browser/attribution_reporting/attribution_report_unittest.cc
@@ -276,11 +276,16 @@ "key_id": "key", "payload": "ABCD1234" }], - "shared_info":"example_shared_info" + "shared_info":"example_shared_info", + "trigger_context_id":"123" })json"); AttributionReport report = ReportBuilder(AttributionInfoBuilder().Build(), SourceBuilder().BuildStored()) + .SetSourceRegistrationTimeConfig( + attribution_reporting::mojom:: + SourceRegistrationTimeConfig::kExclude) + .SetTriggerContextId("123") .BuildNullAggregatable(); EXPECT_EQ(report.ReportURL(), GURL("https://report.test/.well-known/attribution-reporting/" @@ -301,5 +306,47 @@ EXPECT_THAT(report.ReportBody(), IsJson(expected)); } +TEST(AttributionReportTest, ReportBody_AggregatableAttributionReport) { + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitAndEnableFeatureWithParameters( + ::aggregation_service::kAggregationServiceMultipleCloudProviders, + {{"aws_cloud", "https://aws.example.test"}}); + + base::Value::Dict expected = base::test::ParseJsonDict(R"json({ + "aggregation_coordinator_origin": "https://aws.example.test", + "aggregation_service_payloads": [{ + "key_id": "key", + "payload": "ABCD1234" + }], + "shared_info": "example_shared_info", + "trigger_context_id": "123" + })json"); + + AttributionReport report = + ReportBuilder(AttributionInfoBuilder().Build(), + SourceBuilder().BuildStored()) + .SetSourceRegistrationTimeConfig( + attribution_reporting::mojom::SourceRegistrationTimeConfig:: + kExclude) + .SetTriggerContextId("123") + .SetAggregatableHistogramContributions( + {AggregatableHistogramContribution(/*key=*/1, /*value=*/2)}) + .BuildAggregatableAttribution(); + + auto& data = + absl::get<AttributionReport::AggregatableAttributionData>(report.data()); + data.common_data.assembled_report = + AggregatableReport({AggregatableReport::AggregationServicePayload( + /*payload=*/kABCD1234AsBytes, + /*key_id=*/"key", + /*debug_cleartext_payload=*/absl::nullopt)}, + "example_shared_info", + /*debug_key=*/absl::nullopt, + /*additional_fields=*/{}, + /*aggregation_coordinator_origin=*/absl::nullopt); + + EXPECT_THAT(report.ReportBody(), IsJson(expected)); +} + } // namespace } // namespace content
diff --git a/content/browser/attribution_reporting/attribution_reporting.proto b/content/browser/attribution_reporting/attribution_reporting.proto index 4ab7253..e649599 100644 --- a/content/browser/attribution_reporting/attribution_reporting.proto +++ b/content/browser/attribution_reporting/attribution_reporting.proto
@@ -61,6 +61,7 @@ optional string verification_token = 2; optional SourceRegistrationTimeConfig source_registration_time_config = 3; optional string coordinator_origin = 4; + optional string trigger_context_id = 5; reserved 1; reserved "coordinator";
diff --git a/content/browser/attribution_reporting/attribution_storage_delegate_impl.cc b/content/browser/attribution_reporting/attribution_storage_delegate_impl.cc index 141f818..ad3a82e 100644 --- a/content/browser/attribution_reporting/attribution_storage_delegate_impl.cc +++ b/content/browser/attribution_reporting/attribution_storage_delegate_impl.cc
@@ -12,11 +12,13 @@ #include <utility> #include <vector> +#include "base/check.h" #include "base/feature_list.h" #include "base/memory/ptr_util.h" #include "base/rand_util.h" #include "base/time/time.h" #include "base/uuid.h" +#include "components/attribution_reporting/aggregatable_trigger_config.h" #include "components/attribution_reporting/constants.h" #include "components/attribution_reporting/event_report_windows.h" #include "components/attribution_reporting/features.h" @@ -253,7 +255,13 @@ // See spec // https://wicg.github.io/attribution-reporting-api/#generate-null-reports. - switch (trigger.registration().source_registration_time_config) { + bool has_trigger_context_id = + trigger.registration() + .aggregatable_trigger_config.trigger_context_id() + .has_value(); + + switch (trigger.registration() + .aggregatable_trigger_config.source_registration_time_config()) { case attribution_reporting::mojom::SourceRegistrationTimeConfig::kInclude: { absl::optional<base::Time> rounded_attributed_source_time; if (attributed_source_time) { @@ -264,6 +272,8 @@ static_assert(attribution_reporting::kMaxSourceExpiry == base::Days(30), "update null reports rate"); + CHECK(!has_trigger_context_id); + return GetNullAggregatableReportsForLookback( trigger, trigger_time, rounded_attributed_source_time, /*days_lookback=*/ @@ -279,8 +289,10 @@ return GetNullAggregatableReportsForLookback( trigger, trigger_time, attributed_source_time, /*days_lookback=*/0, - config_.aggregate_limit - .null_reports_rate_exclude_source_registration_time); + has_trigger_context_id + ? 1. + : config_.aggregate_limit + .null_reports_rate_exclude_source_registration_time); } } }
diff --git a/content/browser/attribution_reporting/attribution_storage_delegate_impl_unittest.cc b/content/browser/attribution_reporting/attribution_storage_delegate_impl_unittest.cc index 6d38e46..8c41d5e 100644 --- a/content/browser/attribution_reporting/attribution_storage_delegate_impl_unittest.cc +++ b/content/browser/attribution_reporting/attribution_storage_delegate_impl_unittest.cc
@@ -36,6 +36,7 @@ using ::testing::IsEmpty; using ::testing::Le; using ::testing::Lt; +using ::testing::SizeIs; // This is more comprehensively tested in // //components/attribution_reporting/event_report_windows_unittest.cc. @@ -232,5 +233,25 @@ IsEmpty()); } +TEST(AttributionStorageDelegateImplTest, + NullAggregatableReports_WithTriggerContextId) { + const auto trigger = TriggerBuilder() + .SetSourceRegistrationTimeConfig( + attribution_reporting::mojom:: + SourceRegistrationTimeConfig::kExclude) + .SetTriggerContextId("123") + .Build(); + + EXPECT_THAT(AttributionStorageDelegateImpl().GetNullAggregatableReports( + trigger, /*trigger_time=*/base::Time::Now(), + /*attributed_source_time=*/absl::nullopt), + SizeIs(1u)); + + EXPECT_THAT(AttributionStorageDelegateImpl().GetNullAggregatableReports( + trigger, /*trigger_time=*/base::Time::Now(), + /*attributed_source_time=*/base::Time::Now() - base::Days(1)), + IsEmpty()); +} + } // namespace } // namespace content
diff --git a/content/browser/attribution_reporting/attribution_storage_sql.cc b/content/browser/attribution_reporting/attribution_storage_sql.cc index 7bf69325..56ce899 100644 --- a/content/browser/attribution_reporting/attribution_storage_sql.cc +++ b/content/browser/attribution_reporting/attribution_storage_sql.cc
@@ -36,6 +36,7 @@ #include "base/types/expected_macros.h" #include "base/uuid.h" #include "components/attribution_reporting/aggregatable_dedup_key.h" +#include "components/attribution_reporting/aggregatable_trigger_config.h" #include "components/attribution_reporting/aggregatable_trigger_data.h" #include "components/attribution_reporting/aggregation_keys.h" #include "components/attribution_reporting/constants.h" @@ -2822,7 +2823,7 @@ } base::Time report_time = - delegate_->GetAggregatableReportTime(attribution_info.time); + GetAggregatableReportTime(trigger, attribution_info.time); report = AttributionReport( attribution_info, AttributionReport::Id(kUnsetRecordId), report_time, @@ -2832,7 +2833,7 @@ AttributionReport::CommonAggregatableData( trigger_registration.aggregation_coordinator_origin, /*verification_token=*/absl::nullopt, - trigger_registration.source_registration_time_config), + trigger_registration.aggregatable_trigger_config), std::move(contributions), source)); return AggregatableResult::kSuccess; @@ -2966,7 +2967,7 @@ trigger, attribution_info.time, attributed_source_time); for (const auto& null_aggregatable_report : null_aggregatable_reports) { base::Time report_time = - delegate_->GetAggregatableReportTime(attribution_info.time); + GetAggregatableReportTime(trigger, attribution_info.time); min_null_aggregatable_report_time = AttributionReport::MinReportTime( min_null_aggregatable_report_time, report_time); reports.emplace_back( @@ -2977,7 +2978,7 @@ AttributionReport::CommonAggregatableData( trigger.registration().aggregation_coordinator_origin, /*verification_token=*/absl::nullopt, - trigger.registration().source_registration_time_config), + trigger.registration().aggregatable_trigger_config), trigger.reporting_origin(), null_aggregatable_report.fake_source_time)); } @@ -3049,6 +3050,17 @@ } } +base::Time AttributionStorageSql::GetAggregatableReportTime( + const AttributionTrigger& trigger, + base::Time trigger_time) const { + if (trigger.registration() + .aggregatable_trigger_config.trigger_context_id() + .has_value()) { + return trigger_time; + } + return delegate_->GetAggregatableReportTime(trigger_time); +} + std::set<AttributionDataModel::DataKey> AttributionStorageSql::GetAllDataKeys() { // We don't bother creating the DB here if it doesn't exist, because it's not
diff --git a/content/browser/attribution_reporting/attribution_storage_sql.h b/content/browser/attribution_reporting/attribution_storage_sql.h index 250ce52..bcf7d7f 100644 --- a/content/browser/attribution_reporting/attribution_storage_sql.h +++ b/content/browser/attribution_reporting/attribution_storage_sql.h
@@ -386,6 +386,10 @@ const AttributionTrigger&) VALID_CONTEXT_REQUIRED(sequence_checker_); + base::Time GetAggregatableReportTime(const AttributionTrigger&, + base::Time trigger_time) const + VALID_CONTEXT_REQUIRED(sequence_checker_); + // If set, database errors will not crash the client when run in debug mode. bool ignore_errors_for_testing_ = false;
diff --git a/content/browser/attribution_reporting/attribution_storage_sql_unittest.cc b/content/browser/attribution_reporting/attribution_storage_sql_unittest.cc index a9f539d..47bf02d 100644 --- a/content/browser/attribution_reporting/attribution_storage_sql_unittest.cc +++ b/content/browser/attribution_reporting/attribution_storage_sql_unittest.cc
@@ -116,6 +116,7 @@ proto::AttributionCommonAggregatableMetadata_SourceRegistrationTimeConfig> source_registration_time_config = proto::AttributionCommonAggregatableMetadata::INCLUDE; + absl::optional<std::string> trigger_context_id; }; struct AttributionNullAggregatableMetadataRecord { @@ -125,6 +126,7 @@ proto::AttributionCommonAggregatableMetadata_SourceRegistrationTimeConfig> source_registration_time_config = proto::AttributionCommonAggregatableMetadata::INCLUDE; + absl::optional<std::string> trigger_context_id; }; std::string CreateSerializedFilterData( @@ -190,6 +192,11 @@ *record.source_registration_time_config); } + if (record.trigger_context_id.has_value()) { + msg.mutable_common_data()->set_trigger_context_id( + *record.trigger_context_id); + } + std::string str; bool success = msg.SerializeToString(&str); CHECK(success); @@ -214,6 +221,11 @@ *record.source_registration_time_config); } + if (record.trigger_context_id.has_value()) { + msg.mutable_common_data()->set_trigger_context_id( + *record.trigger_context_id); + } + std::string str; bool success = msg.SerializeToString(&str); CHECK(success); @@ -1987,6 +1999,24 @@ }, .valid = false, }, + { + .desc = "invalid_trigger_context_id", + .record = + AttributionAggregatableMetadataRecord{ + .contributions = + { + AttributionAggregatableMetadataRecord::Contribution{ + .high_bits = 1, + .low_bits = 2, + .value = 3, + }, + }, + .source_registration_time_config = + proto::AttributionCommonAggregatableMetadata::INCLUDE, + .trigger_context_id = "123", + }, + .valid = false, + }, }; base::test::ScopedFeatureList scoped_feature_list( @@ -2088,6 +2118,17 @@ }, .valid = false, }, + { + .desc = "invalid_trigger_context_id", + .record = + AttributionNullAggregatableMetadataRecord{ + .fake_source_time = 12345678900, + .source_registration_time_config = + proto::AttributionCommonAggregatableMetadata::INCLUDE, + .trigger_context_id = "123", + }, + .valid = false, + }, }; base::test::ScopedFeatureList scoped_feature_list(
diff --git a/content/browser/attribution_reporting/attribution_storage_unittest.cc b/content/browser/attribution_reporting/attribution_storage_unittest.cc index 1c50d46..e468b5e 100644 --- a/content/browser/attribution_reporting/attribution_storage_unittest.cc +++ b/content/browser/attribution_reporting/attribution_storage_unittest.cc
@@ -10,6 +10,7 @@ #include <functional> #include <limits> #include <memory> +#include <string> #include <tuple> #include <utility> #include <vector> @@ -27,6 +28,7 @@ #include "base/time/time.h" #include "components/aggregation_service/features.h" #include "components/attribution_reporting/aggregatable_dedup_key.h" +#include "components/attribution_reporting/aggregatable_trigger_config.h" #include "components/attribution_reporting/aggregatable_trigger_data.h" #include "components/attribution_reporting/aggregatable_values.h" #include "components/attribution_reporting/aggregation_keys.h" @@ -2441,7 +2443,7 @@ /*event_triggers=*/{}, aggregatable_trigger_data, aggregatable_values, /*debug_reporting=*/false, /*aggregation_coordinator_origin=*/absl::nullopt, - attribution_reporting::mojom::SourceRegistrationTimeConfig::kInclude), + attribution_reporting::AggregatableTriggerConfig()), /*destination_origin=*/origin, /*verifications=*/{}, /*is_within_fenced_frame=*/false); @@ -2564,8 +2566,7 @@ aggregatable_values, /*debug_reporting=*/false, /*aggregation_coordinator_origin=*/absl::nullopt, - attribution_reporting::mojom::SourceRegistrationTimeConfig:: - kInclude), + attribution_reporting::AggregatableTriggerConfig()), /*destination_origin=*/origin, /*verifications=*/{}, /*is_within_fenced_frame=*/false); @@ -3302,8 +3303,7 @@ attribution_reporting::AggregatableValues(), /*debug_reporting=*/false, /*aggregation_coordinator_origin=*/absl::nullopt, - attribution_reporting::mojom::SourceRegistrationTimeConfig:: - kInclude), + attribution_reporting::AggregatableTriggerConfig()), /*destination_origin=*/origin, /*verifications=*/{}, /*is_within_fenced_frame=*/false))); @@ -3388,8 +3388,7 @@ attribution_reporting::AggregatableValues(), /*debug_reporting=*/false, /*aggregation_coordinator_origin=*/absl::nullopt, - attribution_reporting::mojom::SourceRegistrationTimeConfig:: - kInclude), + attribution_reporting::AggregatableTriggerConfig()), /*destination_origin=*/origin, /*verifications=*/{}, /*is_within_fenced_frame=*/false))); @@ -3443,7 +3442,7 @@ aggregatable_trigger_data, aggregatable_values, /*debug_reporting=*/false, /*aggregation_coordinator_origin=*/absl::nullopt, - attribution_reporting::mojom::SourceRegistrationTimeConfig::kInclude), + attribution_reporting::AggregatableTriggerConfig()), /*destination_origin=*/origin, /*verifications=*/{}, /*is_within_fenced_frame=*/false); @@ -3462,7 +3461,7 @@ aggregatable_trigger_data, aggregatable_values, /*debug_reporting=*/false, /*aggregation_coordinator_origin=*/absl::nullopt, - attribution_reporting::mojom::SourceRegistrationTimeConfig::kInclude), + attribution_reporting::AggregatableTriggerConfig()), /*destination_origin=*/origin, /*verifications=*/{}, /*is_within_fenced_frame=*/false); @@ -3477,7 +3476,7 @@ aggregatable_trigger_data, aggregatable_values, /*debug_reporting=*/false, /*aggregation_coordinator_origin=*/absl::nullopt, - attribution_reporting::mojom::SourceRegistrationTimeConfig::kInclude), + attribution_reporting::AggregatableTriggerConfig()), /*destination_origin=*/origin, /*verifications=*/{}, /*is_within_fenced_frame=*/false); @@ -3497,7 +3496,7 @@ aggregatable_trigger_data, aggregatable_values, /*debug_reporting=*/false, /*aggregation_coordinator_origin=*/absl::nullopt, - attribution_reporting::mojom::SourceRegistrationTimeConfig::kInclude), + attribution_reporting::AggregatableTriggerConfig()), /*destination_origin=*/origin, /*verifications=*/{}, /*is_within_fenced_frame=*/false); @@ -4021,4 +4020,59 @@ TriggerBuilder().SetDedupKey(11).Build())); } +TEST_F(AttributionStorageTest, + AttributionAggregatableReportWithTriggerContextId_RoundTrip) { + storage()->StoreSource(TestAggregatableSourceProvider().GetBuilder().Build()); + + base::Time report_time = base::Time::Now(); + + EXPECT_THAT(storage()->MaybeCreateAndStoreReport( + DefaultAggregatableTriggerBuilder() + .SetSourceRegistrationTimeConfig( + attribution_reporting::mojom:: + SourceRegistrationTimeConfig::kExclude) + .SetTriggerContextId("123") + .Build(/*generate_event_trigger_data=*/false)), + AllOf(CreateReportAggregatableStatusIs( + AttributionTrigger::AggregatableResult::kSuccess), + NewAggregatableReportIs(Optional(AllOf( + AggregatableAttributionDataIs( + TriggerContextIdIs(Optional(std::string("123")))), + ReportTimeIs(report_time)))))); + EXPECT_THAT( + storage()->GetAttributionReports(/*max_report_time=*/base::Time::Max()), + ElementsAre(AllOf(AggregatableAttributionDataIs( + TriggerContextIdIs(Optional(std::string("123")))), + ReportTimeIs(report_time)))); +} + +TEST_F(AttributionStorageTest, + NullAggregatableReportWithTriggerContextId_RoundTrip) { + base::Time now = base::Time::Now(); + base::Time source_time = now - base::Days(1); + base::Time report_time = now; + + delegate()->set_null_aggregatable_reports( + {AttributionStorageDelegate::NullAggregatableReport{ + .fake_source_time = source_time, + }}); + auto result = storage()->MaybeCreateAndStoreReport( + DefaultAggregatableTriggerBuilder() + .SetSourceRegistrationTimeConfig( + attribution_reporting::mojom::SourceRegistrationTimeConfig:: + kExclude) + .SetTriggerContextId("123") + .Build()); + delegate()->set_null_aggregatable_reports({}); + + ASSERT_TRUE(result.min_null_aggregatable_report_time().has_value()); + EXPECT_EQ(*result.min_null_aggregatable_report_time(), report_time); + + EXPECT_THAT( + storage()->GetAttributionReports(/*max_report_time=*/base::Time::Max()), + ElementsAre(AllOf(NullAggregatableDataIs( + TriggerContextIdIs(Optional(std::string("123")))), + ReportTimeIs(report_time)))); +} + } // namespace content
diff --git a/content/browser/attribution_reporting/attribution_test_utils.cc b/content/browser/attribution_reporting/attribution_test_utils.cc index 0d873cc..33cd50e 100644 --- a/content/browser/attribution_reporting/attribution_test_utils.cc +++ b/content/browser/attribution_reporting/attribution_test_utils.cc
@@ -15,6 +15,7 @@ #include "base/strings/string_number_conversions.h" #include "base/time/time.h" #include "components/attribution_reporting/aggregatable_dedup_key.h" +#include "components/attribution_reporting/aggregatable_trigger_config.h" #include "components/attribution_reporting/aggregatable_trigger_data.h" #include "components/attribution_reporting/destination_set.h" #include "components/attribution_reporting/event_report_windows.h" @@ -358,6 +359,12 @@ return *this; } +TriggerBuilder& TriggerBuilder::SetTriggerContextId( + std::string trigger_context_id) { + trigger_context_id_ = std::move(trigger_context_id); + return *this; +} + AttributionTrigger TriggerBuilder::Build( bool generate_event_trigger_data) const { std::vector<attribution_reporting::EventTriggerData> event_triggers; @@ -376,7 +383,9 @@ aggregatable_dedup_key_filter_pair_)}, std::move(event_triggers), aggregatable_trigger_data_, aggregatable_values_, debug_reporting_, - aggregation_coordinator_origin_, source_registration_time_config_), + aggregation_coordinator_origin_, + *attribution_reporting::AggregatableTriggerConfig::Create( + source_registration_time_config_, trigger_context_id_)), destination_origin_, verifications_, is_within_fenced_frame_); } @@ -460,6 +469,12 @@ return *this; } +ReportBuilder& ReportBuilder::SetTriggerContextId( + std::string trigger_context_id) { + trigger_context_id_ = std::move(trigger_context_id); + return *this; +} + AttributionReport ReportBuilder::Build() const { return AttributionReport( attribution_info_, report_id_, report_time_, @@ -476,7 +491,8 @@ AttributionReport::AggregatableAttributionData( AttributionReport::CommonAggregatableData( aggregation_coordinator_origin_, verification_token_, - source_registration_time_config_), + *attribution_reporting::AggregatableTriggerConfig::Create( + source_registration_time_config_, trigger_context_id_)), contributions_, source_)); } @@ -488,7 +504,8 @@ AttributionReport::NullAggregatableData( AttributionReport::CommonAggregatableData( aggregation_coordinator_origin_, verification_token_, - source_registration_time_config_), + *attribution_reporting::AggregatableTriggerConfig::Create( + source_registration_time_config_, trigger_context_id_)), source_.common_info().reporting_origin(), source_.source_time())); } @@ -525,7 +542,7 @@ const auto tie = [](const AttributionReport::CommonAggregatableData& data) { return std::make_tuple(data.verification_token, data.aggregation_coordinator_origin, - data.source_registration_time_config); + data.aggregatable_trigger_config); }; return tie(a) == tie(b); } @@ -730,8 +747,8 @@ out << "(null)"; } - return out << ",source_registration_time_config=" - << data.source_registration_time_config << "}"; + return out << ",aggregatable_trigger_config=" + << data.aggregatable_trigger_config << "}"; } std::ostream& operator<<(
diff --git a/content/browser/attribution_reporting/attribution_test_utils.h b/content/browser/attribution_reporting/attribution_test_utils.h index 05f8f320..3dfa635 100644 --- a/content/browser/attribution_reporting/attribution_test_utils.h +++ b/content/browser/attribution_reporting/attribution_test_utils.h
@@ -208,6 +208,8 @@ TriggerBuilder& SetFilterPair(attribution_reporting::FilterPair filter_pair); + TriggerBuilder& SetTriggerContextId(std::string trigger_context_id); + AttributionTrigger Build(bool generate_event_trigger_data = true) const; private: @@ -231,6 +233,7 @@ attribution_reporting::mojom::SourceRegistrationTimeConfig source_registration_time_config_ = attribution_reporting::mojom::SourceRegistrationTimeConfig::kInclude; + absl::optional<std::string> trigger_context_id_; }; // Helper class to construct an `AttributionInfo` for tests using default data. @@ -284,6 +287,8 @@ ReportBuilder& SetVerificationToken( absl::optional<std::string> verification_token); + ReportBuilder& SetTriggerContextId(std::string trigger_context_id); + AttributionReport Build() const; AttributionReport BuildAggregatableAttribution() const; @@ -306,6 +311,7 @@ attribution_reporting::mojom::SourceRegistrationTimeConfig source_registration_time_config_ = attribution_reporting::mojom::SourceRegistrationTimeConfig::kInclude; + absl::optional<std::string> trigger_context_id_; }; bool operator==(const StoredSource&, const StoredSource&); @@ -520,10 +526,17 @@ MATCHER_P(SourceRegistrationTimeConfigIs, matcher, "") { return ExplainMatchResult(matcher, - arg.common_data.source_registration_time_config, + arg.common_data.aggregatable_trigger_config + .source_registration_time_config(), result_listener); } +MATCHER_P(TriggerContextIdIs, matcher, "") { + return ExplainMatchResult( + matcher, arg.common_data.aggregatable_trigger_config.trigger_context_id(), + result_listener); +} + // `CreateReportResult` matchers MATCHER_P(CreateReportEventLevelStatusIs, matcher, "") {
diff --git a/content/browser/attribution_reporting/sql_utils.cc b/content/browser/attribution_reporting/sql_utils.cc index 459db2f..2bd970b 100644 --- a/content/browser/attribution_reporting/sql_utils.cc +++ b/content/browser/attribution_reporting/sql_utils.cc
@@ -14,6 +14,7 @@ #include "base/feature_list.h" #include "base/time/time.h" #include "components/aggregation_service/features.h" +#include "components/attribution_reporting/aggregatable_trigger_config.h" #include "components/attribution_reporting/aggregation_keys.h" #include "components/attribution_reporting/constants.h" #include "components/attribution_reporting/event_report_windows.h" @@ -59,7 +60,7 @@ msg.set_verification_token(*verification_token); } - switch (data.source_registration_time_config) { + switch (data.aggregatable_trigger_config.source_registration_time_config()) { case SourceRegistrationTimeConfig::kInclude: msg.set_source_registration_time_config( proto::AttributionCommonAggregatableMetadata::INCLUDE); @@ -69,6 +70,12 @@ proto::AttributionCommonAggregatableMetadata::EXCLUDE); break; } + + if (const auto& trigger_context_id = + data.aggregatable_trigger_config.trigger_context_id(); + trigger_context_id.has_value()) { + msg.set_trigger_context_id(*trigger_context_id); + } } [[nodiscard]] bool DeserializeCommonAggregatableData( @@ -91,14 +98,14 @@ std::move(aggregation_coordinator_origin); } + SourceRegistrationTimeConfig source_registration_time_config; + switch (msg.source_registration_time_config()) { case proto::AttributionCommonAggregatableMetadata::INCLUDE: - data.source_registration_time_config = - SourceRegistrationTimeConfig::kInclude; + source_registration_time_config = SourceRegistrationTimeConfig::kInclude; break; case proto::AttributionCommonAggregatableMetadata::EXCLUDE: - data.source_registration_time_config = - SourceRegistrationTimeConfig::kExclude; + source_registration_time_config = SourceRegistrationTimeConfig::kExclude; break; default: return false; @@ -108,6 +115,20 @@ data.verification_token = msg.verification_token(); } + absl::optional<std::string> trigger_context_id; + if (msg.has_trigger_context_id()) { + trigger_context_id = msg.trigger_context_id(); + } + + auto aggregatable_trigger_config = + attribution_reporting::AggregatableTriggerConfig::Create( + source_registration_time_config, trigger_context_id); + if (!aggregatable_trigger_config.has_value()) { + return false; + } + + data.aggregatable_trigger_config = std::move(*aggregatable_trigger_config); + return true; }
diff --git a/content/browser/child_process_security_policy_impl.h b/content/browser/child_process_security_policy_impl.h index c637acc2..da94e6bb 100644 --- a/content/browser/child_process_security_policy_impl.h +++ b/content/browser/child_process_security_policy_impl.h
@@ -99,14 +99,8 @@ bool CanReadFileSystemFile(const storage::FileSystemURL& url); // Returns true if the process is permitted to read and modify the data for - // the given `origin`. This is currently used to protect data such as - // cookies, passwords, and local storage. Does not affect cookies attached - // to or set by network requests. - // - // This can only return false for processes locked to a particular origin, - // which can happen for any origin when the --site-per-process flag is used, - // or for isolated origins that require a dedicated process (see - // AddFutureIsolatedOrigins and AddOriginIsolationStateForBrowsingInstance). + // the given `origin`. For more details, see + // ChildProcessSecurityPolicy::CanAccessDataForOrigin(). bool CanAccessDataForOrigin(const url::Origin& origin); // Returns the original `child_id` used to create the handle.
diff --git a/content/browser/content_index/content_index_service_impl.cc b/content/browser/content_index/content_index_service_impl.cc index 61125b54..34224773 100644 --- a/content/browser/content_index/content_index_service_impl.cc +++ b/content/browser/content_index/content_index_service_impl.cc
@@ -12,6 +12,7 @@ #include "content/browser/storage_partition_impl.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/service_worker_version_base_info.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h"
diff --git a/content/browser/devtools/protocol/service_worker_handler.cc b/content/browser/devtools/protocol/service_worker_handler.cc index 6996729ab..f84ff7b 100644 --- a/content/browser/devtools/protocol/service_worker_handler.cc +++ b/content/browser/devtools/protocol/service_worker_handler.cc
@@ -406,10 +406,9 @@ base::flat_set<std::string> client_set; for (const auto& client : version.clients) { - if (client.second.type() == - blink::mojom::ServiceWorkerClientType::kWindow) { + if (absl::holds_alternative<GlobalRenderFrameHostId>(client.second)) { WebContents* web_contents = WebContentsImpl::FromRenderFrameHostID( - client.second.GetRenderFrameHostId()); + absl::get<GlobalRenderFrameHostId>(client.second)); // There is a possibility that the frame is already deleted // because of the thread hopping. if (!web_contents)
diff --git a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc index b5f044d..e127908 100644 --- a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc +++ b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
@@ -306,7 +306,7 @@ file_system_access_context_->Clone( fsa_context.InitWithNewPipeAndPassReceiver()); - idb_context_ = base::MakeRefCounted<IndexedDBContextImpl>( + idb_context_ = std::make_unique<IndexedDBContextImpl>( temp_dir_.GetPath(), quota_manager_proxy_, std::move(blob_storage_context), std::move(fsa_context), base::SequencedTaskRunner::GetCurrentDefault(), @@ -454,7 +454,7 @@ std::unique_ptr<MockFileSystemAccessContext> file_system_access_context_; scoped_refptr<storage::MockQuotaManager> quota_manager_; scoped_refptr<storage::MockQuotaManagerProxy> quota_manager_proxy_; - scoped_refptr<IndexedDBContextImpl> idb_context_; + std::unique_ptr<IndexedDBContextImpl> idb_context_; std::unique_ptr<TestIDBFactory> idb_factory_; raw_ptr<PartitionedLockManager> lock_manager_ = nullptr;
diff --git a/content/browser/indexed_db/indexed_db_browsertest.cc b/content/browser/indexed_db/indexed_db_browsertest.cc index 4ac1a62..873054ce 100644 --- a/content/browser/indexed_db/indexed_db_browsertest.cc +++ b/content/browser/indexed_db/indexed_db_browsertest.cc
@@ -175,15 +175,19 @@ return partition->GetIndexedDBControl(); } - mojo::Remote<storage::mojom::IndexedDBControlTest> GetControlTest() { + mojo::Remote<storage::mojom::IndexedDBControlTest> GetControlTest( + Shell* browser = nullptr) { mojo::Remote<storage::mojom::IndexedDBControlTest> idb_control_test; - BindControlTest(idb_control_test.BindNewPipeAndPassReceiver()); + BindControlTest(browser, idb_control_test.BindNewPipeAndPassReceiver()); return idb_control_test; } void BindControlTest( + Shell* browser, mojo::PendingReceiver<storage::mojom::IndexedDBControlTest> receiver) { - auto* browser = shell(); + if (!browser) { + browser = shell(); + } StoragePartition* partition = browser->web_contents() ->GetBrowserContext() ->GetDefaultStoragePartition(); @@ -228,30 +232,17 @@ } int64_t RequestUsage(Shell* browser = nullptr) { - base::RunLoop loop; - int64_t size = 0; - auto& control = GetControl(browser); - control.GetUsage(base::BindLambdaForTesting( - [&](std::vector<storage::mojom::StorageUsageInfoPtr> usages) { - for (auto& usage : usages) - size += usage->total_size_bytes; - loop.Quit(); - })); - loop.Run(); - return size; + base::test::TestFuture<int64_t> future; + auto control = GetControlTest(browser); + control->GetUsageForTesting(future.GetCallback()); + return future.Take(); } int64_t RequestBlobFileCount(const storage::BucketLocator& bucket_locator) { - base::RunLoop loop; - int64_t count = 0; - auto control_test = GetControlTest(); - control_test->GetBlobCountForTesting( - bucket_locator, base::BindLambdaForTesting([&](int64_t returned_count) { - count = returned_count; - loop.Quit(); - })); - loop.Run(); - return count; + base::test::TestFuture<int64_t> future; + auto control = GetControlTest(); + control->GetBlobCountForTesting(bucket_locator, future.GetCallback()); + return future.Take(); } bool RequestSchemaDowngrade(const storage::BucketLocator& bucket_locator) { @@ -641,8 +632,6 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithVersion123456Schema, DestroyTest) { const GURL kTestUrl = GetTestUrl("indexeddb", "open_bad_db.html"); - const blink::StorageKey kTestStorageKey = - blink::StorageKey::CreateFirstParty(url::Origin::Create(kTestUrl)); int64_t original_size = RequestUsage(); EXPECT_GT(original_size, 0); SimpleTest(kTestUrl); @@ -659,8 +648,6 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithVersion987654SSVData, DestroyTest) { const GURL kTestUrl = GetTestUrl("indexeddb", "open_bad_db.html"); - const blink::StorageKey kTestStorageKey = - blink::StorageKey::CreateFirstParty(url::Origin::Create(kTestUrl)); int64_t original_size = RequestUsage(); EXPECT_GT(original_size, 0); SimpleTest(kTestUrl); @@ -677,8 +664,6 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithCorruptLevelDB, DestroyTest) { const GURL kTestUrl = GetTestUrl("indexeddb", "open_bad_db.html"); - const blink::StorageKey kTestStorageKey = - blink::StorageKey::CreateFirstParty(url::Origin::Create(kTestUrl)); int64_t original_size = RequestUsage(); EXPECT_GT(original_size, 0); SimpleTest(kTestUrl); @@ -695,8 +680,6 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithMissingSSTFile, DestroyTest) { const GURL kTestUrl = GetTestUrl("indexeddb", "open_missing_table.html"); - const blink::StorageKey kTestStorageKey = - blink::StorageKey::CreateFirstParty(url::Origin::Create(kTestUrl)); int64_t original_size = RequestUsage(); EXPECT_GT(original_size, 0); SimpleTest(kTestUrl); @@ -717,8 +700,6 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithCrbug899446, StableTest) { const GURL kTestUrl = GetTestUrl("indexeddb", "crbug899446.html"); - const blink::StorageKey kTestStorageKey = - blink::StorageKey::CreateFirstParty(url::Origin::Create(kTestUrl)); SimpleTest(kTestUrl); } @@ -729,8 +710,6 @@ IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithCrbug899446Noai, StableTest) { const GURL kTestUrl = GetTestUrl("indexeddb", "crbug899446_noai.html"); - const blink::StorageKey kTestStorageKey = - blink::StorageKey::CreateFirstParty(url::Origin::Create(kTestUrl)); SimpleTest(kTestUrl); } @@ -810,8 +789,8 @@ const blink::StorageKey kTestStorageKey = blink::StorageKey::CreateFirstParty(url::Origin::Create(test_url)); - Shell* browser = CreateOffTheRecordBrowser(); - NavigateToURLBlockUntilNavigationsComplete(browser, test_url, 2); + Shell* browser = nullptr; + SimpleTest(test_url, /*incognito=*/true, &browser); EXPECT_GT(RequestUsage(browser), 5 * 1024); @@ -910,7 +889,7 @@ mojo::Remote<storage::mojom::IndexedDBControlTest> control_test; task_runner->PostTask( FROM_HERE, base::BindOnce(&IndexedDBBrowserTest::BindControlTest, - base::Unretained(test), + base::Unretained(test), nullptr, control_test.BindNewPipeAndPassReceiver())); // TODO(enne): this is a nested message loop on the embedded test server's
diff --git a/content/browser/indexed_db/indexed_db_context_impl.cc b/content/browser/indexed_db/indexed_db_context_impl.cc index c517cac7..c8ac035e 100644 --- a/content/browser/indexed_db/indexed_db_context_impl.cc +++ b/content/browser/indexed_db/indexed_db_context_impl.cc
@@ -91,15 +91,6 @@ } // namespace -// static -void IndexedDBContextImpl::ReleaseOnIDBSequence( - scoped_refptr<IndexedDBContextImpl>&& context) { - if (!context->IDBTaskRunner()->RunsTasksInCurrentSequence()) { - IndexedDBContextImpl* context_ptr = context.get(); - context_ptr->IDBTaskRunner()->ReleaseSoon(FROM_HERE, std::move(context)); - } -} - IndexedDBContextImpl::IndexedDBContextImpl( const base::FilePath& base_data_path, scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy, @@ -166,14 +157,23 @@ } } -void IndexedDBContextImpl::Bind( +void IndexedDBContextImpl::BindControlOnIDBSequence( mojo::PendingReceiver<storage::mojom::IndexedDBControl> control) { + DCHECK(IDBTaskRunner()->RunsTasksInCurrentSequence()); // We cannot run this in the constructor it needs to be async, but the async // tasks might not finish before the destructor runs. InitializeFromFilesIfNeeded(base::DoNothing()); receivers_.Add(this, std::move(control)); } +void IndexedDBContextImpl::BindControl( + mojo::PendingReceiver<storage::mojom::IndexedDBControl> control) { + IDBTaskRunner()->PostTask( + FROM_HERE, + base::BindOnce(&IndexedDBContextImpl::BindControlOnIDBSequence, + weak_factory_.GetWeakPtr(), std::move(control))); +} + void IndexedDBContextImpl::BindIndexedDB( const storage::BucketLocator& bucket_locator, mojo::PendingRemote<storage::mojom::IndexedDBClientStateChecker> @@ -209,36 +209,6 @@ std::move(receiver)); } -void IndexedDBContextImpl::GetUsage(GetUsageCallback usage_callback) { - InitializeFromFilesIfNeeded( - base::BindOnce(&IndexedDBContextImpl::GetUsageImpl, - weak_factory_.GetWeakPtr(), std::move(usage_callback))); -} - -void IndexedDBContextImpl::GetUsageImpl(GetUsageCallback usage_callback) { - std::map<blink::StorageKey, storage::mojom::StorageUsageInfoPtr> usage_map; - for (const auto& bucket_locator : GetAllBuckets()) { - const auto& it = usage_map.find(bucket_locator.storage_key); - if (it != usage_map.end()) { - it->second->total_size_bytes += GetBucketDiskUsage(bucket_locator); - const auto& last_modified = GetBucketLastModified(bucket_locator); - if (it->second->last_modified < last_modified) { - it->second->last_modified = last_modified; - } - } else { - usage_map[bucket_locator.storage_key] = - storage::mojom::StorageUsageInfo::New( - bucket_locator.storage_key, GetBucketDiskUsage(bucket_locator), - GetBucketLastModified(bucket_locator)); - } - } - std::vector<storage::mojom::StorageUsageInfoPtr> result; - for (const auto& it : usage_map) { - result.emplace_back(it.second->Clone()); - } - std::move(usage_callback).Run(std::move(result)); -} - // Note - this is being kept async (instead of having a 'sync' version) to allow // ForceClose to become asynchronous. This is required for // https://crbug.com/965142. @@ -780,6 +750,15 @@ std::move(callback).Run(); } +void IndexedDBContextImpl::GetUsageForTesting( + GetUsageForTestingCallback callback) { + int64_t total_size = 0; + for (const storage::BucketLocator& bucket : bucket_set_) { + total_size += GetBucketDiskUsage(bucket); + } + std::move(callback).Run(total_size); +} + void IndexedDBContextImpl::BindMockFailureSingletonForTesting( mojo::PendingReceiver<storage::mojom::MockFailureInjector> receiver) { IndexedDBTransaction::DisableInactivityTimeoutForTesting(); // IN-TEST @@ -867,10 +846,9 @@ if (!LookUpBucket(bucket_locator.id)) return base::Time(); + // Only used by indexeddb-internals; not worth the complexity to implement. if (is_incognito()) { - if (!indexeddb_factory_) - return base::Time(); - return indexeddb_factory_->GetLastModified(bucket_locator); + return base::Time(); } base::FilePath idb_directory = GetLevelDBPath(bucket_locator); @@ -975,6 +953,7 @@ } void IndexedDBContextImpl::ShutdownOnIDBSequence() { + // `this` will be destroyed when this method returns. DCHECK(IDBTaskRunner()->RunsTasksInCurrentSequence()); if (force_keep_session_state_) @@ -1008,19 +987,25 @@ } } -void IndexedDBContextImpl::Shutdown() { +// static +void IndexedDBContextImpl::Shutdown( + std::unique_ptr<IndexedDBContextImpl> context) { + IndexedDBContextImpl* context_ptr = context.get(); + // Important: This function is NOT called on the IDB Task Runner. All variable // access must be thread-safe. - if (is_incognito()) + if (context->is_incognito()) { + context_ptr->IDBTaskRunner()->DeleteSoon(FROM_HERE, std::move(context)); return; + } - IDBTaskRunner()->PostTask( + context_ptr->IDBTaskRunner()->PostTask( FROM_HERE, base::BindOnce( &IndexedDBContextImpl::InitializeFromFilesIfNeeded, - weak_factory_.GetWeakPtr(), + base::Unretained(context_ptr), base::BindOnce(&IndexedDBContextImpl::ShutdownOnIDBSequence, - base::WrapRefCounted(this)))); + std::move(context)))); } base::FilePath IndexedDBContextImpl::GetBlobStorePath(
diff --git a/content/browser/indexed_db/indexed_db_context_impl.h b/content/browser/indexed_db/indexed_db_context_impl.h index 71b6a139..53f29b8b 100644 --- a/content/browser/indexed_db/indexed_db_context_impl.h +++ b/content/browser/indexed_db/indexed_db_context_impl.h
@@ -53,14 +53,9 @@ class IndexedDBQuotaClient; class CONTENT_EXPORT IndexedDBContextImpl - : public base::RefCountedThreadSafe<IndexedDBContextImpl>, - public storage::mojom::IndexedDBControl, + : public storage::mojom::IndexedDBControl, public storage::mojom::IndexedDBControlTest { public: - // Release `context` on the IDBTaskRunner. - static void ReleaseOnIDBSequence( - scoped_refptr<IndexedDBContextImpl>&& context); - // If `base_data_path` is empty, nothing will be saved to disk. // This is *not* called on the IDBTaskRunner, unlike most other functions. IndexedDBContextImpl( @@ -73,10 +68,16 @@ scoped_refptr<base::SequencedTaskRunner> io_task_runner, scoped_refptr<base::SequencedTaskRunner> custom_task_runner); + ~IndexedDBContextImpl() override; + + // Called to initiate shutdown. This is *not* called on the IDBTaskRunner. + static void Shutdown(std::unique_ptr<IndexedDBContextImpl> context); + IndexedDBContextImpl(const IndexedDBContextImpl&) = delete; IndexedDBContextImpl& operator=(const IndexedDBContextImpl&) = delete; - void Bind(mojo::PendingReceiver<storage::mojom::IndexedDBControl> control); + void BindControl( + mojo::PendingReceiver<storage::mojom::IndexedDBControl> control); // mojom::IndexedDBControl implementation: void BindIndexedDB( @@ -84,7 +85,6 @@ mojo::PendingRemote<storage::mojom::IndexedDBClientStateChecker> client_state_checker_remote, mojo::PendingReceiver<blink::mojom::IDBFactory> receiver) override; - void GetUsage(GetUsageCallback usage_callback) override; void DeleteForStorageKey(const blink::StorageKey& storage_key, DeleteForStorageKeyCallback callback) override; void ForceClose(storage::BucketId bucket_id, @@ -134,6 +134,7 @@ void CompactBackingStoreForTesting( const storage::BucketLocator& bucket_locator, base::OnceClosure callback) override; + void GetUsageForTesting(GetUsageForTestingCallback) override; void BindMockFailureSingletonForTesting( mojo::PendingReceiver<storage::mojom::MockFailureInjector> receiver) override; @@ -147,10 +148,6 @@ IndexedDBFactory* GetIDBFactory(); - // Called by StoragePartitionImpl to clear session-only data. - // *not* called on the IDBTaskRunner. - void Shutdown(); - int64_t GetBucketDiskUsage(const storage::BucketLocator& bucket_locator); const scoped_refptr<base::SequencedTaskRunner>& IDBTaskRunner() const { @@ -219,13 +216,13 @@ const storage::BucketLocator& bucket_locator) const; private: - friend class base::RefCountedThreadSafe<IndexedDBContextImpl>; friend class IndexedDBTest; friend class IndexedDBFactoryTest; class IndexedDBGetUsageAndQuotaCallback; - ~IndexedDBContextImpl() override; + void BindControlOnIDBSequence( + mojo::PendingReceiver<storage::mojom::IndexedDBControl> control); void BindPipesOnIDBSequence( mojo::PendingReceiver<storage::mojom::QuotaClient> @@ -241,7 +238,6 @@ client_state_checker_remote, mojo::PendingReceiver<blink::mojom::IDBFactory> receiver, storage::QuotaErrorOr<storage::BucketInfo> bucket_info); - void GetUsageImpl(GetUsageCallback usage_callback); void ForceCloseImpl( const storage::mojom::ForceCloseReason reason, base::OnceClosure closure, @@ -255,6 +251,7 @@ void DoDeleteBucketData(const storage::BucketLocator& bucket_locator, base::OnceCallback<void(bool)> callback); + // Always run immediately before destruction. void ShutdownOnIDBSequence(); const base::FilePath GetLegacyDataPath() const;
diff --git a/content/browser/indexed_db/indexed_db_context_unittest.cc b/content/browser/indexed_db/indexed_db_context_unittest.cc index aace6572..12c5f12 100644 --- a/content/browser/indexed_db/indexed_db_context_unittest.cc +++ b/content/browser/indexed_db/indexed_db_context_unittest.cc
@@ -68,7 +68,7 @@ quota_manager_proxy_ = base::MakeRefCounted<storage::MockQuotaManagerProxy>( quota_manager_.get(), base::SingleThreadTaskRunner::GetCurrentDefault()); - indexed_db_context_ = base::MakeRefCounted<IndexedDBContextImpl>( + indexed_db_context_ = std::make_unique<IndexedDBContextImpl>( temp_dir_.GetPath(), quota_manager_proxy_, /*blob_storage_context=*/mojo::NullRemote(), /*file_system_access_context=*/mojo::NullRemote(), @@ -85,7 +85,7 @@ // uses the thread pool for querying QuotaDatabase. base::test::TaskEnvironment task_environment_; - scoped_refptr<IndexedDBContextImpl> indexed_db_context_; + std::unique_ptr<IndexedDBContextImpl> indexed_db_context_; scoped_refptr<storage::MockQuotaManager> quota_manager_; scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_;
diff --git a/content/browser/indexed_db/indexed_db_control_wrapper.cc b/content/browser/indexed_db/indexed_db_control_wrapper.cc index 223eb64..0ec4bad0 100644 --- a/content/browser/indexed_db/indexed_db_control_wrapper.cc +++ b/content/browser/indexed_db/indexed_db_control_wrapper.cc
@@ -22,15 +22,16 @@ scoped_refptr<base::SequencedTaskRunner> io_task_runner, scoped_refptr<base::SequencedTaskRunner> custom_task_runner) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - context_ = base::MakeRefCounted<IndexedDBContextImpl>( + context_ = std::make_unique<IndexedDBContextImpl>( data_path, std::move(quota_manager_proxy), std::move(blob_storage_context), std::move(file_system_access_context), io_task_runner, std::move(custom_task_runner)); if (special_storage_policy) { storage_policy_observer_.emplace( - base::BindRepeating(&IndexedDBControlWrapper::ApplyPolicyUpdates, - weak_factory_.GetWeakPtr()), + base::BindRepeating( + &IndexedDBControlWrapper::OnSpecialStoragePolicyUpdated, + base::Unretained(this)), io_task_runner, std::move(special_storage_policy)); } } @@ -38,113 +39,42 @@ IndexedDBControlWrapper::~IndexedDBControlWrapper() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - context_->Shutdown(); - IndexedDBContextImpl::ReleaseOnIDBSequence(std::move(context_)); + IndexedDBContextImpl::Shutdown(std::move(context_)); } -void IndexedDBControlWrapper::BindIndexedDB( - const storage::BucketLocator& bucket_locator, - mojo::PendingRemote<storage::mojom::IndexedDBClientStateChecker> - client_state_checker_remote, - mojo::PendingReceiver<blink::mojom::IDBFactory> receiver) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - BindRemoteIfNeeded(); - if (storage_policy_observer_) { - // TODO(https://crbug.com/1199077): Pass the real StorageKey once - // StoragePolicyObserver is migrated. - storage_policy_observer_->StartTrackingOrigin( - bucket_locator.storage_key.origin()); - } - indexed_db_control_->BindIndexedDB(bucket_locator, - std::move(client_state_checker_remote), - std::move(receiver)); -} - -void IndexedDBControlWrapper::GetUsage(GetUsageCallback usage_callback) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - BindRemoteIfNeeded(); - indexed_db_control_->GetUsage(std::move(usage_callback)); -} - -void IndexedDBControlWrapper::DeleteForStorageKey( - const blink::StorageKey& storage_key, - DeleteForStorageKeyCallback callback) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - BindRemoteIfNeeded(); - indexed_db_control_->DeleteForStorageKey(storage_key, std::move(callback)); -} - -void IndexedDBControlWrapper::ForceClose( - storage::BucketId bucket_id, - storage::mojom::ForceCloseReason reason, - base::OnceClosure callback) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - BindRemoteIfNeeded(); - indexed_db_control_->ForceClose(bucket_id, reason, std::move(callback)); -} - -void IndexedDBControlWrapper::GetConnectionCount( - storage::BucketId bucket_id, - GetConnectionCountCallback callback) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - BindRemoteIfNeeded(); - indexed_db_control_->GetConnectionCount(bucket_id, std::move(callback)); -} - -void IndexedDBControlWrapper::DownloadBucketData( - storage::BucketId bucket_id, - DownloadBucketDataCallback callback) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - BindRemoteIfNeeded(); - indexed_db_control_->DownloadBucketData(bucket_id, std::move(callback)); -} - -void IndexedDBControlWrapper::GetAllBucketsDetails( - GetAllBucketsDetailsCallback callback) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - BindRemoteIfNeeded(); - indexed_db_control_->GetAllBucketsDetails(std::move(callback)); -} - -void IndexedDBControlWrapper::SetForceKeepSessionState() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - BindRemoteIfNeeded(); - indexed_db_control_->SetForceKeepSessionState(); -} - -void IndexedDBControlWrapper::ApplyPolicyUpdates( - std::vector<storage::mojom::StoragePolicyUpdatePtr> policy_updates) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - BindRemoteIfNeeded(); - indexed_db_control_->ApplyPolicyUpdates(std::move(policy_updates)); -} - -void IndexedDBControlWrapper::BindTestInterface( - mojo::PendingReceiver<storage::mojom::IndexedDBControlTest> receiver) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - BindRemoteIfNeeded(); - indexed_db_control_->BindTestInterface(std::move(receiver)); -} - -void IndexedDBControlWrapper::AddObserver( - mojo::PendingRemote<storage::mojom::IndexedDBObserver> observer) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - BindRemoteIfNeeded(); - indexed_db_control_->AddObserver(std::move(observer)); -} - -void IndexedDBControlWrapper::BindRemoteIfNeeded() { +storage::mojom::IndexedDBControl& +IndexedDBControlWrapper::GetIndexedDBControl() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK( !(indexed_db_control_.is_bound() && !indexed_db_control_.is_connected())) << "Rebinding is not supported yet."; - if (indexed_db_control_.is_bound()) - return; - context_->IDBTaskRunner()->PostTask( - FROM_HERE, - base::BindOnce(&IndexedDBContextImpl::Bind, context_, - indexed_db_control_.BindNewPipeAndPassReceiver())); + if (!indexed_db_control_.is_bound()) { + context_->BindControl(indexed_db_control_.BindNewPipeAndPassReceiver()); + + if (storage_policy_observer_) { + mojo::PendingRemote<storage::mojom::IndexedDBObserver> remote; + receiver_.Bind(remote.InitWithNewPipeAndPassReceiver()); + indexed_db_control_->AddObserver(std::move(remote)); + } + } + + return *indexed_db_control_; +} + +void IndexedDBControlWrapper::OnIndexedDBListChanged( + const storage::BucketLocator& bucket_locator) { + CHECK(storage_policy_observer_); + // TODO(https://crbug.com/1199077): Pass the real StorageKey once + // StoragePolicyObserver is migrated. + storage_policy_observer_->StartTrackingOrigin( + bucket_locator.storage_key.origin()); +} + +void IndexedDBControlWrapper::OnSpecialStoragePolicyUpdated( + std::vector<storage::mojom::StoragePolicyUpdatePtr> policy_updates) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + GetIndexedDBControl().ApplyPolicyUpdates(std::move(policy_updates)); } } // namespace content
diff --git a/content/browser/indexed_db/indexed_db_control_wrapper.h b/content/browser/indexed_db/indexed_db_control_wrapper.h index 45316e1..f2ad3ce 100644 --- a/content/browser/indexed_db/indexed_db_control_wrapper.h +++ b/content/browser/indexed_db/indexed_db_control_wrapper.h
@@ -12,20 +12,13 @@ #include "content/browser/indexed_db/indexed_db_context_impl.h" #include "storage/browser/quota/storage_policy_observer.h" -namespace blink { -class StorageKey; -} - namespace content { // This wrapper is created, destroyed, and operated on the UI thread in the -// browser process. It owns `IndexedDBContextImpl` and forwards all -// `IndexedDBControl` calls to that context. It observes the -// `special_storage_policy` and forwards policy updates to the context. In the -// theoretical world where IndexedDBContextImpl lives in a separate process, -// this class is necessary because `special_storage_policy` lives in the browser -// process. -class IndexedDBControlWrapper : public storage::mojom::IndexedDBControl { +// browser process. Its main purpose is to observe the `special_storage_policy` +// and forwards policy updates to the context, while also informing the policy +// when an origin is actively using IDB. +class IndexedDBControlWrapper : public storage::mojom::IndexedDBObserver { public: explicit IndexedDBControlWrapper( const base::FilePath& data_path, @@ -43,42 +36,32 @@ ~IndexedDBControlWrapper() override; - // mojom::IndexedDBControl implementation: - void BindIndexedDB( + // Returns the mojom interface to the `IndexedDBContextImpl`, creating the + // context if it does not already exist. + storage::mojom::IndexedDBControl& GetIndexedDBControl(); + + // mojom::IndexedDBObserver: + void OnIndexedDBListChanged( + const storage::BucketLocator& bucket_locator) override; + void OnIndexedDBContentChanged( const storage::BucketLocator& bucket_locator, - mojo::PendingRemote<storage::mojom::IndexedDBClientStateChecker> - client_state_checker_remote, - mojo::PendingReceiver<blink::mojom::IDBFactory> receiver) override; - void GetUsage(GetUsageCallback usage_callback) override; - void DeleteForStorageKey(const blink::StorageKey& storage_key, - DeleteForStorageKeyCallback callback) override; - void ForceClose(storage::BucketId bucket_id, - storage::mojom::ForceCloseReason reason, - base::OnceClosure callback) override; - void GetConnectionCount(storage::BucketId bucket_id, - GetConnectionCountCallback callback) override; - void DownloadBucketData(storage::BucketId bucket_id, - DownloadBucketDataCallback callback) override; - void GetAllBucketsDetails(GetAllBucketsDetailsCallback callback) override; - void SetForceKeepSessionState() override; - void ApplyPolicyUpdates(std::vector<storage::mojom::StoragePolicyUpdatePtr> - policy_updates) override; - void BindTestInterface( - mojo::PendingReceiver<storage::mojom::IndexedDBControlTest> receiver) - override; - void AddObserver( - mojo::PendingRemote<storage::mojom::IndexedDBObserver> observer) override; + const std::u16string& database_name, + const std::u16string& object_store_name) override {} private: - void BindRemoteIfNeeded(); + void OnSpecialStoragePolicyUpdated( + std::vector<storage::mojom::StoragePolicyUpdatePtr> policy_updates); absl::optional<storage::StoragePolicyObserver> storage_policy_observer_; mojo::Remote<storage::mojom::IndexedDBControl> indexed_db_control_; - scoped_refptr<IndexedDBContextImpl> context_; + std::unique_ptr<IndexedDBContextImpl> context_; + + // Used to observe `context_`. Note that `this` only observes `context_` if + // `storage_policy_observer_` exists. + mojo::Receiver<storage::mojom::IndexedDBObserver> receiver_{this}; SEQUENCE_CHECKER(sequence_checker_); - base::WeakPtrFactory<IndexedDBControlWrapper> weak_factory_{this}; }; } // namespace content
diff --git a/content/browser/indexed_db/indexed_db_database_unittest.cc b/content/browser/indexed_db/indexed_db_database_unittest.cc index 6e144406..5911dba6 100644 --- a/content/browser/indexed_db/indexed_db_database_unittest.cc +++ b/content/browser/indexed_db/indexed_db_database_unittest.cc
@@ -69,7 +69,7 @@ quota_manager_.get(), base::SingleThreadTaskRunner::GetCurrentDefault().get()); - indexed_db_context_ = base::MakeRefCounted<IndexedDBContextImpl>( + indexed_db_context_ = std::make_unique<IndexedDBContextImpl>( temp_dir_.GetPath(), quota_manager_proxy_, /*blob_storage_context=*/mojo::NullRemote(), /*file_system_access_context=*/mojo::NullRemote(), @@ -120,7 +120,7 @@ base::test::TaskEnvironment task_environment_; base::ScopedTempDir temp_dir_; - scoped_refptr<IndexedDBContextImpl> indexed_db_context_; + std::unique_ptr<IndexedDBContextImpl> indexed_db_context_; std::unique_ptr<IndexedDBBucketContext> bucket_context_; scoped_refptr<storage::MockQuotaManager> quota_manager_; scoped_refptr<storage::MockQuotaManagerProxy> quota_manager_proxy_;
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc b/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc index 8e78eea..cfbb731 100644 --- a/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc +++ b/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc
@@ -188,7 +188,7 @@ CreateAndReturnTempDir(&temp_dir_), task_environment_.GetMainThreadTaskRunner(), special_storage_policy_)), - context_impl_(base::MakeRefCounted<IndexedDBContextImpl>( + context_impl_(std::make_unique<IndexedDBContextImpl>( temp_dir_.GetPath(), quota_manager_->proxy(), mojo::NullRemote(), @@ -227,11 +227,11 @@ loop.Run(); } - // IndexedDBContextImpl must be released on the IDB sequence. + // IndexedDBContextImpl must be destroyed on the IDB sequence. { scoped_refptr<base::SequencedTaskRunner> idb_task_runner = context_impl_->IDBTaskRunner(); - context_impl_->ReleaseOnIDBSequence(std::move(context_impl_)); + IndexedDBContextImpl::Shutdown(std::move(context_impl_)); base::RunLoop loop; idb_task_runner->PostTask(FROM_HERE, loop.QuitClosure()); loop.Run(); @@ -248,7 +248,7 @@ base::ScopedTempDir temp_dir_; scoped_refptr<storage::MockSpecialStoragePolicy> special_storage_policy_; scoped_refptr<storage::MockQuotaManager> quota_manager_; - scoped_refptr<IndexedDBContextImpl> context_impl_; + std::unique_ptr<IndexedDBContextImpl> context_impl_; mojo::Remote<blink::mojom::IDBFactory> idb_mojo_factory_; };
diff --git a/content/browser/indexed_db/indexed_db_factory.cc b/content/browser/indexed_db/indexed_db_factory.cc index df2dad5d..a6fe41d 100644 --- a/content/browser/indexed_db/indexed_db_factory.cc +++ b/content/browser/indexed_db/indexed_db_factory.cc
@@ -606,17 +606,6 @@ return backing_store->GetInMemoryBlobSize() + level_db_size; } -base::Time IndexedDBFactory::GetLastModified( - const storage::BucketLocator& bucket_locator) const { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - auto it = bucket_contexts_.find(bucket_locator.id); - if (it == bucket_contexts_.end()) { - return base::Time(); - } - IndexedDBBackingStore* backing_store = it->second->backing_store(); - return backing_store->db()->LastModified(); -} - std::vector<storage::BucketId> IndexedDBFactory::GetOpenBucketIdsForTesting() const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/content/browser/indexed_db/indexed_db_factory.h b/content/browser/indexed_db/indexed_db_factory.h index 93e9d9d3c..9f219f4 100644 --- a/content/browser/indexed_db/indexed_db_factory.h +++ b/content/browser/indexed_db/indexed_db_factory.h
@@ -116,9 +116,6 @@ // For usage reporting. int64_t GetInMemoryDBSize(const storage::BucketLocator& bucket_locator) const; - base::Time GetLastModified( - const storage::BucketLocator& bucket_locator) const; - std::vector<storage::BucketId> GetOpenBucketIdsForTesting() const; IndexedDBBucketContext* GetBucketContextForTesting(
diff --git a/content/browser/indexed_db/indexed_db_factory_unittest.cc b/content/browser/indexed_db/indexed_db_factory_unittest.cc index d4e54be..5affcf3 100644 --- a/content/browser/indexed_db/indexed_db_factory_unittest.cc +++ b/content/browser/indexed_db/indexed_db_factory_unittest.cc
@@ -120,7 +120,7 @@ } void SetUpContext() { - context_ = base::MakeRefCounted<IndexedDBContextImpl>( + context_ = std::make_unique<IndexedDBContextImpl>( temp_dir_.GetPath(), quota_manager_proxy_.get(), /*blob_storage_context=*/mojo::NullRemote(), /*file_system_access_context=*/mojo::NullRemote(), @@ -129,7 +129,7 @@ } void SetUpInMemoryContext() { - context_ = base::MakeRefCounted<IndexedDBContextImpl>( + context_ = std::make_unique<IndexedDBContextImpl>( base::FilePath(), quota_manager_proxy_.get(), /*blob_storage_context=*/mojo::NullRemote(), /*file_system_access_context=*/mojo::NullRemote(), @@ -181,7 +181,7 @@ scoped_refptr<storage::MockSpecialStoragePolicy> quota_policy_; scoped_refptr<storage::MockQuotaManager> quota_manager_; scoped_refptr<storage::MockQuotaManagerProxy> quota_manager_proxy_; - scoped_refptr<IndexedDBContextImpl> context_; + std::unique_ptr<IndexedDBContextImpl> context_; std::unique_ptr<MockIndexedDBFactoryClient> mock_factory_client_; }; @@ -303,45 +303,17 @@ EXPECT_TRUE(bucket_context5_handle.IsHeld()) << s.ToString(); EXPECT_TRUE(s.ok()) << s.ToString(); - base::test::TestFuture<std::vector<storage::mojom::StorageUsageInfoPtr>> - infos_future; - context()->GetUsage(infos_future.GetCallback()); - auto infos = infos_future.Take(); - int64_t bucket_size_1 = base::ComputeDirectorySize(file_1.DirName()); - int64_t bucket_size_2 = base::ComputeDirectorySize(file_2.DirName()); - int64_t bucket_size_3 = base::ComputeDirectorySize(file_3.DirName()); int64_t bucket_size_4 = base::ComputeDirectorySize(file_4.DirName()); int64_t bucket_size_5 = base::ComputeDirectorySize(file_5.DirName()); - // Buckets 1, 4, and 5 merge if partitioning is on. If partitioning is off - // buckets 1 and 5 merge. - EXPECT_EQ(IsThirdPartyStoragePartitioningEnabled() ? 4ul : 3ul, infos.size()); - for (const auto& info : infos) { - if (info->storage_key == bucket_locator_1.storage_key) { - // This is the size of the 10 and 10000 character files (buckets 1 and 4). - if (IsThirdPartyStoragePartitioningEnabled()) { - // If third party storage partitioning is on, additional space is taken - // by supporting files for the independent buckets. - EXPECT_NE(bucket_size_1, bucket_size_4); - } else { - EXPECT_NE(bucket_size_1, bucket_size_5); - } - EXPECT_NE(bucket_size_1, bucket_size_5); - EXPECT_EQ(info->total_size_bytes, bucket_size_1 + bucket_size_5); - } else if (info->storage_key == bucket_locator_2.storage_key) { - // This is the size of the 100 character file (bucket 2). - EXPECT_EQ(info->total_size_bytes, bucket_size_2); - } else if (info->storage_key == bucket_locator_3.storage_key) { - // This is the size of the 1000 character file (bucket 3). - EXPECT_EQ(info->total_size_bytes, bucket_size_3); - } else if (info->storage_key == bucket_locator_4.storage_key) { - // This is the size of the 1000 character file (bucket 4). - EXPECT_EQ(info->total_size_bytes, bucket_size_4); - } else { - NOTREACHED(); - } + if (IsThirdPartyStoragePartitioningEnabled()) { + // If third party storage partitioning is on, additional space is taken + // by supporting files for the independent buckets. + EXPECT_NE(bucket_size_1, bucket_size_4); } + EXPECT_NE(bucket_size_1, bucket_size_5); + if (IsThirdPartyStoragePartitioningEnabled()) { EXPECT_EQ(5ul, factory()->GetOpenBucketIdsForTesting().size()); } else {
diff --git a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc index 1f66d12..7958132 100644 --- a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc +++ b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc
@@ -80,7 +80,7 @@ base::SingleThreadTaskRunner::GetCurrentDefault(), special_storage_policy_); - idb_context_ = base::MakeRefCounted<IndexedDBContextImpl>( + idb_context_ = std::make_unique<IndexedDBContextImpl>( temp_dir_.GetPath(), quota_manager_->proxy(), /*blob_storage_context=*/mojo::NullRemote(), /*file_system_access_context=*/mojo::NullRemote(), @@ -211,7 +211,7 @@ base::test::TaskEnvironment task_environment_; base::ScopedTempDir temp_dir_; - scoped_refptr<IndexedDBContextImpl> idb_context_; + std::unique_ptr<IndexedDBContextImpl> idb_context_; scoped_refptr<storage::MockQuotaManager> quota_manager_; base::WeakPtrFactory<IndexedDBQuotaClientTest> weak_factory_{this}; }; @@ -491,7 +491,7 @@ /*in_memory=*/true, base::FilePath(), base::SingleThreadTaskRunner::GetCurrentDefault(), special_storage_policy_); - auto incognito_idb_context = base::MakeRefCounted<IndexedDBContextImpl>( + auto incognito_idb_context = std::make_unique<IndexedDBContextImpl>( base::FilePath(), quota_manager->proxy(), /*blob_storage_context=*/mojo::NullRemote(), /*file_system_access_context=*/mojo::NullRemote(), @@ -518,7 +518,7 @@ /*in_memory=*/true, base::FilePath(), base::SingleThreadTaskRunner::GetCurrentDefault(), special_storage_policy_); - auto incognito_idb_context = base::MakeRefCounted<IndexedDBContextImpl>( + auto incognito_idb_context = std::make_unique<IndexedDBContextImpl>( base::FilePath(), quota_manager->proxy(), /*blob_storage_context=*/mojo::NullRemote(), /*file_system_access_context=*/mojo::NullRemote(),
diff --git a/content/browser/indexed_db/indexed_db_transaction_unittest.cc b/content/browser/indexed_db/indexed_db_transaction_unittest.cc index cd8815e..54fdaec 100644 --- a/content/browser/indexed_db/indexed_db_transaction_unittest.cc +++ b/content/browser/indexed_db/indexed_db_transaction_unittest.cc
@@ -68,7 +68,7 @@ /*is_incognito=*/false, temp_dir_.GetPath(), base::SingleThreadTaskRunner::GetCurrentDefault(), /*special_storage_policy=*/nullptr); - indexed_db_context_ = base::MakeRefCounted<IndexedDBContextImpl>( + indexed_db_context_ = std::make_unique<IndexedDBContextImpl>( temp_dir_.GetPath(), quota_manager_->proxy(), /*blob_storage_context=*/mojo::NullRemote(), /*file_system_access_context=*/mojo::NullRemote(), @@ -136,7 +136,7 @@ std::unique_ptr<base::test::TaskEnvironment> task_environment_; std::unique_ptr<IndexedDBBucketContext> bucket_context_; raw_ptr<IndexedDBDatabase> db_; - scoped_refptr<IndexedDBContextImpl> indexed_db_context_; + std::unique_ptr<IndexedDBContextImpl> indexed_db_context_; scoped_refptr<storage::MockQuotaManager> quota_manager_; bool error_called_ = false;
diff --git a/content/browser/indexed_db/indexed_db_unittest.cc b/content/browser/indexed_db/indexed_db_unittest.cc index 6ca4e4b..6acd046 100644 --- a/content/browser/indexed_db/indexed_db_unittest.cc +++ b/content/browser/indexed_db/indexed_db_unittest.cc
@@ -131,7 +131,7 @@ base::MakeRefCounted<storage::MockQuotaManagerProxy>( quota_manager_.get(), base::SequencedTaskRunner::GetCurrentDefault())), - context_(base::MakeRefCounted<IndexedDBContextImpl>( + context_(std::make_unique<IndexedDBContextImpl>( temp_dir_.GetPath(), quota_manager_proxy_.get(), /*blob_storage_context=*/mojo::NullRemote(), @@ -353,7 +353,7 @@ scoped_refptr<storage::MockSpecialStoragePolicy> special_storage_policy_; scoped_refptr<storage::MockQuotaManager> quota_manager_; scoped_refptr<storage::MockQuotaManagerProxy> quota_manager_proxy_; - scoped_refptr<IndexedDBContextImpl> context_; + std::unique_ptr<IndexedDBContextImpl> context_; mojo::Remote<blink::mojom::IDBFactory> factory_remote_; }; @@ -428,7 +428,7 @@ context()->ForceInitializeFromFilesForTesting(run_loop.QuitClosure()); run_loop.Run(); - context()->Shutdown(); + IndexedDBContextImpl::Shutdown(std::move(context_)); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(base::DirectoryExists(normal_path_first_party)); @@ -485,7 +485,7 @@ context()->ForceInitializeFromFilesForTesting(base::DoNothing()); base::RunLoop().RunUntilIdle(); - context()->Shutdown(); + IndexedDBContextImpl::Shutdown(std::move(context_)); base::RunLoop().RunUntilIdle(); // No data was cleared because of SetForceKeepSessionState.
diff --git a/content/browser/interest_group/interest_group_browsertest.cc b/content/browser/interest_group/interest_group_browsertest.cc index fe73b6e..ab47ca68 100644 --- a/content/browser/interest_group/interest_group_browsertest.cc +++ b/content/browser/interest_group/interest_group_browsertest.cc
@@ -696,7 +696,8 @@ blink::features::kFencedFramesM120FeaturesPart1, features::kBackForwardCache, features::kFledgeUseInterestGroupCache}, /*disabled_features=*/ - {blink::features::kFencedFrames}); + {blink::features::kFencedFrames, + blink::features::kFledgeEnforceKAnonymity}); } ~InterestGroupBrowserTest() override { content_browser_client_.reset(); }
diff --git a/content/browser/media/capture/content_capture_device_browsertest_base.cc b/content/browser/media/capture/content_capture_device_browsertest_base.cc index 622de68..9735535 100644 --- a/content/browser/media/capture/content_capture_device_browsertest_base.cc +++ b/content/browser/media/capture/content_capture_device_browsertest_base.cc
@@ -79,9 +79,7 @@ media::VideoCaptureParams ContentCaptureDeviceBrowserTestBase::SnapshotCaptureParams() { - // TODO(crbug.com/1504337): Test with capture sizes greater than the content - // size to exercise HiDPI. - constexpr gfx::Size kMaxCaptureSize = gfx::Size(200, 200); + constexpr gfx::Size kMaxCaptureSize = gfx::Size(320, 320); constexpr int kMaxFramesPerSecond = 60; gfx::Size capture_size = kMaxCaptureSize;
diff --git a/content/browser/media/capture/web_contents_frame_tracker.cc b/content/browser/media/capture/web_contents_frame_tracker.cc index 7cda83a7..49448c7 100644 --- a/content/browser/media/capture/web_contents_frame_tracker.cc +++ b/content/browser/media/capture/web_contents_frame_tracker.cc
@@ -195,7 +195,8 @@ TRACE_EVENT_INSTANT1( "gpu.capture", "WebContentsFrameTracker::SetCapturedContentSize", TRACE_EVENT_SCOPE_THREAD, "content_size", content_size.ToString()); - if (is_high_dpi_enabled_) { + if (base::FeatureList::IsEnabled(media::kWebContentsCaptureHiDpi) && + is_high_dpi_enabled_) { // Now that we have a new content size, reset some related values. content_size_ = content_size; max_capture_scale_override_ = kMaxCaptureScaleOverride; @@ -262,7 +263,7 @@ preferred_size, static_cast<float>(1 / scale_ratio)); } - DVLOG(1) << __func__ << ": x_ratio=" << x_ratio << " y_ratio=" << y_ratio + DVLOG(3) << __func__ << ": x_ratio=" << x_ratio << " y_ratio=" << y_ratio << " scale_ratio=" << scale_ratio << " preferred_size=" << preferred_size.ToString(); } @@ -331,7 +332,8 @@ std::clamp(std::round(largest_factor * 4) / 4, kMinCaptureScaleOverride, kMaxCaptureScaleOverride); - DVLOG(1) << __func__ << ":" << " capture_size_=" << capture_size_.ToString() + DVLOG(3) << __func__ << ":" + << " capture_size_=" << capture_size_.ToString() << ", letterbox_size=" << letterbox_size.ToString() << ", current_content_size=" << current_content_size.ToString() << ", unscaled_current_content_size="
diff --git a/content/browser/media/capture/web_contents_frame_tracker_unittest.cc b/content/browser/media/capture/web_contents_frame_tracker_unittest.cc index 9a3c2548..ccc83e3 100644 --- a/content/browser/media/capture/web_contents_frame_tracker_unittest.cc +++ b/content/browser/media/capture/web_contents_frame_tracker_unittest.cc
@@ -8,6 +8,7 @@ #include "base/memory/weak_ptr.h" #include "base/task/sequenced_task_runner.h" #include "base/task/single_thread_task_runner.h" +#include "base/test/scoped_feature_list.h" #include "build/build_config.h" #include "content/browser/media/capture/mouse_cursor_overlay_controller.h" #include "content/browser/media/capture/web_contents_video_capture_device.h" @@ -17,6 +18,7 @@ #include "content/public/test/test_utils.h" #include "content/test/test_render_view_host.h" #include "content/test/test_web_contents.h" +#include "media/base/media_switches.h" #include "media/capture/mojom/video_capture_types.mojom.h" #include "media/capture/video/video_capture_feedback.h" #include "testing/gmock/include/gmock/gmock.h" @@ -387,6 +389,9 @@ } TEST_F(WebContentsFrameTrackerTest, SetsScaleOverride) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature(media::kWebContentsCaptureHiDpi); + StartTrackerOnUIThread(kSize1080p); RunAllTasksUntilIdle(); @@ -444,6 +449,9 @@ } TEST_F(WebContentsFrameTrackerTest, SettingScaleFactorMaintainsStableCapture) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature(media::kWebContentsCaptureHiDpi); + StartTrackerOnUIThread(kSize1080p); RunAllTasksUntilIdle(); @@ -459,6 +467,9 @@ } TEST_F(WebContentsFrameTrackerTest, HighDpiIsRoundedIfBetweenBounds) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature(media::kWebContentsCaptureHiDpi); + StartTrackerOnUIThread(kSize1080p); RunAllTasksUntilIdle(); @@ -469,6 +480,9 @@ } TEST_F(WebContentsFrameTrackerTest, HighDpiIsRoundedIfBetweenDifferentBounds) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature(media::kWebContentsCaptureHiDpi); + StartTrackerOnUIThread(kSize1080p); RunAllTasksUntilIdle(); @@ -479,6 +493,9 @@ } TEST_F(WebContentsFrameTrackerTest, HighDpiIsRoundedToMinimum) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature(media::kWebContentsCaptureHiDpi); + StartTrackerOnUIThread(kSize1080p); RunAllTasksUntilIdle(); @@ -489,6 +506,9 @@ } TEST_F(WebContentsFrameTrackerTest, HighDpiIsRoundedToMaximum) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature(media::kWebContentsCaptureHiDpi); + StartTrackerOnUIThread(kSize1080p); RunAllTasksUntilIdle(); @@ -498,6 +518,9 @@ } TEST_F(WebContentsFrameTrackerTest, HighDpiScalingIsStable) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature(media::kWebContentsCaptureHiDpi); + StartTrackerOnUIThread(kSize1080p); RunAllTasksUntilIdle(); @@ -525,6 +548,9 @@ } TEST_F(WebContentsFrameTrackerTest, HighDpiAdjustsForResourceUtilization) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature(media::kWebContentsCaptureHiDpi); + StartTrackerOnUIThread(kSize1080p); RunAllTasksUntilIdle(); @@ -561,6 +587,9 @@ } TEST_F(WebContentsFrameTrackerTest, HighDpiAdjustsForMaxPixelRate) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature(media::kWebContentsCaptureHiDpi); + StartTrackerOnUIThread(kSize1080p); RunAllTasksUntilIdle();
diff --git a/content/browser/media/capture/web_contents_video_capture_device_browsertest.cc b/content/browser/media/capture/web_contents_video_capture_device_browsertest.cc index 4f0cf3b..1b63a33a 100644 --- a/content/browser/media/capture/web_contents_video_capture_device_browsertest.cc +++ b/content/browser/media/capture/web_contents_video_capture_device_browsertest.cc
@@ -26,6 +26,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/test/browser_test.h" #include "content/shell/browser/shell.h" +#include "media/base/media_switches.h" #include "media/base/video_frame.h" #include "media/base/video_types.h" #include "media/base/video_util.h" @@ -52,7 +53,10 @@ : public ContentCaptureDeviceBrowserTestBase, public FrameTestUtil { public: - WebContentsVideoCaptureDeviceBrowserTest() = default; + WebContentsVideoCaptureDeviceBrowserTest() { + // TODO(https://crbug.com/1324757): tests should work with HiDPI enabled. + scoped_feature_list_.InitAndDisableFeature(media::kWebContentsCaptureHiDpi); + } WebContentsVideoCaptureDeviceBrowserTest( const WebContentsVideoCaptureDeviceBrowserTest&) = delete;
diff --git a/content/browser/media/media_devices_util.cc b/content/browser/media/media_devices_util.cc index 84d52d6..e44acbb 100644 --- a/content/browser/media/media_devices_util.cc +++ b/content/browser/media/media_devices_util.cc
@@ -242,14 +242,8 @@ const MediaDeviceSaltAndOrigin& salt_and_origin, const std::string& raw_device_id, bool use_group_salt) { - // TODO(crbug.com/1215532): DCHECKs are disabled during automated testing on - // CrOS and this check failed when tested on an experimental builder. Revert - // https://crrev.com/c/2932244 to enable it. See go/chrome-dcheck-on-cros - // or http://crbug.com/1113456 for more details. -#if !BUILDFLAG(IS_CHROMEOS_ASH) - DCHECK(!raw_device_id.empty()); -#endif - if (raw_device_id == media::AudioDeviceDescription::kDefaultDeviceId || + if (raw_device_id.empty() || + raw_device_id == media::AudioDeviceDescription::kDefaultDeviceId || raw_device_id == media::AudioDeviceDescription::kCommunicationsDeviceId) { return raw_device_id; } @@ -271,7 +265,6 @@ const MediaDeviceSaltAndOrigin& salt_and_origin, const std::string& hmac_device_id, const std::string& raw_device_id) { - DCHECK(!raw_device_id.empty()); return GetHMACForRawMediaDeviceID(salt_and_origin, raw_device_id) == hmac_device_id; }
diff --git a/content/browser/media/media_devices_util_unittest.cc b/content/browser/media/media_devices_util_unittest.cc index 72c00c0..a6d1d12 100644 --- a/content/browser/media/media_devices_util_unittest.cc +++ b/content/browser/media/media_devices_util_unittest.cc
@@ -102,6 +102,13 @@ EXPECT_TRUE(DoesRawMediaDeviceIDMatchHMAC( salt_and_origin, hashed_communications_id, raw_communications_id)); EXPECT_EQ(raw_communications_id, hashed_communications_id); + + const std::string raw_empty_id; + const std::string hashed_empty_id = + GetHMACForRawMediaDeviceID(salt_and_origin, raw_empty_id); + EXPECT_TRUE(DoesRawMediaDeviceIDMatchHMAC(salt_and_origin, hashed_empty_id, + raw_empty_id)); + EXPECT_EQ(raw_empty_id, hashed_empty_id); } TEST(MediaDevicesUtilTest, TranslateNonSpecialDeviceID) {
diff --git a/content/browser/notifications/notification_event_dispatcher_impl.cc b/content/browser/notifications/notification_event_dispatcher_impl.cc index e17f83f..fdc75fd1 100644 --- a/content/browser/notifications/notification_event_dispatcher_impl.cc +++ b/content/browser/notifications/notification_event_dispatcher_impl.cc
@@ -16,6 +16,7 @@ #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/storage_partition.h" #include "content/public/browser/weak_document_ptr.h"
diff --git a/content/browser/notifications/platform_notification_context_impl.h b/content/browser/notifications/platform_notification_context_impl.h index 9c9e590a..1dc5478 100644 --- a/content/browser/notifications/platform_notification_context_impl.h +++ b/content/browser/notifications/platform_notification_context_impl.h
@@ -45,6 +45,7 @@ class PlatformNotificationServiceProxy; class RenderProcessHost; class ServiceWorkerContextWrapper; +class WeakDocumentPtr; // Implementation of the Web Notification storage context. The public methods // defined in this interface must only be called on the UI thread.
diff --git a/content/browser/renderer_host/media/media_devices_manager.cc b/content/browser/renderer_host/media/media_devices_manager.cc index db7f818..4dbdf46 100644 --- a/content/browser/renderer_host/media/media_devices_manager.cc +++ b/content/browser/renderer_host/media/media_devices_manager.cc
@@ -1356,6 +1356,13 @@ #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) void MediaDevicesManager::RegisterVideoCaptureDevicesChangedObserver() { CHECK(!video_capture_service_device_changed_observer_); + if (base::FeatureList::IsEnabled( + features::kRunVideoCaptureServiceInBrowserProcess)) { + // Do not create a mojo connection when the video capture service is running + // in the browser process as the device monitor will send device change + // notifications directly to the system monitor in the browser process. + return; + } // base::Unretained(this) is safe here because |this| owns // |video_capture_service_device_changed_observer_|. video_capture_service_device_changed_observer_ =
diff --git a/content/browser/renderer_host/render_frame_host_delegate.cc b/content/browser/renderer_host/render_frame_host_delegate.cc index 72a8636..134d857a 100644 --- a/content/browser/renderer_host/render_frame_host_delegate.cc +++ b/content/browser/renderer_host/render_frame_host_delegate.cc
@@ -135,12 +135,6 @@ return {}; } -media::MediaMetricsProvider::RecordAggregateWatchTimeCallback -RenderFrameHostDelegate::GetRecordAggregateWatchTimeCallback( - const GURL& page_main_frame_last_committed_url) { - return base::NullCallback(); -} - void RenderFrameHostDelegate::IsClipboardPasteContentAllowed( const GURL& url, const ui::ClipboardFormatType& data_type,
diff --git a/content/browser/renderer_host/render_frame_host_delegate.h b/content/browser/renderer_host/render_frame_host_delegate.h index 140bdcdd..9e26f10 100644 --- a/content/browser/renderer_host/render_frame_host_delegate.h +++ b/content/browser/renderer_host/render_frame_host_delegate.h
@@ -533,10 +533,6 @@ // the given offset (ie, -1 will return the "back" item). virtual bool IsAllowedToGoToEntryAtOffset(int32_t offset); - virtual media::MediaMetricsProvider::RecordAggregateWatchTimeCallback - GetRecordAggregateWatchTimeCallback( - const GURL& page_main_frame_last_committed_url); - // Determines if a clipboard paste using |data| of type |data_type| is allowed // in this renderer frame. Possible data types supported for paste can be // seen in the ClipboardHostImpl class. Text based formats will use the
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc index 40a4ef40..972418b 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -9266,13 +9266,6 @@ delegate_->AccessibilityLocationChangesReceived(details); } -media::MediaMetricsProvider::RecordAggregateWatchTimeCallback -RenderFrameHostImpl::GetRecordAggregateWatchTimeCallback() { - // The URL used for UKM must always be the top level frame. - return delegate_->GetRecordAggregateWatchTimeCallback( - GetOutermostMainFrame()->GetLastCommittedURL()); -} - void RenderFrameHostImpl::ResetWaitingState() { // We don't allow resetting waiting state when the RenderFrameHost is either // in BackForwardCache or in pending deletion state, as we don't allow @@ -11721,9 +11714,6 @@ ->GetLearningSession(); }, weak_ptr_factory_.GetWeakPtr()), - base::BindRepeating( - &RenderFrameHostImpl::GetRecordAggregateWatchTimeCallback, - base::Unretained(this)), std::move(is_shutting_down_cb), std::move(receiver)); }
diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h index db0f6a5..ba700007 100644 --- a/content/browser/renderer_host/render_frame_host_impl.h +++ b/content/browser/renderer_host/render_frame_host_impl.h
@@ -994,9 +994,6 @@ return !is_main_frame() && is_local_root(); } - media::MediaMetricsProvider::RecordAggregateWatchTimeCallback - GetRecordAggregateWatchTimeCallback(); - // The unique ID of the latest NavigationEntry that this RenderFrameHost is // showing. This may change even when this frame hasn't committed a page, // such as for a new subframe navigation in a different frame.
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h index 347860f..066c1a8 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -558,12 +558,6 @@ void UpdateWindowsNow(); - // For HiDPI capture mode, adjust the device scale factor to render the - // contents at a higher pixel density when scale_override_for_capture_ > 1.0. - // The first boolean returns true if any screen info was changed. - // The second boolean returns true if the ScreenInfo was changed. - std::pair<bool, bool> MaybeUpdateScreenInfosForHiDPI(); - // Interface through which the NSView is to be manipulated. This points either // to |in_process_ns_view_bridge_| or to |remote_ns_view_|. raw_ptr<remote_cocoa::mojom::RenderWidgetHostNSView> ns_view_ = nullptr;
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index e4fb367..404d89f7 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -877,9 +877,29 @@ new_screen_infos_from_shim_.reset(); } - std::pair<bool, bool> was_updated = MaybeUpdateScreenInfosForHiDPI(); - any_display_changed |= was_updated.first; - current_display_changed |= was_updated.second; + if (base::FeatureList::IsEnabled(media::kWebContentsCaptureHiDpi)) { + // If HiDPI capture mode is active, adjust the device scale factor to + // increase the rendered pixel count. |new_screen_infos| always contains + // the unmodified original values for the display, and a copy of it is + // saved in |screen_infos_|, with a modification applied if applicable. + // When HiDPI mode is turned off (the scale override is 1.0), the original + // |new_screen_infos| value gets copied unchanged to |screen_infos_|. + display::ScreenInfos new_screen_infos = original_screen_infos_; + const float old_device_scale_factor = + new_screen_infos.current().device_scale_factor; + new_screen_infos.mutable_current().device_scale_factor = + old_device_scale_factor * scale_override_for_capture_; + if (screen_infos_ != new_screen_infos) { + DVLOG(1) << __func__ << ": Overriding device_scale_factor from " + << old_device_scale_factor << " to " + << new_screen_infos.current().device_scale_factor + << " for capture."; + any_display_changed = true; + current_display_changed |= + new_screen_infos.current() != screen_infos_.current(); + screen_infos_ = new_screen_infos; + } + } bool dip_size_changed = view_bounds_in_window_dip_.size() != browser_compositor_->GetRendererSize(); @@ -2385,32 +2405,6 @@ [NSApp updateWindows]; } -std::pair<bool, bool> -RenderWidgetHostViewMac::MaybeUpdateScreenInfosForHiDPI() { - // For HiDPI capture mode, adjust the device scale factor to - // increase the rendered pixel count. |new_screen_infos| always contains - // the unmodified original values for the display, and a copy of it is - // saved in |screen_infos_|, with a modification applied if applicable. - // When HiDPI mode is turned off (the scale override is 1.0), the original - // |new_screen_infos| value gets copied unchanged to |screen_infos_|. - display::ScreenInfos new_screen_infos = original_screen_infos_; - const float old_device_scale_factor = - new_screen_infos.current().device_scale_factor; - new_screen_infos.mutable_current().device_scale_factor = - old_device_scale_factor * scale_override_for_capture_; - if (screen_infos_ != new_screen_infos) { - DVLOG(1) << __func__ << ": Overriding device_scale_factor from " - << old_device_scale_factor << " to " - << new_screen_infos.current().device_scale_factor - << " for capture."; - const bool current_display_changed = - new_screen_infos.current() != screen_infos_.current(); - screen_infos_ = new_screen_infos; - return {true, current_display_changed}; - } - return {false, false}; -} - Class GetRenderWidgetHostViewCocoaClassForTesting() { return [RenderWidgetHostViewCocoa class]; }
diff --git a/content/browser/service_worker/service_worker_container_host.cc b/content/browser/service_worker/service_worker_container_host.cc index 4fe5400..bc57cde 100644 --- a/content/browser/service_worker/service_worker_container_host.cc +++ b/content/browser/service_worker/service_worker_container_host.cc
@@ -10,6 +10,7 @@ #include "base/containers/adapters.h" #include "base/containers/contains.h" #include "base/functional/callback_helpers.h" +#include "base/functional/overloaded.h" #include "base/strings/stringprintf.h" #include "base/task/single_thread_task_runner.h" #include "base/uuid.h" @@ -868,13 +869,24 @@ ServiceWorkerContainerHost::GetClientType() const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(client_info_); - return client_info_->type(); + return absl::visit( + base::Overloaded( + [](GlobalRenderFrameHostId render_frame_host_id) { + return blink::mojom::ServiceWorkerClientType::kWindow; + }, + [](blink::DedicatedWorkerToken dedicated_worker_token) { + return blink::mojom::ServiceWorkerClientType::kDedicatedWorker; + }, + [](blink::SharedWorkerToken shared_worker_token) { + return blink::mojom::ServiceWorkerClientType::kSharedWorker; + }), + *client_info_); } bool ServiceWorkerContainerHost::IsContainerForWindowClient() const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); return client_info_ && - client_info_->type() == blink::mojom::ServiceWorkerClientType::kWindow; + absl::holds_alternative<GlobalRenderFrameHostId>(*client_info_); } bool ServiceWorkerContainerHost::IsContainerForWorkerClient() const { @@ -883,8 +895,8 @@ if (!client_info_) return false; - return client_info_->type() == ServiceWorkerClientType::kDedicatedWorker || - client_info_->type() == ServiceWorkerClientType::kSharedWorker; + return absl::holds_alternative<blink::DedicatedWorkerToken>(*client_info_) || + absl::holds_alternative<blink::SharedWorkerToken>(*client_info_); } ServiceWorkerClientInfo ServiceWorkerContainerHost::GetServiceWorkerClientInfo() @@ -905,7 +917,7 @@ DCHECK(IsContainerForWindowClient()); ongoing_navigation_frame_tree_node_id_ = RenderFrameHost::kNoFrameTreeNodeId; - client_info_->SetRenderFrameHostId(rfh_id); + client_info_ = rfh_id; if (controller_) controller_->UpdateForegroundPriority(); @@ -1198,7 +1210,7 @@ const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(IsContainerForWindowClient()); - return client_info_->GetRenderFrameHostId(); + return absl::get<GlobalRenderFrameHostId>(*client_info_); } int ServiceWorkerContainerHost::GetProcessId() const {
diff --git a/content/browser/service_worker/service_worker_container_host.h b/content/browser/service_worker/service_worker_container_host.h index 4d0ea21..85ef8f68 100644 --- a/content/browser/service_worker/service_worker_container_host.h +++ b/content/browser/service_worker/service_worker_container_host.h
@@ -21,6 +21,7 @@ #include "content/browser/storage_partition_impl.h" #include "content/common/content_export.h" #include "content/public/browser/child_process_host.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/browser/service_worker_client_info.h" #include "mojo/public/cpp/bindings/associated_remote.h" #include "mojo/public/cpp/bindings/receiver_set.h"
diff --git a/content/browser/service_worker/service_worker_info.h b/content/browser/service_worker/service_worker_info.h index 86b868d0..f744598 100644 --- a/content/browser/service_worker/service_worker_info.h +++ b/content/browser/service_worker/service_worker_info.h
@@ -14,6 +14,7 @@ #include "base/time/time.h" #include "content/browser/service_worker/service_worker_version.h" #include "content/common/content_export.h" +#include "content/public/browser/service_worker_client_info.h" #include "content/public/browser/service_worker_version_base_info.h" #include "services/metrics/public/cpp/ukm_source_id.h" #include "third_party/blink/public/common/service_worker/embedded_worker_status.h" @@ -27,8 +28,6 @@ namespace content { -class ServiceWorkerClientInfo; - struct CONTENT_EXPORT ServiceWorkerVersionInfo : public ServiceWorkerVersionBaseInfo { public:
diff --git a/content/browser/service_worker/service_worker_internals_ui.cc b/content/browser/service_worker/service_worker_internals_ui.cc index 776996c..d4d85ac 100644 --- a/content/browser/service_worker/service_worker_internals_ui.cc +++ b/content/browser/service_worker/service_worker_internals_ui.cc
@@ -156,9 +156,9 @@ for (auto& it : version.clients) { base::Value::Dict client; client.Set("client_id", it.first); - if (it.second.type() == blink::mojom::ServiceWorkerClientType::kWindow) { - RenderFrameHost* render_frame_host = - RenderFrameHost::FromID(it.second.GetRenderFrameHostId()); + if (absl::holds_alternative<GlobalRenderFrameHostId>(it.second)) { + RenderFrameHost* render_frame_host = RenderFrameHost::FromID( + absl::get<GlobalRenderFrameHostId>(it.second)); if (render_frame_host) { client.Set("url", render_frame_host->GetLastCommittedURL().spec()); }
diff --git a/content/browser/service_worker/service_worker_main_resource_loader_interceptor.cc b/content/browser/service_worker/service_worker_main_resource_loader_interceptor.cc index 868c2fd..4a294979 100644 --- a/content/browser/service_worker/service_worker_main_resource_loader_interceptor.cc +++ b/content/browser/service_worker/service_worker_main_resource_loader_interceptor.cc
@@ -8,6 +8,7 @@ #include <utility> #include "base/functional/bind.h" +#include "base/functional/overloaded.h" #include "base/memory/ptr_util.h" #include "base/types/optional_util.h" #include "build/chromeos_buildflags.h" @@ -175,7 +176,7 @@ network::mojom::RequestDestination::kSharedWorker); ServiceWorkerClientInfo client_info = - ServiceWorkerClientInfo(*worker_token_); + absl::ConvertVariantTo<ServiceWorkerClientInfo>(*worker_token_); container_host = context_core->CreateContainerHostForWorker( std::move(host_receiver), process_id_, std::move(client_remote), @@ -352,27 +353,46 @@ const url::Origin& origin) { if (!worker_token_.has_value()) return absl::nullopt; + auto* process = RenderProcessHost::FromID(process_id_); - if (!process) + if (!process) { return absl::nullopt; + } auto* storage_partition = process->GetStoragePartition(); - if (worker_token_->Is<blink::DedicatedWorkerToken>()) { - auto* worker_service = static_cast<DedicatedWorkerServiceImpl*>( - storage_partition->GetDedicatedWorkerService()); - auto* worker_host = worker_service->GetDedicatedWorkerHostFromToken( - worker_token_->GetAs<blink::DedicatedWorkerToken>()); - if (worker_host) - return worker_host->GetStorageKey().WithOrigin(origin); - } else if (worker_token_->Is<blink::SharedWorkerToken>()) { - auto* worker_service = static_cast<SharedWorkerServiceImpl*>( - storage_partition->GetSharedWorkerService()); - auto* worker_host = worker_service->GetSharedWorkerHostFromToken( - worker_token_->GetAs<blink::SharedWorkerToken>()); - if (worker_host) - return worker_host->GetStorageKey().WithOrigin(origin); - } else { - NOTREACHED(); + return absl::visit(base::Overloaded([&, this](auto token) { + return GetStorageKeyFromWorkerHost(storage_partition, + token, origin); + }), + *worker_token_); +} + +absl::optional<blink::StorageKey> +ServiceWorkerMainResourceLoaderInterceptor::GetStorageKeyFromWorkerHost( + content::StoragePartition* storage_partition, + blink::DedicatedWorkerToken dedicated_worker_token, + const url::Origin& origin) { + auto* worker_service = static_cast<DedicatedWorkerServiceImpl*>( + storage_partition->GetDedicatedWorkerService()); + auto* worker_host = + worker_service->GetDedicatedWorkerHostFromToken(dedicated_worker_token); + if (worker_host) { + return worker_host->GetStorageKey().WithOrigin(origin); + } + return absl::nullopt; +} + +absl::optional<blink::StorageKey> +ServiceWorkerMainResourceLoaderInterceptor::GetStorageKeyFromWorkerHost( + content::StoragePartition* storage_partition, + blink::SharedWorkerToken shared_worker_token, + const url::Origin& origin) { + auto* worker_service = static_cast<SharedWorkerServiceImpl*>( + storage_partition->GetSharedWorkerService()); + auto* worker_host = + worker_service->GetSharedWorkerHostFromToken(shared_worker_token); + if (worker_host) { + return worker_host->GetStorageKey().WithOrigin(origin); } return absl::nullopt; }
diff --git a/content/browser/service_worker/service_worker_main_resource_loader_interceptor.h b/content/browser/service_worker/service_worker_main_resource_loader_interceptor.h index db75ff4..8fac6a9 100644 --- a/content/browser/service_worker/service_worker_main_resource_loader_interceptor.h +++ b/content/browser/service_worker/service_worker_main_resource_loader_interceptor.h
@@ -127,6 +127,16 @@ absl::optional<blink::StorageKey> GetStorageKeyFromWorkerHost( const url::Origin& origin); + absl::optional<blink::StorageKey> GetStorageKeyFromWorkerHost( + content::StoragePartition* storage_partition, + blink::DedicatedWorkerToken dedicated_worker_token, + const url::Origin& origin); + + absl::optional<blink::StorageKey> GetStorageKeyFromWorkerHost( + content::StoragePartition* storage_partition, + blink::SharedWorkerToken shared_worker_token, + const url::Origin& origin); + // For navigations, |handle_| outlives |this|. It's owned by // NavigationRequest which outlives NavigationURLLoaderImpl which owns |this|. // For workers, |handle_| may be destroyed during interception. It's owned by
diff --git a/content/browser/startup_helper.cc b/content/browser/startup_helper.cc index 8b887900..332d889d 100644 --- a/content/browser/startup_helper.cc +++ b/content/browser/startup_helper.cc
@@ -41,7 +41,7 @@ << " list specified."; } - base::FeatureList::InitializeInstance( + base::FeatureList::InitInstance( command_line->GetSwitchValueASCII(switches::kEnableFeatures), command_line->GetSwitchValueASCII(switches::kDisableFeatures), GetSwitchDependentFeatureOverrides(*command_line));
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc index a0684ba..3b1dd64 100644 --- a/content/browser/storage_partition_impl.cc +++ b/content/browser/storage_partition_impl.cc
@@ -1784,7 +1784,7 @@ storage::mojom::IndexedDBControl& StoragePartitionImpl::GetIndexedDBControl() { DCHECK_CURRENTLY_ON(BrowserThread::UI); - return *indexed_db_control_wrapper_.get(); + return indexed_db_control_wrapper_->GetIndexedDBControl(); } FileSystemAccessEntryFactory*
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index ae1bdaa2..94bf876 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -9775,33 +9775,6 @@ is_capturing_media_stream); } -media::MediaMetricsProvider::RecordAggregateWatchTimeCallback -WebContentsImpl::GetRecordAggregateWatchTimeCallback( - const GURL& page_main_frame_last_committed_url) { - OPTIONAL_TRACE_EVENT0("content", - "WebContentsImpl::RecordAggregateWatchTimeCallback"); - if (!delegate_ || !delegate_->GetDelegateWeakPtr()) { - return base::DoNothing(); - } - - return base::BindRepeating( - [](base::WeakPtr<WebContentsDelegate> delegate, - GURL page_main_frame_last_committed_url, - base::TimeDelta total_watch_time, base::TimeDelta time_stamp, - bool has_video, bool has_audio) { - content::MediaPlayerWatchTime watch_time( - page_main_frame_last_committed_url, - page_main_frame_last_committed_url.DeprecatedGetOriginAsURL(), - total_watch_time, time_stamp, has_video, has_audio); - - // Save the watch time if the delegate is still alive. - if (delegate) { - delegate->MediaWatchTimeChanged(watch_time); - } - }, - delegate_->GetDelegateWeakPtr(), page_main_frame_last_committed_url); -} - // Cf. `GetProspectiveOuterDocument` which applies to the same situation, but is // for ascending. std::vector<FrameTreeNode*> WebContentsImpl::GetUnattachedOwnedNodes(
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index b21b830..db57b79 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h
@@ -746,9 +746,6 @@ void OnFrameIsCapturingMediaStreamChanged( RenderFrameHostImpl* host, bool is_capturing_media_stream) override; - media::MediaMetricsProvider::RecordAggregateWatchTimeCallback - GetRecordAggregateWatchTimeCallback( - const GURL& page_main_frame_last_committed_url) override; std::vector<FrameTreeNode*> GetUnattachedOwnedNodes( RenderFrameHostImpl* owner) override; void RegisterProtocolHandler(RenderFrameHostImpl* source,
diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc index 7c1c480..86e30621 100644 --- a/content/browser/web_contents/web_contents_impl_browsertest.cc +++ b/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -5990,15 +5990,6 @@ video.play(); )")); - // Get a watch time callback from `fenced_frame`. - media::MediaMetricsProvider::RecordAggregateWatchTimeCallback - record_playback_cb = static_cast<RenderFrameHostImpl*>(fenced_frame) - ->GetRecordAggregateWatchTimeCallback(); - std::move(record_playback_cb) - .Run(base::TimeDelta(), base::TimeDelta(), true, true); - // Check if the URL is from the top level frame. - DCHECK_EQ(top_url, delegate.watch_time().url); - base::RunLoop run_loop; test_recorder.SetOnAddEntryCallback(UkmEntry::kEntryName, run_loop.QuitClosure());
diff --git a/content/browser/webauth/webauth_request_security_checker.cc b/content/browser/webauth/webauth_request_security_checker.cc index 750a4df..a7d62e48 100644 --- a/content/browser/webauth/webauth_request_security_checker.cc +++ b/content/browser/webauth/webauth_request_security_checker.cc
@@ -149,42 +149,13 @@ const url::Origin& caller_origin, const base::Value& value) { // This code processes a .well-known/webauthn-origins JSON. See - // https://github.com/w3c/webauthn/wiki/Explainer:-Cross-domain-requests + // https://github.com/w3c/webauthn/wiki/Explainer:-Related-origin-requests if (!value.is_dict()) { return blink::mojom::AuthenticatorStatus:: BAD_RELYING_PARTY_ID_JSON_PARSE_ERROR; } - // Extensions aren't listed in the `origins` list so that they don't interfere - // with the label limits in other browsers. - if (base::EndsWith(caller_origin.scheme(), "-extension")) { - const base::Value::List* extensions = - value.GetDict().FindList("extensions"); - if (!extensions) { - return blink::mojom::AuthenticatorStatus:: - BAD_RELYING_PARTY_ID_NO_JSON_MATCH_EXTENSION; - } - for (const base::Value& extension_str : *extensions) { - if (!extension_str.is_string()) { - return blink::mojom::AuthenticatorStatus:: - BAD_RELYING_PARTY_ID_JSON_PARSE_ERROR; - } - const GURL url(extension_str.GetString()); - if (!url.is_valid()) { - return blink::mojom::AuthenticatorStatus:: - BAD_RELYING_PARTY_ID_JSON_PARSE_ERROR; - } - const auto origin = url::Origin::Create(url); - if (origin.IsSameOriginWith(caller_origin)) { - return blink::mojom::AuthenticatorStatus::SUCCESS; - } - } - - return blink::mojom::AuthenticatorStatus:: - BAD_RELYING_PARTY_ID_NO_JSON_MATCH; - } - const base::Value::List* origins = value.GetDict().FindList("origins"); if (!origins) { return blink::mojom::AuthenticatorStatus::
diff --git a/content/browser/webauth/webauth_request_security_checker_unittest.cc b/content/browser/webauth/webauth_request_security_checker_unittest.cc index cb3556a..f48c8fb 100644 --- a/content/browser/webauth/webauth_request_security_checker_unittest.cc +++ b/content/browser/webauth/webauth_request_security_checker_unittest.cc
@@ -351,9 +351,6 @@ const base::test::ScopedFeatureList scoped_feature_list{ device::kWebAuthnRelatedOrigin}; - url::ScopedSchemeRegistryForTests scoped_scheme_registry; - url::AddStandardScheme("foo-extension", url::SCHEME_WITH_HOST); - struct TestCase { const char* json; blink::mojom::AuthenticatorStatus expected; @@ -366,8 +363,6 @@ blink::mojom::AuthenticatorStatus::BAD_RELYING_PARTY_ID_NO_JSON_MATCH; constexpr blink::mojom::AuthenticatorStatus no_match_hit_limits = blink:: mojom::AuthenticatorStatus::BAD_RELYING_PARTY_ID_NO_JSON_MATCH_HIT_LIMITS; - constexpr blink::mojom::AuthenticatorStatus no_match_extension = blink:: - mojom::AuthenticatorStatus::BAD_RELYING_PARTY_ID_NO_JSON_MATCH_EXTENSION; static const TestCase kTestCases[] = { {R"([])", parse_error}, @@ -425,20 +420,6 @@ EXPECT_EQ(test.expected, Test("https://foo.com", test.json)); } - - static const TestCase kExtensionTestCases[] = { - {R"({})", no_match_extension}, - {R"({"extensions": "bar"})", no_match_extension}, - {R"({"extensions": []})", no_match}, - {R"({"extensions": [1]})", parse_error}, - {R"({"extensions": ["foo-extension://abcde"]})", ok}, - }; - - for (const auto& test : kExtensionTestCases) { - SCOPED_TRACE(test.json); - - EXPECT_EQ(test.expected, Test("foo-extension://abcde/", test.json)); - } } } // namespace
diff --git a/content/browser/webid/federated_auth_request_impl.cc b/content/browser/webid/federated_auth_request_impl.cc index 263aa6c..64c574e0 100644 --- a/content/browser/webid/federated_auth_request_impl.cc +++ b/content/browser/webid/federated_auth_request_impl.cc
@@ -2144,22 +2144,16 @@ should_delay_callback); return; } - // Grant sharing permission specific to *this account*. - // - // TODO(majidvp): But wait which account? - // 1) The account that user selected in our UI (i.e., account_id_) or - // 2) The one for which the IDP generated a token. - // - // Ideally these are one and the same but currently there is no - // enforcement for that equality so they could be different. In the - // future we may want to enforce that the token account (aka subject) - // matches the user selected account. But for now these questions are - // moot since we don't actually inspect the returned idtoken. - // https://crbug.com/1199088 + + // Auto re-authentication can only be triggered when there's already a + // sharing permission OR the IdP is exempted with 3PC access. Either way + // we shouldn't explicitly grant permission here. CHECK(!account_id_.empty()); - permission_delegate_->GrantSharingPermission( - origin(), GetEmbeddingOrigin(), url::Origin::Create(idp_config_url), - account_id_); + if (dialog_type_ != kAutoReauth) { + permission_delegate_->GrantSharingPermission( + origin(), GetEmbeddingOrigin(), url::Origin::Create(idp_config_url), + account_id_); + } SetRequiresUserMediation(false);
diff --git a/content/browser/webid/federated_auth_request_impl_unittest.cc b/content/browser/webid/federated_auth_request_impl_unittest.cc index fb6c7195..b42b0f7 100644 --- a/content/browser/webid/federated_auth_request_impl_unittest.cc +++ b/content/browser/webid/federated_auth_request_impl_unittest.cc
@@ -2190,6 +2190,13 @@ OriginFromString(kRpUrl))) .WillOnce(Return(true)); + // Sharing permission won't be granted with this setup. + EXPECT_CALL(*test_permission_delegate_, + GrantSharingPermission( + OriginFromString(kRpUrl), OriginFromString(kRpUrl), + OriginFromString(kProviderUrlFull), std::string(kAccountId))) + .Times(0); + // Set IDP claims user is signed in. MockConfiguration configuration = kConfigurationValid; configuration.idp_info[kProviderUrlFull].accounts[0].login_state =
diff --git a/content/browser/worker_host/worker_script_fetcher.h b/content/browser/worker_host/worker_script_fetcher.h index d0f9fba..6fd6ad5 100644 --- a/content/browser/worker_host/worker_script_fetcher.h +++ b/content/browser/worker_host/worker_script_fetcher.h
@@ -12,6 +12,7 @@ #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" #include "net/url_request/redirect_info.h" +#include "services/metrics/public/cpp/ukm_source_id.h" #include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" #include "services/network/public/mojom/client_security_state.mojom-forward.h" #include "services/network/public/mojom/url_loader.mojom.h" @@ -23,6 +24,7 @@ #include "third_party/blink/public/mojom/worker/worker_main_script_load_params.mojom.h" namespace net { +class IsolationInfo; class SiteForCookies; } // namespace net
diff --git a/content/browser/worker_host/worker_script_loader.h b/content/browser/worker_host/worker_script_loader.h index b2f4e5ff..66bbee6 100644 --- a/content/browser/worker_host/worker_script_loader.h +++ b/content/browser/worker_host/worker_script_loader.h
@@ -19,6 +19,7 @@ #include "net/base/load_timing_info.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "net/url_request/url_request.h" +#include "services/metrics/public/cpp/ukm_source_id.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/single_request_url_loader_factory.h" #include "services/network/public/cpp/url_loader_completion_status.h"
diff --git a/content/common/service_worker/race_network_request_url_loader_client.cc b/content/common/service_worker/race_network_request_url_loader_client.cc index dff7adc1..37a0eda 100644 --- a/content/common/service_worker/race_network_request_url_loader_client.cc +++ b/content/common/service_worker/race_network_request_url_loader_client.cc
@@ -9,6 +9,7 @@ #include "base/metrics/histogram_functions.h" #include "base/notreached.h" #include "base/strings/strcat.h" +#include "base/system/sys_info.h" #include "base/time/time.h" #include "base/trace_event/trace_event.h" #include "content/common/features.h" @@ -56,6 +57,7 @@ body_consumer_watcher_(FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::MANUAL, base::SequencedTaskRunner::GetCurrentDefault()), + data_pipe_buffer_size_(GetDataPipeCapacityBytes()), request_start_(base::TimeTicks::Now()), request_start_time_(base::Time::Now()) { TRACE_EVENT_WITH_FLOW0("ServiceWorker", @@ -63,19 +65,17 @@ "ServiceWorkerRaceNetworkRequestURLLoaderClient", TRACE_ID_LOCAL(this), TRACE_EVENT_FLAG_FLOW_OUT); - uint32_t data_pipe_size = ServiceWorkerRaceNetworkRequestURLLoaderClient:: - GetDataPipeCapacityBytes(); // Create two data pipes. One is for RaceNetworkRequest. The other is for the // corresponding request in the fetch handler. if (CreateDataPipe(data_pipe_for_race_network_request_.producer, data_pipe_for_race_network_request_.consumer, - data_pipe_size) != MOJO_RESULT_OK) { + data_pipe_buffer_size_) != MOJO_RESULT_OK) { TransitionState(State::kAborted); return; } if (CreateDataPipe(data_pipe_for_fetch_handler_.producer, data_pipe_for_fetch_handler_.consumer, - data_pipe_size) != MOJO_RESULT_OK) { + data_pipe_buffer_size_) != MOJO_RESULT_OK) { TransitionState(State::kAborted); return; } @@ -581,6 +581,13 @@ void* write_buffer, const void* read_buffer, uint32_t num_bytes_to_consume) { + SCOPED_CRASH_KEY_NUMBER("SWRace", "physical_memory_mb", + base::SysInfo::AmountOfPhysicalMemoryMB()); + SCOPED_CRASH_KEY_NUMBER("SWRace", "available_physical_memory_mb", + base::SysInfo::AmountOfAvailablePhysicalMemory()); + SCOPED_CRASH_KEY_NUMBER("SWRace", "is_lowend_device", + base::SysInfo::IsLowEndDevice()); + CHECK_GE(data_pipe_buffer_size_, num_bytes_to_consume); memcpy(write_buffer, read_buffer, num_bytes_to_consume); MojoResult result = data_pipe_info.producer->EndWriteData(num_bytes_to_consume); @@ -825,11 +832,14 @@ uint32_t ServiceWorkerRaceNetworkRequestURLLoaderClient::GetDataPipeCapacityBytes() { - return data_pipe_size_for_test_ > 0 - ? data_pipe_size_for_test_ - : network::features::GetDataPipeDefaultAllocationSize( - network::features::DataPipeAllocationSize:: - kLargerSizeIfPossible); + if (data_pipe_size_for_test_ > 0) { + return data_pipe_size_for_test_; + } + // The feature param may override the buffer size. + return base::GetFieldTrialParamByFeatureAsInt( + features::kServiceWorkerAutoPreload, "data_pipe_capacity_num_bytes", + network::features::GetDataPipeDefaultAllocationSize( + network::features::DataPipeAllocationSize::kLargerSizeIfPossible)); } // static
diff --git a/content/common/service_worker/race_network_request_url_loader_client.h b/content/common/service_worker/race_network_request_url_loader_client.h index 9fbd40f..6388a2a 100644 --- a/content/common/service_worker/race_network_request_url_loader_client.h +++ b/content/common/service_worker/race_network_request_url_loader_client.h
@@ -237,6 +237,7 @@ DataPipeInfo data_pipe_for_race_network_request_; DataPipeInfo data_pipe_for_fetch_handler_; + uint32_t data_pipe_buffer_size_; absl::optional<network::URLLoaderCompletionStatus> completion_status_; bool redirected_ = false; std::unique_ptr<mojo::DataPipeDrainer> data_drainer_;
diff --git a/content/public/browser/BUILD.gn b/content/public/browser/BUILD.gn index f0894db..68aa72a 100644 --- a/content/public/browser/BUILD.gn +++ b/content/public/browser/BUILD.gn
@@ -373,7 +373,6 @@ "service_process_host_passkeys.h", "service_process_info.cc", "service_process_info.h", - "service_worker_client_info.cc", "service_worker_client_info.h", "service_worker_context.h", "service_worker_context_observer.h",
diff --git a/content/public/browser/child_process_security_policy.h b/content/public/browser/child_process_security_policy.h index 93c8869..99c4b11 100644 --- a/content/public/browser/child_process_security_policy.h +++ b/content/public/browser/child_process_security_policy.h
@@ -210,14 +210,17 @@ virtual void GrantSendMidiSysExMessage(int child_id) = 0; // Returns true if the process is permitted to read and modify the data for - // the origin of |url|. This is currently used to protect data such as - // cookies, passwords, and local storage. Does not affect cookies attached to - // or set by network requests. + // the given `origin`. This is used to protect data such as cookies, + // passwords, and local storage. Does not affect cookies attached to or set by + // network requests. // - // This can only return false for processes locked to a particular origin, - // which can happen for any origin when the --site-per-process flag is used, - // or for isolated origins that require a dedicated process (see - // AddFutureIsolatedOrigins). + // This function performs two kinds of security checks: + // - "Jail" check: ensures that a process locked to a particular site can + // only access data belonging to that site. + // - "Citadel" check: ensures that a process that is *not* locked to a + // particular site does not access data belonging to a site that requires a + // dedicated process. This check is mainly relevant on Android, where only + // some sites require site isolation. virtual bool CanAccessDataForOrigin(int child_id, const url::Origin& origin) = 0;
diff --git a/content/public/browser/service_worker_client_info.cc b/content/public/browser/service_worker_client_info.cc deleted file mode 100644 index 10b0f8c..0000000 --- a/content/public/browser/service_worker_client_info.cc +++ /dev/null
@@ -1,67 +0,0 @@ -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/public/browser/service_worker_client_info.h" -#include "content/public/browser/child_process_host.h" - -namespace content { - -ServiceWorkerClientInfo::ServiceWorkerClientInfo() - : type_(blink::mojom::ServiceWorkerClientType::kWindow) {} - -ServiceWorkerClientInfo::ServiceWorkerClientInfo( - const blink::DedicatedWorkerToken& dedicated_worker_token) - : type_(blink::mojom::ServiceWorkerClientType::kDedicatedWorker), - worker_token_(dedicated_worker_token) {} - -ServiceWorkerClientInfo::ServiceWorkerClientInfo( - const blink::SharedWorkerToken& shared_worker_token) - : type_(blink::mojom::ServiceWorkerClientType::kSharedWorker), - worker_token_(shared_worker_token) {} - -ServiceWorkerClientInfo::ServiceWorkerClientInfo( - const DedicatedOrSharedWorkerToken& worker_token) - : worker_token_(worker_token) { - if (worker_token.Is<blink::DedicatedWorkerToken>()) { - type_ = blink::mojom::ServiceWorkerClientType::kDedicatedWorker; - } else { - DCHECK(worker_token.Is<blink::SharedWorkerToken>()); - type_ = blink::mojom::ServiceWorkerClientType::kSharedWorker; - } -} - -ServiceWorkerClientInfo::ServiceWorkerClientInfo( - const ServiceWorkerClientInfo& other) = default; - -ServiceWorkerClientInfo& ServiceWorkerClientInfo::operator=( - const ServiceWorkerClientInfo& other) = default; - -ServiceWorkerClientInfo::~ServiceWorkerClientInfo() = default; - -GlobalRenderFrameHostId ServiceWorkerClientInfo::GetRenderFrameHostId() const { - DCHECK_EQ(type_, blink::mojom::ServiceWorkerClientType::kWindow); - return render_frame_host_id_; -} - -void ServiceWorkerClientInfo::SetRenderFrameHostId( - const GlobalRenderFrameHostId& render_frame_host_id) { - DCHECK_EQ(type_, blink::mojom::ServiceWorkerClientType::kWindow); - DCHECK_NE(ChildProcessHost::kInvalidUniqueID, render_frame_host_id.child_id); - DCHECK_NE(MSG_ROUTING_NONE, render_frame_host_id.frame_routing_id); - - render_frame_host_id_ = render_frame_host_id; -} - -blink::DedicatedWorkerToken ServiceWorkerClientInfo::GetDedicatedWorkerToken() - const { - DCHECK_EQ(type_, blink::mojom::ServiceWorkerClientType::kDedicatedWorker); - return worker_token_->GetAs<blink::DedicatedWorkerToken>(); -} - -blink::SharedWorkerToken ServiceWorkerClientInfo::GetSharedWorkerToken() const { - DCHECK_EQ(type_, blink::mojom::ServiceWorkerClientType::kSharedWorker); - return worker_token_->GetAs<blink::SharedWorkerToken>(); -} - -} // namespace content
diff --git a/content/public/browser/service_worker_client_info.h b/content/public/browser/service_worker_client_info.h index 775b691..21bbd54 100644 --- a/content/public/browser/service_worker_client_info.h +++ b/content/public/browser/service_worker_client_info.h
@@ -5,65 +5,18 @@ #ifndef CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CLIENT_INFO_H_ #define CONTENT_PUBLIC_BROWSER_SERVICE_WORKER_CLIENT_INFO_H_ -#include "content/common/content_export.h" #include "content/public/browser/global_routing_id.h" -#include "content/public/browser/render_frame_host.h" -#include "third_party/abseil-cpp/absl/types/optional.h" -#include "third_party/blink/public/common/tokens/multi_token.h" +#include "third_party/abseil-cpp/absl/types/variant.h" #include "third_party/blink/public/common/tokens/tokens.h" -#include "third_party/blink/public/mojom/service_worker/service_worker_client.mojom.h" namespace content { using DedicatedOrSharedWorkerToken = - blink::MultiToken<blink::DedicatedWorkerToken, blink::SharedWorkerToken>; + absl::variant<blink::DedicatedWorkerToken, blink::SharedWorkerToken>; -// Holds information about a single service worker client: -// https://w3c.github.io/ServiceWorker/#client -class CONTENT_EXPORT ServiceWorkerClientInfo { - public: - ServiceWorkerClientInfo(); - explicit ServiceWorkerClientInfo( - const blink::DedicatedWorkerToken& dedicated_worker_token); - explicit ServiceWorkerClientInfo( - const blink::SharedWorkerToken& shared_worker_token); - explicit ServiceWorkerClientInfo( - const DedicatedOrSharedWorkerToken& worker_token); - - ServiceWorkerClientInfo(const ServiceWorkerClientInfo& other); - ServiceWorkerClientInfo& operator=(const ServiceWorkerClientInfo& other); - - ~ServiceWorkerClientInfo(); - - // Returns the type of this client. - blink::mojom::ServiceWorkerClientType type() const { return type_; } - - GlobalRenderFrameHostId GetRenderFrameHostId() const; - void SetRenderFrameHostId( - const GlobalRenderFrameHostId& render_frame_host_id); - - // Returns the corresponding DedicatedWorkerToken. This should only be called - // if "type() == blink::mojom::ServiceWorkerClientType::kDedicatedWorker". - blink::DedicatedWorkerToken GetDedicatedWorkerToken() const; - - // Returns the corresponding SharedWorkerToken. This should only be called - // if "type() == blink::mojom::ServiceWorkerClientType::kSharedWorker". - blink::SharedWorkerToken GetSharedWorkerToken() const; - - private: - // The client type. - blink::mojom::ServiceWorkerClientType type_; - - // For a window client. - // Currently, there is a time lag between when ServiceWorkerClientInfo is - // created and `render_frame_host_id_` is set. - // TODO(asamidoi): Set GlobalRenderFrameHostId in the constructor of - // ServiceWorkerClientInfo and remove SetRenderFrameHostId(). - GlobalRenderFrameHostId render_frame_host_id_; - - // The ID of the client, if it is a worker. - absl::optional<DedicatedOrSharedWorkerToken> worker_token_; -}; +using ServiceWorkerClientInfo = absl::variant<GlobalRenderFrameHostId, + blink::DedicatedWorkerToken, + blink::SharedWorkerToken>; } // namespace content
diff --git a/content/renderer/pepper/resource_converter.cc b/content/renderer/pepper/resource_converter.cc index 04a0c69..0e5435b7 100644 --- a/content/renderer/pepper/resource_converter.cc +++ b/content/renderer/pepper/resource_converter.cc
@@ -144,8 +144,7 @@ blink::WebDOMFileSystem web_dom_file_system = blink::WebDOMFileSystem::Create( frame, blink_type, blink::WebString::FromUTF8(name), root_url, blink::WebDOMFileSystem::kSerializableTypeSerializable); - *dom_file_system = - web_dom_file_system.ToV8Value(context->Global(), context->GetIsolate()); + *dom_file_system = web_dom_file_system.ToV8Value(context->GetIsolate()); return true; }
diff --git a/content/renderer/pepper/v8_var_converter.cc b/content/renderer/pepper/v8_var_converter.cc index 963db8a..d0c037b 100644 --- a/content/renderer/pepper/v8_var_converter.cc +++ b/content/renderer/pepper/v8_var_converter.cc
@@ -155,7 +155,7 @@ HostArrayBufferVar* host_buffer = static_cast<HostArrayBufferVar*>(buffer); *result = blink::WebArrayBufferConverter::ToV8Value( - &host_buffer->webkit_buffer(), context->Global(), isolate); + &host_buffer->webkit_buffer(), isolate); break; } case PP_VARTYPE_ARRAY:
diff --git a/content/renderer/skia_benchmarking_extension.cc b/content/renderer/skia_benchmarking_extension.cc index bd40e8d..07834d1 100644 --- a/content/renderer/skia_benchmarking_extension.cc +++ b/content/renderer/skia_benchmarking_extension.cc
@@ -234,7 +234,7 @@ .Set("width", snapped_clip.width()) .Set("height", snapped_clip.height()) .Set("data", blink::WebArrayBufferConverter::ToV8Value( - &buffer, context->Global(), isolate)) + &buffer, isolate)) .Build()); }
diff --git a/content/test/content_test_bundle_data.filelist b/content/test/content_test_bundle_data.filelist index a068a94..cd74617 100644 --- a/content/test/content_test_bundle_data.filelist +++ b/content/test/content_test_bundle_data.filelist
@@ -5481,6 +5481,8 @@ data/attribution_reporting/aggregatable_report_goldens/latest/report_7_cleartext_payloads.json data/attribution_reporting/aggregatable_report_goldens/latest/report_8.json data/attribution_reporting/aggregatable_report_goldens/latest/report_8_cleartext_payloads.json +data/attribution_reporting/aggregatable_report_goldens/latest/report_9.json +data/attribution_reporting/aggregatable_report_goldens/latest/report_9_cleartext_payloads.json data/attribution_reporting/aggregatable_report_goldens/latest/report_gcp_1.json data/attribution_reporting/aggregatable_report_goldens/latest/report_gcp_1_cleartext_payloads.json data/attribution_reporting/aggregatable_report_goldens/latest/report_gcp_2.json @@ -5497,6 +5499,8 @@ data/attribution_reporting/aggregatable_report_goldens/latest/report_gcp_7_cleartext_payloads.json data/attribution_reporting/aggregatable_report_goldens/latest/report_gcp_8.json data/attribution_reporting/aggregatable_report_goldens/latest/report_gcp_8_cleartext_payloads.json +data/attribution_reporting/aggregatable_report_goldens/latest/report_gcp_9.json +data/attribution_reporting/aggregatable_report_goldens/latest/report_gcp_9_cleartext_payloads.json data/attribution_reporting/aggregatable_report_goldens/version_/private_key.txt data/attribution_reporting/aggregatable_report_goldens/version_/public_key.json data/attribution_reporting/aggregatable_report_goldens/version_/report_1.json @@ -5522,6 +5526,7 @@ data/attribution_reporting/interop/aggregatable_contributions_creation.json data/attribution_reporting/interop/aggregatable_dedup_key.json data/attribution_reporting/interop/aggregatable_large_key.json +data/attribution_reporting/interop/aggregatable_report_trigger_context_id.json data/attribution_reporting/interop/aggregatable_report_window.json data/attribution_reporting/interop/aggregatable_storage_limit.json data/attribution_reporting/interop/aggregatable_with_event_disabled.json
diff --git a/content/test/data/attribution_reporting/aggregatable_report_goldens/latest/report_9.json b/content/test/data/attribution_reporting/aggregatable_report_goldens/latest/report_9.json new file mode 100644 index 0000000..3ca85b8b --- /dev/null +++ b/content/test/data/attribution_reporting/aggregatable_report_goldens/latest/report_9.json
@@ -0,0 +1,9 @@ +{ + "aggregation_coordinator_origin": "https://publickeyservice.msmt.aws.privacysandboxservices.com", + "aggregation_service_payloads": [ { + "key_id": "example_id", + "payload": "hR9Peif1FVr1+QSK6lK5LxAGuJDIOoArZwo8nkcc7UcfLZf0BOy9tUS4A2smDniFyM/3EhZN+3oZQJjDNmiurcDy459pVma3SDFIyLfUbY+m7ekkupW7l34L2pxvE3fo65YvyJ4ypU26Lizw7yauYQOss/vW0hi410FKQG1wrr7dGCioosMPVJT6wiAFqUEwAfiy+7cr4ed+Mv+YWD6HCmtL+/Zszl93CDNjNJXifQapyD6qVpwSatmcgWVkSuUrgbfPqOiyZvUiUy4aLmYFo8vNHhQUFZYqWh0HiiiHeFbrr9re5y6Tb5pRSLTGkPF5+DHYZgtdsiepWPQ4MIIfLgzrp7l/3bDEjHCYm902mIA1LzhXLNb0VGv+0Z2PhZ+hBTfkejMyyeApfCPcZGimXlaoEG8eNgwPoJDWNriJZJQvta1zl2Xhow8opaFjtl991dcscN+AFE/Z+cYJbYYSTh91/+CONxT7kK3KlTdfc1bnep+3YnzMIdg4tnwQ+gukU/Gd7BrC/pA+g7y5ucQkmnwHrV8j3gKB5dkeYyPF5wpSG5sXLS/Q6DoduwTRMjPYr0rMa00kqyTl0IKjG77z18oZ9lGXGAd8LMTRaP4VTWr4Gn7nNyzmG1xqUQkx3Cj4eQIzC+/fM05nXbNmomKf+07OClrXdHYwiYd9fRTwJqzt4H1gZ3cfK+BNh7wQd5WHmGGeg2JVsofmK3RecM2V0QMO/Py0JGSY+lmRRxhHqLdhaDjWzG3GNTgYkWTQGD3nRAFbKJKObe4pYUnl6D68ogG0IKiJkddvEUImMFrvoafSxLraEVTOz0jyLDp4SIvbAT1qQpvPEYbqq2w7C5TBuGCiRWEASPaVsVeOkUgsx/8/b9C0SH/ikfUWQkPbX/4vXQl8YBGfetn0eowKlxd+Hr4cAd6isl9DTOrU5A/Y3GYhqDnZRAIz42Q0v/i5hQ+HoDBt0OVkcnH0Hq5bbE/NG1lM+FJrUTYgOF5i6VYDeszyQvkcC+aQN2XADikzOwavykg1mX1iIW/9Y67+ls5HX8zdAVJw30IwK12X" + } ], + "shared_info": "{\"api\":\"attribution-reporting\",\"attribution_destination\":\"https://conversion.test\",\"report_id\":\"21abd97f-73e8-4b88-9389-a9fee6abda5e\",\"reporting_origin\":\"https://report.test\",\"scheduled_report_time\":\"1234486400\",\"source_registration_time\":\"0\",\"version\":\"0.1\"}", + "trigger_context_id": "example" +}
diff --git a/content/test/data/attribution_reporting/aggregatable_report_goldens/latest/report_9_cleartext_payloads.json b/content/test/data/attribution_reporting/aggregatable_report_goldens/latest/report_9_cleartext_payloads.json new file mode 100644 index 0000000..4df1a92f --- /dev/null +++ b/content/test/data/attribution_reporting/aggregatable_report_goldens/latest/report_9_cleartext_payloads.json
@@ -0,0 +1,3 @@ +[ + "omRkYXRhlKJldmFsdWVEAAAAAWZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAGlvcGVyYXRpb25paGlzdG9ncmFt" +] \ No newline at end of file
diff --git a/content/test/data/attribution_reporting/aggregatable_report_goldens/latest/report_gcp_9.json b/content/test/data/attribution_reporting/aggregatable_report_goldens/latest/report_gcp_9.json new file mode 100644 index 0000000..7c23d08 --- /dev/null +++ b/content/test/data/attribution_reporting/aggregatable_report_goldens/latest/report_gcp_9.json
@@ -0,0 +1,9 @@ +{ + "aggregation_coordinator_origin": "https://publickeyservice.msmt.gcp.privacysandboxservices.com", + "aggregation_service_payloads": [ { + "key_id": "example_id", + "payload": "hR9Peif1FVr1+QSK6lK5LxAGuJDIOoArZwo8nkcc7UcfLZf0BOy9tUS4A2smDniFyM/3EhZN+3oZQJjDNmiurcDy459pVma3SDFIyLfUbY+m7ekkupW7l34L2pxvE3fo65YvyJ4ypU26Lizw7yauYQOss/vW0hi410FKQG1wrr7dGCioosMPVJT6wiAFqUEwAfiy+7cr4ed+Mv+YWD6HCmtL+/Zszl93CDNjNJXifQapyD6qVpwSatmcgWVkSuUrgbfPqOiyZvUiUy4aLmYFo8vNHhQUFZYqWh0HiiiHeFbrr9re5y6Tb5pRSLTGkPF5+DHYZgtdsiepWPQ4MIIfLgzrp7l/3bDEjHCYm902mIA1LzhXLNb0VGv+0Z2PhZ+hBTfkejMyyeApfCPcZGimXlaoEG8eNgwPoJDWNriJZJQvta1zl2Xhow8opaFjtl991dcscN+AFE/Z+cYJbYYSTh91/+CONxT7kK3KlTdfc1bnep+3YnzMIdg4tnwQ+gukU/Gd7BrC/pA+g7y5ucQkmnwHrV8j3gKB5dkeYyPF5wpSG5sXLS/Q6DoduwTRMjPYr0rMa00kqyTl0IKjG77z18oZ9lGXGAd8LMTRaP4VTWr4Gn7nNyzmG1xqUQkx3Cj4eQIzC+/fM05nXbNmomKf+07OClrXdHYwiYd9fRTwJqzt4H1gZ3cfK+BNh7wQd5WHmGGeg2JVsofmK3RecM2V0QMO/Py0JGSY+lmRRxhHqLdhaDjWzG3GNTgYkWTQGD3nRAFbKJKObe4pYUnl6D68ogG0IKiJkddvEUImMFrvoafSxLraEVTOz0jyLDp4SIvbAT1qQpvPEYbqq2w7C5TBuGCiRWEASPaVsVeOkUgsx/8/b9C0SH/ikfUWQkPbX/4vXQl8YBGfetn0eowKlxd+Hr4cAd6isl9DTOrU5A/Y3GYhqDnZRAIz42Q0v/i5hQ+HoDBt0OVkcnH0Hq5bbE/NG1lM+FJrUTYgOF5i6VYDeszyQvkcC+aQN2XADikzOwavykg1mX1iIW/9Y67+ls5HX8zdAVJw30IwK12X" + } ], + "shared_info": "{\"api\":\"attribution-reporting\",\"attribution_destination\":\"https://conversion.test\",\"report_id\":\"21abd97f-73e8-4b88-9389-a9fee6abda5e\",\"reporting_origin\":\"https://report.test\",\"scheduled_report_time\":\"1234486400\",\"source_registration_time\":\"0\",\"version\":\"0.1\"}", + "trigger_context_id": "example" +}
diff --git a/content/test/data/attribution_reporting/aggregatable_report_goldens/latest/report_gcp_9_cleartext_payloads.json b/content/test/data/attribution_reporting/aggregatable_report_goldens/latest/report_gcp_9_cleartext_payloads.json new file mode 100644 index 0000000..4df1a92f --- /dev/null +++ b/content/test/data/attribution_reporting/aggregatable_report_goldens/latest/report_gcp_9_cleartext_payloads.json
@@ -0,0 +1,3 @@ +[ + "omRkYXRhlKJldmFsdWVEAAAAAWZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAKJldmFsdWVEAAAAAGZidWNrZXRQAAAAAAAAAAAAAAAAAAAAAGlvcGVyYXRpb25paGlzdG9ncmFt" +] \ No newline at end of file
diff --git a/content/test/data/attribution_reporting/interop/aggregatable_report_trigger_context_id.json b/content/test/data/attribution_reporting/interop/aggregatable_report_trigger_context_id.json new file mode 100644 index 0000000..523256e --- /dev/null +++ b/content/test/data/attribution_reporting/interop/aggregatable_report_trigger_context_id.json
@@ -0,0 +1,149 @@ +{ + "description": "Aggregatable report with trigger context ID", + "needs_trigger_context_id": true, + "input": { + "registrations": [ + { + "timestamp": "0", + "registration_request": { + "context_origin": "https://source.test", + "attribution_src_url": "https://reporter.test/register-source", + "source_type": "navigation" + }, + "responses": [ + { + "url": "https://reporter.test/register-source", + "response": { + "Attribution-Reporting-Register-Source": { + "destination": "https://destination.test", + "source_event_id": "123", + "aggregation_keys": { + "a": "0x159" + } + } + } + } + ] + }, + { + "timestamp": "1", + "registration_request": { + "attribution_src_url": "https://reporter.test/register-trigger", + "context_origin": "https://destination.test" + }, + "responses": [ + { + "url": "https://reporter.test/register-trigger", + "response": { + "Attribution-Reporting-Register-Trigger": { + "trigger_context_id": 456 // wrong type + } + } + } + ] + }, + { + "timestamp": "2", + "registration_request": { + "attribution_src_url": "https://reporter.test/register-trigger", + "context_origin": "https://destination.test" + }, + "responses": [ + { + "url": "https://reporter.test/register-trigger", + "response": { + "Attribution-Reporting-Register-Trigger": { + "trigger_context_id": "" // empty + } + } + } + ] + }, + { + "timestamp": "3", + "registration_request": { + "attribution_src_url": "https://reporter.test/register-trigger", + "context_origin": "https://destination.test" + }, + "responses": [ + { + "url": "https://reporter.test/register-trigger", + "response": { + "Attribution-Reporting-Register-Trigger": { + "trigger_context_id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" // too long + } + } + } + ] + }, + { + "timestamp": "4", + "registration_request": { + "attribution_src_url": "https://reporter.test/register-trigger", + "context_origin": "https://destination.test" + }, + "responses": [ + { + "url": "https://reporter.test/register-trigger", + "response": { + "Attribution-Reporting-Register-Trigger": { + "aggregatable_source_registration_time": "include", + "trigger_context_id": "123" // not allowed + } + } + } + ] + }, + { + "timestamp": "5", + "registration_request": { + "attribution_src_url": "https://reporter.test/register-trigger", + "context_origin": "https://destination.test" + }, + "responses": [ + { + "url": "https://reporter.test/register-trigger", + "response": { + "Attribution-Reporting-Register-Trigger": { + "aggregatable_trigger_data": [ + { + "source_keys": ["a"], + "key_piece": "0x400" + } + ], + "aggregatable_values": { + "a": 123 + }, + "trigger_context_id": "456" + } + } + } + ] + } + ] + }, + "output": { + "unparsable_registrations": [ + {"time": "1", "type": "trigger"}, + {"time": "2", "type": "trigger"}, + {"time": "3", "type": "trigger"}, + {"time": "4", "type": "trigger"} + ], + "reports": [ + { + "payload": { + "attribution_destination": "https://destination.test", + "histograms": [ + { + "key": "0x559", + "value": 123 + } + ], + "trigger_context_id": "456" + }, + "report_url": "https://reporter.test/.well-known/attribution-reporting/report-aggregate-attribution", + "report_time": "5" + } + ] + } +}
diff --git a/content/test/fuzzer/fuzzer_support.cc b/content/test/fuzzer/fuzzer_support.cc index fba907e..48d2abe 100644 --- a/content/test/fuzzer/fuzzer_support.cc +++ b/content/test/fuzzer/fuzzer_support.cc
@@ -40,7 +40,7 @@ Env::Env() { base::CommandLine::Init(0, nullptr); - base::FeatureList::InitializeInstance(std::string(), std::string()); + base::FeatureList::InitInstance(std::string(), std::string()); base::i18n::InitializeICU(); TestTimeouts::Initialize();
diff --git a/content/web_test/renderer/test_runner.cc b/content/web_test/renderer/test_runner.cc index a399e6b..291954cc 100644 --- a/content/web_test/renderer/test_runner.cc +++ b/content/web_test/renderer/test_runner.cc
@@ -141,8 +141,7 @@ bool read = bitmap.readPixels(info, buffer.Data(), row_bytes, 0, 0); CHECK(read); - args.push_back(blink::WebArrayBufferConverter::ToV8Value( - &buffer, isolate->GetCurrentContext()->Global(), isolate)); + args.push_back(blink::WebArrayBufferConverter::ToV8Value(&buffer, isolate)); return args; }
diff --git a/device/vr/BUILD.gn b/device/vr/BUILD.gn index c05e687..2d62f6a 100644 --- a/device/vr/BUILD.gn +++ b/device/vr/BUILD.gn
@@ -194,6 +194,8 @@ "openxr/openxr_extension_helper.h", "openxr/openxr_graphics_binding.cc", "openxr/openxr_graphics_binding.h", + "openxr/openxr_hand_tracker.cc", + "openxr/openxr_hand_tracker.h", "openxr/openxr_input_helper.cc", "openxr/openxr_input_helper.h", "openxr/openxr_interaction_profile_paths.h",
diff --git a/device/vr/openxr/openxr_controller.cc b/device/vr/openxr/openxr_controller.cc index b9adbad4..4b6aecb 100644 --- a/device/vr/openxr/openxr_controller.cc +++ b/device/vr/openxr/openxr_controller.cc
@@ -38,104 +38,6 @@ return std::string("/user/hand/") + GetStringFromType(type); } -static constexpr mojom::XRHandJoint OpenXRHandJointToMojomJoint( - XrHandJointEXT openxr_joint) { - DCHECK_NE(openxr_joint, XR_HAND_JOINT_PALM_EXT); - // The OpenXR joints have palm at 0, but from that point are the same as the - // mojom joints. Hence they are offset by 1. - return static_cast<mojom::XRHandJoint>(openxr_joint - 1); -} - -// Enforce that the conversion is correct at compilation time. -// The mojom hand joints must match the WebXR spec. If these are ever out of -// sync, this mapping will need to be updated. -static_assert(mojom::XRHandJoint::kWrist == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_WRIST_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert( - mojom::XRHandJoint::kThumbMetacarpal == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_THUMB_METACARPAL_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert(mojom::XRHandJoint::kThumbPhalanxProximal == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_THUMB_PROXIMAL_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert(mojom::XRHandJoint::kThumbPhalanxDistal == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_THUMB_DISTAL_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert(mojom::XRHandJoint::kThumbTip == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_THUMB_TIP_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert( - mojom::XRHandJoint::kIndexFingerMetacarpal == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_INDEX_METACARPAL_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert(mojom::XRHandJoint::kIndexFingerPhalanxProximal == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_INDEX_PROXIMAL_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert( - mojom::XRHandJoint::kIndexFingerPhalanxIntermediate == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_INDEX_INTERMEDIATE_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert(mojom::XRHandJoint::kIndexFingerPhalanxDistal == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_INDEX_DISTAL_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert(mojom::XRHandJoint::kIndexFingerTip == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_INDEX_TIP_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert( - mojom::XRHandJoint::kMiddleFingerMetacarpal == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_MIDDLE_METACARPAL_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert( - mojom::XRHandJoint::kMiddleFingerPhalanxProximal == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_MIDDLE_PROXIMAL_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert( - mojom::XRHandJoint::kMiddleFingerPhalanxIntermediate == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_MIDDLE_INTERMEDIATE_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert(mojom::XRHandJoint::kMiddleFingerPhalanxDistal == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_MIDDLE_DISTAL_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert(mojom::XRHandJoint::kMiddleFingerTip == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_MIDDLE_TIP_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert( - mojom::XRHandJoint::kRingFingerMetacarpal == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_RING_METACARPAL_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert(mojom::XRHandJoint::kRingFingerPhalanxProximal == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_RING_PROXIMAL_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert( - mojom::XRHandJoint::kRingFingerPhalanxIntermediate == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_RING_INTERMEDIATE_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert(mojom::XRHandJoint::kRingFingerPhalanxDistal == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_RING_DISTAL_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert(mojom::XRHandJoint::kRingFingerTip == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_RING_TIP_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert( - mojom::XRHandJoint::kPinkyFingerMetacarpal == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_LITTLE_METACARPAL_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert( - mojom::XRHandJoint::kPinkyFingerPhalanxProximal == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_LITTLE_PROXIMAL_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert( - mojom::XRHandJoint::kPinkyFingerPhalanxIntermediate == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_LITTLE_INTERMEDIATE_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert(mojom::XRHandJoint::kPinkyFingerPhalanxDistal == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_LITTLE_DISTAL_EXT), - "WebXR - OpenXR joint enum value mismatch"); -static_assert(mojom::XRHandJoint::kPinkyFingerTip == - OpenXRHandJointToMojomJoint(XR_HAND_JOINT_LITTLE_TIP_EXT), - "WebXR - OpenXR joint enum value mismatch"); - } // namespace OpenXrController::OpenXrController() @@ -163,10 +65,6 @@ if (pointer_pose_space_ != XR_NULL_HANDLE) { xrDestroySpace(pointer_pose_space_); } - if (hand_tracker_ != XR_NULL_HANDLE) { - extension_helper_->ExtensionMethods().xrDestroyHandTrackerEXT( - hand_tracker_); - } } XrResult OpenXrController::Initialize( OpenXrHandednessType type, @@ -181,6 +79,7 @@ session_ = session; path_helper_ = path_helper; extension_helper_ = &extension_helper; + hand_tracker_ = extension_helper_->CreateHandTracker(session_, type_); std::string action_set_name = std::string(GetStringFromType(type_)) + "_action_set"; @@ -324,15 +223,6 @@ return XR_SUCCESS; } -XrResult OpenXrController::InitializeHandTracking() { - XrHandTrackerCreateInfoEXT create_info{XR_TYPE_HAND_TRACKER_CREATE_INFO_EXT}; - create_info.hand = type_ == OpenXrHandednessType::kRight ? XR_HAND_RIGHT_EXT - : XR_HAND_LEFT_EXT; - create_info.handJointSet = XR_HAND_JOINT_SET_DEFAULT_EXT; - return extension_helper_->ExtensionMethods().xrCreateHandTrackerEXT( - session_, &create_info, &hand_tracker_); -} - uint32_t OpenXrController::GetId() const { return static_cast<uint32_t>(type_); } @@ -454,60 +344,11 @@ mojom::XRHandTrackingDataPtr OpenXrController::GetHandTrackingData( XrSpace mojo_space, XrTime predicted_display_time) { - // Lazy init hand tracking as we only need it if the app requests it. - if (hand_tracker_ == XR_NULL_HANDLE) { - if (XR_FAILED(InitializeHandTracking())) { - return nullptr; - } - } - - XrHandJointLocationEXT joint_locations_buffer[XR_HAND_JOINT_COUNT_EXT]; - XrHandJointLocationsEXT locations{XR_TYPE_HAND_JOINT_LOCATIONS_EXT}; - locations.jointCount = std::extent<decltype(joint_locations_buffer)>::value; - locations.jointLocations = joint_locations_buffer; - - XrHandJointsLocateInfoEXT locate_info{XR_TYPE_HAND_JOINTS_LOCATE_INFO_EXT}; - locate_info.baseSpace = mojo_space; - locate_info.time = predicted_display_time; - - if (XR_FAILED(extension_helper_->ExtensionMethods().xrLocateHandJointsEXT( - hand_tracker_, &locate_info, &locations)) || - !locations.isActive) { + if (!hand_tracker_) { return nullptr; } - mojom::XRHandTrackingDataPtr hand_tracking_data = - device::mojom::XRHandTrackingData::New(); - hand_tracking_data->hand_joint_data = - std::vector<mojom::XRHandJointDataPtr>{}; - - constexpr unsigned kNumWebXRJoints = - static_cast<unsigned>(mojom::XRHandJoint::kMaxValue) + 1u; - - // WebXR has one less joint than OpenXR. WebXR lacks the PALM joint which is - // the first joint in OpenXR - DCHECK_EQ(kNumWebXRJoints, XR_HAND_JOINT_COUNT_EXT - 1u); - hand_tracking_data->hand_joint_data.reserve(kNumWebXRJoints); - for (uint32_t i = 0; i < XR_HAND_JOINT_COUNT_EXT; i++) { - // We skip the palm joint as WebXR does not support it. All other joints are - // supported - if (i == XR_HAND_JOINT_PALM_EXT) { - static_assert(XR_HAND_JOINT_PALM_EXT == 0u, - "OpenXR palm joint expected to be the 0th joint"); - continue; - } - - mojom::XRHandJointDataPtr joint_data = - device::mojom::XRHandJointData::New(); - joint_data->joint = - OpenXRHandJointToMojomJoint(static_cast<XrHandJointEXT>(i)); - joint_data->mojo_from_joint = - XrPoseToGfxTransform(joint_locations_buffer[i].pose); - joint_data->radius = joint_locations_buffer[i].radius; - hand_tracking_data->hand_joint_data.push_back(std::move(joint_data)); - } - - return hand_tracking_data; + return hand_tracker_->GetHandTrackingData(mojo_space, predicted_display_time); } absl::optional<gfx::Transform> OpenXrController::GetMojoFromGripTransform(
diff --git a/device/vr/openxr/openxr_controller.h b/device/vr/openxr/openxr_controller.h index 90346115..d2e42c327 100644 --- a/device/vr/openxr/openxr_controller.h +++ b/device/vr/openxr/openxr_controller.h
@@ -12,6 +12,7 @@ #include <vector> #include "base/memory/raw_ptr.h" +#include "device/vr/openxr/openxr_hand_tracker.h" #include "device/vr/openxr/openxr_interaction_profiles.h" #include "device/vr/openxr/openxr_path_helper.h" #include "device/vr/public/mojom/vr_service.mojom.h" @@ -156,13 +157,14 @@ OpenXrHandednessType type_; XrInstance instance_; XrSession session_; - XrHandTrackerEXT hand_tracker_{XR_NULL_HANDLE}; XrActionSet action_set_; XrAction grip_pose_action_; XrSpace grip_pose_space_; XrAction pointer_pose_action_; XrSpace pointer_pose_space_; + std::unique_ptr<OpenXrHandTracker> hand_tracker_; + OpenXrInteractionProfileType interaction_profile_; std::unordered_map<OpenXrButtonType,
diff --git a/device/vr/openxr/openxr_extension_helper.cc b/device/vr/openxr/openxr_extension_helper.cc index f55e4fc1..22685ac 100644 --- a/device/vr/openxr/openxr_extension_helper.cc +++ b/device/vr/openxr/openxr_extension_helper.cc
@@ -146,7 +146,14 @@ case device::mojom::XRSessionFeature::ANCHORS: return IsExtensionSupported(XR_MSFT_SPATIAL_ANCHOR_EXTENSION_NAME); case device::mojom::XRSessionFeature::HAND_INPUT: - return IsExtensionSupported(XR_MSFT_HAND_INTERACTION_EXTENSION_NAME); + // We need the XR_EXT_HAND_TRACKING extension in order to supply the hand + // mesh required by the spec for the hand input feature. However, the hand + // mesh must be tied to an XrInputSource. In order to generate an + // XrInputSource we need to be able to send up a "primary action" event + // (i.e. a click), so we need to also check that we have an extension + // enabled that we can use to generate that. + return IsExtensionSupported(XR_EXT_HAND_TRACKING_EXTENSION_NAME) && + IsExtensionSupported(XR_MSFT_HAND_INTERACTION_EXTENSION_NAME); case device::mojom::XRSessionFeature::HIT_TEST: return IsExtensionSupported(XR_MSFT_SCENE_UNDERSTANDING_EXTENSION_NAME); case device::mojom::XRSessionFeature::SECONDARY_VIEWS: @@ -170,6 +177,16 @@ return std::make_unique<OpenXrAnchorManager>(*this, session, base_space); } +std::unique_ptr<OpenXrHandTracker> OpenXrExtensionHelper::CreateHandTracker( + XrSession session, + OpenXrHandednessType handedness) const { + if (IsExtensionSupported(XR_EXT_HAND_TRACKING_EXTENSION_NAME)) { + return std::make_unique<OpenXrHandTracker>(*this, session, handedness); + } + + return nullptr; +} + std::unique_ptr<OpenXRSceneUnderstandingManager> OpenXrExtensionHelper::CreateSceneUnderstandingManager( XrSession session,
diff --git a/device/vr/openxr/openxr_extension_helper.h b/device/vr/openxr/openxr_extension_helper.h index eddb4c6..aa2ba4f 100644 --- a/device/vr/openxr/openxr_extension_helper.h +++ b/device/vr/openxr/openxr_extension_helper.h
@@ -11,6 +11,7 @@ #include "base/logging.h" #include "base/memory/raw_ptr.h" #include "device/vr/openxr/openxr_anchor_manager.h" +#include "device/vr/openxr/openxr_hand_tracker.h" #include "device/vr/openxr/openxr_platform.h" #include "device/vr/openxr/openxr_scene_understanding_manager.h" #include "device/vr/openxr/openxr_stage_bounds_provider.h" @@ -95,6 +96,10 @@ XrSession session, XrSpace base_space) const; + std::unique_ptr<OpenXrHandTracker> CreateHandTracker( + XrSession session, + OpenXrHandednessType handedness) const; + std::unique_ptr<OpenXRSceneUnderstandingManager> CreateSceneUnderstandingManager(XrSession session, XrSpace base_space) const;
diff --git a/device/vr/openxr/openxr_hand_tracker.cc b/device/vr/openxr/openxr_hand_tracker.cc new file mode 100644 index 0000000..0504b2c --- /dev/null +++ b/device/vr/openxr/openxr_hand_tracker.cc
@@ -0,0 +1,202 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "device/vr/openxr/openxr_hand_tracker.h" + +#include <vector> + +#include "device/vr/openxr/openxr_extension_helper.h" +#include "device/vr/openxr/openxr_interaction_profiles.h" +#include "device/vr/openxr/openxr_util.h" +#include "device/vr/public/mojom/vr_service.mojom.h" +#include "third_party/openxr/src/include/openxr/openxr.h" + +namespace device { + +namespace { +static constexpr mojom::XRHandJoint OpenXRHandJointToMojomJoint( + XrHandJointEXT openxr_joint) { + CHECK_NE(openxr_joint, XR_HAND_JOINT_PALM_EXT); + // The OpenXR joints have palm at 0, but from that point are the same as the + // mojom joints. Hence they are offset by 1. + return static_cast<mojom::XRHandJoint>(openxr_joint - 1); +} + +constexpr unsigned kNumWebXRJoints = + static_cast<unsigned>(mojom::XRHandJoint::kMaxValue) + 1u; + +// WebXR doesn't expose the palm joint, so there's not a corresponding mojom +// value to check, but validate which index we're skipping for it. +static_assert(XR_HAND_JOINT_PALM_EXT == 0u, + "OpenXR palm joint expected to be the 0th joint"); + +// Because we do not expose the PALM joint (which is the first joint in OpenXR), +// we have one less joint than OpenXR. +static_assert(kNumWebXRJoints == XR_HAND_JOINT_COUNT_EXT - 1u); + +// Enforce that the conversion is correct at compilation time. +// The mojom hand joints must match the WebXR spec. If these are ever out of +// sync, this mapping will need to be updated. +static_assert(mojom::XRHandJoint::kWrist == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_WRIST_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert( + mojom::XRHandJoint::kThumbMetacarpal == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_THUMB_METACARPAL_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert(mojom::XRHandJoint::kThumbPhalanxProximal == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_THUMB_PROXIMAL_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert(mojom::XRHandJoint::kThumbPhalanxDistal == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_THUMB_DISTAL_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert(mojom::XRHandJoint::kThumbTip == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_THUMB_TIP_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert( + mojom::XRHandJoint::kIndexFingerMetacarpal == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_INDEX_METACARPAL_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert(mojom::XRHandJoint::kIndexFingerPhalanxProximal == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_INDEX_PROXIMAL_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert( + mojom::XRHandJoint::kIndexFingerPhalanxIntermediate == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_INDEX_INTERMEDIATE_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert(mojom::XRHandJoint::kIndexFingerPhalanxDistal == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_INDEX_DISTAL_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert(mojom::XRHandJoint::kIndexFingerTip == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_INDEX_TIP_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert( + mojom::XRHandJoint::kMiddleFingerMetacarpal == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_MIDDLE_METACARPAL_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert( + mojom::XRHandJoint::kMiddleFingerPhalanxProximal == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_MIDDLE_PROXIMAL_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert( + mojom::XRHandJoint::kMiddleFingerPhalanxIntermediate == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_MIDDLE_INTERMEDIATE_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert(mojom::XRHandJoint::kMiddleFingerPhalanxDistal == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_MIDDLE_DISTAL_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert(mojom::XRHandJoint::kMiddleFingerTip == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_MIDDLE_TIP_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert( + mojom::XRHandJoint::kRingFingerMetacarpal == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_RING_METACARPAL_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert(mojom::XRHandJoint::kRingFingerPhalanxProximal == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_RING_PROXIMAL_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert( + mojom::XRHandJoint::kRingFingerPhalanxIntermediate == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_RING_INTERMEDIATE_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert(mojom::XRHandJoint::kRingFingerPhalanxDistal == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_RING_DISTAL_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert(mojom::XRHandJoint::kRingFingerTip == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_RING_TIP_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert( + mojom::XRHandJoint::kPinkyFingerMetacarpal == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_LITTLE_METACARPAL_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert( + mojom::XRHandJoint::kPinkyFingerPhalanxProximal == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_LITTLE_PROXIMAL_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert( + mojom::XRHandJoint::kPinkyFingerPhalanxIntermediate == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_LITTLE_INTERMEDIATE_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert(mojom::XRHandJoint::kPinkyFingerPhalanxDistal == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_LITTLE_DISTAL_EXT), + "WebXR - OpenXR joint enum value mismatch"); +static_assert(mojom::XRHandJoint::kPinkyFingerTip == + OpenXRHandJointToMojomJoint(XR_HAND_JOINT_LITTLE_TIP_EXT), + "WebXR - OpenXR joint enum value mismatch"); +} // namespace + +OpenXrHandTracker::OpenXrHandTracker( + const OpenXrExtensionHelper& extension_helper, + XrSession session, + OpenXrHandednessType type) + : extension_helper_(extension_helper), session_(session), type_(type) {} + +OpenXrHandTracker::~OpenXrHandTracker() { + if (hand_tracker_ != XR_NULL_HANDLE) { + extension_helper_->ExtensionMethods().xrDestroyHandTrackerEXT( + hand_tracker_); + } +} + +mojom::XRHandTrackingDataPtr OpenXrHandTracker::GetHandTrackingData( + XrSpace base_space, + XrTime predicted_display_time) { + // Lazy init hand tracking as we only need it if the app requests it. + if (hand_tracker_ == XR_NULL_HANDLE) { + if (XR_FAILED(InitializeHandTracking())) { + return nullptr; + } + } + + XrHandJointLocationEXT joint_locations_buffer[XR_HAND_JOINT_COUNT_EXT]; + XrHandJointLocationsEXT locations{XR_TYPE_HAND_JOINT_LOCATIONS_EXT}; + locations.jointCount = std::extent<decltype(joint_locations_buffer)>::value; + locations.jointLocations = joint_locations_buffer; + + XrHandJointsLocateInfoEXT locate_info{XR_TYPE_HAND_JOINTS_LOCATE_INFO_EXT}; + locate_info.baseSpace = base_space; + locate_info.time = predicted_display_time; + + if (XR_FAILED(extension_helper_->ExtensionMethods().xrLocateHandJointsEXT( + hand_tracker_, &locate_info, &locations)) || + !locations.isActive) { + return nullptr; + } + + mojom::XRHandTrackingDataPtr hand_tracking_data = + device::mojom::XRHandTrackingData::New(); + hand_tracking_data->hand_joint_data = + std::vector<mojom::XRHandJointDataPtr>{}; + + hand_tracking_data->hand_joint_data.reserve(kNumWebXRJoints); + for (uint32_t i = 0; i < XR_HAND_JOINT_COUNT_EXT; i++) { + // We skip the palm joint as WebXR does not support it. All other joints are + // supported + if (i == XR_HAND_JOINT_PALM_EXT) { + continue; + } + + mojom::XRHandJointDataPtr joint_data = + device::mojom::XRHandJointData::New(); + joint_data->joint = + OpenXRHandJointToMojomJoint(static_cast<XrHandJointEXT>(i)); + joint_data->mojo_from_joint = + XrPoseToGfxTransform(joint_locations_buffer[i].pose); + joint_data->radius = joint_locations_buffer[i].radius; + hand_tracking_data->hand_joint_data.push_back(std::move(joint_data)); + } + + return hand_tracking_data; +} + +XrResult OpenXrHandTracker::InitializeHandTracking() { + XrHandTrackerCreateInfoEXT create_info{XR_TYPE_HAND_TRACKER_CREATE_INFO_EXT}; + create_info.hand = type_ == OpenXrHandednessType::kRight ? XR_HAND_RIGHT_EXT + : XR_HAND_LEFT_EXT; + create_info.handJointSet = XR_HAND_JOINT_SET_DEFAULT_EXT; + return extension_helper_->ExtensionMethods().xrCreateHandTrackerEXT( + session_, &create_info, &hand_tracker_); +} + +} // namespace device
diff --git a/device/vr/openxr/openxr_hand_tracker.h b/device/vr/openxr/openxr_hand_tracker.h new file mode 100644 index 0000000..4b8c9d91 --- /dev/null +++ b/device/vr/openxr/openxr_hand_tracker.h
@@ -0,0 +1,39 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef DEVICE_VR_OPENXR_OPENXR_HAND_TRACKER_H_ +#define DEVICE_VR_OPENXR_OPENXR_HAND_TRACKER_H_ + +#include "base/memory/raw_ref.h" +#include "device/vr/public/mojom/vr_service.mojom-forward.h" +#include "third_party/openxr/src/include/openxr/openxr.h" + +namespace device { + +enum class OpenXrHandednessType; +class OpenXrExtensionHelper; + +class OpenXrHandTracker { + public: + OpenXrHandTracker(const OpenXrExtensionHelper& extension_helper, + XrSession session, + OpenXrHandednessType type); + virtual ~OpenXrHandTracker(); + + mojom::XRHandTrackingDataPtr GetHandTrackingData( + XrSpace base_space, + XrTime predicted_display_time); + + private: + XrResult InitializeHandTracking(); + + const raw_ref<const OpenXrExtensionHelper> extension_helper_; + XrSession session_; + OpenXrHandednessType type_; + XrHandTrackerEXT hand_tracker_{XR_NULL_HANDLE}; +}; + +} // namespace device + +#endif // DEVICE_VR_OPENXR_OPENXR_HAND_TRACKER_H_
diff --git a/device/vr/public/mojom/xr_device.mojom b/device/vr/public/mojom/xr_device.mojom index 00298696..3dcef536 100644 --- a/device/vr/public/mojom/xr_device.mojom +++ b/device/vr/public/mojom/xr_device.mojom
@@ -7,6 +7,8 @@ import "device/vr/public/mojom/xr_session.mojom"; // XRDeviceId is used in metrics, so don't reorder or reuse. +// When adding values here be sure to add a corresponding entry to the enum in +// tools/metrics/histograms/metadata/xr/enums.xml as well. enum XRDeviceId { WEB_TEST_DEVICE_ID = 0, // Fake device used by web_tests. FAKE_DEVICE_ID = 1, // Fake device used in unit tests.
diff --git a/docs/website b/docs/website index 6e489be..3ad9a16 160000 --- a/docs/website +++ b/docs/website
@@ -1 +1 @@ -Subproject commit 6e489be4eaddfb81f7a34feb9bb32529751afc8a +Subproject commit 3ad9a16c79e736566dbd597d88cdbe86878895c4
diff --git a/extensions/browser/extension_action.cc b/extensions/browser/extension_action.cc index 780dcfb..83ed94c 100644 --- a/extensions/browser/extension_action.cc +++ b/extensions/browser/extension_action.cc
@@ -111,7 +111,7 @@ } GURL ExtensionAction::GetPopupUrl(int tab_id) const { - return GetValue(&popup_url_, tab_id); + return GetValue(popup_url_, tab_id); } void ExtensionAction::SetIcon(int tab_id, const gfx::Image& image) { @@ -155,11 +155,11 @@ } gfx::Image ExtensionAction::GetExplicitlySetIcon(int tab_id) const { - return GetValue(&icon_, tab_id); + return GetValue(icon_, tab_id); } bool ExtensionAction::SetIsVisible(int tab_id, bool new_visibility) { - const bool old_visibility = GetValue(&is_visible_, tab_id); + const bool old_visibility = GetValue(is_visible_, tab_id); if (old_visibility == new_visibility) return false; @@ -321,7 +321,7 @@ // Determines which icon would be returned by |GetIcon|, and returns its width. int ExtensionAction::GetIconWidth(int tab_id) const { // If icon has been set, return its width. - gfx::Image icon = GetValue(&icon_, tab_id); + gfx::Image icon = GetValue(icon_, tab_id); if (!icon.IsEmpty()) return icon.Width(); // If there is a default icon, the icon width will be set depending on our @@ -336,14 +336,17 @@ bool ExtensionAction::GetIsVisibleInternal(int tab_id, bool include_declarative) const { - if (const bool* tab_is_visible = FindOrNull(&is_visible_, tab_id)) + if (const bool* tab_is_visible = base::FindOrNull(is_visible_, tab_id)) { return *tab_is_visible; + } if (include_declarative && base::Contains(declarative_show_count_, tab_id)) return true; - if (const bool* default_is_visible = FindOrNull(&is_visible_, kDefaultTabId)) + if (const bool* default_is_visible = + base::FindOrNull(is_visible_, kDefaultTabId)) { return *default_is_visible; + } return false; }
diff --git a/extensions/browser/extension_action.h b/extensions/browser/extension_action.h index 4d8ee60..d502f94 100644 --- a/extensions/browser/extension_action.h +++ b/extensions/browser/extension_action.h
@@ -11,6 +11,7 @@ #include <vector> #include "base/containers/contains.h" +#include "base/containers/map_util.h" #include "base/values.h" #include "extensions/common/api/extension_action/action_info.h" #include "extensions/common/constants.h" @@ -91,7 +92,7 @@ // If tab |tab_id| has a set title, return it. Otherwise, return // the default title. - std::string GetTitle(int tab_id) const { return GetValue(&title_, tab_id); } + std::string GetTitle(int tab_id) const { return GetValue(title_, tab_id); } // Icons are a bit different because the default value can be set to either a // bitmap or a path. However, conceptually, there is only one default icon. @@ -130,7 +131,7 @@ // Get the badge text that has been set using SetBadgeText for a tab, or the // default if no badge text was set. std::string GetExplicitlySetBadgeText(int tab_id) const { - return GetValue(&badge_text_, tab_id); + return GetValue(badge_text_, tab_id); } // Set this action's badge text color on a specific tab. @@ -140,7 +141,7 @@ // Get the text color for a tab, or the default color if no text color // was set. SkColor GetBadgeTextColor(int tab_id) const { - return GetValue(&badge_text_color_, tab_id); + return GetValue(badge_text_color_, tab_id); } // Set this action's badge background color on a specific tab. @@ -150,7 +151,7 @@ // Get the badge background color for a tab, or the default if no color // was set. SkColor GetBadgeBackgroundColor(int tab_id) const { - return GetValue(&badge_background_color_, tab_id); + return GetValue(badge_background_color_, tab_id); } // Set this ExtensionAction's DNR matched action count on a specific tab. @@ -160,7 +161,7 @@ // Get this ExtensionAction's DNR matched action count on a specific tab. // Returns -1 if no entry is found. int GetDNRActionCount(int tab_id) const { - return GetValue(&dnr_action_count_, tab_id); + return GetValue(dnr_action_count_, tab_id); } // Clear this ExtensionAction's DNR matched action count for all tabs. void ClearDNRActionCountForAllTabs() { dnr_action_count_.clear(); } @@ -252,21 +253,11 @@ (*map)[tab_id] = val; } - template <class Map> - static const typename Map::mapped_type* FindOrNull( - const Map* map, - const typename Map::key_type& key) { - typename Map::const_iterator iter = map->find(key); - if (iter == map->end()) - return NULL; - return &iter->second; - } - template <class T> - T GetValue(const std::map<int, T>* map, int tab_id) const { - if (const T* tab_value = FindOrNull(map, tab_id)) { + T GetValue(const std::map<int, T>& map, int tab_id) const { + if (const T* tab_value = base::FindOrNull(map, tab_id)) { return *tab_value; - } else if (const T* default_value = FindOrNull(map, kDefaultTabId)) { + } else if (const T* default_value = base::FindOrNull(map, kDefaultTabId)) { return *default_value; } else { return ValueTraits<T>::CreateEmpty();
diff --git a/extensions/browser/extension_registry_unittest.cc b/extensions/browser/extension_registry_unittest.cc index cd87a5a..98b9e69 100644 --- a/extensions/browser/extension_registry_unittest.cc +++ b/extensions/browser/extension_registry_unittest.cc
@@ -181,8 +181,7 @@ // Enabled is part of everything and the enabled list. EXPECT_TRUE( registry.GetExtensionById(enabled->id(), ExtensionRegistry::EVERYTHING)); - EXPECT_TRUE( - registry.GetExtensionById(enabled->id(), ExtensionRegistry::ENABLED)); + EXPECT_TRUE(registry.enabled_extensions().GetByID(enabled->id())); EXPECT_FALSE( registry.GetExtensionById(enabled->id(), ExtensionRegistry::DISABLED)); EXPECT_FALSE( @@ -193,8 +192,7 @@ // Disabled is part of everything and the disabled list. EXPECT_TRUE( registry.GetExtensionById(disabled->id(), ExtensionRegistry::EVERYTHING)); - EXPECT_FALSE( - registry.GetExtensionById(disabled->id(), ExtensionRegistry::ENABLED)); + EXPECT_FALSE(registry.enabled_extensions().GetByID(disabled->id())); EXPECT_TRUE( registry.GetExtensionById(disabled->id(), ExtensionRegistry::DISABLED)); EXPECT_FALSE( @@ -205,8 +203,7 @@ // Terminated is part of everything and the terminated list. EXPECT_TRUE(registry.GetExtensionById(terminated->id(), ExtensionRegistry::EVERYTHING)); - EXPECT_FALSE( - registry.GetExtensionById(terminated->id(), ExtensionRegistry::ENABLED)); + EXPECT_FALSE(registry.enabled_extensions().GetByID(terminated->id())); EXPECT_FALSE( registry.GetExtensionById(terminated->id(), ExtensionRegistry::DISABLED)); EXPECT_TRUE(registry.GetExtensionById(terminated->id(), @@ -217,8 +214,7 @@ // Blocklisted is part of everything and the blocklisted list. EXPECT_TRUE(registry.GetExtensionById(blocklisted->id(), ExtensionRegistry::EVERYTHING)); - EXPECT_FALSE( - registry.GetExtensionById(blocklisted->id(), ExtensionRegistry::ENABLED)); + EXPECT_FALSE(registry.enabled_extensions().GetByID(blocklisted->id())); EXPECT_FALSE(registry.GetExtensionById(blocklisted->id(), ExtensionRegistry::DISABLED)); EXPECT_FALSE(registry.GetExtensionById(blocklisted->id(),
diff --git a/extensions/browser/user_script_loader.cc b/extensions/browser/user_script_loader.cc index 1af3211..2b63f3c9 100644 --- a/extensions/browser/user_script_loader.cc +++ b/extensions/browser/user_script_loader.cc
@@ -82,9 +82,9 @@ if (host_id.type == mojom::HostID::HostType::kWebUi) return true; - const Extension* extension = - ExtensionRegistry::Get(browser_context) - ->GetExtensionById(host_id.id, ExtensionRegistry::ENABLED); + const Extension* extension = ExtensionRegistry::Get(browser_context) + ->enabled_extensions() + .GetByID(host_id.id); return extension && PermissionsData::CanExecuteScriptEverywhere( extension->id(), extension->location());
diff --git a/extensions/common/api/declarative/declarative_constants.h b/extensions/common/api/declarative/declarative_constants.h index 524c73178..333b08f 100644 --- a/extensions/common/api/declarative/declarative_constants.h +++ b/extensions/common/api/declarative/declarative_constants.h
@@ -7,8 +7,7 @@ #ifndef EXTENSIONS_COMMON_API_DECLARATIVE_DECLARATIVE_CONSTANTS_H_ #define EXTENSIONS_COMMON_API_DECLARATIVE_DECLARATIVE_CONSTANTS_H_ -namespace extensions { -namespace declarative_content_constants { +namespace extensions::declarative_content_constants { // Signals to which ContentRulesRegistries are registered. extern const char kOnPageChanged[]; @@ -41,7 +40,6 @@ kMaxValue = kRequestContentScript, }; -} // namespace declarative_content_constants -} // namespace extensions +} // namespace extensions::declarative_content_constants #endif // EXTENSIONS_COMMON_API_DECLARATIVE_DECLARATIVE_CONSTANTS_H_
diff --git a/extensions/common/api/declarative_net_request/constants.h b/extensions/common/api/declarative_net_request/constants.h index 8781a9c..ec3939c 100644 --- a/extensions/common/api/declarative_net_request/constants.h +++ b/extensions/common/api/declarative_net_request/constants.h
@@ -7,8 +7,7 @@ #include "base/types/id_type.h" -namespace extensions { -namespace declarative_net_request { +namespace extensions::declarative_net_request { // Permission name. extern const char kDeclarativeNetRequestPermission[]; @@ -97,7 +96,6 @@ extern const char kMatchResponseHeadersPath[]; extern const char kMatchExcludedResponseHeadersPath[]; -} // namespace declarative_net_request -} // namespace extensions +} // namespace extensions::declarative_net_request #endif // EXTENSIONS_COMMON_API_DECLARATIVE_NET_REQUEST_CONSTANTS_H_
diff --git a/extensions/common/api/declarative_net_request/dnr_manifest_data.h b/extensions/common/api/declarative_net_request/dnr_manifest_data.h index f59d42b1..bae4a672 100644 --- a/extensions/common/api/declarative_net_request/dnr_manifest_data.h +++ b/extensions/common/api/declarative_net_request/dnr_manifest_data.h
@@ -13,8 +13,7 @@ #include "extensions/common/api/declarative_net_request/constants.h" #include "extensions/common/extension.h" -namespace extensions { -namespace declarative_net_request { +namespace extensions::declarative_net_request { // Manifest data required for the kDeclarativeNetRequestKey manifest // key. @@ -78,7 +77,6 @@ ManifestIDToRulesetMap manifest_id_to_ruleset_map; }; -} // namespace declarative_net_request -} // namespace extensions +} // namespace extensions::declarative_net_request #endif // EXTENSIONS_COMMON_API_DECLARATIVE_NET_REQUEST_DNR_MANIFEST_DATA_H_
diff --git a/extensions/common/api/declarative_net_request/dnr_manifest_handler.h b/extensions/common/api/declarative_net_request/dnr_manifest_handler.h index 13142a6..8af2ae6 100644 --- a/extensions/common/api/declarative_net_request/dnr_manifest_handler.h +++ b/extensions/common/api/declarative_net_request/dnr_manifest_handler.h
@@ -7,8 +7,7 @@ #include "extensions/common/manifest_handler.h" -namespace extensions { -namespace declarative_net_request { +namespace extensions::declarative_net_request { // Parses the kDeclarativeNetRequestKey manifest key. class DNRManifestHandler : public ManifestHandler { @@ -28,7 +27,6 @@ base::span<const char* const> Keys() const override; }; -} // namespace declarative_net_request -} // namespace extensions +} // namespace extensions::declarative_net_request #endif // EXTENSIONS_COMMON_API_DECLARATIVE_NET_REQUEST_DNR_MANIFEST_HANDLER_H_
diff --git a/extensions/common/api/declarative_net_request/test_utils.h b/extensions/common/api/declarative_net_request/test_utils.h index 330cc7f..a5ba7c7f 100644 --- a/extensions/common/api/declarative_net_request/test_utils.h +++ b/extensions/common/api/declarative_net_request/test_utils.h
@@ -13,8 +13,7 @@ #include "extensions/common/api/declarative_net_request/constants.h" #include "extensions/common/url_pattern.h" -namespace extensions { -namespace declarative_net_request { +namespace extensions::declarative_net_request { struct DictionarySource { DictionarySource() = default; @@ -256,7 +255,6 @@ unsigned flags = ConfigFlag::kConfig_None, const std::string& extension_name = "Test Extension"); -} // namespace declarative_net_request -} // namespace extensions +} // namespace extensions::declarative_net_request #endif // EXTENSIONS_COMMON_API_DECLARATIVE_NET_REQUEST_TEST_UTILS_H_
diff --git a/extensions/common/extension_features.cc b/extensions/common/extension_features.cc index d4f11c3..589627a 100644 --- a/extensions/common/extension_features.cc +++ b/extensions/common/extension_features.cc
@@ -11,32 +11,26 @@ // API Features /////////////////////////////////////////////////////////////////////////////// -// Controls the availability of contentSettings.clipboard. BASE_FEATURE(kApiContentSettingsClipboard, "ApiContentSettingsClipboard", base::FEATURE_DISABLED_BY_DEFAULT); -// Controls the availability of the enterprise.kioskInput API. BASE_FEATURE(kApiEnterpriseKioskInput, "ApiEnterpriseKioskInput", base::FEATURE_ENABLED_BY_DEFAULT); -// Controls the availability of the ReadingList API. BASE_FEATURE(kApiReadingList, "ApiReadingList", base::FEATURE_ENABLED_BY_DEFAULT); -// Controls the availability of the userScripts API. BASE_FEATURE(kApiUserScripts, "ApiUserScripts", base::FEATURE_ENABLED_BY_DEFAULT); -// Controls the availability of the odfsConfigPrivate API. BASE_FEATURE(kApiOdfsConfigPrivate, "ApiOdfsConfigPrivate", base::FEATURE_DISABLED_BY_DEFAULT); -// Controls the availability of navigation to file URLs. BASE_FEATURE(kRestrictFileURLNavigation, "RestrictFileURLNavigation", base::FEATURE_ENABLED_BY_DEFAULT); @@ -47,95 +41,62 @@ // For historical reasons, this includes some APIs. Please don't add more. -// Whether extension contexts can use SharedArrayBuffers unconditionally (i.e. -// without requiring cross origin isolation). -// TODO(crbug.com/1184892): Flip this in M95. BASE_FEATURE(kAllowSharedArrayBuffersUnconditionally, "AllowSharedArrayBuffersUnconditionally", base::FEATURE_ENABLED_BY_DEFAULT); -// Enables the UI in the install prompt which lets a user choose to withhold -// requested host permissions by default. BASE_FEATURE(kAllowWithholdingExtensionPermissionsOnInstall, "AllowWithholdingExtensionPermissionsOnInstall", base::FEATURE_DISABLED_BY_DEFAULT); -// If enabled, calls RenderFrame::SetAllowsCrossBrowsingInstanceFrameLookup() in -// DidCreateScriptContext() instead of DidCommitProvisionalLoad() to avoid -// creating the script context too early which can be bad for performance. BASE_FEATURE(kAvoidEarlyExtensionScriptContextCreation, "AvoidEarlyExtensionScriptContextCreation", base::FEATURE_ENABLED_BY_DEFAULT); -// When enabled, then bad_message::ReceivedBadMessage will be called when -// browser receives an IPC from a content script and the IPC that unexpectedly -// claims to act on behalf of a given extension id, (i.e. even if the browser -// process things that renderer process never run content scripts from the -// extension). BASE_FEATURE(kCheckingNoExtensionIdInExtensionIpcs, "EMF_NO_EXTENSION_ID_FOR_EXTENSION_SOURCE", base::FEATURE_ENABLED_BY_DEFAULT); -// Determine if dynamic extension URLs are handled and redirected. BASE_FEATURE(kExtensionDynamicURLRedirection, "ExtensionDynamicURLRedirection", base::FEATURE_DISABLED_BY_DEFAULT); -// Side panel API availability. BASE_FEATURE(kExtensionSidePanelIntegration, "ExtensionSidePanelIntegration", base::FEATURE_ENABLED_BY_DEFAULT); -// IsValidSourceUrl enforcement for ExtensionHostMsg_OpenChannelToExtension IPC. BASE_FEATURE(kExtensionSourceUrlEnforcement, "ExtensionSourceUrlEnforcement", base::FEATURE_ENABLED_BY_DEFAULT); -// File Handlers. BASE_FEATURE(kExtensionWebFileHandlers, "ExtensionWebFileHandlers", base::FEATURE_ENABLED_BY_DEFAULT); -// If enabled, only manifest v3 extensions is allowed while v2 will be disabled. -// Note that this feature is now only checked by `ExtensionManagement` which -// represents enterprise extension configurations. Flip the feature will block -// mv2 extension by default but the error messages will improperly mention -// enterprise policy. BASE_FEATURE(kExtensionsManifestV3Only, "ExtensionsManifestV3Only", base::FEATURE_DISABLED_BY_DEFAULT); -// Enables enhanced site control for extensions and allowing the user to control -// site permissions. BASE_FEATURE(kExtensionsMenuAccessControl, "ExtensionsMenuAccessControl", base::FEATURE_DISABLED_BY_DEFAULT); -// If enabled, user permitted sites are granted access. This should only happen -// if kExtensionsMenuAccessControl is enabled, since it's the only entry point -// where user could set permitted sites. BASE_FEATURE(kExtensionsMenuAccessControlWithPermittedSites, "ExtensionsMenuAccessControlWithPermittedSitesName", base::FEATURE_DISABLED_BY_DEFAULT); -// Forces requests to go through WebRequestProxyingURLLoaderFactory. BASE_FEATURE(kForceWebRequestProxyForTest, "ForceWebRequestProxyForTest", base::FEATURE_DISABLED_BY_DEFAULT); -// Launches Native Host executables directly on Windows rather than using a -// cmd.exe process as a proxy. BASE_FEATURE(kLaunchWindowsNativeHostsDirectly, "LaunchWindowsNativeHostsDirectly", base::FEATURE_DISABLED_BY_DEFAULT); -// Controls whether extensions can use the new favicon fetching in Manifest V3. BASE_FEATURE(kNewExtensionFaviconHandling, "ExtensionsNewFaviconHandling", base::FEATURE_ENABLED_BY_DEFAULT); -// If enabled, allows APIs used by the webstore to be exposed on the URL for the -// new webstore. BASE_FEATURE(kNewWebstoreDomain, "NewWebstoreDomain", base::FEATURE_ENABLED_BY_DEFAULT); @@ -145,89 +106,50 @@ "ReportKeepaliveUkm", base::FEATURE_ENABLED_BY_DEFAULT); -// When enabled, causes extensions to allow access to certain APIs only if the -// user is in the developer mode. BASE_FEATURE(kRestrictDeveloperModeAPIs, "RestrictDeveloperModeAPIs", base::FEATURE_ENABLED_BY_DEFAULT); -// Reports Extensions.WebRequest.KeepaliveRequestFinished when enabled. -// Automatically disable extensions not included in the Safe Browsing CRX -// allowlist if the user has turned on Enhanced Safe Browsing (ESB). The -// extensions can be disabled at ESB opt-in time or when an extension is moved -// out of the allowlist. BASE_FEATURE(kSafeBrowsingCrxAllowlistAutoDisable, "SafeBrowsingCrxAllowlistAutoDisable", base::FEATURE_DISABLED_BY_DEFAULT); -// Controls whether we show an install friction dialog when an Enhanced Safe -// Browsing user tries to install an extension that is not included in the -// Safe Browsing CRX allowlist. This feature also controls if we show a warning -// in 'chrome://extensions' for extensions not included in the allowlist. BASE_FEATURE(kSafeBrowsingCrxAllowlistShowWarnings, "SafeBrowsingCrxAllowlistShowWarnings", base::FEATURE_ENABLED_BY_DEFAULT); -// When enabled, causes Manifest V3 (and greater) extensions to use structured -// cloning (instead of JSON serialization) for extension messaging, except when -// communicating with native messaging hosts. BASE_FEATURE(kStructuredCloningForMV3Messaging, "StructuredCloningForMV3Messaging", base::FEATURE_DISABLED_BY_DEFAULT); -// If enabled, APIs of the Telemetry Extension platform that have pending -// approval will be enabled. Read more about the platform here: -// https://chromium.googlesource.com/chromium/src/+/master/docs/telemetry_extension/README.md. BASE_FEATURE(kTelemetryExtensionPendingApprovalApi, "TelemetryExtensionPendingApprovalApi", base::FEATURE_DISABLED_BY_DEFAULT); -// If enabled, calling WebRequestEventRouter::Get will return an instance of the -// per-BrowserContext WebRequestEventRouter instead of the global singleton -// ExtensionWebRequestEventRouter. BASE_FEATURE(kUsePerBrowserContextWebRequestEventRouter, "kUsePerBrowserContextWebRequestEventRouter", base::FEATURE_ENABLED_BY_DEFAULT); -// Controls the <webview> tag behaviour changes proposed as part of the guest -// view MPArch migration. See -// https://docs.google.com/document/d/1RVbtvklXUg9QCNvMT0r-1qDwJNeQFGoTCOD1Ur9mDa4/edit?usp=sharing -// for details. BASE_FEATURE(kWebviewTagMPArchBehavior, "WebviewTagMPArchBehavior", base::FEATURE_ENABLED_BY_DEFAULT); -// If enabled, extensions installed from .zip files (from dev mode) are changed -// from installing in base::TEMP_DIR to .../<profile_dir>/UnpackedExtensions and -// persist until removed by the user. BASE_FEATURE(kExtensionsZipFileInstalledInProfileDir, "ExtensionsZipFileInstalledInProfileDir", base::FEATURE_ENABLED_BY_DEFAULT); -// If enabled, extensions with service workers use an optimized event -// dispatching flow that does not start the worker for every event. It only -// starts a worker if it is not already running. BASE_FEATURE(kExtensionsServiceWorkerOptimizedEventDispatch, "ExtensionsServiceWorkerOptimizedEventDispatch", base::FEATURE_DISABLED_BY_DEFAULT); -// If enabled, the button for visiting the chrome webstore in both the -// extensions menu in the app menu and the chrome://extensions sidebar will send -// the user to the new chrome webstore URL. BASE_FEATURE(kNewWebstoreURL, "NewWebstoreURL", base::FEATURE_DISABLED_BY_DEFAULT); -// Enables a relaxed rule count for "safe" dynqmic or session scoped rules above -// the current limit. If disabled, all dynamic and session scoped rules are -// treated as "safe" but the rule limit's value will be the stricter "unsafe" -// limit. BASE_FEATURE(kDeclarativeNetRequestSafeRuleLimits, "DeclarativeNetRequestSafeDynamicRules", base::FEATURE_ENABLED_BY_DEFAULT); -// Enables declarative net request rules to specify response headers as a -// matching condition. BASE_FEATURE(kDeclarativeNetRequestResponseHeaderMatching, "DeclarativeNetRequestResponseHeaderMatching", base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/extensions/common/extension_features.h b/extensions/common/extension_features.h index 6bead5f..a5438d9b 100644 --- a/extensions/common/extension_features.h +++ b/extensions/common/extension_features.h
@@ -34,11 +34,22 @@ // NOTE(devlin): If there are consistently enough of these in flux, it might // make sense to have their own file. +// Controls the availability of contentSettings.clipboard. BASE_DECLARE_FEATURE(kApiContentSettingsClipboard); + +// Controls the availability of the enterprise.kioskInput API. BASE_DECLARE_FEATURE(kApiEnterpriseKioskInput); + +// Controls the availability of the ReadingList API. BASE_DECLARE_FEATURE(kApiReadingList); + +// Controls the availability of the userScripts API. BASE_DECLARE_FEATURE(kApiUserScripts); + +// Controls the availability of the odfsConfigPrivate API. BASE_DECLARE_FEATURE(kApiOdfsConfigPrivate); + +// Controls the availability of navigation to file URLs. BASE_DECLARE_FEATURE(kRestrictFileURLNavigation); /////////////////////////////////////////////////////////////////////////////// @@ -47,28 +58,108 @@ // For historical reasons, this includes some APIs. Please don't add more. +// Whether extension contexts can use SharedArrayBuffers unconditionally (i.e. +// without requiring cross origin isolation). +// TODO(crbug.com/1184892): Flip this in M95. BASE_DECLARE_FEATURE(kAllowSharedArrayBuffersUnconditionally); + +// Enables the UI in the install prompt which lets a user choose to withhold +// requested host permissions by default. BASE_DECLARE_FEATURE(kAllowWithholdingExtensionPermissionsOnInstall); + +// If enabled, calls RenderFrame::SetAllowsCrossBrowsingInstanceFrameLookup() in +// DidCreateScriptContext() instead of DidCommitProvisionalLoad() to avoid +// creating the script context too early which can be bad for performance. BASE_DECLARE_FEATURE(kAvoidEarlyExtensionScriptContextCreation); + +// When enabled, then bad_message::ReceivedBadMessage will be called when +// browser receives an IPC from a content script and the IPC that unexpectedly +// claims to act on behalf of a given extension id, (i.e. even if the browser +// process things that renderer process never run content scripts from the +// extension). BASE_DECLARE_FEATURE(kCheckingNoExtensionIdInExtensionIpcs); + +// Determine if dynamic extension URLs are handled and redirected. BASE_DECLARE_FEATURE(kExtensionDynamicURLRedirection); + +// Side panel API availability. BASE_DECLARE_FEATURE(kExtensionSidePanelIntegration); -BASE_DECLARE_FEATURE(kExtensionsManifestV3Only); -BASE_DECLARE_FEATURE(kExtensionsMenuAccessControl); -BASE_DECLARE_FEATURE(kExtensionsMenuAccessControlWithPermittedSites); + +// IsValidSourceUrl enforcement for ExtensionHostMsg_OpenChannelToExtension IPC. BASE_DECLARE_FEATURE(kExtensionSourceUrlEnforcement); + +// File Handlers. BASE_DECLARE_FEATURE(kExtensionWebFileHandlers); + +// If enabled, only manifest v3 extensions is allowed while v2 will be disabled. +// Note that this feature is now only checked by `ExtensionManagement` which +// represents enterprise extension configurations. Flip the feature will block +// mv2 extension by default but the error messages will improperly mention +// enterprise policy. +BASE_DECLARE_FEATURE(kExtensionsManifestV3Only); + +// Enables enhanced site control for extensions and allowing the user to control +// site permissions. +BASE_DECLARE_FEATURE(kExtensionsMenuAccessControl); + +// If enabled, user permitted sites are granted access. This should only happen +// if kExtensionsMenuAccessControl is enabled, since it's the only entry point +// where user could set permitted sites. +BASE_DECLARE_FEATURE(kExtensionsMenuAccessControlWithPermittedSites); + +// Forces requests to go through WebRequestProxyingURLLoaderFactory. BASE_DECLARE_FEATURE(kForceWebRequestProxyForTest); + +// Launches Native Host executables directly on Windows rather than using a +// cmd.exe process as a proxy. BASE_DECLARE_FEATURE(kLaunchWindowsNativeHostsDirectly); + +// Controls whether extensions can use the new favicon fetching in Manifest V3. BASE_DECLARE_FEATURE(kNewExtensionFaviconHandling); + +// If enabled, allows APIs used by the webstore to be exposed on the URL for the +// new webstore. BASE_DECLARE_FEATURE(kNewWebstoreDomain); + +// To investigate signal beacon loss in crrev.com/c/2262402. BASE_DECLARE_FEATURE(kReportKeepaliveUkm); + +// When enabled, causes extensions to allow access to certain APIs only if the +// user is in the developer mode. BASE_DECLARE_FEATURE(kRestrictDeveloperModeAPIs); + +// Reports Extensions.WebRequest.KeepaliveRequestFinished when enabled. +// Automatically disable extensions not included in the Safe Browsing CRX +// allowlist if the user has turned on Enhanced Safe Browsing (ESB). The +// extensions can be disabled at ESB opt-in time or when an extension is moved +// out of the allowlist. BASE_DECLARE_FEATURE(kSafeBrowsingCrxAllowlistAutoDisable); + +// Controls whether we show an install friction dialog when an Enhanced Safe +// Browsing user tries to install an extension that is not included in the +// Safe Browsing CRX allowlist. This feature also controls if we show a warning +// in 'chrome://extensions' for extensions not included in the allowlist. BASE_DECLARE_FEATURE(kSafeBrowsingCrxAllowlistShowWarnings); + +// When enabled, causes Manifest V3 (and greater) extensions to use structured +// cloning (instead of JSON serialization) for extension messaging, except when +// communicating with native messaging hosts. BASE_DECLARE_FEATURE(kStructuredCloningForMV3Messaging); + +// If enabled, APIs of the Telemetry Extension platform that have pending +// approval will be enabled. Read more about the platform here: +// https://chromium.googlesource.com/chromium/src/+/master/docs/telemetry_extension/README.md. BASE_DECLARE_FEATURE(kTelemetryExtensionPendingApprovalApi); + +// If enabled, calling WebRequestEventRouter::Get will return an instance of the +// per-BrowserContext WebRequestEventRouter instead of the global singleton +// ExtensionWebRequestEventRouter. BASE_DECLARE_FEATURE(kUsePerBrowserContextWebRequestEventRouter); + +// Controls the <webview> tag behaviour changes proposed as part of the guest +// view MPArch migration. See +// https://docs.google.com/document/d/1RVbtvklXUg9QCNvMT0r-1qDwJNeQFGoTCOD1Ur9mDa4/edit?usp=sharing +// for details. BASE_DECLARE_FEATURE(kWebviewTagMPArchBehavior); /////////////////////////////////////////////////////////////////////////////// @@ -77,12 +168,31 @@ // See the guidance at the top of this file. /////////////////////////////////////////////////////////////////////////////// -BASE_DECLARE_FEATURE(kDeclarativeNetRequestResponseHeaderMatching); -BASE_DECLARE_FEATURE(kDeclarativeNetRequestSafeRuleLimits); -BASE_DECLARE_FEATURE(kExtensionsServiceWorkerOptimizedEventDispatch); +// If enabled, extensions installed from .zip files (from dev mode) are changed +// from installing in base::TEMP_DIR to .../<profile_dir>/UnpackedExtensions and +// persist until removed by the user. BASE_DECLARE_FEATURE(kExtensionsZipFileInstalledInProfileDir); + +// If enabled, extensions with service workers use an optimized event +// dispatching flow that does not start the worker for every event. It only +// starts a worker if it is not already running. +BASE_DECLARE_FEATURE(kExtensionsServiceWorkerOptimizedEventDispatch); + +// If enabled, the button for visiting the chrome webstore in both the +// extensions menu in the app menu and the chrome://extensions sidebar will send +// the user to the new chrome webstore URL. BASE_DECLARE_FEATURE(kNewWebstoreURL); +// Enables a relaxed rule count for "safe" dynqmic or session scoped rules above +// the current limit. If disabled, all dynamic and session scoped rules are +// treated as "safe" but the rule limit's value will be the stricter "unsafe" +// limit. +BASE_DECLARE_FEATURE(kDeclarativeNetRequestSafeRuleLimits); + +// Enables declarative net request rules to specify response headers as a +// matching condition. +BASE_DECLARE_FEATURE(kDeclarativeNetRequestResponseHeaderMatching); + } // namespace extensions_features #endif // EXTENSIONS_COMMON_EXTENSION_FEATURES_H_
diff --git a/extensions/common/features/feature_flags.cc b/extensions/common/features/feature_flags.cc index d875165..6786c24 100644 --- a/extensions/common/features/feature_flags.cc +++ b/extensions/common/features/feature_flags.cc
@@ -26,7 +26,6 @@ &extensions_features::kApiUserScripts, &extensions_features::kApiOdfsConfigPrivate, &extensions_features::kNewWebstoreDomain, - &extensions_features::kRestrictFileURLNavigation, &extensions_features::kTelemetryExtensionPendingApprovalApi, }; @@ -50,7 +49,22 @@ bool IsFeatureFlagEnabled(const std::string& feature_flag) { const base::Feature* feature = GetFeature(feature_flag); CHECK(feature) << feature_flag; - return base::FeatureList::IsEnabled(*feature); + + // If the feature list is initialized, use its value. + if (base::FeatureList::GetInstance()) { + return base::FeatureList::IsEnabled(*feature); + } + + // There's a chance the feature list isn't initialized. This can happen + // when the user appended the --pack-extension switch, in which case the + // pack job happens before the feature list is set up. In this case, + // use the feature's default state. + // This isn't a security risk in this case; packing an extension doesn't + // determine its functionality when installed (and anyone could pack an + // extension with any feature configuration). + // TODO(https://crbug.com/1506254): Remove this handling and rely on + // the FeatureList being initialized. + return feature->default_state == base::FEATURE_ENABLED_BY_DEFAULT; } ScopedFeatureFlagsOverride CreateScopedFeatureFlagsOverrideForTesting(
diff --git a/extensions/common/features/simple_feature.cc b/extensions/common/features/simple_feature.cc index 849a79f2..9aa1090 100644 --- a/extensions/common/features/simple_feature.cc +++ b/extensions/common/features/simple_feature.cc
@@ -676,10 +676,21 @@ if (!MatchesSessionTypes(session_type)) return CreateAvailability(INVALID_SESSION_TYPE, session_type); - if (check_developer_mode && - base::FeatureList::IsEnabled( - extensions_features::kRestrictDeveloperModeAPIs) && - developer_mode_only_ && !GetCurrentDeveloperMode(context_id)) { + // Check developer mode only if the corresponding feature is enabled. + // There's a chance this can be hit before the feature list is instantiated + // if the user appended the --pack-extension switch. In this case, use the + // feature's default value. + // TODO(https://crbug.com/1506254): Remove this handling and rely on + // the FeatureList being initialized. + bool dev_mode_feature_is_enabled = + base::FeatureList::GetInstance() + ? base::FeatureList::IsEnabled( + extensions_features::kRestrictDeveloperModeAPIs) + : extensions_features::kRestrictDeveloperModeAPIs.default_state == + base::FEATURE_ENABLED_BY_DEFAULT; + check_developer_mode &= dev_mode_feature_is_enabled; + if (check_developer_mode && developer_mode_only_ && + !GetCurrentDeveloperMode(context_id)) { return CreateAvailability(REQUIRES_DEVELOPER_MODE); }
diff --git a/extensions/common/image_util.h b/extensions/common/image_util.h index 7834ce59..9621026 100644 --- a/extensions/common/image_util.h +++ b/extensions/common/image_util.h
@@ -14,8 +14,7 @@ } // This file contains various utility functions for extension images and colors. -namespace extensions { -namespace image_util { +namespace extensions::image_util { // Returns whether an icon image is considered to be visible in its display // context. @@ -54,7 +53,6 @@ // Load a PNG image from a file into the destination bitmap. bool LoadPngFromFile(const base::FilePath& path, SkBitmap* dst); -} // namespace image_util -} // namespace extensions +} // namespace extensions::image_util #endif // EXTENSIONS_COMMON_IMAGE_UTIL_H_
diff --git a/extensions/common/manifest_handler_helpers.h b/extensions/common/manifest_handler_helpers.h index 0e51dc5c..b390be96 100644 --- a/extensions/common/manifest_handler_helpers.h +++ b/extensions/common/manifest_handler_helpers.h
@@ -14,8 +14,7 @@ class ExtensionIconSet; -namespace extensions { -namespace manifest_handler_helpers { +namespace extensions::manifest_handler_helpers { // Tokenize a dictionary path. std::vector<base::StringPiece> TokenizeDictionaryPath(base::StringPiece path); @@ -33,7 +32,6 @@ ExtensionIconSet* icons, std::u16string* error); -} // namespace manifest_handler_helpers -} // namespace extensions +} // namespace extensions::manifest_handler_helpers #endif // EXTENSIONS_COMMON_MANIFEST_HANDLER_HELPERS_H_
diff --git a/extensions/common/manifest_handlers/automation.h b/extensions/common/manifest_handlers/automation.h index 1cb873bd..f6fd781 100644 --- a/extensions/common/manifest_handlers/automation.h +++ b/extensions/common/manifest_handlers/automation.h
@@ -15,11 +15,9 @@ namespace extensions { -namespace api { -namespace extensions_manifest_types { +namespace api::extensions_manifest_types { struct Automation; } -} // namespace api class URLPatternSet; class AutomationManifestPermission;
diff --git a/extensions/common/manifest_handlers/oauth2_manifest_handler.h b/extensions/common/manifest_handlers/oauth2_manifest_handler.h index 2e1f346..56cc3957 100644 --- a/extensions/common/manifest_handlers/oauth2_manifest_handler.h +++ b/extensions/common/manifest_handlers/oauth2_manifest_handler.h
@@ -9,11 +9,9 @@ #include "extensions/common/manifest_handler.h" namespace extensions { -namespace api { -namespace oauth2 { +namespace api::oauth2 { struct OAuth2Info; -} // namespace oauth2 -} // namespace api +} // namespace api::oauth2 // Parses the "oauth2" manifest key. class OAuth2ManifestHandler : public ManifestHandler {
diff --git a/extensions/common/permissions/extensions_api_permissions.h b/extensions/common/permissions/extensions_api_permissions.h index 713ef16..5862c97 100644 --- a/extensions/common/permissions/extensions_api_permissions.h +++ b/extensions/common/permissions/extensions_api_permissions.h
@@ -9,13 +9,11 @@ #include "extensions/common/alias.h" #include "extensions/common/permissions/api_permission.h" -namespace extensions { -namespace api_permissions { +namespace extensions::api_permissions { base::span<const APIPermissionInfo::InitInfo> GetPermissionInfos(); base::span<const Alias> GetPermissionAliases(); -} // namespace api_permissions -} // namespace extensions +} // namespace extensions::api_permissions #endif // EXTENSIONS_COMMON_PERMISSIONS_EXTENSIONS_API_PERMISSIONS_H_
diff --git a/extensions/common/utils/content_script_utils.h b/extensions/common/utils/content_script_utils.h index 6ef0986..d3de4b59 100644 --- a/extensions/common/utils/content_script_utils.h +++ b/extensions/common/utils/content_script_utils.h
@@ -18,8 +18,7 @@ // Contains helper methods for parsing content script fields. -namespace extensions { -namespace script_parsing { +namespace extensions::script_parsing { // Returns the maximum length allowed in an individual script file. Scripts // above this length will not be loaded. @@ -90,7 +89,6 @@ ExtensionResource::SymlinkPolicy GetSymlinkPolicy(const Extension* extension); -} // namespace script_parsing -} // namespace extensions +} // namespace extensions::script_parsing #endif // EXTENSIONS_COMMON_UTILS_CONTENT_SCRIPT_UTILS_H_
diff --git a/extensions/renderer/api/dom_hooks_delegate.cc b/extensions/renderer/api/dom_hooks_delegate.cc index 931c6e6c..c75f09a2 100644 --- a/extensions/renderer/api/dom_hooks_delegate.cc +++ b/extensions/renderer/api/dom_hooks_delegate.cc
@@ -70,8 +70,7 @@ if (shadow_root.IsNull()) return v8::Null(script_context->isolate()); - return shadow_root.ToV8Value(script_context->v8_context()->Global(), - script_context->isolate()); + return shadow_root.ToV8Value(script_context->isolate()); } } // namespace extensions
diff --git a/extensions/renderer/api/file_system_natives.cc b/extensions/renderer/api/file_system_natives.cc index 7a41512..09707cde 100644 --- a/extensions/renderer/api/file_system_natives.cc +++ b/extensions/renderer/api/file_system_natives.cc
@@ -71,11 +71,10 @@ GURL root_url(storage::GetIsolatedFileSystemRootURIString( origin, file_system_id, optional_root_name)); - args.GetReturnValue().Set( - blink::WebDOMFileSystem::Create( - webframe, blink::kWebFileSystemTypeIsolated, - blink::WebString::FromUTF8(name), root_url) - .ToV8Value(context()->v8_context()->Global(), isolate)); + args.GetReturnValue().Set(blink::WebDOMFileSystem::Create( + webframe, blink::kWebFileSystemTypeIsolated, + blink::WebString::FromUTF8(name), root_url) + .ToV8Value(isolate)); } void FileSystemNatives::GetFileEntry( @@ -114,8 +113,7 @@ webframe, type, blink::WebString::FromUTF8(file_system_name), file_system_root_url) .CreateV8Entry(blink::WebString::FromUTF8(file_path_string), - entry_type, context()->v8_context()->Global(), - args.GetIsolate())); + entry_type, args.GetIsolate())); } void FileSystemNatives::CrackIsolatedFileSystemName(
diff --git a/extensions/renderer/set_icon_natives.cc b/extensions/renderer/set_icon_natives.cc index 0cec33331..1f916e9 100644 --- a/extensions/renderer/set_icon_natives.cc +++ b/extensions/renderer/set_icon_natives.cc
@@ -148,8 +148,8 @@ std::vector<uint8_t> s = skia::mojom::InlineBitmap::Serialize(&bitmap); blink::WebArrayBuffer buffer = blink::WebArrayBuffer::Create(s.size(), 1); memcpy(buffer.Data(), s.data(), s.size()); - *image_data_bitmap = blink::WebArrayBufferConverter::ToV8Value( - &buffer, context()->v8_context()->Global(), isolate); + *image_data_bitmap = + blink::WebArrayBufferConverter::ToV8Value(&buffer, isolate); return true; }
diff --git a/gpu/command_buffer/client/client_shared_image.cc b/gpu/command_buffer/client/client_shared_image.cc index 6aab9c1..2e4682a6 100644 --- a/gpu/command_buffer/client/client_shared_image.cc +++ b/gpu/command_buffer/client/client_shared_image.cc
@@ -6,6 +6,73 @@ namespace gpu { +ClientSharedImage::ScopedMapping::ScopedMapping() = default; +ClientSharedImage::ScopedMapping::~ScopedMapping() { + if (buffer_) { + buffer_->Unmap(); + } +} + +// static +std::unique_ptr<ClientSharedImage::ScopedMapping> +ClientSharedImage::ScopedMapping::Create( + gfx::GpuMemoryBuffer* gpu_memory_buffer) { + auto scoped_mapping = base::WrapUnique(new ScopedMapping()); + if (!scoped_mapping->Init(gpu_memory_buffer)) { + LOG(ERROR) << "ScopedMapping init failed."; + return nullptr; + } + return scoped_mapping; +} + +bool ClientSharedImage::ScopedMapping::Init( + gfx::GpuMemoryBuffer* gpu_memory_buffer) { + if (!gpu_memory_buffer) { + LOG(ERROR) << "No GpuMemoryBuffer."; + return false; + } + + if (!gpu_memory_buffer->Map()) { + LOG(ERROR) << "Failed to map the buffer."; + return false; + } + buffer_ = gpu_memory_buffer; + return true; +} + +void* ClientSharedImage::ScopedMapping::Memory(const uint32_t plane_index) { + CHECK(buffer_); + return buffer_->memory(plane_index); +} + +size_t ClientSharedImage::ScopedMapping::Stride(const uint32_t plane_index) { + CHECK(buffer_); + return buffer_->stride(plane_index); +} + +gfx::Size ClientSharedImage::ScopedMapping::Size() { + CHECK(buffer_); + return buffer_->GetSize(); +} + +gfx::BufferFormat ClientSharedImage::ScopedMapping::Format() { + CHECK(buffer_); + return buffer_->GetFormat(); +} + +bool ClientSharedImage::ScopedMapping::IsSharedMemory() { + CHECK(buffer_); + return buffer_->GetType() == gfx::GpuMemoryBufferType::SHARED_MEMORY_BUFFER; +} + +void ClientSharedImage::ScopedMapping::OnMemoryDump( + base::trace_event::ProcessMemoryDump* pmd, + const base::trace_event::MemoryAllocatorDumpGuid& buffer_dump_guid, + uint64_t tracing_process_id, + int importance) { + buffer_->OnMemoryDump(pmd, buffer_dump_guid, tracing_process_id, importance); +} + ClientSharedImage::ClientSharedImage(const Mailbox& mailbox) : ClientSharedImage(mailbox, nullptr) {} @@ -16,9 +83,8 @@ ClientSharedImage::~ClientSharedImage() = default; -std::unique_ptr<SharedImageInterface::ScopedMapping> ClientSharedImage::Map() { - auto scoped_mapping = - SharedImageInterface::ScopedMapping::Create(gpu_memory_buffer_.get()); +std::unique_ptr<ClientSharedImage::ScopedMapping> ClientSharedImage::Map() { + auto scoped_mapping = ScopedMapping::Create(gpu_memory_buffer_.get()); if (!scoped_mapping) { LOG(ERROR) << "Unable to create ScopedMapping"; }
diff --git a/gpu/command_buffer/client/client_shared_image.h b/gpu/command_buffer/client/client_shared_image.h index 323594c..89bb3b6 100644 --- a/gpu/command_buffer/client/client_shared_image.h +++ b/gpu/command_buffer/client/client_shared_image.h
@@ -17,12 +17,72 @@ class GPU_EXPORT ClientSharedImage : public base::RefCountedThreadSafe<ClientSharedImage> { public: + // Provides access to the CPU visible memory for the SharedImage if it is + // being used for CPU READ/WRITE and underlying resource(native buffers/shared + // memory) is CPU mappable. Memory and strides can be requested for each + // plane. + class GPU_EXPORT ScopedMapping { + public: + ~ScopedMapping(); + + // Returns a pointer to the beginning of the plane. + void* Memory(const uint32_t plane_index); + + // Returns plane stride. + size_t Stride(const uint32_t plane_index); + + // Returns the size of the buffer. + gfx::Size Size(); + + // Returns BufferFormat. + gfx::BufferFormat Format(); + + // Returns whether the underlying resource is shared memory. + bool IsSharedMemory(); + + // Dumps information about the memory backing this instance to |pmd|. + // The memory usage is attributed to |buffer_dump_guid|. + // |tracing_process_id| uniquely identifies the process owning the memory. + // |importance| is relevant only for the cases of co-ownership, the memory + // gets attributed to the owner with the highest importance. + void OnMemoryDump( + base::trace_event::ProcessMemoryDump* pmd, + const base::trace_event::MemoryAllocatorDumpGuid& buffer_dump_guid, + uint64_t tracing_process_id, + int importance); + + private: + friend class ClientSharedImage; + + ScopedMapping(); + static std::unique_ptr<ScopedMapping> Create( + gfx::GpuMemoryBuffer* gpu_memory_buffer); + + bool Init(gfx::GpuMemoryBuffer* gpu_memory_buffer); + + // ScopedMapping is essentially a wrapper around GpuMemoryBuffer for now for + // simplicity and will be removed later. + // TODO(crbug.com/1474697): Refactor/Rename GpuMemoryBuffer and its + // implementations as the end goal after all clients using GMB are + // converted to use the ScopedMapping and notion of GpuMemoryBuffer is being + // removed. + raw_ptr<gfx::GpuMemoryBuffer> buffer_; + }; + explicit ClientSharedImage(const Mailbox& mailbox); ClientSharedImage(const Mailbox& mailbox, std::unique_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer); const Mailbox& mailbox() { return mailbox_; } + // Returns a clone of the GpuMemoryBufferHandle associated with this ClientSI. + // Valid to call only if this instance was created with a non-null + // GpuMemoryBuffer. + gfx::GpuMemoryBufferHandle CloneGpuMemoryBufferHandle() const { + CHECK(gpu_memory_buffer_); + return gpu_memory_buffer_->CloneHandle(); + } + base::trace_event::MemoryAllocatorDumpGuid GetGUIDForTracing() { return gpu::GetSharedImageGUIDForTracing(mailbox_); } @@ -30,7 +90,7 @@ // Maps |mailbox| into CPU visible memory and returns a ScopedMapping object // which can be used to read/write to the CPU mapped memory. The SharedImage // backing this ClientSI must have been created with CPU_READ/CPU_WRITE usage. - std::unique_ptr<SharedImageInterface::ScopedMapping> Map(); + std::unique_ptr<ScopedMapping> Map(); static scoped_refptr<ClientSharedImage> CreateForTesting() { return base::MakeRefCounted<ClientSharedImage>(
diff --git a/gpu/command_buffer/client/shared_image_interface.cc b/gpu/command_buffer/client/shared_image_interface.cc index ee6bbc6..328cc17 100644 --- a/gpu/command_buffer/client/shared_image_interface.cc +++ b/gpu/command_buffer/client/shared_image_interface.cc
@@ -30,73 +30,6 @@ return base::MakeRefCounted<ClientSharedImage>(Mailbox()); } -SharedImageInterface::ScopedMapping::ScopedMapping() = default; -SharedImageInterface::ScopedMapping::~ScopedMapping() { - if (buffer_) { - buffer_->Unmap(); - } -} - -// static -std::unique_ptr<SharedImageInterface::ScopedMapping> -SharedImageInterface::ScopedMapping::Create( - gfx::GpuMemoryBuffer* gpu_memory_buffer) { - auto scoped_mapping = base::WrapUnique(new ScopedMapping()); - if (!scoped_mapping->Init(gpu_memory_buffer)) { - LOG(ERROR) << "ScopedMapping init failed."; - return nullptr; - } - return scoped_mapping; -} - -bool SharedImageInterface::ScopedMapping::Init( - gfx::GpuMemoryBuffer* gpu_memory_buffer) { - if (!gpu_memory_buffer) { - LOG(ERROR) << "No GpuMemoryBuffer."; - return false; - } - - if (!gpu_memory_buffer->Map()) { - LOG(ERROR) << "Failed to map the buffer."; - return false; - } - buffer_ = gpu_memory_buffer; - return true; -} - -void* SharedImageInterface::ScopedMapping::Memory(const uint32_t plane_index) { - CHECK(buffer_); - return buffer_->memory(plane_index); -} - -size_t SharedImageInterface::ScopedMapping::Stride(const uint32_t plane_index) { - CHECK(buffer_); - return buffer_->stride(plane_index); -} - -gfx::Size SharedImageInterface::ScopedMapping::Size() { - CHECK(buffer_); - return buffer_->GetSize(); -} - -gfx::BufferFormat SharedImageInterface::ScopedMapping::Format() { - CHECK(buffer_); - return buffer_->GetFormat(); -} - -bool SharedImageInterface::ScopedMapping::IsSharedMemory() { - CHECK(buffer_); - return buffer_->GetType() == gfx::GpuMemoryBufferType::SHARED_MEMORY_BUFFER; -} - -void SharedImageInterface::ScopedMapping::OnMemoryDump( - base::trace_event::ProcessMemoryDump* pmd, - const base::trace_event::MemoryAllocatorDumpGuid& buffer_dump_guid, - uint64_t tracing_process_id, - int importance) { - buffer_->OnMemoryDump(pmd, buffer_dump_guid, tracing_process_id, importance); -} - uint32_t SharedImageInterface::UsageForMailbox(const Mailbox& mailbox) { return 0u; }
diff --git a/gpu/command_buffer/client/shared_image_interface.h b/gpu/command_buffer/client/shared_image_interface.h index aa5dff2..5ba94377 100644 --- a/gpu/command_buffer/client/shared_image_interface.h +++ b/gpu/command_buffer/client/shared_image_interface.h
@@ -54,65 +54,12 @@ // synchronized using SyncTokens. See //docs/design/gpu_synchronization.md. class GPU_EXPORT SharedImageInterface { public: - // Provides access to the CPU visible memory for the mailbox if it is being - // used for CPU READ/WRITE and underlying resource(native buffers/shared - // memory) is CPU mappable. Memory and strides can be requested for each - // plane. - // TODO(blundell): Move this into ClientSharedImage. - class GPU_EXPORT ScopedMapping { - public: - ~ScopedMapping(); - - // Returns a pointer to the beginning of the plane. - void* Memory(const uint32_t plane_index); - - // Returns plane stride. - size_t Stride(const uint32_t plane_index); - - // Returns the size of the buffer. - gfx::Size Size(); - - // Returns BufferFormat. - gfx::BufferFormat Format(); - - // Returns whether the underlying resource is shared memory. - bool IsSharedMemory(); - - // Dumps information about the memory backing this instance to |pmd|. - // The memory usage is attributed to |buffer_dump_guid|. - // |tracing_process_id| uniquely identifies the process owning the memory. - // |importance| is relevant only for the cases of co-ownership, the memory - // gets attributed to the owner with the highest importance. - void OnMemoryDump( - base::trace_event::ProcessMemoryDump* pmd, - const base::trace_event::MemoryAllocatorDumpGuid& buffer_dump_guid, - uint64_t tracing_process_id, - int importance); - - private: - friend class ClientSharedImage; - - ScopedMapping(); - static std::unique_ptr<ScopedMapping> Create( - gfx::GpuMemoryBuffer* gpu_memory_buffer); - - bool Init(gfx::GpuMemoryBuffer* gpu_memory_buffer); - - // ScopedMapping is essentially a wrapper around GpuMemoryBuffer for now for - // simplicity and will be removed later. - // TODO(crbug.com/1474697): Refactor/Rename GpuMemoryBuffer and its - // implementations as the end goal after all clients using GMB are - // converted to use the ScopedMapping and notion of GpuMemoryBuffer is being - // removed. - raw_ptr<gfx::GpuMemoryBuffer> buffer_; - }; + virtual ~SharedImageInterface() = default; static std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferForUseByScopedMapping( GpuMemoryBufferHandleInfo handle_info); - virtual ~SharedImageInterface() = default; - // Creates a shared image of requested |format|, |size| and |color_space|. // |usage| is a combination of |SharedImageUsage| bits that describes which // API(s) the image will be used with.
diff --git a/gpu/command_buffer/tests/lpm/gl_lpm_fuzzer.cc b/gpu/command_buffer/tests/lpm/gl_lpm_fuzzer.cc index ac9ae43..90ecb36 100644 --- a/gpu/command_buffer/tests/lpm/gl_lpm_fuzzer.cc +++ b/gpu/command_buffer/tests/lpm/gl_lpm_fuzzer.cc
@@ -53,7 +53,7 @@ gl::kGLImplementationANGLEName); command_line->AppendSwitchASCII(switches::kUseANGLE, gl::kANGLEImplementationNullName); - base::FeatureList::InitializeInstance(std::string(), std::string()); + base::FeatureList::InitInstance(std::string(), std::string()); base::SingleThreadTaskExecutor io_task_executor(base::MessagePumpType::IO); #if BUILDFLAG(IS_OZONE) ui::OzonePlatform::InitializeForGPU(ui::OzonePlatform::InitParams());
diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc index 8dd5ff6..fa3d17c 100644 --- a/gpu/config/gpu_finch_features.cc +++ b/gpu/config/gpu_finch_features.cc
@@ -179,7 +179,7 @@ // unnecessary construction/destruction of GLTextures. BASE_FEATURE(kEnablePerContextGLTextureCache, "EnablePerContextGLTextureCache", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); // Detect front buffering condition and set buffer usage as such. // This is a killswitch to be removed once launched.
diff --git a/gpu/perftests/run_all_tests.cc b/gpu/perftests/run_all_tests.cc index 70508ee..bd9ca92a 100644 --- a/gpu/perftests/run_all_tests.cc +++ b/gpu/perftests/run_all_tests.cc
@@ -17,7 +17,7 @@ #endif static int RunHelper(base::TestSuite* test_suite) { - base::FeatureList::InitializeInstance(std::string(), std::string()); + base::FeatureList::InitInstance(std::string(), std::string()); std::unique_ptr<base::SingleThreadTaskExecutor> executor; #if BUILDFLAG(IS_OZONE) executor = std::make_unique<base::SingleThreadTaskExecutor>(
diff --git a/headless/lib/browser/headless_content_browser_client.cc b/headless/lib/browser/headless_content_browser_client.cc index 1122708..6a118e4 100644 --- a/headless/lib/browser/headless_content_browser_client.cc +++ b/headless/lib/browser/headless_content_browser_client.cc
@@ -5,6 +5,7 @@ #include "headless/lib/browser/headless_content_browser_client.h" #include <string> +#include <string_view> #include <unordered_set> #include <vector> @@ -15,7 +16,6 @@ #include "base/i18n/rtl.h" #include "base/path_service.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "build/build_config.h" #include "components/embedder_support/switches.h" @@ -213,7 +213,7 @@ HeadlessBrowserContextImpl::From( render_process_host->GetBrowserContext()); - std::vector<base::StringPiece> languages = base::SplitStringPiece( + std::vector<std::string_view> languages = base::SplitStringPiece( headless_browser_context_impl->options()->accept_language(), ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); if (!languages.empty()) {
diff --git a/headless/lib/headless_content_client.cc b/headless/lib/headless_content_client.cc index d726ba2..51987166 100644 --- a/headless/lib/headless_content_client.cc +++ b/headless/lib/headless_content_client.cc
@@ -18,7 +18,7 @@ return l10n_util::GetStringUTF16(message_id); } -base::StringPiece HeadlessContentClient::GetDataResource( +std::string_view HeadlessContentClient::GetDataResource( int resource_id, ui::ResourceScaleFactor scale_factor) { return ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
diff --git a/headless/lib/headless_content_client.h b/headless/lib/headless_content_client.h index 1cf4175f..985c0e42 100644 --- a/headless/lib/headless_content_client.h +++ b/headless/lib/headless_content_client.h
@@ -6,6 +6,7 @@ #define HEADLESS_LIB_HEADLESS_CONTENT_CLIENT_H_ #include <memory> +#include <string_view> #include "base/synchronization/lock.h" #include "content/public/common/content_client.h" @@ -27,7 +28,7 @@ // content::ContentClient implementation: std::u16string GetLocalizedString(int message_id) override; - base::StringPiece GetDataResource( + std::string_view GetDataResource( int resource_id, ui::ResourceScaleFactor scale_factor) override; base::RefCountedMemory* GetDataResourceBytes(int resource_id) override;
diff --git a/headless/public/util/error_reporter.cc b/headless/public/util/error_reporter.cc index ce95b49..84bf140 100644 --- a/headless/public/util/error_reporter.cc +++ b/headless/public/util/error_reporter.cc
@@ -29,7 +29,7 @@ path_.back() = name; } -void ErrorReporter::AddError(base::StringPiece description) { +void ErrorReporter::AddError(std::string_view description) { std::stringstream error; for (size_t i = 0; i < path_.size(); i++) { if (!path_[i]) {
diff --git a/headless/public/util/error_reporter.h b/headless/public/util/error_reporter.h index f764ad6..96cb08e 100644 --- a/headless/public/util/error_reporter.h +++ b/headless/public/util/error_reporter.h
@@ -6,10 +6,10 @@ #define HEADLESS_PUBLIC_UTIL_ERROR_REPORTER_H_ #include <string> +#include <string_view> #include <vector> #include "base/dcheck_is_on.h" -#include "base/strings/string_piece.h" #include "headless/public/headless_export.h" namespace headless { @@ -33,7 +33,7 @@ void SetName(const char* name); // Report an error in the current parsing context. - void AddError(base::StringPiece description); + void AddError(std::string_view description); // Returns true if any errors have been reported so far. bool HasErrors() const; @@ -47,7 +47,7 @@ void Push() {} void Pop() {} void SetName(const char* name) {} - void AddError(base::StringPiece description) {} + void AddError(std::string_view description) {} bool HasErrors() const { return false; } std::vector<std::string> errors() const { return {}; } std::string ToString() const { return ""; }
diff --git a/headless/test/headless_browser_test_utils.cc b/headless/test/headless_browser_test_utils.cc index 6f6a2c3a..542ef6c 100644 --- a/headless/test/headless_browser_test_utils.cc +++ b/headless/test/headless_browser_test_utils.cc
@@ -92,28 +92,28 @@ /////////////////////////////////////////////////////////////////////// // base::Value::Dict helpers. -std::string DictString(const base::Value::Dict& dict, base::StringPiece path) { +std::string DictString(const base::Value::Dict& dict, std::string_view path) { const std::string* result = dict.FindStringByDottedPath(path); CHECK(result) << "Missing value for '" << path << "' in:\n" << dict.DebugString(); return *result; } -int DictInt(const base::Value::Dict& dict, base::StringPiece path) { +int DictInt(const base::Value::Dict& dict, std::string_view path) { std::optional<int> result = dict.FindIntByDottedPath(path); CHECK(result) << "Missing value for '" << path << "' in:\n" << dict.DebugString(); return *result; } -bool DictBool(const base::Value::Dict& dict, base::StringPiece path) { +bool DictBool(const base::Value::Dict& dict, std::string_view path) { std::optional<bool> result = dict.FindBoolByDottedPath(path); CHECK(result) << "Missing value for '" << path << "' in:\n" << dict.DebugString(); return *result; } -bool DictHas(const base::Value::Dict& dict, base::StringPiece path) { +bool DictHas(const base::Value::Dict& dict, std::string_view path) { return dict.FindByDottedPath(path) != nullptr; }
diff --git a/headless/test/headless_browser_test_utils.h b/headless/test/headless_browser_test_utils.h index f947005..0659ceb 100644 --- a/headless/test/headless_browser_test_utils.h +++ b/headless/test/headless_browser_test_utils.h
@@ -6,8 +6,8 @@ #define HEADLESS_TEST_HEADLESS_BROWSER_TEST_UTILS_H_ #include <string> +#include <string_view> -#include "base/strings/string_piece.h" #include "base/values.h" #include "net/base/net_errors.h" #include "testing/gmock/include/gmock/gmock-matchers.h" @@ -47,7 +47,7 @@ // Convenience function to create a single key/value Dict. template <typename T> -base::Value::Dict Param(base::StringPiece key, T&& value) { +base::Value::Dict Param(std::string_view key, T&& value) { base::Value::Dict param; param.Set(key, std::move(value)); return param; @@ -55,10 +55,10 @@ // Convenience functions to retrieve values from a base::Value::Dict and // CHECK fail if the specified path is not found. -std::string DictString(const base::Value::Dict& dict, base::StringPiece path); -int DictInt(const base::Value::Dict& dict, base::StringPiece path); -bool DictBool(const base::Value::Dict& dict, base::StringPiece path); -bool DictHas(const base::Value::Dict& dict, base::StringPiece path); +std::string DictString(const base::Value::Dict& dict, std::string_view path); +int DictInt(const base::Value::Dict& dict, std::string_view path); +bool DictBool(const base::Value::Dict& dict, std::string_view path); +bool DictHas(const base::Value::Dict& dict, std::string_view path); // A custom GMock matcher which matches if a base::Value::Dict has // a path |path| that is equal to |value|.
diff --git a/infra/config/PRESUBMIT.py b/infra/config/PRESUBMIT.py index fb98a7b..7bc1b50 100644 --- a/infra/config/PRESUBMIT.py +++ b/infra/config/PRESUBMIT.py
@@ -14,8 +14,8 @@ # The time module's handling of timezones is abysmal, so the boundaries are # precomputed in UNIX time -_FREEZE_START = 1671177600 # 2022/12/16 00:00 -0800 -_FREEZE_END = 1672646400 # 2023/01/02 00:00 -0800 +_FREEZE_START = 1702627200 # 2023/12/15 00:00 -0800 +_FREEZE_END = 1704182400 # 2024/01/02 00:00 -0800 def CheckFreeze(input_api, output_api):
diff --git a/infra/config/generated/builders/build/build-perf-android-siso/gn-args.json b/infra/config/generated/builders/build/build-perf-android-siso/gn-args.json index cc3745c..f38aff6 100644 --- a/infra/config/generated/builders/build/build-perf-android-siso/gn-args.json +++ b/infra/config/generated/builders/build/build-perf-android-siso/gn-args.json
@@ -8,7 +8,6 @@ "debuggable_apks": false, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "fail_on_android_expectations": true, "ffmpeg_branding": "Chrome", "is_component_build": false, @@ -34,7 +33,6 @@ "debuggable_apks": false, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "fail_on_android_expectations": true, "ffmpeg_branding": "Chrome", "is_component_build": false,
diff --git a/infra/config/generated/builders/build/build-perf-android/gn-args.json b/infra/config/generated/builders/build/build-perf-android/gn-args.json index c2ee320..cf87c9d 100644 --- a/infra/config/generated/builders/build/build-perf-android/gn-args.json +++ b/infra/config/generated/builders/build/build-perf-android/gn-args.json
@@ -6,7 +6,6 @@ "debuggable_apks": false, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "fail_on_android_expectations": true, "ffmpeg_branding": "Chrome", "is_component_build": false,
diff --git a/infra/config/generated/builders/build/build-perf-linux-siso/gn-args.json b/infra/config/generated/builders/build/build-perf-linux-siso/gn-args.json index 96f649e..e4a13576 100644 --- a/infra/config/generated/builders/build/build-perf-linux-siso/gn-args.json +++ b/infra/config/generated/builders/build/build-perf-linux-siso/gn-args.json
@@ -8,7 +8,6 @@ "enable_backup_ref_ptr_feature_flag": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false, @@ -28,7 +27,6 @@ "enable_backup_ref_ptr_feature_flag": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/build/build-perf-linux/gn-args.json b/infra/config/generated/builders/build/build-perf-linux/gn-args.json index b8d6efd..4e588f10 100644 --- a/infra/config/generated/builders/build/build-perf-linux/gn-args.json +++ b/infra/config/generated/builders/build/build-perf-linux/gn-args.json
@@ -6,7 +6,6 @@ "enable_backup_ref_ptr_feature_flag": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/build/build-perf-windows-siso/gn-args.json b/infra/config/generated/builders/build/build-perf-windows-siso/gn-args.json index 35671ef..62fa511b 100644 --- a/infra/config/generated/builders/build/build-perf-windows-siso/gn-args.json +++ b/infra/config/generated/builders/build/build-perf-windows-siso/gn-args.json
@@ -6,7 +6,6 @@ "dcheck_always_on": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "enable_resource_allowlist_generation": false, "ffmpeg_branding": "Chrome", "is_component_build": false, @@ -26,7 +25,6 @@ "dcheck_always_on": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "enable_resource_allowlist_generation": false, "ffmpeg_branding": "Chrome", "is_component_build": false,
diff --git a/infra/config/generated/builders/build/build-perf-windows/gn-args.json b/infra/config/generated/builders/build/build-perf-windows/gn-args.json index 4ae653b8..108f851 100644 --- a/infra/config/generated/builders/build/build-perf-windows/gn-args.json +++ b/infra/config/generated/builders/build/build-perf-windows/gn-args.json
@@ -4,7 +4,6 @@ "dcheck_always_on": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "enable_resource_allowlist_generation": false, "ffmpeg_branding": "Chrome", "is_component_build": false,
diff --git a/infra/config/generated/builders/build/linux-chromeos-build-perf-siso/gn-args.json b/infra/config/generated/builders/build/linux-chromeos-build-perf-siso/gn-args.json index a93a81b..06ca7c7 100644 --- a/infra/config/generated/builders/build/linux-chromeos-build-perf-siso/gn-args.json +++ b/infra/config/generated/builders/build/linux-chromeos-build-perf-siso/gn-args.json
@@ -8,7 +8,6 @@ "enable_backup_ref_ptr_feature_flag": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "ChromeOS", "is_component_build": false, "is_debug": false, @@ -31,7 +30,6 @@ "enable_backup_ref_ptr_feature_flag": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "ChromeOS", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/build/linux-chromeos-build-perf/gn-args.json b/infra/config/generated/builders/build/linux-chromeos-build-perf/gn-args.json index 3e9fd736..f82fc1b 100644 --- a/infra/config/generated/builders/build/linux-chromeos-build-perf/gn-args.json +++ b/infra/config/generated/builders/build/linux-chromeos-build-perf/gn-args.json
@@ -6,7 +6,6 @@ "enable_backup_ref_ptr_feature_flag": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "ChromeOS", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/build/mac-build-perf-siso/gn-args.json b/infra/config/generated/builders/build/mac-build-perf-siso/gn-args.json index ea049b77..84d8d97 100644 --- a/infra/config/generated/builders/build/mac-build-perf-siso/gn-args.json +++ b/infra/config/generated/builders/build/mac-build-perf-siso/gn-args.json
@@ -7,7 +7,6 @@ "enable_backup_ref_ptr_feature_flag": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false, @@ -27,7 +26,6 @@ "enable_backup_ref_ptr_feature_flag": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/build/mac-build-perf/gn-args.json b/infra/config/generated/builders/build/mac-build-perf/gn-args.json index d952075..633f1d82 100644 --- a/infra/config/generated/builders/build/mac-build-perf/gn-args.json +++ b/infra/config/generated/builders/build/mac-build-perf/gn-args.json
@@ -5,7 +5,6 @@ "enable_backup_ref_ptr_feature_flag": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/ci/Dawn Android arm Builder/gn-args.json b/infra/config/generated/builders/ci/Dawn Android arm Builder/gn-args.json index 86d6f90..96ebd2f1 100644 --- a/infra/config/generated/builders/ci/Dawn Android arm Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Dawn Android arm Builder/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/ci/Dawn Android arm DEPS Builder/gn-args.json b/infra/config/generated/builders/ci/Dawn Android arm DEPS Builder/gn-args.json index 86d6f90..96ebd2f1 100644 --- a/infra/config/generated/builders/ci/Dawn Android arm DEPS Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Dawn Android arm DEPS Builder/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git "a/infra/config/generated/builders/ci/Dawn Android arm64 DEPS Release \050Pixel 6\051/gn-args.json" "b/infra/config/generated/builders/ci/Dawn Android arm64 DEPS Release \050Pixel 6\051/gn-args.json" index 27ee115..29d2b6e 100644 --- "a/infra/config/generated/builders/ci/Dawn Android arm64 DEPS Release \050Pixel 6\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/Dawn Android arm64 DEPS Release \050Pixel 6\051/gn-args.json"
@@ -2,7 +2,6 @@ "gn_args": { "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git "a/infra/config/generated/builders/ci/Dawn Android arm64 Release \050Pixel 6\051/gn-args.json" "b/infra/config/generated/builders/ci/Dawn Android arm64 Release \050Pixel 6\051/gn-args.json" index 27ee115..29d2b6e 100644 --- "a/infra/config/generated/builders/ci/Dawn Android arm64 Release \050Pixel 6\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/Dawn Android arm64 Release \050Pixel 6\051/gn-args.json"
@@ -2,7 +2,6 @@ "gn_args": { "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/ci/Dawn Linux TSAN Release/gn-args.json b/infra/config/generated/builders/ci/Dawn Linux TSAN Release/gn-args.json index a25b08e5..8f82e0e9 100644 --- a/infra/config/generated/builders/ci/Dawn Linux TSAN Release/gn-args.json +++ b/infra/config/generated/builders/ci/Dawn Linux TSAN Release/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "is_tsan": true,
diff --git a/infra/config/generated/builders/ci/Dawn Linux x64 Builder/gn-args.json b/infra/config/generated/builders/ci/Dawn Linux x64 Builder/gn-args.json index 5b182aa..57a2973 100644 --- a/infra/config/generated/builders/ci/Dawn Linux x64 Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Dawn Linux x64 Builder/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/ci/Dawn Linux x64 DEPS Builder/gn-args.json b/infra/config/generated/builders/ci/Dawn Linux x64 DEPS Builder/gn-args.json index 5b182aa..57a2973 100644 --- a/infra/config/generated/builders/ci/Dawn Linux x64 DEPS Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Dawn Linux x64 DEPS Builder/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git "a/infra/config/generated/builders/ci/Dawn Mac arm64 DEPS Release \050Apple M2\051/gn-args.json" "b/infra/config/generated/builders/ci/Dawn Mac arm64 DEPS Release \050Apple M2\051/gn-args.json" index 7f16d6ac..f537c0e 100644 --- "a/infra/config/generated/builders/ci/Dawn Mac arm64 DEPS Release \050Apple M2\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/Dawn Mac arm64 DEPS Release \050Apple M2\051/gn-args.json"
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git "a/infra/config/generated/builders/ci/Dawn Mac arm64 Release \050Apple M2\051/gn-args.json" "b/infra/config/generated/builders/ci/Dawn Mac arm64 Release \050Apple M2\051/gn-args.json" index 7f16d6ac..f537c0e 100644 --- "a/infra/config/generated/builders/ci/Dawn Mac arm64 Release \050Apple M2\051/gn-args.json" +++ "b/infra/config/generated/builders/ci/Dawn Mac arm64 Release \050Apple M2\051/gn-args.json"
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/ci/Dawn Mac x64 Builder/gn-args.json b/infra/config/generated/builders/ci/Dawn Mac x64 Builder/gn-args.json index 91f1530..8b405d5 100644 --- a/infra/config/generated/builders/ci/Dawn Mac x64 Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Dawn Mac x64 Builder/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/ci/Dawn Mac x64 DEPS Builder/gn-args.json b/infra/config/generated/builders/ci/Dawn Mac x64 DEPS Builder/gn-args.json index 91f1530..8b405d5 100644 --- a/infra/config/generated/builders/ci/Dawn Mac x64 DEPS Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Dawn Mac x64 DEPS Builder/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/ci/Dawn Win10 x64 ASAN Builder/gn-args.json b/infra/config/generated/builders/ci/Dawn Win10 x64 ASAN Builder/gn-args.json index 6629de4..ae751e9 100644 --- a/infra/config/generated/builders/ci/Dawn Win10 x64 ASAN Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Dawn Win10 x64 ASAN Builder/gn-args.json
@@ -3,7 +3,6 @@ "dawn_enable_opengles": true, "dawn_use_built_dxc": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_asan": true, "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/ci/Dawn Win10 x64 Builder/gn-args.json b/infra/config/generated/builders/ci/Dawn Win10 x64 Builder/gn-args.json index bfe074f2..e5f7115 100644 --- a/infra/config/generated/builders/ci/Dawn Win10 x64 Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Dawn Win10 x64 Builder/gn-args.json
@@ -3,7 +3,6 @@ "dawn_enable_opengles": true, "dawn_use_built_dxc": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/ci/Dawn Win10 x64 DEPS Builder/gn-args.json b/infra/config/generated/builders/ci/Dawn Win10 x64 DEPS Builder/gn-args.json index bfe074f2..e5f7115 100644 --- a/infra/config/generated/builders/ci/Dawn Win10 x64 DEPS Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Dawn Win10 x64 DEPS Builder/gn-args.json
@@ -3,7 +3,6 @@ "dawn_enable_opengles": true, "dawn_use_built_dxc": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/ci/Dawn Win10 x86 Builder/gn-args.json b/infra/config/generated/builders/ci/Dawn Win10 x86 Builder/gn-args.json index 2b69f5f..a6f87e49 100644 --- a/infra/config/generated/builders/ci/Dawn Win10 x86 Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Dawn Win10 x86 Builder/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/ci/Dawn Win10 x86 DEPS Builder/gn-args.json b/infra/config/generated/builders/ci/Dawn Win10 x86 DEPS Builder/gn-args.json index 2b69f5f..a6f87e49 100644 --- a/infra/config/generated/builders/ci/Dawn Win10 x86 DEPS Builder/gn-args.json +++ b/infra/config/generated/builders/ci/Dawn Win10 x86 DEPS Builder/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/ci/Linux ASan LSan Builder/gn-args.json b/infra/config/generated/builders/ci/Linux ASan LSan Builder/gn-args.json new file mode 100644 index 0000000..bd432da --- /dev/null +++ b/infra/config/generated/builders/ci/Linux ASan LSan Builder/gn-args.json
@@ -0,0 +1,13 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "fail_on_san_warnings": true, + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "is_lsan": true, + "symbol_level": 1, + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/Linux ASan LSan Builder/properties.json b/infra/config/generated/builders/ci/Linux ASan LSan Builder/properties.json index 0f6604b..e91e607b 100644 --- a/infra/config/generated/builders/ci/Linux ASan LSan Builder/properties.json +++ b/infra/config/generated/builders/ci/Linux ASan LSan Builder/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/Linux ASan LSan Builder/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/Linux CFI/gn-args.json b/infra/config/generated/builders/ci/Linux CFI/gn-args.json new file mode 100644 index 0000000..9f2c01c --- /dev/null +++ b/infra/config/generated/builders/ci/Linux CFI/gn-args.json
@@ -0,0 +1,13 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "is_cfi": true, + "is_component_build": false, + "is_debug": false, + "use_cfi_cast": true, + "use_cfi_diag": true, + "use_cfi_icall": true, + "use_remoteexec": true, + "use_thin_lto": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/Linux CFI/properties.json b/infra/config/generated/builders/ci/Linux CFI/properties.json index f208c24..835fe0b 100644 --- a/infra/config/generated/builders/ci/Linux CFI/properties.json +++ b/infra/config/generated/builders/ci/Linux CFI/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/Linux CFI/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/gn-args.json b/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/gn-args.json new file mode 100644 index 0000000..4d01f4e8 --- /dev/null +++ b/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/gn-args.json
@@ -0,0 +1,13 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "is_lsan": true, + "symbol_level": 1, + "target_os": "chromeos", + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/properties.json b/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/properties.json index 7da4589..990e4a9 100644 --- a/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/properties.json +++ b/infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/Linux Chromium OS ASan LSan Builder/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/gn-args.json b/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/gn-args.json new file mode 100644 index 0000000..02ad9ff --- /dev/null +++ b/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/gn-args.json
@@ -0,0 +1,11 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "is_component_build": false, + "is_debug": false, + "is_msan": true, + "msan_track_origins": 2, + "target_os": "chromeos", + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/properties.json b/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/properties.json index 0dfaeaf..e9a07bfb 100644 --- a/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/properties.json +++ b/infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/Linux ChromiumOS MSan Builder/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/Linux MSan Builder/gn-args.json b/infra/config/generated/builders/ci/Linux MSan Builder/gn-args.json new file mode 100644 index 0000000..5715022 --- /dev/null +++ b/infra/config/generated/builders/ci/Linux MSan Builder/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "is_component_build": false, + "is_debug": false, + "is_msan": true, + "msan_track_origins": 2, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/Linux MSan Builder/properties.json b/infra/config/generated/builders/ci/Linux MSan Builder/properties.json index 8d5891a..7ca8bca 100644 --- a/infra/config/generated/builders/ci/Linux MSan Builder/properties.json +++ b/infra/config/generated/builders/ci/Linux MSan Builder/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/Linux MSan Builder/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/Linux TSan Builder/gn-args.json b/infra/config/generated/builders/ci/Linux TSan Builder/gn-args.json new file mode 100644 index 0000000..939a89c --- /dev/null +++ b/infra/config/generated/builders/ci/Linux TSan Builder/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "enable_nacl": false, + "is_component_build": false, + "is_debug": false, + "is_tsan": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/Linux TSan Builder/properties.json b/infra/config/generated/builders/ci/Linux TSan Builder/properties.json index 28e840d..b63b1e1 100644 --- a/infra/config/generated/builders/ci/Linux TSan Builder/properties.json +++ b/infra/config/generated/builders/ci/Linux TSan Builder/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/Linux TSan Builder/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/Mac ASan 64 Builder/gn-args.json b/infra/config/generated/builders/ci/Mac ASan 64 Builder/gn-args.json new file mode 100644 index 0000000..3dcb849 --- /dev/null +++ b/infra/config/generated/builders/ci/Mac ASan 64 Builder/gn-args.json
@@ -0,0 +1,11 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "enable_nacl": false, + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "symbol_level": 1, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/Mac ASan 64 Builder/properties.json b/infra/config/generated/builders/ci/Mac ASan 64 Builder/properties.json index 623e5fd..4956a280 100644 --- a/infra/config/generated/builders/ci/Mac ASan 64 Builder/properties.json +++ b/infra/config/generated/builders/ci/Mac ASan 64 Builder/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/Mac ASan 64 Builder/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/WebKit Linux ASAN/gn-args.json b/infra/config/generated/builders/ci/WebKit Linux ASAN/gn-args.json new file mode 100644 index 0000000..d3ce452 --- /dev/null +++ b/infra/config/generated/builders/ci/WebKit Linux ASAN/gn-args.json
@@ -0,0 +1,12 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "ffmpeg_branding": "Chrome", + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "is_lsan": true, + "proprietary_codecs": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/WebKit Linux ASAN/properties.json b/infra/config/generated/builders/ci/WebKit Linux ASAN/properties.json index 8cc1903..10143c7 100644 --- a/infra/config/generated/builders/ci/WebKit Linux ASAN/properties.json +++ b/infra/config/generated/builders/ci/WebKit Linux ASAN/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/WebKit Linux ASAN/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/WebKit Linux Leak/gn-args.json b/infra/config/generated/builders/ci/WebKit Linux Leak/gn-args.json new file mode 100644 index 0000000..9343f21c --- /dev/null +++ b/infra/config/generated/builders/ci/WebKit Linux Leak/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "ffmpeg_branding": "Chrome", + "is_component_build": false, + "is_debug": false, + "proprietary_codecs": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/WebKit Linux Leak/properties.json b/infra/config/generated/builders/ci/WebKit Linux Leak/properties.json index 58eefd0..f1c0f96b 100644 --- a/infra/config/generated/builders/ci/WebKit Linux Leak/properties.json +++ b/infra/config/generated/builders/ci/WebKit Linux Leak/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/WebKit Linux Leak/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/WebKit Linux MSAN/gn-args.json b/infra/config/generated/builders/ci/WebKit Linux MSAN/gn-args.json new file mode 100644 index 0000000..2c0a3af --- /dev/null +++ b/infra/config/generated/builders/ci/WebKit Linux MSAN/gn-args.json
@@ -0,0 +1,12 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "ffmpeg_branding": "Chrome", + "is_component_build": false, + "is_debug": false, + "is_msan": true, + "msan_track_origins": 2, + "proprietary_codecs": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/WebKit Linux MSAN/properties.json b/infra/config/generated/builders/ci/WebKit Linux MSAN/properties.json index 0cc2ab3..06745b5 100644 --- a/infra/config/generated/builders/ci/WebKit Linux MSAN/properties.json +++ b/infra/config/generated/builders/ci/WebKit Linux MSAN/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/WebKit Linux MSAN/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/android-angle-chromium-arm64-builder/gn-args.json b/infra/config/generated/builders/ci/android-angle-chromium-arm64-builder/gn-args.json index fedbd72..e14b2c71 100644 --- a/infra/config/generated/builders/ci/android-angle-chromium-arm64-builder/gn-args.json +++ b/infra/config/generated/builders/ci/android-angle-chromium-arm64-builder/gn-args.json
@@ -3,7 +3,6 @@ "android_static_analysis": "off", "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/ci/android-asan/gn-args.json b/infra/config/generated/builders/ci/android-asan/gn-args.json new file mode 100644 index 0000000..ebcff9c --- /dev/null +++ b/infra/config/generated/builders/ci/android-asan/gn-args.json
@@ -0,0 +1,16 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "debuggable_apks": false, + "ffmpeg_branding": "Chrome", + "is_asan": true, + "is_clang": true, + "is_component_build": false, + "is_debug": false, + "proprietary_codecs": true, + "strip_debug_info": true, + "symbol_level": 1, + "target_os": "android", + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/android-asan/properties.json b/infra/config/generated/builders/ci/android-asan/properties.json index 71977c1..637f0f28 100644 --- a/infra/config/generated/builders/ci/android-asan/properties.json +++ b/infra/config/generated/builders/ci/android-asan/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/android-asan/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/android-rust-arm32-rel/gn-args.json b/infra/config/generated/builders/ci/android-rust-arm32-rel/gn-args.json new file mode 100644 index 0000000..71848a86 --- /dev/null +++ b/infra/config/generated/builders/ci/android-rust-arm32-rel/gn-args.json
@@ -0,0 +1,16 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "debuggable_apks": false, + "enable_all_rust_features": true, + "ffmpeg_branding": "Chrome", + "is_component_build": false, + "is_debug": false, + "proprietary_codecs": true, + "symbol_level": 1, + "target_cpu": "arm", + "target_os": "android", + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/android-rust-arm32-rel/properties.json b/infra/config/generated/builders/ci/android-rust-arm32-rel/properties.json index 4f79b32..3484837 100644 --- a/infra/config/generated/builders/ci/android-rust-arm32-rel/properties.json +++ b/infra/config/generated/builders/ci/android-rust-arm32-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/android-rust-arm32-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/android-rust-arm64-dbg/gn-args.json b/infra/config/generated/builders/ci/android-rust-arm64-dbg/gn-args.json new file mode 100644 index 0000000..b26986c1 --- /dev/null +++ b/infra/config/generated/builders/ci/android-rust-arm64-dbg/gn-args.json
@@ -0,0 +1,14 @@ +{ + "gn_args": { + "debuggable_apks": false, + "enable_all_rust_features": true, + "ffmpeg_branding": "Chrome", + "is_component_build": true, + "is_debug": true, + "proprietary_codecs": true, + "symbol_level": 1, + "target_cpu": "arm64", + "target_os": "android", + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/android-rust-arm64-dbg/properties.json b/infra/config/generated/builders/ci/android-rust-arm64-dbg/properties.json index fc076f1..cfb5ff3 100644 --- a/infra/config/generated/builders/ci/android-rust-arm64-dbg/properties.json +++ b/infra/config/generated/builders/ci/android-rust-arm64-dbg/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/android-rust-arm64-dbg/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/android-rust-arm64-rel/gn-args.json b/infra/config/generated/builders/ci/android-rust-arm64-rel/gn-args.json new file mode 100644 index 0000000..3461678 --- /dev/null +++ b/infra/config/generated/builders/ci/android-rust-arm64-rel/gn-args.json
@@ -0,0 +1,16 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "debuggable_apks": false, + "enable_all_rust_features": true, + "ffmpeg_branding": "Chrome", + "is_component_build": false, + "is_debug": false, + "proprietary_codecs": true, + "symbol_level": 1, + "target_cpu": "arm64", + "target_os": "android", + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/android-rust-arm64-rel/properties.json b/infra/config/generated/builders/ci/android-rust-arm64-rel/properties.json index aa07d2b..27706ccb 100644 --- a/infra/config/generated/builders/ci/android-rust-arm64-rel/properties.json +++ b/infra/config/generated/builders/ci/android-rust-arm64-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/android-rust-arm64-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/ios-asan/gn-args.json b/infra/config/generated/builders/ci/ios-asan/gn-args.json new file mode 100644 index 0000000..7ef3db0 --- /dev/null +++ b/infra/config/generated/builders/ci/ios-asan/gn-args.json
@@ -0,0 +1,13 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "enable_run_ios_unittests_with_xctest": true, + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "target_cpu": "x64", + "target_environment": "simulator", + "target_os": "ios", + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/ios-asan/properties.json b/infra/config/generated/builders/ci/ios-asan/properties.json index 1e16ef3a..6261b0cf 100644 --- a/infra/config/generated/builders/ci/ios-asan/properties.json +++ b/infra/config/generated/builders/ci/ios-asan/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/ios-asan/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/linux-exp-asan-lsan-fyi-rel/gn-args.json b/infra/config/generated/builders/ci/linux-exp-asan-lsan-fyi-rel/gn-args.json new file mode 100644 index 0000000..bd432da --- /dev/null +++ b/infra/config/generated/builders/ci/linux-exp-asan-lsan-fyi-rel/gn-args.json
@@ -0,0 +1,13 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "fail_on_san_warnings": true, + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "is_lsan": true, + "symbol_level": 1, + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/linux-exp-asan-lsan-fyi-rel/properties.json b/infra/config/generated/builders/ci/linux-exp-asan-lsan-fyi-rel/properties.json index 37e155e..6b4aa29 100644 --- a/infra/config/generated/builders/ci/linux-exp-asan-lsan-fyi-rel/properties.json +++ b/infra/config/generated/builders/ci/linux-exp-asan-lsan-fyi-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/linux-exp-asan-lsan-fyi-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/linux-exp-msan-fyi-rel/gn-args.json b/infra/config/generated/builders/ci/linux-exp-msan-fyi-rel/gn-args.json new file mode 100644 index 0000000..58d9509 --- /dev/null +++ b/infra/config/generated/builders/ci/linux-exp-msan-fyi-rel/gn-args.json
@@ -0,0 +1,11 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "fail_on_san_warnings": true, + "is_component_build": false, + "is_debug": false, + "is_msan": true, + "msan_track_origins": 2, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/linux-exp-msan-fyi-rel/properties.json b/infra/config/generated/builders/ci/linux-exp-msan-fyi-rel/properties.json index d045c9a..5773b359 100644 --- a/infra/config/generated/builders/ci/linux-exp-msan-fyi-rel/properties.json +++ b/infra/config/generated/builders/ci/linux-exp-msan-fyi-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/linux-exp-msan-fyi-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/linux-exp-tsan-fyi-rel/gn-args.json b/infra/config/generated/builders/ci/linux-exp-tsan-fyi-rel/gn-args.json new file mode 100644 index 0000000..2bac085 --- /dev/null +++ b/infra/config/generated/builders/ci/linux-exp-tsan-fyi-rel/gn-args.json
@@ -0,0 +1,11 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "enable_nacl": false, + "fail_on_san_warnings": true, + "is_component_build": false, + "is_debug": false, + "is_tsan": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/linux-exp-tsan-fyi-rel/properties.json b/infra/config/generated/builders/ci/linux-exp-tsan-fyi-rel/properties.json index c07375e0e..2af9278 100644 --- a/infra/config/generated/builders/ci/linux-exp-tsan-fyi-rel/properties.json +++ b/infra/config/generated/builders/ci/linux-exp-tsan-fyi-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/linux-exp-tsan-fyi-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/linux-lacros-asan-lsan-rel/gn-args.json b/infra/config/generated/builders/ci/linux-lacros-asan-lsan-rel/gn-args.json new file mode 100644 index 0000000..a04c11e53 --- /dev/null +++ b/infra/config/generated/builders/ci/linux-lacros-asan-lsan-rel/gn-args.json
@@ -0,0 +1,15 @@ +{ + "gn_args": { + "also_build_ash_chrome": true, + "chromeos_is_browser_only": true, + "dcheck_always_on": true, + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "is_lsan": true, + "symbol_level": 1, + "target_os": "chromeos", + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/linux-lacros-asan-lsan-rel/properties.json b/infra/config/generated/builders/ci/linux-lacros-asan-lsan-rel/properties.json index 040037e5..561f76e 100644 --- a/infra/config/generated/builders/ci/linux-lacros-asan-lsan-rel/properties.json +++ b/infra/config/generated/builders/ci/linux-lacros-asan-lsan-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/linux-lacros-asan-lsan-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/linux-rust-x64-dbg/gn-args.json b/infra/config/generated/builders/ci/linux-rust-x64-dbg/gn-args.json new file mode 100644 index 0000000..1a626964 --- /dev/null +++ b/infra/config/generated/builders/ci/linux-rust-x64-dbg/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "enable_all_rust_features": true, + "is_component_build": true, + "is_debug": true, + "symbol_level": 1, + "target_cpu": "x64", + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/linux-rust-x64-dbg/properties.json b/infra/config/generated/builders/ci/linux-rust-x64-dbg/properties.json index 48c75d5..cd9a7f2 100644 --- a/infra/config/generated/builders/ci/linux-rust-x64-dbg/properties.json +++ b/infra/config/generated/builders/ci/linux-rust-x64-dbg/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/linux-rust-x64-dbg/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/linux-rust-x64-rel/gn-args.json b/infra/config/generated/builders/ci/linux-rust-x64-rel/gn-args.json new file mode 100644 index 0000000..eb52c824 --- /dev/null +++ b/infra/config/generated/builders/ci/linux-rust-x64-rel/gn-args.json
@@ -0,0 +1,12 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "enable_all_rust_features": true, + "is_component_build": false, + "is_debug": false, + "symbol_level": 1, + "target_cpu": "x64", + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/linux-rust-x64-rel/properties.json b/infra/config/generated/builders/ci/linux-rust-x64-rel/properties.json index 1e7c461..acac4dd 100644 --- a/infra/config/generated/builders/ci/linux-rust-x64-rel/properties.json +++ b/infra/config/generated/builders/ci/linux-rust-x64-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/linux-rust-x64-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/linux-swangle-chromium-x64-exp/gn-args.json b/infra/config/generated/builders/ci/linux-swangle-chromium-x64-exp/gn-args.json index 77f26f58..d3489b1 100644 --- a/infra/config/generated/builders/ci/linux-swangle-chromium-x64-exp/gn-args.json +++ b/infra/config/generated/builders/ci/linux-swangle-chromium-x64-exp/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/ci/linux-swangle-chromium-x64/gn-args.json b/infra/config/generated/builders/ci/linux-swangle-chromium-x64/gn-args.json index 77f26f58..d3489b1 100644 --- a/infra/config/generated/builders/ci/linux-swangle-chromium-x64/gn-args.json +++ b/infra/config/generated/builders/ci/linux-swangle-chromium-x64/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/ci/linux-ubsan-fyi-rel/gn-args.json b/infra/config/generated/builders/ci/linux-ubsan-fyi-rel/gn-args.json new file mode 100644 index 0000000..93f81a0c --- /dev/null +++ b/infra/config/generated/builders/ci/linux-ubsan-fyi-rel/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "is_component_build": false, + "is_debug": false, + "is_ubsan": true, + "is_ubsan_no_recover": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/linux-ubsan-fyi-rel/properties.json b/infra/config/generated/builders/ci/linux-ubsan-fyi-rel/properties.json index 12ba8f5..1c3a166 100644 --- a/infra/config/generated/builders/ci/linux-ubsan-fyi-rel/properties.json +++ b/infra/config/generated/builders/ci/linux-ubsan-fyi-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/linux-ubsan-fyi-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/linux-ubsan-vptr/gn-args.json b/infra/config/generated/builders/ci/linux-ubsan-vptr/gn-args.json new file mode 100644 index 0000000..4bd355d6 --- /dev/null +++ b/infra/config/generated/builders/ci/linux-ubsan-vptr/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "is_component_build": false, + "is_debug": false, + "is_ubsan_no_recover": true, + "is_ubsan_vptr": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/linux-ubsan-vptr/properties.json b/infra/config/generated/builders/ci/linux-ubsan-vptr/properties.json index f94b6df..5bdc2c8c 100644 --- a/infra/config/generated/builders/ci/linux-ubsan-vptr/properties.json +++ b/infra/config/generated/builders/ci/linux-ubsan-vptr/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/linux-ubsan-vptr/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/mac-lsan-fyi-rel/gn-args.json b/infra/config/generated/builders/ci/mac-lsan-fyi-rel/gn-args.json new file mode 100644 index 0000000..e373dfb --- /dev/null +++ b/infra/config/generated/builders/ci/mac-lsan-fyi-rel/gn-args.json
@@ -0,0 +1,11 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "enable_nacl": false, + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "is_lsan": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/mac-lsan-fyi-rel/properties.json b/infra/config/generated/builders/ci/mac-lsan-fyi-rel/properties.json index 91c2ced..7b132626 100644 --- a/infra/config/generated/builders/ci/mac-lsan-fyi-rel/properties.json +++ b/infra/config/generated/builders/ci/mac-lsan-fyi-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/mac-lsan-fyi-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/mac-rust-x64-dbg/gn-args.json b/infra/config/generated/builders/ci/mac-rust-x64-dbg/gn-args.json new file mode 100644 index 0000000..1a626964 --- /dev/null +++ b/infra/config/generated/builders/ci/mac-rust-x64-dbg/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "enable_all_rust_features": true, + "is_component_build": true, + "is_debug": true, + "symbol_level": 1, + "target_cpu": "x64", + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/mac-rust-x64-dbg/properties.json b/infra/config/generated/builders/ci/mac-rust-x64-dbg/properties.json index 8df44f3..3bb27fd 100644 --- a/infra/config/generated/builders/ci/mac-rust-x64-dbg/properties.json +++ b/infra/config/generated/builders/ci/mac-rust-x64-dbg/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/mac-rust-x64-dbg/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/mac-swangle-chromium-x64/gn-args.json b/infra/config/generated/builders/ci/mac-swangle-chromium-x64/gn-args.json index 77f26f58..d3489b1 100644 --- a/infra/config/generated/builders/ci/mac-swangle-chromium-x64/gn-args.json +++ b/infra/config/generated/builders/ci/mac-swangle-chromium-x64/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/ci/win-asan/gn-args.json b/infra/config/generated/builders/ci/win-asan/gn-args.json new file mode 100644 index 0000000..00aa3fa5 --- /dev/null +++ b/infra/config/generated/builders/ci/win-asan/gn-args.json
@@ -0,0 +1,12 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "enable_ipc_fuzzer": true, + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "symbol_level": 1, + "use_remoteexec": true, + "v8_enable_verify_heap": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/win-asan/properties.json b/infra/config/generated/builders/ci/win-asan/properties.json index 3557e89..1d9735e 100644 --- a/infra/config/generated/builders/ci/win-asan/properties.json +++ b/infra/config/generated/builders/ci/win-asan/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/win-asan/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/win-rust-x64-dbg/gn-args.json b/infra/config/generated/builders/ci/win-rust-x64-dbg/gn-args.json new file mode 100644 index 0000000..1a626964 --- /dev/null +++ b/infra/config/generated/builders/ci/win-rust-x64-dbg/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "enable_all_rust_features": true, + "is_component_build": true, + "is_debug": true, + "symbol_level": 1, + "target_cpu": "x64", + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/win-rust-x64-dbg/properties.json b/infra/config/generated/builders/ci/win-rust-x64-dbg/properties.json index 2e3ffa7..aae39b9 100644 --- a/infra/config/generated/builders/ci/win-rust-x64-dbg/properties.json +++ b/infra/config/generated/builders/ci/win-rust-x64-dbg/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/win-rust-x64-dbg/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/win-rust-x64-rel/gn-args.json b/infra/config/generated/builders/ci/win-rust-x64-rel/gn-args.json new file mode 100644 index 0000000..eb52c824 --- /dev/null +++ b/infra/config/generated/builders/ci/win-rust-x64-rel/gn-args.json
@@ -0,0 +1,12 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "enable_all_rust_features": true, + "is_component_build": false, + "is_debug": false, + "symbol_level": 1, + "target_cpu": "x64", + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/win-rust-x64-rel/properties.json b/infra/config/generated/builders/ci/win-rust-x64-rel/properties.json index 3c9e3b896..1b83e1a 100644 --- a/infra/config/generated/builders/ci/win-rust-x64-rel/properties.json +++ b/infra/config/generated/builders/ci/win-rust-x64-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/ci/win-rust-x64-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/ci/win-swangle-chromium-x86/gn-args.json b/infra/config/generated/builders/ci/win-swangle-chromium-x86/gn-args.json index 2409e05..6b1d4d8 100644 --- a/infra/config/generated/builders/ci/win-swangle-chromium-x86/gn-args.json +++ b/infra/config/generated/builders/ci/win-swangle-chromium-x86/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "enable_resource_allowlist_generation": true, "ffmpeg_branding": "Chrome", "is_component_build": false,
diff --git a/infra/config/generated/builders/gn_args_locations.json b/infra/config/generated/builders/gn_args_locations.json index a9728ca..f76eee0 100644 --- a/infra/config/generated/builders/gn_args_locations.json +++ b/infra/config/generated/builders/gn_args_locations.json
@@ -265,6 +265,30 @@ "mac-arm64-rel": "ci/mac-arm64-rel/gn-args.json", "mac-intel-on-arm64-rel": "ci/mac-intel-on-arm64-rel/gn-args.json" }, + "chromium.memory": { + "Linux ASan LSan Builder": "ci/Linux ASan LSan Builder/gn-args.json", + "Linux CFI": "ci/Linux CFI/gn-args.json", + "Linux Chromium OS ASan LSan Builder": "ci/Linux Chromium OS ASan LSan Builder/gn-args.json", + "Linux ChromiumOS MSan Builder": "ci/Linux ChromiumOS MSan Builder/gn-args.json", + "Linux MSan Builder": "ci/Linux MSan Builder/gn-args.json", + "Linux TSan Builder": "ci/Linux TSan Builder/gn-args.json", + "Mac ASan 64 Builder": "ci/Mac ASan 64 Builder/gn-args.json", + "WebKit Linux ASAN": "ci/WebKit Linux ASAN/gn-args.json", + "WebKit Linux Leak": "ci/WebKit Linux Leak/gn-args.json", + "WebKit Linux MSAN": "ci/WebKit Linux MSAN/gn-args.json", + "android-asan": "ci/android-asan/gn-args.json", + "ios-asan": "ci/ios-asan/gn-args.json", + "linux-lacros-asan-lsan-rel": "ci/linux-lacros-asan-lsan-rel/gn-args.json", + "linux-ubsan-vptr": "ci/linux-ubsan-vptr/gn-args.json", + "win-asan": "ci/win-asan/gn-args.json" + }, + "chromium.memory.fyi": { + "linux-exp-asan-lsan-fyi-rel": "ci/linux-exp-asan-lsan-fyi-rel/gn-args.json", + "linux-exp-msan-fyi-rel": "ci/linux-exp-msan-fyi-rel/gn-args.json", + "linux-exp-tsan-fyi-rel": "ci/linux-exp-tsan-fyi-rel/gn-args.json", + "linux-ubsan-fyi-rel": "ci/linux-ubsan-fyi-rel/gn-args.json", + "mac-lsan-fyi-rel": "ci/mac-lsan-fyi-rel/gn-args.json" + }, "chromium.reclient.fyi": { "Comparison Linux (reclient vs reclient remote links)": "reclient/Comparison Linux (reclient vs reclient remote links)/gn-args.json", "Comparison Linux (reclient)": "reclient/Comparison Linux (reclient)/gn-args.json", @@ -301,6 +325,16 @@ "mac-arm64-rel reclient test": "reclient/mac-arm64-rel reclient test/gn-args.json", "mac-arm64-rel reclient test untrusted": "reclient/mac-arm64-rel reclient test untrusted/gn-args.json" }, + "chromium.rust": { + "android-rust-arm32-rel": "ci/android-rust-arm32-rel/gn-args.json", + "android-rust-arm64-dbg": "ci/android-rust-arm64-dbg/gn-args.json", + "android-rust-arm64-rel": "ci/android-rust-arm64-rel/gn-args.json", + "linux-rust-x64-dbg": "ci/linux-rust-x64-dbg/gn-args.json", + "linux-rust-x64-rel": "ci/linux-rust-x64-rel/gn-args.json", + "mac-rust-x64-dbg": "ci/mac-rust-x64-dbg/gn-args.json", + "win-rust-x64-dbg": "ci/win-rust-x64-dbg/gn-args.json", + "win-rust-x64-rel": "ci/win-rust-x64-rel/gn-args.json" + }, "chromium.swangle": { "linux-swangle-chromium-x64": "ci/linux-swangle-chromium-x64/gn-args.json", "linux-swangle-chromium-x64-exp": "ci/linux-swangle-chromium-x64-exp/gn-args.json", @@ -502,29 +536,44 @@ "tryserver.chromium.linux": { "chromeos-js-code-coverage": "try/chromeos-js-code-coverage/gn-args.json", "chromeos-js-coverage-rel": "try/chromeos-js-coverage-rel/gn-args.json", + "layout_test_leak_detection": "try/layout_test_leak_detection/gn-args.json", "leak_detection_linux": "try/leak_detection_linux/gn-args.json", "linux-arm64-castos": "try/linux-arm64-castos/gn-args.json", "linux-bfcache-rel": "try/linux-bfcache-rel/gn-args.json", "linux-chromeos-code-coverage": "try/linux-chromeos-code-coverage/gn-args.json", "linux-code-coverage": "try/linux-code-coverage/gn-args.json", + "linux-exp-asan-lsan-fyi-rel": "try/linux-exp-asan-lsan-fyi-rel/gn-args.json", + "linux-exp-msan-fyi-rel": "try/linux-exp-msan-fyi-rel/gn-args.json", "linux-extended-tracing-rel": "try/linux-extended-tracing-rel/gn-args.json", "linux-gcc-rel": "try/linux-gcc-rel/gn-args.json", "linux-js-code-coverage": "try/linux-js-code-coverage/gn-args.json", "linux-js-coverage-rel": "try/linux-js-coverage-rel/gn-args.json", + "linux-lacros-asan-lsan-rel": "try/linux-lacros-asan-lsan-rel/gn-args.json", "linux-lacros-code-coverage": "try/linux-lacros-code-coverage/gn-args.json", "linux-rel": "try/linux-rel/gn-args.json", "linux-siso-rel": "try/linux-siso-rel/gn-args.json", + "linux-ubsan-fyi-rel": "try/linux-ubsan-fyi-rel/gn-args.json", + "linux-ubsan-vptr": "try/linux-ubsan-vptr/gn-args.json", "linux-v4l2-codec-rel": "try/linux-v4l2-codec-rel/gn-args.json", "linux-wayland-rel": "try/linux-wayland-rel/gn-args.json", + "linux-webkit-asan-rel": "try/linux-webkit-asan-rel/gn-args.json", + "linux-webkit-msan-rel": "try/linux-webkit-msan-rel/gn-args.json", "linux-x64-castos": "try/linux-x64-castos/gn-args.json", "linux-x64-castos-audio": "try/linux-x64-castos-audio/gn-args.json", "linux-x64-castos-dbg": "try/linux-x64-castos-dbg/gn-args.json", + "linux_chromium_asan_rel_ng": "try/linux_chromium_asan_rel_ng/gn-args.json", + "linux_chromium_cfi_rel_ng": "try/linux_chromium_cfi_rel_ng/gn-args.json", + "linux_chromium_chromeos_asan_rel_ng": "try/linux_chromium_chromeos_asan_rel_ng/gn-args.json", + "linux_chromium_chromeos_msan_rel_ng": "try/linux_chromium_chromeos_msan_rel_ng/gn-args.json", "linux_chromium_compile_dbg_ng": "try/linux_chromium_compile_dbg_ng/gn-args.json", "linux_chromium_compile_siso_dbg_ng": "try/linux_chromium_compile_siso_dbg_ng/gn-args.json", "linux_chromium_dbg_ng": "try/linux_chromium_dbg_ng/gn-args.json", + "linux_chromium_msan_rel_ng": "try/linux_chromium_msan_rel_ng/gn-args.json", + "linux_chromium_tsan_rel_ng": "try/linux_chromium_tsan_rel_ng/gn-args.json", "network_service_linux": "try/network_service_linux/gn-args.json" }, "tryserver.chromium.mac": { + "ios-asan": "try/ios-asan/gn-args.json", "ios-catalyst": "try/ios-catalyst/gn-args.json", "ios-device": "try/ios-device/gn-args.json", "ios-simulator": "try/ios-simulator/gn-args.json", @@ -544,10 +593,21 @@ "mac13-tests": "try/mac13-tests/gn-args.json", "mac_chromium_10.15_rel_ng": "try/mac_chromium_10.15_rel_ng/gn-args.json", "mac_chromium_11.0_rel_ng": "try/mac_chromium_11.0_rel_ng/gn-args.json", + "mac_chromium_asan_rel_ng": "try/mac_chromium_asan_rel_ng/gn-args.json", "mac_chromium_compile_dbg_ng": "try/mac_chromium_compile_dbg_ng/gn-args.json", "mac_chromium_compile_rel_ng": "try/mac_chromium_compile_rel_ng/gn-args.json", "mac_chromium_dbg_ng": "try/mac_chromium_dbg_ng/gn-args.json" }, + "tryserver.chromium.rust": { + "android-rust-arm32-rel": "try/android-rust-arm32-rel/gn-args.json", + "android-rust-arm64-dbg": "try/android-rust-arm64-dbg/gn-args.json", + "android-rust-arm64-rel": "try/android-rust-arm64-rel/gn-args.json", + "linux-rust-x64-dbg": "try/linux-rust-x64-dbg/gn-args.json", + "linux-rust-x64-rel": "try/linux-rust-x64-rel/gn-args.json", + "mac-rust-x64-dbg": "try/mac-rust-x64-dbg/gn-args.json", + "win-rust-x64-dbg": "try/win-rust-x64-dbg/gn-args.json", + "win-rust-x64-rel": "try/win-rust-x64-rel/gn-args.json" + }, "tryserver.chromium.swangle": { "linux-swangle-chromium-try-x64": "try/linux-swangle-chromium-try-x64/gn-args.json", "linux-swangle-chromium-try-x64-exp": "try/linux-swangle-chromium-try-x64-exp/gn-args.json", @@ -570,6 +630,7 @@ "win-updater-try-builder-rel": "try/win-updater-try-builder-rel/gn-args.json" }, "tryserver.chromium.win": { + "win-asan": "try/win-asan/gn-args.json", "win-rel": "try/win-rel/gn-args.json", "win10-code-coverage": "try/win10-code-coverage/gn-args.json", "win10-dbg": "try/win10-dbg/gn-args.json",
diff --git a/infra/config/generated/builders/try/android-10-arm64-rel/gn-args.json b/infra/config/generated/builders/try/android-10-arm64-rel/gn-args.json index 2d6cc2d..e27db229 100644 --- a/infra/config/generated/builders/try/android-10-arm64-rel/gn-args.json +++ b/infra/config/generated/builders/try/android-10-arm64-rel/gn-args.json
@@ -3,7 +3,6 @@ "android_static_analysis": "off", "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android-11-x86-rel/gn-args.json b/infra/config/generated/builders/try/android-11-x86-rel/gn-args.json index 2546538..7f2cc4c 100644 --- a/infra/config/generated/builders/try/android-11-x86-rel/gn-args.json +++ b/infra/config/generated/builders/try/android-11-x86-rel/gn-args.json
@@ -3,7 +3,6 @@ "android_static_analysis": "off", "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android-12-x64-dbg/gn-args.json b/infra/config/generated/builders/try/android-12-x64-dbg/gn-args.json index 217aceb..7559654 100644 --- a/infra/config/generated/builders/try/android-12-x64-dbg/gn-args.json +++ b/infra/config/generated/builders/try/android-12-x64-dbg/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/android-12-x64-rel/gn-args.json b/infra/config/generated/builders/try/android-12-x64-rel/gn-args.json index 92f73f0..1abd33c4 100644 --- a/infra/config/generated/builders/try/android-12-x64-rel/gn-args.json +++ b/infra/config/generated/builders/try/android-12-x64-rel/gn-args.json
@@ -4,7 +4,6 @@ "coverage_instrumentation_input_file": "//.code-coverage/files_to_instrument.txt", "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android-12l-x64-dbg/gn-args.json b/infra/config/generated/builders/try/android-12l-x64-dbg/gn-args.json index 217aceb..7559654 100644 --- a/infra/config/generated/builders/try/android-12l-x64-dbg/gn-args.json +++ b/infra/config/generated/builders/try/android-12l-x64-dbg/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/android-13-x64-rel/gn-args.json b/infra/config/generated/builders/try/android-13-x64-rel/gn-args.json index 9bbfb0b..5ff8e21 100644 --- a/infra/config/generated/builders/try/android-13-x64-rel/gn-args.json +++ b/infra/config/generated/builders/try/android-13-x64-rel/gn-args.json
@@ -3,7 +3,6 @@ "android_static_analysis": "off", "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android-angle-chromium-try/gn-args.json b/infra/config/generated/builders/try/android-angle-chromium-try/gn-args.json index 3e6406d1..d2ed2384 100644 --- a/infra/config/generated/builders/try/android-angle-chromium-try/gn-args.json +++ b/infra/config/generated/builders/try/android-angle-chromium-try/gn-args.json
@@ -3,7 +3,6 @@ "android_static_analysis": "off", "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android-arm64-all-targets-dbg/gn-args.json b/infra/config/generated/builders/try/android-arm64-all-targets-dbg/gn-args.json index 0668e14..b695083 100644 --- a/infra/config/generated/builders/try/android-arm64-all-targets-dbg/gn-args.json +++ b/infra/config/generated/builders/try/android-arm64-all-targets-dbg/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "android_static_analysis": "off", "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/android-arm64-rel-compilator/properties.json b/infra/config/generated/builders/try/android-arm64-rel-compilator/properties.json index 0ce3a28b..2ace468 100644 --- a/infra/config/generated/builders/try/android-arm64-rel-compilator/properties.json +++ b/infra/config/generated/builders/try/android-arm64-rel-compilator/properties.json
@@ -101,6 +101,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-untrusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git a/infra/config/generated/builders/try/android-arm64-rel/gn-args.json b/infra/config/generated/builders/try/android-arm64-rel/gn-args.json index c2ee320..cf87c9d 100644 --- a/infra/config/generated/builders/try/android-arm64-rel/gn-args.json +++ b/infra/config/generated/builders/try/android-arm64-rel/gn-args.json
@@ -6,7 +6,6 @@ "debuggable_apks": false, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "fail_on_android_expectations": true, "ffmpeg_branding": "Chrome", "is_component_build": false,
diff --git a/infra/config/generated/builders/try/android-arm64-siso-rel-compilator/properties.json b/infra/config/generated/builders/try/android-arm64-siso-rel-compilator/properties.json index 90d0c4e..7bc03af2 100644 --- a/infra/config/generated/builders/try/android-arm64-siso-rel-compilator/properties.json +++ b/infra/config/generated/builders/try/android-arm64-siso-rel-compilator/properties.json
@@ -104,8 +104,7 @@ }, "$build/siso": { "configs": [ - "builder", - "remote-devtools-frontend-typescript" + "builder" ], "enable_cloud_profiler": true, "enable_cloud_trace": true,
diff --git a/infra/config/generated/builders/try/android-arm64-siso-rel/gn-args.json b/infra/config/generated/builders/try/android-arm64-siso-rel/gn-args.json index c2ee320..cf87c9d 100644 --- a/infra/config/generated/builders/try/android-arm64-siso-rel/gn-args.json +++ b/infra/config/generated/builders/try/android-arm64-siso-rel/gn-args.json
@@ -6,7 +6,6 @@ "debuggable_apks": false, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "fail_on_android_expectations": true, "ffmpeg_branding": "Chrome", "is_component_build": false,
diff --git a/infra/config/generated/builders/try/android-bfcache-rel/gn-args.json b/infra/config/generated/builders/try/android-bfcache-rel/gn-args.json index 5cfc5d91..b2cd361 100644 --- a/infra/config/generated/builders/try/android-bfcache-rel/gn-args.json +++ b/infra/config/generated/builders/try/android-bfcache-rel/gn-args.json
@@ -3,7 +3,6 @@ "android_static_analysis": "off", "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android-binary-size-siso/gn-args.json b/infra/config/generated/builders/try/android-binary-size-siso/gn-args.json index 69d0fa6..2d8abbd0 100644 --- a/infra/config/generated/builders/try/android-binary-size-siso/gn-args.json +++ b/infra/config/generated/builders/try/android-binary-size-siso/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "android_channel": "stable", "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_official_build": true, "is_on_release_branch": true,
diff --git a/infra/config/generated/builders/try/android-binary-size/gn-args.json b/infra/config/generated/builders/try/android-binary-size/gn-args.json index 69d0fa6..2d8abbd0 100644 --- a/infra/config/generated/builders/try/android-binary-size/gn-args.json +++ b/infra/config/generated/builders/try/android-binary-size/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "android_channel": "stable", "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_official_build": true, "is_on_release_branch": true,
diff --git a/infra/config/generated/builders/try/android-chrome-pie-x86-wpt-android-specific/gn-args.json b/infra/config/generated/builders/try/android-chrome-pie-x86-wpt-android-specific/gn-args.json index 5cfc5d91..b2cd361 100644 --- a/infra/config/generated/builders/try/android-chrome-pie-x86-wpt-android-specific/gn-args.json +++ b/infra/config/generated/builders/try/android-chrome-pie-x86-wpt-android-specific/gn-args.json
@@ -3,7 +3,6 @@ "android_static_analysis": "off", "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android-chrome-pie-x86-wpt-fyi-rel/gn-args.json b/infra/config/generated/builders/try/android-chrome-pie-x86-wpt-fyi-rel/gn-args.json index 5cfc5d91..b2cd361 100644 --- a/infra/config/generated/builders/try/android-chrome-pie-x86-wpt-fyi-rel/gn-args.json +++ b/infra/config/generated/builders/try/android-chrome-pie-x86-wpt-fyi-rel/gn-args.json
@@ -3,7 +3,6 @@ "android_static_analysis": "off", "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android-cronet-x86-dbg-10-tests/gn-args.json b/infra/config/generated/builders/try/android-cronet-x86-dbg-10-tests/gn-args.json index 3c0cd40..916db64 100644 --- a/infra/config/generated/builders/try/android-cronet-x86-dbg-10-tests/gn-args.json +++ b/infra/config/generated/builders/try/android-cronet-x86-dbg-10-tests/gn-args.json
@@ -5,7 +5,6 @@ "default_min_sdk_version": 21, "disable_file_support": true, "enable_base_tracing": false, - "enable_mojom_message_id_scrambling": false, "enable_reporting": true, "enable_resource_allowlist_generation": false, "enable_websockets": false,
diff --git a/infra/config/generated/builders/try/android-cronet-x86-dbg-lollipop-tests/gn-args.json b/infra/config/generated/builders/try/android-cronet-x86-dbg-lollipop-tests/gn-args.json index 3c0cd40..916db64 100644 --- a/infra/config/generated/builders/try/android-cronet-x86-dbg-lollipop-tests/gn-args.json +++ b/infra/config/generated/builders/try/android-cronet-x86-dbg-lollipop-tests/gn-args.json
@@ -5,7 +5,6 @@ "default_min_sdk_version": 21, "disable_file_support": true, "enable_base_tracing": false, - "enable_mojom_message_id_scrambling": false, "enable_reporting": true, "enable_resource_allowlist_generation": false, "enable_websockets": false,
diff --git a/infra/config/generated/builders/try/android-dawn-arm-rel/gn-args.json b/infra/config/generated/builders/try/android-dawn-arm-rel/gn-args.json index 86d6f90..96ebd2f1 100644 --- a/infra/config/generated/builders/try/android-dawn-arm-rel/gn-args.json +++ b/infra/config/generated/builders/try/android-dawn-arm-rel/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android-dawn-arm64-rel/gn-args.json b/infra/config/generated/builders/try/android-dawn-arm64-rel/gn-args.json index 27ee115..29d2b6e 100644 --- a/infra/config/generated/builders/try/android-dawn-arm64-rel/gn-args.json +++ b/infra/config/generated/builders/try/android-dawn-arm64-rel/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android-oreo-arm64-dbg/gn-args.json b/infra/config/generated/builders/try/android-oreo-arm64-dbg/gn-args.json index 9684d5f..3ad5d3b 100644 --- a/infra/config/generated/builders/try/android-oreo-arm64-dbg/gn-args.json +++ b/infra/config/generated/builders/try/android-oreo-arm64-dbg/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/android-oreo-x86-rel/gn-args.json b/infra/config/generated/builders/try/android-oreo-x86-rel/gn-args.json index b21435f..38908a88 100644 --- a/infra/config/generated/builders/try/android-oreo-x86-rel/gn-args.json +++ b/infra/config/generated/builders/try/android-oreo-x86-rel/gn-args.json
@@ -4,7 +4,6 @@ "coverage_instrumentation_input_file": "//.code-coverage/files_to_instrument.txt", "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android-pie-arm64-dbg/gn-args.json b/infra/config/generated/builders/try/android-pie-arm64-dbg/gn-args.json index 9684d5f..3ad5d3b 100644 --- a/infra/config/generated/builders/try/android-pie-arm64-dbg/gn-args.json +++ b/infra/config/generated/builders/try/android-pie-arm64-dbg/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/android-pie-x86-rel/gn-args.json b/infra/config/generated/builders/try/android-pie-x86-rel/gn-args.json index 5cfc5d91..b2cd361 100644 --- a/infra/config/generated/builders/try/android-pie-x86-rel/gn-args.json +++ b/infra/config/generated/builders/try/android-pie-x86-rel/gn-args.json
@@ -3,7 +3,6 @@ "android_static_analysis": "off", "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android-rust-arm32-rel/gn-args.json b/infra/config/generated/builders/try/android-rust-arm32-rel/gn-args.json new file mode 100644 index 0000000..71848a86 --- /dev/null +++ b/infra/config/generated/builders/try/android-rust-arm32-rel/gn-args.json
@@ -0,0 +1,16 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "debuggable_apks": false, + "enable_all_rust_features": true, + "ffmpeg_branding": "Chrome", + "is_component_build": false, + "is_debug": false, + "proprietary_codecs": true, + "symbol_level": 1, + "target_cpu": "arm", + "target_os": "android", + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/android-rust-arm32-rel/properties.json b/infra/config/generated/builders/try/android-rust-arm32-rel/properties.json index 643a234..7e5a267 100644 --- a/infra/config/generated/builders/try/android-rust-arm32-rel/properties.json +++ b/infra/config/generated/builders/try/android-rust-arm32-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/android-rust-arm32-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/android-rust-arm64-dbg/gn-args.json b/infra/config/generated/builders/try/android-rust-arm64-dbg/gn-args.json new file mode 100644 index 0000000..b26986c1 --- /dev/null +++ b/infra/config/generated/builders/try/android-rust-arm64-dbg/gn-args.json
@@ -0,0 +1,14 @@ +{ + "gn_args": { + "debuggable_apks": false, + "enable_all_rust_features": true, + "ffmpeg_branding": "Chrome", + "is_component_build": true, + "is_debug": true, + "proprietary_codecs": true, + "symbol_level": 1, + "target_cpu": "arm64", + "target_os": "android", + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/android-rust-arm64-dbg/properties.json b/infra/config/generated/builders/try/android-rust-arm64-dbg/properties.json index 44b79a5a..7140b54b 100644 --- a/infra/config/generated/builders/try/android-rust-arm64-dbg/properties.json +++ b/infra/config/generated/builders/try/android-rust-arm64-dbg/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/android-rust-arm64-dbg/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/android-rust-arm64-rel/gn-args.json b/infra/config/generated/builders/try/android-rust-arm64-rel/gn-args.json new file mode 100644 index 0000000..3461678 --- /dev/null +++ b/infra/config/generated/builders/try/android-rust-arm64-rel/gn-args.json
@@ -0,0 +1,16 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "debuggable_apks": false, + "enable_all_rust_features": true, + "ffmpeg_branding": "Chrome", + "is_component_build": false, + "is_debug": false, + "proprietary_codecs": true, + "symbol_level": 1, + "target_cpu": "arm64", + "target_os": "android", + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/android-rust-arm64-rel/properties.json b/infra/config/generated/builders/try/android-rust-arm64-rel/properties.json index 9da117c..c9de207e4 100644 --- a/infra/config/generated/builders/try/android-rust-arm64-rel/properties.json +++ b/infra/config/generated/builders/try/android-rust-arm64-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/android-rust-arm64-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/android-webview-10-x86-rel-tests/gn-args.json b/infra/config/generated/builders/try/android-webview-10-x86-rel-tests/gn-args.json index 2546538..7f2cc4c 100644 --- a/infra/config/generated/builders/try/android-webview-10-x86-rel-tests/gn-args.json +++ b/infra/config/generated/builders/try/android-webview-10-x86-rel-tests/gn-args.json
@@ -3,7 +3,6 @@ "android_static_analysis": "off", "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android-webview-12-x64-dbg/gn-args.json b/infra/config/generated/builders/try/android-webview-12-x64-dbg/gn-args.json index 217aceb..7559654 100644 --- a/infra/config/generated/builders/try/android-webview-12-x64-dbg/gn-args.json +++ b/infra/config/generated/builders/try/android-webview-12-x64-dbg/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/android-webview-13-x64-dbg/gn-args.json b/infra/config/generated/builders/try/android-webview-13-x64-dbg/gn-args.json index 217aceb..7559654 100644 --- a/infra/config/generated/builders/try/android-webview-13-x64-dbg/gn-args.json +++ b/infra/config/generated/builders/try/android-webview-13-x64-dbg/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/android-webview-oreo-arm64-dbg/gn-args.json b/infra/config/generated/builders/try/android-webview-oreo-arm64-dbg/gn-args.json index 2854deb..500bd2d7 100644 --- a/infra/config/generated/builders/try/android-webview-oreo-arm64-dbg/gn-args.json +++ b/infra/config/generated/builders/try/android-webview-oreo-arm64-dbg/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android-webview-pie-arm64-dbg/gn-args.json b/infra/config/generated/builders/try/android-webview-pie-arm64-dbg/gn-args.json index 2854deb..500bd2d7 100644 --- a/infra/config/generated/builders/try/android-webview-pie-arm64-dbg/gn-args.json +++ b/infra/config/generated/builders/try/android-webview-pie-arm64-dbg/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android-x64-cast/gn-args.json b/infra/config/generated/builders/try/android-x64-cast/gn-args.json index b7d6ea4..9e90dc8 100644 --- a/infra/config/generated/builders/try/android-x64-cast/gn-args.json +++ b/infra/config/generated/builders/try/android-x64-cast/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "debuggable_apks": false, "enable_cast_receiver": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_cast_android": true, "is_clang": true,
diff --git a/infra/config/generated/builders/try/android-x86-rel/gn-args.json b/infra/config/generated/builders/try/android-x86-rel/gn-args.json index 6eb700e..fd52a171 100644 --- a/infra/config/generated/builders/try/android-x86-rel/gn-args.json +++ b/infra/config/generated/builders/try/android-x86-rel/gn-args.json
@@ -4,7 +4,6 @@ "coverage_instrumentation_input_file": "//.code-coverage/files_to_instrument.txt", "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/android_arm64_dbg_recipe/gn-args.json b/infra/config/generated/builders/try/android_arm64_dbg_recipe/gn-args.json index 0668e14..b695083 100644 --- a/infra/config/generated/builders/try/android_arm64_dbg_recipe/gn-args.json +++ b/infra/config/generated/builders/try/android_arm64_dbg_recipe/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "android_static_analysis": "off", "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/android_compile_dbg/gn-args.json b/infra/config/generated/builders/try/android_compile_dbg/gn-args.json index 3d971bf..35a882c 100644 --- a/infra/config/generated/builders/try/android_compile_dbg/gn-args.json +++ b/infra/config/generated/builders/try/android_compile_dbg/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/android_compile_dbg/properties.json b/infra/config/generated/builders/try/android_compile_dbg/properties.json index f13f4a4..d1bf63d 100644 --- a/infra/config/generated/builders/try/android_compile_dbg/properties.json +++ b/infra/config/generated/builders/try/android_compile_dbg/properties.json
@@ -58,6 +58,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-untrusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git a/infra/config/generated/builders/try/android_compile_siso_dbg/gn-args.json b/infra/config/generated/builders/try/android_compile_siso_dbg/gn-args.json index 3d971bf..35a882c 100644 --- a/infra/config/generated/builders/try/android_compile_siso_dbg/gn-args.json +++ b/infra/config/generated/builders/try/android_compile_siso_dbg/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/android_compile_siso_dbg/properties.json b/infra/config/generated/builders/try/android_compile_siso_dbg/properties.json index 42af94e2..ead6b94 100644 --- a/infra/config/generated/builders/try/android_compile_siso_dbg/properties.json +++ b/infra/config/generated/builders/try/android_compile_siso_dbg/properties.json
@@ -60,8 +60,7 @@ }, "$build/siso": { "configs": [ - "builder", - "remote-devtools-frontend-typescript" + "builder" ], "enable_cloud_profiler": true, "enable_cloud_trace": true,
diff --git a/infra/config/generated/builders/try/android_compile_x64_dbg/gn-args.json b/infra/config/generated/builders/try/android_compile_x64_dbg/gn-args.json index bf2854d1..6a4440e 100644 --- a/infra/config/generated/builders/try/android_compile_x64_dbg/gn-args.json +++ b/infra/config/generated/builders/try/android_compile_x64_dbg/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/android_compile_x86_dbg/gn-args.json b/infra/config/generated/builders/try/android_compile_x86_dbg/gn-args.json index e973d72..06fe72a 100644 --- a/infra/config/generated/builders/try/android_compile_x86_dbg/gn-args.json +++ b/infra/config/generated/builders/try/android_compile_x86_dbg/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/android_cronet/gn-args.json b/infra/config/generated/builders/try/android_cronet/gn-args.json index 6158c6a..1fdd7f7e 100644 --- a/infra/config/generated/builders/try/android_cronet/gn-args.json +++ b/infra/config/generated/builders/try/android_cronet/gn-args.json
@@ -7,7 +7,6 @@ "default_min_sdk_version": 21, "disable_file_support": true, "enable_base_tracing": false, - "enable_mojom_message_id_scrambling": false, "enable_reporting": true, "enable_resource_allowlist_generation": false, "enable_websockets": false,
diff --git a/infra/config/generated/builders/try/chromeos-amd64-generic-dbg/gn-args.json b/infra/config/generated/builders/try/chromeos-amd64-generic-dbg/gn-args.json index 3d38a33d..16e3b03 100644 --- a/infra/config/generated/builders/try/chromeos-amd64-generic-dbg/gn-args.json +++ b/infra/config/generated/builders/try/chromeos-amd64-generic-dbg/gn-args.json
@@ -2,7 +2,6 @@ "args_file": "//build/args/chromeos/amd64-generic.gni", "gn_args": { "dcheck_always_on": false, - "enable_mojom_message_id_scrambling": false, "is_chromeos_device": true, "is_debug": true, "ozone_platform_headless": true,
diff --git a/infra/config/generated/builders/try/chromeos-amd64-generic-rel-gtest-and-tast/gn-args.json b/infra/config/generated/builders/try/chromeos-amd64-generic-rel-gtest-and-tast/gn-args.json index 1b92215..7a830b21 100644 --- a/infra/config/generated/builders/try/chromeos-amd64-generic-rel-gtest-and-tast/gn-args.json +++ b/infra/config/generated/builders/try/chromeos-amd64-generic-rel-gtest-and-tast/gn-args.json
@@ -3,7 +3,6 @@ "gn_args": { "also_build_lacros_chrome_for_architecture": "amd64", "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_chromeos_device": true, "ozone_platform_headless": true, "use_dummy_lastchange": true,
diff --git a/infra/config/generated/builders/try/chromeos-amd64-generic-rel-gtest/gn-args.json b/infra/config/generated/builders/try/chromeos-amd64-generic-rel-gtest/gn-args.json index 1b92215..7a830b21 100644 --- a/infra/config/generated/builders/try/chromeos-amd64-generic-rel-gtest/gn-args.json +++ b/infra/config/generated/builders/try/chromeos-amd64-generic-rel-gtest/gn-args.json
@@ -3,7 +3,6 @@ "gn_args": { "also_build_lacros_chrome_for_architecture": "amd64", "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_chromeos_device": true, "ozone_platform_headless": true, "use_dummy_lastchange": true,
diff --git a/infra/config/generated/builders/try/chromeos-amd64-generic-rel-renamed/gn-args.json b/infra/config/generated/builders/try/chromeos-amd64-generic-rel-renamed/gn-args.json index 1b92215..7a830b21 100644 --- a/infra/config/generated/builders/try/chromeos-amd64-generic-rel-renamed/gn-args.json +++ b/infra/config/generated/builders/try/chromeos-amd64-generic-rel-renamed/gn-args.json
@@ -3,7 +3,6 @@ "gn_args": { "also_build_lacros_chrome_for_architecture": "amd64", "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_chromeos_device": true, "ozone_platform_headless": true, "use_dummy_lastchange": true,
diff --git a/infra/config/generated/builders/try/chromeos-amd64-generic-rel/gn-args.json b/infra/config/generated/builders/try/chromeos-amd64-generic-rel/gn-args.json index 1b92215..7a830b21 100644 --- a/infra/config/generated/builders/try/chromeos-amd64-generic-rel/gn-args.json +++ b/infra/config/generated/builders/try/chromeos-amd64-generic-rel/gn-args.json
@@ -3,7 +3,6 @@ "gn_args": { "also_build_lacros_chrome_for_architecture": "amd64", "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_chromeos_device": true, "ozone_platform_headless": true, "use_dummy_lastchange": true,
diff --git a/infra/config/generated/builders/try/chromeos-amd64-generic-siso-rel-compilator/properties.json b/infra/config/generated/builders/try/chromeos-amd64-generic-siso-rel-compilator/properties.json index 38cb81e60..a78f39c4 100644 --- a/infra/config/generated/builders/try/chromeos-amd64-generic-siso-rel-compilator/properties.json +++ b/infra/config/generated/builders/try/chromeos-amd64-generic-siso-rel-compilator/properties.json
@@ -62,8 +62,7 @@ }, "$build/siso": { "configs": [ - "builder", - "remote-devtools-frontend-typescript" + "builder" ], "enable_cloud_profiler": true, "enable_cloud_trace": true,
diff --git a/infra/config/generated/builders/try/chromeos-arm-generic-rel/gn-args.json b/infra/config/generated/builders/try/chromeos-arm-generic-rel/gn-args.json index 0d432156..0debe17 100644 --- a/infra/config/generated/builders/try/chromeos-arm-generic-rel/gn-args.json +++ b/infra/config/generated/builders/try/chromeos-arm-generic-rel/gn-args.json
@@ -2,7 +2,6 @@ "args_file": "//build/args/chromeos/arm-generic.gni", "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_chromeos_device": true, "ozone_platform_headless": true, "use_dummy_lastchange": true,
diff --git a/infra/config/generated/builders/try/dawn-android-arm-deps-rel/gn-args.json b/infra/config/generated/builders/try/dawn-android-arm-deps-rel/gn-args.json index 86d6f90..96ebd2f1 100644 --- a/infra/config/generated/builders/try/dawn-android-arm-deps-rel/gn-args.json +++ b/infra/config/generated/builders/try/dawn-android-arm-deps-rel/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/dawn-android-arm64-deps-rel/gn-args.json b/infra/config/generated/builders/try/dawn-android-arm64-deps-rel/gn-args.json index 27ee115..29d2b6e 100644 --- a/infra/config/generated/builders/try/dawn-android-arm64-deps-rel/gn-args.json +++ b/infra/config/generated/builders/try/dawn-android-arm64-deps-rel/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dcheck_always_on": true, "debuggable_apks": false, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/dawn-linux-x64-deps-rel/gn-args.json b/infra/config/generated/builders/try/dawn-linux-x64-deps-rel/gn-args.json index 5b182aa..57a2973 100644 --- a/infra/config/generated/builders/try/dawn-linux-x64-deps-rel/gn-args.json +++ b/infra/config/generated/builders/try/dawn-linux-x64-deps-rel/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/dawn-mac-x64-deps-rel/gn-args.json b/infra/config/generated/builders/try/dawn-mac-x64-deps-rel/gn-args.json index 91f1530..8b405d5 100644 --- a/infra/config/generated/builders/try/dawn-mac-x64-deps-rel/gn-args.json +++ b/infra/config/generated/builders/try/dawn-mac-x64-deps-rel/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/dawn-try-linux-tsan-rel/gn-args.json b/infra/config/generated/builders/try/dawn-try-linux-tsan-rel/gn-args.json index a25b08e5..8f82e0e9 100644 --- a/infra/config/generated/builders/try/dawn-try-linux-tsan-rel/gn-args.json +++ b/infra/config/generated/builders/try/dawn-try-linux-tsan-rel/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "is_tsan": true,
diff --git a/infra/config/generated/builders/try/dawn-try-mac-amd-exp/gn-args.json b/infra/config/generated/builders/try/dawn-try-mac-amd-exp/gn-args.json index 91f1530..8b405d5 100644 --- a/infra/config/generated/builders/try/dawn-try-mac-amd-exp/gn-args.json +++ b/infra/config/generated/builders/try/dawn-try-mac-amd-exp/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/dawn-try-mac-arm64-deps-rel/gn-args.json b/infra/config/generated/builders/try/dawn-try-mac-arm64-deps-rel/gn-args.json index 7f16d6ac..f537c0e 100644 --- a/infra/config/generated/builders/try/dawn-try-mac-arm64-deps-rel/gn-args.json +++ b/infra/config/generated/builders/try/dawn-try-mac-arm64-deps-rel/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/dawn-try-mac-arm64-rel/gn-args.json b/infra/config/generated/builders/try/dawn-try-mac-arm64-rel/gn-args.json index 7f16d6ac..f537c0e 100644 --- a/infra/config/generated/builders/try/dawn-try-mac-arm64-rel/gn-args.json +++ b/infra/config/generated/builders/try/dawn-try-mac-arm64-rel/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/dawn-try-mac-intel-exp/gn-args.json b/infra/config/generated/builders/try/dawn-try-mac-intel-exp/gn-args.json index 91f1530..8b405d5 100644 --- a/infra/config/generated/builders/try/dawn-try-mac-intel-exp/gn-args.json +++ b/infra/config/generated/builders/try/dawn-try-mac-intel-exp/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/dawn-try-win-x64-intel-exp/gn-args.json b/infra/config/generated/builders/try/dawn-try-win-x64-intel-exp/gn-args.json index bfe074f2..e5f7115 100644 --- a/infra/config/generated/builders/try/dawn-try-win-x64-intel-exp/gn-args.json +++ b/infra/config/generated/builders/try/dawn-try-win-x64-intel-exp/gn-args.json
@@ -3,7 +3,6 @@ "dawn_enable_opengles": true, "dawn_use_built_dxc": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/dawn-try-win-x86-intel-exp/gn-args.json b/infra/config/generated/builders/try/dawn-try-win-x86-intel-exp/gn-args.json index 2b69f5f..a6f87e49 100644 --- a/infra/config/generated/builders/try/dawn-try-win-x86-intel-exp/gn-args.json +++ b/infra/config/generated/builders/try/dawn-try-win-x86-intel-exp/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/dawn-try-win10-x64-intel-asan/gn-args.json b/infra/config/generated/builders/try/dawn-try-win10-x64-intel-asan/gn-args.json index 6629de4..ae751e9 100644 --- a/infra/config/generated/builders/try/dawn-try-win10-x64-intel-asan/gn-args.json +++ b/infra/config/generated/builders/try/dawn-try-win10-x64-intel-asan/gn-args.json
@@ -3,7 +3,6 @@ "dawn_enable_opengles": true, "dawn_use_built_dxc": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_asan": true, "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/dawn-try-win10-x64-nvidia-asan/gn-args.json b/infra/config/generated/builders/try/dawn-try-win10-x64-nvidia-asan/gn-args.json index 6629de4..ae751e9 100644 --- a/infra/config/generated/builders/try/dawn-try-win10-x64-nvidia-asan/gn-args.json +++ b/infra/config/generated/builders/try/dawn-try-win10-x64-nvidia-asan/gn-args.json
@@ -3,7 +3,6 @@ "dawn_enable_opengles": true, "dawn_use_built_dxc": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_asan": true, "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/dawn-try-win10-x86-rel/gn-args.json b/infra/config/generated/builders/try/dawn-try-win10-x86-rel/gn-args.json index 2b69f5f..a6f87e49 100644 --- a/infra/config/generated/builders/try/dawn-try-win10-x86-rel/gn-args.json +++ b/infra/config/generated/builders/try/dawn-try-win10-x86-rel/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/dawn-win10-x64-deps-rel/gn-args.json b/infra/config/generated/builders/try/dawn-win10-x64-deps-rel/gn-args.json index bfe074f2..e5f7115 100644 --- a/infra/config/generated/builders/try/dawn-win10-x64-deps-rel/gn-args.json +++ b/infra/config/generated/builders/try/dawn-win10-x64-deps-rel/gn-args.json
@@ -3,7 +3,6 @@ "dawn_enable_opengles": true, "dawn_use_built_dxc": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/dawn-win10-x86-deps-rel/gn-args.json b/infra/config/generated/builders/try/dawn-win10-x86-deps-rel/gn-args.json index 2b69f5f..a6f87e49 100644 --- a/infra/config/generated/builders/try/dawn-win10-x86-deps-rel/gn-args.json +++ b/infra/config/generated/builders/try/dawn-win10-x86-deps-rel/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/fuchsia-angle-try/gn-args.json b/infra/config/generated/builders/try/fuchsia-angle-try/gn-args.json index ec5a510..2ae78d2 100644 --- a/infra/config/generated/builders/try/fuchsia-angle-try/gn-args.json +++ b/infra/config/generated/builders/try/fuchsia-angle-try/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "build_angle_deqp_tests": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": true, "is_debug": false, "symbol_level": 0,
diff --git a/infra/config/generated/builders/try/fuchsia-arm64-cast-receiver-rel/gn-args.json b/infra/config/generated/builders/try/fuchsia-arm64-cast-receiver-rel/gn-args.json index 87998b7..027c9bc 100644 --- a/infra/config/generated/builders/try/fuchsia-arm64-cast-receiver-rel/gn-args.json +++ b/infra/config/generated/builders/try/fuchsia-arm64-cast-receiver-rel/gn-args.json
@@ -2,7 +2,6 @@ "args_file": "//build/config/fuchsia/size_optimized_cast_receiver_args.gn", "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 0,
diff --git a/infra/config/generated/builders/try/fuchsia-arm64-rel/gn-args.json b/infra/config/generated/builders/try/fuchsia-arm64-rel/gn-args.json index c4c1242..1275069 100644 --- a/infra/config/generated/builders/try/fuchsia-arm64-rel/gn-args.json +++ b/infra/config/generated/builders/try/fuchsia-arm64-rel/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 0,
diff --git a/infra/config/generated/builders/try/fuchsia-binary-size-siso/gn-args.json b/infra/config/generated/builders/try/fuchsia-binary-size-siso/gn-args.json index 21c97d5c..7375c24 100644 --- a/infra/config/generated/builders/try/fuchsia-binary-size-siso/gn-args.json +++ b/infra/config/generated/builders/try/fuchsia-binary-size-siso/gn-args.json
@@ -2,7 +2,6 @@ "args_file": "//build/config/fuchsia/size_optimized_cast_receiver_args.gn", "gn_args": { "dcheck_always_on": false, - "enable_mojom_message_id_scrambling": false, "is_debug": false, "is_official_build": true, "target_cpu": "arm64",
diff --git a/infra/config/generated/builders/try/fuchsia-binary-size/gn-args.json b/infra/config/generated/builders/try/fuchsia-binary-size/gn-args.json index 21c97d5c..7375c24 100644 --- a/infra/config/generated/builders/try/fuchsia-binary-size/gn-args.json +++ b/infra/config/generated/builders/try/fuchsia-binary-size/gn-args.json
@@ -2,7 +2,6 @@ "args_file": "//build/config/fuchsia/size_optimized_cast_receiver_args.gn", "gn_args": { "dcheck_always_on": false, - "enable_mojom_message_id_scrambling": false, "is_debug": false, "is_official_build": true, "target_cpu": "arm64",
diff --git a/infra/config/generated/builders/try/fuchsia-compile-x64-dbg/gn-args.json b/infra/config/generated/builders/try/fuchsia-compile-x64-dbg/gn-args.json index 8339b8f45..272f3a1 100644 --- a/infra/config/generated/builders/try/fuchsia-compile-x64-dbg/gn-args.json +++ b/infra/config/generated/builders/try/fuchsia-compile-x64-dbg/gn-args.json
@@ -1,6 +1,5 @@ { "gn_args": { - "enable_mojom_message_id_scrambling": false, "is_component_build": true, "is_debug": true, "symbol_level": 0,
diff --git a/infra/config/generated/builders/try/fuchsia-x64-cast-receiver-rel/gn-args.json b/infra/config/generated/builders/try/fuchsia-x64-cast-receiver-rel/gn-args.json index e52eb2b..ba8cb54 100644 --- a/infra/config/generated/builders/try/fuchsia-x64-cast-receiver-rel/gn-args.json +++ b/infra/config/generated/builders/try/fuchsia-x64-cast-receiver-rel/gn-args.json
@@ -3,7 +3,6 @@ "gn_args": { "coverage_instrumentation_input_file": "//.code-coverage/files_to_instrument.txt", "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "fuchsia_code_coverage": true, "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/fuchsia-x64-rel/gn-args.json b/infra/config/generated/builders/try/fuchsia-x64-rel/gn-args.json index 85fa2057..cf80cb8e 100644 --- a/infra/config/generated/builders/try/fuchsia-x64-rel/gn-args.json +++ b/infra/config/generated/builders/try/fuchsia-x64-rel/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 0,
diff --git a/infra/config/generated/builders/try/ios-asan/gn-args.json b/infra/config/generated/builders/try/ios-asan/gn-args.json new file mode 100644 index 0000000..7ef3db0 --- /dev/null +++ b/infra/config/generated/builders/try/ios-asan/gn-args.json
@@ -0,0 +1,13 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "enable_run_ios_unittests_with_xctest": true, + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "target_cpu": "x64", + "target_environment": "simulator", + "target_os": "ios", + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/ios-asan/properties.json b/infra/config/generated/builders/try/ios-asan/properties.json index c4cc573..7272baefd 100644 --- a/infra/config/generated/builders/try/ios-asan/properties.json +++ b/infra/config/generated/builders/try/ios-asan/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/ios-asan/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/ios-simulator-full-configs/gn-args.json b/infra/config/generated/builders/try/ios-simulator-full-configs/gn-args.json index ee962bc5..eba0bf24 100644 --- a/infra/config/generated/builders/try/ios-simulator-full-configs/gn-args.json +++ b/infra/config/generated/builders/try/ios-simulator-full-configs/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "coverage_instrumentation_input_file": "//.code-coverage/files_to_instrument.txt", - "enable_mojom_message_id_scrambling": false, "enable_run_ios_unittests_with_xctest": true, "is_component_build": false, "is_debug": true,
diff --git a/infra/config/generated/builders/try/ios-simulator-noncq/gn-args.json b/infra/config/generated/builders/try/ios-simulator-noncq/gn-args.json index e012ac34..41bf2db 100644 --- a/infra/config/generated/builders/try/ios-simulator-noncq/gn-args.json +++ b/infra/config/generated/builders/try/ios-simulator-noncq/gn-args.json
@@ -1,6 +1,5 @@ { "gn_args": { - "enable_mojom_message_id_scrambling": false, "enable_run_ios_unittests_with_xctest": true, "is_component_build": false, "is_debug": true,
diff --git a/infra/config/generated/builders/try/ios-simulator/gn-args.json b/infra/config/generated/builders/try/ios-simulator/gn-args.json index ee962bc5..eba0bf24 100644 --- a/infra/config/generated/builders/try/ios-simulator/gn-args.json +++ b/infra/config/generated/builders/try/ios-simulator/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "coverage_instrumentation_input_file": "//.code-coverage/files_to_instrument.txt", - "enable_mojom_message_id_scrambling": false, "enable_run_ios_unittests_with_xctest": true, "is_component_build": false, "is_debug": true,
diff --git a/infra/config/generated/builders/try/lacros-amd64-generic-rel-non-skylab/gn-args.json b/infra/config/generated/builders/try/lacros-amd64-generic-rel-non-skylab/gn-args.json index e58e5df..a492cde39 100644 --- a/infra/config/generated/builders/try/lacros-amd64-generic-rel-non-skylab/gn-args.json +++ b/infra/config/generated/builders/try/lacros-amd64-generic-rel-non-skylab/gn-args.json
@@ -3,7 +3,6 @@ "gn_args": { "chromeos_is_browser_only": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_chromeos_device": true, "is_debug": false, "ozone_platform_headless": true,
diff --git a/infra/config/generated/builders/try/lacros-amd64-generic-rel/gn-args.json b/infra/config/generated/builders/try/lacros-amd64-generic-rel/gn-args.json index 77f7170..501041d 100644 --- a/infra/config/generated/builders/try/lacros-amd64-generic-rel/gn-args.json +++ b/infra/config/generated/builders/try/lacros-amd64-generic-rel/gn-args.json
@@ -3,7 +3,6 @@ "gn_args": { "chromeos_is_browser_only": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_chromeos_device": true, "is_debug": false, "is_skylab": true,
diff --git a/infra/config/generated/builders/try/lacros-arm-generic-rel/gn-args.json b/infra/config/generated/builders/try/lacros-arm-generic-rel/gn-args.json index 4ca3f93..2231274 100644 --- a/infra/config/generated/builders/try/lacros-arm-generic-rel/gn-args.json +++ b/infra/config/generated/builders/try/lacros-arm-generic-rel/gn-args.json
@@ -3,7 +3,6 @@ "gn_args": { "chromeos_is_browser_only": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_chromeos_device": true, "is_debug": false, "ozone_platform_headless": true,
diff --git a/infra/config/generated/builders/try/layout_test_leak_detection/gn-args.json b/infra/config/generated/builders/try/layout_test_leak_detection/gn-args.json new file mode 100644 index 0000000..03c4f762 --- /dev/null +++ b/infra/config/generated/builders/try/layout_test_leak_detection/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "is_component_build": false, + "is_debug": false, + "symbol_level": 0, + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/layout_test_leak_detection/properties.json b/infra/config/generated/builders/try/layout_test_leak_detection/properties.json index 5d246b94..1c523091 100644 --- a/infra/config/generated/builders/try/layout_test_leak_detection/properties.json +++ b/infra/config/generated/builders/try/layout_test_leak_detection/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/layout_test_leak_detection/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/leak_detection_linux/gn-args.json b/infra/config/generated/builders/try/leak_detection_linux/gn-args.json index 8c8f591..03c4f762 100644 --- a/infra/config/generated/builders/try/leak_detection_linux/gn-args.json +++ b/infra/config/generated/builders/try/leak_detection_linux/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 0,
diff --git a/infra/config/generated/builders/try/linux-arm64-castos/gn-args.json b/infra/config/generated/builders/try/linux-arm64-castos/gn-args.json index fb3b944f..4873f19 100644 --- a/infra/config/generated/builders/try/linux-arm64-castos/gn-args.json +++ b/infra/config/generated/builders/try/linux-arm64-castos/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dcheck_always_on": false, "enable_cast_receiver": true, - "enable_mojom_message_id_scrambling": false, "is_castos": true, "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/linux-cfm-rel/gn-args.json b/infra/config/generated/builders/try/linux-cfm-rel/gn-args.json index 47fc54d..0c5f630e 100644 --- a/infra/config/generated/builders/try/linux-cfm-rel/gn-args.json +++ b/infra/config/generated/builders/try/linux-cfm-rel/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_cfm": true, "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/linux-chromeos-compile-dbg/gn-args.json b/infra/config/generated/builders/try/linux-chromeos-compile-dbg/gn-args.json index f9c9461f..5e765cf 100644 --- a/infra/config/generated/builders/try/linux-chromeos-compile-dbg/gn-args.json +++ b/infra/config/generated/builders/try/linux-chromeos-compile-dbg/gn-args.json
@@ -1,6 +1,5 @@ { "gn_args": { - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "ChromeOS", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/linux-chromeos-compile-siso-dbg/properties.json b/infra/config/generated/builders/try/linux-chromeos-compile-siso-dbg/properties.json index 6d77c81..c2b1a0c 100644 --- a/infra/config/generated/builders/try/linux-chromeos-compile-siso-dbg/properties.json +++ b/infra/config/generated/builders/try/linux-chromeos-compile-siso-dbg/properties.json
@@ -54,8 +54,7 @@ }, "$build/siso": { "configs": [ - "builder", - "remote-devtools-frontend-typescript" + "builder" ], "enable_cloud_profiler": true, "enable_cloud_trace": true,
diff --git a/infra/config/generated/builders/try/linux-chromeos-dbg/gn-args.json b/infra/config/generated/builders/try/linux-chromeos-dbg/gn-args.json index 699e809..0e73baaf 100644 --- a/infra/config/generated/builders/try/linux-chromeos-dbg/gn-args.json +++ b/infra/config/generated/builders/try/linux-chromeos-dbg/gn-args.json
@@ -1,6 +1,5 @@ { "gn_args": { - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "ChromeOS", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/linux-chromeos-rel/gn-args.json b/infra/config/generated/builders/try/linux-chromeos-rel/gn-args.json index 3e9fd736..f82fc1b 100644 --- a/infra/config/generated/builders/try/linux-chromeos-rel/gn-args.json +++ b/infra/config/generated/builders/try/linux-chromeos-rel/gn-args.json
@@ -6,7 +6,6 @@ "enable_backup_ref_ptr_feature_flag": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "ChromeOS", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/linux-dawn-rel/gn-args.json b/infra/config/generated/builders/try/linux-dawn-rel/gn-args.json index 5b182aa..57a2973 100644 --- a/infra/config/generated/builders/try/linux-dawn-rel/gn-args.json +++ b/infra/config/generated/builders/try/linux-dawn-rel/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/linux-exp-asan-lsan-fyi-rel/gn-args.json b/infra/config/generated/builders/try/linux-exp-asan-lsan-fyi-rel/gn-args.json new file mode 100644 index 0000000..bd432da --- /dev/null +++ b/infra/config/generated/builders/try/linux-exp-asan-lsan-fyi-rel/gn-args.json
@@ -0,0 +1,13 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "fail_on_san_warnings": true, + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "is_lsan": true, + "symbol_level": 1, + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux-exp-asan-lsan-fyi-rel/properties.json b/infra/config/generated/builders/try/linux-exp-asan-lsan-fyi-rel/properties.json index 256b0a5c..a9d82243 100644 --- a/infra/config/generated/builders/try/linux-exp-asan-lsan-fyi-rel/properties.json +++ b/infra/config/generated/builders/try/linux-exp-asan-lsan-fyi-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux-exp-asan-lsan-fyi-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux-exp-msan-fyi-rel/gn-args.json b/infra/config/generated/builders/try/linux-exp-msan-fyi-rel/gn-args.json new file mode 100644 index 0000000..58d9509 --- /dev/null +++ b/infra/config/generated/builders/try/linux-exp-msan-fyi-rel/gn-args.json
@@ -0,0 +1,11 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "fail_on_san_warnings": true, + "is_component_build": false, + "is_debug": false, + "is_msan": true, + "msan_track_origins": 2, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux-exp-msan-fyi-rel/properties.json b/infra/config/generated/builders/try/linux-exp-msan-fyi-rel/properties.json index 8007ac2..541c50f 100644 --- a/infra/config/generated/builders/try/linux-exp-msan-fyi-rel/properties.json +++ b/infra/config/generated/builders/try/linux-exp-msan-fyi-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux-exp-msan-fyi-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux-extended-tracing-rel/gn-args.json b/infra/config/generated/builders/try/linux-extended-tracing-rel/gn-args.json index 0df5e0f2..d55cab1 100644 --- a/infra/config/generated/builders/try/linux-extended-tracing-rel/gn-args.json +++ b/infra/config/generated/builders/try/linux-extended-tracing-rel/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "extended_tracing_enabled": true, "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/linux-lacros-asan-lsan-rel/gn-args.json b/infra/config/generated/builders/try/linux-lacros-asan-lsan-rel/gn-args.json new file mode 100644 index 0000000..a04c11e53 --- /dev/null +++ b/infra/config/generated/builders/try/linux-lacros-asan-lsan-rel/gn-args.json
@@ -0,0 +1,15 @@ +{ + "gn_args": { + "also_build_ash_chrome": true, + "chromeos_is_browser_only": true, + "dcheck_always_on": true, + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "is_lsan": true, + "symbol_level": 1, + "target_os": "chromeos", + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux-lacros-asan-lsan-rel/properties.json b/infra/config/generated/builders/try/linux-lacros-asan-lsan-rel/properties.json index bab8d5e6..5a014692 100644 --- a/infra/config/generated/builders/try/linux-lacros-asan-lsan-rel/properties.json +++ b/infra/config/generated/builders/try/linux-lacros-asan-lsan-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux-lacros-asan-lsan-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux-lacros-rel/gn-args.json b/infra/config/generated/builders/try/linux-lacros-rel/gn-args.json index db7e622b..2045401 100644 --- a/infra/config/generated/builders/try/linux-lacros-rel/gn-args.json +++ b/infra/config/generated/builders/try/linux-lacros-rel/gn-args.json
@@ -4,7 +4,6 @@ "chromeos_is_browser_only": true, "coverage_instrumentation_input_file": "//.code-coverage/files_to_instrument.txt", "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_clang": true, "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/linux-official/gn-args.json b/infra/config/generated/builders/try/linux-official/gn-args.json index 690e452..01fd8ee6 100644 --- a/infra/config/generated/builders/try/linux-official/gn-args.json +++ b/infra/config/generated/builders/try/linux-official/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_official_build": true, "symbol_level": 1, "use_dummy_lastchange": true,
diff --git a/infra/config/generated/builders/try/linux-rel-compilator/properties.json b/infra/config/generated/builders/try/linux-rel-compilator/properties.json index dad36a7e..5288b5de 100644 --- a/infra/config/generated/builders/try/linux-rel-compilator/properties.json +++ b/infra/config/generated/builders/try/linux-rel-compilator/properties.json
@@ -165,6 +165,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-untrusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git a/infra/config/generated/builders/try/linux-rel/gn-args.json b/infra/config/generated/builders/try/linux-rel/gn-args.json index b8d6efd..4e588f10 100644 --- a/infra/config/generated/builders/try/linux-rel/gn-args.json +++ b/infra/config/generated/builders/try/linux-rel/gn-args.json
@@ -6,7 +6,6 @@ "enable_backup_ref_ptr_feature_flag": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/linux-rust-x64-dbg/gn-args.json b/infra/config/generated/builders/try/linux-rust-x64-dbg/gn-args.json new file mode 100644 index 0000000..1a626964 --- /dev/null +++ b/infra/config/generated/builders/try/linux-rust-x64-dbg/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "enable_all_rust_features": true, + "is_component_build": true, + "is_debug": true, + "symbol_level": 1, + "target_cpu": "x64", + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux-rust-x64-dbg/properties.json b/infra/config/generated/builders/try/linux-rust-x64-dbg/properties.json index 228dcc5..ac72916 100644 --- a/infra/config/generated/builders/try/linux-rust-x64-dbg/properties.json +++ b/infra/config/generated/builders/try/linux-rust-x64-dbg/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux-rust-x64-dbg/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux-rust-x64-rel/gn-args.json b/infra/config/generated/builders/try/linux-rust-x64-rel/gn-args.json new file mode 100644 index 0000000..eb52c824 --- /dev/null +++ b/infra/config/generated/builders/try/linux-rust-x64-rel/gn-args.json
@@ -0,0 +1,12 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "enable_all_rust_features": true, + "is_component_build": false, + "is_debug": false, + "symbol_level": 1, + "target_cpu": "x64", + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux-rust-x64-rel/properties.json b/infra/config/generated/builders/try/linux-rust-x64-rel/properties.json index dd06edd..39df3828 100644 --- a/infra/config/generated/builders/try/linux-rust-x64-rel/properties.json +++ b/infra/config/generated/builders/try/linux-rust-x64-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux-rust-x64-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux-siso-rel-compilator/properties.json b/infra/config/generated/builders/try/linux-siso-rel-compilator/properties.json index f76fb4f..dc12af93 100644 --- a/infra/config/generated/builders/try/linux-siso-rel-compilator/properties.json +++ b/infra/config/generated/builders/try/linux-siso-rel-compilator/properties.json
@@ -168,8 +168,7 @@ }, "$build/siso": { "configs": [ - "builder", - "remote-devtools-frontend-typescript" + "builder" ], "enable_cloud_profiler": true, "enable_cloud_trace": true,
diff --git a/infra/config/generated/builders/try/linux-siso-rel/gn-args.json b/infra/config/generated/builders/try/linux-siso-rel/gn-args.json index b8d6efd..4e588f10 100644 --- a/infra/config/generated/builders/try/linux-siso-rel/gn-args.json +++ b/infra/config/generated/builders/try/linux-siso-rel/gn-args.json
@@ -6,7 +6,6 @@ "enable_backup_ref_ptr_feature_flag": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/linux-swangle-chromium-try-x64-exp/gn-args.json b/infra/config/generated/builders/try/linux-swangle-chromium-try-x64-exp/gn-args.json index fb67dcd..37b6e0955 100644 --- a/infra/config/generated/builders/try/linux-swangle-chromium-try-x64-exp/gn-args.json +++ b/infra/config/generated/builders/try/linux-swangle-chromium-try-x64-exp/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/linux-swangle-chromium-try-x64/gn-args.json b/infra/config/generated/builders/try/linux-swangle-chromium-try-x64/gn-args.json index fb67dcd..37b6e0955 100644 --- a/infra/config/generated/builders/try/linux-swangle-chromium-try-x64/gn-args.json +++ b/infra/config/generated/builders/try/linux-swangle-chromium-try-x64/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/linux-ubsan-fyi-rel/gn-args.json b/infra/config/generated/builders/try/linux-ubsan-fyi-rel/gn-args.json new file mode 100644 index 0000000..93f81a0c --- /dev/null +++ b/infra/config/generated/builders/try/linux-ubsan-fyi-rel/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "is_component_build": false, + "is_debug": false, + "is_ubsan": true, + "is_ubsan_no_recover": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux-ubsan-fyi-rel/properties.json b/infra/config/generated/builders/try/linux-ubsan-fyi-rel/properties.json index f0374c6..e7b06bf 100644 --- a/infra/config/generated/builders/try/linux-ubsan-fyi-rel/properties.json +++ b/infra/config/generated/builders/try/linux-ubsan-fyi-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux-ubsan-fyi-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux-ubsan-vptr/gn-args.json b/infra/config/generated/builders/try/linux-ubsan-vptr/gn-args.json new file mode 100644 index 0000000..4bd355d6 --- /dev/null +++ b/infra/config/generated/builders/try/linux-ubsan-vptr/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "is_component_build": false, + "is_debug": false, + "is_ubsan_no_recover": true, + "is_ubsan_vptr": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux-ubsan-vptr/properties.json b/infra/config/generated/builders/try/linux-ubsan-vptr/properties.json index f9837ce..a15412f 100644 --- a/infra/config/generated/builders/try/linux-ubsan-vptr/properties.json +++ b/infra/config/generated/builders/try/linux-ubsan-vptr/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux-ubsan-vptr/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux-updater-try-builder-rel/gn-args.json b/infra/config/generated/builders/try/linux-updater-try-builder-rel/gn-args.json index 873ffe6..5f0b0ed 100644 --- a/infra/config/generated/builders/try/linux-updater-try-builder-rel/gn-args.json +++ b/infra/config/generated/builders/try/linux-updater-try-builder-rel/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "enable_updater": true, "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/linux-v4l2-codec-rel/gn-args.json b/infra/config/generated/builders/try/linux-v4l2-codec-rel/gn-args.json index 9a3bfa6..48ac97bda 100644 --- a/infra/config/generated/builders/try/linux-v4l2-codec-rel/gn-args.json +++ b/infra/config/generated/builders/try/linux-v4l2-codec-rel/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/linux-wayland-rel/gn-args.json b/infra/config/generated/builders/try/linux-wayland-rel/gn-args.json index 1bef75a..353a7949 100644 --- a/infra/config/generated/builders/try/linux-wayland-rel/gn-args.json +++ b/infra/config/generated/builders/try/linux-wayland-rel/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "coverage_instrumentation_input_file": "//.code-coverage/files_to_instrument.txt", "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/linux-webkit-asan-rel/gn-args.json b/infra/config/generated/builders/try/linux-webkit-asan-rel/gn-args.json new file mode 100644 index 0000000..d3ce452 --- /dev/null +++ b/infra/config/generated/builders/try/linux-webkit-asan-rel/gn-args.json
@@ -0,0 +1,12 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "ffmpeg_branding": "Chrome", + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "is_lsan": true, + "proprietary_codecs": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux-webkit-asan-rel/properties.json b/infra/config/generated/builders/try/linux-webkit-asan-rel/properties.json index 337a3bf..cf2623c4 100644 --- a/infra/config/generated/builders/try/linux-webkit-asan-rel/properties.json +++ b/infra/config/generated/builders/try/linux-webkit-asan-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux-webkit-asan-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux-webkit-msan-rel/gn-args.json b/infra/config/generated/builders/try/linux-webkit-msan-rel/gn-args.json new file mode 100644 index 0000000..5715022 --- /dev/null +++ b/infra/config/generated/builders/try/linux-webkit-msan-rel/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "is_component_build": false, + "is_debug": false, + "is_msan": true, + "msan_track_origins": 2, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux-webkit-msan-rel/properties.json b/infra/config/generated/builders/try/linux-webkit-msan-rel/properties.json index ec639d1..27d465e 100644 --- a/infra/config/generated/builders/try/linux-webkit-msan-rel/properties.json +++ b/infra/config/generated/builders/try/linux-webkit-msan-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux-webkit-msan-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux-x64-castos-audio/gn-args.json b/infra/config/generated/builders/try/linux-x64-castos-audio/gn-args.json index 42d8d65..56696f6 100644 --- a/infra/config/generated/builders/try/linux-x64-castos-audio/gn-args.json +++ b/infra/config/generated/builders/try/linux-x64-castos-audio/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dcheck_always_on": true, "enable_cast_receiver": true, - "enable_mojom_message_id_scrambling": false, "is_cast_audio_only": true, "is_castos": true, "is_component_build": false,
diff --git a/infra/config/generated/builders/try/linux-x64-castos-dbg/gn-args.json b/infra/config/generated/builders/try/linux-x64-castos-dbg/gn-args.json index bc96623..51ff676 100644 --- a/infra/config/generated/builders/try/linux-x64-castos-dbg/gn-args.json +++ b/infra/config/generated/builders/try/linux-x64-castos-dbg/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "enable_cast_receiver": true, - "enable_mojom_message_id_scrambling": false, "is_castos": true, "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/linux-x64-castos/gn-args.json b/infra/config/generated/builders/try/linux-x64-castos/gn-args.json index 868b72d..3f3f06f 100644 --- a/infra/config/generated/builders/try/linux-x64-castos/gn-args.json +++ b/infra/config/generated/builders/try/linux-x64-castos/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dcheck_always_on": true, "enable_cast_receiver": true, - "enable_mojom_message_id_scrambling": false, "is_castos": true, "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/linux_chromium_asan_rel_ng-compilator/properties.json b/infra/config/generated/builders/try/linux_chromium_asan_rel_ng-compilator/properties.json index cb37fa1b..638dc83 100644 --- a/infra/config/generated/builders/try/linux_chromium_asan_rel_ng-compilator/properties.json +++ b/infra/config/generated/builders/try/linux_chromium_asan_rel_ng-compilator/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux_chromium_asan_rel_ng/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux_chromium_asan_rel_ng/gn-args.json b/infra/config/generated/builders/try/linux_chromium_asan_rel_ng/gn-args.json new file mode 100644 index 0000000..bd432da --- /dev/null +++ b/infra/config/generated/builders/try/linux_chromium_asan_rel_ng/gn-args.json
@@ -0,0 +1,13 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "fail_on_san_warnings": true, + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "is_lsan": true, + "symbol_level": 1, + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux_chromium_asan_rel_ng/properties.json b/infra/config/generated/builders/try/linux_chromium_asan_rel_ng/properties.json index 737c1ff..5e04603 100644 --- a/infra/config/generated/builders/try/linux_chromium_asan_rel_ng/properties.json +++ b/infra/config/generated/builders/try/linux_chromium_asan_rel_ng/properties.json
@@ -5,6 +5,9 @@ }, "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux_chromium_asan_rel_ng/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux_chromium_cfi_rel_ng/gn-args.json b/infra/config/generated/builders/try/linux_chromium_cfi_rel_ng/gn-args.json new file mode 100644 index 0000000..dc695f3f --- /dev/null +++ b/infra/config/generated/builders/try/linux_chromium_cfi_rel_ng/gn-args.json
@@ -0,0 +1,14 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "is_cfi": true, + "is_component_build": false, + "is_debug": false, + "use_cfi_cast": true, + "use_cfi_diag": true, + "use_cfi_icall": true, + "use_dummy_lastchange": true, + "use_remoteexec": true, + "use_thin_lto": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux_chromium_cfi_rel_ng/properties.json b/infra/config/generated/builders/try/linux_chromium_cfi_rel_ng/properties.json index ea08ddf..d16c51a4 100644 --- a/infra/config/generated/builders/try/linux_chromium_cfi_rel_ng/properties.json +++ b/infra/config/generated/builders/try/linux_chromium_cfi_rel_ng/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux_chromium_cfi_rel_ng/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux_chromium_chromeos_asan_rel_ng/gn-args.json b/infra/config/generated/builders/try/linux_chromium_chromeos_asan_rel_ng/gn-args.json new file mode 100644 index 0000000..4d01f4e8 --- /dev/null +++ b/infra/config/generated/builders/try/linux_chromium_chromeos_asan_rel_ng/gn-args.json
@@ -0,0 +1,13 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "is_lsan": true, + "symbol_level": 1, + "target_os": "chromeos", + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux_chromium_chromeos_asan_rel_ng/properties.json b/infra/config/generated/builders/try/linux_chromium_chromeos_asan_rel_ng/properties.json index 303da2cb..0710513d 100644 --- a/infra/config/generated/builders/try/linux_chromium_chromeos_asan_rel_ng/properties.json +++ b/infra/config/generated/builders/try/linux_chromium_chromeos_asan_rel_ng/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux_chromium_chromeos_asan_rel_ng/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux_chromium_chromeos_msan_rel_ng/gn-args.json b/infra/config/generated/builders/try/linux_chromium_chromeos_msan_rel_ng/gn-args.json new file mode 100644 index 0000000..02ad9ff --- /dev/null +++ b/infra/config/generated/builders/try/linux_chromium_chromeos_msan_rel_ng/gn-args.json
@@ -0,0 +1,11 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "is_component_build": false, + "is_debug": false, + "is_msan": true, + "msan_track_origins": 2, + "target_os": "chromeos", + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux_chromium_chromeos_msan_rel_ng/properties.json b/infra/config/generated/builders/try/linux_chromium_chromeos_msan_rel_ng/properties.json index 7650432..9f4b992 100644 --- a/infra/config/generated/builders/try/linux_chromium_chromeos_msan_rel_ng/properties.json +++ b/infra/config/generated/builders/try/linux_chromium_chromeos_msan_rel_ng/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux_chromium_chromeos_msan_rel_ng/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux_chromium_compile_dbg_ng/gn-args.json b/infra/config/generated/builders/try/linux_chromium_compile_dbg_ng/gn-args.json index 6735637d..df67d1e 100644 --- a/infra/config/generated/builders/try/linux_chromium_compile_dbg_ng/gn-args.json +++ b/infra/config/generated/builders/try/linux_chromium_compile_dbg_ng/gn-args.json
@@ -1,6 +1,5 @@ { "gn_args": { - "enable_mojom_message_id_scrambling": false, "is_component_build": true, "is_debug": true, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/linux_chromium_compile_siso_dbg_ng/gn-args.json b/infra/config/generated/builders/try/linux_chromium_compile_siso_dbg_ng/gn-args.json index 6735637d..df67d1e 100644 --- a/infra/config/generated/builders/try/linux_chromium_compile_siso_dbg_ng/gn-args.json +++ b/infra/config/generated/builders/try/linux_chromium_compile_siso_dbg_ng/gn-args.json
@@ -1,6 +1,5 @@ { "gn_args": { - "enable_mojom_message_id_scrambling": false, "is_component_build": true, "is_debug": true, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/linux_chromium_dbg_ng/gn-args.json b/infra/config/generated/builders/try/linux_chromium_dbg_ng/gn-args.json index 7558416..c391bf3e 100644 --- a/infra/config/generated/builders/try/linux_chromium_dbg_ng/gn-args.json +++ b/infra/config/generated/builders/try/linux_chromium_dbg_ng/gn-args.json
@@ -1,6 +1,5 @@ { "gn_args": { - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/linux_chromium_msan_rel_ng/gn-args.json b/infra/config/generated/builders/try/linux_chromium_msan_rel_ng/gn-args.json new file mode 100644 index 0000000..5715022 --- /dev/null +++ b/infra/config/generated/builders/try/linux_chromium_msan_rel_ng/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "is_component_build": false, + "is_debug": false, + "is_msan": true, + "msan_track_origins": 2, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux_chromium_msan_rel_ng/properties.json b/infra/config/generated/builders/try/linux_chromium_msan_rel_ng/properties.json index cb4ab309..4ea3714 100644 --- a/infra/config/generated/builders/try/linux_chromium_msan_rel_ng/properties.json +++ b/infra/config/generated/builders/try/linux_chromium_msan_rel_ng/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux_chromium_msan_rel_ng/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux_chromium_tsan_rel_ng-compilator/properties.json b/infra/config/generated/builders/try/linux_chromium_tsan_rel_ng-compilator/properties.json index b9ff6c14..7b80848 100644 --- a/infra/config/generated/builders/try/linux_chromium_tsan_rel_ng-compilator/properties.json +++ b/infra/config/generated/builders/try/linux_chromium_tsan_rel_ng-compilator/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux_chromium_tsan_rel_ng/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/linux_chromium_tsan_rel_ng/gn-args.json b/infra/config/generated/builders/try/linux_chromium_tsan_rel_ng/gn-args.json new file mode 100644 index 0000000..eb2d03e --- /dev/null +++ b/infra/config/generated/builders/try/linux_chromium_tsan_rel_ng/gn-args.json
@@ -0,0 +1,12 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "enable_nacl": false, + "is_component_build": false, + "is_debug": false, + "is_tsan": true, + "symbol_level": 1, + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/linux_chromium_tsan_rel_ng/properties.json b/infra/config/generated/builders/try/linux_chromium_tsan_rel_ng/properties.json index 6f88643..36309a32 100644 --- a/infra/config/generated/builders/try/linux_chromium_tsan_rel_ng/properties.json +++ b/infra/config/generated/builders/try/linux_chromium_tsan_rel_ng/properties.json
@@ -5,6 +5,9 @@ }, "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/linux_chromium_tsan_rel_ng/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/mac-arm64-on-arm64-rel/gn-args.json b/infra/config/generated/builders/try/mac-arm64-on-arm64-rel/gn-args.json index fe2b7ce..b75f3b5 100644 --- a/infra/config/generated/builders/try/mac-arm64-on-arm64-rel/gn-args.json +++ b/infra/config/generated/builders/try/mac-arm64-on-arm64-rel/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 0,
diff --git a/infra/config/generated/builders/try/mac-dawn-rel/gn-args.json b/infra/config/generated/builders/try/mac-dawn-rel/gn-args.json index 91f1530..8b405d5 100644 --- a/infra/config/generated/builders/try/mac-dawn-rel/gn-args.json +++ b/infra/config/generated/builders/try/mac-dawn-rel/gn-args.json
@@ -2,7 +2,6 @@ "gn_args": { "dawn_enable_opengles": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/mac-intel-on-arm64-rel/gn-args.json b/infra/config/generated/builders/try/mac-intel-on-arm64-rel/gn-args.json index b8a93a5..e117120 100644 --- a/infra/config/generated/builders/try/mac-intel-on-arm64-rel/gn-args.json +++ b/infra/config/generated/builders/try/mac-intel-on-arm64-rel/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 0,
diff --git a/infra/config/generated/builders/try/mac-rel/gn-args.json b/infra/config/generated/builders/try/mac-rel/gn-args.json index d952075..633f1d82 100644 --- a/infra/config/generated/builders/try/mac-rel/gn-args.json +++ b/infra/config/generated/builders/try/mac-rel/gn-args.json
@@ -5,7 +5,6 @@ "enable_backup_ref_ptr_feature_flag": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/mac-rust-x64-dbg/gn-args.json b/infra/config/generated/builders/try/mac-rust-x64-dbg/gn-args.json new file mode 100644 index 0000000..1a626964 --- /dev/null +++ b/infra/config/generated/builders/try/mac-rust-x64-dbg/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "enable_all_rust_features": true, + "is_component_build": true, + "is_debug": true, + "symbol_level": 1, + "target_cpu": "x64", + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/mac-rust-x64-dbg/properties.json b/infra/config/generated/builders/try/mac-rust-x64-dbg/properties.json index e57b7b0a..68e2b056 100644 --- a/infra/config/generated/builders/try/mac-rust-x64-dbg/properties.json +++ b/infra/config/generated/builders/try/mac-rust-x64-dbg/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/mac-rust-x64-dbg/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/mac-siso-rel-compilator/properties.json b/infra/config/generated/builders/try/mac-siso-rel-compilator/properties.json index 75ed2ee2..8ab5fa9 100644 --- a/infra/config/generated/builders/try/mac-siso-rel-compilator/properties.json +++ b/infra/config/generated/builders/try/mac-siso-rel-compilator/properties.json
@@ -199,8 +199,7 @@ }, "$build/siso": { "configs": [ - "builder", - "remote-devtools-frontend-typescript" + "builder" ], "enable_cloud_profiler": true, "enable_cloud_trace": true,
diff --git a/infra/config/generated/builders/try/mac-siso-rel/gn-args.json b/infra/config/generated/builders/try/mac-siso-rel/gn-args.json index d952075..633f1d82 100644 --- a/infra/config/generated/builders/try/mac-siso-rel/gn-args.json +++ b/infra/config/generated/builders/try/mac-siso-rel/gn-args.json
@@ -5,7 +5,6 @@ "enable_backup_ref_ptr_feature_flag": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/mac-swangle-chromium-try-x64/gn-args.json b/infra/config/generated/builders/try/mac-swangle-chromium-try-x64/gn-args.json index fb67dcd..37b6e0955 100644 --- a/infra/config/generated/builders/try/mac-swangle-chromium-try-x64/gn-args.json +++ b/infra/config/generated/builders/try/mac-swangle-chromium-try-x64/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/mac-updater-try-builder-rel/gn-args.json b/infra/config/generated/builders/try/mac-updater-try-builder-rel/gn-args.json index 873ffe6..5f0b0ed 100644 --- a/infra/config/generated/builders/try/mac-updater-try-builder-rel/gn-args.json +++ b/infra/config/generated/builders/try/mac-updater-try-builder-rel/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "enable_updater": true, "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/mac11-arm64-rel/gn-args.json b/infra/config/generated/builders/try/mac11-arm64-rel/gn-args.json index f0d67ad..cba19a2 100644 --- a/infra/config/generated/builders/try/mac11-arm64-rel/gn-args.json +++ b/infra/config/generated/builders/try/mac11-arm64-rel/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/mac12-arm64-rel/gn-args.json b/infra/config/generated/builders/try/mac12-arm64-rel/gn-args.json index f0d67ad..cba19a2 100644 --- a/infra/config/generated/builders/try/mac12-arm64-rel/gn-args.json +++ b/infra/config/generated/builders/try/mac12-arm64-rel/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/mac12-tests/gn-args.json b/infra/config/generated/builders/try/mac12-tests/gn-args.json index 8c8f591..03c4f762 100644 --- a/infra/config/generated/builders/try/mac12-tests/gn-args.json +++ b/infra/config/generated/builders/try/mac12-tests/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 0,
diff --git a/infra/config/generated/builders/try/mac13-arm64-rel/gn-args.json b/infra/config/generated/builders/try/mac13-arm64-rel/gn-args.json index f0d67ad..cba19a2 100644 --- a/infra/config/generated/builders/try/mac13-arm64-rel/gn-args.json +++ b/infra/config/generated/builders/try/mac13-arm64-rel/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/mac13-tests/gn-args.json b/infra/config/generated/builders/try/mac13-tests/gn-args.json index 8c8f591..03c4f762 100644 --- a/infra/config/generated/builders/try/mac13-tests/gn-args.json +++ b/infra/config/generated/builders/try/mac13-tests/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 0,
diff --git a/infra/config/generated/builders/try/mac_chromium_10.15_rel_ng/gn-args.json b/infra/config/generated/builders/try/mac_chromium_10.15_rel_ng/gn-args.json index dbb406d..2056661 100644 --- a/infra/config/generated/builders/try/mac_chromium_10.15_rel_ng/gn-args.json +++ b/infra/config/generated/builders/try/mac_chromium_10.15_rel_ng/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "enable_nacl": false, "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/mac_chromium_11.0_rel_ng/gn-args.json b/infra/config/generated/builders/try/mac_chromium_11.0_rel_ng/gn-args.json index 8c8f591..03c4f762 100644 --- a/infra/config/generated/builders/try/mac_chromium_11.0_rel_ng/gn-args.json +++ b/infra/config/generated/builders/try/mac_chromium_11.0_rel_ng/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 0,
diff --git a/infra/config/generated/builders/try/mac_chromium_asan_rel_ng/gn-args.json b/infra/config/generated/builders/try/mac_chromium_asan_rel_ng/gn-args.json new file mode 100644 index 0000000..2a6be9369 --- /dev/null +++ b/infra/config/generated/builders/try/mac_chromium_asan_rel_ng/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "enable_nacl": false, + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/mac_chromium_asan_rel_ng/properties.json b/infra/config/generated/builders/try/mac_chromium_asan_rel_ng/properties.json index 94064c3..0d9e175 100644 --- a/infra/config/generated/builders/try/mac_chromium_asan_rel_ng/properties.json +++ b/infra/config/generated/builders/try/mac_chromium_asan_rel_ng/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/mac_chromium_asan_rel_ng/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/mac_chromium_compile_dbg_ng/gn-args.json b/infra/config/generated/builders/try/mac_chromium_compile_dbg_ng/gn-args.json index 7558416..c391bf3e 100644 --- a/infra/config/generated/builders/try/mac_chromium_compile_dbg_ng/gn-args.json +++ b/infra/config/generated/builders/try/mac_chromium_compile_dbg_ng/gn-args.json
@@ -1,6 +1,5 @@ { "gn_args": { - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/mac_chromium_compile_rel_ng/gn-args.json b/infra/config/generated/builders/try/mac_chromium_compile_rel_ng/gn-args.json index fb67dcd..37b6e0955 100644 --- a/infra/config/generated/builders/try/mac_chromium_compile_rel_ng/gn-args.json +++ b/infra/config/generated/builders/try/mac_chromium_compile_rel_ng/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/network_service_linux/gn-args.json b/infra/config/generated/builders/try/network_service_linux/gn-args.json index 8c8f591..03c4f762 100644 --- a/infra/config/generated/builders/try/network_service_linux/gn-args.json +++ b/infra/config/generated/builders/try/network_service_linux/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 0,
diff --git a/infra/config/generated/builders/try/win-asan/gn-args.json b/infra/config/generated/builders/try/win-asan/gn-args.json new file mode 100644 index 0000000..00aa3fa5 --- /dev/null +++ b/infra/config/generated/builders/try/win-asan/gn-args.json
@@ -0,0 +1,12 @@ +{ + "gn_args": { + "dcheck_always_on": false, + "enable_ipc_fuzzer": true, + "is_asan": true, + "is_component_build": false, + "is_debug": false, + "symbol_level": 1, + "use_remoteexec": true, + "v8_enable_verify_heap": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/win-asan/properties.json b/infra/config/generated/builders/try/win-asan/properties.json index 9e6c1dd..b103184 100644 --- a/infra/config/generated/builders/try/win-asan/properties.json +++ b/infra/config/generated/builders/try/win-asan/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/win-asan/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/win-dawn-rel/gn-args.json b/infra/config/generated/builders/try/win-dawn-rel/gn-args.json index bfe074f2..e5f7115 100644 --- a/infra/config/generated/builders/try/win-dawn-rel/gn-args.json +++ b/infra/config/generated/builders/try/win-dawn-rel/gn-args.json
@@ -3,7 +3,6 @@ "dawn_enable_opengles": true, "dawn_use_built_dxc": true, "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "is_component_build": false, "is_debug": false, "symbol_level": 1,
diff --git a/infra/config/generated/builders/try/win-rel-compilator/properties.json b/infra/config/generated/builders/try/win-rel-compilator/properties.json index c6b39ff..bc9c611 100644 --- a/infra/config/generated/builders/try/win-rel-compilator/properties.json +++ b/infra/config/generated/builders/try/win-rel-compilator/properties.json
@@ -169,6 +169,15 @@ "metrics_project": "chromium-reclient-metrics", "scandeps_server": true }, + "$build/siso": { + "configs": [ + "builder" + ], + "enable_cloud_profiler": true, + "enable_cloud_trace": true, + "experiments": [], + "project": "rbe-chromium-untrusted" + }, "$recipe_engine/resultdb/test_presentation": { "column_keys": [], "grouping_keys": [
diff --git a/infra/config/generated/builders/try/win-rel/gn-args.json b/infra/config/generated/builders/try/win-rel/gn-args.json index 4ae653b8..108f851 100644 --- a/infra/config/generated/builders/try/win-rel/gn-args.json +++ b/infra/config/generated/builders/try/win-rel/gn-args.json
@@ -4,7 +4,6 @@ "dcheck_always_on": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "enable_resource_allowlist_generation": false, "ffmpeg_branding": "Chrome", "is_component_build": false,
diff --git a/infra/config/generated/builders/try/win-rust-x64-dbg/gn-args.json b/infra/config/generated/builders/try/win-rust-x64-dbg/gn-args.json new file mode 100644 index 0000000..1a626964 --- /dev/null +++ b/infra/config/generated/builders/try/win-rust-x64-dbg/gn-args.json
@@ -0,0 +1,10 @@ +{ + "gn_args": { + "enable_all_rust_features": true, + "is_component_build": true, + "is_debug": true, + "symbol_level": 1, + "target_cpu": "x64", + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/win-rust-x64-dbg/properties.json b/infra/config/generated/builders/try/win-rust-x64-dbg/properties.json index b138f11..b191b2b 100644 --- a/infra/config/generated/builders/try/win-rust-x64-dbg/properties.json +++ b/infra/config/generated/builders/try/win-rust-x64-dbg/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/win-rust-x64-dbg/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/win-rust-x64-rel/gn-args.json b/infra/config/generated/builders/try/win-rust-x64-rel/gn-args.json new file mode 100644 index 0000000..eb52c824 --- /dev/null +++ b/infra/config/generated/builders/try/win-rust-x64-rel/gn-args.json
@@ -0,0 +1,12 @@ +{ + "gn_args": { + "dcheck_always_on": true, + "enable_all_rust_features": true, + "is_component_build": false, + "is_debug": false, + "symbol_level": 1, + "target_cpu": "x64", + "use_dummy_lastchange": true, + "use_remoteexec": true + } +} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/win-rust-x64-rel/properties.json b/infra/config/generated/builders/try/win-rust-x64-rel/properties.json index 7c19e25a..56e369bf 100644 --- a/infra/config/generated/builders/try/win-rust-x64-rel/properties.json +++ b/infra/config/generated/builders/try/win-rust-x64-rel/properties.json
@@ -1,6 +1,9 @@ { "$build/chromium_tests_builder_config": { "builder_config": { + "additional_exclusions": [ + "infra/config/generated/builders/try/win-rust-x64-rel/gn-args.json" + ], "builder_db": { "entries": [ {
diff --git a/infra/config/generated/builders/try/win-swangle-chromium-try-x86/gn-args.json b/infra/config/generated/builders/try/win-swangle-chromium-try-x86/gn-args.json index 67b585d..929db2c 100644 --- a/infra/config/generated/builders/try/win-swangle-chromium-try-x86/gn-args.json +++ b/infra/config/generated/builders/try/win-swangle-chromium-try-x86/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "enable_resource_allowlist_generation": true, "ffmpeg_branding": "Chrome", "is_component_build": false,
diff --git a/infra/config/generated/builders/try/win-updater-try-builder-rel/gn-args.json b/infra/config/generated/builders/try/win-updater-try-builder-rel/gn-args.json index 873ffe6..5f0b0ed 100644 --- a/infra/config/generated/builders/try/win-updater-try-builder-rel/gn-args.json +++ b/infra/config/generated/builders/try/win-updater-try-builder-rel/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "enable_updater": true, "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/builders/try/win11-x64-fyi-rel/gn-args.json b/infra/config/generated/builders/try/win11-x64-fyi-rel/gn-args.json index 4ae653b8..108f851 100644 --- a/infra/config/generated/builders/try/win11-x64-fyi-rel/gn-args.json +++ b/infra/config/generated/builders/try/win11-x64-fyi-rel/gn-args.json
@@ -4,7 +4,6 @@ "dcheck_always_on": true, "enable_dangling_raw_ptr_checks": true, "enable_dangling_raw_ptr_feature_flag": true, - "enable_mojom_message_id_scrambling": false, "enable_resource_allowlist_generation": false, "ffmpeg_branding": "Chrome", "is_component_build": false,
diff --git a/infra/config/generated/builders/try/win_chromium_compile_dbg_ng/gn-args.json b/infra/config/generated/builders/try/win_chromium_compile_dbg_ng/gn-args.json index cb54340f..b46bca96 100644 --- a/infra/config/generated/builders/try/win_chromium_compile_dbg_ng/gn-args.json +++ b/infra/config/generated/builders/try/win_chromium_compile_dbg_ng/gn-args.json
@@ -1,6 +1,5 @@ { "gn_args": { - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": true, "is_debug": true,
diff --git a/infra/config/generated/builders/try/win_chromium_compile_rel_ng/gn-args.json b/infra/config/generated/builders/try/win_chromium_compile_rel_ng/gn-args.json index 67b585d..929db2c 100644 --- a/infra/config/generated/builders/try/win_chromium_compile_rel_ng/gn-args.json +++ b/infra/config/generated/builders/try/win_chromium_compile_rel_ng/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "enable_resource_allowlist_generation": true, "ffmpeg_branding": "Chrome", "is_component_build": false,
diff --git a/infra/config/generated/builders/try/win_chromium_x64_rel_ng/gn-args.json b/infra/config/generated/builders/try/win_chromium_x64_rel_ng/gn-args.json index fb67dcd..37b6e0955 100644 --- a/infra/config/generated/builders/try/win_chromium_x64_rel_ng/gn-args.json +++ b/infra/config/generated/builders/try/win_chromium_x64_rel_ng/gn-args.json
@@ -1,7 +1,6 @@ { "gn_args": { "dcheck_always_on": true, - "enable_mojom_message_id_scrambling": false, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/infra/config/generated/luci/cr-buildbucket.cfg b/infra/config/generated/luci/cr-buildbucket.cfg index def9cb8..4c48e05 100644 --- a/infra/config/generated/luci/cr-buildbucket.cfg +++ b/infra/config/generated/luci/cr-buildbucket.cfg
@@ -209,8 +209,7 @@ ' },' ' "$build/siso": {' ' "configs": [' - ' "builder",' - ' "remote-devtools-frontend-typescript"' + ' "builder"' ' ],' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' @@ -346,8 +345,7 @@ ' },' ' "$build/siso": {' ' "configs": [' - ' "builder",' - ' "remote-devtools-frontend-typescript"' + ' "builder"' ' ],' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' @@ -473,8 +471,7 @@ ' },' ' "$build/siso": {' ' "configs": [' - ' "builder",' - ' "remote-devtools-frontend-typescript"' + ' "builder"' ' ],' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' @@ -603,8 +600,7 @@ ' },' ' "$build/siso": {' ' "configs": [' - ' "builder",' - ' "remote-devtools-frontend-typescript"' + ' "builder"' ' ],' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' @@ -730,8 +726,7 @@ ' },' ' "$build/siso": {' ' "configs": [' - ' "builder",' - ' "remote-devtools-frontend-typescript"' + ' "builder"' ' ],' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' @@ -860,8 +855,7 @@ ' },' ' "$build/siso": {' ' "configs": [' - ' "builder",' - ' "remote-devtools-frontend-typescript"' + ' "builder"' ' ],' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' @@ -1114,8 +1108,7 @@ ' },' ' "$build/siso": {' ' "configs": [' - ' "builder",' - ' "remote-devtools-frontend-typescript"' + ' "builder"' ' ],' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' @@ -1245,8 +1238,7 @@ ' },' ' "$build/siso": {' ' "configs": [' - ' "builder",' - ' "remote-devtools-frontend-typescript"' + ' "builder"' ' ],' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' @@ -1376,8 +1368,7 @@ ' },' ' "$build/siso": {' ' "configs": [' - ' "builder",' - ' "remote-devtools-frontend-typescript"' + ' "builder"' ' ],' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' @@ -1635,8 +1626,7 @@ ' },' ' "$build/siso": {' ' "configs": [' - ' "builder",' - ' "remote-devtools-frontend-typescript"' + ' "builder"' ' ],' ' "enable_cloud_profiler": true,' ' "enable_cloud_trace": true,' @@ -64707,6 +64697,15 @@ ' "metrics_project": "chromium-reclient-metrics",' ' "scandeps_server": true' ' },' + ' "$build/siso": {' + ' "configs": [' + ' "builder"' + ' ],' + ' "enable_cloud_profiler": true,' + ' "enable_cloud_trace": true,' + ' "experiments": [],' + ' "project": "rbe-chromium-untrusted"' + ' },' ' "$recipe_engine/resultdb/test_presentation": {' ' "column_keys": [],' ' "grouping_keys": ['
diff --git a/infra/config/generated/testing/gn_isolate_map.pyl b/infra/config/generated/testing/gn_isolate_map.pyl index 482edc8f..0b78cb96 100644 --- a/infra/config/generated/testing/gn_isolate_map.pyl +++ b/infra/config/generated/testing/gn_isolate_map.pyl
@@ -45,26 +45,22 @@ "label": "//third_party/angle/src/tests:angle_deqp_gles2_tests", "type": "windowed_test_launcher", }, + "angle_deqp_gles31_rotate180_tests": { + "label": "//third_party/angle/src/tests:angle_deqp_gles31_rotate180_tests", + "type": "windowed_test_launcher", + }, + "angle_deqp_gles31_rotate270_tests": { + "label": "//third_party/angle/src/tests:angle_deqp_gles31_rotate270_tests", + "type": "windowed_test_launcher", + }, + "angle_deqp_gles31_rotate90_tests": { + "label": "//third_party/angle/src/tests:angle_deqp_gles31_rotate90_tests", + "type": "windowed_test_launcher", + }, "angle_deqp_gles31_tests": { "label": "//third_party/angle/src/tests:angle_deqp_gles31_tests", "type": "windowed_test_launcher", }, - "angle_deqp_gles3_tests": { - "label": "//third_party/angle/src/tests:angle_deqp_gles3_tests", - "type": "windowed_test_launcher", - }, - "angle_deqp_khr_gles2_tests": { - "label": "//third_party/angle/src/tests:angle_deqp_khr_gles2_tests", - "type": "windowed_test_launcher", - }, - "angle_deqp_khr_gles3_tests": { - "label": "//third_party/angle/src/tests:angle_deqp_khr_gles3_tests", - "type": "windowed_test_launcher", - }, - "angle_deqp_khr_gles31_tests": { - "label": "//third_party/angle/src/tests:angle_deqp_khr_gles31_tests", - "type": "windowed_test_launcher", - }, "angle_deqp_gles3_rotate180_tests": { "label": "//third_party/angle/src/tests:angle_deqp_gles3_rotate180_tests", "type": "windowed_test_launcher", @@ -77,16 +73,20 @@ "label": "//third_party/angle/src/tests:angle_deqp_gles3_rotate90_tests", "type": "windowed_test_launcher", }, - "angle_deqp_gles31_rotate180_tests": { - "label": "//third_party/angle/src/tests:angle_deqp_gles31_rotate180_tests", + "angle_deqp_gles3_tests": { + "label": "//third_party/angle/src/tests:angle_deqp_gles3_tests", "type": "windowed_test_launcher", }, - "angle_deqp_gles31_rotate270_tests": { - "label": "//third_party/angle/src/tests:angle_deqp_gles31_rotate270_tests", + "angle_deqp_khr_gles2_tests": { + "label": "//third_party/angle/src/tests:angle_deqp_khr_gles2_tests", "type": "windowed_test_launcher", }, - "angle_deqp_gles31_rotate90_tests": { - "label": "//third_party/angle/src/tests:angle_deqp_gles31_rotate90_tests", + "angle_deqp_khr_gles31_tests": { + "label": "//third_party/angle/src/tests:angle_deqp_khr_gles31_tests", + "type": "windowed_test_launcher", + }, + "angle_deqp_khr_gles3_tests": { + "label": "//third_party/angle/src/tests:angle_deqp_khr_gles3_tests", "type": "windowed_test_launcher", }, "angle_end2end_tests": { @@ -113,16 +113,16 @@ "label": "//chrome/test:ash_crosapi_tests", "type": "windowed_test_launcher", }, - "ash_webui_unittests": { - "label": "//ash/webui:ash_webui_unittests", + "ash_pixeltests": { + "label": "//ash:ash_pixeltests", "type": "windowed_test_launcher", }, "ash_unittests": { "label": "//ash:ash_unittests", "type": "windowed_test_launcher", }, - "ash_pixeltests": { - "label": "//ash:ash_pixeltests", + "ash_webui_unittests": { + "label": "//ash/webui:ash_webui_unittests", "type": "windowed_test_launcher", }, "aura_unittests": { @@ -231,6 +231,14 @@ "label": "//build/android:build_junit_tests", "type": "generated_script", }, + "build_rust_tests": { + "label": "//build/rust/tests:build_rust_tests", + "type": "generated_script", + }, + "capture_unittests": { + "label": "//media/capture:capture_unittests", + "type": "windowed_test_launcher", + }, "captured_sites_interactive_tests": { "label": "//chrome/test:captured_sites_interactive_tests", "type": "windowed_test_launcher", @@ -238,30 +246,6 @@ "--disable-extensions", ], }, - "capture_unittests": { - "label": "//media/capture:capture_unittests", - "type": "windowed_test_launcher", - }, - "cast_display_settings_unittests": { - "label": "//chromecast/ui/display_settings:cast_display_settings_unittests", - "type": "console_test_launcher", - }, - "cast_runner_browsertests": { - "label": "//fuchsia_web/runners:cast_runner_browsertests", - "type": "console_test_launcher", - }, - "cast_runner_integration_tests": { - "label": "//fuchsia_web/runners:cast_runner_integration_tests", - "type": "console_test_launcher", - }, - "cast_runner_pkg": { - "label": "//fuchsia_web/runners:cast_runner_pkg", - "type": "additional_compile_target", - }, - "cast_runner_unittests": { - "label": "//fuchsia_web/runners:cast_runner_unittests", - "type": "console_test_launcher", - }, "cast_audio_backend_unittests": { "label": "//chromecast/media/cma/backend:cast_audio_backend_unittests", "type": "console_test_launcher", @@ -282,6 +266,10 @@ "label": "//chromecast/crash:cast_crash_unittests", "type": "console_test_launcher", }, + "cast_display_settings_unittests": { + "label": "//chromecast/ui/display_settings:cast_display_settings_unittests", + "type": "console_test_launcher", + }, "cast_graphics_unittests": { "label": "//chromecast/graphics:cast_graphics_unittests", "type": "console_test_launcher", @@ -294,6 +282,22 @@ "label": "//chromecast/media:cast_media_unittests", "type": "console_test_launcher", }, + "cast_runner_browsertests": { + "label": "//fuchsia_web/runners:cast_runner_browsertests", + "type": "console_test_launcher", + }, + "cast_runner_integration_tests": { + "label": "//fuchsia_web/runners:cast_runner_integration_tests", + "type": "console_test_launcher", + }, + "cast_runner_pkg": { + "label": "//fuchsia_web/runners:cast_runner_pkg", + "type": "additional_compile_target", + }, + "cast_runner_unittests": { + "label": "//fuchsia_web/runners:cast_runner_unittests", + "type": "console_test_launcher", + }, "cast_shell": { "label": "//chromecast:cast_shell", "type": "additional_compile_target", @@ -330,6 +334,30 @@ "label": "//chrome:chrome", "type": "additional_compile_target", }, + "chrome/browser/media/router": { + "label": "//chrome/browser/media/router:router", + "type": "additional_compile_target", + }, + "chrome/browser/media/router:openscreen_unittests": { + "label": "//chrome/browser/media/router:openscreen_unittests", + "type": "additional_compile_target", + }, + "chrome/browser/media/router:unittests": { + "label": "//chrome/browser/media/router:unittests", + "type": "additional_compile_target", + }, + "chrome/installer/linux": { + "label": "//chrome/installer/linux:linux", + "type": "additional_compile_target", + }, + "chrome/installer/mac": { + "label": "//chrome/installer/mac:mac", + "type": "additional_compile_target", + }, + "chrome/updater:all": { + "label": "//chrome/updater:all", + "type": "additional_compile_target", + }, "chrome_all_tast_tests": { "label": "//chromeos:chrome_all_tast_tests", "type": "generated_script", @@ -359,6 +387,14 @@ "label": "//chrome/chrome_elf:chrome_elf_unittests", "type": "console_test_launcher", }, + "chrome_ios_wpt": { + "label": "//ios/chrome/test/wpt:chrome_ios_wpt", + "type": "generated_script", + "args": [ + "--results-directory", + "${ISOLATED_OUTDIR}", + ], + }, "chrome_java_test_pagecontroller_junit_tests": { "label": "//chrome/test/android:chrome_java_test_pagecontroller_junit_tests", "type": "generated_script", @@ -391,14 +427,14 @@ "label": "//chrome:chrome_private_code_test", "type": "generated_script", }, - "chrome_public_apk_baseline_profile_generator": { - "label": "//chrome/test/android:chrome_public_apk_baseline_profile_generator", - "type": "console_test_launcher", - }, "chrome_public_apk": { "label": "//chrome/android:chrome_public_apk", "type": "additional_compile_target", }, + "chrome_public_apk_baseline_profile_generator": { + "label": "//chrome/test/android:chrome_public_apk_baseline_profile_generator", + "type": "console_test_launcher", + }, "chrome_public_smoke_test": { "label": "//chrome/android:chrome_public_smoke_test", "type": "console_test_launcher", @@ -431,6 +467,14 @@ "label": "//chrome/test:chrome_sizes", "type": "generated_script", }, + "chrome_wpt_tests": { + "label": "//:chrome_wpt_tests", + "type": "generated_script", + "args": [ + "--results-directory", + "${ISOLATED_OUTDIR}", + ], + }, "chromedriver": { "label": "//chrome/test/chromedriver:chromedriver_server", "type": "additional_compile_target", @@ -462,62 +506,6 @@ "--browser-name=chrome-headless-shell", ], }, - "chromeos_integration_tests": { - "label": "//chrome/test:chromeos_integration_tests", - "type": "windowed_test_launcher", - }, - "chrome_wpt_tests": { - "label": "//:chrome_wpt_tests", - "type": "generated_script", - "args": [ - "--results-directory", - "${ISOLATED_OUTDIR}", - ], - }, - "content_shell_wpt": { - "label": "//:content_shell_wpt", - "type": "generated_script", - "args": [ - "--results-directory", - "${ISOLATED_OUTDIR}", - ], - }, - "chrome_ios_wpt": { - "label": "//ios/chrome/test/wpt:chrome_ios_wpt", - "type": "generated_script", - "args": [ - "--results-directory", - "${ISOLATED_OUTDIR}", - ], - }, - "chrome/browser/media/router": { - "label": "//chrome/browser/media/router:router", - "type": "additional_compile_target", - }, - "chrome/browser/media/router:openscreen_unittests": { - "label": "//chrome/browser/media/router:openscreen_unittests", - "type": "additional_compile_target", - }, - "chrome/browser/media/router:unittests": { - "label": "//chrome/browser/media/router:unittests", - "type": "additional_compile_target", - }, - "chrome/installer/linux": { - "label": "//chrome/installer/linux:linux", - "type": "additional_compile_target", - }, - "chrome/installer/mac": { - "label": "//chrome/installer/mac:mac", - "type": "additional_compile_target", - }, - "variations_smoke_tests": { - "label": "//chrome/test:variations_smoke_tests", - "type": "generated_script", - }, - "variations_desktop_smoke_tests": { - "label": "//chrome/test/variations:variations_desktop_smoke_tests", - "type": "generated_script", - }, "chromedriver_replay_unittests": { "label": "//chrome/test/chromedriver:chromedriver_replay_unittests", "type": "script", @@ -531,6 +519,10 @@ "label": "//chromeos/components:chromeos_components_unittests", "type": "console_test_launcher", }, + "chromeos_integration_tests": { + "label": "//chrome/test:chromeos_integration_tests", + "type": "windowed_test_launcher", + }, "chromeos_unittests": { "label": "//chromeos:chromeos_unittests", "type": "console_test_launcher", @@ -558,14 +550,6 @@ "src/third_party/android_sdk/public/platform-tools/adb", ], }, - "components/media_router/common/providers/cast/channel": { - "label": "//components/media_router/common/providers/cast/channel:cast_channel", - "type": "additional_compile_target", - }, - "components/media_router/common/providers/cast/channel:unit_tests": { - "label": "//components/media_router/common/providers/cast/channel:unit_tests", - "type": "additional_compile_target", - }, "components/media_router/common/providers/cast/certificate": { "label": "//components/media_router/common/providers/cast/certificate", "type": "additional_compile_target", @@ -574,6 +558,14 @@ "label": "//components/media_router/common/providers/cast/certificate:unit_tests", "type": "additional_compile_target", }, + "components/media_router/common/providers/cast/channel": { + "label": "//components/media_router/common/providers/cast/channel:cast_channel", + "type": "additional_compile_target", + }, + "components/media_router/common/providers/cast/channel:unit_tests": { + "label": "//components/media_router/common/providers/cast/channel:unit_tests", + "type": "additional_compile_target", + }, "components/mirroring/browser": { "label": "//components/mirroring/browser:browser", "type": "additional_compile_target", @@ -641,6 +633,14 @@ "label": "//content/shell/android:content_shell_test_apk", "type": "console_test_launcher", }, + "content_shell_wpt": { + "label": "//:content_shell_wpt", + "type": "generated_script", + "args": [ + "--results-directory", + "${ISOLATED_OUTDIR}", + ], + }, "content_unittests": { "label": "//content/test:content_unittests", "type": "windowed_test_launcher", @@ -705,6 +705,14 @@ "label": "//crypto:crypto_unittests", "type": "console_test_launcher", }, + "ct_telemetry_perf_tests_without_chrome": { + "label": "//chrome/test:ct_telemetry_perf_tests_without_chrome", + "type": "script", + "script": "//testing/scripts/run_performance_tests.py", + "args": [ + "../../tools/perf/run_benchmark", + ], + }, "dawn_end2end_tests": { "label": "//third_party/dawn/src/dawn/tests:dawn_end2end_tests", "type": "windowed_test_launcher", @@ -776,6 +784,10 @@ "label": "//extensions:extensions_unittests", "type": "windowed_test_launcher", }, + "fake_libva_driver_unittest": { + "label": "//media/gpu/vaapi/test/fake_libva_driver:fake_libva_driver_unittest", + "type": "console_test_launcher", + }, "filesystem_service_unittests": { "label": "//components/services/filesystem:filesystem_service_unittests", "type": "console_test_launcher", @@ -802,10 +814,6 @@ "label": "//chrome/credential_provider/test:gcp_unittests", "type": "console_test_launcher", }, - "test_ash_chrome_cipd_yaml": { - "label": "//chrome/test:test_ash_chrome_cipd_yaml", - "type": "additional_compile_target", - }, "gfx_unittests": { "label": "//ui/gfx:gfx_unittests", "type": "console_test_launcher", @@ -913,18 +921,14 @@ "label": "//ios/chrome/test:all_fuzzer_tests", "type": "additional_compile_target", }, - "ios_chrome_clusterfuzz_asan_build": { - "label": "//ios/chrome/test/wpt:ios_chrome_clusterfuzz_asan_build", - "type": "additional_compile_target", - }, - "ios_chrome_unittests": { - "label": "//ios/chrome/test:ios_chrome_unittests", - "type": "generated_script", - }, "ios_chrome_bookmarks_eg2tests_module": { "label": "//ios/chrome/test/earl_grey2:ios_chrome_bookmarks_eg2tests_module", "type": "generated_script", }, + "ios_chrome_clusterfuzz_asan_build": { + "label": "//ios/chrome/test/wpt:ios_chrome_clusterfuzz_asan_build", + "type": "additional_compile_target", + }, "ios_chrome_integration_eg2tests_module": { "label": "//ios/chrome/test/earl_grey2:ios_chrome_integration_eg2tests_module", "type": "generated_script", @@ -945,18 +949,22 @@ "label": "//ios/chrome/test/earl_grey2:ios_chrome_ui_eg2tests_module", "type": "generated_script", }, + "ios_chrome_unittests": { + "label": "//ios/chrome/test:ios_chrome_unittests", + "type": "generated_script", + }, "ios_chrome_web_eg2tests_module": { "label": "//ios/chrome/test/earl_grey2:ios_chrome_web_eg2tests_module", "type": "generated_script", }, - "ios_crash_xcuitests_module": { - "label": "//third_party/crashpad/crashpad/test/ios:ios_crash_xcuitests_module", - "type": "generated_script", - }, "ios_components_unittests": { "label": "//ios/components:ios_components_unittests", "type": "generated_script", }, + "ios_crash_xcuitests_module": { + "label": "//third_party/crashpad/crashpad/test/ios:ios_crash_xcuitests_module", + "type": "generated_script", + }, "ios_net_unittests": { "label": "//ios/net:ios_net_unittests", "type": "generated_script", @@ -1150,14 +1158,6 @@ "label": "//components/module_installer/android:module_installer_junit_tests", "type": "generated_script", }, - "monochrome_public_smoke_test": { - "label": "//chrome/android:monochrome_public_smoke_test", - "type": "console_test_launcher", - }, - "monochrome_public_bundle_smoke_test": { - "label": "//chrome/android:monochrome_public_bundle_smoke_test", - "type": "console_test_launcher", - }, "mojo_python_unittests": { "label": "//mojo/public/tools:mojo_python_unittests", "type": "script", @@ -1206,6 +1206,14 @@ "apks/MonochromePublic.apk.pathmap.txt", ], }, + "monochrome_public_bundle_smoke_test": { + "label": "//chrome/android:monochrome_public_bundle_smoke_test", + "type": "console_test_launcher", + }, + "monochrome_public_smoke_test": { + "label": "//chrome/android:monochrome_public_smoke_test", + "type": "console_test_launcher", + }, "monochrome_public_test_ar_apk": { "label": "//chrome/android:monochrome_public_test_ar_apk", "type": "console_test_launcher", @@ -1228,10 +1236,6 @@ "label": "//components/nacl/loader:nacl_loader_unittests", "type": "console_test_launcher", }, - "build_rust_tests": { - "label": "//build/rust/tests:build_rust_tests", - "type": "generated_script", - }, "native_theme_unittests": { "label": "//ui/native_theme:native_theme_unittests", "type": "windowed_test_launcher", @@ -1340,14 +1344,14 @@ "label": "//chrome/test:performance_test_suite_android_clank_monochrome_bundle", "type": "generated_script", }, - "performance_test_suite_android_clank_trichrome_chrome_google_64_32_bundle": { - "label": "//chrome/test:performance_test_suite_android_clank_trichrome_chrome_google_64_32_bundle", - "type": "generated_script", - }, "performance_test_suite_android_clank_trichrome_bundle": { "label": "//chrome/test:performance_test_suite_android_clank_trichrome_bundle", "type": "generated_script", }, + "performance_test_suite_android_clank_trichrome_chrome_google_64_32_bundle": { + "label": "//chrome/test:performance_test_suite_android_clank_trichrome_chrome_google_64_32_bundle", + "type": "generated_script", + }, "performance_test_suite_eve": { "label": "//chrome/test:performance_test_suite_eve", "type": "generated_script", @@ -1488,10 +1492,6 @@ "label": "//chrome/installer/setup:setup_unittests", "type": "console_test_launcher", }, - "shell_encryption_unittests": { - "label": "//third_party/shell-encryption:shell_encryption_unittests", - "type": "console_test_launcher", - }, "shell_dialogs_unittests": { "label": "//ui/shell_dialogs:shell_dialogs_unittests", "type": "console_test_launcher", @@ -1499,6 +1499,10 @@ "--test-launcher-jobs=1", ], }, + "shell_encryption_unittests": { + "label": "//third_party/shell-encryption:shell_encryption_unittests", + "type": "console_test_launcher", + }, "skia_unittests": { "label": "//skia:skia_unittests", "type": "console_test_launcher", @@ -1511,14 +1515,14 @@ "label": "//sql:sql_unittests", "type": "console_test_launcher", }, - "strip_lacros_files": { - "label": "//chrome:strip_lacros_files", - "type": "additional_compile_target", - }, "storage_unittests": { "label": "//storage:storage_unittests", "type": "console_test_launcher", }, + "strip_lacros_files": { + "label": "//chrome:strip_lacros_files", + "type": "additional_compile_target", + }, "symupload": { "label": "//third_party/breakpad:symupload", "type": "additional_compile_target", @@ -1607,14 +1611,6 @@ "-v", ], }, - "ct_telemetry_perf_tests_without_chrome": { - "label": "//chrome/test:ct_telemetry_perf_tests_without_chrome", - "type": "script", - "script": "//testing/scripts/run_performance_tests.py", - "args": [ - "../../tools/perf/run_benchmark", - ], - }, "telemetry_perf_unittests": { "label": "//chrome/test:telemetry_perf_unittests", "type": "script", @@ -1655,6 +1651,10 @@ "../../", ], }, + "test_ash_chrome_cipd_yaml": { + "label": "//chrome/test:test_ash_chrome_cipd_yaml", + "type": "additional_compile_target", + }, "test_cpp_including_rust_unittests": { "label": "//build/rust/tests/test_cpp_including_rust:test_cpp_including_rust_unittests", "type": "console_test_launcher", @@ -1721,6 +1721,10 @@ "label": "//ui/touch_selection:ui_touch_selection_unittests", "type": "windowed_test_launcher", }, + "ui_unittests": { + "label": "//ui/tests:ui_unittests", + "type": "console_test_launcher", + }, "unit_tests": { "label": "//chrome/test:unit_tests", "type": "windowed_test_launcher", @@ -1761,14 +1765,6 @@ "--ui-test-action-timeout=40000", ], }, - "chrome/updater:all": { - "label": "//chrome/updater:all", - "type": "additional_compile_target", - }, - "ui_unittests": { - "label": "//ui/tests:ui_unittests", - "type": "console_test_launcher", - }, "upload_trace_processor": { "label": "//tools/perf/core/perfetto_binary_roller:upload_trace_processor", "type": "generated_script", @@ -1793,26 +1789,30 @@ "label": "//media/gpu/vaapi:vaapi_unittest", "type": "console_test_launcher", }, - "fake_libva_driver_unittest": { - "label": "//media/gpu/vaapi/test/fake_libva_driver:fake_libva_driver_unittest", - "type": "console_test_launcher", + "variations_desktop_smoke_tests": { + "label": "//chrome/test/variations:variations_desktop_smoke_tests", + "type": "generated_script", }, - "video_decode_accelerator_tests": { - "label": "//media/gpu/test:video_decode_accelerator_tests", - "type": "additional_compile_target", + "variations_smoke_tests": { + "label": "//chrome/test:variations_smoke_tests", + "type": "generated_script", }, "video_decode_accelerator_perf_tests": { "label": "//media/gpu/test:video_decode_accelerator_perf_tests", "type": "additional_compile_target", }, - "video_encode_accelerator_tests": { - "label": "//media/gpu/test:video_encode_accelerator_tests", + "video_decode_accelerator_tests": { + "label": "//media/gpu/test:video_decode_accelerator_tests", "type": "additional_compile_target", }, "video_encode_accelerator_perf_tests": { "label": "//media/gpu/test:video_encode_accelerator_perf_tests", "type": "additional_compile_target", }, + "video_encode_accelerator_tests": { + "label": "//media/gpu/test:video_encode_accelerator_tests", + "type": "additional_compile_target", + }, "views_examples_unittests": { "label": "//ui/views/examples:views_examples_unittests", "type": "windowed_test_launcher", @@ -1918,6 +1918,20 @@ "${ISOLATED_OUTDIR}", ], }, + "webview_64_cts_tests": { + "label": "//android_webview/test:webview_64_cts_tests", + "type": "script", + "script": "//android_webview/tools/run_cts.py", + "args": [ + "--skip-expected-failures", + "--use-webview-provider", + "apks/SystemWebView64.apk", + "--apk-under-test", + "apks/SystemWebView64.apk", + "--use-apk-under-test-flags-file", + "-v", + ], + }, "webview_cts_tests": { "label": "//android_webview/test:webview_cts_tests", "type": "script", @@ -1932,6 +1946,26 @@ "-v", ], }, + "webview_instrumentation_test_apk": { + "label": "//android_webview/test:webview_instrumentation_test_apk", + "type": "console_test_launcher", + }, + "webview_trichrome_64_cts_tests": { + "label": "//android_webview/test:webview_trichrome_64_cts_tests", + "type": "script", + "script": "//android_webview/tools/run_cts.py", + "args": [ + "--skip-expected-failures", + "--additional-apk", + "apks/TrichromeLibrary64.apk", + "--use-webview-provider", + "apks/TrichromeWebView64.apk", + "--apk-under-test", + "apks/TrichromeWebView64.apk", + "--use-apk-under-test-flags-file", + "-v", + ], + }, "webview_trichrome_cts_tests": { "label": "//android_webview/test:webview_trichrome_cts_tests", "type": "script", @@ -1948,40 +1982,6 @@ "-v", ], }, - "webview_trichrome_64_cts_tests": { - "label": "//android_webview/test:webview_trichrome_64_cts_tests", - "type": "script", - "script": "//android_webview/tools/run_cts.py", - "args": [ - "--skip-expected-failures", - "--additional-apk", - "apks/TrichromeLibrary64.apk", - "--use-webview-provider", - "apks/TrichromeWebView64.apk", - "--apk-under-test", - "apks/TrichromeWebView64.apk", - "--use-apk-under-test-flags-file", - "-v", - ], - }, - "webview_64_cts_tests": { - "label": "//android_webview/test:webview_64_cts_tests", - "type": "script", - "script": "//android_webview/tools/run_cts.py", - "args": [ - "--skip-expected-failures", - "--use-webview-provider", - "apks/SystemWebView64.apk", - "--apk-under-test", - "apks/SystemWebView64.apk", - "--use-apk-under-test-flags-file", - "-v", - ], - }, - "webview_instrumentation_test_apk": { - "label": "//android_webview/test:webview_instrumentation_test_apk", - "type": "console_test_launcher", - }, "webview_ui_test_app_test_apk": { "label": "//android_webview/tools/automated_ui_tests:webview_ui_test_app_test_apk", "type": "console_test_launcher",
diff --git a/infra/config/generated/testing/test_suites.pyl b/infra/config/generated/testing/test_suites.pyl index 1c94dfaf..2f4f4fb 100644 --- a/infra/config/generated/testing/test_suites.pyl +++ b/infra/config/generated/testing/test_suites.pyl
@@ -5756,9 +5756,9 @@ 'compound_suites': { 'android_10_rel_gtests': [ - 'android_trichrome_smoke_tests', 'android_ar_gtests', 'android_ddready_vr_gtests', + 'android_trichrome_smoke_tests', ], 'android_12_dbg_emulator_gtests': [ @@ -5768,9 +5768,9 @@ 'android_marshmallow_gtests': [ 'android_smoke_tests', 'android_specific_chromium_gtests', + 'chrome_public_tests', 'chromium_gtests', 'chromium_gtests_for_devices_with_graphical_output', - 'chrome_public_tests', 'linux_flavor_specific_chromium_gtests', 'vr_android_specific_chromium_tests', 'vr_platform_specific_chromium_gtests', @@ -5828,8 +5828,8 @@ ], 'android_pie_rel_gtests': [ - 'android_pie_rel_reduced_capacity_gtests', 'android_monochrome_smoke_tests', + 'android_pie_rel_reduced_capacity_gtests', 'android_smoke_tests', 'chrome_public_tests', 'system_webview_shell_instrumentation_tests', @@ -5864,15 +5864,15 @@ ], 'chromeos_vm_gtests': [ - 'chromeos_system_friendly_gtests', 'chromeos_integration_tests', + 'chromeos_system_friendly_gtests', ], 'chromeos_vm_gtests_and_tast': [ 'chromeos_browser_all_tast_tests', 'chromeos_browser_integration_tests', - 'chromeos_system_friendly_gtests', 'chromeos_integration_tests', + 'chromeos_system_friendly_gtests', ], 'chromeos_vm_tast': [ @@ -5883,9 +5883,9 @@ 'chromium_android_gtests': [ 'android_smoke_tests', 'android_specific_chromium_gtests', + 'chrome_public_tests', 'chromium_gtests', 'chromium_gtests_for_devices_with_graphical_output', - 'chrome_public_tests', 'linux_flavor_specific_chromium_gtests', 'vr_android_specific_chromium_tests', 'vr_platform_specific_chromium_gtests', @@ -5905,10 +5905,10 @@ 'chromium_gtests_for_linux_and_mac_only', 'chromium_gtests_for_linux_only', 'chromium_gtests_for_win_and_linux_only', - 'linux_flavor_specific_chromium_gtests', - 'linux_specific_xr_gtests', 'gl_gtests_passthrough', 'gpu_fyi_vulkan_swiftshader_gtests', + 'linux_flavor_specific_chromium_gtests', + 'linux_specific_xr_gtests', 'non_android_and_cast_and_chromeos_chromium_gtests', 'non_android_chromium_gtests_no_nacl', 'vr_platform_specific_chromium_gtests', @@ -5922,19 +5922,19 @@ 'chromium_gtests_for_linux_and_mac_only', 'chromium_gtests_for_linux_only', 'chromium_gtests_for_win_and_linux_only', + 'gl_gtests_passthrough', 'linux_flavor_specific_chromium_gtests', 'linux_specific_xr_gtests', - 'gl_gtests_passthrough', 'non_android_and_cast_and_chromeos_chromium_gtests', 'non_android_chromium_gtests_no_nacl', 'vr_platform_specific_chromium_gtests', ], 'chromium_linux_blink_rel_isolated_scripts': [ + 'chromium_web_tests_high_dpi_isolated_scripts', 'chromium_webkit_isolated_scripts', 'linux_specific_chromium_isolated_scripts', 'vulkan_swiftshader_isolated_scripts', - 'chromium_web_tests_high_dpi_isolated_scripts', ], 'chromium_linux_cast_audio_gtests': [ @@ -5989,29 +5989,32 @@ 'chromium_linux_rel_isolated_scripts': [ 'chromedriver_py_tests_isolated_scripts', + 'chromium_web_tests_high_dpi_isolated_scripts', 'desktop_chromium_isolated_scripts', 'linux_specific_chromium_isolated_scripts', 'mojo_python_unittests_isolated_scripts', 'pytype_tests', 'telemetry_perf_unittests_isolated_scripts', 'vulkan_swiftshader_isolated_scripts', - 'chromium_web_tests_high_dpi_isolated_scripts', ], 'chromium_linux_rel_isolated_scripts_code_coverage': [ 'chromedriver_py_tests_isolated_scripts', + 'chromium_web_tests_high_dpi_isolated_scripts', 'desktop_chromium_isolated_scripts', + 'gpu_dawn_webgpu_blink_web_tests', 'linux_specific_chromium_isolated_scripts', 'mojo_python_unittests_isolated_scripts', 'pytype_tests', 'telemetry_perf_unittests_isolated_scripts_xvfb', 'vulkan_swiftshader_isolated_scripts', - 'chromium_web_tests_high_dpi_isolated_scripts', - 'gpu_dawn_webgpu_blink_web_tests', ], 'chromium_linux_rel_isolated_scripts_once': [ 'chromedriver_py_tests_isolated_scripts', + 'chromium_web_tests_brfetch_isolated_scripts', + 'chromium_web_tests_high_dpi_isolated_scripts', + 'chromium_wpt_tests_isolated_scripts', 'desktop_chromium_isolated_scripts', 'desktop_once_isolated_scripts', 'linux_specific_chromium_isolated_scripts', @@ -6019,9 +6022,6 @@ 'pytype_tests', 'telemetry_perf_unittests_isolated_scripts', 'vulkan_swiftshader_isolated_scripts', - 'chromium_web_tests_high_dpi_isolated_scripts', - 'chromium_web_tests_brfetch_isolated_scripts', - 'chromium_wpt_tests_isolated_scripts', ], 'chromium_mac_gtests': [ @@ -6172,8 +6172,8 @@ ], 'devtools_gtests': [ - 'devtools_browser_tests', 'blink_unittests', + 'devtools_browser_tests', ], 'fuchsia_accessibility_browsertests': [ @@ -6220,8 +6220,8 @@ 'gpu_angle_win_intel_nvidia_telemetry_tests': [ 'gpu_info_collection_telemetry_tests', 'gpu_webgl2_conformance_d3d11_passthrough_telemetry_tests', - 'gpu_webgl_conformance_d3d9_passthrough_telemetry_tests', 'gpu_webgl_conformance_d3d11_passthrough_telemetry_tests', + 'gpu_webgl_conformance_d3d9_passthrough_telemetry_tests', 'gpu_webgl_conformance_vulkan_passthrough_telemetry_tests', ], @@ -6276,29 +6276,29 @@ ], 'gpu_dawn_compat_telemetry_tests': [ + 'gpu_dawn_web_platform_webgpu_cts_force_swiftshader', 'gpu_dawn_webgpu_compat_cts', 'gpu_dawn_webgpu_cts', - 'gpu_dawn_web_platform_webgpu_cts_force_swiftshader', ], 'gpu_dawn_integration_asan_gtests_passthrough': [ + 'gpu_common_gtests_passthrough', 'gpu_dawn_gtests', 'gpu_dawn_gtests_no_dxc', - 'gpu_common_gtests_passthrough', ], 'gpu_dawn_integration_gtests_passthrough': [ + 'gpu_common_gtests_passthrough', 'gpu_dawn_gtests', 'gpu_dawn_gtests_with_validation', - 'gpu_common_gtests_passthrough', ], 'gpu_dawn_integration_gtests_passthrough_win_x64': [ + 'gpu_common_gtests_passthrough', 'gpu_dawn_gtests', - 'gpu_dawn_gtests_with_validation', 'gpu_dawn_gtests_no_dxc', 'gpu_dawn_gtests_no_dxc_with_validation', - 'gpu_common_gtests_passthrough', + 'gpu_dawn_gtests_with_validation', ], 'gpu_dawn_isolated_scripts': [ @@ -6309,14 +6309,14 @@ ], 'gpu_dawn_telemetry_tests': [ - 'gpu_dawn_webgpu_cts', 'gpu_dawn_web_platform_webgpu_cts_force_swiftshader', + 'gpu_dawn_webgpu_cts', ], 'gpu_dawn_telemetry_win_x64_tests': [ + 'gpu_dawn_web_platform_webgpu_cts_force_swiftshader', 'gpu_dawn_webgpu_cts', 'gpu_dawn_webgpu_cts_dxc', - 'gpu_dawn_web_platform_webgpu_cts_force_swiftshader', ], 'gpu_dawn_tsan_gtests': [ @@ -6368,9 +6368,9 @@ 'gpu_mediapipe_validating_telemetry_tests', 'gpu_validating_telemetry_tests', 'gpu_webcodecs_validating_telemetry_test', - 'gpu_webgl_conformance_validating_telemetry_tests', 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests', 'gpu_webgl2_conformance_validating_telemetry_tests', + 'gpu_webgl_conformance_validating_telemetry_tests', ], 'gpu_fyi_lacros_release_telemetry_tests': [ @@ -6413,9 +6413,9 @@ 'gpu_common_and_optional_telemetry_tests', 'gpu_mediapipe_passthrough_telemetry_tests', 'gpu_passthrough_telemetry_tests', + 'gpu_skia_renderer_vulkan_passthrough_telemetry_tests', 'gpu_webgl2_conformance_gl_passthrough_telemetry_tests', 'gpu_webgl_conformance_gl_passthrough_telemetry_tests', - 'gpu_skia_renderer_vulkan_passthrough_telemetry_tests', ], 'gpu_fyi_mac_debug_gtests': [ @@ -6555,10 +6555,10 @@ 'gpu_passthrough_telemetry_tests', 'gpu_validating_telemetry_tests', 'gpu_webcodecs_validating_telemetry_test', - 'gpu_webgl_conformance_gles_passthrough_telemetry_tests', - 'gpu_webgl_conformance_validating_telemetry_tests', 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests', 'gpu_webgl2_conformance_validating_telemetry_tests', + 'gpu_webgl_conformance_gles_passthrough_telemetry_tests', + 'gpu_webgl_conformance_validating_telemetry_tests', ], 'gpu_swangle_telemetry_tests': [ @@ -6603,18 +6603,18 @@ ], 'linux_chromeos_specific_and_lacros_dependent_gtests': [ + 'ash_pixel_gtests', 'aura_gtests', 'chromium_gtests', 'chromium_gtests_for_devices_with_graphical_output', 'chromium_gtests_for_linux_and_chromeos_only', 'chromium_gtests_for_win_and_linux_only', + 'linux_chromeos_browser_tests_require_lacros', 'linux_chromeos_lacros_gtests', 'linux_chromeos_specific_gtests', - 'linux_chromeos_browser_tests_require_lacros', 'linux_flavor_specific_chromium_gtests', 'non_android_chromium_gtests', 'pixel_experimental_browser_tests_gtests', - 'ash_pixel_gtests', ], 'linux_viz_gtests': [ @@ -6677,8 +6677,8 @@ 'wpt_web_tests_content_shell_multiple_flags': [ 'wpt_web_tests_content_shell', - 'wpt_web_tests_not_site_per_process', 'wpt_web_tests_highdpi', + 'wpt_web_tests_not_site_per_process', ], }, @@ -6686,9 +6686,9 @@ 'android_11_emulator_gtests': { 'android_emulator_specific_chrome_public_tests': {}, - 'android_trichrome_smoke_tests': {}, 'android_smoke_tests': {}, 'android_specific_chromium_gtests': {}, + 'android_trichrome_smoke_tests': {}, 'chromium_gtests': {}, 'chromium_gtests_for_devices_with_graphical_output': {}, 'linux_flavor_specific_chromium_gtests': {}, @@ -6705,9 +6705,9 @@ 'android_12_emulator_gtests': { 'android_12_fieldtrial_webview_tests': {}, 'android_emulator_specific_chrome_public_tests': {}, - 'android_trichrome_smoke_tests': {}, 'android_smoke_tests': {}, 'android_specific_chromium_gtests': {}, + 'android_trichrome_smoke_tests': {}, 'chrome_profile_generator_tests': {}, 'chromium_gtests': {}, 'chromium_gtests_for_devices_with_graphical_output': {}, @@ -6726,9 +6726,9 @@ 'android_12l_emulator_gtests': { 'android_emulator_specific_chrome_public_tests': {}, - 'android_trichrome_smoke_tests': {}, 'android_smoke_tests': {}, 'android_specific_chromium_gtests': {}, + 'android_trichrome_smoke_tests': {}, 'chromium_gtests': {}, 'chromium_gtests_for_devices_with_graphical_output': {}, 'linux_flavor_specific_chromium_gtests': {}, @@ -6738,9 +6738,9 @@ 'android_13_emulator_gtests': { 'android_emulator_specific_chrome_public_tests': {}, - 'android_trichrome_smoke_tests': {}, 'android_smoke_tests': {}, 'android_specific_chromium_gtests': {}, + 'android_trichrome_smoke_tests': {}, 'chromium_gtests': {}, 'chromium_gtests_for_devices_with_graphical_output': {}, 'linux_flavor_specific_chromium_gtests': {}, @@ -6757,6 +6757,13 @@ 'android_fieldtrial_rel_webview_tests': { 'fieldtrial_android_tests': {}, + 'system_webview_shell_instrumentation_tests': { + 'variants': [ + 'DISABLE_FIELD_TRIAL_CONFIG_WEBVIEW_COMMANDLINE', + 'SINGLE_GROUP_PER_STUDY_PREFER_EXISTING_BEHAVIOR_WEBVIEW_COMMANDLINE', + 'SINGLE_GROUP_PER_STUDY_PREFER_NEW_BEHAVIOR_WEBVIEW_COMMANDLINE', + ], + }, 'webview_bot_instrumentation_test_apk_gtest': { 'variants': [ 'DISABLE_FIELD_TRIAL_CONFIG', @@ -6778,13 +6785,6 @@ 'SINGLE_GROUP_PER_STUDY_PREFER_NEW_BEHAVIOR', ], }, - 'system_webview_shell_instrumentation_tests': { - 'variants': [ - 'DISABLE_FIELD_TRIAL_CONFIG_WEBVIEW_COMMANDLINE', - 'SINGLE_GROUP_PER_STUDY_PREFER_EXISTING_BEHAVIOR_WEBVIEW_COMMANDLINE', - 'SINGLE_GROUP_PER_STUDY_PREFER_NEW_BEHAVIOR_WEBVIEW_COMMANDLINE', - ], - }, }, 'chromeos_brya_skylab_tests': { @@ -6962,12 +6962,12 @@ 'CROS_JACUZZI_RELEASE_LKGM', ], }, - 'gpu_webgl_conformance_gles_passthrough_telemetry_tests': { + 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests': { 'variants': [ 'CROS_JACUZZI_RELEASE_LKGM', ], }, - 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests': { + 'gpu_webgl_conformance_gles_passthrough_telemetry_tests': { 'variants': [ 'CROS_JACUZZI_RELEASE_LKGM', ], @@ -6995,12 +6995,12 @@ 'CROS_VOLTEER_PUBLIC_RELEASE_ASH_LKGM', ], }, - 'gpu_webgl_conformance_gles_passthrough_telemetry_tests': { + 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests': { 'variants': [ 'CROS_VOLTEER_PUBLIC_RELEASE_ASH_LKGM', ], }, - 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests': { + 'gpu_webgl_conformance_gles_passthrough_telemetry_tests': { 'variants': [ 'CROS_VOLTEER_PUBLIC_RELEASE_ASH_LKGM', ], @@ -7013,12 +7013,12 @@ 'LACROS_ASH_TOT', ], }, - 'gpu_webgl_conformance_gles_passthrough_telemetry_tests': { + 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests': { 'variants': [ 'LACROS_ASH_TOT', ], }, - 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests': { + 'gpu_webgl_conformance_gles_passthrough_telemetry_tests': { 'variants': [ 'LACROS_ASH_TOT', ], @@ -7031,16 +7031,12 @@ 'SIM_IPHONE_14_16_4', ], }, - 'ios_eg2_tests': { + 'ios_crash_xcuitests': { 'mixins': [ 'xcode_parallelization', - 'record_failed_tests', ], 'variants': [ 'SIM_IPHONE_14_16_4', - 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPAD_10TH_GEN_16_4', - 'SIM_IPAD_PRO_6TH_GEN_16_4', ], }, 'ios_eg2_cq_tests': { @@ -7049,25 +7045,29 @@ 'record_failed_tests', ], 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_10TH_GEN_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', + 'SIM_IPHONE_14_16_4', + ], + }, + 'ios_eg2_tests': { + 'mixins': [ + 'xcode_parallelization', + 'record_failed_tests', + ], + 'variants': [ + 'SIM_IPAD_10TH_GEN_16_4', + 'SIM_IPAD_AIR_5TH_GEN_16_4', + 'SIM_IPAD_PRO_6TH_GEN_16_4', + 'SIM_IPHONE_14_16_4', ], }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_14_16_4', - 'SIM_IPHONE_14_PRO_MAX_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_16_4', - ], - }, - 'ios_crash_xcuitests': { - 'mixins': [ - 'xcode_parallelization', - ], - 'variants': [ 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_PRO_MAX_16_4', ], }, }, @@ -7086,34 +7086,34 @@ 'SIM_IPHONE_14_16_4', ], }, - 'ios_eg2_tests': { - 'mixins': [ - 'xcode_parallelization', - 'record_failed_tests', - ], - 'variants': [ - 'SIM_IPHONE_14_16_4', - 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPAD_PRO_6TH_GEN_16_4', - ], - }, 'ios_eg2_cq_tests': { 'mixins': [ 'xcode_parallelization', 'record_failed_tests', ], 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_16_4', + 'SIM_IPHONE_14_16_4', + ], + }, + 'ios_eg2_tests': { + 'mixins': [ + 'xcode_parallelization', + 'record_failed_tests', + ], + 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_16_4', + 'SIM_IPAD_PRO_6TH_GEN_16_4', + 'SIM_IPHONE_14_16_4', ], }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_14_16_4', - 'SIM_IPHONE_SE_3RD_GEN_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_16_4', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_SE_3RD_GEN_16_4', ], }, }, @@ -7121,35 +7121,8 @@ 'ios17_beta_simulator_tests': { 'ios_common_tests': { 'variants': [ - 'SIM_IPHONE_14_17_2', 'SIM_IPAD_AIR_5TH_GEN_17_2', - ], - }, - 'ios_eg2_tests': { - 'mixins': [ - 'xcode_parallelization', - 'record_failed_tests', - ], - 'variants': [ 'SIM_IPHONE_14_17_2', - 'SIM_IPAD_AIR_5TH_GEN_17_2', - ], - }, - 'ios_eg2_cq_tests': { - 'mixins': [ - 'xcode_parallelization', - 'record_failed_tests', - ], - 'variants': [ - 'SIM_IPHONE_14_17_2', - 'SIM_IPAD_AIR_5TH_GEN_17_2', - ], - }, - 'ios_screen_size_dependent_tests': { - 'variants': [ - 'SIM_IPHONE_14_17_2', - 'SIM_IPHONE_SE_3RD_GEN_17_2', - 'SIM_IPAD_AIR_5TH_GEN_17_2', ], }, 'ios_crash_xcuitests': { @@ -7157,8 +7130,35 @@ 'xcode_parallelization', ], 'variants': [ - 'SIM_IPHONE_14_17_2', 'SIM_IPAD_AIR_5TH_GEN_17_2', + 'SIM_IPHONE_14_17_2', + ], + }, + 'ios_eg2_cq_tests': { + 'mixins': [ + 'xcode_parallelization', + 'record_failed_tests', + ], + 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_17_2', + 'SIM_IPHONE_14_17_2', + ], + }, + 'ios_eg2_tests': { + 'mixins': [ + 'xcode_parallelization', + 'record_failed_tests', + ], + 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_17_2', + 'SIM_IPHONE_14_17_2', + ], + }, + 'ios_screen_size_dependent_tests': { + 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_17_2', + 'SIM_IPHONE_14_17_2', + 'SIM_IPHONE_SE_3RD_GEN_17_2', ], }, }, @@ -7166,17 +7166,8 @@ 'ios17_sdk_simulator_tests': { 'ios_common_tests': { 'variants': [ - 'SIM_IPHONE_14_17_2', 'SIM_IPAD_AIR_5TH_GEN_17_2', - ], - }, - 'ios_eg2_tests': { - 'mixins': [ - 'xcode_parallelization', - ], - 'variants': [ 'SIM_IPHONE_14_17_2', - 'SIM_IPAD_AIR_5TH_GEN_17_2', ], }, 'ios_eg2_cq_tests': { @@ -7188,11 +7179,20 @@ 'SIM_IPHONE_14_17_2', ], }, + 'ios_eg2_tests': { + 'mixins': [ + 'xcode_parallelization', + ], + 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_17_2', + 'SIM_IPHONE_14_17_2', + ], + }, 'ios_screen_size_dependent_tests': { 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_17_2', 'SIM_IPHONE_14_17_2', 'SIM_IPHONE_SE_3RD_GEN_17_2', - 'SIM_IPAD_AIR_5TH_GEN_17_2', ], }, }, @@ -7200,14 +7200,14 @@ 'ios_asan_tests': { 'ios_common_tests': { 'variants': [ - 'SIM_IPHONE_X_15_5', 'SIM_IPAD_AIR_2_15_5', + 'SIM_IPHONE_X_15_5', ], }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_X_15_5', 'SIM_IPAD_AIR_2_15_5', + 'SIM_IPHONE_X_15_5', ], }, }, @@ -7239,10 +7239,10 @@ 'ios_code_coverage_tests': { 'ios_common_tests': { 'variants': [ - 'SIM_IPHONE_14_PLUS_16_4', - 'SIM_IPHONE_14_PLUS_17_0', 'SIM_IPHONE_14_16_4', 'SIM_IPHONE_14_17_0', + 'SIM_IPHONE_14_PLUS_16_4', + 'SIM_IPHONE_14_PLUS_17_0', ], }, 'ios_eg2_cq_tests': { @@ -7250,12 +7250,12 @@ 'xcode_parallelization', ], 'variants': [ - 'SIM_IPHONE_14_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_AIR_5TH_GEN_16_4', 'SIM_IPAD_AIR_5TH_GEN_17_0', 'SIM_IPAD_PRO_6TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, 'ios_eg2_tests': { @@ -7263,18 +7263,18 @@ 'xcode_parallelization', ], 'variants': [ - 'SIM_IPHONE_14_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_PRO_6TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_14_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_PRO_6TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, }, @@ -7286,42 +7286,42 @@ 'SIM_IPHONE_14_17_0', ], }, - 'ios_eg2_tests': { - 'mixins': [ - 'xcode_parallelization', - 'record_failed_tests', - ], - 'variants': [ - 'SIM_IPHONE_14_17_0', - 'SIM_IPAD_AIR_5TH_GEN_17_0', - ], - }, 'ios_eg2_cq_tests': { 'mixins': [ 'xcode_parallelization', 'record_failed_tests', ], 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_10TH_GEN_16_4', - 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPAD_PRO_6TH_GEN_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_10TH_GEN_17_0', + 'SIM_IPAD_AIR_5TH_GEN_16_4', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPAD_PRO_6TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', + ], + }, + 'ios_eg2_tests': { + 'mixins': [ + 'xcode_parallelization', + 'record_failed_tests', + ], + 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_14_17_0', ], }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_14_PRO_MAX_16_4', - 'SIM_IPHONE_14_16_4', - 'SIM_IPHONE_SE_3RD_GEN_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPHONE_14_PRO_MAX_17_0', - 'SIM_IPHONE_14_17_0', - 'SIM_IPHONE_SE_3RD_GEN_17_0', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', + 'SIM_IPHONE_14_PRO_MAX_16_4', + 'SIM_IPHONE_14_PRO_MAX_17_0', + 'SIM_IPHONE_SE_3RD_GEN_16_4', + 'SIM_IPHONE_SE_3RD_GEN_17_0', ], }, }, @@ -7333,28 +7333,28 @@ 'SIM_IPHONE_14_PLUS_17_0', ], }, - 'ios_eg2_tests': { - 'mixins': [ - 'xcode_parallelization', - ], - 'variants': [ - 'SIM_IPHONE_14_16_4', - 'SIM_IPHONE_14_17_0', - 'SIM_IPAD_PRO_6TH_GEN_16_4', - 'SIM_IPAD_PRO_6TH_GEN_17_0', - ], - }, 'ios_eg2_cq_tests': { 'mixins': [ 'xcode_parallelization', ], 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_16_4', + 'SIM_IPAD_AIR_5TH_GEN_17_0', 'SIM_IPAD_PRO_6TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_17_0', 'SIM_IPHONE_14_16_4', 'SIM_IPHONE_14_17_0', - 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPAD_AIR_5TH_GEN_17_0', + ], + }, + 'ios_eg2_tests': { + 'mixins': [ + 'xcode_parallelization', + ], + 'variants': [ + 'SIM_IPAD_PRO_6TH_GEN_16_4', + 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, 'ios_screen_size_dependent_tests': { @@ -7401,15 +7401,14 @@ }, 'ios_simulator_noncq_tests': { - 'ios_eg2_tests': { + 'ios_crash_xcuitests': { 'mixins': [ 'xcode_parallelization', - 'record_failed_tests', ], 'variants': [ 'SIM_IPHONE_13_15_5', - 'SIM_IPAD_PRO_6TH_GEN_16_4', - 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_SE_3RD_GEN_16_4', + 'SIM_IPHONE_SE_3RD_GEN_17_0', ], }, 'ios_eg2_cq_tests': { @@ -7418,31 +7417,32 @@ 'record_failed_tests', ], 'variants': [ - 'SIM_IPHONE_13_15_5', 'SIM_IPAD_AIR_5TH_GEN_16_4', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_13_15_5', + ], + }, + 'ios_eg2_tests': { + 'mixins': [ + 'xcode_parallelization', + 'record_failed_tests', + ], + 'variants': [ + 'SIM_IPAD_PRO_6TH_GEN_16_4', + 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_13_15_5', ], }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_SE_3RD_GEN_15_5', 'SIM_IPAD_AIR_5TH_GEN_15_5', - 'SIM_IPHONE_14_PLUS_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPHONE_SE_3RD_GEN_16_4', - 'SIM_IPAD_PRO_6TH_GEN_16_4', - 'SIM_IPHONE_14_PLUS_17_0', 'SIM_IPAD_AIR_5TH_GEN_17_0', - 'SIM_IPHONE_SE_3RD_GEN_17_0', + 'SIM_IPAD_PRO_6TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_17_0', - ], - }, - 'ios_crash_xcuitests': { - 'mixins': [ - 'xcode_parallelization', - ], - 'variants': [ - 'SIM_IPHONE_13_15_5', + 'SIM_IPHONE_14_PLUS_16_4', + 'SIM_IPHONE_14_PLUS_17_0', + 'SIM_IPHONE_SE_3RD_GEN_15_5', 'SIM_IPHONE_SE_3RD_GEN_16_4', 'SIM_IPHONE_SE_3RD_GEN_17_0', ], @@ -7467,10 +7467,10 @@ }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_PRO_6TH_GEN_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, }, @@ -7478,10 +7478,10 @@ 'ios_webkit_tot_tests': { 'ios_common_tests': { 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, 'ios_eg2_cq_tests': { @@ -7489,10 +7489,10 @@ 'xcode_parallelization', ], 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, 'ios_eg2_tests': { @@ -7500,18 +7500,18 @@ 'xcode_parallelization', ], 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, }, @@ -7519,10 +7519,10 @@ 'ios_webrtc_fyi_tests': { 'ios_remoting_fyi_unittests': { 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, }, @@ -7530,8 +7530,8 @@ 'lacros_amd64_generic_rel_skylab_fyi': { 'lacros_skylab_tests': { 'variants': [ - 'CROS_OCTOPUS_PUBLIC_LKGM', 'CROS_EVE_PUBLIC_LKGM', + 'CROS_OCTOPUS_PUBLIC_LKGM', ], }, }, @@ -7547,8 +7547,8 @@ 'lacros_arm64_generic_rel_skylab_fyi': { 'lacros_skylab_tests': { 'variants': [ - 'CROS_JACUZZI_PUBLIC_LKGM', 'CROS_JACUZZI_CQ_PUBLIC_LKGM', + 'CROS_JACUZZI_PUBLIC_LKGM', 'CROS_TROGDOR_PUBLIC_LKGM', ], }, @@ -7631,8 +7631,8 @@ 'lacros_skylab_arm': { 'lacros_skylab_tests_version_skew': { 'variants': [ - 'CROS_JACUZZI_RELEASE_DEV', 'CROS_JACUZZI_RELEASE_BETA', + 'CROS_JACUZZI_RELEASE_DEV', 'CROS_JACUZZI_RELEASE_STABLE', ], }, @@ -7649,38 +7649,19 @@ 'lacros_skylab_arm_fyi': { 'lacros_skylab_arm_tests_fyi': { 'variants': [ - 'CROS_HANA_RELEASE_LKGM', - 'CROS_HANA_RELEASE_DEV', 'CROS_HANA_RELEASE_BETA', + 'CROS_HANA_RELEASE_DEV', + 'CROS_HANA_RELEASE_LKGM', 'CROS_HANA_RELEASE_STABLE', - 'CROS_STRONGBAD_RELEASE_LKGM', - 'CROS_STRONGBAD_RELEASE_DEV', 'CROS_STRONGBAD_RELEASE_BETA', + 'CROS_STRONGBAD_RELEASE_DEV', + 'CROS_STRONGBAD_RELEASE_LKGM', 'CROS_STRONGBAD_RELEASE_STABLE', ], }, }, 'lacros_skylab_tests_amd64_generic': { - 'lacros_skylab_tests_version_skew': { - 'variants': [ - 'CROS_BRYA_RELEASE_DEV', - 'CROS_BRYA_RELEASE_BETA', - 'CROS_BRYA_RELEASE_STABLE', - 'CROS_DEDEDE_RELEASE_DEV', - 'CROS_DEDEDE_RELEASE_BETA', - 'CROS_DEDEDE_RELEASE_STABLE', - 'CROS_FIZZ_RELEASE_DEV', - 'CROS_FIZZ_RELEASE_BETA', - 'CROS_FIZZ_RELEASE_STABLE', - 'CROS_GUYBRUSH_RELEASE_DEV', - 'CROS_GUYBRUSH_RELEASE_BETA', - 'CROS_GUYBRUSH_RELEASE_STABLE', - 'CROS_PUFF_RELEASE_DEV', - 'CROS_PUFF_RELEASE_BETA', - 'CROS_PUFF_RELEASE_STABLE', - ], - }, 'lacros_skylab_tests': { 'variants': [ 'CROS_BRYA_RELEASE_LKGM', @@ -7690,6 +7671,25 @@ 'CROS_PUFF_RELEASE_LKGM', ], }, + 'lacros_skylab_tests_version_skew': { + 'variants': [ + 'CROS_BRYA_RELEASE_BETA', + 'CROS_BRYA_RELEASE_DEV', + 'CROS_BRYA_RELEASE_STABLE', + 'CROS_DEDEDE_RELEASE_BETA', + 'CROS_DEDEDE_RELEASE_DEV', + 'CROS_DEDEDE_RELEASE_STABLE', + 'CROS_FIZZ_RELEASE_BETA', + 'CROS_FIZZ_RELEASE_DEV', + 'CROS_FIZZ_RELEASE_STABLE', + 'CROS_GUYBRUSH_RELEASE_BETA', + 'CROS_GUYBRUSH_RELEASE_DEV', + 'CROS_GUYBRUSH_RELEASE_STABLE', + 'CROS_PUFF_RELEASE_BETA', + 'CROS_PUFF_RELEASE_DEV', + 'CROS_PUFF_RELEASE_STABLE', + ], + }, 'lacros_skylab_tests_with_gtests': { 'variants': [ 'CROS_BRYA_RELEASE_LKGM', @@ -7704,21 +7704,21 @@ 'lacros_skylab_tests_amd64_generic_fyi': { 'lacros_skylab_amd64_fyi': { 'variants': [ - 'CROS_OCTOPUS_RELEASE_LKGM', - 'CROS_OCTOPUS_RELEASE_DEV', 'CROS_OCTOPUS_RELEASE_BETA', + 'CROS_OCTOPUS_RELEASE_DEV', + 'CROS_OCTOPUS_RELEASE_LKGM', 'CROS_OCTOPUS_RELEASE_STABLE', ], }, }, 'lacros_skylab_tests_amd64_generic_rel': { - 'lacros_skylab_tests': { + 'chromeos_integration_tests': { 'variants': [ 'CROS_VOLTEER_PUBLIC_LKGM', ], }, - 'chromeos_integration_tests': { + 'lacros_skylab_tests': { 'variants': [ 'CROS_VOLTEER_PUBLIC_LKGM', ], @@ -7733,33 +7733,33 @@ 'chromium_gtests_for_win_and_linux_only': {}, 'linux_chromeos_lacros_gtests': {}, 'linux_flavor_specific_chromium_gtests': {}, - 'linux_lacros_specific_gtests': {}, - 'non_android_chromium_gtests': {}, 'linux_lacros_chrome_browsertests_non_version_skew': {}, 'linux_lacros_chrome_browsertests_version_skew': { 'variants': [ + 'LACROS_VERSION_SKEW_BETA', 'LACROS_VERSION_SKEW_CANARY', 'LACROS_VERSION_SKEW_DEV', - 'LACROS_VERSION_SKEW_BETA', 'LACROS_VERSION_SKEW_STABLE', ], }, 'linux_lacros_chrome_interactive_ui_tests_version_skew': { 'variants': [ + 'LACROS_VERSION_SKEW_BETA', 'LACROS_VERSION_SKEW_CANARY', 'LACROS_VERSION_SKEW_DEV', - 'LACROS_VERSION_SKEW_BETA', 'LACROS_VERSION_SKEW_STABLE', ], }, + 'linux_lacros_specific_gtests': {}, + 'non_android_chromium_gtests': {}, }, 'linux_lacros_version_skew_tests': { 'linux_lacros_chrome_interactive_ui_tests_version_skew': { 'variants': [ + 'LACROS_VERSION_SKEW_BETA', 'LACROS_VERSION_SKEW_CANARY', 'LACROS_VERSION_SKEW_DEV', - 'LACROS_VERSION_SKEW_BETA', 'LACROS_VERSION_SKEW_STABLE', ], }, @@ -7815,6 +7815,12 @@ 'MAC_RETINA_NVIDIA_GPU_STABLE', ], }, + 'gpu_gl_passthrough_ganesh_telemetry_tests': { + 'variants': [ + 'MAC_MINI_INTEL_GPU_STABLE', + 'MAC_RETINA_AMD_GPU_STABLE', + ], + }, 'gpu_mediapipe_passthrough_telemetry_tests': { 'variants': [ 'MAC_MINI_INTEL_GPU_STABLE', @@ -7822,12 +7828,6 @@ 'MAC_RETINA_NVIDIA_GPU_STABLE', ], }, - 'gpu_gl_passthrough_ganesh_telemetry_tests': { - 'variants': [ - 'MAC_MINI_INTEL_GPU_STABLE', - 'MAC_RETINA_AMD_GPU_STABLE', - ], - }, 'gpu_metal_passthrough_graphite_telemetry_tests': { 'variants': [ 'MAC_MINI_INTEL_GPU_STABLE',
diff --git a/infra/config/generated/testing/variants.pyl b/infra/config/generated/testing/variants.pyl index bbf30ba..9afeeb0 100644 --- a/infra/config/generated/testing/variants.pyl +++ b/infra/config/generated/testing/variants.pyl
@@ -5,6 +5,379 @@ # 3. Run //infra/config/scripts/sync-pyl-files.py { + 'CROS_BRYA_RELEASE_ASH_LKGM': { + 'identifier': 'BRYA_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'brya', + 'use_lkgm': True, + 'dut_pool': 'chrome', + }, + }, + 'CROS_BRYA_RELEASE_BETA': { + 'identifier': 'BRYA_RELEASE_BETA', + 'skylab': { + 'cros_board': 'brya', + 'cros_img': 'brya-release/R120-15662.16.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_BRYA_RELEASE_DEV': { + 'identifier': 'BRYA_RELEASE_DEV', + 'skylab': { + 'cros_board': 'brya', + 'cros_img': 'brya-release/R121-15678.0.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_BRYA_RELEASE_LKGM': { + 'identifier': 'BRYA_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'brya', + 'use_lkgm': True, + 'dut_pool': 'chrome', + }, + }, + 'CROS_BRYA_RELEASE_STABLE': { + 'identifier': 'BRYA_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'brya', + 'cros_img': 'brya-release/R119-15633.44.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_DEDEDE_RELEASE_BETA': { + 'identifier': 'DEDEDE_RELEASE_BETA', + 'skylab': { + 'cros_board': 'dedede', + 'cros_img': 'dedede-release/R120-15662.16.0', + }, + }, + 'CROS_DEDEDE_RELEASE_DEV': { + 'identifier': 'DEDEDE_RELEASE_DEV', + 'skylab': { + 'cros_board': 'dedede', + 'cros_img': 'dedede-release/R121-15678.0.0', + }, + }, + 'CROS_DEDEDE_RELEASE_LKGM': { + 'identifier': 'DEDEDE_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'dedede', + 'use_lkgm': True, + }, + }, + 'CROS_DEDEDE_RELEASE_STABLE': { + 'identifier': 'DEDEDE_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'dedede', + 'cros_img': 'dedede-release/R119-15633.44.0', + }, + }, + 'CROS_EVE_PUBLIC_LKGM': { + 'identifier': 'EVE_PUBLIC_LKGM', + 'skylab': { + 'cros_board': 'eve', + 'cros_img': 'eve-public/R121-15684.0.0', + 'bucket': 'chromiumos-image-archive', + 'dut_pool': 'chromium', + 'public_builder': 'cros_test_platform_public', + 'public_builder_bucket': 'testplatform-public', + }, + }, + 'CROS_FIZZ_RELEASE_BETA': { + 'identifier': 'FIZZ_RELEASE_BETA', + 'skylab': { + 'cros_board': 'fizz', + 'cros_img': 'fizz-release/R120-15662.16.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_FIZZ_RELEASE_DEV': { + 'identifier': 'FIZZ_RELEASE_DEV', + 'skylab': { + 'cros_board': 'fizz', + 'cros_img': 'fizz-release/R121-15678.0.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_FIZZ_RELEASE_LKGM': { + 'identifier': 'FIZZ_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'fizz', + 'use_lkgm': True, + 'dut_pool': 'chrome', + }, + }, + 'CROS_FIZZ_RELEASE_STABLE': { + 'identifier': 'FIZZ_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'fizz', + 'cros_img': 'fizz-release/R119-15633.44.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_GUYBRUSH_RELEASE_BETA': { + 'identifier': 'GUYBRUSH_RELEASE_BETA', + 'skylab': { + 'cros_board': 'guybrush', + 'cros_img': 'guybrush-release/R120-15662.16.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_GUYBRUSH_RELEASE_DEV': { + 'identifier': 'GUYBRUSH_RELEASE_DEV', + 'skylab': { + 'cros_board': 'guybrush', + 'cros_img': 'guybrush-release/R121-15678.0.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_GUYBRUSH_RELEASE_LKGM': { + 'identifier': 'GUYBRUSH_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'guybrush', + 'use_lkgm': True, + 'dut_pool': 'chrome', + }, + }, + 'CROS_GUYBRUSH_RELEASE_STABLE': { + 'identifier': 'GUYBRUSH_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'guybrush', + 'cros_img': 'guybrush-release/R119-15633.44.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_HANA_RELEASE_BETA': { + 'identifier': 'HANA_RELEASE_BETA', + 'skylab': { + 'cros_board': 'hana', + 'cros_img': 'hana-release/R120-15662.16.0', + }, + }, + 'CROS_HANA_RELEASE_DEV': { + 'identifier': 'HANA_RELEASE_DEV', + 'skylab': { + 'cros_board': 'hana', + 'cros_img': 'hana-release/R121-15678.0.0', + }, + }, + 'CROS_HANA_RELEASE_LKGM': { + 'identifier': 'HANA_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'hana', + 'use_lkgm': True, + }, + }, + 'CROS_HANA_RELEASE_STABLE': { + 'identifier': 'HANA_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'hana', + 'cros_img': 'hana-release/R119-15633.44.0', + }, + }, + 'CROS_JACUZZI_CQ_PUBLIC_LKGM': { + 'identifier': 'JACUZZI_CQ_PUBLIC_LKGM', + 'skylab': { + 'cros_board': 'jacuzzi', + 'cros_img': 'jacuzzi-public/R121-15673.0.0', + 'bucket': 'chromiumos-image-archive', + 'public_builder': 'cros_test_platform_public', + 'public_builder_bucket': 'testplatform-public', + }, + }, + 'CROS_JACUZZI_PUBLIC_LKGM': { + 'identifier': 'JACUZZI_PUBLIC_LKGM', + 'skylab': { + 'cros_board': 'jacuzzi', + 'cros_img': 'jacuzzi-public/R121-15673.0.0', + 'bucket': 'chromiumos-image-archive', + }, + }, + 'CROS_JACUZZI_RELEASE_BETA': { + 'identifier': 'JACUZZI_RELEASE_BETA', + 'skylab': { + 'cros_board': 'jacuzzi', + 'cros_img': 'jacuzzi-release/R120-15662.16.0', + }, + }, + 'CROS_JACUZZI_RELEASE_CHROME_FROM_TLS_ASH_LKGM': { + 'identifier': 'JACUZZI_RELEASE_CHROME_FROM_TLS_LKGM', + 'skylab': { + 'cros_board': 'jacuzzi', + 'use_lkgm': True, + }, + }, + 'CROS_JACUZZI_RELEASE_DEV': { + 'identifier': 'JACUZZI_RELEASE_DEV', + 'skylab': { + 'cros_board': 'jacuzzi', + 'cros_img': 'jacuzzi-release/R121-15678.0.0', + }, + }, + 'CROS_JACUZZI_RELEASE_LKGM': { + 'identifier': 'JACUZZI_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'jacuzzi', + 'use_lkgm': True, + }, + }, + 'CROS_JACUZZI_RELEASE_STABLE': { + 'identifier': 'JACUZZI_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'jacuzzi', + 'cros_img': 'jacuzzi-release/R119-15633.44.0', + }, + }, + 'CROS_OCTOPUS_PUBLIC_LKGM': { + 'identifier': 'OCTOPUS_PUBLIC_LKGM', + 'skylab': { + 'cros_board': 'octopus', + 'cros_img': 'octopus-public/R121-15684.0.0', + 'bucket': 'chromiumos-image-archive', + }, + }, + 'CROS_OCTOPUS_RELEASE_BETA': { + 'identifier': 'OCTOPUS_RELEASE_BETA', + 'skylab': { + 'cros_board': 'octopus', + 'cros_img': 'octopus-release/R120-15662.16.0', + }, + }, + 'CROS_OCTOPUS_RELEASE_CHROME_FROM_TLS_ASH_LKGM': { + 'identifier': 'OCTOPUS_RELEASE_CHROME_FROM_TLS_LKGM', + 'skylab': { + 'cros_board': 'octopus', + 'use_lkgm': True, + }, + }, + 'CROS_OCTOPUS_RELEASE_DEV': { + 'identifier': 'OCTOPUS_RELEASE_DEV', + 'skylab': { + 'cros_board': 'octopus', + 'cros_img': 'octopus-release/R121-15678.0.0', + }, + }, + 'CROS_OCTOPUS_RELEASE_LKGM': { + 'identifier': 'OCTOPUS_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'octopus', + 'use_lkgm': True, + }, + }, + 'CROS_OCTOPUS_RELEASE_STABLE': { + 'identifier': 'OCTOPUS_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'octopus', + 'cros_img': 'octopus-release/R119-15633.44.0', + }, + }, + 'CROS_PUFF_RELEASE_BETA': { + 'identifier': 'PUFF_RELEASE_BETA', + 'skylab': { + 'cros_board': 'puff', + 'cros_img': 'puff-release/R120-15662.16.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_PUFF_RELEASE_DEV': { + 'identifier': 'PUFF_RELEASE_DEV', + 'skylab': { + 'cros_board': 'puff', + 'cros_img': 'puff-release/R121-15678.0.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_PUFF_RELEASE_LKGM': { + 'identifier': 'PUFF_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'puff', + 'use_lkgm': True, + 'dut_pool': 'chrome', + }, + }, + 'CROS_PUFF_RELEASE_STABLE': { + 'identifier': 'PUFF_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'puff', + 'cros_img': 'puff-release/R118-15604.57.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_STRONGBAD_RELEASE_BETA': { + 'identifier': 'STRONGBAD_RELEASE_BETA', + 'skylab': { + 'cros_board': 'strongbad', + 'cros_img': 'strongbad-release/R120-15662.16.0', + }, + }, + 'CROS_STRONGBAD_RELEASE_DEV': { + 'identifier': 'strongbad_RELEASE_DEV', + 'skylab': { + 'cros_board': 'strongbad', + 'cros_img': 'strongbad-release/R121-15678.0.0', + }, + }, + 'CROS_STRONGBAD_RELEASE_LKGM': { + 'identifier': 'STRONGBAD_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'strongbad', + 'use_lkgm': True, + }, + }, + 'CROS_STRONGBAD_RELEASE_STABLE': { + 'identifier': 'STRONGBAD_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'strongbad', + 'cros_img': 'strongbad-release/R119-15633.44.0', + }, + }, + 'CROS_TROGDOR_PUBLIC_LKGM': { + 'identifier': 'TROGDOR_PUBLIC_LKGM', + 'skylab': { + 'cros_board': 'trogdor', + 'cros_img': 'trogdor-public/R121-15684.0.0', + 'bucket': 'chromiumos-image-archive', + }, + }, + 'CROS_TROGDOR_RELEASE_ASH_LKGM': { + 'identifier': 'TROGDOR_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'trogdor', + 'use_lkgm': True, + }, + }, + 'CROS_VOLTEER_PUBLIC_LKGM': { + 'identifier': 'VOLTEER_PUBLIC_LKGM', + 'skylab': { + 'cros_board': 'volteer', + 'cros_model': 'voxel', + 'cros_img': 'volteer-public/R121-15684.0.0', + 'bucket': 'chromiumos-image-archive', + 'dut_pool': 'chromium', + 'public_builder': 'cros_test_platform_public', + 'public_builder_bucket': 'testplatform-public', + }, + }, + 'CROS_VOLTEER_PUBLIC_RELEASE_ASH_LKGM': { + 'identifier': 'VOLTEER_PUBLIC_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'volteer', + 'cros_model': 'voxel', + 'use_lkgm': True, + 'bucket': 'chromiumos-image-archive', + 'dut_pool': 'chromium', + 'public_builder': 'cros_test_platform_public', + 'public_builder_bucket': 'testplatform-public', + }, + }, + 'CROS_VOLTEER_RELEASE_ASH_LKGM': { + 'identifier': 'VOLTEER_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'volteer', + 'use_lkgm': True, + }, + }, 'DISABLE_FIELD_TRIAL_CONFIG': { 'identifier': 'Disable Field Trial Config', 'args': [ @@ -19,46 +392,6 @@ '--webview-command-line-arg=--webview-verbose-logging', ], }, - 'SINGLE_GROUP_PER_STUDY_PREFER_EXISTING_BEHAVIOR': { - 'identifier': 'Single Group Per Study Prefer Existing Behavior Field Trial Config', - 'args': [ - '--variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_existing_behavior/seed.json', - '--accept-empty-variations-seed-signature', - '--webview-verbose-logging', - '--disable-field-trial-config', - '--fake-variations-channel=stable', - ], - }, - 'SINGLE_GROUP_PER_STUDY_PREFER_NEW_BEHAVIOR': { - 'identifier': 'Single Group Per Study Prefer New Behavior Field Trial Config', - 'args': [ - '--variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_new_behavior/seed.json', - '--accept-empty-variations-seed-signature', - '--webview-verbose-logging', - '--disable-field-trial-config', - '--fake-variations-channel=stable', - ], - }, - 'SINGLE_GROUP_PER_STUDY_PREFER_EXISTING_BEHAVIOR_WEBVIEW_COMMANDLINE': { - 'identifier': 'Single Group Per Study Prefer Existing Behavior Field Trial Config', - 'args': [ - '--webview-variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_existing_behavior/seed.json', - '--webview-command-line-arg=--accept-empty-variations-seed-signature', - '--webview-command-line-arg=--webview-verbose-logging', - '--webview-command-line-arg=--disable-field-trial-config', - '--webview-command-line-arg=--fake-variations-channel=stable', - ], - }, - 'SINGLE_GROUP_PER_STUDY_PREFER_NEW_BEHAVIOR_WEBVIEW_COMMANDLINE': { - 'identifier': 'Single Group Per Study Prefer New Behavior Field Trial Config', - 'args': [ - '--webview-variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_new_behavior/seed.json', - '--webview-command-line-arg=--accept-empty-variations-seed-signature', - '--webview-command-line-arg=--webview-verbose-logging', - '--webview-command-line-arg=--disable-field-trial-config', - '--webview-command-line-arg=--fake-variations-channel=stable', - ], - }, 'IPHONE_7_15_4_1': { 'identifier': 'iPhone 7 15.4.1', 'swarming': { @@ -68,18 +401,68 @@ }, }, }, - 'LACROS_VERSION_SKEW_CANARY': { - 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 121.0.6156.0', + 'LACROS_AMD64_GENERIC': { + 'identifier': 'amd64-generic', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6156.0/test_ash_chrome', + '--board=amd64-generic', + '--use-vm', + ], + 'swarming': { + 'dimensions': { + 'cpu': 'x86-64', + 'kvm': '1', + 'os': 'Ubuntu-22.04', + }, + }, + }, + 'LACROS_ASH_TOT': { + 'identifier': 'Ash ToT', + 'args': [ + '--deploy-lacros', + ], + }, + 'LACROS_EVE': { + 'identifier': 'eve', + 'args': [ + '--board=eve', + '--flash', + ], + 'ci_only': True, + 'swarming': { + 'dimensions': { + 'os': 'ChromeOS', + 'device_type': 'eve', + }, + }, + }, + 'LACROS_VERSION_SKEW_BETA': { + 'identifier': 'Lacros version skew testing ash beta', + 'description': 'Run with ash-chrome version 120.0.6099.25', + 'args': [ + '--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6099.25/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v121.0.6156.0', - 'revision': 'version:121.0.6156.0', + 'location': 'lacros_version_skew_tests_v120.0.6099.25', + 'revision': 'version:120.0.6099.25', + }, + ], + }, + }, + 'LACROS_VERSION_SKEW_CANARY': { + 'identifier': 'Lacros version skew testing ash canary', + 'description': 'Run with ash-chrome version 121.0.6157.0', + 'args': [ + '--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6157.0/test_ash_chrome', + ], + 'swarming': { + 'cipd_packages': [ + { + 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', + 'location': 'lacros_version_skew_tests_v121.0.6157.0', + 'revision': 'version:121.0.6157.0', }, ], }, @@ -100,22 +483,6 @@ ], }, }, - 'LACROS_VERSION_SKEW_BETA': { - 'identifier': 'Lacros version skew testing ash beta', - 'description': 'Run with ash-chrome version 120.0.6099.25', - 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6099.25/test_ash_chrome', - ], - 'swarming': { - 'cipd_packages': [ - { - 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v120.0.6099.25', - 'revision': 'version:120.0.6099.25', - }, - ], - }, - }, 'LACROS_VERSION_SKEW_STABLE': { 'identifier': 'Lacros version skew testing ash stable', 'description': 'Run with ash-chrome version 119.0.6045.192', @@ -162,6 +529,54 @@ 'mac_retina_nvidia_gpu_stable', ], }, + 'MODEL_VALIDATION_BASE': { + 'identifier': 'MODEL_VALIDATION_BASE', + }, + 'MODEL_VALIDATION_TRUNK': { + 'identifier': 'MODEL_VALIDATION_TRUNK', + 'linux_args': [ + '--chromedriver', + 'chromedriver', + '--binary', + 'chrome', + ], + 'mac_args': [ + '--chromedriver', + 'chromedriver', + '--binary', + 'Chromium.app/Contents/MacOS/Chromium', + ], + 'win_args': [ + '--chromedriver', + 'chromedriver.exe', + '--binary', + 'Chrome.exe', + ], + }, + 'SIM_IPAD_10TH_GEN_16_4': { + 'identifier': 'iPad (10th generation) 16.4', + 'args': [ + '--platform', + 'iPad (10th generation)', + '--version', + '16.4', + ], + 'mixins': [ + 'ios_runtime_cache_16_4', + ], + }, + 'SIM_IPAD_10TH_GEN_17_0': { + 'identifier': 'iPad (10th generation) 17.0', + 'args': [ + '--platform', + 'iPad (10th generation)', + '--version', + '17.0', + ], + 'mixins': [ + 'ios_runtime_cache_17_0', + ], + }, 'SIM_IPAD_AIR_2_15_5': { 'identifier': 'iPad Air 2 15.5', 'args': [ @@ -246,42 +661,6 @@ 'ios_runtime_cache_17_0', ], }, - 'SIM_IPAD_10TH_GEN_16_4': { - 'identifier': 'iPad (10th generation) 16.4', - 'args': [ - '--platform', - 'iPad (10th generation)', - '--version', - '16.4', - ], - 'mixins': [ - 'ios_runtime_cache_16_4', - ], - }, - 'SIM_IPAD_10TH_GEN_17_0': { - 'identifier': 'iPad (10th generation) 17.0', - 'args': [ - '--platform', - 'iPad (10th generation)', - '--version', - '17.0', - ], - 'mixins': [ - 'ios_runtime_cache_17_0', - ], - }, - 'SIM_IPHONE_6S_15_5': { - 'identifier': 'iPhone 6s 15.5', - 'args': [ - '--platform', - 'iPhone 6s', - '--version', - '15.5', - ], - 'mixins': [ - 'ios_runtime_cache_15_5', - ], - }, 'SIM_IPHONE_13_15_5': { 'identifier': 'iPhone 13 15.5', 'args': [ @@ -378,6 +757,18 @@ 'ios_runtime_cache_17_0', ], }, + 'SIM_IPHONE_6S_15_5': { + 'identifier': 'iPhone 6s 15.5', + 'args': [ + '--platform', + 'iPhone 6s', + '--version', + '15.5', + ], + 'mixins': [ + 'ios_runtime_cache_15_5', + ], + }, 'SIM_IPHONE_SE_3RD_GEN_15_5': { 'identifier': 'iPhone SE (3rd generation) 15.5', 'args': [ @@ -438,6 +829,46 @@ 'ios_runtime_cache_15_5', ], }, + 'SINGLE_GROUP_PER_STUDY_PREFER_EXISTING_BEHAVIOR': { + 'identifier': 'Single Group Per Study Prefer Existing Behavior Field Trial Config', + 'args': [ + '--variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_existing_behavior/seed.json', + '--accept-empty-variations-seed-signature', + '--webview-verbose-logging', + '--disable-field-trial-config', + '--fake-variations-channel=stable', + ], + }, + 'SINGLE_GROUP_PER_STUDY_PREFER_EXISTING_BEHAVIOR_WEBVIEW_COMMANDLINE': { + 'identifier': 'Single Group Per Study Prefer Existing Behavior Field Trial Config', + 'args': [ + '--webview-variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_existing_behavior/seed.json', + '--webview-command-line-arg=--accept-empty-variations-seed-signature', + '--webview-command-line-arg=--webview-verbose-logging', + '--webview-command-line-arg=--disable-field-trial-config', + '--webview-command-line-arg=--fake-variations-channel=stable', + ], + }, + 'SINGLE_GROUP_PER_STUDY_PREFER_NEW_BEHAVIOR': { + 'identifier': 'Single Group Per Study Prefer New Behavior Field Trial Config', + 'args': [ + '--variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_new_behavior/seed.json', + '--accept-empty-variations-seed-signature', + '--webview-verbose-logging', + '--disable-field-trial-config', + '--fake-variations-channel=stable', + ], + }, + 'SINGLE_GROUP_PER_STUDY_PREFER_NEW_BEHAVIOR_WEBVIEW_COMMANDLINE': { + 'identifier': 'Single Group Per Study Prefer New Behavior Field Trial Config', + 'args': [ + '--webview-variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_new_behavior/seed.json', + '--webview-command-line-arg=--accept-empty-variations-seed-signature', + '--webview-command-line-arg=--webview-verbose-logging', + '--webview-command-line-arg=--disable-field-trial-config', + '--webview-command-line-arg=--fake-variations-channel=stable', + ], + }, 'WEBVIEW_TRICHROME_FULL_CTS_TESTS': { 'identifier': 'full_mode', 'swarming': { @@ -452,413 +883,6 @@ '--test-apk-as-instant', ], }, - 'CROS_BRYA_RELEASE_ASH_LKGM': { - 'identifier': 'BRYA_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'brya', - 'use_lkgm': True, - 'dut_pool': 'chrome', - }, - }, - 'CROS_BRYA_RELEASE_LKGM': { - 'identifier': 'BRYA_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'brya', - 'use_lkgm': True, - 'dut_pool': 'chrome', - }, - }, - 'CROS_BRYA_RELEASE_DEV': { - 'identifier': 'BRYA_RELEASE_DEV', - 'skylab': { - 'cros_board': 'brya', - 'cros_img': 'brya-release/R121-15678.0.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_BRYA_RELEASE_BETA': { - 'identifier': 'BRYA_RELEASE_BETA', - 'skylab': { - 'cros_board': 'brya', - 'cros_img': 'brya-release/R120-15662.16.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_BRYA_RELEASE_STABLE': { - 'identifier': 'BRYA_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'brya', - 'cros_img': 'brya-release/R119-15633.44.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_DEDEDE_RELEASE_LKGM': { - 'identifier': 'DEDEDE_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'dedede', - 'use_lkgm': True, - }, - }, - 'CROS_DEDEDE_RELEASE_DEV': { - 'identifier': 'DEDEDE_RELEASE_DEV', - 'skylab': { - 'cros_board': 'dedede', - 'cros_img': 'dedede-release/R121-15678.0.0', - }, - }, - 'CROS_DEDEDE_RELEASE_BETA': { - 'identifier': 'DEDEDE_RELEASE_BETA', - 'skylab': { - 'cros_board': 'dedede', - 'cros_img': 'dedede-release/R120-15662.16.0', - }, - }, - 'CROS_DEDEDE_RELEASE_STABLE': { - 'identifier': 'DEDEDE_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'dedede', - 'cros_img': 'dedede-release/R119-15633.44.0', - }, - }, - 'CROS_FIZZ_RELEASE_LKGM': { - 'identifier': 'FIZZ_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'fizz', - 'use_lkgm': True, - 'dut_pool': 'chrome', - }, - }, - 'CROS_FIZZ_RELEASE_DEV': { - 'identifier': 'FIZZ_RELEASE_DEV', - 'skylab': { - 'cros_board': 'fizz', - 'cros_img': 'fizz-release/R121-15678.0.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_FIZZ_RELEASE_BETA': { - 'identifier': 'FIZZ_RELEASE_BETA', - 'skylab': { - 'cros_board': 'fizz', - 'cros_img': 'fizz-release/R120-15662.16.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_FIZZ_RELEASE_STABLE': { - 'identifier': 'FIZZ_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'fizz', - 'cros_img': 'fizz-release/R119-15633.44.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_GUYBRUSH_RELEASE_LKGM': { - 'identifier': 'GUYBRUSH_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'guybrush', - 'use_lkgm': True, - 'dut_pool': 'chrome', - }, - }, - 'CROS_GUYBRUSH_RELEASE_DEV': { - 'identifier': 'GUYBRUSH_RELEASE_DEV', - 'skylab': { - 'cros_board': 'guybrush', - 'cros_img': 'guybrush-release/R121-15678.0.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_GUYBRUSH_RELEASE_BETA': { - 'identifier': 'GUYBRUSH_RELEASE_BETA', - 'skylab': { - 'cros_board': 'guybrush', - 'cros_img': 'guybrush-release/R120-15662.16.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_GUYBRUSH_RELEASE_STABLE': { - 'identifier': 'GUYBRUSH_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'guybrush', - 'cros_img': 'guybrush-release/R119-15633.44.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_PUFF_RELEASE_LKGM': { - 'identifier': 'PUFF_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'puff', - 'use_lkgm': True, - 'dut_pool': 'chrome', - }, - }, - 'CROS_PUFF_RELEASE_DEV': { - 'identifier': 'PUFF_RELEASE_DEV', - 'skylab': { - 'cros_board': 'puff', - 'cros_img': 'puff-release/R121-15678.0.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_PUFF_RELEASE_BETA': { - 'identifier': 'PUFF_RELEASE_BETA', - 'skylab': { - 'cros_board': 'puff', - 'cros_img': 'puff-release/R120-15662.16.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_PUFF_RELEASE_STABLE': { - 'identifier': 'PUFF_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'puff', - 'cros_img': 'puff-release/R118-15604.57.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_EVE_PUBLIC_LKGM': { - 'identifier': 'EVE_PUBLIC_LKGM', - 'skylab': { - 'cros_board': 'eve', - 'cros_img': 'eve-public/R121-15684.0.0', - 'bucket': 'chromiumos-image-archive', - 'dut_pool': 'chromium', - 'public_builder': 'cros_test_platform_public', - 'public_builder_bucket': 'testplatform-public', - }, - }, - 'CROS_HANA_RELEASE_LKGM': { - 'identifier': 'HANA_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'hana', - 'use_lkgm': True, - }, - }, - 'CROS_HANA_RELEASE_DEV': { - 'identifier': 'HANA_RELEASE_DEV', - 'skylab': { - 'cros_board': 'hana', - 'cros_img': 'hana-release/R121-15678.0.0', - }, - }, - 'CROS_HANA_RELEASE_BETA': { - 'identifier': 'HANA_RELEASE_BETA', - 'skylab': { - 'cros_board': 'hana', - 'cros_img': 'hana-release/R120-15662.16.0', - }, - }, - 'CROS_HANA_RELEASE_STABLE': { - 'identifier': 'HANA_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'hana', - 'cros_img': 'hana-release/R119-15633.44.0', - }, - }, - 'CROS_JACUZZI_RELEASE_LKGM': { - 'identifier': 'JACUZZI_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'jacuzzi', - 'use_lkgm': True, - }, - }, - 'CROS_JACUZZI_RELEASE_DEV': { - 'identifier': 'JACUZZI_RELEASE_DEV', - 'skylab': { - 'cros_board': 'jacuzzi', - 'cros_img': 'jacuzzi-release/R121-15678.0.0', - }, - }, - 'CROS_JACUZZI_RELEASE_BETA': { - 'identifier': 'JACUZZI_RELEASE_BETA', - 'skylab': { - 'cros_board': 'jacuzzi', - 'cros_img': 'jacuzzi-release/R120-15662.16.0', - }, - }, - 'CROS_JACUZZI_RELEASE_CHROME_FROM_TLS_ASH_LKGM': { - 'identifier': 'JACUZZI_RELEASE_CHROME_FROM_TLS_LKGM', - 'skylab': { - 'cros_board': 'jacuzzi', - 'use_lkgm': True, - }, - }, - 'CROS_JACUZZI_RELEASE_STABLE': { - 'identifier': 'JACUZZI_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'jacuzzi', - 'cros_img': 'jacuzzi-release/R119-15633.44.0', - }, - }, - 'CROS_JACUZZI_PUBLIC_LKGM': { - 'identifier': 'JACUZZI_PUBLIC_LKGM', - 'skylab': { - 'cros_board': 'jacuzzi', - 'cros_img': 'jacuzzi-public/R121-15673.0.0', - 'bucket': 'chromiumos-image-archive', - }, - }, - 'CROS_JACUZZI_CQ_PUBLIC_LKGM': { - 'identifier': 'JACUZZI_CQ_PUBLIC_LKGM', - 'skylab': { - 'cros_board': 'jacuzzi', - 'cros_img': 'jacuzzi-public/R121-15673.0.0', - 'bucket': 'chromiumos-image-archive', - 'public_builder': 'cros_test_platform_public', - 'public_builder_bucket': 'testplatform-public', - }, - }, - 'CROS_TROGDOR_PUBLIC_LKGM': { - 'identifier': 'TROGDOR_PUBLIC_LKGM', - 'skylab': { - 'cros_board': 'trogdor', - 'cros_img': 'trogdor-public/R121-15684.0.0', - 'bucket': 'chromiumos-image-archive', - }, - }, - 'CROS_OCTOPUS_PUBLIC_LKGM': { - 'identifier': 'OCTOPUS_PUBLIC_LKGM', - 'skylab': { - 'cros_board': 'octopus', - 'cros_img': 'octopus-public/R121-15684.0.0', - 'bucket': 'chromiumos-image-archive', - }, - }, - 'CROS_OCTOPUS_RELEASE_CHROME_FROM_TLS_ASH_LKGM': { - 'identifier': 'OCTOPUS_RELEASE_CHROME_FROM_TLS_LKGM', - 'skylab': { - 'cros_board': 'octopus', - 'use_lkgm': True, - }, - }, - 'CROS_OCTOPUS_RELEASE_LKGM': { - 'identifier': 'OCTOPUS_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'octopus', - 'use_lkgm': True, - }, - }, - 'CROS_OCTOPUS_RELEASE_DEV': { - 'identifier': 'OCTOPUS_RELEASE_DEV', - 'skylab': { - 'cros_board': 'octopus', - 'cros_img': 'octopus-release/R121-15678.0.0', - }, - }, - 'CROS_OCTOPUS_RELEASE_BETA': { - 'identifier': 'OCTOPUS_RELEASE_BETA', - 'skylab': { - 'cros_board': 'octopus', - 'cros_img': 'octopus-release/R120-15662.16.0', - }, - }, - 'CROS_OCTOPUS_RELEASE_STABLE': { - 'identifier': 'OCTOPUS_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'octopus', - 'cros_img': 'octopus-release/R119-15633.44.0', - }, - }, - 'CROS_STRONGBAD_RELEASE_LKGM': { - 'identifier': 'STRONGBAD_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'strongbad', - 'use_lkgm': True, - }, - }, - 'CROS_STRONGBAD_RELEASE_DEV': { - 'identifier': 'strongbad_RELEASE_DEV', - 'skylab': { - 'cros_board': 'strongbad', - 'cros_img': 'strongbad-release/R121-15678.0.0', - }, - }, - 'CROS_STRONGBAD_RELEASE_BETA': { - 'identifier': 'STRONGBAD_RELEASE_BETA', - 'skylab': { - 'cros_board': 'strongbad', - 'cros_img': 'strongbad-release/R120-15662.16.0', - }, - }, - 'CROS_STRONGBAD_RELEASE_STABLE': { - 'identifier': 'STRONGBAD_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'strongbad', - 'cros_img': 'strongbad-release/R119-15633.44.0', - }, - }, - 'CROS_TROGDOR_RELEASE_ASH_LKGM': { - 'identifier': 'TROGDOR_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'trogdor', - 'use_lkgm': True, - }, - }, - 'CROS_VOLTEER_PUBLIC_LKGM': { - 'identifier': 'VOLTEER_PUBLIC_LKGM', - 'skylab': { - 'cros_board': 'volteer', - 'cros_model': 'voxel', - 'cros_img': 'volteer-public/R121-15684.0.0', - 'bucket': 'chromiumos-image-archive', - 'dut_pool': 'chromium', - 'public_builder': 'cros_test_platform_public', - 'public_builder_bucket': 'testplatform-public', - }, - }, - 'CROS_VOLTEER_PUBLIC_RELEASE_ASH_LKGM': { - 'identifier': 'VOLTEER_PUBLIC_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'volteer', - 'cros_model': 'voxel', - 'use_lkgm': True, - 'bucket': 'chromiumos-image-archive', - 'dut_pool': 'chromium', - 'public_builder': 'cros_test_platform_public', - 'public_builder_bucket': 'testplatform-public', - }, - }, - 'CROS_VOLTEER_RELEASE_ASH_LKGM': { - 'identifier': 'VOLTEER_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'volteer', - 'use_lkgm': True, - }, - }, - 'LACROS_AMD64_GENERIC': { - 'identifier': 'amd64-generic', - 'args': [ - '--board=amd64-generic', - '--use-vm', - ], - 'swarming': { - 'dimensions': { - 'cpu': 'x86-64', - 'kvm': '1', - 'os': 'Ubuntu-22.04', - }, - }, - }, - 'LACROS_ASH_TOT': { - 'identifier': 'Ash ToT', - 'args': [ - '--deploy-lacros', - ], - }, - 'LACROS_EVE': { - 'identifier': 'eve', - 'args': [ - '--board=eve', - '--flash', - ], - 'ci_only': True, - 'swarming': { - 'dimensions': { - 'os': 'ChromeOS', - 'device_type': 'eve', - }, - }, - }, 'WIN10_INTEL_UHD_630_STABLE': { 'identifier': '8086:9bc5', 'mixins': [ @@ -872,28 +896,4 @@ 'win10_nvidia_gtx_1660_stable', ], }, - 'MODEL_VALIDATION_BASE': { - 'identifier': 'MODEL_VALIDATION_BASE', - }, - 'MODEL_VALIDATION_TRUNK': { - 'identifier': 'MODEL_VALIDATION_TRUNK', - 'linux_args': [ - '--chromedriver', - 'chromedriver', - '--binary', - 'chrome', - ], - 'mac_args': [ - '--chromedriver', - 'chromedriver', - '--binary', - 'Chromium.app/Contents/MacOS/Chromium', - ], - 'win_args': [ - '--chromedriver', - 'chromedriver.exe', - '--binary', - 'Chrome.exe', - ], - }, }
diff --git a/infra/config/gn_args/gn_args.star b/infra/config/gn_args/gn_args.star index 9899ea0..3a4ea868 100644 --- a/infra/config/gn_args/gn_args.star +++ b/infra/config/gn_args/gn_args.star
@@ -422,7 +422,6 @@ "debug_try_builder", configs = [ "debug_builder", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ) @@ -453,16 +452,6 @@ }, ) -# Scrambling mojom message IDs invalidates the outputs in build dir every time -# when changing chrome/VERSION. This should be disabled in CQ to make -# incremental builds more efficient. -gn_args.config( - "disable_mojom_message_id_scrambling", - args = { - "enable_mojom_message_id_scrambling": False, - }, -) - gn_args.config( "disable_nacl", args = { @@ -477,6 +466,13 @@ }, ) +gn_args.config( + "enable_all_rust_features", + args = { + "enable_all_rust_features": True, + }, +) + # Enables backup ref ptr by changing the default value of the feature flag. # This sets the default value of PartitionAllocBackupRefPtr to enabled, with # enabled-processes = non-renderer: @@ -525,6 +521,13 @@ ) gn_args.config( + "fail_on_san_warnings", + args = { + "fail_on_san_warnings": True, + }, +) + +gn_args.config( "ffmpeg_branding_chrome", args = { "ffmpeg_branding": "Chrome", @@ -976,7 +979,6 @@ "try_builder", configs = [ "dcheck_always_on", - "disable_mojom_message_id_scrambling", "minimal_symbols", "use_dummy_lastchange", ], @@ -997,6 +999,16 @@ ) gn_args.config( + "ubsan_no_recover", + args = { + "is_ubsan_no_recover": True, + }, + configs = [ + "ubsan", + ], +) + +gn_args.config( "ubsan_security_non_vptr", args = { "is_ubsan_security": True,
diff --git a/infra/config/lib/targets.star b/infra/config/lib/targets.star index 4e512c27..3f7feb0 100644 --- a/infra/config/lib/targets.star +++ b/infra/config/lib/targets.star
@@ -763,7 +763,7 @@ def _generate_gn_isolate_map_pyl(ctx): entries = [] - for n in graph.children(keys.project(), _TARGET.kind, graph.DEFINITION_ORDER): + for n in graph.children(keys.project(), _TARGET.kind, graph.KEY_ORDER): entries.append(' "{}": {{'.format(n.key.id)) entries.append(' "label": "{}",'.format(n.props.label)) if n.props.label_type != None: @@ -1001,7 +1001,7 @@ def _generate_mixins_pyl(ctx): formatter = _formatter() - for n in graph.children(keys.project(), _TARGET_MIXIN.kind, graph.DEFINITION_ORDER): + for n in graph.children(keys.project(), _TARGET_MIXIN.kind, graph.KEY_ORDER): mixin = n.props.mixin_values formatter.open_scope("'{}': {{".format(n.key.id)) @@ -1019,7 +1019,7 @@ def _generate_variants_pyl(ctx): formatter = _formatter() - for n in graph.children(keys.project(), _TARGET_VARIANT.kind, graph.DEFINITION_ORDER): + for n in graph.children(keys.project(), _TARGET_VARIANT.kind, graph.KEY_ORDER): mixin = n.props.mixin_values formatter.open_scope("'{}': {{".format(n.key.id)) @@ -1050,11 +1050,11 @@ formatter.open_scope("'basic_suites': {") - for suite in graph.children(keys.project(), _LEGACY_BASIC_SUITE.kind, graph.DEFINITION_ORDER): + for suite in graph.children(keys.project(), _LEGACY_BASIC_SUITE.kind, graph.KEY_ORDER): formatter.add_line("") formatter.open_scope("'{}': {{".format(suite.key.id)) - for test_name, test_config in suite.props.tests.items(): + for test_name, test_config in sorted(suite.props.tests.items()): if not test_config: formatter.add_line("'{}': {{}},".format(test_name)) continue @@ -1105,10 +1105,10 @@ formatter.open_scope("'compound_suites': {") - for suite in graph.children(keys.project(), _LEGACY_COMPOUND_SUITE.kind, graph.DEFINITION_ORDER): + for suite in graph.children(keys.project(), _LEGACY_COMPOUND_SUITE.kind, graph.KEY_ORDER): formatter.add_line("") formatter.open_scope("'{}': [".format(suite.key.id)) - for basic_suite in graph.children(suite.key, _LEGACY_BASIC_SUITE.kind, graph.DEFINITION_ORDER): + for basic_suite in graph.children(suite.key, _LEGACY_BASIC_SUITE.kind, graph.KEY_ORDER): formatter.add_line("'{}',".format(basic_suite.key.id)) formatter.close_scope("],") @@ -1118,12 +1118,15 @@ formatter.open_scope("'matrix_compound_suites': {") - for suite in graph.children(keys.project(), _LEGACY_MATRIX_COMPOUND_SUITE.kind, graph.DEFINITION_ORDER): + for suite in graph.children(keys.project(), _LEGACY_MATRIX_COMPOUND_SUITE.kind, graph.KEY_ORDER): formatter.add_line("") formatter.open_scope("'{}': {{".format(suite.key.id)) - for matrix_config in graph.children(suite.key, _LEGACY_MATRIX_CONFIG.kind, graph.DEFINITION_ORDER): + for matrix_config in graph.children(suite.key, _LEGACY_MATRIX_CONFIG.kind, graph.KEY_ORDER): + # The order that mixins are declared is significant, + # DEFINITION_ORDER preserves the order that the edges were added + # from the parent to the child mixins = graph.children(matrix_config.key, _TARGET_MIXIN.kind, graph.DEFINITION_ORDER) - variants = graph.children(matrix_config.key, _TARGET_VARIANT.kind, graph.DEFINITION_ORDER) + variants = graph.children(matrix_config.key, _TARGET_VARIANT.kind, graph.KEY_ORDER) if not (mixins or variants): formatter.add_line("'{}': {{}},".format(matrix_config.key.id)) continue
diff --git a/infra/config/subprojects/build/build.star b/infra/config/subprojects/build/build.star index c745802..401e3d5e 100644 --- a/infra/config/subprojects/build/build.star +++ b/infra/config/subprojects/build/build.star
@@ -77,8 +77,7 @@ reclient_instance = reclient.instance.DEFAULT_UNTRUSTED, siso_project = siso.project.DEFAULT_UNTRUSTED, use_clang_coverage = True, - # TODO: b/308405411 - Enable remote-devtools-frontend-typescript by default. - siso_configs = ["builder", "remote-devtools-frontend-typescript"], + siso_configs = ["builder"], **kwargs )
diff --git a/infra/config/subprojects/chromium/ci/chromium.memory.fyi.star b/infra/config/subprojects/chromium/ci/chromium.memory.fyi.star index 695b5f27..fd8754b 100644 --- a/infra/config/subprojects/chromium/ci/chromium.memory.fyi.star +++ b/infra/config/subprojects/chromium/ci/chromium.memory.fyi.star
@@ -7,6 +7,7 @@ load("//lib/builders.star", "os", "reclient") load("//lib/ci.star", "ci") load("//lib/consoles.star", "consoles") +load("//lib/gn_args.star", "gn_args") ci.defaults.set( executable = ci.DEFAULT_EXECUTABLE, @@ -54,6 +55,16 @@ short_name = "asan lsan", ), execution_timeout = 6 * time.hour, + gn_args = gn_args.config( + configs = [ + "asan", + "lsan", + "fail_on_san_warnings", + "release_try_builder", + "minimal_symbols", + "reclient", + ], + ), reclient_jobs = reclient.jobs.DEFAULT, ) @@ -86,6 +97,14 @@ short_name = "msan", ), execution_timeout = 6 * time.hour, + gn_args = gn_args.config( + configs = [ + "msan", + "fail_on_san_warnings", + "release_builder", + "reclient", + ], + ), reclient_jobs = reclient.jobs.DEFAULT, ) @@ -112,6 +131,15 @@ short_name = "tsan", ), execution_timeout = 4 * time.hour, + gn_args = gn_args.config( + configs = [ + "tsan", + "disable_nacl", + "fail_on_san_warnings", + "release_builder", + "reclient", + ], + ), reclient_jobs = reclient.jobs.DEFAULT, ) @@ -138,6 +166,13 @@ short_name = "fyi", ), execution_timeout = 6 * time.hour, + gn_args = gn_args.config( + configs = [ + "ubsan_no_recover", + "release_builder", + "reclient", + ], + ), reclient_jobs = reclient.jobs.DEFAULT, ) @@ -167,5 +202,15 @@ short_name = "lsan", ), execution_timeout = 12 * time.hour, + gn_args = gn_args.config( + configs = [ + "asan", + "lsan", + "dcheck_always_on", + "disable_nacl", + "release_builder", + "reclient", + ], + ), reclient_jobs = reclient.jobs.DEFAULT, )
diff --git a/infra/config/subprojects/chromium/ci/chromium.memory.star b/infra/config/subprojects/chromium/ci/chromium.memory.star index cf6e9d8..2f9f2b4 100644 --- a/infra/config/subprojects/chromium/ci/chromium.memory.star +++ b/infra/config/subprojects/chromium/ci/chromium.memory.star
@@ -10,6 +10,7 @@ load("//lib/builders.star", "os", "reclient", "sheriff_rotations", "xcode") load("//lib/ci.star", "ci") load("//lib/consoles.star", "consoles") +load("//lib/gn_args.star", "gn_args") ci.defaults.set( executable = ci.DEFAULT_EXECUTABLE, @@ -72,6 +73,16 @@ short_name = "bld", ), cq_mirrors_console_view = "mirrors", + gn_args = gn_args.config( + configs = [ + "asan", + "lsan", + "fail_on_san_warnings", + "release_try_builder", + "minimal_symbols", + "reclient", + ], + ), ) linux_memory_builder( @@ -126,6 +137,14 @@ short_name = "bld", ), cq_mirrors_console_view = "mirrors", + gn_args = gn_args.config( + configs = [ + "tsan", + "disable_nacl", + "release_builder", + "reclient", + ], + ), ) linux_memory_builder( @@ -151,6 +170,18 @@ ), # TODO(thakis): Remove once https://crbug.com/927738 is resolved. execution_timeout = 5 * time.hour, + gn_args = gn_args.config( + configs = [ + "cfi_full", + "cfi_icall", + "cfi_diag", + "thin_lto", + "release", + "static", + "dcheck_always_on", + "reclient", + ], + ), ) linux_memory_builder( @@ -182,6 +213,16 @@ # TODO(crbug.com/1030593): Builds take more than 3 hours sometimes. Remove # once the builds are faster. execution_timeout = 6 * time.hour, + gn_args = gn_args.config( + configs = [ + "asan", + "lsan", + "chromeos", + "release_try_builder", + "minimal_symbols", + "reclient", + ], + ), ) linux_memory_builder( @@ -242,6 +283,14 @@ short_name = "bld", ), execution_timeout = 4 * time.hour, + gn_args = gn_args.config( + configs = [ + "chromeos", + "msan", + "release_builder", + "reclient", + ], + ), ) linux_memory_builder( @@ -302,6 +351,13 @@ category = "linux|msan", short_name = "bld", ), + gn_args = gn_args.config( + configs = [ + "msan", + "release_builder", + "reclient", + ], + ), ) linux_memory_builder( @@ -360,6 +416,17 @@ category = "lacros|asan", short_name = "asan", ), + gn_args = gn_args.config( + configs = [ + "asan", + "lsan", + "release_try_builder", + "minimal_symbols", + "reclient", + "lacros_on_linux", + "also_build_ash_chrome", + ], + ), ) ci.builder( @@ -388,6 +455,16 @@ category = "mac", short_name = "bld", ), + gn_args = gn_args.config( + configs = [ + "asan", + "minimal_symbols", + "disable_nacl", + "release_builder", + "reclient", + "dcheck_always_on", + ], + ), ) linux_memory_builder( @@ -470,6 +547,14 @@ category = "linux|webkit", short_name = "asn", ), + gn_args = gn_args.config( + configs = [ + "asan", + "lsan", + "release_builder_blink", + "reclient", + ], + ), ) ci.builder( @@ -494,6 +579,12 @@ category = "linux|webkit", short_name = "lk", ), + gn_args = gn_args.config( + configs = [ + "release_builder_blink", + "reclient", + ], + ), ) ci.builder( @@ -522,6 +613,13 @@ category = "linux|webkit", short_name = "msn", ), + gn_args = gn_args.config( + configs = [ + "msan", + "release_builder_blink", + "reclient", + ], + ), ) ci.builder( @@ -548,6 +646,17 @@ category = "android", short_name = "asn", ), + gn_args = gn_args.config( + configs = [ + "android_builder", + "clang", + "asan", + "release_builder", + "reclient", + "strip_debug_info", + "minimal_symbols", + ], + ), ) ci.builder( @@ -575,6 +684,14 @@ category = "linux|ubsan", short_name = "vpt", ), + gn_args = gn_args.config( + configs = [ + "ubsan_vptr", + "ubsan_vptr_no_recover_hack", + "release_builder", + "reclient", + ], + ), reclient_jobs = reclient.jobs.DEFAULT, ) @@ -604,6 +721,17 @@ # This builder is normally using 2.5 hours to run with a cached builder. And # 1.5 hours additional setup time without cache, https://crbug.com/1311134. execution_timeout = 5 * time.hour, + gn_args = gn_args.config( + configs = [ + "asan", + "fuzzer", + "static", + "v8_heap", + "minimal_symbols", + "release_builder", + "reclient", + ], + ), reclient_jobs = reclient.jobs.DEFAULT, ) @@ -637,5 +765,15 @@ category = "iOS", short_name = "asn", ), + gn_args = gn_args.config( + configs = [ + "ios_simulator", + "x64", + "release_builder", + "reclient", + "asan", + "xctest", + ], + ), xcode = xcode.x15main, )
diff --git a/infra/config/subprojects/chromium/ci/chromium.rust.star b/infra/config/subprojects/chromium/ci/chromium.rust.star index d0f0b86..1db89b5 100644 --- a/infra/config/subprojects/chromium/ci/chromium.rust.star +++ b/infra/config/subprojects/chromium/ci/chromium.rust.star
@@ -7,6 +7,7 @@ load("//lib/builders.star", "os", "reclient") load("//lib/ci.star", "ci") load("//lib/consoles.star", "consoles") +load("//lib/gn_args.star", "gn_args") ci.defaults.set( executable = ci.DEFAULT_EXECUTABLE, @@ -50,6 +51,16 @@ category = "Android 32bit", short_name = "rel", ), + gn_args = gn_args.config( + configs = [ + "release_try_builder", + "minimal_symbols", + "reclient", + "enable_all_rust_features", + "android_builder", + "arm", + ], + ), ) ci.builder( @@ -75,6 +86,15 @@ category = "Android 64bit", short_name = "dbg", ), + gn_args = gn_args.config( + configs = [ + "debug_builder", + "reclient", + "enable_all_rust_features", + "android_builder", + "arm64", + ], + ), ) ci.builder( @@ -100,6 +120,16 @@ category = "Android 64bit", short_name = "rel", ), + gn_args = gn_args.config( + configs = [ + "release_try_builder", + "minimal_symbols", + "reclient", + "enable_all_rust_features", + "android_builder", + "arm64", + ], + ), ) ci.builder( @@ -119,6 +149,14 @@ category = "Linux", short_name = "dbg", ), + gn_args = gn_args.config( + configs = [ + "debug_builder", + "reclient", + "enable_all_rust_features", + "x64", + ], + ), ) ci.builder( @@ -140,6 +178,15 @@ category = "Linux", short_name = "rel", ), + gn_args = gn_args.config( + configs = [ + "release_try_builder", + "minimal_symbols", + "reclient", + "enable_all_rust_features", + "x64", + ], + ), ) ci.builder( @@ -163,6 +210,14 @@ category = "Mac x64", short_name = "dbg", ), + gn_args = gn_args.config( + configs = [ + "debug_builder", + "reclient", + "enable_all_rust_features", + "x64", + ], + ), ) ci.builder( @@ -184,6 +239,14 @@ category = "Windows x64", short_name = "dbg", ), + gn_args = gn_args.config( + configs = [ + "debug_builder", + "reclient", + "enable_all_rust_features", + "x64", + ], + ), ) ci.builder( @@ -205,4 +268,13 @@ category = "Windows x64", short_name = "rel", ), + gn_args = gn_args.config( + configs = [ + "release_try_builder", + "minimal_symbols", + "reclient", + "enable_all_rust_features", + "x64", + ], + ), )
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.android.star b/infra/config/subprojects/chromium/try/tryserver.chromium.android.star index d5f51207..d736eb6 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.android.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.android.star
@@ -189,6 +189,7 @@ name = "android-arm64-rel-compilator", branch_selector = branches.selector.ANDROID_BRANCHES, main_list_view = "try", + siso_enabled = True, ) # TODO: crbug.com/1502025 - Reduce duplicated configs from the shadow builder. @@ -217,15 +218,20 @@ try_.compilator_builder( name = "android-arm64-siso-rel-compilator", main_list_view = "try", - # TODO: b/308405411 - Enable remote-devtools-frontend-typescript by default. - siso_configs = ["builder", "remote-devtools-frontend-typescript"], siso_enabled = True, ) -# TODO(crbug.com/1367523): Reeanble this builder once the reboot issue is resolved. +# TODO(crbug.com/1367523): Reenable this builder once the reboot issue is resolved. # try_.builder( # name = "android-asan", # mirrors = ["ci/android-asan"], +# gn_args = gn_args.config( +# configs = [ +# "ci/android-asan", +# "release_try_builder", +# "minimal_symbols", +# ], +# ), # reclient_jobs = reclient.jobs.LOW_JOBS_FOR_CQ, # ) @@ -260,13 +266,12 @@ configs = [ "android_builder", "chrome_with_codecs", - "disable_mojom_message_id_scrambling", + "reclient", "minimal_symbols", "official_optimize", - "reclient", "stable_channel", - "use_dummy_lastchange", "v8_release_branch", + "use_dummy_lastchange", ], ), main_list_view = "try", @@ -286,6 +291,7 @@ ], }, }, + siso_enabled = True, tryjob = try_.job(), ) @@ -538,7 +544,7 @@ ], contact_team_email = "cronet-team@google.com", gn_args = gn_args.config( - configs = ["ci/android-cronet-x86-dbg", "disable_mojom_message_id_scrambling", "use_dummy_lastchange"], + configs = ["ci/android-cronet-x86-dbg", "use_dummy_lastchange"], ), main_list_view = "try", reclient_jobs = reclient.jobs.LOW_JOBS_FOR_CQ, @@ -596,7 +602,7 @@ ], contact_team_email = "cronet-team@google.com", gn_args = gn_args.config( - configs = ["ci/android-cronet-x86-dbg", "disable_mojom_message_id_scrambling", "use_dummy_lastchange"], + configs = ["ci/android-cronet-x86-dbg", "use_dummy_lastchange"], ), main_list_view = "try", reclient_jobs = reclient.jobs.LOW_JOBS_FOR_CQ, @@ -969,7 +975,6 @@ configs = [ "ci/Cast Android (dbg)", "compile_only", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ), @@ -1004,6 +1009,7 @@ ), main_list_view = "try", reclient_jobs = reclient.jobs.HIGH_JOBS_FOR_CQ, + siso_enabled = True, tryjob = try_.job(), ) @@ -1025,8 +1031,6 @@ gn_args = "try/android_compile_dbg", main_list_view = "try", reclient_jobs = reclient.jobs.HIGH_JOBS_FOR_CQ, - # TODO: b/308405411 - Enable remote-devtools-frontend-typescript by default. - siso_configs = ["builder", "remote-devtools-frontend-typescript"], siso_enabled = True, tryjob = try_.job( experiment_percentage = 10,
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.angle.star b/infra/config/subprojects/chromium/try/tryserver.chromium.angle.star index 0157751a..6b87ff6 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.angle.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.angle.star
@@ -57,7 +57,6 @@ gn_args = gn_args.config( configs = [ "ci/fuchsia-angle-builder", - "disable_mojom_message_id_scrambling", "no_symbols", "use_dummy_lastchange", ],
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.chromiumos.star b/infra/config/subprojects/chromium/try/tryserver.chromium.chromiumos.star index 2699e94f..01bb248 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.chromiumos.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.chromiumos.star
@@ -63,7 +63,6 @@ gn_args = gn_args.config( configs = [ "ci/chromeos-amd64-generic-dbg", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ), @@ -87,7 +86,6 @@ configs = [ "ci/chromeos-amd64-generic-rel", "dcheck_always_on", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ), @@ -113,7 +111,6 @@ configs = [ "ci/chromeos-amd64-generic-rel", "dcheck_always_on", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ), @@ -151,7 +148,6 @@ configs = [ "ci/chromeos-amd64-generic-rel", "dcheck_always_on", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ), @@ -177,7 +173,6 @@ configs = [ "ci/chromeos-amd64-generic-rel-renamed", "dcheck_always_on", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ), @@ -258,8 +253,6 @@ try_.compilator_builder( name = "chromeos-amd64-generic-siso-rel-compilator", main_list_view = "try", - # TODO: b/308405411 - Enable remote-devtools-frontend-typescript by default. - siso_configs = ["builder", "remote-devtools-frontend-typescript"], siso_enabled = True, ) @@ -283,7 +276,6 @@ configs = [ "ci/chromeos-arm-generic-rel", "dcheck_always_on", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ), @@ -315,7 +307,6 @@ configs = [ "ci/lacros-amd64-generic-rel", "dcheck_always_on", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ), @@ -343,7 +334,6 @@ configs = [ "ci/lacros-amd64-generic-rel-non-skylab", "dcheck_always_on", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ), @@ -373,7 +363,6 @@ configs = [ "ci/lacros-arm-generic-rel", "dcheck_always_on", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ), @@ -435,7 +424,6 @@ gn_args = gn_args.config( configs = [ "ci/linux-chromeos-dbg", - "disable_mojom_message_id_scrambling", "no_symbols", "use_dummy_lastchange", ], @@ -460,8 +448,6 @@ contact_team_email = "chrome-build-team@google.com", main_list_view = "try", reclient_jobs = reclient.jobs.HIGH_JOBS_FOR_CQ, - # TODO: b/308405411 - Enable remote-devtools-frontend-typescript by default. - siso_configs = ["builder", "remote-devtools-frontend-typescript"], siso_enabled = True, tryjob = try_.job( experiment_percentage = 10, @@ -585,11 +571,10 @@ gn_args = gn_args.config( configs = [ "ci/linux-lacros-builder-rel", - "clang", - "disable_mojom_message_id_scrambling", - "partial_code_coverage_instrumentation", "release_try_builder", + "clang", "use_clang_coverage", + "partial_code_coverage_instrumentation", "use_dummy_lastchange", ], ), @@ -620,7 +605,6 @@ gn_args = gn_args.config( configs = [ "ci/linux-chromeos-dbg", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ),
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.fuchsia.star b/infra/config/subprojects/chromium/try/tryserver.chromium.fuchsia.star index 6b0ea60..a0f6fca 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.fuchsia.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.fuchsia.star
@@ -101,13 +101,12 @@ cores = 16 if settings.is_main else 8, gn_args = gn_args.config( configs = [ - "arm64", - "cast_receiver_size_optimized", - "disable_mojom_message_id_scrambling", - "fuchsia", + "release", "official_optimize", "reclient", - "release", + "fuchsia", + "arm64", + "cast_receiver_size_optimized", "use_dummy_lastchange", ], ), @@ -164,7 +163,6 @@ gn_args = gn_args.config( configs = [ "ci/fuchsia-x64-dbg", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ),
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.linux.star b/infra/config/subprojects/chromium/try/tryserver.chromium.linux.star index 7a7f732..c87e57c 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.linux.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.linux.star
@@ -39,6 +39,12 @@ mirrors = [ "ci/WebKit Linux Leak", ], + gn_args = gn_args.config( + configs = [ + "release_try_builder", + "reclient", + ], + ), reclient_jobs = reclient.jobs.LOW_JOBS_FOR_CQ, ) @@ -70,7 +76,6 @@ gn_args = gn_args.config( configs = [ "ci/Cast Linux ARM64", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ), @@ -130,6 +135,7 @@ mirrors = [ "ci/linux-exp-asan-lsan-fyi-rel", ], + gn_args = "ci/linux-exp-asan-lsan-fyi-rel", reclient_jobs = reclient.jobs.LOW_JOBS_FOR_CQ, ) @@ -140,6 +146,7 @@ mirrors = [ "ci/linux-exp-msan-fyi-rel", ], + gn_args = "ci/linux-exp-msan-fyi-rel", reclient_jobs = reclient.jobs.LOW_JOBS_FOR_CQ, ) @@ -297,6 +304,7 @@ "chromium.enable_cleandead": 50, }, main_list_view = "try", + siso_enabled = True, ) # TODO: crbug.com/1502025 - Reduce duplicated configs from the shadow builder. @@ -327,8 +335,6 @@ try_.compilator_builder( name = "linux-siso-rel-compilator", main_list_view = "try", - # TODO: b/308405411 - Enable remote-devtools-frontend-typescript by default. - siso_configs = ["builder", "remote-devtools-frontend-typescript"], siso_enabled = True, ) @@ -339,6 +345,7 @@ mirrors = [ "ci/linux-ubsan-fyi-rel", ], + gn_args = "ci/linux-ubsan-fyi-rel", reclient_jobs = reclient.jobs.LOW_JOBS_FOR_CQ, ) @@ -380,6 +387,7 @@ mirrors = [ "ci/WebKit Linux ASAN", ], + gn_args = "ci/WebKit Linux ASAN", reclient_jobs = reclient.jobs.LOW_JOBS_FOR_CQ, ) @@ -391,6 +399,13 @@ # At this time, MSan is only compatibly with Focal. See # //docs/linux/instrumented_libraries.md. os = os.LINUX_FOCAL, + gn_args = gn_args.config( + configs = [ + "msan", + "release_builder", + "reclient", + ], + ), reclient_jobs = reclient.jobs.LOW_JOBS_FOR_CQ, ) @@ -454,7 +469,6 @@ gn_args = gn_args.config( configs = [ "ci/Cast Linux Debug", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ), @@ -489,6 +503,7 @@ "chromium.compilator_can_outlive_parent": 100, "chromium.skip_successful_tests": 50, }, + gn_args = "ci/Linux ASan LSan Builder", main_list_view = "try", tryjob = try_.job(), # TODO (crbug.com/1372179): Use orchestrator pool once overloaded test pools @@ -539,6 +554,12 @@ ssd = True, # TODO(thakis): Remove once https://crbug.com/927738 is resolved. execution_timeout = 7 * time.hour, + gn_args = gn_args.config( + configs = [ + "ci/Linux CFI", + "use_dummy_lastchange", + ], + ), reclient_jobs = reclient.jobs.LOW_JOBS_FOR_CQ, tryjob = try_.job( location_filters = [ @@ -569,6 +590,7 @@ # TODO(crbug/1144484): Remove this timeout once we figure out the # regression in compiler or toolchain. execution_timeout = 7 * time.hour, + gn_args = "ci/Linux Chromium OS ASan LSan Builder", reclient_jobs = reclient.jobs.HIGH_JOBS_FOR_CQ, ) @@ -583,6 +605,7 @@ # //docs/linux/instrumented_libraries.md. os = os.LINUX_FOCAL, ssd = True, + gn_args = "ci/Linux ChromiumOS MSan Builder", reclient_jobs = reclient.jobs.HIGH_JOBS_FOR_CQ, ) @@ -701,6 +724,10 @@ # //docs/linux/instrumented_libraries.md. os = os.LINUX_FOCAL, execution_timeout = 6 * time.hour, + # This is intentionally a release_bot and not a release_trybot; + # enabling DCHECKs seems to cause flaky failures that don't show up + # on the continuous builder. + gn_args = "ci/Linux MSan Builder", reclient_jobs = reclient.jobs.HIGH_JOBS_FOR_CQ, ) @@ -717,6 +744,13 @@ "chromium.add_one_test_shard": 10, "chromium.skip_successful_tests": 50, }, + gn_args = gn_args.config( + configs = [ + "ci/Linux TSan Builder", + "release_try_builder", + "minimal_symbols", + ], + ), main_list_view = "try", tryjob = try_.job(), # TODO (crbug.com/1372179): Use orchestrator pool once overloaded test pools @@ -763,6 +797,9 @@ mirrors = [ "ci/linux-ubsan-vptr", ], + # This is intentionally a release_bot and not a release_trybot to match + # the CI configuration, where no debug builder exists. + gn_args = "ci/linux-ubsan-vptr", reclient_jobs = reclient.jobs.LOW_JOBS_FOR_CQ, ) @@ -773,6 +810,7 @@ ], cores = 16, ssd = True, + gn_args = "ci/linux-lacros-asan-lsan-rel", reclient_jobs = reclient.jobs.HIGH_JOBS_FOR_CQ, )
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.mac.star b/infra/config/subprojects/chromium/try/tryserver.chromium.mac.star index 4ad71b0..b4fb043 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.mac.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.mac.star
@@ -205,8 +205,6 @@ cpu = cpu.ARM64, contact_team_email = "chrome-build-team@google.com", main_list_view = "try", - # TODO: b/308405411 - Enable remote-devtools-frontend-typescript by default. - siso_configs = ["builder", "remote-devtools-frontend-typescript"], siso_enabled = True, ) @@ -401,6 +399,15 @@ "ci/Mac ASan 64 Builder", "ci/Mac ASan 64 Tests (1)", ], + gn_args = gn_args.config( + configs = [ + "asan", + "dcheck_always_on", + "disable_nacl", + "release_builder", + "reclient", + ], + ), reclient_jobs = reclient.jobs.HIGH_JOBS_FOR_CQ, ) @@ -420,7 +427,6 @@ gn_args = gn_args.config( configs = [ "ci/Mac Builder (dbg)", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ), @@ -498,6 +504,7 @@ mirrors = [ "ci/ios-asan", ], + gn_args = "ci/ios-asan", ) ios_builder( @@ -563,9 +570,8 @@ gn_args = gn_args.config( configs = [ "ci/ios-simulator", - "disable_mojom_message_id_scrambling", - "partial_code_coverage_instrumentation", "use_clang_coverage", + "partial_code_coverage_instrumentation", "use_dummy_lastchange", ], ), @@ -633,9 +639,8 @@ gn_args = gn_args.config( configs = [ "ci/ios-simulator-full-configs", - "disable_mojom_message_id_scrambling", - "partial_code_coverage_instrumentation", "use_clang_coverage", + "partial_code_coverage_instrumentation", "use_dummy_lastchange", ], ), @@ -664,7 +669,6 @@ gn_args = gn_args.config( configs = [ "ci/ios-simulator-noncq", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ),
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.rust.star b/infra/config/subprojects/chromium/try/tryserver.chromium.rust.star index 9fbb84a..322cbebc7 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.rust.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.rust.star
@@ -27,38 +27,45 @@ try_.builder( name = "android-rust-arm32-rel", mirrors = ["ci/android-rust-arm32-rel"], + gn_args = "ci/android-rust-arm32-rel", ) try_.builder( name = "android-rust-arm64-dbg", mirrors = ["ci/android-rust-arm64-dbg"], + gn_args = "ci/android-rust-arm64-dbg", ) try_.builder( name = "android-rust-arm64-rel", mirrors = ["ci/android-rust-arm64-rel"], + gn_args = "ci/android-rust-arm64-rel", ) try_.builder( name = "linux-rust-x64-rel", mirrors = ["ci/linux-rust-x64-rel"], + gn_args = "ci/linux-rust-x64-rel", ) try_.builder( name = "linux-rust-x64-dbg", mirrors = ["ci/linux-rust-x64-dbg"], + gn_args = "ci/linux-rust-x64-dbg", ) try_.builder( name = "win-rust-x64-rel", mirrors = ["ci/win-rust-x64-rel"], os = os.WINDOWS_DEFAULT, + gn_args = "ci/win-rust-x64-rel", ) try_.builder( name = "win-rust-x64-dbg", mirrors = ["ci/win-rust-x64-dbg"], os = os.WINDOWS_DEFAULT, + gn_args = "ci/win-rust-x64-dbg", ) try_.builder( @@ -66,4 +73,5 @@ mirrors = ["ci/mac-rust-x64-dbg"], cores = None, os = os.MAC_ANY, + gn_args = "ci/mac-rust-x64-dbg", )
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.win.star b/infra/config/subprojects/chromium/try/tryserver.chromium.win.star index ec73349..178a217 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.win.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.win.star
@@ -49,6 +49,7 @@ cores = 16, ssd = True, execution_timeout = 9 * time.hour, + gn_args = "ci/win-asan", reclient_jobs = reclient.jobs.HIGH_JOBS_FOR_CQ, ) @@ -127,6 +128,7 @@ # TODO (crbug.com/1245171): Revert when root issue is fixed grace_period = 4 * time.minute, main_list_view = "try", + siso_enabled = True, ) # TODO: crbug.com/1502025 - Reduce duplicated configs from the shadow builder. @@ -186,7 +188,6 @@ gn_args = gn_args.config( configs = [ "ci/Win Builder (dbg)", - "disable_mojom_message_id_scrambling", "use_dummy_lastchange", ], ),
diff --git a/infra/config/targets/lacros-version-skew-variants.json b/infra/config/targets/lacros-version-skew-variants.json index 8557b5f6..41b876d0 100644 --- a/infra/config/targets/lacros-version-skew-variants.json +++ b/infra/config/targets/lacros-version-skew-variants.json
@@ -1,16 +1,16 @@ { "LACROS_VERSION_SKEW_CANARY": { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6156.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6157.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6156.0", + "description": "Run with ash-chrome version 121.0.6157.0", "identifier": "Lacros version skew testing ash canary", "swarming": { "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6156.0", - "revision": "version:121.0.6156.0" + "location": "lacros_version_skew_tests_v121.0.6157.0", + "revision": "version:121.0.6157.0" } ] }
diff --git a/internal b/internal index 6385567..1931bbc 160000 --- a/internal +++ b/internal
@@ -1 +1 @@ -Subproject commit 63855671b456f868bcdbce8a29290156fca3dc6b +Subproject commit 1931bbc2e77812d0a84aaadc2ab830a556752026
diff --git a/ios/chrome/app/BUILD.gn b/ios/chrome/app/BUILD.gn index 94b61c76..36c42ed 100644 --- a/ios/chrome/app/BUILD.gn +++ b/ios/chrome/app/BUILD.gn
@@ -509,7 +509,7 @@ "//ios/chrome/browser/feature_engagement/model", "//ios/chrome/browser/first_run/model", "//ios/chrome/browser/geolocation/model", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/mailto_handler/model", "//ios/chrome/browser/mailto_handler/model:mailto_handler_factory", "//ios/chrome/browser/main/model",
diff --git a/ios/chrome/app/resources/ios_chrome_repack.gni b/ios/chrome/app/resources/ios_chrome_repack.gni index 3216044..2521b4e 100644 --- a/ios/chrome/app/resources/ios_chrome_repack.gni +++ b/ios/chrome/app/resources/ios_chrome_repack.gni
@@ -28,6 +28,7 @@ repack_locales(target_name) { forward_variables_from(invoker, "*") source_patterns = [ + "${root_gen_dir}/components/strings/search_engine_descriptions_strings_", "${root_gen_dir}/components/strings/components_${branding_path_product}_strings_", "${root_gen_dir}/components/strings/components_locale_settings_", "${root_gen_dir}/components/strings/components_strings_", @@ -55,6 +56,7 @@ "//components/strings:components_branded_strings", "//components/strings:components_locale_settings", "//components/strings:components_strings", + "//components/strings:search_engine_descriptions_strings", "//ios/chrome/app/strings:ios_branded_strings", "//ios/chrome/app/strings:ios_strings", "//ios/chrome/browser/ui/whats_new/strings:strings",
diff --git a/ios/chrome/app/spotlight/BUILD.gn b/ios/chrome/app/spotlight/BUILD.gn index 8d9dafa..e731175 100644 --- a/ios/chrome/app/spotlight/BUILD.gn +++ b/ios/chrome/app/spotlight/BUILD.gn
@@ -46,7 +46,7 @@ "//ios/chrome/app/strings", "//ios/chrome/browser/bookmarks/model", "//ios/chrome/browser/favicon", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/reading_list/model", "//ios/chrome/browser/search_engines/model:template_url_service_factory", "//ios/chrome/browser/shared/model/browser",
diff --git a/ios/chrome/app/spotlight/topsites_spotlight_manager.mm b/ios/chrome/app/spotlight/topsites_spotlight_manager.mm index 422ac13..e996f7f 100644 --- a/ios/chrome/app/spotlight/topsites_spotlight_manager.mm +++ b/ios/chrome/app/spotlight/topsites_spotlight_manager.mm
@@ -19,7 +19,7 @@ #import "ios/chrome/app/spotlight/spotlight_logger.h" #import "ios/chrome/browser/bookmarks/model/local_or_syncable_bookmark_model_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h" -#import "ios/chrome/browser/history/top_sites_factory.h" +#import "ios/chrome/browser/history/model/top_sites_factory.h" #import "ios/chrome/browser/sync/model/sync_observer_bridge.h" #import "ios/chrome/browser/sync/model/sync_service_factory.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.h"
diff --git a/ios/chrome/app/strings/ios_strings.grd b/ios/chrome/app/strings/ios_strings.grd index f5c23c1..494d6b73 100644 --- a/ios/chrome/app/strings/ios_strings.grd +++ b/ios/chrome/app/strings/ios_strings.grd
@@ -1887,10 +1887,10 @@ <message name="IDS_IOS_MANUAL_FALLBACK_ADD_PAYMENT_METHOD" desc="The title for the button in the manual fallback UI that takes the user to the add new credit card screen through settings. In this screen, the user can input their card details and save them."> Add Payment Method... </message> - <message name="IDS_IOS_MANUAL_FALLBACK_MANAGE_PASSWORDS" desc="The title for the button in the manual fallback UI that takes the user to the passwords settings. In this screen they see all the passwords and can erase them. Note it is different from IDS_IOS_MANUAL_FALLBACK_USE_OTHER_PASSWORD_WITH_DOTS [30em]"> + <message name="IDS_IOS_MANUAL_FALLBACK_MANAGE_PASSWORDS" desc="The title for the button in the manual fallback UI that takes the user to the passwords settings. In this screen they see all the passwords and can erase them."> Manage Passwords... </message> - <message name="IDS_IOS_MANUAL_FALLBACK_MANAGE_SETTINGS" desc="The title for the button in the manual fallback UI that takes the user to the passwords settings. In this screen they can manage the settings for their passwords. Note it is different from IDS_IOS_MANUAL_FALLBACK_USE_OTHER_PASSWORD_WITH_DOTS [30em]"> + <message name="IDS_IOS_MANUAL_FALLBACK_MANAGE_SETTINGS" desc="The title for the button in the manual fallback UI that takes the user to the passwords settings. In this screen they can manage the settings for their passwords."> Manage Settings... </message> <message name="IDS_IOS_MANUAL_FALLBACK_NO_USERNAME" desc="The title for disabled buttons on the manual fallback passwords UI when a credential doesn't contains a username. [30em]"> @@ -1911,9 +1911,6 @@ <message name="IDS_IOS_MANUAL_FALLBACK_NOT_SECURE_GENERIC_BODY" desc="The body of the alert informing a user the content they selected won't be filled on the form." meaning="The form is not secure [80em]"> To protect your privacy, Chrome will not autofill this field. </message> - <message name="IDS_IOS_MANUAL_FALLBACK_USE_OTHER_PASSWORD" desc="The title for the manual fallback UI with all passwords without filter." meaning="The title for a list where the user is about to select a password or username to be filled in a form [Length: 10em]"> - Passwords - </message> <message name="IDS_IOS_MANUAL_FALLBACK_SELECT_PASSWORD_WITH_DOTS" desc="The title for the button in the manual fallback passwords UI that allows the user to select a saved password from a list, and fill it into the active field. [30em]"> Select Password... </message> @@ -1923,15 +1920,9 @@ <message name="IDS_IOS_MANUAL_FALLBACK_SELECT_PASSWORD_DIALOG_TITLE" desc="The title of a dialog asking the user to confirm they trust the current site before selecting a saved password to fill."> Select Password </message> - <message name="IDS_IOS_MANUAL_FALLBACK_SUGGEST_PASSWORD_WITH_DOTS" desc="The title for the button in the manual fallback passwords UI that is used to trigger password generation on the active field. [30em]"> - Suggest Password... - </message> <message name="IDS_IOS_MANUAL_FALLBACK_SUGGEST_STRONG_PASSWORD_WITH_DOTS" desc="The title for the button in the manual fallback passwords UI that is used to trigger password generation on the active field. 'Strong' refers to the fact that the password is randomly-generated, and thus hard to guess and unlikely to be reused. [30em]"> Suggest Strong Password... </message> - <message name="IDS_IOS_MANUAL_FALLBACK_USE_OTHER_PASSWORD_WITH_DOTS" desc="The title for the button in the manual fallback passwords UI that is used to open a list of all the user credentials where they can select one to fill a form. This button is showed at the same time as a different button with IDS_IOS_MANUAL_FALLBACK_MANAGE_PASSWORDS as title. [30em]"> - Use Other Password... - </message> <message name="IDS_IOS_MANUAL_FALLBACK_MANAGE_CREDIT_CARDS" desc="The title for the button in the manual fallback UI that takes the user to the payments settings. In this screen they see all the credit cards and can erase them. [30em]"> Manage Payment Methods... </message> @@ -3702,14 +3693,6 @@ <message name="IDS_IOS_CANCEL_PASSWORD_EDIT" desc="Cancel button inside confirmation alert when the user is trying to edit password [iOS only]" meaning="Cancels editing"> Cancel </message> - <message name="IDS_IOS_CONFIRM_USING_OTHER_PASSWORD_TITLE" desc="Title for the confirmation dialog which is shown when user wants to use other passwords. [iOS only]"> - Use other password - </message> - <message name="IDS_IOS_CONFIRM_USING_OTHER_PASSWORD_DESCRIPTION" desc="Description for the confirmation dialog which is shown when user wants to use other passwords. [iOS only]"> - If you trust <ph name="TIME">$1<ex>example.com</ex></ph>, you can use a saved password from another site. - -Try to use a unique password for every site. - </message> <message name="IDS_IOS_CONFIRM_USING_OTHER_PASSWORD_CONTINUE" desc="Action button for confirmation dialog which is shown when user wants to use other passwords. [iOS only]" meaning="User acknowledge warning and wants to proceed."> Continue </message>
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_CONFIRM_USING_OTHER_PASSWORD_DESCRIPTION.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_CONFIRM_USING_OTHER_PASSWORD_DESCRIPTION.png.sha1 deleted file mode 100644 index 3f676114..0000000 --- a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_CONFIRM_USING_OTHER_PASSWORD_DESCRIPTION.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -6744fea42c080e6601ed3753cf143707eb381514 \ No newline at end of file
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_CONFIRM_USING_OTHER_PASSWORD_TITLE.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_CONFIRM_USING_OTHER_PASSWORD_TITLE.png.sha1 deleted file mode 100644 index 3f676114..0000000 --- a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_CONFIRM_USING_OTHER_PASSWORD_TITLE.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -6744fea42c080e6601ed3753cf143707eb381514 \ No newline at end of file
diff --git a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_MANUAL_FALLBACK_SUGGEST_PASSWORD_WITH_DOTS.png.sha1 b/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_MANUAL_FALLBACK_SUGGEST_PASSWORD_WITH_DOTS.png.sha1 deleted file mode 100644 index d262e4c..0000000 --- a/ios/chrome/app/strings/ios_strings_grd/IDS_IOS_MANUAL_FALLBACK_SUGGEST_PASSWORD_WITH_DOTS.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -b26737bdec1518d48e1e9998161e37bb4b22ef08 \ No newline at end of file
diff --git a/ios/chrome/browser/application_context/model/BUILD.gn b/ios/chrome/browser/application_context/model/BUILD.gn index e9ee6f3b..fed95415 100644 --- a/ios/chrome/browser/application_context/model/BUILD.gn +++ b/ios/chrome/browser/application_context/model/BUILD.gn
@@ -34,7 +34,7 @@ "//ios/chrome/browser/crash_report/model/breadcrumbs:application_breadcrumbs_logger", "//ios/chrome/browser/default_browser/model:utils", "//ios/chrome/browser/gcm/model", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/metrics/model", "//ios/chrome/browser/policy", "//ios/chrome/browser/prefs/model",
diff --git a/ios/chrome/browser/application_context/model/DEPS b/ios/chrome/browser/application_context/model/DEPS index 71f7e6c1..b1dd4135 100644 --- a/ios/chrome/browser/application_context/model/DEPS +++ b/ios/chrome/browser/application_context/model/DEPS
@@ -4,7 +4,7 @@ "+ios/chrome/browser/crash_report/model", "+ios/chrome/browser/default_browser/model", "+ios/chrome/browser/gcm/model", - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/metrics/model", "+ios/chrome/browser/policy", "+ios/chrome/browser/prefs/model",
diff --git a/ios/chrome/browser/application_context/model/application_context_impl.mm b/ios/chrome/browser/application_context/model/application_context_impl.mm index 96210e6b..dbed894f 100644 --- a/ios/chrome/browser/application_context/model/application_context_impl.mm +++ b/ios/chrome/browser/application_context/model/application_context_impl.mm
@@ -49,7 +49,7 @@ #import "ios/chrome/browser/crash_report/model/breadcrumbs/application_breadcrumbs_logger.h" #import "ios/chrome/browser/default_browser/model/utils.h" #import "ios/chrome/browser/gcm/model/ios_chrome_gcm_profile_service_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/metrics/model/ios_chrome_metrics_services_manager_client.h" #import "ios/chrome/browser/policy/browser_policy_connector_ios.h" #import "ios/chrome/browser/policy/configuration_policy_handler_list_factory.h"
diff --git a/ios/chrome/browser/autocomplete/model/BUILD.gn b/ios/chrome/browser/autocomplete/model/BUILD.gn index 666ad0c..9333021 100644 --- a/ios/chrome/browser/autocomplete/model/BUILD.gn +++ b/ios/chrome/browser/autocomplete/model/BUILD.gn
@@ -41,7 +41,7 @@ "//components/sync", "//components/unified_consent", "//ios/chrome/browser/bookmarks/model", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/search_engines/model", "//ios/chrome/browser/shared/model/application_context", "//ios/chrome/browser/shared/model/browser",
diff --git a/ios/chrome/browser/autocomplete/model/DEPS b/ios/chrome/browser/autocomplete/model/DEPS index f13fbe6..35467bf0 100644 --- a/ios/chrome/browser/autocomplete/model/DEPS +++ b/ios/chrome/browser/autocomplete/model/DEPS
@@ -1,7 +1,7 @@ include_rules = [ "+components/omnibox/resources", "+ios/chrome/browser/bookmarks/model", - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/search_engines/model", "+ios/chrome/browser/signin/model", "+ios/chrome/browser/sync/model",
diff --git a/ios/chrome/browser/autocomplete/model/autocomplete_provider_client_impl.mm b/ios/chrome/browser/autocomplete/model/autocomplete_provider_client_impl.mm index 248a6b52..7894826 100644 --- a/ios/chrome/browser/autocomplete/model/autocomplete_provider_client_impl.mm +++ b/ios/chrome/browser/autocomplete/model/autocomplete_provider_client_impl.mm
@@ -31,8 +31,8 @@ #import "ios/chrome/browser/autocomplete/model/zero_suggest_cache_service_factory.h" #import "ios/chrome/browser/bookmarks/model/account_bookmark_model_factory.h" #import "ios/chrome/browser/bookmarks/model/local_or_syncable_bookmark_model_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" -#import "ios/chrome/browser/history/top_sites_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" +#import "ios/chrome/browser/history/model/top_sites_factory.h" #import "ios/chrome/browser/search_engines/model/template_url_service_factory.h" #import "ios/chrome/browser/shared/model/application_context/application_context.h" #import "ios/chrome/browser/shared/model/browser/browser.h"
diff --git a/ios/chrome/browser/autocomplete/model/in_memory_url_index_factory.cc b/ios/chrome/browser/autocomplete/model/in_memory_url_index_factory.cc index 183f1e4..e530214 100644 --- a/ios/chrome/browser/autocomplete/model/in_memory_url_index_factory.cc +++ b/ios/chrome/browser/autocomplete/model/in_memory_url_index_factory.cc
@@ -12,7 +12,7 @@ #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "components/omnibox/browser/in_memory_url_index.h" #include "ios/chrome/browser/bookmarks/model/local_or_syncable_bookmark_model_factory.h" -#include "ios/chrome/browser/history/history_service_factory.h" +#include "ios/chrome/browser/history/model/history_service_factory.h" #include "ios/chrome/browser/search_engines/model/template_url_service_factory.h" #include "ios/chrome/browser/shared/model/browser_state/browser_state_otr_helper.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h"
diff --git a/ios/chrome/browser/autocomplete/model/shortcuts_backend_factory.mm b/ios/chrome/browser/autocomplete/model/shortcuts_backend_factory.mm index 592927b..2667ea8 100644 --- a/ios/chrome/browser/autocomplete/model/shortcuts_backend_factory.mm +++ b/ios/chrome/browser/autocomplete/model/shortcuts_backend_factory.mm
@@ -12,7 +12,7 @@ #import "components/omnibox/browser/shortcuts_backend.h" #import "components/omnibox/browser/shortcuts_constants.h" #import "components/prefs/pref_service.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/search_engines/model/template_url_service_factory.h" #import "ios/chrome/browser/search_engines/model/ui_thread_search_terms_data.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h"
diff --git a/ios/chrome/browser/autofill/model/BUILD.gn b/ios/chrome/browser/autofill/model/BUILD.gn index af1084c..9d9baf2 100644 --- a/ios/chrome/browser/autofill/model/BUILD.gn +++ b/ios/chrome/browser/autofill/model/BUILD.gn
@@ -57,7 +57,7 @@ "//components/prefs", "//components/sync/service", "//components/variations/service", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/shared/model/application_context", "//ios/chrome/browser/shared/model/browser_state", "//ios/chrome/browser/shared/model/paths",
diff --git a/ios/chrome/browser/autofill/model/DEPS b/ios/chrome/browser/autofill/model/DEPS index 8b78e27..2755a82 100644 --- a/ios/chrome/browser/autofill/model/DEPS +++ b/ios/chrome/browser/autofill/model/DEPS
@@ -1,5 +1,5 @@ include_rules = [ - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/signin/model", "+ios/chrome/browser/sync/model", "+ios/chrome/browser/webdata_services/model",
diff --git a/ios/chrome/browser/autofill/model/autocomplete_history_manager_factory.mm b/ios/chrome/browser/autofill/model/autocomplete_history_manager_factory.mm index b5046b2a..bb92564e 100644 --- a/ios/chrome/browser/autofill/model/autocomplete_history_manager_factory.mm +++ b/ios/chrome/browser/autofill/model/autocomplete_history_manager_factory.mm
@@ -11,7 +11,7 @@ #import "components/autofill/core/browser/webdata/autofill_webdata_service.h" #import "components/keyed_service/core/service_access_type.h" #import "components/keyed_service/ios/browser_state_dependency_manager.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/shared/model/application_context/application_context.h" #import "ios/chrome/browser/shared/model/browser_state/browser_state_otr_helper.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h"
diff --git a/ios/chrome/browser/autofill/model/personal_data_manager_factory.mm b/ios/chrome/browser/autofill/model/personal_data_manager_factory.mm index f126170..62851fb 100644 --- a/ios/chrome/browser/autofill/model/personal_data_manager_factory.mm +++ b/ios/chrome/browser/autofill/model/personal_data_manager_factory.mm
@@ -19,7 +19,7 @@ #import "ios/chrome/browser/autofill/model/autofill_image_fetcher_factory.h" #import "ios/chrome/browser/autofill/model/autofill_image_fetcher_impl.h" #import "ios/chrome/browser/autofill/model/strike_database_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/shared/model/application_context/application_context.h" #import "ios/chrome/browser/shared/model/browser_state/browser_state_otr_helper.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h"
diff --git a/ios/chrome/browser/bookmarks/model/BUILD.gn b/ios/chrome/browser/bookmarks/model/BUILD.gn index f873c30..4ef29110 100644 --- a/ios/chrome/browser/bookmarks/model/BUILD.gn +++ b/ios/chrome/browser/bookmarks/model/BUILD.gn
@@ -35,7 +35,7 @@ "//components/sync_bookmarks", "//components/undo", "//ios/chrome/browser/favicon", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/shared/model/application_context", "//ios/chrome/browser/shared/model/browser_state", "//ios/chrome/browser/signin/model", @@ -45,7 +45,7 @@ ] public_deps = [ ":model_utils" ] allow_circular_includes_from = [ - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", ":model_utils", ] }
diff --git a/ios/chrome/browser/bookmarks/model/DEPS b/ios/chrome/browser/bookmarks/model/DEPS index f0dd747..4ab5aa2 100644 --- a/ios/chrome/browser/bookmarks/model/DEPS +++ b/ios/chrome/browser/bookmarks/model/DEPS
@@ -1,5 +1,5 @@ include_rules = [ - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/favicon", "+ios/chrome/browser/signin/model", ]
diff --git a/ios/chrome/browser/bookmarks/model/account_bookmark_model_factory.cc b/ios/chrome/browser/bookmarks/model/account_bookmark_model_factory.cc index 8ac46220..8025cc2 100644 --- a/ios/chrome/browser/bookmarks/model/account_bookmark_model_factory.cc +++ b/ios/chrome/browser/bookmarks/model/account_bookmark_model_factory.cc
@@ -20,7 +20,7 @@ #include "ios/chrome/browser/bookmarks/model/bookmark_undo_service_factory.h" #include "ios/chrome/browser/bookmarks/model/local_or_syncable_bookmark_model_factory.h" #include "ios/chrome/browser/bookmarks/model/local_or_syncable_bookmark_sync_service_factory.h" -#include "ios/chrome/browser/history/history_service_factory.h" +#include "ios/chrome/browser/history/model/history_service_factory.h" #include "ios/chrome/browser/shared/model/browser_state/browser_state_otr_helper.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #include "ios/web/public/thread/web_task_traits.h"
diff --git a/ios/chrome/browser/bookmarks/model/bookmark_client_impl.cc b/ios/chrome/browser/bookmarks/model/bookmark_client_impl.cc index eca9d9e7..be76976 100644 --- a/ios/chrome/browser/bookmarks/model/bookmark_client_impl.cc +++ b/ios/chrome/browser/bookmarks/model/bookmark_client_impl.cc
@@ -19,7 +19,7 @@ #include "components/sync_bookmarks/bookmark_sync_service.h" #include "components/undo/bookmark_undo_service.h" #include "ios/chrome/browser/favicon/favicon_service_factory.h" -#include "ios/chrome/browser/history/history_service_factory.h" +#include "ios/chrome/browser/history/model/history_service_factory.h" BookmarkClientImpl::BookmarkClientImpl( ChromeBrowserState* browser_state,
diff --git a/ios/chrome/browser/bookmarks/model/local_or_syncable_bookmark_model_factory.cc b/ios/chrome/browser/bookmarks/model/local_or_syncable_bookmark_model_factory.cc index af2a609..e3fa32fe 100644 --- a/ios/chrome/browser/bookmarks/model/local_or_syncable_bookmark_model_factory.cc +++ b/ios/chrome/browser/bookmarks/model/local_or_syncable_bookmark_model_factory.cc
@@ -19,7 +19,7 @@ #include "ios/chrome/browser/bookmarks/model/bookmark_undo_service_factory.h" #include "ios/chrome/browser/bookmarks/model/local_or_syncable_bookmark_sync_service_factory.h" #import "ios/chrome/browser/bookmarks/model/managed_bookmark_service_factory.h" -#include "ios/chrome/browser/history/history_service_factory.h" +#include "ios/chrome/browser/history/model/history_service_factory.h" #include "ios/chrome/browser/shared/model/browser_state/browser_state_otr_helper.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #include "ios/web/public/thread/web_task_traits.h"
diff --git a/ios/chrome/browser/browser_state/model/BUILD.gn b/ios/chrome/browser/browser_state/model/BUILD.gn index cf57cd9..5f65e60 100644 --- a/ios/chrome/browser/browser_state/model/BUILD.gn +++ b/ios/chrome/browser/browser_state/model/BUILD.gn
@@ -93,7 +93,7 @@ "//ios/chrome/browser/follow/model:service_factory", "//ios/chrome/browser/gcm/model", "//ios/chrome/browser/google:google_logo", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/invalidation/model", "//ios/chrome/browser/language/model", "//ios/chrome/browser/mailto_handler/model:mailto_handler_factory", @@ -142,6 +142,7 @@ "//ios/chrome/browser/ui/fullscreen", "//ios/chrome/browser/ui/voice", "//ios/chrome/browser/unified_consent/model", + "//ios/chrome/browser/unit_conversion:unit_conversion_factory", "//ios/chrome/browser/web_state_list/model/web_usage_enabler", "//ios/chrome/browser/webdata_services/model", "//ios/components/cookie_util",
diff --git a/ios/chrome/browser/browser_state/model/browser_state_keyed_service_factories.mm b/ios/chrome/browser/browser_state/model/browser_state_keyed_service_factories.mm index f00f760..90f4ccd 100644 --- a/ios/chrome/browser/browser_state/model/browser_state_keyed_service_factories.mm +++ b/ios/chrome/browser/browser_state/model/browser_state_keyed_service_factories.mm
@@ -36,10 +36,10 @@ #import "ios/chrome/browser/follow/model/follow_service_factory.h" #import "ios/chrome/browser/gcm/model/ios_chrome_gcm_profile_service_factory.h" #import "ios/chrome/browser/google/google_logo_service_factory.h" -#import "ios/chrome/browser/history/domain_diversity_reporter_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" -#import "ios/chrome/browser/history/top_sites_factory.h" -#import "ios/chrome/browser/history/web_history_service_factory.h" +#import "ios/chrome/browser/history/model/domain_diversity_reporter_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" +#import "ios/chrome/browser/history/model/top_sites_factory.h" +#import "ios/chrome/browser/history/model/web_history_service_factory.h" #import "ios/chrome/browser/invalidation/model/ios_chrome_profile_invalidation_provider_factory.h" #import "ios/chrome/browser/language/model/accept_languages_service_factory.h" #import "ios/chrome/browser/language/model/language_model_manager_factory.h" @@ -96,6 +96,7 @@ #import "ios/chrome/browser/trusted_vault/model/ios_trusted_vault_service_factory.h" #import "ios/chrome/browser/ui/voice/text_to_speech_playback_controller_factory.h" #import "ios/chrome/browser/unified_consent/model/unified_consent_service_factory.h" +#import "ios/chrome/browser/unit_conversion/unit_conversion_service_factory.h" #import "ios/chrome/browser/webdata_services/model/web_data_service_factory.h" #if BUILDFLAG(IOS_CREDENTIAL_PROVIDER_ENABLED) @@ -207,6 +208,7 @@ BringAndroidTabsToIOSServiceFactory::GetInstance(); PromosManagerEventExporterFactory::GetInstance(); PlusAddressServiceFactory::GetInstance(); + UnitConversionServiceFactory::GetInstance(); #if BUILDFLAG(IOS_CREDENTIAL_PROVIDER_ENABLED) CredentialProviderServiceFactory::GetInstance();
diff --git a/ios/chrome/browser/browsing_data/model/BUILD.gn b/ios/chrome/browser/browsing_data/model/BUILD.gn index 620ea8e..89e9332 100644 --- a/ios/chrome/browser/browsing_data/model/BUILD.gn +++ b/ios/chrome/browser/browsing_data/model/BUILD.gn
@@ -57,7 +57,7 @@ "//ios/chrome/browser/browser_state/model:ios_thread", "//ios/chrome/browser/crash_report/model", "//ios/chrome/browser/external_files/model", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/https_upgrades/model", "//ios/chrome/browser/language/model", "//ios/chrome/browser/optimization_guide/model",
diff --git a/ios/chrome/browser/browsing_data/model/DEPS b/ios/chrome/browser/browsing_data/model/DEPS index 004fd09..16b01af2 100644 --- a/ios/chrome/browser/browsing_data/model/DEPS +++ b/ios/chrome/browser/browsing_data/model/DEPS
@@ -1,6 +1,6 @@ include_rules = [ "+ios/chrome/browser/browser_state/model/ios_chrome_io_thread.h", - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/passwords/model", "+ios/chrome/browser/sync/model", "+ios/chrome/browser/webdata_services/model",
diff --git a/ios/chrome/browser/browsing_data/model/browsing_data_counter_wrapper.cc b/ios/chrome/browser/browsing_data/model/browsing_data_counter_wrapper.cc index 2548d1e..ddcd0d2 100644 --- a/ios/chrome/browser/browsing_data/model/browsing_data_counter_wrapper.cc +++ b/ios/chrome/browser/browsing_data/model/browsing_data_counter_wrapper.cc
@@ -18,8 +18,8 @@ #include "components/sync/service/sync_service.h" #include "ios/chrome/browser/browsing_data/model/browsing_data_features.h" #include "ios/chrome/browser/browsing_data/model/cache_counter.h" -#include "ios/chrome/browser/history/history_service_factory.h" -#include "ios/chrome/browser/history/web_history_service_factory.h" +#include "ios/chrome/browser/history/model/history_service_factory.h" +#include "ios/chrome/browser/history/model/web_history_service_factory.h" #include "ios/chrome/browser/passwords/model/ios_chrome_account_password_store_factory.h" #include "ios/chrome/browser/passwords/model/ios_chrome_profile_password_store_factory.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h"
diff --git a/ios/chrome/browser/browsing_data/model/browsing_data_remover_impl.mm b/ios/chrome/browser/browsing_data/model/browsing_data_remover_impl.mm index 3c6cb98..0ea02fd 100644 --- a/ios/chrome/browser/browsing_data/model/browsing_data_remover_impl.mm +++ b/ios/chrome/browser/browsing_data/model/browsing_data_remover_impl.mm
@@ -44,8 +44,8 @@ #import "ios/chrome/browser/crash_report/model/crash_helper.h" #import "ios/chrome/browser/external_files/model/external_file_remover.h" #import "ios/chrome/browser/external_files/model/external_file_remover_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" -#import "ios/chrome/browser/history/web_history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" +#import "ios/chrome/browser/history/model/web_history_service_factory.h" #import "ios/chrome/browser/https_upgrades/model/https_upgrade_service_factory.h" #import "ios/chrome/browser/language/model/url_language_histogram_factory.h" #import "ios/chrome/browser/optimization_guide/model/optimization_guide_service.h"
diff --git a/ios/chrome/browser/commerce/model/BUILD.gn b/ios/chrome/browser/commerce/model/BUILD.gn index b04de03..bd43258f 100644 --- a/ios/chrome/browser/commerce/model/BUILD.gn +++ b/ios/chrome/browser/commerce/model/BUILD.gn
@@ -47,7 +47,7 @@ "//components/leveldb_proto", "//components/prefs", "//ios/chrome/browser/bookmarks/model", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/optimization_guide/model", "//ios/chrome/browser/power_bookmarks/model", "//ios/chrome/browser/shared/model/application_context",
diff --git a/ios/chrome/browser/commerce/model/DEPS b/ios/chrome/browser/commerce/model/DEPS index 3e59337..9fd3019b 100644 --- a/ios/chrome/browser/commerce/model/DEPS +++ b/ios/chrome/browser/commerce/model/DEPS
@@ -3,7 +3,7 @@ "+components/commerce/core/proto", "+components/session_proto_db", "+components/commerce/ios/browser", - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/power_bookmarks/model", "+ios/chrome/browser/signin/model", "+ios/chrome/browser/sync/model",
diff --git a/ios/chrome/browser/commerce/model/shopping_service_factory.mm b/ios/chrome/browser/commerce/model/shopping_service_factory.mm index 3a1cba2..8a4918b8 100644 --- a/ios/chrome/browser/commerce/model/shopping_service_factory.mm +++ b/ios/chrome/browser/commerce/model/shopping_service_factory.mm
@@ -16,7 +16,7 @@ #import "ios/chrome/browser/bookmarks/model/account_bookmark_model_factory.h" #import "ios/chrome/browser/bookmarks/model/local_or_syncable_bookmark_model_factory.h" #import "ios/chrome/browser/commerce/model/session_proto_db_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/optimization_guide/model/optimization_guide_service.h" #import "ios/chrome/browser/optimization_guide/model/optimization_guide_service_factory.h" #import "ios/chrome/browser/power_bookmarks/model/power_bookmark_service_factory.h"
diff --git a/ios/chrome/browser/credential_provider/model/BUILD.gn b/ios/chrome/browser/credential_provider/model/BUILD.gn index 8dea3e6..de02915 100644 --- a/ios/chrome/browser/credential_provider/model/BUILD.gn +++ b/ios/chrome/browser/credential_provider/model/BUILD.gn
@@ -80,7 +80,7 @@ "//components/prefs:test_support", "//components/variations:test_support", "//ios/chrome/browser/favicon", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/shared/model/application_context", "//ios/chrome/browser/shared/model/browser_state:test_support", "//ios/chrome/browser/signin/model",
diff --git a/ios/chrome/browser/credential_provider/model/credential_provider_service.mm b/ios/chrome/browser/credential_provider/model/credential_provider_service.mm index e8658a2..c092972 100644 --- a/ios/chrome/browser/credential_provider/model/credential_provider_service.mm +++ b/ios/chrome/browser/credential_provider/model/credential_provider_service.mm
@@ -155,19 +155,6 @@ identity_manager_->AddObserver(this); sync_service_->AddObserver(this); - // This class should usually handle incremental PasswordStore updates in - // OnLoginsChanged(), but there could be bugs. E.g. maybe an update is fired - // before the observer is added. So re-write the data on startup as a - // safeguard. Post a task for performance. - // Note: in reality this re-write does the same IO work as saving a new - // password. The implementations of MutableCredentialStore write *every* - // password to disk, even in OnLoginsChanged(). - base::SequencedTaskRunner::GetCurrentDefault()->PostDelayedTask( - FROM_HERE, - base::BindOnce(&CredentialProviderService::RequestSyncAllCredentials, - weak_ptr_factory_.GetWeakPtr()), - base::Seconds(5)); - saving_passwords_enabled_.Init( password_manager::prefs::kCredentialsEnableService, prefs, base::BindRepeating(
diff --git a/ios/chrome/browser/credential_provider/model/credential_provider_service_unittest.mm b/ios/chrome/browser/credential_provider/model/credential_provider_service_unittest.mm index 7ffdce8b..748c7427 100644 --- a/ios/chrome/browser/credential_provider/model/credential_provider_service_unittest.mm +++ b/ios/chrome/browser/credential_provider/model/credential_provider_service_unittest.mm
@@ -154,27 +154,6 @@ std::unique_ptr<CredentialProviderService> credential_provider_service_; }; -// Test that CredentialProviderService writes all the credentials the first time -// it runs. -TEST_F(CredentialProviderServiceTest, FirstSync) { - password_manager::PasswordForm form; - form.url = GURL("http://g.com"); - form.username_value = u"user"; - form.password_value = u"qwerty123"; - password_store_->AddLogin(form); - base::RunLoop().RunUntilIdle(); - - CreateCredentialProviderService(); - // The first write is delayed. - task_environment_.FastForwardBy(base::Seconds(30)); - base::RunLoop().RunUntilIdle(); - - ASSERT_EQ(credential_store_.credentials.count, 1u); - EXPECT_NSEQ(credential_store_.credentials[0].serviceName, @"g.com"); - EXPECT_NSEQ(credential_store_.credentials[0].user, @"user"); - EXPECT_NSEQ(credential_store_.credentials[0].password, @"qwerty123"); -} - TEST_F(CredentialProviderServiceTest, TwoStores) { password_manager::PasswordForm local_form; local_form.url = GURL("http://local.com");
diff --git a/ios/chrome/browser/favicon/BUILD.gn b/ios/chrome/browser/favicon/BUILD.gn index d346e40..d441911 100644 --- a/ios/chrome/browser/favicon/BUILD.gn +++ b/ios/chrome/browser/favicon/BUILD.gn
@@ -28,7 +28,7 @@ "//components/image_fetcher/core", "//components/image_fetcher/ios", "//components/resources", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/sessions:restoration_observer", "//ios/chrome/browser/sessions:session_restoration_service", "//ios/chrome/browser/sessions:session_restoration_service_factory",
diff --git a/ios/chrome/browser/favicon/DEPS b/ios/chrome/browser/favicon/DEPS index 4036eef..71e8da9 100644 --- a/ios/chrome/browser/favicon/DEPS +++ b/ios/chrome/browser/favicon/DEPS
@@ -1,5 +1,5 @@ include_rules = [ - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/sessions", ]
diff --git a/ios/chrome/browser/favicon/favicon_service_factory.cc b/ios/chrome/browser/favicon/favicon_service_factory.cc index 5a27abb6..98611c04 100644 --- a/ios/chrome/browser/favicon/favicon_service_factory.cc +++ b/ios/chrome/browser/favicon/favicon_service_factory.cc
@@ -9,7 +9,7 @@ #include "components/keyed_service/core/service_access_type.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "ios/chrome/browser/favicon/favicon_client_impl.h" -#include "ios/chrome/browser/history/history_service_factory.h" +#include "ios/chrome/browser/history/model/history_service_factory.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" namespace {
diff --git a/ios/chrome/browser/flags/about_flags.mm b/ios/chrome/browser/flags/about_flags.mm index 09cb586..1c63d892 100644 --- a/ios/chrome/browser/flags/about_flags.mm +++ b/ios/chrome/browser/flags/about_flags.mm
@@ -1105,9 +1105,6 @@ flag_descriptions::kDefaultBrowserIntentsShowSettingsName, flag_descriptions::kDefaultBrowserIntentsShowSettingsDescription, flags_ui::kOsIos, FEATURE_VALUE_TYPE(kDefaultBrowserIntentsShowSettings)}, - {"ios-password-ui-split", flag_descriptions::kIOSPasswordUISplitName, - flag_descriptions::kIOSPasswordUISplitDescription, flags_ui::kOsIos, - FEATURE_VALUE_TYPE(password_manager::features::kIOSPasswordUISplit)}, {"ios-password-bottom-sheet", flag_descriptions::kIOSPasswordBottomSheetName, flag_descriptions::kIOSPasswordBottomSheetDescription, flags_ui::kOsIos, @@ -1357,11 +1354,6 @@ flags_ui::kOsIos, FEATURE_VALUE_TYPE(password_manager::features:: kIOSPasswordSettingsBulkUploadLocalPasswords)}, - {"enable-reading-list-account-storage", - flag_descriptions::kEnableReadingListAccountStorageName, - flag_descriptions::kEnableReadingListAccountStorageDescription, - flags_ui::kOsIos, - FEATURE_VALUE_TYPE(syncer::kReadingListEnableDualReadingListModel)}, {"enable-reading-list-sign-in-promo", flag_descriptions::kEnableReadingListSignInPromoName, flag_descriptions::kEnableReadingListSignInPromoDescription,
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc index ef93adea..518e708 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc
@@ -558,11 +558,6 @@ "Password Manager subpages. Supersedes `Password Manager Auth on Entry` if " "enabled."; -const char kIOSPasswordUISplitName[] = "Password Manager UI Split"; -const char kIOSPasswordUISplitDescription[] = - "Splits Password Settings and " - "Password Manager into two separate UIs."; - const char kIOSSaveToDriveName[] = "IOS Save to Drive"; const char kIOSSaveToDriveDescription[] = "Enables the Save to Drive feature on iOS.";
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h index 74fe3010..82e1f8ab 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h
@@ -479,11 +479,6 @@ extern const char kIOSPasswordAuthOnEntryV2Name[]; extern const char kIOSPasswordAuthOnEntryV2Description[]; -// Title and description for the flag to split password settings and password -// management into two separate UIs. -extern const char kIOSPasswordUISplitName[]; -extern const char kIOSPasswordUISplitDescription[]; - // Title and description for the flag to enable password bottom sheet on IOS. extern const char kIOSPasswordBottomSheetName[]; extern const char kIOSPasswordBottomSheetDescription[];
diff --git a/ios/chrome/browser/follow/model/BUILD.gn b/ios/chrome/browser/follow/model/BUILD.gn index 9868d92d..15ba36d 100644 --- a/ios/chrome/browser/follow/model/BUILD.gn +++ b/ios/chrome/browser/follow/model/BUILD.gn
@@ -66,7 +66,7 @@ "//ios/chrome/browser/feature_engagement/model", "//ios/chrome/browser/follow/model:enums", "//ios/chrome/browser/follow/model:utils", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/shared/model/browser_state", "//ios/chrome/browser/shared/model/url", "//ios/chrome/browser/shared/public/features",
diff --git a/ios/chrome/browser/follow/model/DEPS b/ios/chrome/browser/follow/model/DEPS index c6071e08..d103e24 100644 --- a/ios/chrome/browser/follow/model/DEPS +++ b/ios/chrome/browser/follow/model/DEPS
@@ -1,7 +1,7 @@ include_rules = [ "+ios/chrome/browser/discover_feed", "+ios/chrome/browser/feature_engagement/model", - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/ntp/model/new_tab_page_util.h", "+ios/chrome/browser/search_engines/model/template_url_service_factory.h", "+ios/chrome/browser/signin/model",
diff --git a/ios/chrome/browser/follow/model/follow_tab_helper.mm b/ios/chrome/browser/follow/model/follow_tab_helper.mm index 670e403a..a426dd00 100644 --- a/ios/chrome/browser/follow/model/follow_tab_helper.mm +++ b/ios/chrome/browser/follow/model/follow_tab_helper.mm
@@ -27,7 +27,7 @@ #import "ios/chrome/browser/follow/model/follow_service.h" #import "ios/chrome/browser/follow/model/follow_service_factory.h" #import "ios/chrome/browser/follow/model/follow_util.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/shared/model/url/url_util.h" #import "ios/chrome/browser/shared/public/features/features.h"
diff --git a/ios/chrome/browser/history/BUILD.gn b/ios/chrome/browser/history/BUILD.gn deleted file mode 100644 index 29a9e37..0000000 --- a/ios/chrome/browser/history/BUILD.gn +++ /dev/null
@@ -1,100 +0,0 @@ -# Copyright 2016 The Chromium Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -source_set("history") { - sources = [ - "domain_diversity_reporter_factory.h", - "domain_diversity_reporter_factory.mm", - "history_backend_client_impl.cc", - "history_backend_client_impl.h", - "history_client_impl.cc", - "history_client_impl.h", - "history_service_factory.cc", - "history_service_factory.h", - "top_sites_factory.cc", - "top_sites_factory.h", - "web_history_service_factory.cc", - "web_history_service_factory.h", - ] - deps = [ - ":history_utils", - "//base", - "//components/bookmarks/browser", - "//components/browser_sync", - "//components/dom_distiller/core", - "//components/history/core/browser", - "//components/history/core/common", - "//components/history/ios/browser", - "//components/history/metrics", - "//components/keyed_service/core", - "//components/keyed_service/ios", - "//components/pref_registry", - "//components/prefs", - "//components/sync", - "//components/version_info", - "//ios/chrome/browser/shared/model/browser_state", - "//ios/chrome/browser/shared/model/url:constants", - "//ios/chrome/browser/signin/model", - "//ios/chrome/common", - "//ios/components/webui:url_constants", - "//ios/web", - "//net", - "//url", - ] -} - -source_set("history_utils") { - sources = [ - "history_utils.cc", - "history_utils.h", - ] - deps = [ - "//components/dom_distiller/core", - "//ios/chrome/browser/shared/model/url:constants", - "//ios/components/webui:url_constants", - "//url", - ] -} - -source_set("tab_helper") { - sources = [ - "history_tab_helper.h", - "history_tab_helper.mm", - ] - deps = [ - ":history", - "//base", - "//components/history/core/browser", - "//components/keyed_service/core", - "//components/strings", - "//components/translate/core/browser", - "//components/translate/core/common", - "//ios/chrome/browser/complex_tasks/model", - "//ios/chrome/browser/sessions", - "//ios/chrome/browser/shared/model/browser_state", - "//ios/chrome/browser/shared/model/url:constants", - "//ios/chrome/browser/translate/model", - "//ios/web", - "//ui/base", - "//url", - ] -} - -source_set("unit_tests") { - testonly = true - sources = [ "history_tab_helper_unittest.mm" ] - deps = [ - ":history", - ":tab_helper", - "//base", - "//base/test:test_support", - "//components/history/core/browser", - "//components/keyed_service/core", - "//ios/chrome/browser/shared/model/browser_state:test_support", - "//ios/chrome/browser/shared/model/url:constants", - "//ios/web", - "//ios/web/public/test/fakes", - "//testing/gtest", - ] -}
diff --git a/ios/chrome/browser/history/history_service_factory.h b/ios/chrome/browser/history/history_service_factory.h deleted file mode 100644 index 17b33dd..0000000 --- a/ios/chrome/browser/history/history_service_factory.h +++ /dev/null
@@ -1,55 +0,0 @@ -// Copyright 2015 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_HISTORY_HISTORY_SERVICE_FACTORY_H_ -#define IOS_CHROME_BROWSER_HISTORY_HISTORY_SERVICE_FACTORY_H_ - -#include <memory> - -#include "base/no_destructor.h" -#include "components/keyed_service/ios/browser_state_keyed_service_factory.h" - -class ChromeBrowserState; -enum class ServiceAccessType; - -namespace history { -class HistoryService; -} - -namespace ios { -// Singleton that owns all HistoryServices and associates them with -// ChromeBrowserState. -class HistoryServiceFactory : public BrowserStateKeyedServiceFactory { - public: - static history::HistoryService* GetForBrowserState( - ChromeBrowserState* browser_state, - ServiceAccessType access_type); - static history::HistoryService* GetForBrowserStateIfExists( - ChromeBrowserState* browser_state, - ServiceAccessType access_type); - static HistoryServiceFactory* GetInstance(); - - // Returns the default factory, useful in tests where it's null by default. - static TestingFactory GetDefaultFactory(); - - HistoryServiceFactory(const HistoryServiceFactory&) = delete; - HistoryServiceFactory& operator=(const HistoryServiceFactory&) = delete; - - private: - friend class base::NoDestructor<HistoryServiceFactory>; - - HistoryServiceFactory(); - ~HistoryServiceFactory() override; - - // BrowserStateKeyedServiceFactory implementation. - std::unique_ptr<KeyedService> BuildServiceInstanceFor( - web::BrowserState* context) const override; - web::BrowserState* GetBrowserStateToUse( - web::BrowserState* context) const override; - bool ServiceIsNULLWhileTesting() const override; -}; - -} // namespace ios - -#endif // IOS_CHROME_BROWSER_HISTORY_HISTORY_SERVICE_FACTORY_H_
diff --git a/ios/chrome/browser/history/model/BUILD.gn b/ios/chrome/browser/history/model/BUILD.gn index 8a52c8a..66a99c4 100644 --- a/ios/chrome/browser/history/model/BUILD.gn +++ b/ios/chrome/browser/history/model/BUILD.gn
@@ -1,8 +1,100 @@ -# Copyright 2023 The Chromium Authors +# Copyright 2016 The Chromium Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. source_set("model") { - sources = [ "history_service_factory.h" ] - public_deps = [ "//ios/chrome/browser/history" ] + sources = [ + "domain_diversity_reporter_factory.h", + "domain_diversity_reporter_factory.mm", + "history_backend_client_impl.cc", + "history_backend_client_impl.h", + "history_client_impl.cc", + "history_client_impl.h", + "history_service_factory.cc", + "history_service_factory.h", + "top_sites_factory.cc", + "top_sites_factory.h", + "web_history_service_factory.cc", + "web_history_service_factory.h", + ] + deps = [ + ":utils", + "//base", + "//components/bookmarks/browser", + "//components/browser_sync", + "//components/dom_distiller/core", + "//components/history/core/browser", + "//components/history/core/common", + "//components/history/ios/browser", + "//components/history/metrics", + "//components/keyed_service/core", + "//components/keyed_service/ios", + "//components/pref_registry", + "//components/prefs", + "//components/sync", + "//components/version_info", + "//ios/chrome/browser/shared/model/browser_state", + "//ios/chrome/browser/shared/model/url:constants", + "//ios/chrome/browser/signin/model", + "//ios/chrome/common", + "//ios/components/webui:url_constants", + "//ios/web", + "//net", + "//url", + ] +} + +source_set("utils") { + sources = [ + "history_utils.cc", + "history_utils.h", + ] + deps = [ + "//components/dom_distiller/core", + "//ios/chrome/browser/shared/model/url:constants", + "//ios/components/webui:url_constants", + "//url", + ] +} + +source_set("tab_helper") { + sources = [ + "history_tab_helper.h", + "history_tab_helper.mm", + ] + deps = [ + ":model", + "//base", + "//components/history/core/browser", + "//components/keyed_service/core", + "//components/strings", + "//components/translate/core/browser", + "//components/translate/core/common", + "//ios/chrome/browser/complex_tasks/model", + "//ios/chrome/browser/sessions", + "//ios/chrome/browser/shared/model/browser_state", + "//ios/chrome/browser/shared/model/url:constants", + "//ios/chrome/browser/translate/model", + "//ios/web", + "//ui/base", + "//url", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ "history_tab_helper_unittest.mm" ] + deps = [ + ":model", + ":tab_helper", + "//base", + "//base/test:test_support", + "//components/history/core/browser", + "//components/keyed_service/core", + "//ios/chrome/browser/shared/model/browser_state:test_support", + "//ios/chrome/browser/shared/model/url:constants", + "//ios/web", + "//ios/web/public/test/fakes", + "//testing/gtest", + ] }
diff --git a/ios/chrome/browser/history/DEPS b/ios/chrome/browser/history/model/DEPS similarity index 100% rename from ios/chrome/browser/history/DEPS rename to ios/chrome/browser/history/model/DEPS
diff --git a/ios/chrome/browser/history/OWNERS b/ios/chrome/browser/history/model/OWNERS similarity index 100% rename from ios/chrome/browser/history/OWNERS rename to ios/chrome/browser/history/model/OWNERS
diff --git a/ios/chrome/browser/history/domain_diversity_reporter_factory.h b/ios/chrome/browser/history/model/domain_diversity_reporter_factory.h similarity index 85% rename from ios/chrome/browser/history/domain_diversity_reporter_factory.h rename to ios/chrome/browser/history/model/domain_diversity_reporter_factory.h index f5ee4ee..243c23f 100644 --- a/ios/chrome/browser/history/domain_diversity_reporter_factory.h +++ b/ios/chrome/browser/history/model/domain_diversity_reporter_factory.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef IOS_CHROME_BROWSER_HISTORY_DOMAIN_DIVERSITY_REPORTER_FACTORY_H_ -#define IOS_CHROME_BROWSER_HISTORY_DOMAIN_DIVERSITY_REPORTER_FACTORY_H_ +#ifndef IOS_CHROME_BROWSER_HISTORY_MODEL_DOMAIN_DIVERSITY_REPORTER_FACTORY_H_ +#define IOS_CHROME_BROWSER_HISTORY_MODEL_DOMAIN_DIVERSITY_REPORTER_FACTORY_H_ #include <memory> @@ -48,4 +48,4 @@ bool ServiceIsCreatedWithBrowserState() const override; }; -#endif // IOS_CHROME_BROWSER_HISTORY_DOMAIN_DIVERSITY_REPORTER_FACTORY_H_ \ No newline at end of file +#endif // IOS_CHROME_BROWSER_HISTORY_MODEL_DOMAIN_DIVERSITY_REPORTER_FACTORY_H_ \ No newline at end of file
diff --git a/ios/chrome/browser/history/domain_diversity_reporter_factory.mm b/ios/chrome/browser/history/model/domain_diversity_reporter_factory.mm similarity index 94% rename from ios/chrome/browser/history/domain_diversity_reporter_factory.mm rename to ios/chrome/browser/history/model/domain_diversity_reporter_factory.mm index 6e60020..dcff859 100644 --- a/ios/chrome/browser/history/domain_diversity_reporter_factory.mm +++ b/ios/chrome/browser/history/model/domain_diversity_reporter_factory.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "ios/chrome/browser/history/domain_diversity_reporter_factory.h" +#import "ios/chrome/browser/history/model/domain_diversity_reporter_factory.h" #import "base/functional/bind.h" #import "base/no_destructor.h" @@ -13,7 +13,7 @@ #import "components/keyed_service/ios/browser_state_dependency_manager.h" #import "components/pref_registry/pref_registry_syncable.h" #import "components/prefs/pref_service.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/shared/model/browser_state/browser_state_otr_helper.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h"
diff --git a/ios/chrome/browser/history/history_backend_client_impl.cc b/ios/chrome/browser/history/model/history_backend_client_impl.cc similarity index 96% rename from ios/chrome/browser/history/history_backend_client_impl.cc rename to ios/chrome/browser/history/model/history_backend_client_impl.cc index 32d4f583..3948635c 100644 --- a/ios/chrome/browser/history/history_backend_client_impl.cc +++ b/ios/chrome/browser/history/model/history_backend_client_impl.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/chrome/browser/history/history_backend_client_impl.h" +#include "ios/chrome/browser/history/model/history_backend_client_impl.h" #include "base/check.h" #include "base/containers/contains.h"
diff --git a/ios/chrome/browser/history/history_backend_client_impl.h b/ios/chrome/browser/history/model/history_backend_client_impl.h similarity index 83% rename from ios/chrome/browser/history/history_backend_client_impl.h rename to ios/chrome/browser/history/model/history_backend_client_impl.h index 00bc6d4..27294f6 100644 --- a/ios/chrome/browser/history/history_backend_client_impl.h +++ b/ios/chrome/browser/history/model/history_backend_client_impl.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef IOS_CHROME_BROWSER_HISTORY_HISTORY_BACKEND_CLIENT_IMPL_H_ -#define IOS_CHROME_BROWSER_HISTORY_HISTORY_BACKEND_CLIENT_IMPL_H_ +#ifndef IOS_CHROME_BROWSER_HISTORY_MODEL_HISTORY_BACKEND_CLIENT_IMPL_H_ +#define IOS_CHROME_BROWSER_HISTORY_MODEL_HISTORY_BACKEND_CLIENT_IMPL_H_ #include <vector> @@ -36,4 +36,4 @@ std::vector<scoped_refptr<bookmarks::ModelLoader>> model_loaders_; }; -#endif // IOS_CHROME_BROWSER_HISTORY_HISTORY_BACKEND_CLIENT_IMPL_H_ +#endif // IOS_CHROME_BROWSER_HISTORY_MODEL_HISTORY_BACKEND_CLIENT_IMPL_H_
diff --git a/ios/chrome/browser/history/history_client_impl.cc b/ios/chrome/browser/history/model/history_client_impl.cc similarity index 96% rename from ios/chrome/browser/history/history_client_impl.cc rename to ios/chrome/browser/history/model/history_client_impl.cc index 0c456be..427a9fa7 100644 --- a/ios/chrome/browser/history/history_client_impl.cc +++ b/ios/chrome/browser/history/model/history_client_impl.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/chrome/browser/history/history_client_impl.h" +#include "ios/chrome/browser/history/model/history_client_impl.h" #include <set> @@ -14,8 +14,8 @@ #include "components/bookmarks/browser/bookmark_utils.h" #include "components/bookmarks/browser/model_loader.h" #include "components/history/core/browser/history_service.h" -#include "ios/chrome/browser/history/history_backend_client_impl.h" -#include "ios/chrome/browser/history/history_utils.h" +#include "ios/chrome/browser/history/model/history_backend_client_impl.h" +#include "ios/chrome/browser/history/model/history_utils.h" #include "url/gurl.h" HistoryClientImpl::HistoryClientImpl(
diff --git a/ios/chrome/browser/history/history_client_impl.h b/ios/chrome/browser/history/model/history_client_impl.h similarity index 94% rename from ios/chrome/browser/history/history_client_impl.h rename to ios/chrome/browser/history/model/history_client_impl.h index 9d38291a..40f26eb 100644 --- a/ios/chrome/browser/history/history_client_impl.h +++ b/ios/chrome/browser/history/model/history_client_impl.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef IOS_CHROME_BROWSER_HISTORY_HISTORY_CLIENT_IMPL_H_ -#define IOS_CHROME_BROWSER_HISTORY_HISTORY_CLIENT_IMPL_H_ +#ifndef IOS_CHROME_BROWSER_HISTORY_MODEL_HISTORY_CLIENT_IMPL_H_ +#define IOS_CHROME_BROWSER_HISTORY_MODEL_HISTORY_CLIENT_IMPL_H_ #include <memory> #include <set> @@ -85,4 +85,4 @@ bookmark_model_observations_{this}; }; -#endif // IOS_CHROME_BROWSER_HISTORY_HISTORY_CLIENT_IMPL_H_ +#endif // IOS_CHROME_BROWSER_HISTORY_MODEL_HISTORY_CLIENT_IMPL_H_
diff --git a/ios/chrome/browser/history/history_service_factory.cc b/ios/chrome/browser/history/model/history_service_factory.cc similarity index 96% rename from ios/chrome/browser/history/history_service_factory.cc rename to ios/chrome/browser/history/model/history_service_factory.cc index 5a542b7..4582996 100644 --- a/ios/chrome/browser/history/history_service_factory.cc +++ b/ios/chrome/browser/history/model/history_service_factory.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/chrome/browser/history/history_service_factory.h" +#include "ios/chrome/browser/history/model/history_service_factory.h" #include <utility> @@ -17,7 +17,7 @@ #include "components/prefs/pref_service.h" #include "ios/chrome/browser/bookmarks/model/account_bookmark_model_factory.h" #include "ios/chrome/browser/bookmarks/model/local_or_syncable_bookmark_model_factory.h" -#include "ios/chrome/browser/history/history_client_impl.h" +#include "ios/chrome/browser/history/model/history_client_impl.h" #include "ios/chrome/browser/shared/model/browser_state/browser_state_otr_helper.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #include "ios/chrome/common/channel_info.h"
diff --git a/ios/chrome/browser/history/model/history_service_factory.h b/ios/chrome/browser/history/model/history_service_factory.h index 0a548a2..ebd48c00 100644 --- a/ios/chrome/browser/history/model/history_service_factory.h +++ b/ios/chrome/browser/history/model/history_service_factory.h
@@ -1,10 +1,55 @@ -// Copyright 2023 The Chromium Authors +// Copyright 2015 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef IOS_CHROME_BROWSER_HISTORY_MODEL_HISTORY_SERVICE_FACTORY_H_ #define IOS_CHROME_BROWSER_HISTORY_MODEL_HISTORY_SERVICE_FACTORY_H_ -#import "ios/chrome/browser/history/history_service_factory.h" +#include <memory> + +#include "base/no_destructor.h" +#include "components/keyed_service/ios/browser_state_keyed_service_factory.h" + +class ChromeBrowserState; +enum class ServiceAccessType; + +namespace history { +class HistoryService; +} + +namespace ios { +// Singleton that owns all HistoryServices and associates them with +// ChromeBrowserState. +class HistoryServiceFactory : public BrowserStateKeyedServiceFactory { + public: + static history::HistoryService* GetForBrowserState( + ChromeBrowserState* browser_state, + ServiceAccessType access_type); + static history::HistoryService* GetForBrowserStateIfExists( + ChromeBrowserState* browser_state, + ServiceAccessType access_type); + static HistoryServiceFactory* GetInstance(); + + // Returns the default factory, useful in tests where it's null by default. + static TestingFactory GetDefaultFactory(); + + HistoryServiceFactory(const HistoryServiceFactory&) = delete; + HistoryServiceFactory& operator=(const HistoryServiceFactory&) = delete; + + private: + friend class base::NoDestructor<HistoryServiceFactory>; + + HistoryServiceFactory(); + ~HistoryServiceFactory() override; + + // BrowserStateKeyedServiceFactory implementation. + std::unique_ptr<KeyedService> BuildServiceInstanceFor( + web::BrowserState* context) const override; + web::BrowserState* GetBrowserStateToUse( + web::BrowserState* context) const override; + bool ServiceIsNULLWhileTesting() const override; +}; + +} // namespace ios #endif // IOS_CHROME_BROWSER_HISTORY_MODEL_HISTORY_SERVICE_FACTORY_H_
diff --git a/ios/chrome/browser/history/history_tab_helper.h b/ios/chrome/browser/history/model/history_tab_helper.h similarity index 95% rename from ios/chrome/browser/history/history_tab_helper.h rename to ios/chrome/browser/history/model/history_tab_helper.h index ba03702..c5fa5ce6 100644 --- a/ios/chrome/browser/history/history_tab_helper.h +++ b/ios/chrome/browser/history/model/history_tab_helper.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef IOS_CHROME_BROWSER_HISTORY_HISTORY_TAB_HELPER_H_ -#define IOS_CHROME_BROWSER_HISTORY_HISTORY_TAB_HELPER_H_ +#ifndef IOS_CHROME_BROWSER_HISTORY_MODEL_HISTORY_TAB_HELPER_H_ +#define IOS_CHROME_BROWSER_HISTORY_MODEL_HISTORY_TAB_HELPER_H_ #include <vector> @@ -118,4 +118,4 @@ WEB_STATE_USER_DATA_KEY_DECL(); }; -#endif // IOS_CHROME_BROWSER_HISTORY_HISTORY_TAB_HELPER_H_ +#endif // IOS_CHROME_BROWSER_HISTORY_MODEL_HISTORY_TAB_HELPER_H_
diff --git a/ios/chrome/browser/history/history_tab_helper.mm b/ios/chrome/browser/history/model/history_tab_helper.mm similarity index 98% rename from ios/chrome/browser/history/history_tab_helper.mm rename to ios/chrome/browser/history/model/history_tab_helper.mm index 097e4976..a1f8a014 100644 --- a/ios/chrome/browser/history/history_tab_helper.mm +++ b/ios/chrome/browser/history/model/history_tab_helper.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "ios/chrome/browser/history/history_tab_helper.h" +#import "ios/chrome/browser/history/model/history_tab_helper.h" #import "base/memory/ptr_util.h" #import "components/history/core/browser/history_constants.h" @@ -12,7 +12,7 @@ #import "components/translate/core/common/language_detection_details.h" #import "ios/chrome/browser/complex_tasks/model/ios_content_record_task_id.h" #import "ios/chrome/browser/complex_tasks/model/ios_task_tab_helper.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/sessions/ios_chrome_session_tab_helper.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/shared/model/url/chrome_url_constants.h"
diff --git a/ios/chrome/browser/history/history_tab_helper_unittest.mm b/ios/chrome/browser/history/model/history_tab_helper_unittest.mm similarity index 98% rename from ios/chrome/browser/history/history_tab_helper_unittest.mm rename to ios/chrome/browser/history/model/history_tab_helper_unittest.mm index a5cd9cd5..f0c3c11 100644 --- a/ios/chrome/browser/history/history_tab_helper_unittest.mm +++ b/ios/chrome/browser/history/model/history_tab_helper_unittest.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "ios/chrome/browser/history/history_tab_helper.h" +#import "ios/chrome/browser/history/model/history_tab_helper.h" #import "base/functional/bind.h" #import "base/functional/callback.h" @@ -12,7 +12,7 @@ #import "base/test/task_environment.h" #import "components/history/core/browser/history_service.h" #import "components/keyed_service/core/service_access_type.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h" #import "ios/chrome/browser/shared/model/url/chrome_url_constants.h" #import "ios/web/public/navigation/navigation_item.h"
diff --git a/ios/chrome/browser/history/history_utils.cc b/ios/chrome/browser/history/model/history_utils.cc similarity index 95% rename from ios/chrome/browser/history/history_utils.cc rename to ios/chrome/browser/history/model/history_utils.cc index bc9b915..5661b6c 100644 --- a/ios/chrome/browser/history/history_utils.cc +++ b/ios/chrome/browser/history/model/history_utils.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/chrome/browser/history/history_utils.h" +#include "ios/chrome/browser/history/model/history_utils.h" #include "components/dom_distiller/core/url_constants.h" #include "ios/chrome/browser/shared/model/url/chrome_url_constants.h"
diff --git a/ios/chrome/browser/history/history_utils.h b/ios/chrome/browser/history/model/history_utils.h similarity index 67% rename from ios/chrome/browser/history/history_utils.h rename to ios/chrome/browser/history/model/history_utils.h index 9792bce..7e1f38eb 100644 --- a/ios/chrome/browser/history/history_utils.h +++ b/ios/chrome/browser/history/model/history_utils.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef IOS_CHROME_BROWSER_HISTORY_HISTORY_UTILS_H_ -#define IOS_CHROME_BROWSER_HISTORY_HISTORY_UTILS_H_ +#ifndef IOS_CHROME_BROWSER_HISTORY_MODEL_HISTORY_UTILS_H_ +#define IOS_CHROME_BROWSER_HISTORY_MODEL_HISTORY_UTILS_H_ class GURL; @@ -15,4 +15,4 @@ } // namespace ios -#endif // IOS_CHROME_BROWSER_HISTORY_HISTORY_UTILS_H_ +#endif // IOS_CHROME_BROWSER_HISTORY_MODEL_HISTORY_UTILS_H_
diff --git a/ios/chrome/browser/history/top_sites_factory.cc b/ios/chrome/browser/history/model/top_sites_factory.cc similarity index 92% rename from ios/chrome/browser/history/top_sites_factory.cc rename to ios/chrome/browser/history/model/top_sites_factory.cc index 28f59858..a382d4d 100644 --- a/ios/chrome/browser/history/top_sites_factory.cc +++ b/ios/chrome/browser/history/model/top_sites_factory.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/chrome/browser/history/top_sites_factory.h" +#include "ios/chrome/browser/history/model/top_sites_factory.h" #include <memory> @@ -14,8 +14,8 @@ #include "components/keyed_service/core/service_access_type.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" #include "components/pref_registry/pref_registry_syncable.h" -#include "ios/chrome/browser/history/history_service_factory.h" -#include "ios/chrome/browser/history/history_utils.h" +#include "ios/chrome/browser/history/model/history_service_factory.h" +#include "ios/chrome/browser/history/model/history_utils.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #include "ios/web/public/thread/web_thread.h"
diff --git a/ios/chrome/browser/history/top_sites_factory.h b/ios/chrome/browser/history/model/top_sites_factory.h similarity index 87% rename from ios/chrome/browser/history/top_sites_factory.h rename to ios/chrome/browser/history/model/top_sites_factory.h index d7970df91..16b14ad 100644 --- a/ios/chrome/browser/history/top_sites_factory.h +++ b/ios/chrome/browser/history/model/top_sites_factory.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef IOS_CHROME_BROWSER_HISTORY_TOP_SITES_FACTORY_H_ -#define IOS_CHROME_BROWSER_HISTORY_TOP_SITES_FACTORY_H_ +#ifndef IOS_CHROME_BROWSER_HISTORY_MODEL_TOP_SITES_FACTORY_H_ +#define IOS_CHROME_BROWSER_HISTORY_MODEL_TOP_SITES_FACTORY_H_ #include "base/memory/ref_counted.h" #include "base/no_destructor.h" @@ -43,4 +43,4 @@ } // namespace ios -#endif // IOS_CHROME_BROWSER_HISTORY_TOP_SITES_FACTORY_H_ +#endif // IOS_CHROME_BROWSER_HISTORY_MODEL_TOP_SITES_FACTORY_H_
diff --git a/ios/chrome/browser/history/web_history_service_factory.cc b/ios/chrome/browser/history/model/web_history_service_factory.cc similarity index 97% rename from ios/chrome/browser/history/web_history_service_factory.cc rename to ios/chrome/browser/history/model/web_history_service_factory.cc index fb0613d3..564f6ee 100644 --- a/ios/chrome/browser/history/web_history_service_factory.cc +++ b/ios/chrome/browser/history/model/web_history_service_factory.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/chrome/browser/history/web_history_service_factory.h" +#include "ios/chrome/browser/history/model/web_history_service_factory.h" #include "base/no_destructor.h" #include "components/history/core/browser/web_history_service.h"
diff --git a/ios/chrome/browser/history/web_history_service_factory.h b/ios/chrome/browser/history/model/web_history_service_factory.h similarity index 84% rename from ios/chrome/browser/history/web_history_service_factory.h rename to ios/chrome/browser/history/model/web_history_service_factory.h index 083f2b2..6df5bd7 100644 --- a/ios/chrome/browser/history/web_history_service_factory.h +++ b/ios/chrome/browser/history/model/web_history_service_factory.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef IOS_CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_ -#define IOS_CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_ +#ifndef IOS_CHROME_BROWSER_HISTORY_MODEL_WEB_HISTORY_SERVICE_FACTORY_H_ +#define IOS_CHROME_BROWSER_HISTORY_MODEL_WEB_HISTORY_SERVICE_FACTORY_H_ #include <memory> @@ -41,4 +41,4 @@ } // namespace ios -#endif // IOS_CHROME_BROWSER_HISTORY_WEB_HISTORY_SERVICE_FACTORY_H_ +#endif // IOS_CHROME_BROWSER_HISTORY_MODEL_WEB_HISTORY_SERVICE_FACTORY_H_
diff --git a/ios/chrome/browser/metrics/model/BUILD.gn b/ios/chrome/browser/metrics/model/BUILD.gn index 9284834..174cdb6 100644 --- a/ios/chrome/browser/metrics/model/BUILD.gn +++ b/ios/chrome/browser/metrics/model/BUILD.gn
@@ -123,7 +123,7 @@ "//ios/chrome/app/application_delegate:app_state_header", "//ios/chrome/browser/crash_report/model", "//ios/chrome/browser/default_browser/model:utils", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/sessions:restoration_observer", "//ios/chrome/browser/sessions:session_restoration_service", "//ios/chrome/browser/sessions:session_restoration_service_factory",
diff --git a/ios/chrome/browser/metrics/model/DEPS b/ios/chrome/browser/metrics/model/DEPS index 1d8fbda..12dd121 100644 --- a/ios/chrome/browser/metrics/model/DEPS +++ b/ios/chrome/browser/metrics/model/DEPS
@@ -1,5 +1,5 @@ include_rules = [ - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/sync/model", "+ios/chrome/browser/sessions", "+ios/chrome/browser/shared/ui/util/uikit_ui_util.h",
diff --git a/ios/chrome/browser/metrics/model/ios_chrome_metrics_service_client.mm b/ios/chrome/browser/metrics/model/ios_chrome_metrics_service_client.mm index a26430f..ad727dd9 100644 --- a/ios/chrome/browser/metrics/model/ios_chrome_metrics_service_client.mm +++ b/ios/chrome/browser/metrics/model/ios_chrome_metrics_service_client.mm
@@ -62,7 +62,7 @@ #import "components/variations/variations_associated_data.h" #import "components/version_info/version_info.h" #import "google_apis/google_api_keys.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/metrics/model/chrome_browser_state_client.h" #import "ios/chrome/browser/metrics/model/ios_chrome_default_browser_metrics_provider.h" #import "ios/chrome/browser/metrics/model/ios_chrome_signin_and_sync_status_metrics_provider.h"
diff --git a/ios/chrome/browser/ntp_tiles/model/BUILD.gn b/ios/chrome/browser/ntp_tiles/model/BUILD.gn index ef9dadd2..277bf127 100644 --- a/ios/chrome/browser/ntp_tiles/model/BUILD.gn +++ b/ios/chrome/browser/ntp_tiles/model/BUILD.gn
@@ -19,7 +19,7 @@ "//components/keyed_service/core", "//components/ntp_tiles", "//ios/chrome/browser/favicon", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/json_parser", "//ios/chrome/browser/search_engines/model", "//ios/chrome/browser/shared/model/application_context",
diff --git a/ios/chrome/browser/ntp_tiles/model/DEPS b/ios/chrome/browser/ntp_tiles/model/DEPS index ed89255..e261941 100644 --- a/ios/chrome/browser/ntp_tiles/model/DEPS +++ b/ios/chrome/browser/ntp_tiles/model/DEPS
@@ -1,6 +1,6 @@ include_rules = [ "+ios/chrome/browser/favicon", - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/search_engines/model", ]
diff --git a/ios/chrome/browser/ntp_tiles/model/ios_most_visited_sites_factory.cc b/ios/chrome/browser/ntp_tiles/model/ios_most_visited_sites_factory.cc index cbdaa83..17b14df 100644 --- a/ios/chrome/browser/ntp_tiles/model/ios_most_visited_sites_factory.cc +++ b/ios/chrome/browser/ntp_tiles/model/ios_most_visited_sites_factory.cc
@@ -12,7 +12,7 @@ #include "components/ntp_tiles/most_visited_sites.h" #include "ios/chrome/browser/favicon/favicon_service_factory.h" #include "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h" -#include "ios/chrome/browser/history/top_sites_factory.h" +#include "ios/chrome/browser/history/model/top_sites_factory.h" #include "ios/chrome/browser/ntp_tiles/model/ios_popular_sites_factory.h" #include "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #include "services/data_decoder/public/cpp/data_decoder.h"
diff --git a/ios/chrome/browser/passwords/model/ios_chrome_password_manager_client.h b/ios/chrome/browser/passwords/model/ios_chrome_password_manager_client.h index 4bbb354..495c2b94 100644 --- a/ios/chrome/browser/passwords/model/ios_chrome_password_manager_client.h +++ b/ios/chrome/browser/passwords/model/ios_chrome_password_manager_client.h
@@ -122,7 +122,6 @@ password_manager::CredentialLeakType leak_type, const GURL& origin, const std::u16string& username) override; - void NotifyKeychainError() override; bool IsSavingAndFillingEnabled(const GURL& url) const override; bool IsFillingEnabled(const GURL& url) const override; bool IsCommittedMainFrameSecure() const override;
diff --git a/ios/chrome/browser/passwords/model/ios_chrome_password_manager_client.mm b/ios/chrome/browser/passwords/model/ios_chrome_password_manager_client.mm index bbbe7e0b..62d6dee 100644 --- a/ios/chrome/browser/passwords/model/ios_chrome_password_manager_client.mm +++ b/ios/chrome/browser/passwords/model/ios_chrome_password_manager_client.mm
@@ -243,8 +243,6 @@ username:username]; } -void IOSChromePasswordManagerClient::NotifyKeychainError() {} - bool IOSChromePasswordManagerClient::IsSavingAndFillingEnabled( const GURL& url) const { return *saving_passwords_enabled_ && !IsOffTheRecord() &&
diff --git a/ios/chrome/browser/policy/policy_egtest.mm b/ios/chrome/browser/policy/policy_egtest.mm index 5db56d54..66e515e 100644 --- a/ios/chrome/browser/policy/policy_egtest.mm +++ b/ios/chrome/browser/policy/policy_egtest.mm
@@ -10,7 +10,6 @@ #import "components/autofill/core/common/autofill_prefs.h" #import "components/enterprise/browser/enterprise_switches.h" #import "components/history/core/common/pref_names.h" -#import "components/password_manager/core/common/password_manager_features.h" #import "components/password_manager/core/common/password_manager_pref_names.h" #import "components/policy/core/common/cloud/cloud_policy_constants.h" #import "components/policy/core/common/policy_loader_ios_constants.h" @@ -159,8 +158,6 @@ // "com.apple.configuration.managed" key. AppLaunchConfiguration config = [super appConfigurationForTestCase]; config.relaunch_policy = NoForceRelaunchAndResetState; - config.features_enabled.push_back( - password_manager::features::kIOSPasswordUISplit); if ([self isRunningTest:@selector(testPopupMenuItemWithUserPolicy)] || [self isRunningTest:@selector(testManagementPageManagedWithUserPolicy)]) {
diff --git a/ios/chrome/browser/prerender/model/BUILD.gn b/ios/chrome/browser/prerender/model/BUILD.gn index 275f5ed..209dd3d7 100644 --- a/ios/chrome/browser/prerender/model/BUILD.gn +++ b/ios/chrome/browser/prerender/model/BUILD.gn
@@ -37,7 +37,7 @@ "//ios/chrome/browser/crash_report/model:model_internal", "//ios/chrome/browser/download/model:mime_types", "//ios/chrome/browser/geolocation/model", - "//ios/chrome/browser/history:tab_helper", + "//ios/chrome/browser/history/model:tab_helper", "//ios/chrome/browser/itunes_urls/model", "//ios/chrome/browser/net", "//ios/chrome/browser/ntp/model:util",
diff --git a/ios/chrome/browser/prerender/model/DEPS b/ios/chrome/browser/prerender/model/DEPS index a6a6fc43..b2170a0f 100644 --- a/ios/chrome/browser/prerender/model/DEPS +++ b/ios/chrome/browser/prerender/model/DEPS
@@ -3,7 +3,7 @@ "+ios/chrome/browser/app_launcher/model", "+ios/chrome/browser/crash_report/model", "+ios/chrome/browser/download/model", - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/itunes_urls/model", "+ios/chrome/browser/signin/model", "+ios/chrome/browser/supervised_user/model",
diff --git a/ios/chrome/browser/prerender/model/preload_controller.mm b/ios/chrome/browser/prerender/model/preload_controller.mm index 4f7bf4fd..323d30d 100644 --- a/ios/chrome/browser/prerender/model/preload_controller.mm +++ b/ios/chrome/browser/prerender/model/preload_controller.mm
@@ -20,7 +20,7 @@ #import "ios/chrome/browser/app_launcher/model/app_launcher_tab_helper.h" #import "ios/chrome/browser/crash_report/model/crash_report_helper.h" #import "ios/chrome/browser/download/model/mime_type_util.h" -#import "ios/chrome/browser/history/history_tab_helper.h" +#import "ios/chrome/browser/history/model/history_tab_helper.h" #import "ios/chrome/browser/itunes_urls/model/itunes_urls_handler_tab_helper.h" #import "ios/chrome/browser/prerender/model/preload_controller_delegate.h" #import "ios/chrome/browser/prerender/model/prerender_pref.h" @@ -71,9 +71,6 @@ // The name of the histogram for recording final status (e.g. used/cancelled) // of prerender requests. const char kPrerenderFinalStatusHistogramName[] = "Prerender.FinalStatus"; -// The name of the histogram for recording the number of successful prerenders. -const char kPrerendersPerSessionCountHistogramName[] = - "Prerender.PrerendersPerSessionCount"; // The name of the histogram for recording time until a successful prerender. const char kPrerenderPrerenderTimeSaved[] = "Prerender.PrerenderTimeSaved"; // Histogram to record that the load was complete when the prerender was used. @@ -297,10 +294,6 @@ // Whether or not the current connection is using WWAN. @property(nonatomic, assign) BOOL isOnCellularNetwork; -// Number of successful prerenders (i.e. the user viewed the prerendered page) -// during the lifetime of this controller. -@property(nonatomic) NSUInteger successfulPrerendersPerSessionCount; - // Tracks the time of the last attempt to load a prerender URL. Used for UMA // reporting of load durations. @property(nonatomic) base::TimeTicks startTime; @@ -363,8 +356,6 @@ } - (void)dealloc { - UMA_HISTOGRAM_COUNTS_1M(kPrerendersPerSessionCountHistogramName, - self.successfulPrerendersPerSessionCount); [self cancelPrerender]; } @@ -470,7 +461,6 @@ return nullptr; } - self.successfulPrerendersPerSessionCount++; [self recordReleaseMetrics]; [self removeScheduledPrerenderRequests];
diff --git a/ios/chrome/browser/promos_manager/promos_manager_impl.h b/ios/chrome/browser/promos_manager/promos_manager_impl.h index 9c5053c..c7705de 100644 --- a/ios/chrome/browser/promos_manager/promos_manager_impl.h +++ b/ios/chrome/browser/promos_manager/promos_manager_impl.h
@@ -119,6 +119,9 @@ bool CanShowPromoUsingFeatureEngagementTracker( promos_manager::Promo promo) const; + // Returns the corresponding base::Feature for the given Promo. + const base::Feature* FeatureForPromo(promos_manager::Promo promo) const; + // Returns a list of impression counts (std::vector<int>) from a promo // impression counts map. std::vector<int> ImpressionCounts(
diff --git a/ios/chrome/browser/promos_manager/promos_manager_impl.mm b/ios/chrome/browser/promos_manager/promos_manager_impl.mm index 44fb047..42dcee5 100644 --- a/ios/chrome/browser/promos_manager/promos_manager_impl.mm +++ b/ios/chrome/browser/promos_manager/promos_manager_impl.mm
@@ -489,18 +489,23 @@ bool PromosManagerImpl::CanShowPromoUsingFeatureEngagementTracker( promos_manager::Promo promo) const { - auto it = promo_configs_.find(promo); - if (it == promo_configs_.end()) { - return false; - } - - const base::Feature* feature = it->feature_engagement_feature; + const base::Feature* feature = FeatureForPromo(promo); if (!feature) { return false; } return tracker_->ShouldTriggerHelpUI(*feature); } +const base::Feature* PromosManagerImpl::FeatureForPromo( + promos_manager::Promo promo) const { + auto it = promo_configs_.find(promo); + if (it == promo_configs_.end()) { + return nil; + } + + return it->feature_engagement_feature; +} + std::vector<int> PromosManagerImpl::ImpressionCounts( std::map<promos_manager::Promo, int>& promo_impression_counts) const { std::vector<int> counts; @@ -519,7 +524,7 @@ } // Sort the promos in the order that they will be displayed. -// Based on the Promo's context, type, and the recently shown time. +// Based on the Promo's context and type. std::vector<promos_manager::Promo> PromosManagerImpl::SortPromos( const std::map<promos_manager::Promo, PromoContext>& promos_to_sort_with_context) const { @@ -531,13 +536,11 @@ std::pair<promos_manager::Promo, PromoContext>(it.first, it.second)); } - const std::vector<promos_manager::Impression>& impression_history = - impression_history_; - // The order: PostRestoreSignIn types are shown first, then Promos with - // pending state, then Promos without pending state in least-recently-shown - // order. - auto compare_promo = [&impression_history]( + // pending state, then Promos without pending state. For promos without + // pending state, those never before shown come before those that have been + // shown before. + auto compare_promo = [this]( std::pair<promos_manager::Promo, PromoContext> lhs, std::pair<promos_manager::Promo, PromoContext> rhs) { // PostRestoreDefaultBrowser comes first. @@ -570,28 +573,31 @@ if (!lhs.second.was_pending && rhs.second.was_pending) { return false; } - // Tied after comparing the type and pending state, break using the most - // recently shown times, prefer the promo that was shown less recently. - auto lhs_impression = - std::find_if(impression_history.begin(), impression_history.end(), - [lhs](promos_manager::Impression impression) { - return impression.promo == lhs.first; - }); - // If the promo is unseen, make it show first. - if (lhs_impression == impression_history.end()) { + + // Check Feature Engagement Tracker data for promos. + const base::Feature* lhs_feature = FeatureForPromo(lhs.first); + const base::Feature* rhs_feature = FeatureForPromo(rhs.first); + if (!lhs_feature && !rhs_feature) { + return lhs.first < rhs.first; + } else if (!rhs_feature) { return true; - } - auto rhs_impression = - std::find_if(impression_history.begin(), impression_history.end(), - [rhs](promos_manager::Impression impression) { - return impression.promo == rhs.first; - }); - if (rhs_impression == impression_history.end()) { + } else if (!lhs_feature) { return false; } - // Both promos are seen. `impression_history` is in the most recently seen - // order. larger iterator = less recently seen = displayed first - return lhs_impression > rhs_impression; + if (!tracker_->IsInitialized()) { + return lhs.first < rhs.first; + } + // Prefer the promo that has not been shown to the + // one that has. + bool lhs_shown = tracker_->HasEverTriggered(*lhs_feature, true); + bool rhs_shown = tracker_->HasEverTriggered(*rhs_feature, true); + if (!lhs_shown && rhs_shown) { + return true; + } + if (lhs_shown && !rhs_shown) { + return false; + } + return lhs.first < rhs.first; }; sort(promos_list_to_sort.begin(), promos_list_to_sort.end(), compare_promo);
diff --git a/ios/chrome/browser/promos_manager/promos_manager_impl_unittest.mm b/ios/chrome/browser/promos_manager/promos_manager_impl_unittest.mm index b90f330..918df405 100644 --- a/ios/chrome/browser/promos_manager/promos_manager_impl_unittest.mm +++ b/ios/chrome/browser/promos_manager/promos_manager_impl_unittest.mm
@@ -25,6 +25,9 @@ #import "ios/chrome/browser/promos_manager/promo_config.h" #import "ios/chrome/browser/promos_manager/promos_manager.h" #import "ios/chrome/browser/shared/model/prefs/pref_names.h" +#import "testing/gmock/include/gmock/gmock.h" +#import "testing/gtest/include/gtest/gtest.h" +#import "testing/gtest_mac.h" #import "testing/platform_test.h" using PromoContext = PromosManagerImpl::PromoContext; @@ -44,6 +47,12 @@ .was_pending = false, }; +BASE_FEATURE(kTestFeatureOne, "test_one", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kTestFeatureTwo, "test_two", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kTestFeatureThree, + "test_three", + base::FEATURE_DISABLED_BY_DEFAULT); + } // namespace class PromosManagerImplTest : public PlatformTest { @@ -74,7 +83,7 @@ std::unique_ptr<TestingPrefServiceSimple> local_state_; std::unique_ptr<PromosManagerImpl> promos_manager_; - std::unique_ptr<feature_engagement::test::MockTracker> mock_tracker_; + feature_engagement::test::MockTracker mock_tracker_; base::test::ScopedFeatureList scoped_feature_list_; }; @@ -110,9 +119,8 @@ void PromosManagerImplTest::CreatePromosManager() { CreatePrefs(); - mock_tracker_ = std::make_unique<feature_engagement::test::MockTracker>(); promos_manager_ = std::make_unique<PromosManagerImpl>( - local_state_.get(), &test_clock_, mock_tracker_.get(), nullptr); + local_state_.get(), &test_clock_, &mock_tracker_, nullptr); promos_manager_->Init(); } @@ -492,24 +500,11 @@ {promos_manager::Promo::DefaultBrowser, kPromoContextForActive}, }; - int today = TodaysDay(); - - promos_manager_->impression_history_ = { - promos_manager::Impression(promos_manager::Promo::Test, today, false), - promos_manager::Impression(promos_manager::Promo::DefaultBrowser, - today - 7, false), - promos_manager::Impression(promos_manager::Promo::AppStoreRating, - today - 14, false), - promos_manager::Impression( - promos_manager::Promo::CredentialProviderExtension, today - 180, - false), - }; - std::vector<promos_manager::Promo> expected = { - promos_manager::Promo::CredentialProviderExtension, - promos_manager::Promo::AppStoreRating, - promos_manager::Promo::DefaultBrowser, promos_manager::Promo::Test, + promos_manager::Promo::DefaultBrowser, + promos_manager::Promo::AppStoreRating, + promos_manager::Promo::CredentialProviderExtension, }; EXPECT_EQ(promos_manager_->SortPromos(active_promos), expected); @@ -526,25 +521,11 @@ {promos_manager::Promo::AppStoreRating, kPromoContextForActive}, }; - int today = TodaysDay(); - - const std::vector<promos_manager::Impression> impressions = { - promos_manager::Impression(promos_manager::Promo::Test, today, false), - promos_manager::Impression(promos_manager::Promo::DefaultBrowser, - today - 7, false), - promos_manager::Impression(promos_manager::Promo::AppStoreRating, - today - 14, false), - promos_manager::Impression( - promos_manager::Promo::CredentialProviderExtension, today - 180, - false), - }; - const std::vector<promos_manager::Promo> expected = { - promos_manager::Promo::AppStoreRating, promos_manager::Promo::Test, + promos_manager::Promo::AppStoreRating, }; - promos_manager_->impression_history_ = impressions; EXPECT_EQ(promos_manager_->SortPromos(active_promos), expected); } @@ -553,29 +534,29 @@ TEST_F(PromosManagerImplTest, ReturnsSortPromosBreakingTies) { CreatePromosManager(); const std::map<promos_manager::Promo, PromoContext> active_promos = { - {promos_manager::Promo::Test, kPromoContextForActive}, {promos_manager::Promo::CredentialProviderExtension, kPromoContextForActive}, {promos_manager::Promo::AppStoreRating, kPromoContextForActive}, {promos_manager::Promo::DefaultBrowser, kPromoContextForActive}, }; - int today = TodaysDay(); + PromoConfigsSet promoImpressionLimits; + promoImpressionLimits.emplace( + promos_manager::Promo::CredentialProviderExtension, &kTestFeatureOne); + promoImpressionLimits.emplace(promos_manager::Promo::AppStoreRating, + &kTestFeatureTwo); + promoImpressionLimits.emplace(promos_manager::Promo::DefaultBrowser, + &kTestFeatureThree); + promos_manager_->InitializePromoConfigs(std::move(promoImpressionLimits)); - const std::vector<promos_manager::Impression> impressions = { - promos_manager::Impression(promos_manager::Promo::Test, today, false), - promos_manager::Impression(promos_manager::Promo::DefaultBrowser, today, - false), - promos_manager::Impression(promos_manager::Promo::AppStoreRating, today, - false), - promos_manager::Impression( - promos_manager::Promo::CredentialProviderExtension, today, false), - }; + EXPECT_CALL(mock_tracker_, IsInitialized()) + .WillRepeatedly(testing::Return(true)); + EXPECT_CALL(mock_tracker_, HasEverTriggered(testing::_, true)) + .WillRepeatedly(testing::Return(false)); - promos_manager_->impression_history_ = impressions; - EXPECT_EQ(promos_manager_->SortPromos(active_promos).size(), (size_t)4); + EXPECT_EQ(promos_manager_->SortPromos(active_promos).size(), (size_t)3); EXPECT_EQ(promos_manager_->SortPromos(active_promos)[0], - promos_manager::Promo::CredentialProviderExtension); + promos_manager::Promo::DefaultBrowser); } // Tests `SortPromos` returns a single promo in a list when the impression @@ -658,21 +639,32 @@ {promos_manager::Promo::DefaultBrowser, kPromoContextForActive}, }; - int today = TodaysDay(); + PromoConfigsSet promoImpressionLimits; + promoImpressionLimits.emplace(promos_manager::Promo::Test, &kTestFeatureOne); + promoImpressionLimits.emplace(promos_manager::Promo::AppStoreRating, + &kTestFeatureTwo); + promoImpressionLimits.emplace(promos_manager::Promo::DefaultBrowser, + &kTestFeatureThree); + promos_manager_->InitializePromoConfigs(std::move(promoImpressionLimits)); - const std::vector<promos_manager::Impression> impressions = { - promos_manager::Impression(promos_manager::Promo::Test, today, false), - promos_manager::Impression(promos_manager::Promo::DefaultBrowser, - today - 7, false), - }; + EXPECT_CALL(mock_tracker_, IsInitialized()) + .WillRepeatedly(testing::Return(true)); + EXPECT_CALL(mock_tracker_, + HasEverTriggered(testing::Ref(kTestFeatureTwo), true)) + .WillRepeatedly(testing::Return(false)); + EXPECT_CALL(mock_tracker_, + HasEverTriggered(testing::Ref(kTestFeatureOne), true)) + .WillRepeatedly(testing::Return(true)); + EXPECT_CALL(mock_tracker_, + HasEverTriggered(testing::Ref(kTestFeatureThree), true)) + .WillRepeatedly(testing::Return(true)); const std::vector<promos_manager::Promo> expected = { promos_manager::Promo::AppStoreRating, - promos_manager::Promo::DefaultBrowser, promos_manager::Promo::Test, + promos_manager::Promo::DefaultBrowser, }; - promos_manager_->impression_history_ = impressions; EXPECT_EQ(promos_manager_->SortPromos(active_promos), expected); }
diff --git a/ios/chrome/browser/reading_list/model/BUILD.gn b/ios/chrome/browser/reading_list/model/BUILD.gn index 583a1b2..03084387 100644 --- a/ios/chrome/browser/reading_list/model/BUILD.gn +++ b/ios/chrome/browser/reading_list/model/BUILD.gn
@@ -47,7 +47,7 @@ "//components/ukm/ios:ukm_url_recorder", "//ios/chrome/app/strings:ios_strings_grit", "//ios/chrome/browser/favicon", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/shared/model/application_context", "//ios/chrome/browser/shared/model/browser", "//ios/chrome/browser/shared/model/browser_state",
diff --git a/ios/chrome/browser/reading_list/model/DEPS b/ios/chrome/browser/reading_list/model/DEPS index 5c71d726..398f79b 100644 --- a/ios/chrome/browser/reading_list/model/DEPS +++ b/ios/chrome/browser/reading_list/model/DEPS
@@ -2,7 +2,7 @@ "+ios/chrome/browser/favicon", "+ios/chrome/browser/signin/model", "+ios/chrome/browser/sync/model", - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/dom_distiller/model", ]
diff --git a/ios/chrome/browser/reading_list/model/reading_list_download_service_factory.mm b/ios/chrome/browser/reading_list/model/reading_list_download_service_factory.mm index 4cc655b..de93aeb6 100644 --- a/ios/chrome/browser/reading_list/model/reading_list_download_service_factory.mm +++ b/ios/chrome/browser/reading_list/model/reading_list_download_service_factory.mm
@@ -10,7 +10,7 @@ #import "components/dom_distiller/core/distiller_url_fetcher.h" #import "components/keyed_service/ios/browser_state_dependency_manager.h" #import "ios/chrome/browser/favicon/favicon_service_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/reading_list/model/reading_list_distiller_page_factory.h" #import "ios/chrome/browser/reading_list/model/reading_list_download_service.h" #import "ios/chrome/browser/reading_list/model/reading_list_model_factory.h"
diff --git a/ios/chrome/browser/reading_list/model/reading_list_model_factory.mm b/ios/chrome/browser/reading_list/model/reading_list_model_factory.mm index d04cd49..a1dc3c7 100644 --- a/ios/chrome/browser/reading_list/model/reading_list_model_factory.mm +++ b/ios/chrome/browser/reading_list/model/reading_list_model_factory.mm
@@ -15,7 +15,6 @@ #import "components/reading_list/core/dual_reading_list_model.h" #import "components/reading_list/core/reading_list_model_impl.h" #import "components/reading_list/core/reading_list_model_storage_impl.h" -#import "components/reading_list/features/reading_list_switches.h" #import "components/signin/public/identity_manager/tribool.h" #import "components/sync/base/features.h" #import "components/sync/base/storage_type.h" @@ -66,10 +65,6 @@ reading_list::DualReadingListModel* ReadingListModelFactory::GetAsDualReadingListModelForBrowserState( ChromeBrowserState* browser_state) { - if (!base::FeatureList::IsEnabled( - syncer::kReadingListEnableDualReadingListModel)) { - return nullptr; - } return static_cast<reading_list::DualReadingListModel*>( GetForBrowserState(browser_state)); } @@ -97,16 +92,13 @@ syncer::OnceModelTypeStoreFactory store_factory = ModelTypeStoreServiceFactory::GetForBrowserState(chrome_browser_state) ->GetStoreFactory(); - auto storage = + auto local_storage = std::make_unique<ReadingListModelStorageImpl>(std::move(store_factory)); - auto reading_list_model = std::make_unique<ReadingListModelImpl>( - std::move(storage), syncer::StorageType::kUnspecified, - GetWipeModelUponSyncDisabledBehaviorForSyncableModel(), - base::DefaultClock::GetInstance()); - if (!base::FeatureList::IsEnabled( - syncer::kReadingListEnableDualReadingListModel)) { - return reading_list_model; - } + auto reading_list_model_for_local_storage = + std::make_unique<ReadingListModelImpl>( + std::move(local_storage), syncer::StorageType::kUnspecified, + GetWipeModelUponSyncDisabledBehaviorForSyncableModel(), + base::DefaultClock::GetInstance()); syncer::OnceModelTypeStoreFactory store_factory_for_account_storage = ModelTypeStoreServiceFactory::GetForBrowserState(chrome_browser_state) @@ -119,7 +111,8 @@ syncer::WipeModelUponSyncDisabledBehavior::kAlways, base::DefaultClock::GetInstance()); return std::make_unique<reading_list::DualReadingListModel>( - /*local_or_syncable_model=*/std::move(reading_list_model), + /*local_or_syncable_model=*/std::move( + reading_list_model_for_local_storage), /*account_model=*/std::move(reading_list_model_for_account_storage)); }
diff --git a/ios/chrome/browser/safe_browsing/model/BUILD.gn b/ios/chrome/browser/safe_browsing/model/BUILD.gn index 514a3e0..85a17b4 100644 --- a/ios/chrome/browser/safe_browsing/model/BUILD.gn +++ b/ios/chrome/browser/safe_browsing/model/BUILD.gn
@@ -64,7 +64,7 @@ "//components/sync_user_events", "//components/variations/service", "//ios/chrome/browser/content_settings/model", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/net", "//ios/chrome/browser/passwords/model:store_factory", "//ios/chrome/browser/policy", @@ -172,7 +172,7 @@ "//components/strings", "//components/sync_user_events:test_support", "//components/unified_consent", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/passwords/model", "//ios/chrome/browser/prerender/model", "//ios/chrome/browser/prerender/model:test_support",
diff --git a/ios/chrome/browser/safe_browsing/model/DEPS b/ios/chrome/browser/safe_browsing/model/DEPS index ac71d4d..5fb7640 100644 --- a/ios/chrome/browser/safe_browsing/model/DEPS +++ b/ios/chrome/browser/safe_browsing/model/DEPS
@@ -1,5 +1,5 @@ include_rules = [ - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/infobars", "+ios/chrome/browser/signin/model", "+ios/chrome/browser/sync/model",
diff --git a/ios/chrome/browser/safe_browsing/model/chrome_password_protection_service.mm b/ios/chrome/browser/safe_browsing/model/chrome_password_protection_service.mm index 7cd23d1..85f6069 100644 --- a/ios/chrome/browser/safe_browsing/model/chrome_password_protection_service.mm +++ b/ios/chrome/browser/safe_browsing/model/chrome_password_protection_service.mm
@@ -35,7 +35,7 @@ #import "components/sync/service/sync_service.h" #import "components/sync_user_events/user_event_service.h" #import "components/variations/service/variations_service.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/passwords/model/ios_chrome_account_password_store_factory.h" #import "ios/chrome/browser/passwords/model/ios_chrome_profile_password_store_factory.h" #import "ios/chrome/browser/safe_browsing/model/user_population_helper.h"
diff --git a/ios/chrome/browser/safe_browsing/model/chrome_password_protection_service_factory.mm b/ios/chrome/browser/safe_browsing/model/chrome_password_protection_service_factory.mm index cedae8ab..99825a2 100644 --- a/ios/chrome/browser/safe_browsing/model/chrome_password_protection_service_factory.mm +++ b/ios/chrome/browser/safe_browsing/model/chrome_password_protection_service_factory.mm
@@ -7,7 +7,7 @@ #import "base/no_destructor.h" #import "components/keyed_service/core/service_access_type.h" #import "components/keyed_service/ios/browser_state_dependency_manager.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/passwords/model/ios_chrome_account_password_store_factory.h" #import "ios/chrome/browser/passwords/model/ios_chrome_profile_password_store_factory.h" #import "ios/chrome/browser/safe_browsing/model/chrome_password_protection_service.h"
diff --git a/ios/chrome/browser/safe_browsing/model/chrome_password_protection_service_unittest.mm b/ios/chrome/browser/safe_browsing/model/chrome_password_protection_service_unittest.mm index e8fd7024..0ff22cb2 100644 --- a/ios/chrome/browser/safe_browsing/model/chrome_password_protection_service_unittest.mm +++ b/ios/chrome/browser/safe_browsing/model/chrome_password_protection_service_unittest.mm
@@ -25,7 +25,7 @@ #import "components/strings/grit/components_strings.h" #import "components/sync/protocol/gaia_password_reuse.pb.h" #import "components/sync_user_events/fake_user_event_service.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/passwords/model/ios_chrome_profile_password_store_factory.h" #import "ios/chrome/browser/safe_browsing/model/safe_browsing_metrics_collector_factory.h" #import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h"
diff --git a/ios/chrome/browser/safe_browsing/model/verdict_cache_manager_factory.mm b/ios/chrome/browser/safe_browsing/model/verdict_cache_manager_factory.mm index 06dc083..3ab060c 100644 --- a/ios/chrome/browser/safe_browsing/model/verdict_cache_manager_factory.mm +++ b/ios/chrome/browser/safe_browsing/model/verdict_cache_manager_factory.mm
@@ -11,7 +11,7 @@ #import "components/safe_browsing/core/browser/verdict_cache_manager.h" #import "components/sync/service/sync_service.h" #import "ios/chrome/browser/content_settings/model/host_content_settings_map_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/shared/model/browser_state/browser_state_otr_helper.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/sync/model/sync_service_factory.h"
diff --git a/ios/chrome/browser/screen_time/model/BUILD.gn b/ios/chrome/browser/screen_time/model/BUILD.gn index f50566e..829b2d66 100644 --- a/ios/chrome/browser/screen_time/model/BUILD.gn +++ b/ios/chrome/browser/screen_time/model/BUILD.gn
@@ -31,7 +31,7 @@ "//components/history/core/browser", "//components/keyed_service/core", "//components/keyed_service/ios", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/shared/model/browser_state", "//net", ]
diff --git a/ios/chrome/browser/screen_time/model/DEPS b/ios/chrome/browser/screen_time/model/DEPS index 2338e227..276083f 100644 --- a/ios/chrome/browser/screen_time/model/DEPS +++ b/ios/chrome/browser/screen_time/model/DEPS
@@ -1,3 +1,3 @@ include_rules = [ - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", ]
diff --git a/ios/chrome/browser/screen_time/model/screen_time_history_deleter_factory.mm b/ios/chrome/browser/screen_time/model/screen_time_history_deleter_factory.mm index ad1b687..8bebd5652 100644 --- a/ios/chrome/browser/screen_time/model/screen_time_history_deleter_factory.mm +++ b/ios/chrome/browser/screen_time/model/screen_time_history_deleter_factory.mm
@@ -7,7 +7,7 @@ #import "base/no_destructor.h" #import "components/keyed_service/core/service_access_type.h" #import "components/keyed_service/ios/browser_state_dependency_manager.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/screen_time/model/screen_time_history_deleter.h" #import "ios/chrome/browser/shared/model/browser_state/browser_state_otr_helper.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h"
diff --git a/ios/chrome/browser/search_engines/model/BUILD.gn b/ios/chrome/browser/search_engines/model/BUILD.gn index 2d83fa96..8ab78bd5 100644 --- a/ios/chrome/browser/search_engines/model/BUILD.gn +++ b/ios/chrome/browser/search_engines/model/BUILD.gn
@@ -40,7 +40,7 @@ "//components/search_engines", "//components/version_info", "//ios/chrome/browser/google", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/shared/model/application_context", "//ios/chrome/browser/shared/model/browser_state", "//ios/chrome/browser/shared/public/features:system_flags",
diff --git a/ios/chrome/browser/search_engines/model/DEPS b/ios/chrome/browser/search_engines/model/DEPS index 83c7f1f..cff4ac61 100644 --- a/ios/chrome/browser/search_engines/model/DEPS +++ b/ios/chrome/browser/search_engines/model/DEPS
@@ -1,5 +1,5 @@ include_rules = [ - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/widget_kit/model", "+ios/chrome/browser/webdata_services/model", "+ios/chrome/browser/google",
diff --git a/ios/chrome/browser/search_engines/model/template_url_service_factory.mm b/ios/chrome/browser/search_engines/model/template_url_service_factory.mm index c6d4a6c7..309d039 100644 --- a/ios/chrome/browser/search_engines/model/template_url_service_factory.mm +++ b/ios/chrome/browser/search_engines/model/template_url_service_factory.mm
@@ -11,7 +11,7 @@ #import "components/keyed_service/ios/browser_state_dependency_manager.h" #import "components/search_engines/default_search_manager.h" #import "components/search_engines/template_url_service.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/search_engines/model/template_url_service_client_impl.h" #import "ios/chrome/browser/search_engines/model/ui_thread_search_terms_data.h" #import "ios/chrome/browser/shared/model/application_context/application_context.h"
diff --git a/ios/chrome/browser/segmentation_platform/BUILD.gn b/ios/chrome/browser/segmentation_platform/BUILD.gn index 8c77a21..a1ff6a0 100644 --- a/ios/chrome/browser/segmentation_platform/BUILD.gn +++ b/ios/chrome/browser/segmentation_platform/BUILD.gn
@@ -29,7 +29,7 @@ "//components/segmentation_platform/public/proto", "//components/sync_device_info", "//components/variations", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/metrics/model:accessor", "//ios/chrome/browser/optimization_guide/model", "//ios/chrome/browser/shared/model/application_context",
diff --git a/ios/chrome/browser/segmentation_platform/DEPS b/ios/chrome/browser/segmentation_platform/DEPS index 2a19982..0446c2d 100644 --- a/ios/chrome/browser/segmentation_platform/DEPS +++ b/ios/chrome/browser/segmentation_platform/DEPS
@@ -5,7 +5,7 @@ "+components/sync_device_info", "+ios/web/public", "+ios/chrome/browser/sync/model", - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/optimization_guide/model", "+ios/chrome/browser/metrics/model", ]
diff --git a/ios/chrome/browser/segmentation_platform/segmentation_platform_service_factory.mm b/ios/chrome/browser/segmentation_platform/segmentation_platform_service_factory.mm index abe6f43a..0896b0e 100644 --- a/ios/chrome/browser/segmentation_platform/segmentation_platform_service_factory.mm +++ b/ios/chrome/browser/segmentation_platform/segmentation_platform_service_factory.mm
@@ -25,7 +25,7 @@ #import "components/segmentation_platform/public/config.h" #import "components/segmentation_platform/public/features.h" #import "components/sync_device_info/device_info_sync_service.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/optimization_guide/model/optimization_guide_service.h" #import "ios/chrome/browser/optimization_guide/model/optimization_guide_service_factory.h" #import "ios/chrome/browser/segmentation_platform/otr_web_state_observer.h"
diff --git a/ios/chrome/browser/shared/coordinator/scene/scene_controller.mm b/ios/chrome/browser/shared/coordinator/scene/scene_controller.mm index 65eefea..a81024cd 100644 --- a/ios/chrome/browser/shared/coordinator/scene/scene_controller.mm +++ b/ios/chrome/browser/shared/coordinator/scene/scene_controller.mm
@@ -175,6 +175,14 @@ namespace { +// Killswitch, can be removed around February 2024. If enabled, +// createInitialUI will call makeKeyAndVisible before mainCoordinator start. +// When disabled, this fix resolves a flicker when starting the app in light +// mode +BASE_FEATURE(kMakeKeyAndVisibleBeforeMainCoordinatorStart, + "MakeKeyAndVisibleBeforeMainCoordinatorStart", + base::FEATURE_DISABLED_BY_DEFAULT); + // Feature to control whether Search Intents (Widgets, Application // Shortcuts menu) forcibly open a new tab, rather than reusing an // existing NTP. See http://crbug.com/1363375 for details. @@ -1042,12 +1050,22 @@ _webStateListForwardingObserver.get()); _mainWebStateObserver->Observe(self.mainInterface.browser->GetWebStateList()); - // Enables UI initializations to query the keyWindow's size. - [self.sceneState.window makeKeyAndVisible]; + if (base::FeatureList::IsEnabled( + kMakeKeyAndVisibleBeforeMainCoordinatorStart)) { + [self.sceneState.window makeKeyAndVisible]; + } // Lazy init of mainCoordinator. [self.mainCoordinator start]; + if (!base::FeatureList::IsEnabled( + kMakeKeyAndVisibleBeforeMainCoordinatorStart)) { + // Enables UI initializations to query the keyWindow's size. Do this after + // `mainCoordinator start` as it sets self.window.rootViewController to work + // around crbug.com/850387, causing a flicker if -makeKeyAndVisible has been + // called. + [self.sceneState.window makeKeyAndVisible]; + } [self.mainCoordinator setActivePage:[self activePage]]; if (!self.sceneState.appState.startupInformation.isFirstRun) {
diff --git a/ios/chrome/browser/shared/model/browser/test/BUILD.gn b/ios/chrome/browser/shared/model/browser/test/BUILD.gn index 43bbc20ea..53cfe38 100644 --- a/ios/chrome/browser/shared/model/browser/test/BUILD.gn +++ b/ios/chrome/browser/shared/model/browser/test/BUILD.gn
@@ -21,5 +21,6 @@ "//ios/chrome/browser/shared/model/web_state_list", "//ios/chrome/browser/shared/model/web_state_list/test:test_support", "//ios/chrome/browser/shared/public/commands", + "//ios/chrome/browser/snapshots/model", ] }
diff --git a/ios/chrome/browser/shared/model/browser/test/DEPS b/ios/chrome/browser/shared/model/browser/test/DEPS new file mode 100644 index 0000000..e4adf553 --- /dev/null +++ b/ios/chrome/browser/shared/model/browser/test/DEPS
@@ -0,0 +1,3 @@ +include_rules = [ + "+ios/chrome/browser/snapshots/model", +]
diff --git a/ios/chrome/browser/shared/model/browser/test/test_browser.h b/ios/chrome/browser/shared/model/browser/test/test_browser.h index 005e8ec6..b09c9e8 100644 --- a/ios/chrome/browser/shared/model/browser/test/test_browser.h +++ b/ios/chrome/browser/shared/model/browser/test/test_browser.h
@@ -58,6 +58,7 @@ std::unique_ptr<WebStateListDelegate> web_state_list_delegate_; std::unique_ptr<WebStateList> web_state_list_; __strong CommandDispatcher* command_dispatcher_ = nil; + std::unique_ptr<TestBrowser> inactive_browser_; base::ObserverList<BrowserObserver, /* check_empty= */ true> observers_; // Needs to be the last member field to ensure all weak pointers are
diff --git a/ios/chrome/browser/shared/model/browser/test/test_browser.mm b/ios/chrome/browser/shared/model/browser/test/test_browser.mm index b23039c..fc66060 100644 --- a/ios/chrome/browser/shared/model/browser/test/test_browser.mm +++ b/ios/chrome/browser/shared/model/browser/test/test_browser.mm
@@ -10,6 +10,7 @@ #import "ios/chrome/browser/shared/model/web_state_list/test/fake_web_state_list_delegate.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_list.h" #import "ios/chrome/browser/shared/public/commands/command_dispatcher.h" +#import "ios/chrome/browser/snapshots/model/snapshot_browser_agent.h" TestBrowser::TestBrowser( ChromeBrowserState* browser_state, @@ -90,7 +91,12 @@ } Browser* TestBrowser::CreateInactiveBrowser() { - NOTREACHED_NORETURN(); + inactive_browser_ = + std::make_unique<TestBrowser>(browser_state_, scene_state_); + SnapshotBrowserAgent::CreateForBrowser(inactive_browser_.get()); + SnapshotBrowserAgent::FromBrowser(inactive_browser_.get()) + ->SetSessionID("some_id"); + return inactive_browser_.get(); } void TestBrowser::DestroyInactiveBrowser() {
diff --git a/ios/chrome/browser/sync/model/BUILD.gn b/ios/chrome/browser/sync/model/BUILD.gn index 785bf13d..864ef6b 100644 --- a/ios/chrome/browser/sync/model/BUILD.gn +++ b/ios/chrome/browser/sync/model/BUILD.gn
@@ -70,7 +70,7 @@ "//ios/chrome/browser/favicon", "//ios/chrome/browser/gcm/model", "//ios/chrome/browser/gcm/model/instance_id", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/invalidation/model", "//ios/chrome/browser/metrics/model:google_groups_updater", "//ios/chrome/browser/passwords/model:sharing_factory", @@ -101,7 +101,7 @@ "//url", ] allow_circular_includes_from = [ - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/passwords/model:store_factory", "//ios/chrome/browser/reading_list/model", "//ios/chrome/browser/signin/model", @@ -182,7 +182,7 @@ "//components/supervised_user/core/common:buildflags", "//components/sync", "//ios/chrome/browser/favicon", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/shared/model/browser_state:test_support", "//ios/chrome/browser/shared/model/url:constants", "//ios/chrome/browser/webdata_services/model",
diff --git a/ios/chrome/browser/sync/model/DEPS b/ios/chrome/browser/sync/model/DEPS index c8e6555..186392f1 100644 --- a/ios/chrome/browser/sync/model/DEPS +++ b/ios/chrome/browser/sync/model/DEPS
@@ -3,7 +3,7 @@ "+components/trusted_vault", "+ios/chrome/browser/search_engines/model", "+ios/chrome/browser/signin/model", - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/webdata_services/model", "+ios/chrome/browser/tabs/model", "+ios/chrome/browser/favicon",
diff --git a/ios/chrome/browser/sync/model/ios_chrome_sync_client.mm b/ios/chrome/browser/sync/model/ios_chrome_sync_client.mm index 652eb81..6bad4de 100644 --- a/ios/chrome/browser/sync/model/ios_chrome_sync_client.mm +++ b/ios/chrome/browser/sync/model/ios_chrome_sync_client.mm
@@ -43,7 +43,7 @@ #import "ios/chrome/browser/consent_auditor/model/consent_auditor_factory.h" #import "ios/chrome/browser/dom_distiller/model/dom_distiller_service_factory.h" #import "ios/chrome/browser/favicon/favicon_service_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/metrics/model/google_groups_updater_service_factory.h" #import "ios/chrome/browser/passwords/model/ios_chrome_account_password_store_factory.h" #import "ios/chrome/browser/passwords/model/ios_chrome_password_receiver_service_factory.h"
diff --git a/ios/chrome/browser/sync/model/send_tab_to_self_sync_service_factory.mm b/ios/chrome/browser/sync/model/send_tab_to_self_sync_service_factory.mm index 95f8eed..a6cf4c1 100644 --- a/ios/chrome/browser/sync/model/send_tab_to_self_sync_service_factory.mm +++ b/ios/chrome/browser/sync/model/send_tab_to_self_sync_service_factory.mm
@@ -9,7 +9,7 @@ #import "components/keyed_service/ios/browser_state_dependency_manager.h" #import "components/send_tab_to_self/send_tab_to_self_sync_service.h" #import "components/sync_device_info/device_info_sync_service.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/sync/model/device_info_sync_service_factory.h" #import "ios/chrome/browser/sync/model/model_type_store_service_factory.h"
diff --git a/ios/chrome/browser/sync/model/session_sync_service_factory.mm b/ios/chrome/browser/sync/model/session_sync_service_factory.mm index 26db3c8..89cfcd3a 100644 --- a/ios/chrome/browser/sync/model/session_sync_service_factory.mm +++ b/ios/chrome/browser/sync/model/session_sync_service_factory.mm
@@ -22,7 +22,7 @@ #import "components/sync_sessions/session_sync_service_impl.h" #import "components/sync_sessions/sync_sessions_client.h" #import "components/sync_sessions/synced_window_delegates_getter.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/shared/model/browser/browser_list_factory.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/shared/model/url/chrome_url_constants.h"
diff --git a/ios/chrome/browser/sync/model/sessions/BUILD.gn b/ios/chrome/browser/sync/model/sessions/BUILD.gn index c9733e9..59ec44eb 100644 --- a/ios/chrome/browser/sync/model/sessions/BUILD.gn +++ b/ios/chrome/browser/sync/model/sessions/BUILD.gn
@@ -13,7 +13,7 @@ "//components/keyed_service/core", "//components/sync", "//components/sync_sessions", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/shared/model/browser", "//ios/chrome/browser/shared/model/browser_state", "//ios/chrome/browser/shared/model/web_state_list",
diff --git a/ios/chrome/browser/sync/model/sessions/ios_chrome_local_session_event_router.mm b/ios/chrome/browser/sync/model/sessions/ios_chrome_local_session_event_router.mm index 3d4ec47..dcf8f91 100644 --- a/ios/chrome/browser/sync/model/sessions/ios_chrome_local_session_event_router.mm +++ b/ios/chrome/browser/sync/model/sessions/ios_chrome_local_session_event_router.mm
@@ -13,7 +13,7 @@ #import "components/sync/base/features.h" #import "components/sync_sessions/sync_sessions_client.h" #import "components/sync_sessions/synced_tab_delegate.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/shared/model/browser/all_web_state_list_observation_registrar.h" #import "ios/chrome/browser/shared/model/browser/browser_list.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_list.h"
diff --git a/ios/chrome/browser/sync/model/sync_service_factory.mm b/ios/chrome/browser/sync/model/sync_service_factory.mm index 568e12dc..830a3b64 100644 --- a/ios/chrome/browser/sync/model/sync_service_factory.mm +++ b/ios/chrome/browser/sync/model/sync_service_factory.mm
@@ -35,7 +35,7 @@ #import "ios/chrome/browser/consent_auditor/model/consent_auditor_factory.h" #import "ios/chrome/browser/favicon/favicon_service_factory.h" #import "ios/chrome/browser/gcm/model/ios_chrome_gcm_profile_service_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/metrics/model/google_groups_updater_service_factory.h" #import "ios/chrome/browser/passwords/model/ios_chrome_account_password_store_factory.h" #import "ios/chrome/browser/passwords/model/ios_chrome_password_receiver_service_factory.h"
diff --git a/ios/chrome/browser/sync/model/sync_service_factory_unittest.cc b/ios/chrome/browser/sync/model/sync_service_factory_unittest.cc index de85935..08a397e 100644 --- a/ios/chrome/browser/sync/model/sync_service_factory_unittest.cc +++ b/ios/chrome/browser/sync/model/sync_service_factory_unittest.cc
@@ -15,7 +15,7 @@ #include "components/sync/service/data_type_controller.h" #include "components/sync/service/sync_service_impl.h" #include "ios/chrome/browser/favicon/favicon_service_factory.h" -#include "ios/chrome/browser/history/history_service_factory.h" +#include "ios/chrome/browser/history/model/history_service_factory.h" #include "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h" #include "ios/chrome/browser/webdata_services/model/web_data_service_factory.h" #include "ios/web/public/test/web_task_environment.h"
diff --git a/ios/chrome/browser/tabs/model/BUILD.gn b/ios/chrome/browser/tabs/model/BUILD.gn index 007548da..ddec52c 100644 --- a/ios/chrome/browser/tabs/model/BUILD.gn +++ b/ios/chrome/browser/tabs/model/BUILD.gn
@@ -70,8 +70,8 @@ "//ios/chrome/browser/find_in_page/model:util", "//ios/chrome/browser/follow/model:tab_helper", "//ios/chrome/browser/geolocation/model", - "//ios/chrome/browser/history", - "//ios/chrome/browser/history:tab_helper", + "//ios/chrome/browser/history/model", + "//ios/chrome/browser/history/model:tab_helper", "//ios/chrome/browser/https_upgrades/model", "//ios/chrome/browser/infobars", "//ios/chrome/browser/infobars:badge",
diff --git a/ios/chrome/browser/tabs/model/inactive_tabs/features.mm b/ios/chrome/browser/tabs/model/inactive_tabs/features.mm index b3875e1..00e501b 100644 --- a/ios/chrome/browser/tabs/model/inactive_tabs/features.mm +++ b/ios/chrome/browser/tabs/model/inactive_tabs/features.mm
@@ -16,7 +16,7 @@ BASE_FEATURE(kTabInactivityThreshold, "TabInactivityThreshold", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); const char kTabInactivityThresholdParameterName[] = "variant"; const char kTabInactivityThresholdOneWeekParam[] = @@ -77,12 +77,12 @@ } else if (feature_param == kTabInactivityThresholdImmediateDemoParam) { return base::Seconds(0); } - return base::Days(14); + return base::Days(21); } BASE_FEATURE(kShowInactiveTabsCount, "ShowInactiveTabsCount", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); bool IsShowInactiveTabsCountEnabled() { CHECK(IsInactiveTabsAvailable());
diff --git a/ios/chrome/browser/tabs/model/inactive_tabs/utils_unittest.mm b/ios/chrome/browser/tabs/model/inactive_tabs/utils_unittest.mm index e3d789a7..757528c 100644 --- a/ios/chrome/browser/tabs/model/inactive_tabs/utils_unittest.mm +++ b/ios/chrome/browser/tabs/model/inactive_tabs/utils_unittest.mm
@@ -242,6 +242,12 @@ // Restore all inactive tab. TEST_F(InactiveTabsUtilsTest, RestoreAllInactive) { + // RestoreAllInactive checks that it is called when the feature is disabled, + // either via the flag, or via the user pref. Disable in both places. + base::test::ScopedFeatureList feature_list; + feature_list.InitAndDisableFeature(kTabInactivityThreshold); + local_state_.Get()->SetInteger(prefs::kInactiveTabsTimeThreshold, -1); + WebStateList* active_web_state_list = browser_active_->GetWebStateList(); WebStateList* inactive_web_state_list = browser_inactive_->GetWebStateList(); @@ -379,8 +385,11 @@ // Ensure that restore function is working with complicated lists (multiple // tabs, un-ordered, pinned tabs). TEST_F(InactiveTabsUtilsTest, ComplicatedRestore) { + // RestoreAllInactive checks that it is called when the feature is disabled, + // either via the flag, or via the user pref. Disable in both places. base::test::ScopedFeatureList feature_list; feature_list.InitAndDisableFeature(kTabInactivityThreshold); + local_state_.Get()->SetInteger(prefs::kInactiveTabsTimeThreshold, -1); WebStateList* active_web_state_list = browser_active_->GetWebStateList(); WebStateList* inactive_web_state_list = browser_inactive_->GetWebStateList(); @@ -558,6 +567,12 @@ // Checks that Inactive Tabs migration method RestoreAllInactiveTabs filters out // duplicates across browsers. TEST_F(InactiveTabsUtilsTest, RestoreAllInactiveTabsRemovesCrossDuplicates) { + // RestoreAllInactive checks that it is called when the feature is disabled, + // either via the flag, or via the user pref. Disable in both places. + base::test::ScopedFeatureList feature_list; + feature_list.InitAndDisableFeature(kTabInactivityThreshold); + local_state_.Get()->SetInteger(prefs::kInactiveTabsTimeThreshold, -1); + // Create known identifiers and last_active_time. const web::WebStateID unique_identifier = web::WebStateID::NewUnique(); const base::Time last_active_time = base::Time::Now();
diff --git a/ios/chrome/browser/tabs/model/tab_helper_util.mm b/ios/chrome/browser/tabs/model/tab_helper_util.mm index 4eeca64..bc21868 100644 --- a/ios/chrome/browser/tabs/model/tab_helper_util.mm +++ b/ios/chrome/browser/tabs/model/tab_helper_util.mm
@@ -41,9 +41,9 @@ #import "ios/chrome/browser/find_in_page/model/java_script_find_tab_helper.h" #import "ios/chrome/browser/find_in_page/model/util.h" #import "ios/chrome/browser/follow/model/follow_tab_helper.h" -#import "ios/chrome/browser/history/history_service_factory.h" -#import "ios/chrome/browser/history/history_tab_helper.h" -#import "ios/chrome/browser/history/top_sites_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_tab_helper.h" +#import "ios/chrome/browser/history/model/top_sites_factory.h" #import "ios/chrome/browser/https_upgrades/model/https_only_mode_upgrade_tab_helper.h" #import "ios/chrome/browser/https_upgrades/model/https_upgrade_service_factory.h" #import "ios/chrome/browser/https_upgrades/model/typed_navigation_upgrade_tab_helper.h"
diff --git a/ios/chrome/browser/tabs_search/model/BUILD.gn b/ios/chrome/browser/tabs_search/model/BUILD.gn index 5e933b7..642c1ce9 100644 --- a/ios/chrome/browser/tabs_search/model/BUILD.gn +++ b/ios/chrome/browser/tabs_search/model/BUILD.gn
@@ -14,7 +14,7 @@ "//components/signin/public/base", "//components/signin/public/identity_manager", "//components/sync_sessions", - "//ios/chrome/browser/history:history_utils", + "//ios/chrome/browser/history/model:utils", "//ios/chrome/browser/shared/model/browser", "//ios/chrome/browser/shared/model/web_state_list", "//ios/chrome/browser/synced_sessions/model", @@ -34,7 +34,7 @@ "//base", "//components/keyed_service/core", "//components/keyed_service/ios", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/sessions", "//ios/chrome/browser/shared/model/browser", "//ios/chrome/browser/shared/model/browser_state", @@ -50,7 +50,7 @@ ":model", ":model_factory", "//components/sessions", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/sessions", "//ios/chrome/browser/shared/model/browser", "//ios/chrome/browser/shared/model/browser/test:test_support",
diff --git a/ios/chrome/browser/tabs_search/model/DEPS b/ios/chrome/browser/tabs_search/model/DEPS index fb29ebd9..d832430 100644 --- a/ios/chrome/browser/tabs_search/model/DEPS +++ b/ios/chrome/browser/tabs_search/model/DEPS
@@ -1,5 +1,5 @@ include_rules = [ - "+ios/chrome/browser/history", + "+ios/chrome/browser/history/model", "+ios/chrome/browser/synced_sessions/model", "+ios/chrome/browser/sessions", "+ios/chrome/browser/tabs/model",
diff --git a/ios/chrome/browser/tabs_search/model/tabs_search_service.mm b/ios/chrome/browser/tabs_search/model/tabs_search_service.mm index 5ea378b..9b2c2faa 100644 --- a/ios/chrome/browser/tabs_search/model/tabs_search_service.mm +++ b/ios/chrome/browser/tabs_search/model/tabs_search_service.mm
@@ -14,7 +14,7 @@ #import "components/signin/public/base/consent_level.h" #import "components/signin/public/identity_manager/identity_manager.h" #import "components/sync_sessions/session_sync_service.h" -#import "ios/chrome/browser/history/history_utils.h" +#import "ios/chrome/browser/history/model/history_utils.h" #import "ios/chrome/browser/shared/model/browser/browser.h" #import "ios/chrome/browser/shared/model/browser/browser_list.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_list.h"
diff --git a/ios/chrome/browser/tabs_search/model/tabs_search_service_factory.mm b/ios/chrome/browser/tabs_search/model/tabs_search_service_factory.mm index 1338b31..8008242 100644 --- a/ios/chrome/browser/tabs_search/model/tabs_search_service_factory.mm +++ b/ios/chrome/browser/tabs_search/model/tabs_search_service_factory.mm
@@ -7,8 +7,8 @@ #import "base/check.h" #import "components/keyed_service/core/service_access_type.h" #import "components/keyed_service/ios/browser_state_dependency_manager.h" -#import "ios/chrome/browser/history/history_service_factory.h" -#import "ios/chrome/browser/history/web_history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" +#import "ios/chrome/browser/history/model/web_history_service_factory.h" #import "ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.h" #import "ios/chrome/browser/shared/model/browser/browser_list_factory.h" #import "ios/chrome/browser/shared/model/browser_state/browser_state_otr_helper.h"
diff --git a/ios/chrome/browser/tabs_search/model/tabs_search_service_unittest.mm b/ios/chrome/browser/tabs_search/model/tabs_search_service_unittest.mm index d2fe1f73..592add9 100644 --- a/ios/chrome/browser/tabs_search/model/tabs_search_service_unittest.mm +++ b/ios/chrome/browser/tabs_search/model/tabs_search_service_unittest.mm
@@ -10,7 +10,7 @@ #import "base/i18n/case_conversion.h" #import "base/strings/utf_string_conversions.h" #import "components/sessions/core/tab_restore_service_impl.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/sessions/ios_chrome_tab_restore_service_client.h" #import "ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.h" #import "ios/chrome/browser/shared/model/browser/browser_list.h"
diff --git a/ios/chrome/browser/ui/authentication/signin/instant_signin/instant_signin_mediator.mm b/ios/chrome/browser/ui/authentication/signin/instant_signin/instant_signin_mediator.mm index 1cffe2b..fdcfb0d 100644 --- a/ios/chrome/browser/ui/authentication/signin/instant_signin/instant_signin_mediator.mm +++ b/ios/chrome/browser/ui/authentication/signin/instant_signin/instant_signin_mediator.mm
@@ -99,14 +99,10 @@ } bool bookmarksAccountStorageEnabled = base::FeatureList::IsEnabled(syncer::kEnableBookmarksAccountStorage); - bool dualReadingListModelEnabled = base::FeatureList::IsEnabled( - syncer::kReadingListEnableDualReadingListModel); bool readingListTransportUponSignInEnabled = base::FeatureList::IsEnabled( syncer::kReadingListEnableSyncTransportModeUponSignIn); - CHECK(bookmarksAccountStorageEnabled || - (dualReadingListModelEnabled && readingListTransportUponSignInEnabled)) + CHECK(bookmarksAccountStorageEnabled || readingListTransportUponSignInEnabled) << "bookmarksAccountStorageEnabled: " << bookmarksAccountStorageEnabled - << ", dualReadingListModelEnabled: " << dualReadingListModelEnabled << ", readingListTransportUponSignInEnabled: " << readingListTransportUponSignInEnabled; _syncService->GetUserSettings()
diff --git a/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.mm b/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.mm index ab5ec784..b5e07ea 100644 --- a/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.mm +++ b/ios/chrome/browser/ui/authentication/signin_promo_view_mediator.mm
@@ -1019,14 +1019,10 @@ - (void)optInBookmarkReadingListAccountStorage { bool bookmarksAccountStorageEnabled = base::FeatureList::IsEnabled(syncer::kEnableBookmarksAccountStorage); - bool dualReadingListModelEnabled = base::FeatureList::IsEnabled( - syncer::kReadingListEnableDualReadingListModel); bool readingListTransportUponSignInEnabled = base::FeatureList::IsEnabled( syncer::kReadingListEnableSyncTransportModeUponSignIn); - CHECK(bookmarksAccountStorageEnabled || - (dualReadingListModelEnabled && readingListTransportUponSignInEnabled)) + CHECK(bookmarksAccountStorageEnabled || readingListTransportUponSignInEnabled) << "bookmarksAccountStorageEnabled: " << bookmarksAccountStorageEnabled - << ", dualReadingListModelEnabled: " << dualReadingListModelEnabled << ", readingListTransportUponSignInEnabled: " << readingListTransportUponSignInEnabled; _syncService->GetUserSettings()
diff --git a/ios/chrome/browser/ui/autofill/autofill_profile_edit_mediator.mm b/ios/chrome/browser/ui/autofill/autofill_profile_edit_mediator.mm index cac82d1..1470b78 100644 --- a/ios/chrome/browser/ui/autofill/autofill_profile_edit_mediator.mm +++ b/ios/chrome/browser/ui/autofill/autofill_profile_edit_mediator.mm
@@ -243,7 +243,8 @@ autofill::AutofillCountry country( base::SysNSStringToUTF8(self.selectedCountryCode), GetApplicationContext()->GetApplicationLocale()); - [self.consumer setNameRequired:country.requires_full_name()]; + // TODO(crbug.com/1413205): Remove `setNameRequired()`. + [self.consumer setNameRequired:NO]; [self.consumer setLine1Required:country.requires_line1()]; [self.consumer setCityRequired:country.requires_city()]; [self.consumer setStateRequired:country.requires_state()];
diff --git a/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_coordinator.mm b/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_coordinator.mm index 20d02c4..c412acd 100644 --- a/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_coordinator.mm +++ b/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_coordinator.mm
@@ -557,16 +557,10 @@ std::u16string origin = base::ASCIIToUTF16( password_manager::GetShownOrigin(url::Origin::Create(URL))); - bool useUpdatedStrings = base::FeatureList::IsEnabled( - password_manager::features::kIOSPasswordUISplit); - NSString* title = l10n_util::GetNSString( - useUpdatedStrings ? IDS_IOS_MANUAL_FALLBACK_SELECT_PASSWORD_DIALOG_TITLE - : IDS_IOS_CONFIRM_USING_OTHER_PASSWORD_TITLE); + IDS_IOS_MANUAL_FALLBACK_SELECT_PASSWORD_DIALOG_TITLE); NSString* message = l10n_util::GetNSStringF( - useUpdatedStrings ? IDS_IOS_MANUAL_FALLBACK_SELECT_PASSWORD_DIALOG_MESSAGE - : IDS_IOS_CONFIRM_USING_OTHER_PASSWORD_DESCRIPTION, - origin); + IDS_IOS_MANUAL_FALLBACK_SELECT_PASSWORD_DIALOG_MESSAGE, origin); self.alertCoordinator = [[AlertCoordinator alloc] initWithBaseViewController:self.baseViewController
diff --git a/ios/chrome/browser/ui/autofill/manual_fill/BUILD.gn b/ios/chrome/browser/ui/autofill/manual_fill/BUILD.gn index 9985c53a..64946579 100644 --- a/ios/chrome/browser/ui/autofill/manual_fill/BUILD.gn +++ b/ios/chrome/browser/ui/autofill/manual_fill/BUILD.gn
@@ -239,7 +239,6 @@ "//base/test:test_support", "//components/autofill/core/browser:test_support", "//components/password_manager/core/browser", - "//components/password_manager/core/common:features", "//components/strings", "//ios/chrome/app/strings", "//ios/chrome/browser/shared/ui/util:eg_test_support+eg2",
diff --git a/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_mediator.mm b/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_mediator.mm index 6ba7ea7..d1e707bb 100644 --- a/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_mediator.mm +++ b/ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_mediator.mm
@@ -13,7 +13,6 @@ #import "components/autofill/ios/form_util/form_activity_params.h" #import "components/password_manager/core/browser/password_manager_client.h" #import "components/password_manager/core/browser/password_store/password_store_interface.h" -#import "components/password_manager/core/common/password_manager_features.h" #import "components/sync/base/model_type.h" #import "components/sync/service/sync_service.h" #import "ios/chrome/browser/autofill/model/manual_fill/passwords_fetcher.h" @@ -247,9 +246,6 @@ [[NSMutableArray alloc] init]; __weak __typeof(self) weakSelf = self; - bool useUpdatedStrings = base::FeatureList::IsEnabled( - password_manager::features::kIOSPasswordUISplit); - password_manager::PasswordManagerClient* passwordManagerClient = _webState ? PasswordTabHelper::FromWebState(_webState) ->GetPasswordManagerClient() @@ -260,9 +256,7 @@ passwordManagerClient->IsSavingAndFillingEnabled(_URL) && _activeFieldIsPassword) { NSString* suggestPasswordTitleString = l10n_util::GetNSString( - useUpdatedStrings - ? IDS_IOS_MANUAL_FALLBACK_SUGGEST_STRONG_PASSWORD_WITH_DOTS - : IDS_IOS_MANUAL_FALLBACK_SUGGEST_PASSWORD_WITH_DOTS); + IDS_IOS_MANUAL_FALLBACK_SUGGEST_STRONG_PASSWORD_WITH_DOTS); ManualFillActionItem* suggestPasswordItem = [[ManualFillActionItem alloc] initWithTitle:suggestPasswordTitleString action:^{ @@ -276,9 +270,7 @@ } NSString* otherPasswordsTitleString = l10n_util::GetNSString( - useUpdatedStrings - ? IDS_IOS_MANUAL_FALLBACK_SELECT_PASSWORD_WITH_DOTS - : IDS_IOS_MANUAL_FALLBACK_USE_OTHER_PASSWORD_WITH_DOTS); + IDS_IOS_MANUAL_FALLBACK_SELECT_PASSWORD_WITH_DOTS); ManualFillActionItem* otherPasswordsItem = [[ManualFillActionItem alloc] initWithTitle:otherPasswordsTitleString action:^{ @@ -304,22 +296,19 @@ manual_fill::ManagePasswordsAccessibilityIdentifier; [actions addObject:managePasswordsItem]; - // "Manage Settings..." also appears when updated strings are enabled. - if (useUpdatedStrings) { - NSString* manageSettingsTitle = - l10n_util::GetNSString(IDS_IOS_MANUAL_FALLBACK_MANAGE_SETTINGS); - ManualFillActionItem* manageSettingsItem = [[ManualFillActionItem alloc] - initWithTitle:manageSettingsTitle - action:^{ - base::RecordAction(base::UserMetricsAction( - "ManualFallback_Password_OpenManageSettings")); - [weakSelf.navigator openPasswordSettings]; - }]; - manageSettingsItem.accessibilityIdentifier = - manual_fill::ManageSettingsAccessibilityIdentifier; + NSString* manageSettingsTitle = + l10n_util::GetNSString(IDS_IOS_MANUAL_FALLBACK_MANAGE_SETTINGS); + ManualFillActionItem* manageSettingsItem = [[ManualFillActionItem alloc] + initWithTitle:manageSettingsTitle + action:^{ + base::RecordAction(base::UserMetricsAction( + "ManualFallback_Password_OpenManageSettings")); + [weakSelf.navigator openPasswordSettings]; + }]; + manageSettingsItem.accessibilityIdentifier = + manual_fill::ManageSettingsAccessibilityIdentifier; - [actions addObject:manageSettingsItem]; - } + [actions addObject:manageSettingsItem]; [self.consumer presentActions:actions]; }
diff --git a/ios/chrome/browser/ui/autofill/manual_fill/password_view_controller.mm b/ios/chrome/browser/ui/autofill/manual_fill/password_view_controller.mm index 0d5547aef3..1961a77 100644 --- a/ios/chrome/browser/ui/autofill/manual_fill/password_view_controller.mm +++ b/ios/chrome/browser/ui/autofill/manual_fill/password_view_controller.mm
@@ -10,7 +10,6 @@ #import "base/strings/sys_string_conversions.h" #import "components/google/core/common/google_util.h" #import "components/password_manager/core/browser/password_manager_constants.h" -#import "components/password_manager/core/common/password_manager_features.h" #import "ios/chrome/browser/net/crurl.h" #import "ios/chrome/browser/shared/model/application_context/application_context.h" #import "ios/chrome/browser/shared/ui/list_model/list_item+Controller.h" @@ -80,15 +79,9 @@ self.navigationItem.hidesSearchBarWhenScrolling = NO; self.searchController.searchBar.accessibilityIdentifier = manual_fill::kPasswordSearchBarAccessibilityIdentifier; + self.title = l10n_util::GetNSString(IDS_IOS_PASSWORD_MANAGER); - bool useUISplitHeader = base::FeatureList::IsEnabled( - password_manager::features::kIOSPasswordUISplit); - int titleStringID = useUISplitHeader - ? IDS_IOS_PASSWORD_MANAGER - : IDS_IOS_MANUAL_FALLBACK_USE_OTHER_PASSWORD; - self.title = l10n_util::GetNSString(titleStringID); - - if (useUISplitHeader && self.searchController) { + if (self.searchController) { [self setUpCustomTitleView]; [self addHeaderItem]; }
diff --git a/ios/chrome/browser/ui/autofill/manual_fill/password_view_controller_egtest.mm b/ios/chrome/browser/ui/autofill/manual_fill/password_view_controller_egtest.mm index 8b2c3250b..ffb8139 100644 --- a/ios/chrome/browser/ui/autofill/manual_fill/password_view_controller_egtest.mm +++ b/ios/chrome/browser/ui/autofill/manual_fill/password_view_controller_egtest.mm
@@ -7,7 +7,6 @@ #import "base/strings/utf_string_conversions.h" #import "base/test/ios/wait_util.h" #import "components/password_manager/core/browser/password_ui_utils.h" -#import "components/password_manager/core/common/password_manager_features.h" #import "components/strings/grit/components_strings.h" #import "components/sync/base/features.h" #import "ios/chrome/browser/signin/model/fake_system_identity.h" @@ -163,9 +162,6 @@ - (AppLaunchConfiguration)appConfigurationForTestCase { AppLaunchConfiguration config; - config.features_enabled.push_back( - password_manager::features::kIOSPasswordUISplit); - if ([self isRunningTest:@selector (testPasswordGenerationOnManualFallbackSignedInNotSyncingAccount)] ||
diff --git a/ios/chrome/browser/ui/browser_view/BUILD.gn b/ios/chrome/browser/ui/browser_view/BUILD.gn index d926d84..60f1403 100644 --- a/ios/chrome/browser/ui/browser_view/BUILD.gn +++ b/ios/chrome/browser/ui/browser_view/BUILD.gn
@@ -300,7 +300,7 @@ "//ios/chrome/browser/feature_engagement/model", "//ios/chrome/browser/find_in_page/model", "//ios/chrome/browser/find_in_page/model:util", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/lens/model", "//ios/chrome/browser/metrics/model:metrics_browser_agent", "//ios/chrome/browser/ntp/model",
diff --git a/ios/chrome/browser/ui/browser_view/browser_coordinator_unittest.mm b/ios/chrome/browser/ui/browser_view/browser_coordinator_unittest.mm index 50ee6b43..4152a358 100644 --- a/ios/chrome/browser/ui/browser_view/browser_coordinator_unittest.mm +++ b/ios/chrome/browser/ui/browser_view/browser_coordinator_unittest.mm
@@ -13,7 +13,7 @@ #import "ios/chrome/browser/favicon/favicon_service_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/lens/model/lens_browser_agent.h" #import "ios/chrome/browser/ntp/model/new_tab_page_tab_helper.h" #import "ios/chrome/browser/prerender/model/prerender_service_factory.h"
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller_unittest.mm b/ios/chrome/browser/ui/browser_view/browser_view_controller_unittest.mm index 15840a9c..eadfc212 100644 --- a/ios/chrome/browser/ui/browser_view/browser_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/browser_view/browser_view_controller_unittest.mm
@@ -22,7 +22,7 @@ #import "ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h" #import "ios/chrome/browser/feature_engagement/model/tracker_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/lens/model/lens_browser_agent.h" #import "ios/chrome/browser/metrics/model/tab_usage_recorder_browser_agent.h" #import "ios/chrome/browser/ntp/model/new_tab_page_tab_helper.h"
diff --git a/ios/chrome/browser/ui/content_suggestions/BUILD.gn b/ios/chrome/browser/ui/content_suggestions/BUILD.gn index 081a75e9..59f76a69 100644 --- a/ios/chrome/browser/ui/content_suggestions/BUILD.gn +++ b/ios/chrome/browser/ui/content_suggestions/BUILD.gn
@@ -66,6 +66,7 @@ "//components/signin/public/identity_manager/objc", "//components/strings", "//components/sync/base:features", + "//components/url_formatter", "//ios/chrome/app:tests_hook", "//ios/chrome/app/application_delegate:app_state_header", "//ios/chrome/app/strings",
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm index 8c05364..2775fa1c 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator.mm
@@ -41,6 +41,7 @@ #import "components/strings/grit/components_strings.h" #import "components/sync/base/user_selectable_type.h" #import "components/sync/service/sync_user_settings.h" +#import "components/url_formatter/elide_url.h" #import "ios/chrome/app/application_delegate/app_state.h" #import "ios/chrome/app/application_delegate/app_state_observer.h" #import "ios/chrome/browser/default_browser/model/utils.h" @@ -454,7 +455,7 @@ - (void)configureMostRecentTabItemWithWebState:(web::WebState*)webState timeLabel:(NSString*)timeLabel { - // The most recent tab tile is part of the tab resume feature. + // The most recent tab tile is replaced by the tab resume feature. if (IsTabResumptionEnabled()) { return; } @@ -474,8 +475,9 @@ self.returnToRecentTabItem.icon = favicon.ToUIImage(); } } + const GURL& URL = webState->GetLastCommittedURL(); if (!self.returnToRecentTabItem.icon) { - driver->FetchFavicon(webState->GetLastCommittedURL(), false); + driver->FetchFavicon(URL, false); } self.returnToRecentTabItem.title = @@ -483,6 +485,7 @@ self.returnToRecentTabItem.subtitle = [self constructReturnToRecentTabSubtitleWithPageTitle:base::SysUTF16ToNSString( webState->GetTitle()) + forURL:URL timeString:timeLabel]; self.showMostRecentTabStartSurfaceTile = YES; [self.consumer @@ -696,15 +699,15 @@ [self.contentSuggestionsMetricsRecorder recordTabResumptionTabOpened]; [IntentDonationHelper donateIntent:IntentType::kOpenLatestTab]; [self hideRecentTabTile]; - WebStateList* web_state_list = self.browser->GetWebStateList(); - web::WebState* web_state = + WebStateList* webStateList = self.browser->GetWebStateList(); + web::WebState* webState = StartSurfaceRecentTabBrowserAgent::FromBrowser(self.browser) ->most_recent_tab(); - if (!web_state) { + if (!webState) { return; } - int index = web_state_list->GetIndexOfWebState(web_state); - web_state_list->ActivateWebStateAt(index); + int index = webStateList->GetIndexOfWebState(webState); + webStateList->ActivateWebStateAt(index); } - (void)openTabResumptionItem { @@ -787,7 +790,7 @@ #pragma mark - StartSurfaceRecentTabObserving -- (void)mostRecentTabWasRemoved:(web::WebState*)web_state { +- (void)mostRecentTabWasRemoved:(web::WebState*)webState { if (IsTabResumptionEnabled() && _tabResumptionItem) { [self hideTabResumption]; } else { @@ -795,7 +798,8 @@ } } -- (void)mostRecentTabFaviconUpdatedWithImage:(UIImage*)image { +- (void)mostRecentTab:(web::WebState*)webState + faviconUpdatedWithImage:(UIImage*)image { if (self.returnToRecentTabItem) { self.returnToRecentTabItem.icon = image; [self.consumer @@ -803,13 +807,17 @@ } } -- (void)mostRecentTabTitleWasUpdated:(NSString*)title { +- (void)mostRecentTab:(web::WebState*)webState + titleWasUpdated:(NSString*)title { if (self.returnToRecentTabItem) { SceneState* scene = self.browser->GetSceneState(); - NSString* time_label = GetRecentTabTileTimeLabelForSceneState(scene); - self.returnToRecentTabItem.subtitle = - [self constructReturnToRecentTabSubtitleWithPageTitle:title - timeString:time_label]; + NSString* timeLabel = GetRecentTabTileTimeLabelForSceneState(scene); + self.returnToRecentTabItem.subtitle = [self + constructReturnToRecentTabSubtitleWithPageTitle:title + forURL: + webState + ->GetLastCommittedURL() + timeString:timeLabel]; [self.consumer updateReturnToRecentTabTileWithConfig:self.returnToRecentTabItem]; } @@ -1169,10 +1177,25 @@ [self.dispatcher showSnackbarMessage:message]; } +// Creates a string containing the title and the time string. +// If `title` is empty, use the `URL` instead. - (NSString*)constructReturnToRecentTabSubtitleWithPageTitle: (NSString*)pageTitle + forURL:(const GURL&)URL timeString:(NSString*)time { - return [NSString stringWithFormat:@"%@%@", pageTitle, time]; + NSString* title = pageTitle; + if (![title length]) { + title = [self displayableURLFromURL:URL]; + } + return [NSString stringWithFormat:@"%@%@", title, time]; +} + +// Formats the URL to be displayed in the recent tabs card. +- (NSString*)displayableURLFromURL:(const GURL&)URL { + return base::SysUTF16ToNSString( + url_formatter:: + FormatUrlForDisplayOmitSchemePathTrivialSubdomainsAndMobilePrefix( + URL)); } - (BOOL)shouldShowWhatsNewActionItem {
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator_unittest.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator_unittest.mm index 407f0f5..0aeaa50 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator_unittest.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_mediator_unittest.mm
@@ -57,6 +57,7 @@ #import "ios/chrome/browser/sync/model/sync_service_factory.h" #import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_most_visited_action_item.h" #import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_most_visited_item.h" +#import "ios/chrome/browser/ui/content_suggestions/cells/content_suggestions_return_to_recent_tab_item.h" #import "ios/chrome/browser/ui/content_suggestions/cells/parcel_tracking_item.h" #import "ios/chrome/browser/ui/content_suggestions/cells/query_suggestion_view.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_constants.h" @@ -74,6 +75,7 @@ #import "ios/web/public/test/fakes/fake_navigation_manager.h" #import "ios/web/public/test/fakes/fake_web_state.h" #import "ios/web/public/test/web_task_environment.h" +#import "testing/gtest_mac.h" #import "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" #import "third_party/ocmock/gtest_support.h" @@ -337,8 +339,51 @@ url_loader_->last_params.web_params.transition_type)); } +// Tests that MostRecentTab can be opened and that its title is correct when +// tab has a title. TEST_F(ContentSuggestionsMediatorTest, TestOpenMostRecentTab) { // Create non-NTP WebState + auto web_state = CreateWebState("http://chromium.org"); + web_state->SetTitle(u"title"); + int recent_tab_index = web_state_list_->InsertWebState( + 0, std::move(web_state), WebStateList::INSERT_ACTIVATE, WebStateOpener()); + favicon::WebFaviconDriver::CreateForWebState( + web_state_list_->GetActiveWebState(), + /*favicon_service=*/nullptr); + StartSurfaceRecentTabBrowserAgent* browser_agent = + StartSurfaceRecentTabBrowserAgent::FromBrowser(browser_.get()); + browser_agent->SaveMostRecentTab(); + // Create NTP + web_state_list_->InsertWebState(1, CreateWebState("chrome://newtab"), + WebStateList::INSERT_ACTIVATE, + WebStateOpener()); + web::WebState* ntp_web_state = web_state_list_->GetActiveWebState(); + mediator_.webState = ntp_web_state; + NewTabPageTabHelper::FromWebState(ntp_web_state)->SetShowStartSurface(true); + + OCMExpect([consumer_ + updateReturnToRecentTabTileWithConfig: + [OCMArg + checkWithBlock:^(ContentSuggestionsReturnToRecentTabItem* item) { + EXPECT_NSEQ(@"title - 12 hours ago", item.subtitle); + return YES; + }]]); + [mediator_ + configureMostRecentTabItemWithWebState:browser_agent->most_recent_tab() + timeLabel:@"12 hours ago"]; + + OCMExpect([consumer_ hideReturnToRecentTabTile]); + OCMExpect([mediator_.NTPMetricsDelegate recentTabTileOpened]); + + [mediator_ openMostRecentTab]; + // Verify the most recent tab was opened. + EXPECT_EQ(recent_tab_index, web_state_list_->active_index()); +} + +// Tests that MostRecentTab can be opened and that its title is correct when +// tab has a no title. +TEST_F(ContentSuggestionsMediatorTest, TestOpenMostRecentTabNoTitle) { + // Create non-NTP WebState int recent_tab_index = web_state_list_->InsertWebState( 0, CreateWebState("http://chromium.org"), WebStateList::INSERT_ACTIVATE, WebStateOpener()); @@ -356,7 +401,13 @@ mediator_.webState = ntp_web_state; NewTabPageTabHelper::FromWebState(ntp_web_state)->SetShowStartSurface(true); - OCMExpect([consumer_ showReturnToRecentTabTileWithConfig:[OCMArg any]]); + OCMExpect([consumer_ + updateReturnToRecentTabTileWithConfig: + [OCMArg + checkWithBlock:^(ContentSuggestionsReturnToRecentTabItem* item) { + EXPECT_NSEQ(@"chromium.org - 12 hours ago", item.subtitle); + return YES; + }]]); [mediator_ configureMostRecentTabItemWithWebState:browser_agent->most_recent_tab() timeLabel:@"12 hours ago"]; @@ -386,10 +437,11 @@ WebStateOpener()); web::WebState* web_state = browser_agent->most_recent_tab(); [mediator_ configureMostRecentTabItemWithWebState:web_state - timeLabel:@"12 hours ago"]; + timeLabel:@" - 12 hours ago"]; OCMExpect([consumer_ updateReturnToRecentTabTileWithConfig:[OCMArg any]]); - [mediator_ mostRecentTabFaviconUpdatedWithImage:[[UIImage alloc] init]]; + [mediator_ mostRecentTab:web_state + faviconUpdatedWithImage:[[UIImage alloc] init]]; OCMExpect([consumer_ hideReturnToRecentTabTile]); [mediator_ mostRecentTabWasRemoved:web_state];
diff --git a/ios/chrome/browser/ui/context_menu/link_preview/BUILD.gn b/ios/chrome/browser/ui/context_menu/link_preview/BUILD.gn index 2638a81..1102527 100644 --- a/ios/chrome/browser/ui/context_menu/link_preview/BUILD.gn +++ b/ios/chrome/browser/ui/context_menu/link_preview/BUILD.gn
@@ -12,7 +12,7 @@ deps = [ ":link_preview_ui", "//components/url_formatter", - "//ios/chrome/browser/history:tab_helper", + "//ios/chrome/browser/history/model:tab_helper", "//ios/chrome/browser/shared/coordinator/chrome_coordinator", "//ios/chrome/browser/shared/model/browser", "//ios/chrome/browser/shared/model/browser_state",
diff --git a/ios/chrome/browser/ui/context_menu/link_preview/link_preview_coordinator.mm b/ios/chrome/browser/ui/context_menu/link_preview/link_preview_coordinator.mm index 35189f8..a63747f 100644 --- a/ios/chrome/browser/ui/context_menu/link_preview/link_preview_coordinator.mm +++ b/ios/chrome/browser/ui/context_menu/link_preview/link_preview_coordinator.mm
@@ -7,7 +7,7 @@ #import "base/metrics/field_trial_params.h" #import "base/strings/sys_string_conversions.h" #import "components/url_formatter/url_formatter.h" -#import "ios/chrome/browser/history/history_tab_helper.h" +#import "ios/chrome/browser/history/model/history_tab_helper.h" #import "ios/chrome/browser/shared/model/browser/browser.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/shared/model/web_state_list/web_state_list.h"
diff --git a/ios/chrome/browser/ui/first_run/BUILD.gn b/ios/chrome/browser/ui/first_run/BUILD.gn index 21257402..77d407d 100644 --- a/ios/chrome/browser/ui/first_run/BUILD.gn +++ b/ios/chrome/browser/ui/first_run/BUILD.gn
@@ -210,6 +210,7 @@ "//ios/chrome/browser/ui/authentication/signin:constants", "//ios/chrome/browser/ui/authentication/views:views_constants", "//ios/chrome/browser/ui/bookmarks:eg_test_support+eg2", + "//ios/chrome/browser/ui/search_engine_choice:constants", "//ios/chrome/browser/ui/settings/google_services:constants", "//ios/chrome/common:string_util", "//ios/chrome/common/ui/promo_style:constants",
diff --git a/ios/chrome/browser/ui/first_run/first_run_egtest.mm b/ios/chrome/browser/ui/first_run/first_run_egtest.mm index 350dab0..ddaf452 100644 --- a/ios/chrome/browser/ui/first_run/first_run_egtest.mm +++ b/ios/chrome/browser/ui/first_run/first_run_egtest.mm
@@ -35,6 +35,7 @@ #import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey.h" #import "ios/chrome/browser/ui/first_run/first_run_app_interface.h" #import "ios/chrome/browser/ui/first_run/first_run_constants.h" +#import "ios/chrome/browser/ui/search_engine_choice/search_engine_choice_constants.h" #import "ios/chrome/browser/ui/settings/google_services/google_services_settings_constants.h" #import "ios/chrome/browser/ui/settings/google_services/manage_sync_settings_constants.h" #import "ios/chrome/common/ui/promo_style/constants.h" @@ -96,6 +97,25 @@ grey_ancestor(disclaimer), grey_sufficientlyVisible(), nil); } +// Selects search engine cell with `search_engine_name`. +void SelectSearchEngineCellWithName(NSString* search_engine_name) { + NSString* googleAccessibiltyIdentifier = + [NSString stringWithFormat:@"%@%@", kSnippetSearchEngineIdentifierPrefix, + search_engine_name]; + id<GREYMatcher> googleRowMatcher = + grey_allOf(grey_userInteractionEnabled(), + grey_accessibilityID(googleAccessibiltyIdentifier), nil); + // Scroll down to find Google search engine cell. + id<GREYMatcher> scrollView = + grey_accessibilityID(kSearchEngineTableViewIdentifier); + [[[EarlGrey selectElementWithMatcher:googleRowMatcher] + usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, 50) + onElementWithMatcher:scrollView] assertWithMatcher:grey_notNil()]; + // Tap on the Google search engine cell. + [[[EarlGrey selectElementWithMatcher:googleRowMatcher] + assertWithMatcher:grey_notNil()] performAction:grey_tap()]; +} + // Dismisses the choice screen if it appears void DismissChoiceScreenIfNecessary() { if (![ChromeEarlGreyAppInterface IsSearchEngineChoiceScreenEnabledFre]) { @@ -104,14 +124,10 @@ // Selects a search engine. The list of search engines varies from country to // country and is refreshed periodically. Google should always be proposed in // the countries selected by test settings. - id<GREYMatcher> googleRowMatcher = grey_allOf( - grey_userInteractionEnabled(), grey_accessibilityLabel(@"Google"), nil); - [[[EarlGrey selectElementWithMatcher:googleRowMatcher] - assertWithMatcher:grey_notNil()] performAction:grey_tap()]; - - // Taps the "set as default" button. - id<GREYMatcher> primaryButtonMatcher = grey_accessibilityLabel( - l10n_util::GetNSString(IDS_SEARCH_ENGINE_CHOICE_BUTTON_TITLE)); + SelectSearchEngineCellWithName(@"Google"); + // Taps the "Set as Default" button. + id<GREYMatcher> primaryButtonMatcher = + grey_accessibilityID(kSetAsDefaultSearchEngineIdentifier); [[[EarlGrey selectElementWithMatcher:primaryButtonMatcher] assertWithMatcher:grey_notNil()] performAction:grey_tap()]; } @@ -1266,20 +1282,16 @@ // Checks that the choice screen is shown [self verifyChoiceScreenOrDefaultBrowserIsDisplayed]; // Verifies that the primary button is initially disabled. - id<GREYMatcher> primaryButtonMatcher = grey_buttonTitle( - l10n_util::GetNSString(IDS_SEARCH_ENGINE_CHOICE_BUTTON_TITLE)); + id<GREYMatcher> primaryButtonMatcher = + grey_accessibilityID(kSetAsDefaultSearchEngineIdentifier); [[EarlGrey selectElementWithMatcher:primaryButtonMatcher] assertWithMatcher:grey_allOf(grey_not(grey_enabled()), grey_notNil(), nil)]; // Selects a search engine. - id<GREYMatcher> bingRowMatcher = grey_allOf( - grey_userInteractionEnabled(), grey_accessibilityLabel(@"Bing"), nil); - [[[EarlGrey selectElementWithMatcher:bingRowMatcher] - assertWithMatcher:grey_notNil()] performAction:grey_tap()]; + NSString* searchEngineToSelect = @"Bing"; + SelectSearchEngineCellWithName(searchEngineToSelect); // Taps the primary button again. - [[[EarlGrey - selectElementWithMatcher:grey_buttonTitle(l10n_util::GetNSString( - IDS_SEARCH_ENGINE_CHOICE_BUTTON_TITLE))] + [[[EarlGrey selectElementWithMatcher:primaryButtonMatcher] assertWithMatcher:grey_notNil()] performAction:grey_tap()]; DismissScreensAfterChoiceScreen(); @@ -1290,8 +1302,9 @@ // name appears in the name of the selected row. [[EarlGrey selectElementWithMatcher:chrome_test_util::SettingsSearchEngineButton()] - assertWithMatcher:grey_allOf(grey_accessibilityValue(@"Bing"), - grey_notNil(), nil)]; + assertWithMatcher:grey_allOf( + grey_accessibilityValue(searchEngineToSelect), + grey_notNil(), nil)]; } #pragma mark - Helper
diff --git a/ios/chrome/browser/ui/first_run/omnibox_position/BUILD.gn b/ios/chrome/browser/ui/first_run/omnibox_position/BUILD.gn index aaef756..a3256ada 100644 --- a/ios/chrome/browser/ui/first_run/omnibox_position/BUILD.gn +++ b/ios/chrome/browser/ui/first_run/omnibox_position/BUILD.gn
@@ -55,6 +55,7 @@ "//build:branding_buildflags", "//components/search_engines", "//ios/chrome/app/strings", + "//ios/chrome/browser/promos_manager:features", "//ios/chrome/browser/shared/model/prefs:pref_names", "//ios/chrome/browser/shared/public/features", "//ios/chrome/browser/ui/authentication:eg_test_support+eg2",
diff --git a/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_choice_coordinator.mm b/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_choice_coordinator.mm index 2ea3b381..3d45ce2 100644 --- a/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_choice_coordinator.mm +++ b/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_choice_coordinator.mm
@@ -64,7 +64,8 @@ ->GetOriginalChromeBrowserState() ->GetPrefs(); - _viewController = [[OmniboxPositionChoiceViewController alloc] init]; + _viewController = + [[OmniboxPositionChoiceViewController alloc] initWithFirstRun:_firstRun]; _viewController.modalInPresentation = YES; _viewController.delegate = self; _viewController.mutator = _mediator;
diff --git a/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_choice_view_controller.h b/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_choice_view_controller.h index 26b41bbb..52d20c9 100644 --- a/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_choice_view_controller.h +++ b/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_choice_view_controller.h
@@ -17,6 +17,9 @@ /// Mutator of the omnibox position choice model. @property(nonatomic, weak) id<OmniboxPositionChoiceMutator> mutator; +/// Initializes the view controller. The UI changes depending on `isFirstRun`. +- (instancetype)initWithFirstRun:(BOOL)isFirstRun; + @end #endif // IOS_CHROME_BROWSER_UI_FIRST_RUN_OMNIBOX_POSITION_OMNIBOX_POSITION_CHOICE_VIEW_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_choice_view_controller.mm b/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_choice_view_controller.mm index 42024b8..4feefd24 100644 --- a/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_choice_view_controller.mm +++ b/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_choice_view_controller.mm
@@ -19,11 +19,13 @@ AddressBarOptionView* _topAddressBar; /// The view for the bottom address bar preference option. AddressBarOptionView* _bottomAddressBar; + /// Whether the screen is being shown in the FRE. + BOOL _isFirstRun; } #pragma mark - UIViewController -- (instancetype)init { +- (instancetype)initWithFirstRun:(BOOL)isFirstRun { self = [super init]; if (self) { _topAddressBar = [[AddressBarOptionView alloc] @@ -34,6 +36,7 @@ initWithSymbolName:kBottomOmniboxOptionSymbol labelText:l10n_util::GetNSString( IDS_IOS_BOTTOM_ADDRESS_BAR_OPTION)]; + _isFirstRun = isFirstRun; } return self; } @@ -47,7 +50,13 @@ self.titleText = @"**Tailor to Your Needs**"; self.subtitleText = @"**Decide the position of the search bar to tailor your " @"needs and browsing habits**"; - self.primaryActionString = @"**Finish**"; + if (_isFirstRun) { + self.primaryActionString = @"**Finish**"; + self.secondaryActionString = nil; + } else { + self.primaryActionString = @"**Confirm**"; + self.secondaryActionString = @"**No, thanks**"; + } [_topAddressBar addTarget:self action:@selector(didTapTopAddressBarView)
diff --git a/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_egtest.mm b/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_egtest.mm index e212c6bb..a0f9f74 100644 --- a/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_egtest.mm +++ b/ios/chrome/browser/ui/first_run/omnibox_position/omnibox_position_egtest.mm
@@ -7,6 +7,7 @@ #import "base/strings/sys_string_conversions.h" #import "build/branding_buildflags.h" #import "components/search_engines/search_engines_switches.h" +#import "ios/chrome/browser/promos_manager/features.h" #import "ios/chrome/browser/shared/model/prefs/pref_names.h" #import "ios/chrome/browser/shared/public/features/features.h" #import "ios/chrome/browser/ui/authentication/signin_matchers.h" @@ -86,8 +87,10 @@ } // namespace -@interface OmniboxPositionFirstRunTestCase : ChromeTestCase +#pragma mark - FRE promo +/// Tests the omnibox position choice screen in FRE promo. +@interface OmniboxPositionFirstRunTestCase : ChromeTestCase @end @implementation OmniboxPositionFirstRunTestCase @@ -95,6 +98,7 @@ - (void)setUp { [[self class] testForStartup]; [super setUp]; + [ChromeEarlGrey clearUserPrefWithName:prefs::kBottomOmnibox]; } - (AppLaunchConfiguration)appConfigurationForTestCase { @@ -136,7 +140,7 @@ return config; } -#pragma mark - First run tests +#pragma mark Tests // Tests selecting top omnibox in FRE when top is selected by default. - (void)testSelectTopWithTopDefault { @@ -239,3 +243,84 @@ } @end + +#pragma mark - App-launch promo + +/// The the omnibox position choice screen in app-launch promo. +@interface OmniboxPositionAppLaunchTestCase : ChromeTestCase +@end + +@implementation OmniboxPositionAppLaunchTestCase + +- (void)setUp { + [[self class] testForStartup]; + [super setUp]; + [ChromeEarlGrey clearUserPrefWithName:prefs::kBottomOmnibox]; +} + +- (AppLaunchConfiguration)appConfigurationForTestCase { + AppLaunchConfiguration config; + config.additional_args.push_back("-enable-promo-manager-fullscreen-promos"); + // Override trigger requirements to force the promo to appear. + config.additional_args.push_back("-NextPromoForDisplayOverride"); + config.additional_args.push_back("promos_manager::Promo::OmniboxPosition"); + config.relaunch_policy = ForceRelaunchByCleanShutdown; + + // Disable FET in promo manager as the initialization takes too much time and + // causes the test to fail (crbug.com/1505431). + config.features_disabled.push_back(kPromosManagerUsesFET); + + std::string bottomOptionByDefault = + std::string(kBottomOmniboxPromoDefaultPosition.name) + ":" + + kBottomOmniboxPromoDefaultPositionParam + "/" + + kBottomOmniboxPromoDefaultPositionParamBottom; + + config.additional_args.push_back( + "--enable-features=" + bottomOptionByDefault + "," + + kBottomOmniboxPromoAppLaunch.name); + + return config; +} + +#pragma mark Tests + +/// Tests confirming the default omnibox option in app-launch promo. +- (void)testConfirmDefaultOption { + if ([ChromeEarlGrey isIPadIdiom]) { + EARL_GREY_TEST_SKIPPED( + @"Skipped for iPad (no choice for omnibox position on tablet)"); + } + + // The bottom address bar option should be selected. + [[EarlGrey selectElementWithMatcher:BottomAddressBarOptionSelected()] + assertWithMatcher:grey_notNil()]; + + // Confirm selection. + TapPromoStyleButton(kPromoStylePrimaryActionAccessibilityIdentifier); + + // Verify that the preferred omnibox position is bottom. + GREYAssertTrue([ChromeEarlGrey userBooleanPref:prefs::kBottomOmnibox], + @"Failed to set preferred omnibox position to bottom"); +} + +/// Tests discarding the omnibox position choice app-launch promo. +- (void)testNoThanks { + if ([ChromeEarlGrey isIPadIdiom]) { + EARL_GREY_TEST_SKIPPED( + @"Skipped for iPad (no choice for omnibox position on tablet)"); + } + + // The bottom address bar option should be selected. + [[EarlGrey selectElementWithMatcher:BottomAddressBarOptionSelected()] + assertWithMatcher:grey_notNil()]; + + // Discard selection. + TapPromoStyleButton(kPromoStyleSecondaryActionAccessibilityIdentifier); + + // Verify that there is no user preferred omnibox position. + GREYAssertTrue( + [ChromeEarlGrey prefWithNameIsDefaultValue:prefs::kBottomOmnibox], + @"Failed to discard the selected position"); +} + +@end
diff --git a/ios/chrome/browser/ui/history/BUILD.gn b/ios/chrome/browser/ui/history/BUILD.gn index b13aec20..58f6907c 100644 --- a/ios/chrome/browser/ui/history/BUILD.gn +++ b/ios/chrome/browser/ui/history/BUILD.gn
@@ -19,7 +19,7 @@ "//components/history/core/browser", "//components/keyed_service/core", "//ios/chrome/browser/favicon", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/net:crurl", "//ios/chrome/browser/policy:policy_util", "//ios/chrome/browser/shared/coordinator/alert", @@ -118,7 +118,7 @@ "//base", "//components/browsing_data/core", "//components/history/core/browser", - "//ios/chrome/browser/history:history_utils", + "//ios/chrome/browser/history/model:utils", "//url", ] }
diff --git a/ios/chrome/browser/ui/history/history_coordinator.mm b/ios/chrome/browser/ui/history/history_coordinator.mm index 00b4815..ef5baab 100644 --- a/ios/chrome/browser/ui/history/history_coordinator.mm +++ b/ios/chrome/browser/ui/history/history_coordinator.mm
@@ -9,8 +9,8 @@ #import "components/history/core/browser/browsing_history_service.h" #import "components/keyed_service/core/service_access_type.h" #import "components/sync/service/sync_service.h" -#import "ios/chrome/browser/history/history_service_factory.h" -#import "ios/chrome/browser/history/web_history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" +#import "ios/chrome/browser/history/model/web_history_service_factory.h" #import "ios/chrome/browser/net/crurl.h" #import "ios/chrome/browser/policy/policy_util.h" #import "ios/chrome/browser/shared/coordinator/alert/action_sheet_coordinator.h"
diff --git a/ios/chrome/browser/ui/history/history_entry_item.mm b/ios/chrome/browser/ui/history/history_entry_item.mm index 5f8d044..d87783b 100644 --- a/ios/chrome/browser/ui/history/history_entry_item.mm +++ b/ios/chrome/browser/ui/history/history_entry_item.mm
@@ -54,6 +54,7 @@ cell.metadataLabel.text = self.timeText; cell.isAccessibilityElement = YES; cell.accessibilityCustomActions = self.accessibilityActions; + cell.accessibilityTraits |= UIAccessibilityTraitButton; [cell configureUILayout]; }
diff --git a/ios/chrome/browser/ui/history/ios_browsing_history_driver.mm b/ios/chrome/browser/ui/history/ios_browsing_history_driver.mm index f932c7fd..e0da46a 100644 --- a/ios/chrome/browser/ui/history/ios_browsing_history_driver.mm +++ b/ios/chrome/browser/ui/history/ios_browsing_history_driver.mm
@@ -9,7 +9,7 @@ #import "base/check.h" #import "base/strings/utf_string_conversions.h" #import "components/browsing_data/core/history_notice_utils.h" -#import "ios/chrome/browser/history/history_utils.h" +#import "ios/chrome/browser/history/model/history_utils.h" #import "ios/chrome/browser/ui/history/history_consumer.h" #import "ios/chrome/browser/ui/history/ios_browsing_history_driver_delegate.h"
diff --git a/ios/chrome/browser/ui/location_bar/BUILD.gn b/ios/chrome/browser/ui/location_bar/BUILD.gn index ead4fd6..7fffd69a6 100644 --- a/ios/chrome/browser/ui/location_bar/BUILD.gn +++ b/ios/chrome/browser/ui/location_bar/BUILD.gn
@@ -157,7 +157,7 @@ "//ios/chrome/app/strings", "//ios/chrome/browser/autocomplete/model", "//ios/chrome/browser/favicon", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/overlays/model", "//ios/chrome/browser/overlays/model/public/web_content_area", "//ios/chrome/browser/overlays/model/test",
diff --git a/ios/chrome/browser/ui/location_bar/location_bar_coordinator_unittest.mm b/ios/chrome/browser/ui/location_bar/location_bar_coordinator_unittest.mm index 7acab7c..8bedd99f 100644 --- a/ios/chrome/browser/ui/location_bar/location_bar_coordinator_unittest.mm +++ b/ios/chrome/browser/ui/location_bar/location_bar_coordinator_unittest.mm
@@ -15,7 +15,7 @@ #import "ios/chrome/browser/favicon/favicon_service_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/search_engines/model/template_url_service_factory.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h"
diff --git a/ios/chrome/browser/ui/main/BUILD.gn b/ios/chrome/browser/ui/main/BUILD.gn index 1018077..4f1d3a8 100644 --- a/ios/chrome/browser/ui/main/BUILD.gn +++ b/ios/chrome/browser/ui/main/BUILD.gn
@@ -155,7 +155,7 @@ "//ios/chrome/browser/default_browser/model:test_support", "//ios/chrome/browser/default_browser/model:utils", "//ios/chrome/browser/favicon", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/main/model", "//ios/chrome/browser/prerender/model", "//ios/chrome/browser/promos_manager:constants",
diff --git a/ios/chrome/browser/ui/main/browser_view_wrangler_unittest.mm b/ios/chrome/browser/ui/main/browser_view_wrangler_unittest.mm index 3cc7ba4..c62c941 100644 --- a/ios/chrome/browser/ui/main/browser_view_wrangler_unittest.mm +++ b/ios/chrome/browser/ui/main/browser_view_wrangler_unittest.mm
@@ -14,7 +14,7 @@ #import "ios/chrome/browser/favicon/favicon_service_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/prerender/model/prerender_service_factory.h" #import "ios/chrome/browser/search_engines/model/template_url_service_factory.h" #import "ios/chrome/browser/sessions/session_restoration_observer.h"
diff --git a/ios/chrome/browser/ui/omnibox/BUILD.gn b/ios/chrome/browser/ui/omnibox/BUILD.gn index ceed596..c96c6c5 100644 --- a/ios/chrome/browser/ui/omnibox/BUILD.gn +++ b/ios/chrome/browser/ui/omnibox/BUILD.gn
@@ -217,7 +217,7 @@ "//components/search_engines", "//components/variations:variations", "//ios/chrome/browser/autocomplete/model", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/search_engines/model", "//ios/chrome/browser/search_engines/model:template_url_service_factory", "//ios/chrome/browser/shared/model/browser_state",
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_app_interface.mm b/ios/chrome/browser/ui/omnibox/omnibox_app_interface.mm index 73104f1..21b182e5 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_app_interface.mm +++ b/ios/chrome/browser/ui/omnibox/omnibox_app_interface.mm
@@ -16,7 +16,7 @@ #import "components/variations/variations_ids_provider.h" #import "ios/chrome/browser/autocomplete/model/remote_suggestions_service_factory.h" #import "ios/chrome/browser/autocomplete/model/shortcuts_backend_factory.h" -#import "ios/chrome/browser/history/top_sites_factory.h" +#import "ios/chrome/browser/history/model/top_sites_factory.h" #import "ios/chrome/browser/search_engines/model/template_url_service_factory.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/ui/omnibox/test_fake_suggestions_service.h"
diff --git a/ios/chrome/browser/ui/omnibox/popup/BUILD.gn b/ios/chrome/browser/ui/omnibox/popup/BUILD.gn index 7e6f7e03..860acb0 100644 --- a/ios/chrome/browser/ui/omnibox/popup/BUILD.gn +++ b/ios/chrome/browser/ui/omnibox/popup/BUILD.gn
@@ -74,7 +74,7 @@ "//ios/chrome/browser/default_browser/model:utils", "//ios/chrome/browser/favicon", "//ios/chrome/browser/feature_engagement/model", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/net:crurl", "//ios/chrome/browser/ntp/model", "//ios/chrome/browser/ntp/model:util",
diff --git a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_coordinator.mm b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_coordinator.mm index a0655d2..f457480 100644 --- a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_coordinator.mm +++ b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_coordinator.mm
@@ -17,7 +17,7 @@ #import "ios/chrome/browser/favicon/ios_chrome_large_icon_cache_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h" #import "ios/chrome/browser/feature_engagement/model/tracker_factory.h" -#import "ios/chrome/browser/history/top_sites_factory.h" +#import "ios/chrome/browser/history/model/top_sites_factory.h" #import "ios/chrome/browser/net/crurl.h" #import "ios/chrome/browser/policy/policy_util.h" #import "ios/chrome/browser/search_engines/model/template_url_service_factory.h"
diff --git a/ios/chrome/browser/ui/passwords/bottom_sheet/BUILD.gn b/ios/chrome/browser/ui/passwords/bottom_sheet/BUILD.gn index 83cd335..ec37634 100644 --- a/ios/chrome/browser/ui/passwords/bottom_sheet/BUILD.gn +++ b/ios/chrome/browser/ui/passwords/bottom_sheet/BUILD.gn
@@ -162,7 +162,7 @@ "//ios/chrome/app/strings", "//ios/chrome/browser/autofill/model", "//ios/chrome/browser/favicon", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/passwords/model", "//ios/chrome/browser/passwords/model:store_factory", "//ios/chrome/browser/shared/model/browser_state:test_support",
diff --git a/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_mediator_unittest.mm b/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_mediator_unittest.mm index b1c9603..cd5258f 100644 --- a/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_mediator_unittest.mm +++ b/ios/chrome/browser/ui/passwords/bottom_sheet/password_suggestion_bottom_sheet_mediator_unittest.mm
@@ -19,7 +19,7 @@ #import "ios/chrome/browser/favicon/favicon_service_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/passwords/model/ios_chrome_account_password_store_factory.h" #import "ios/chrome/browser/passwords/model/ios_chrome_password_check_manager.h" #import "ios/chrome/browser/passwords/model/ios_chrome_password_check_manager_factory.h"
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_account_storage_egtest.mm b/ios/chrome/browser/ui/reading_list/reading_list_account_storage_egtest.mm index 65d14e90..a6b23d1 100644 --- a/ios/chrome/browser/ui/reading_list/reading_list_account_storage_egtest.mm +++ b/ios/chrome/browser/ui/reading_list/reading_list_account_storage_egtest.mm
@@ -145,8 +145,6 @@ - (AppLaunchConfiguration)appConfigurationForTestCase { AppLaunchConfiguration config; config.features_enabled.push_back( - syncer::kReadingListEnableDualReadingListModel); - config.features_enabled.push_back( syncer::kReadingListEnableSyncTransportModeUponSignIn); if ([self isRunningTest:@selector (testSignInWithSecondaryAccountInPromo_WithSnackbar)] ||
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm b/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm index 483da99..965d29a 100644 --- a/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm +++ b/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm
@@ -625,8 +625,6 @@ - (void)updateSignInPromoVisibility { BOOL areAccountStorageAndPromoEnabled = base::FeatureList::IsEnabled( - syncer::kReadingListEnableDualReadingListModel) && - base::FeatureList::IsEnabled( syncer::kReadingListEnableSyncTransportModeUponSignIn); if (!areAccountStorageAndPromoEnabled || self.isSyncDisabledByAdministrator) { self.shouldShowSignInPromo = NO;
diff --git a/ios/chrome/browser/ui/recent_tabs/BUILD.gn b/ios/chrome/browser/ui/recent_tabs/BUILD.gn index 37b5bea46..befbf3e 100644 --- a/ios/chrome/browser/ui/recent_tabs/BUILD.gn +++ b/ios/chrome/browser/ui/recent_tabs/BUILD.gn
@@ -142,7 +142,7 @@ "//ios/chrome/app/application_delegate:app_state_header", "//ios/chrome/app/application_delegate:test_support", "//ios/chrome/browser/favicon", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/sessions", "//ios/chrome/browser/shared/coordinator/scene:scene_state_header", "//ios/chrome/browser/shared/model/application_context",
diff --git a/ios/chrome/browser/ui/recent_tabs/recent_tabs_coordinator_unittest.mm b/ios/chrome/browser/ui/recent_tabs/recent_tabs_coordinator_unittest.mm index 30d5195..f4cc219 100644 --- a/ios/chrome/browser/ui/recent_tabs/recent_tabs_coordinator_unittest.mm +++ b/ios/chrome/browser/ui/recent_tabs/recent_tabs_coordinator_unittest.mm
@@ -28,7 +28,7 @@ #import "ios/chrome/browser/favicon/favicon_service_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.h" #import "ios/chrome/browser/shared/coordinator/scene/scene_state.h" #import "ios/chrome/browser/shared/model/application_context/application_context.h"
diff --git a/ios/chrome/browser/ui/search_engine_choice/BUILD.gn b/ios/chrome/browser/ui/search_engine_choice/BUILD.gn index e9a4521..a54b9d2 100644 --- a/ios/chrome/browser/ui/search_engine_choice/BUILD.gn +++ b/ios/chrome/browser/ui/search_engine_choice/BUILD.gn
@@ -15,6 +15,7 @@ "search_engine_choice_view_controller.mm", ] deps = [ + ":constants", "//base", "//components/search_engines", "//components/strings", @@ -40,6 +41,14 @@ frameworks = [ "UIKit.framework" ] } +source_set("constants") { + sources = [ + "search_engine_choice_constants.h", + "search_engine_choice_constants.mm", + ] + deps = [ "//base" ] +} + source_set("unit_tests") { testonly = true sources = [ "search_engine_choice_coordinator_unittest.mm" ] @@ -52,7 +61,7 @@ "//components/strings", "//components/sync_preferences:test_support", "//ios/chrome/browser/favicon", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/promos_manager:test_support", "//ios/chrome/browser/search_engines/model:template_url_service_factory", "//ios/chrome/browser/shared/model/browser/test:test_support",
diff --git a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_constants.h b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_constants.h new file mode 100644 index 0000000..e8d166f0 --- /dev/null +++ b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_constants.h
@@ -0,0 +1,17 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_SEARCH_ENGINE_CHOICE_SEARCH_ENGINE_CHOICE_CONSTANTS_H_ +#define IOS_CHROME_BROWSER_UI_SEARCH_ENGINE_CHOICE_SEARCH_ENGINE_CHOICE_CONSTANTS_H_ + +#import <UIKit/UIKit.h> + +// Prefix for the SearchEngineCell accessibility identifier. +extern NSString* const kSnippetSearchEngineIdentifierPrefix; +// `Set as Default` button accessibility identifier. +extern NSString* const kSetAsDefaultSearchEngineIdentifier; +// Search engine table view identifier. +extern NSString* const kSearchEngineTableViewIdentifier; + +#endif // IOS_CHROME_BROWSER_UI_SEARCH_ENGINE_CHOICE_SEARCH_ENGINE_CHOICE_CONSTANTS_H_
diff --git a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_constants.mm b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_constants.mm new file mode 100644 index 0000000..771acd6 --- /dev/null +++ b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_constants.mm
@@ -0,0 +1,12 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/ui/search_engine_choice/search_engine_choice_constants.h" + +NSString* const kSnippetSearchEngineIdentifierPrefix = + @"SnippetSearchEngineIdentifierPrefix_"; +NSString* const kSetAsDefaultSearchEngineIdentifier = + @"SetAsDefaultSearchEngineIdentifier"; +NSString* const kSearchEngineTableViewIdentifier = + @"SearchEngineTableViewIdentifier";
diff --git a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_coordinator_unittest.mm b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_coordinator_unittest.mm index 89d7b36..a31db09 100644 --- a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_coordinator_unittest.mm +++ b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_coordinator_unittest.mm
@@ -19,7 +19,7 @@ #import "ios/chrome/browser/favicon/favicon_service_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/promos_manager/mock_promos_manager.h" #import "ios/chrome/browser/search_engines/model/template_url_service_factory.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h"
diff --git a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/BUILD.gn b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/BUILD.gn index cb87655..cebb8aa 100644 --- a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/BUILD.gn +++ b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/BUILD.gn
@@ -25,6 +25,7 @@ "//ios/chrome/browser/shared/ui/table_view", "//ios/chrome/browser/shared/ui/table_view:styler", "//ios/chrome/browser/shared/ui/table_view:utils", + "//ios/chrome/browser/ui/search_engine_choice:constants", "//ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/cells", "//ios/chrome/common/ui/colors", "//ios/chrome/common/ui/favicon",
diff --git a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/cells/BUILD.gn b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/cells/BUILD.gn index c4c77a31..eebabaa 100644 --- a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/cells/BUILD.gn +++ b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/cells/BUILD.gn
@@ -15,6 +15,7 @@ "//ios/chrome/browser/shared/ui/table_view:styler", "//ios/chrome/browser/shared/ui/table_view/cells", "//ios/chrome/browser/shared/ui/util", + "//ios/chrome/browser/ui/search_engine_choice:constants", "//ios/chrome/browser/ui/settings/cells:public", "//ios/chrome/common/ui/colors", "//ios/chrome/common/ui/favicon",
diff --git a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/cells/snippet_search_engine_cell.mm b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/cells/snippet_search_engine_cell.mm index b19f8f6..105d189 100644 --- a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/cells/snippet_search_engine_cell.mm +++ b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/cells/snippet_search_engine_cell.mm
@@ -5,6 +5,7 @@ #import "ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/cells/snippet_search_engine_cell.h" #import "base/check.h" +#import "ios/chrome/browser/ui/search_engine_choice/search_engine_choice_constants.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h" #import "ios/chrome/common/ui/favicon/favicon_container_view.h" #import "ios/chrome/common/ui/favicon/favicon_view.h" @@ -124,7 +125,9 @@ } - (NSString*)accessibilityIdentifier { - return self.nameLabel.text; + return + [NSString stringWithFormat:@"%@%@", kSnippetSearchEngineIdentifierPrefix, + self.nameLabel.text]; } - (BOOL)isAccessibilityElement {
diff --git a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/search_engine_choice_table_mediator.mm b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/search_engine_choice_table_mediator.mm index 91beef4..38d45068 100644 --- a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/search_engine_choice_table_mediator.mm +++ b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/search_engine_choice_table_mediator.mm
@@ -39,10 +39,9 @@ item.URL = template_url->favicon_url(); } item.name = base::SysUTF16ToNSString(template_url->short_name()); - item.snippetDescription = [[NSString alloc] - initWithFormat:@"** Description for %@ that can be very very very very " - @"very very long. **", - item.name]; + std::u16string string = + search_engines::GetMarketingSnippetString(template_url->data()); + item.snippetDescription = base::SysUTF16ToNSString(string); return item; }
diff --git a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/search_engine_choice_table_view_controller.mm b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/search_engine_choice_table_view_controller.mm index 64c8559..3748d83 100644 --- a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/search_engine_choice_table_view_controller.mm +++ b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/search_engine_choice_table_view_controller.mm
@@ -10,6 +10,7 @@ #import "ios/chrome/browser/shared/ui/symbols/symbols.h" #import "ios/chrome/browser/shared/ui/table_view/legacy_chrome_table_view_styler.h" #import "ios/chrome/browser/shared/ui/table_view/table_view_utils.h" +#import "ios/chrome/browser/ui/search_engine_choice/search_engine_choice_constants.h" #import "ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/cells/snippet_search_engine_cell.h" #import "ios/chrome/browser/ui/search_engine_choice/search_engine_choice_table/cells/snippet_search_engine_item.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h" @@ -81,18 +82,19 @@ - (void)viewDidLoad { [super viewDidLoad]; + UITableView* tableView = self.tableView; + tableView.accessibilityIdentifier = kSearchEngineTableViewIdentifier; // With no header on first appearance, UITableView adds a 35 points space at // the beginning of the table view. This space remains after this table view // reloads with headers. Setting a small tableHeaderView avoids this. - self.tableView.tableHeaderView = + tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, CGFLOAT_MIN)]; - - self.tableView.separatorInset = + tableView.separatorInset = UIEdgeInsetsMake(0, kTableViewSeparatorLeadingInset, 0, 0); - self.tableView.backgroundColor = [UIColor colorNamed:kPrimaryBackgroundColor]; + tableView.backgroundColor = [UIColor colorNamed:kPrimaryBackgroundColor]; self.styler.cellBackgroundColor = [UIColor colorNamed:kTertiaryBackgroundColor]; - self.tableView.separatorColor = [UIColor colorNamed:kGrey300Color]; + tableView.separatorColor = [UIColor colorNamed:kGrey300Color]; [self loadModel]; }
diff --git a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_ui_util.mm b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_ui_util.mm index 2b77fe8..6cb0256 100644 --- a/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_ui_util.mm +++ b/ios/chrome/browser/ui/search_engine_choice/search_engine_choice_ui_util.mm
@@ -9,6 +9,7 @@ #import "components/strings/grit/components_strings.h" #import "ios/chrome/browser/shared/ui/symbols/symbols.h" #import "ios/chrome/browser/shared/ui/util/uikit_ui_util.h" +#import "ios/chrome/browser/ui/search_engine_choice/search_engine_choice_constants.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h" #import "ios/chrome/common/ui/util/button_util.h" #import "ios/chrome/common/ui/util/device_util.h" @@ -199,7 +200,7 @@ button.configuration = buttonConfiguration; button.translatesAutoresizingMaskIntoConstraints = NO; button.enabled = NO; - + button.accessibilityIdentifier = kSetAsDefaultSearchEngineIdentifier; return button; }
diff --git a/ios/chrome/browser/ui/settings/BUILD.gn b/ios/chrome/browser/ui/settings/BUILD.gn index ec13770b..c2e1e19 100644 --- a/ios/chrome/browser/ui/settings/BUILD.gn +++ b/ios/chrome/browser/ui/settings/BUILD.gn
@@ -128,7 +128,7 @@ "//ios/chrome/browser/default_browser/model:utils", "//ios/chrome/browser/favicon", "//ios/chrome/browser/feature_engagement/model", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/language/model", "//ios/chrome/browser/main/model", "//ios/chrome/browser/net:crurl", @@ -336,7 +336,7 @@ "//ios/chrome/browser/browsing_data/model:counters", "//ios/chrome/browser/content_settings/model", "//ios/chrome/browser/favicon", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/passwords/model", "//ios/chrome/browser/policy:policy_util", "//ios/chrome/browser/policy:test_support",
diff --git a/ios/chrome/browser/ui/settings/autofill/autofill_profile_settings_egtest.mm b/ios/chrome/browser/ui/settings/autofill/autofill_profile_settings_egtest.mm index 03626d3..69a8b35c 100644 --- a/ios/chrome/browser/ui/settings/autofill/autofill_profile_settings_egtest.mm +++ b/ios/chrome/browser/ui/settings/autofill/autofill_profile_settings_egtest.mm
@@ -146,8 +146,6 @@ if ([self isRunningTest:@selector(testMigrateToAccount)] || [self isRunningTest:@selector(testIncompleteProfileMigrateToAccount)]) { config.features_enabled.push_back( - autofill::features::kAutofillRequireNameForProfileImport); - config.features_enabled.push_back( syncer::kSyncEnableContactInfoDataTypeInTransportMode); }
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data/BUILD.gn b/ios/chrome/browser/ui/settings/clear_browsing_data/BUILD.gn index 71c12c8..3e7c0f8 100644 --- a/ios/chrome/browser/ui/settings/clear_browsing_data/BUILD.gn +++ b/ios/chrome/browser/ui/settings/clear_browsing_data/BUILD.gn
@@ -36,7 +36,7 @@ "//ios/chrome/browser/discover_feed", "//ios/chrome/browser/discover_feed:discover_feed_factory", "//ios/chrome/browser/feature_engagement/model", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/intents:intents_donation_helper", "//ios/chrome/browser/net:crurl", "//ios/chrome/browser/search_engines/model",
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.mm b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.mm index 1b53fab..eb44776 100644 --- a/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.mm +++ b/ios/chrome/browser/ui/settings/clear_browsing_data/clear_browsing_data_manager.mm
@@ -30,7 +30,7 @@ #import "ios/chrome/browser/browsing_data/model/browsing_data_remover_factory.h" #import "ios/chrome/browser/browsing_data/model/browsing_data_remover_observer_bridge.h" #import "ios/chrome/browser/feature_engagement/model/tracker_factory.h" -#import "ios/chrome/browser/history/web_history_service_factory.h" +#import "ios/chrome/browser/history/model/web_history_service_factory.h" #import "ios/chrome/browser/net/crurl.h" #import "ios/chrome/browser/search_engines/model/template_url_service_factory.h" #import "ios/chrome/browser/shared/coordinator/alert/action_sheet_coordinator.h"
diff --git a/ios/chrome/browser/ui/settings/password/password_details/BUILD.gn b/ios/chrome/browser/ui/settings/password/password_details/BUILD.gn index 5c51dd57..b7dc8302 100644 --- a/ios/chrome/browser/ui/settings/password/password_details/BUILD.gn +++ b/ios/chrome/browser/ui/settings/password/password_details/BUILD.gn
@@ -13,7 +13,7 @@ "password_details_coordinator.h", "password_details_coordinator.mm", "password_details_coordinator_delegate.h", - "password_details_mediator+private.h", + "password_details_mediator+Testing.h", "password_details_mediator.h", "password_details_mediator.mm", "password_details_mediator_delegate.h",
diff --git a/ios/chrome/browser/ui/settings/password/password_details/password_details_coordinator.mm b/ios/chrome/browser/ui/settings/password/password_details/password_details_coordinator.mm index cb47695..1c88de3c 100644 --- a/ios/chrome/browser/ui/settings/password/password_details/password_details_coordinator.mm +++ b/ios/chrome/browser/ui/settings/password/password_details/password_details_coordinator.mm
@@ -37,7 +37,6 @@ #import "ios/chrome/browser/ui/settings/password/password_details/password_details_consumer.h" #import "ios/chrome/browser/ui/settings/password/password_details/password_details_coordinator_delegate.h" #import "ios/chrome/browser/ui/settings/password/password_details/password_details_handler.h" -#import "ios/chrome/browser/ui/settings/password/password_details/password_details_mediator+private.h" #import "ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.h" #import "ios/chrome/browser/ui/settings/password/password_details/password_details_mediator_delegate.h" #import "ios/chrome/browser/ui/settings/password/password_details/password_details_table_view_controller.h"
diff --git a/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator+Testing.h b/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator+Testing.h new file mode 100644 index 0000000..f5310a7 --- /dev/null +++ b/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator+Testing.h
@@ -0,0 +1,18 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_PASSWORD_PASSWORD_DETAILS_PASSWORD_DETAILS_MEDIATOR_TESTING_H_ +#define IOS_CHROME_BROWSER_UI_SETTINGS_PASSWORD_PASSWORD_DETAILS_PASSWORD_DETAILS_MEDIATOR_TESTING_H_ + +#import "ios/chrome/browser/ui/settings/password/password_details/password_details.h" + +// Testing category to expose a private property used for tests. +@interface PasswordDetailsMediator (Testing) + +// The context in which the password details are accessed. +@property(nonatomic, assign) DetailsContext context; + +@end + +#endif // IOS_CHROME_BROWSER_UI_SETTINGS_PASSWORD_PASSWORD_DETAILS_PASSWORD_DETAILS_MEDIATOR_TESTING_H_
diff --git a/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator+private.h b/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator+private.h deleted file mode 100644 index 2df3b67..0000000 --- a/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator+private.h +++ /dev/null
@@ -1,23 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_PASSWORD_PASSWORD_DETAILS_PASSWORD_DETAILS_MEDIATOR_PRIVATE_H_ -#define IOS_CHROME_BROWSER_UI_SETTINGS_PASSWORD_PASSWORD_DETAILS_PASSWORD_DETAILS_MEDIATOR_PRIVATE_H_ - -#import "ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.h" - -// This is a private extension that is intended to expose otherwise private -// members for testing. -@interface PasswordDetailsMediator () - -// The credentials to be displayed in the page. -@property(nonatomic, assign) std::vector<password_manager::CredentialUIEntry> - credentials; - -// The context in which the password details are accessed. -@property(nonatomic, assign) DetailsContext context; - -@end - -#endif // IOS_CHROME_BROWSER_UI_SETTINGS_PASSWORD_PASSWORD_DETAILS_PASSWORD_DETAILS_MEDIATOR_PRIVATE_H_
diff --git a/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.h b/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.h index 07ca828..99c5c4d 100644 --- a/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.h +++ b/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.h
@@ -25,6 +25,13 @@ @interface PasswordDetailsMediator : NSObject <PasswordDetailsTableViewControllerDelegate> +// Consumer of this mediator. +@property(nonatomic, weak) id<PasswordDetailsConsumer> consumer; + +// The credentials to be displayed in the page. +@property(nonatomic, assign) std::vector<password_manager::CredentialUIEntry> + credentials; + // Vector of CredentialUIEntry is converted to an array of PasswordDetails and // passed to a consumer with the display name (title) for the Password Details // view. @@ -36,12 +43,8 @@ context:(DetailsContext)context delegate:(id<PasswordDetailsMediatorDelegate>)delegate NS_DESIGNATED_INITIALIZER; - - (instancetype)init NS_UNAVAILABLE; -// Consumer of this mediator. -@property(nonatomic, weak) id<PasswordDetailsConsumer> consumer; - // Disconnects the mediator from all observers. - (void)disconnect;
diff --git a/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.mm b/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.mm index 83c84cd..d7cdcbc 100644 --- a/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.mm +++ b/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.mm
@@ -3,6 +3,7 @@ // found in the LICENSE file. #import "ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.h" +#import "ios/chrome/browser/ui/settings/password/password_details/password_details_mediator+Testing.h" #import <memory> #import <utility> @@ -32,7 +33,6 @@ #import "ios/chrome/browser/ui/settings/password/account_storage_utils.h" #import "ios/chrome/browser/ui/settings/password/password_details/password_details.h" #import "ios/chrome/browser/ui/settings/password/password_details/password_details_consumer.h" -#import "ios/chrome/browser/ui/settings/password/password_details/password_details_mediator+private.h" #import "ios/chrome/browser/ui/settings/password/password_details/password_details_mediator_delegate.h" #import "ios/chrome/browser/ui/settings/password/password_details/password_details_metrics_utils.h" #import "ios/chrome/browser/ui/settings/password/password_details/password_details_table_view_controller_delegate.h" @@ -149,6 +149,9 @@ // Display name to use for the Password Details view. @property(nonatomic, strong) NSString* displayName; +// The context in which the password details are accessed. +@property(nonatomic, assign) DetailsContext context; + @end @implementation PasswordDetailsMediator
diff --git a/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator_unittest.mm b/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator_unittest.mm index 62757ab..15ccb65 100644 --- a/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator_unittest.mm +++ b/ios/chrome/browser/ui/settings/password/password_details/password_details_mediator_unittest.mm
@@ -3,6 +3,7 @@ // found in the LICENSE file. #import "ios/chrome/browser/ui/settings/password/password_details/password_details_mediator.h" +#import "ios/chrome/browser/ui/settings/password/password_details/password_details_mediator+Testing.h" #import "base/test/bind.h" #import "base/test/scoped_feature_list.h" @@ -20,7 +21,6 @@ #import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h" #import "ios/chrome/browser/sync/model/sync_service_factory.h" #import "ios/chrome/browser/ui/settings/password/password_details/password_details_consumer.h" -#import "ios/chrome/browser/ui/settings/password/password_details/password_details_mediator+private.h" #import "ios/web/public/test/web_task_environment.h" #import "testing/gtest_mac.h" #import "testing/platform_test.h"
diff --git a/ios/chrome/browser/ui/settings/password/password_manager_egtest.mm b/ios/chrome/browser/ui/settings/password/password_manager_egtest.mm index 9c5ed83..b31d03926 100644 --- a/ios/chrome/browser/ui/settings/password/password_manager_egtest.mm +++ b/ios/chrome/browser/ui/settings/password/password_manager_egtest.mm
@@ -682,9 +682,6 @@ // later ones from interacting with the UI. config.relaunch_policy = ForceRelaunchByCleanShutdown; - config.features_enabled.push_back( - password_manager::features::kIOSPasswordUISplit); - // TODO(crbug.com/1448574): Re-enable CPE promo and update // testCopyPasswordToast and testCopyPasswordMenuItem to check for the promo. config.features_disabled.push_back(kCredentialProviderExtensionPromo);
diff --git a/ios/chrome/browser/ui/settings/password/passwords_in_other_apps/passwords_in_other_apps_egtest.mm b/ios/chrome/browser/ui/settings/password/passwords_in_other_apps/passwords_in_other_apps_egtest.mm index 65e11dd..4fce1c5 100644 --- a/ios/chrome/browser/ui/settings/password/passwords_in_other_apps/passwords_in_other_apps_egtest.mm +++ b/ios/chrome/browser/ui/settings/password/passwords_in_other_apps/passwords_in_other_apps_egtest.mm
@@ -133,9 +133,6 @@ AppLaunchConfiguration config; config.features_enabled.push_back( - password_manager::features::kIOSPasswordUISplit); - - config.features_enabled.push_back( password_manager::features::kIOSPasswordAuthOnEntryV2); return config;
diff --git a/ios/chrome/browser/ui/settings/search_engine_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/search_engine_table_view_controller_unittest.mm index b169c40f4..21c966e 100644 --- a/ios/chrome/browser/ui/settings/search_engine_table_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/settings/search_engine_table_view_controller_unittest.mm
@@ -31,7 +31,7 @@ #import "ios/chrome/browser/favicon/favicon_service_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.h" #import "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/policy/browser_state_policy_connector_mock.h" #import "ios/chrome/browser/search_engines/model/template_url_service_factory.h" #import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h"
diff --git a/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_browser_agent.mm b/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_browser_agent.mm index 9b29758..17310cd 100644 --- a/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_browser_agent.mm +++ b/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_browser_agent.mm
@@ -123,7 +123,8 @@ gfx::Image favicon = driver->GetFavicon(); if (!favicon.IsEmpty()) { for (auto& observer : observers_) { - observer.MostRecentTabFaviconUpdated(favicon.ToUIImage()); + observer.MostRecentTabFaviconUpdated(most_recent_tab_, + favicon.ToUIImage()); } } } @@ -131,6 +132,6 @@ void StartSurfaceRecentTabBrowserAgent::TitleWasSet(web::WebState* web_state) { for (auto& observer : observers_) { - observer.MostRecentTabTitleUpdated(web_state->GetTitle()); + observer.MostRecentTabTitleUpdated(web_state, web_state->GetTitle()); } }
diff --git a/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_observer.h b/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_observer.h index 30e55d70..c438dba 100644 --- a/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_observer.h +++ b/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_observer.h
@@ -24,13 +24,17 @@ ~StartSurfaceRecentTabObserver() override; - // Notifies the receiver that the most recent tab was removed. + // Notifies the receiver that the most recent tab (linked to `web_state`) was + // removed. virtual void MostRecentTabRemoved(web::WebState* web_state) {} // Notifies the receiver that the favicon for the current page of the most - // recent tab was updated to `image`. - virtual void MostRecentTabFaviconUpdated(UIImage* image) {} - - virtual void MostRecentTabTitleUpdated(const std::u16string& title) {} + // recent tab (linked to `web_state`) was updated to `image`. + virtual void MostRecentTabFaviconUpdated(web::WebState* web_state, + UIImage* image) {} + // Notifies the receiver that the title for the current page of the most + // recent tab (linked to `web_state`) was updated to `title`. + virtual void MostRecentTabTitleUpdated(web::WebState* web_state, + const std::u16string& title) {} }; #endif // IOS_CHROME_BROWSER_UI_START_SURFACE_START_SURFACE_RECENT_TAB_OBSERVER_H_
diff --git a/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_removal_observer_bridge.h b/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_removal_observer_bridge.h index f8b4a801..bfa23b1 100644 --- a/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_removal_observer_bridge.h +++ b/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_removal_observer_bridge.h
@@ -16,15 +16,15 @@ // Protocol that corresponds to StartSurfaceRecentTabObserver API. Allows // registering Objective-C objects to listen to updates to the most recent tab. @protocol StartSurfaceRecentTabObserving <NSObject> -@optional // Notifies the receiver that the most recent tab was removed. -- (void)mostRecentTabWasRemoved:(web::WebState*)web_state; +- (void)mostRecentTabWasRemoved:(web::WebState*)webState; // Notifies the receiver that the favicon for the current page of the most // recent tab was updated with `image`. -- (void)mostRecentTabFaviconUpdatedWithImage:(UIImage*)image; +- (void)mostRecentTab:(web::WebState*)webState + faviconUpdatedWithImage:(UIImage*)image; // Notifies the receiver that the title of the current page of the most recent // tab was updated to `title`. -- (void)mostRecentTabTitleWasUpdated:(NSString*)title; +- (void)mostRecentTab:(web::WebState*)webState titleWasUpdated:(NSString*)title; @end // Bridge to use an id<StartSurfaceRecentTabObserving> as a @@ -45,8 +45,10 @@ private: // StartSurfaceBrowserAgentObserver. void MostRecentTabRemoved(web::WebState* web_state) override; - void MostRecentTabFaviconUpdated(UIImage* image) override; - void MostRecentTabTitleUpdated(const std::u16string& title) override; + void MostRecentTabFaviconUpdated(web::WebState* web_state, + UIImage* image) override; + void MostRecentTabTitleUpdated(web::WebState* web_state, + const std::u16string& title) override; __weak id<StartSurfaceRecentTabObserving> delegate_ = nil; };
diff --git a/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_removal_observer_bridge.mm b/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_removal_observer_bridge.mm index 73ec397..b2f7a63 100644 --- a/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_removal_observer_bridge.mm +++ b/ios/chrome/browser/ui/start_surface/start_surface_recent_tab_removal_observer_bridge.mm
@@ -15,27 +15,18 @@ void StartSurfaceRecentTabObserverBridge::MostRecentTabRemoved( web::WebState* web_state) { - const SEL selector = @selector(mostRecentTabWasRemoved:); - if (![delegate_ respondsToSelector:selector]) - return; - [delegate_ mostRecentTabWasRemoved:web_state]; } void StartSurfaceRecentTabObserverBridge::MostRecentTabFaviconUpdated( + web::WebState* web_state, UIImage* image) { - const SEL selector = @selector(mostRecentTabFaviconUpdatedWithImage:); - if (![delegate_ respondsToSelector:selector]) - return; - - [delegate_ mostRecentTabFaviconUpdatedWithImage:image]; + [delegate_ mostRecentTab:web_state faviconUpdatedWithImage:image]; } void StartSurfaceRecentTabObserverBridge::MostRecentTabTitleUpdated( + web::WebState* web_state, const std::u16string& title) { - const SEL selector = @selector(mostRecentTabTitleWasUpdated:); - if (![delegate_ respondsToSelector:selector]) - return; - - [delegate_ mostRecentTabTitleWasUpdated:base::SysUTF16ToNSString(title)]; + [delegate_ mostRecentTab:web_state + titleWasUpdated:base::SysUTF16ToNSString(title)]; }
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/BUILD.gn b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/BUILD.gn index 5f4a034e..64faba9a 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/BUILD.gn +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/BUILD.gn
@@ -214,7 +214,7 @@ "//base", "//base/test:test_support", "//components/unified_consent", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/main/model", "//ios/chrome/browser/sessions", "//ios/chrome/browser/sessions:fake",
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_mediator_test.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_mediator_test.mm index a67275e..e3cdc316 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_mediator_test.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_mediator_test.mm
@@ -7,7 +7,7 @@ #import "base/containers/contains.h" #import "base/test/ios/wait_util.h" #import "components/unified_consent/pref_names.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/main/model/browser_web_state_list_delegate.h" #import "ios/chrome/browser/sessions/fake_tab_restore_service.h" #import "ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.h"
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/regular/BUILD.gn b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/regular/BUILD.gn index 4237627..f6f05f1 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/regular/BUILD.gn +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/regular/BUILD.gn
@@ -62,7 +62,7 @@ "//components/policy/core/common:common_constants", "//components/sessions", "//components/sync_preferences:test_support", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/policy:policy_util", "//ios/chrome/browser/sessions", "//ios/chrome/browser/shared/model/browser/test:test_support",
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/regular/regular_grid_mediator_unittest.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/regular/regular_grid_mediator_unittest.mm index 67e99d0..aa8ae6d3 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/regular/regular_grid_mediator_unittest.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/regular/regular_grid_mediator_unittest.mm
@@ -8,7 +8,7 @@ #import "components/policy/core/common/policy_pref_names.h" #import "components/sessions/core/tab_restore_service.h" #import "components/sync_preferences/testing_pref_service_syncable.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/policy/policy_util.h" #import "ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h"
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/pinned_tabs/pinned_tabs_mediator.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/pinned_tabs/pinned_tabs_mediator.mm index 434d032..1e20355f 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/pinned_tabs/pinned_tabs_mediator.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/pinned_tabs/pinned_tabs_mediator.mm
@@ -438,7 +438,7 @@ } // Reorder tabs. - [self.consumer moveItemWithID:tabInfo.tabID toIndex:destinationIndex]; + [self moveItemWithID:tabInfo.tabID toIndex:destinationIndex]; return; } base::UmaHistogramEnumeration(kUmaPinnedViewDragOrigin,
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator_unittest.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator_unittest.mm index afb46b6b..85a9119 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator_unittest.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_coordinator_unittest.mm
@@ -153,7 +153,6 @@ UIWindow* window = GetAnyKeyWindow(); - // TODO(crbug.com/1414048): Add inactive browser. coordinator_ = [[TabGridCoordinator alloc] initWithWindow:window applicationCommandEndpoint:OCMProtocolMock( @@ -161,7 +160,7 @@ browsingDataCommandEndpoint:OCMProtocolMock( @protocol(BrowsingDataCommands)) regularBrowser:browser_.get() - inactiveBrowser:nil + inactiveBrowser:browser_->CreateInactiveBrowser() incognitoBrowser:incognito_browser_.get()]; coordinator_.animationsDisabledForTesting = YES; @@ -204,7 +203,7 @@ // Browser for the coordinator. std::unique_ptr<Browser> browser_; - // Browser for the coordinator. + // Incognito browser for the coordinator. std::unique_ptr<Browser> incognito_browser_; // Scene state emulated in this test.
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_strip/BUILD.gn b/ios/chrome/browser/ui/tab_switcher/tab_strip/BUILD.gn index 3722aa5..ead4b8d 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_strip/BUILD.gn +++ b/ios/chrome/browser/ui/tab_switcher/tab_strip/BUILD.gn
@@ -70,7 +70,7 @@ "//components/favicon/core", "//components/favicon/ios", "//ios/chrome/browser/favicon", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/shared/model/browser/test:test_support", "//ios/chrome/browser/shared/model/browser_state:test_support", "//ios/chrome/browser/shared/model/web_state_list",
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_strip/tab_strip_mediator_unittest.mm b/ios/chrome/browser/ui/tab_switcher/tab_strip/tab_strip_mediator_unittest.mm index c79cfd6a..317ca50 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_strip/tab_strip_mediator_unittest.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_strip/tab_strip_mediator_unittest.mm
@@ -9,7 +9,7 @@ #import "components/favicon/ios/web_favicon_driver.h" #import "components/keyed_service/core/service_access_type.h" #import "ios/chrome/browser/favicon/favicon_service_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/shared/model/browser/test/test_browser.h" #import "ios/chrome/browser/shared/model/browser_state/test_chrome_browser_state.h" #import "ios/chrome/browser/shared/model/web_state_list/test/fake_web_state_list_delegate.h"
diff --git a/ios/chrome/browser/ui/unit_conversion/BUILD.gn b/ios/chrome/browser/ui/unit_conversion/BUILD.gn index 51d56f80c..e4614f1 100644 --- a/ios/chrome/browser/ui/unit_conversion/BUILD.gn +++ b/ios/chrome/browser/ui/unit_conversion/BUILD.gn
@@ -19,6 +19,8 @@ "//ios/chrome/browser/shared/model/browser_state", "//ios/chrome/browser/shared/model/prefs:pref_names", "//ios/chrome/browser/shared/public/commands", + "//ios/chrome/browser/unit_conversion", + "//ios/chrome/browser/unit_conversion:unit_conversion_factory", "//ios/chrome/browser/web/annotations", "//ios/chrome/common:string_util", "//ios/chrome/common/ui/confirmation_alert",
diff --git a/ios/chrome/browser/ui/unit_conversion/unit_conversion_coordinator.mm b/ios/chrome/browser/ui/unit_conversion/unit_conversion_coordinator.mm index ef99fa0..db0babec 100644 --- a/ios/chrome/browser/ui/unit_conversion/unit_conversion_coordinator.mm +++ b/ios/chrome/browser/ui/unit_conversion/unit_conversion_coordinator.mm
@@ -9,6 +9,8 @@ #import "ios/chrome/browser/shared/public/commands/command_dispatcher.h" #import "ios/chrome/browser/ui/unit_conversion/unit_conversion_mediator.h" #import "ios/chrome/browser/ui/unit_conversion/unit_conversion_view_controller.h" +#import "ios/chrome/browser/unit_conversion/unit_conversion_service.h" +#import "ios/chrome/browser/unit_conversion/unit_conversion_service_factory.h" namespace { @@ -62,12 +64,16 @@ } - (void)start { + // Init the keyed service to track the changes of the target unit and pass it + // to the mediator. + UnitConversionService* service = + UnitConversionServiceFactory::GetForBrowserState( + self.browser->GetBrowserState()); + _mediator = [[UnitConversionMediator alloc] initWithService:service]; _viewController = [[UnitConversionViewController alloc] initWithSourceUnit:_sourceUnit + targetUnit:service->GetDefaultTargetFromUnit(_sourceUnit) unitValue:_sourceUnitValue]; - - _mediator = [[UnitConversionMediator alloc] init]; - _mediator.consumer = _viewController; _viewController.mutator = _mediator; _viewController.delegate = self; @@ -77,6 +83,8 @@ - (void)stop { [_mediator reportMetrics]; + [_mediator shutdown]; + _mediator = nil; [self dismissViewController]; }
diff --git a/ios/chrome/browser/ui/unit_conversion/unit_conversion_mediator.h b/ios/chrome/browser/ui/unit_conversion/unit_conversion_mediator.h index b0883d6..177eb30 100644 --- a/ios/chrome/browser/ui/unit_conversion/unit_conversion_mediator.h +++ b/ios/chrome/browser/ui/unit_conversion/unit_conversion_mediator.h
@@ -8,6 +8,7 @@ #import <UIKit/UIKit.h> #import "ios/chrome/browser/ui/unit_conversion/unit_conversion_mutator.h" +#import "ios/chrome/browser/unit_conversion/unit_conversion_service.h" @protocol UnitConversionConsumer; @@ -16,9 +17,18 @@ @property(nonatomic, weak) id<UnitConversionConsumer> consumer; +// UnitConversionMediator designated init function. +- (instancetype)initWithService:(UnitConversionService*)service + NS_DESIGNATED_INITIALIZER; + +- (instancetype)init NS_UNAVAILABLE; + // Logs all the unit conversion histograms at the coordinator stop. - (void)reportMetrics; +// Clears the references to model objects. +- (void)shutdown; + @end #endif // IOS_CHROME_BROWSER_UI_UNIT_CONVERSION_UNIT_CONVERSION_MEDIATOR_H_
diff --git a/ios/chrome/browser/ui/unit_conversion/unit_conversion_mediator.mm b/ios/chrome/browser/ui/unit_conversion/unit_conversion_mediator.mm index dedd3ced..551e2187 100644 --- a/ios/chrome/browser/ui/unit_conversion/unit_conversion_mediator.mm +++ b/ios/chrome/browser/ui/unit_conversion/unit_conversion_mediator.mm
@@ -34,9 +34,14 @@ // An item to track the target unit change, it is initialised with the value // `kUnchanged` and store the first change only. UnitConversionActionTypes _targetUnitChanged; + + // The unit conversion keyed service to keep track of the changes of the + // target unit based on a source unit and store them as the new default + // conversion. + UnitConversionService* _service; } -- (instancetype)init { +- (instancetype)initWithService:(UnitConversionService*)service { self = [super init]; if (self) { _unitTypeChanged = NO; @@ -45,6 +50,7 @@ _sourceUnitChangedBeforeUnitType = UnitConversionActionTypes::kUnchanged; _sourceUnitChangedAfterUnitType = UnitConversionActionTypes::kUnchanged; _targetUnitChanged = UnitConversionActionTypes::kUnchanged; + _service = service; } return self; } @@ -57,6 +63,10 @@ base::UmaHistogramEnumeration(kTargetUnitChangeHistogram, _targetUnitChanged); } +- (void)shutdown { + _service = nullptr; +} + #pragma mark - UnitConversionMutator - (void)unitTypeDidChange:(ios::provider::UnitType)unitType @@ -131,6 +141,7 @@ NSMeasurement* sourceUnitMeasurement = [[NSMeasurement alloc] initWithDoubleValue:unitValue unit:sourceUnit]; if ([sourceUnitMeasurement canBeConvertedToUnit:targetUnit]) { + _service->UpdateDefaultConversionCache(sourceUnit, targetUnit); NSMeasurement* targetUnitMeasurement = [sourceUnitMeasurement measurementByConvertingToUnit:targetUnit];
diff --git a/ios/chrome/browser/ui/unit_conversion/unit_conversion_mediator_unittest.mm b/ios/chrome/browser/ui/unit_conversion/unit_conversion_mediator_unittest.mm index 6ab25a6..3f2c722 100644 --- a/ios/chrome/browser/ui/unit_conversion/unit_conversion_mediator_unittest.mm +++ b/ios/chrome/browser/ui/unit_conversion/unit_conversion_mediator_unittest.mm
@@ -70,12 +70,13 @@ public: void SetUp() override { PlatformTest::SetUp(); - mediator_ = [[UnitConversionMediator alloc] init]; + mediator_ = [[UnitConversionMediator alloc] initWithService:&service_]; helper_ = [[TestUnitConversionProviderTestHelper alloc] init]; ios::provider::test::SetUnitConversionProviderTestHelper(helper_); } void TearDown() override { + service_.Shutdown(); ios::provider::test::SetUnitConversionProviderTestHelper(nil); PlatformTest::TearDown(); } @@ -83,6 +84,7 @@ protected: UnitConversionMediator* mediator_; TestUnitConversionProviderTestHelper* helper_; + UnitConversionService service_; }; // Tests that the conversion and the updates are handled correctly when the
diff --git a/ios/chrome/browser/ui/unit_conversion/unit_conversion_view_controller.h b/ios/chrome/browser/ui/unit_conversion/unit_conversion_view_controller.h index d15db55..7464948 100644 --- a/ios/chrome/browser/ui/unit_conversion/unit_conversion_view_controller.h +++ b/ios/chrome/browser/ui/unit_conversion/unit_conversion_view_controller.h
@@ -28,6 +28,7 @@ // UnitConversionViewController designated init function. - (instancetype)initWithSourceUnit:(NSUnit*)sourceUnit + targetUnit:(NSUnit*)targetUnit unitValue:(double)unitValue NS_DESIGNATED_INITIALIZER; - (instancetype)init NS_UNAVAILABLE;
diff --git a/ios/chrome/browser/ui/unit_conversion/unit_conversion_view_controller.mm b/ios/chrome/browser/ui/unit_conversion/unit_conversion_view_controller.mm index d173fa7..a898d7a4 100644 --- a/ios/chrome/browser/ui/unit_conversion/unit_conversion_view_controller.mm +++ b/ios/chrome/browser/ui/unit_conversion/unit_conversion_view_controller.mm
@@ -137,12 +137,14 @@ @implementation UnitConversionViewController - (instancetype)initWithSourceUnit:(NSUnit*)sourceUnit + targetUnit:(NSUnit*)targetUnit unitValue:(double)unitValue { self = [super initWithStyle:UITableViewStyleInsetGrouped]; if (self) { _unitValue = unitValue; _sourceUnit = sourceUnit; + _targetUnit = targetUnit; _previousHeight = 0; } return self; @@ -177,7 +179,6 @@ - (void)viewDidLoad { [super viewDidLoad]; - _targetUnit = ios::provider::GetDefaultTargetUnit(_sourceUnit); _unitType = TypeByUnit(_sourceUnit); _sourceUnitValueField = [NSString localizedStringWithFormat:@"%g", _unitValue];
diff --git a/ios/chrome/browser/ui/whats_new/whats_new_util.mm b/ios/chrome/browser/ui/whats_new/whats_new_util.mm index 6fbb434..fb5950f 100644 --- a/ios/chrome/browser/ui/whats_new/whats_new_util.mm +++ b/ios/chrome/browser/ui/whats_new/whats_new_util.mm
@@ -84,7 +84,7 @@ BASE_FEATURE(kWhatsNewIOSM116, "WhatsNewIOSM116", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); bool WasWhatsNewUsed() { if (IsWhatsNewM116Enabled()) {
diff --git a/ios/chrome/browser/unit_conversion/BUILD.gn b/ios/chrome/browser/unit_conversion/BUILD.gn new file mode 100644 index 0000000..c5463c3 --- /dev/null +++ b/ios/chrome/browser/unit_conversion/BUILD.gn
@@ -0,0 +1,44 @@ +# Copyright 2023 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("unit_conversion") { + sources = [ + "unit_conversion_service.h", + "unit_conversion_service.mm", + ] + deps = [ + "//base", + "//components/keyed_service/core", + "//components/keyed_service/ios", + "//ios/chrome/browser/shared/model/browser_state", + "//ios/public/provider/chrome/browser/unit_conversion:unit_conversion_api", + ] +} + +source_set("unit_conversion_factory") { + sources = [ + "unit_conversion_service_factory.h", + "unit_conversion_service_factory.mm", + ] + deps = [ + ":unit_conversion", + "//base", + "//components/keyed_service/core", + "//components/keyed_service/ios", + "//ios/chrome/browser/shared/model/browser_state", + "//ios/public/provider/chrome/browser/unit_conversion:unit_conversion_api", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ "unit_conversion_service_unittest.mm" ] + deps = [ + ":unit_conversion", + "//base", + "//base/test:test_support", + "//ios/chrome/test/providers/unit_conversion", + "//third_party/ocmock", + ] +}
diff --git a/ios/chrome/browser/unit_conversion/unit_conversion_service.h b/ios/chrome/browser/unit_conversion/unit_conversion_service.h new file mode 100644 index 0000000..6ee90ad36 --- /dev/null +++ b/ios/chrome/browser/unit_conversion/unit_conversion_service.h
@@ -0,0 +1,33 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UNIT_CONVERSION_UNIT_CONVERSION_SERVICE_H_ +#define IOS_CHROME_BROWSER_UNIT_CONVERSION_UNIT_CONVERSION_SERVICE_H_ + +#import <Foundation/Foundation.h> + +#import "components/keyed_service/core/keyed_service.h" + +// An observable KeyedService which tracks the changes of target unit which +// implies changes in the default conversion +class UnitConversionService : public KeyedService { + public: + // Updates the `default_conversion_cache_` with the `source_unit` as the key + // and `target_unit` as its value. + void UpdateDefaultConversionCache(NSUnit* source_unit, NSUnit* target_unit); + + // Returns the default target unit for a given source unit from + // `default_conversion_cache_`, if the source unit is not present in the + // dictionary the value returned is computed from the + // `unit_conversion_provider`. + NSUnit* GetDefaultTargetFromUnit(NSUnit* unit); + + private: + // A cache to store the changes made to the target unit from a source unit, + // the key represent a source unit and the value the new target unit. + NSMutableDictionary* default_conversion_cache_ = + [[NSMutableDictionary alloc] init]; +}; + +#endif // IOS_CHROME_BROWSER_UNIT_CONVERSION_UNIT_CONVERSION_SERVICE_H_
diff --git a/ios/chrome/browser/unit_conversion/unit_conversion_service.mm b/ios/chrome/browser/unit_conversion/unit_conversion_service.mm new file mode 100644 index 0000000..89f3065 --- /dev/null +++ b/ios/chrome/browser/unit_conversion/unit_conversion_service.mm
@@ -0,0 +1,20 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/unit_conversion/unit_conversion_service.h" + +#import "ios/public/provider/chrome/browser/unit_conversion/unit_conversion_api.h" + +void UnitConversionService::UpdateDefaultConversionCache(NSUnit* source_unit, + NSUnit* target_unit) { + [default_conversion_cache_ setObject:target_unit forKey:source_unit]; +} + +NSUnit* UnitConversionService::GetDefaultTargetFromUnit(NSUnit* unit) { + NSUnit* cached_unit = [default_conversion_cache_ objectForKey:unit]; + if (!cached_unit) { + return ios::provider::GetDefaultTargetUnit(unit); + } + return cached_unit; +}
diff --git a/ios/chrome/browser/unit_conversion/unit_conversion_service_factory.h b/ios/chrome/browser/unit_conversion/unit_conversion_service_factory.h new file mode 100644 index 0000000..073f5736 --- /dev/null +++ b/ios/chrome/browser/unit_conversion/unit_conversion_service_factory.h
@@ -0,0 +1,38 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UNIT_CONVERSION_UNIT_CONVERSION_SERVICE_FACTORY_H_ +#define IOS_CHROME_BROWSER_UNIT_CONVERSION_UNIT_CONVERSION_SERVICE_FACTORY_H_ + +#import "base/no_destructor.h" +#import "components/keyed_service/core/keyed_service.h" +#import "components/keyed_service/ios/browser_state_keyed_service_factory.h" + +class ChromeBrowserState; +class UnitConversionService; + +// Singleton that owns all UnitConversionServices and associates them with +// ChromeBrowserState. +class UnitConversionServiceFactory : public BrowserStateKeyedServiceFactory { + public: + static UnitConversionServiceFactory* GetInstance(); + static UnitConversionService* GetForBrowserState( + ChromeBrowserState* browser_state); + + UnitConversionServiceFactory(const UnitConversionServiceFactory&) = delete; + UnitConversionServiceFactory& operator=(const UnitConversionServiceFactory&) = + delete; + + private: + friend class base::NoDestructor<UnitConversionServiceFactory>; + UnitConversionServiceFactory(); + ~UnitConversionServiceFactory() override; + // BrowserStateKeyedServiceFactory implementation. + std::unique_ptr<KeyedService> BuildServiceInstanceFor( + web::BrowserState* context) const override; + web::BrowserState* GetBrowserStateToUse( + web::BrowserState* state) const override; +}; + +#endif // IOS_CHROME_BROWSER_UNIT_CONVERSION_UNIT_CONVERSION_SERVICE_FACTORY_H_
diff --git a/ios/chrome/browser/unit_conversion/unit_conversion_service_factory.mm b/ios/chrome/browser/unit_conversion/unit_conversion_service_factory.mm new file mode 100644 index 0000000..de4337bd --- /dev/null +++ b/ios/chrome/browser/unit_conversion/unit_conversion_service_factory.mm
@@ -0,0 +1,43 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/unit_conversion/unit_conversion_service_factory.h" + +#import "base/no_destructor.h" +#import "components/keyed_service/ios/browser_state_dependency_manager.h" +#import "ios/chrome/browser/shared/model/browser_state/browser_state_otr_helper.h" +#import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" +#import "ios/chrome/browser/unit_conversion/unit_conversion_service.h" + +// static +UnitConversionServiceFactory* UnitConversionServiceFactory::GetInstance() { + static base::NoDestructor<UnitConversionServiceFactory> instance; + return instance.get(); +} + +// static +UnitConversionService* UnitConversionServiceFactory::GetForBrowserState( + ChromeBrowserState* const state) { + return static_cast<UnitConversionService*>( + GetInstance()->GetServiceForBrowserState(state, true)); +} + +UnitConversionServiceFactory::UnitConversionServiceFactory() + : BrowserStateKeyedServiceFactory( + "UnitConversionService", + BrowserStateDependencyManager::GetInstance()) {} + +UnitConversionServiceFactory::~UnitConversionServiceFactory() {} + +std::unique_ptr<KeyedService> +UnitConversionServiceFactory::BuildServiceInstanceFor( + web::BrowserState* const state) const { + return std::make_unique<UnitConversionService>(); +} + +web::BrowserState* UnitConversionServiceFactory::GetBrowserStateToUse( + web::BrowserState* const state) const { + // The incognito has distinct instance of `UnitConversionService`. + return GetBrowserStateOwnInstanceInIncognito(state); +}
diff --git a/ios/chrome/browser/unit_conversion/unit_conversion_service_unittest.mm b/ios/chrome/browser/unit_conversion/unit_conversion_service_unittest.mm new file mode 100644 index 0000000..7350cf7 --- /dev/null +++ b/ios/chrome/browser/unit_conversion/unit_conversion_service_unittest.mm
@@ -0,0 +1,66 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/unit_conversion/unit_conversion_service.h" +#import "ios/chrome/test/providers/unit_conversion/test_unit_conversion.h" +#import "testing/platform_test.h" + +// A Unit Conversion factory that return test source and target units. +@interface TestUnitConversionProviderTestHelperService + : NSObject <UnitConversionProviderTestHelper> +@end + +@implementation TestUnitConversionProviderTestHelperService + +- (NSUnit*)sourceUnitFromUnitType:(ios::provider::UnitType)unit_type { + return nil; +} + +- (NSUnit*)targetUnitFromUnit:(NSUnit*)unit { + return [NSUnitMass grams]; +} + +@end + +// Test the Unit Conversion Service. +class UnitConversionServiceTest : public PlatformTest { + public: + void SetUp() override { + helper_ = [[TestUnitConversionProviderTestHelperService alloc] init]; + ios::provider::test::SetUnitConversionProviderTestHelper(helper_); + } + + void TearDown() override { + service_.Shutdown(); + ios::provider::test::SetUnitConversionProviderTestHelper(nil); + PlatformTest::TearDown(); + } + + protected: + UnitConversionService service_; + TestUnitConversionProviderTestHelperService* helper_; +}; + +// Tests that the default conversion is taking place (the provided conversion +// from `ios_internal`) when no update has been made to +// `default_conversion_cache_`. +TEST_F(UnitConversionServiceTest, TestDefaultConversionFromProvider) { + EXPECT_EQ(service_.GetDefaultTargetFromUnit([NSUnitMass grams]), + [NSUnitMass grams]); + service_.UpdateDefaultConversionCache([NSUnitMass grams], + [NSUnitMass kilograms]); + EXPECT_EQ(service_.GetDefaultTargetFromUnit([NSUnitMass grams]), + [NSUnitMass kilograms]); +} + +// Tests that the default conversion is changed after adding an element to +// `default_conversion_cache_`. +TEST_F(UnitConversionServiceTest, TestUpdatedDefaultConversion) { + EXPECT_EQ(service_.GetDefaultTargetFromUnit([NSUnitMass grams]), + [NSUnitMass grams]); + service_.UpdateDefaultConversionCache([NSUnitMass grams], + [NSUnitMass kilograms]); + EXPECT_EQ(service_.GetDefaultTargetFromUnit([NSUnitMass grams]), + [NSUnitMass kilograms]); +}
diff --git a/ios/chrome/test/BUILD.gn b/ios/chrome/test/BUILD.gn index 86ea062..fcf207f 100644 --- a/ios/chrome/test/BUILD.gn +++ b/ios/chrome/test/BUILD.gn
@@ -219,7 +219,7 @@ "//ios/chrome/browser/find_in_page/model:unit_tests", "//ios/chrome/browser/flags:unit_tests", "//ios/chrome/browser/follow/model:unit_tests", - "//ios/chrome/browser/history:unit_tests", + "//ios/chrome/browser/history/model:unit_tests", "//ios/chrome/browser/https_upgrades/model:unit_tests", "//ios/chrome/browser/infobars:unit_tests", "//ios/chrome/browser/infobars/overlays:unit_tests", @@ -445,6 +445,7 @@ "//ios/chrome/browser/ui/whats_new/cells:unit_tests", "//ios/chrome/browser/ui/whats_new/data_source:unit_tests", "//ios/chrome/browser/ui/whats_new/promo:unit_tests", + "//ios/chrome/browser/unit_conversion:unit_tests", "//ios/chrome/browser/update_client/model:unit_tests", "//ios/chrome/browser/upgrade/model:unit_tests", "//ios/chrome/browser/url_loading/model:unit_tests",
diff --git a/ios/chrome/test/app/BUILD.gn b/ios/chrome/test/app/BUILD.gn index b56148a..82e1585d 100644 --- a/ios/chrome/test/app/BUILD.gn +++ b/ios/chrome/test/app/BUILD.gn
@@ -61,7 +61,7 @@ "//ios/chrome/browser/browser_state/model", "//ios/chrome/browser/browsing_data/model", "//ios/chrome/browser/content_settings/model", - "//ios/chrome/browser/history", + "//ios/chrome/browser/history/model", "//ios/chrome/browser/infobars", "//ios/chrome/browser/main/model", "//ios/chrome/browser/metrics/model:metrics_browser_agent",
diff --git a/ios/chrome/test/app/browsing_data_test_util.mm b/ios/chrome/test/app/browsing_data_test_util.mm index 0bca6c13..e7d51d91 100644 --- a/ios/chrome/test/app/browsing_data_test_util.mm +++ b/ios/chrome/test/app/browsing_data_test_util.mm
@@ -14,7 +14,7 @@ #import "components/keyed_service/core/service_access_type.h" #import "ios/chrome/app/main_controller.h" #import "ios/chrome/browser/browsing_data/model/browsing_data_remove_mask.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/shared/public/commands/browsing_data_commands.h" #import "ios/chrome/test/app/chrome_test_util.h"
diff --git a/ios/chrome/test/app/sync_test_util.mm b/ios/chrome/test/app/sync_test_util.mm index 4b5572df..25630622 100644 --- a/ios/chrome/test/app/sync_test_util.mm +++ b/ios/chrome/test/app/sync_test_util.mm
@@ -41,7 +41,7 @@ #import "components/sync_sessions/session_store.h" #import "components/sync_sessions/session_sync_test_helper.h" #import "ios/chrome/browser/autofill/model/personal_data_manager_factory.h" -#import "ios/chrome/browser/history/history_service_factory.h" +#import "ios/chrome/browser/history/model/history_service_factory.h" #import "ios/chrome/browser/shared/model/browser_state/chrome_browser_state.h" #import "ios/chrome/browser/sync/model/device_info_sync_service_factory.h" #import "ios/chrome/browser/sync/model/sync_service_factory.h"
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.h b/ios/chrome/test/earl_grey/chrome_earl_grey.h index 2afca5d..ee5e063 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey.h +++ b/ios/chrome/test/earl_grey/chrome_earl_grey.h
@@ -794,6 +794,14 @@ - (void)setBoolValue:(BOOL)value forUserPref:(const std::string&)UTF8PrefName; - (void)setIntegerValue:(int)value forUserPref:(const std::string&)UTF8PrefName; +// Returns true if the Preference is currently using its default value, +// and has not been set by any higher-priority source (even with the same +// value). +- (bool)prefWithNameIsDefaultValue:(const std::string&)prefName; + +// Clears the user pref of `prefName` in the original browser state. +- (void)clearUserPrefWithName:(const std::string&)prefName; + // Resets the BrowsingDataPrefs, which defines if its selected or not when // clearing Browsing data. - (void)resetBrowsingDataPrefs;
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.mm b/ios/chrome/test/earl_grey/chrome_earl_grey.mm index d4074ef3..44657bf9 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey.mm +++ b/ios/chrome/test/earl_grey/chrome_earl_grey.mm
@@ -1518,6 +1518,16 @@ forUserPref:prefName]; } +- (bool)prefWithNameIsDefaultValue:(const std::string&)prefName { + return [ChromeEarlGreyAppInterface + prefWithNameIsDefaultValue:base::SysUTF8ToNSString(prefName)]; +} + +- (void)clearUserPrefWithName:(const std::string&)prefName { + [ChromeEarlGreyAppInterface + clearUserPrefWithName:base::SysUTF8ToNSString(prefName)]; +} + - (void)resetBrowsingDataPrefs { return [ChromeEarlGreyAppInterface resetBrowsingDataPrefs]; }
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.h b/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.h index 3549fc0a..e630178 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.h +++ b/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.h
@@ -610,6 +610,11 @@ // Sets the value of a integer user pref in the original browser state. + (void)setIntegerValue:(int)value forUserPref:(NSString*)prefName; +// Returns true if the Preference is currently using its default value, +// and has not been set by any higher-priority source (even with the same +// value). ++ (BOOL)prefWithNameIsDefaultValue:(NSString*)prefName; + // Clears the user pref of |prefName|. + (void)clearUserPrefWithName:(NSString*)prefName;
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm b/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm index e6f34c3..ca8ab2f 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm +++ b/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm
@@ -1323,6 +1323,14 @@ base::SysNSStringToUTF8(prefName).c_str(), value); } ++ (BOOL)prefWithNameIsDefaultValue:(NSString*)prefName { + std::string path = base::SysNSStringToUTF8(prefName); + const PrefService::Preference* pref = + chrome_test_util::GetOriginalBrowserState()->GetPrefs()->FindPreference( + path); + return pref->IsDefaultValue(); +} + + (void)clearUserPrefWithName:(NSString*)prefName { PrefService* prefs = chrome_test_util::GetOriginalBrowserState()->GetPrefs(); prefs->ClearPref(base::SysNSStringToUTF8(prefName));
diff --git a/ios/chrome/test/earl_grey2/BUILD.gn b/ios/chrome/test/earl_grey2/BUILD.gn index 576ee95..8c9bc49 100644 --- a/ios/chrome/test/earl_grey2/BUILD.gn +++ b/ios/chrome/test/earl_grey2/BUILD.gn
@@ -274,7 +274,6 @@ sources = [ "smoke_egtest.mm" ] deps = [ - "//components/password_manager/core/common:features", "//ios/chrome/app/strings", "//ios/chrome/browser/shared/model/prefs:pref_names", "//ios/chrome/browser/shared/public/features",
diff --git a/ios/chrome/test/earl_grey2/smoke_egtest.mm b/ios/chrome/test/earl_grey2/smoke_egtest.mm index 5e8fb1c..dc275af 100644 --- a/ios/chrome/test/earl_grey2/smoke_egtest.mm +++ b/ios/chrome/test/earl_grey2/smoke_egtest.mm
@@ -5,7 +5,6 @@ #import <UIKit/UIKit.h> #import "base/ios/ios_util.h" -#import "components/password_manager/core/common/password_manager_features.h" #import "ios/chrome/browser/shared/model/prefs/pref_names.h" #import "ios/chrome/browser/shared/public/features/features.h" #import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey.h" @@ -60,8 +59,6 @@ - (void)testToggleSettingsSwitch { AppLaunchConfiguration config = [self appConfigurationForTestCase]; config.relaunch_policy = ForceRelaunchByCleanShutdown; - config.features_enabled.push_back( - password_manager::features::kIOSPasswordUISplit); [[AppLaunchManager sharedManager] ensureAppLaunchedWithConfiguration:config]; [ChromeEarlGreyUI openSettingsMenu];
diff --git a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 index ab041e87..e6ebeec 100644 --- a/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -0fc5f3d9f3422eff2b114515b666e99bc77c0548 \ No newline at end of file +4e66166872bfdd5a430c274f14f9b9bc6eb93308 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 index 833a91efc..3b7ae3d 100644 --- a/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1 +++ b/ios/google_internal/frameworks/ChromeSSOInternal.framework.dSYM.ios.zip.sha1
@@ -1 +1 @@ -5f7d86b659995088b463f99fc7566ba0079de9d2 \ No newline at end of file +be86bdddbdbabd85d5c6c85419b9a5f9fe2f25ee \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 index 26d7e91..4dede621 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -4fd4828be8b40b9574265e6542c3e33381484837 \ No newline at end of file +98b42bed1c35b219d5015c64979a72bec9afaf0e \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 index 655b1a9..1e1ae20 100644 --- a/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -57ecfdb2dd6f8ad0552e3caca5c6a3d07bb82880 \ No newline at end of file +508dff9384f96a4f994302562653abd9cd9a21da \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 index fc9709c..14a5005 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -61a14d868febdd6ff858b069c8a070b46898f490 \ No newline at end of file +5d224b396abd552cecd7807abd9c9c84f6f76cf6 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 index 58190e9..72c88933 100644 --- a/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_sso_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -3601c83549eb9f8978cff5b46e88e457204ed50e \ No newline at end of file +ee0b1764bf5583adb8ef5e4a3a5c2a607b70d7e8 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 index 8707729..7f9dc8f9e 100644 --- a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -d3fb1570164770ae371d9d3724b1e780a272f00d \ No newline at end of file +75b602ef27d55fedfeb45ffb6ff90f7dd0e42deb \ No newline at end of file
diff --git a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 index fc094eeb..7b5e45d0 100644 --- a/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/chrome_test_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -21ee694f5ea89fa5e6fcc6b88d6f89be0c667ac8 \ No newline at end of file +f22a447d7df23c4b89ed11c2cc5277f022e89717 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 index 0dafcb9..0aa7656 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -9bdf2ae64604848115e08c86de795be8962be329 \ No newline at end of file +17b7eb76b4377ca3dabbb660265e83d97bb3287e \ No newline at end of file
diff --git a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 index de6f245..1308831 100644 --- a/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/remoting_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -cc06d1435e4e7ef737aeb7701810b91e3b7d7ea4 \ No newline at end of file +8c32db9750e751f5c0e3b04ee5a946b464e39808 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 index 425eb0f..f4b2bec 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.ios.zip.sha1
@@ -1 +1 @@ -c8aa34a292e92e3eed58a9e5832c648c9c3803db \ No newline at end of file +8ef1aff922c13ea679c555b7a5ead59b529469c1 \ No newline at end of file
diff --git a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 index 39d2e8c..451a776 100644 --- a/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1 +++ b/ios/google_internal/frameworks/web_view_shell_internal_dynamic_framework.iossimulator.zip.sha1
@@ -1 +1 @@ -b11c93ee671f8fa5cc991aa47a8682e4d3f1b62d \ No newline at end of file +121f685c776147b3b182d044563d1fae8e2a6e24 \ No newline at end of file
diff --git a/ios/web_view/internal/passwords/web_view_password_manager_client.h b/ios/web_view/internal/passwords/web_view_password_manager_client.h index 0536f32..e16d960 100644 --- a/ios/web_view/internal/passwords/web_view_password_manager_client.h +++ b/ios/web_view/internal/passwords/web_view_password_manager_client.h
@@ -108,7 +108,6 @@ password_manager::CredentialLeakType leak_type, const GURL& origin, const std::u16string& username) override; - void NotifyKeychainError() override; bool IsSavingAndFillingEnabled(const GURL& url) const override; bool IsCommittedMainFrameSecure() const override; const GURL& GetLastCommittedURL() const override;
diff --git a/ios/web_view/internal/passwords/web_view_password_manager_client.mm b/ios/web_view/internal/passwords/web_view_password_manager_client.mm index 6a014ea..8325ce8e 100644 --- a/ios/web_view/internal/passwords/web_view_password_manager_client.mm +++ b/ios/web_view/internal/passwords/web_view_password_manager_client.mm
@@ -236,8 +236,6 @@ username:username]; } -void WebViewPasswordManagerClient::NotifyKeychainError() {} - bool WebViewPasswordManagerClient::IsSavingAndFillingEnabled( const GURL& url) const { return *saving_passwords_enabled_ && !IsOffTheRecord() &&
diff --git a/ios/web_view/internal/web_view_web_main_parts.mm b/ios/web_view/internal/web_view_web_main_parts.mm index 25aff84..ab4e95c1 100644 --- a/ios/web_view/internal/web_view_web_main_parts.mm +++ b/ios/web_view/internal/web_view_web_main_parts.mm
@@ -77,7 +77,7 @@ switches::kEnableFetchingAccountCapabilities.name, }, ","); - feature_list->InitializeFromCommandLine( + feature_list->InitFromCommandLine( /*enable_features=*/enable_features, /*disable_features=*/disabled_features); base::FeatureList::SetInstance(std::move(feature_list));
diff --git a/ios_internal b/ios_internal index a71771e..3421205 160000 --- a/ios_internal +++ b/ios_internal
@@ -1 +1 @@ -Subproject commit a71771e41c4c362860b19a619ce1ba6b018903b1 +Subproject commit 3421205b08a716356d3f36e2c93e118e12a92f6f
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc index bc7a0c4e7..4d402b4 100644 --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc
@@ -902,14 +902,6 @@ "WebRTCColorAccuracy", base::FEATURE_DISABLED_BY_DEFAULT); -// Takes a reference on a video frame, keeping it alive during the duration of a -// video.requestVideoFrameCallback call. Doesn't change anything to the API for -// now, as this is only used to measure the potential impact of keeping frames -// alive for longer. See crbug.com/1259784. -BASE_FEATURE(kKeepRvfcFrameAlive, - "keep-rvfc-frame-alive", - base::FEATURE_DISABLED_BY_DEFAULT); - // Enables support for External Clear Key (ECK) key system for testing on // supported platforms. On platforms that do not support ECK, this feature has // no effect. @@ -1066,6 +1058,12 @@ kHardwareSecureDecryptionFallbackOnHardwareContextReset{ &kHardwareSecureDecryptionFallback, "on_hardware_context_reset", true}; +// If active, enable HiDPI mode that increases the display scale factor +// while capturing a low-resolution tab. +BASE_FEATURE(kWebContentsCaptureHiDpi, + "WebContentsCaptureHiDPI", + base::FEATURE_ENABLED_BY_DEFAULT); + // Enables handling of hardware media keys for controlling media. BASE_FEATURE(kHardwareMediaKeyHandling, "HardwareMediaKeyHandling",
diff --git a/media/base/media_switches.h b/media/base/media_switches.h index 8cce69f..1d6f4bd0 100644 --- a/media/base/media_switches.h +++ b/media/base/media_switches.h
@@ -253,7 +253,6 @@ kHardwareSecureDecryptionFallbackOnHardwareContextReset; MEDIA_EXPORT BASE_DECLARE_FEATURE(kHideIncognitoMediaMetadata); MEDIA_EXPORT BASE_DECLARE_FEATURE(kInternalMediaSession); -MEDIA_EXPORT BASE_DECLARE_FEATURE(kKeepRvfcFrameAlive); MEDIA_EXPORT BASE_DECLARE_FEATURE(kKeyPressMonitoring); MEDIA_EXPORT BASE_DECLARE_FEATURE(kLiveCaption); MEDIA_EXPORT BASE_DECLARE_FEATURE(kLiveCaptionAutomaticLanguageDownload); @@ -353,6 +352,7 @@ MEDIA_EXPORT BASE_DECLARE_FEATURE(kVideoToolboxVideoDecoder); #endif // BUILDFLAG(IS_APPLE) MEDIA_EXPORT BASE_DECLARE_FEATURE(kWebRTCColorAccuracy); +MEDIA_EXPORT BASE_DECLARE_FEATURE(kWebContentsCaptureHiDpi); MEDIA_EXPORT BASE_DECLARE_FEATURE(kWebrtcMediaCapabilitiesParameters); MEDIA_EXPORT BASE_DECLARE_FEATURE(kResolutionBasedDecoderPriority); MEDIA_EXPORT BASE_DECLARE_FEATURE(kForceHardwareVideoDecoders);
diff --git a/media/base/video_util.cc b/media/base/video_util.cc index aa61c52..850039a 100644 --- a/media/base/video_util.cc +++ b/media/base/video_util.cc
@@ -1348,4 +1348,23 @@ return frame; } +std::tuple<SkYUVAInfo::PlaneConfig, SkYUVAInfo::Subsampling> +VideoPixelFormatToSkiaValues(VideoPixelFormat video_format) { + // To expand support for additional VideoFormats expand this switch. + switch (video_format) { + case PIXEL_FORMAT_NV12: + case PIXEL_FORMAT_P016LE: + return {SkYUVAInfo::PlaneConfig::kY_UV, SkYUVAInfo::Subsampling::k420}; + case PIXEL_FORMAT_NV12A: + return {SkYUVAInfo::PlaneConfig::kY_UV_A, SkYUVAInfo::Subsampling::k420}; + case PIXEL_FORMAT_I420: + return {SkYUVAInfo::PlaneConfig::kY_U_V, SkYUVAInfo::Subsampling::k420}; + case PIXEL_FORMAT_I420A: + return {SkYUVAInfo::PlaneConfig::kY_U_V_A, SkYUVAInfo::Subsampling::k420}; + default: + return {SkYUVAInfo::PlaneConfig::kUnknown, + SkYUVAInfo::Subsampling::kUnknown}; + } +} + } // namespace media
diff --git a/media/base/video_util.h b/media/base/video_util.h index 8c1a4be7..6ce7d1b 100644 --- a/media/base/video_util.h +++ b/media/base/video_util.h
@@ -14,6 +14,7 @@ #include "media/base/media_export.h" #include "media/base/video_types.h" #include "third_party/skia/include/core/SkImage.h" +#include "third_party/skia/include/core/SkYUVAInfo.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" @@ -225,6 +226,10 @@ base::TimeDelta timestamp, bool force_opaque = false); +// Utility to convert a media pixel format to SkYUVAInfo. +MEDIA_EXPORT std::tuple<SkYUVAInfo::PlaneConfig, SkYUVAInfo::Subsampling> +VideoPixelFormatToSkiaValues(VideoPixelFormat video_format); + } // namespace media #endif // MEDIA_BASE_VIDEO_UTIL_H_
diff --git a/media/capture/video/chromeos/video_capture_jpeg_decoder_impl.cc b/media/capture/video/chromeos/video_capture_jpeg_decoder_impl.cc index 088640ce..3b80e02 100644 --- a/media/capture/video/chromeos/video_capture_jpeg_decoder_impl.cc +++ b/media/capture/video/chromeos/video_capture_jpeg_decoder_impl.cc
@@ -8,7 +8,6 @@ #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" -#include "base/metrics/histogram_macros.h" #include "base/task/sequenced_task_runner.h" #include "base/trace_event/typed_macros.h" #include "components/chromeos_camera/mojo_mjpeg_decode_accelerator.h" @@ -41,7 +40,6 @@ base::AutoLock lock(lock_); if (!IsVideoCaptureAcceleratedJpegDecodingEnabled()) { decoder_status_ = FAILED; - RecordInitDecodeUMA_Locked(); return; } @@ -225,7 +223,6 @@ } decoder_status_ = success ? INIT_PASSED : FAILED; - RecordInitDecodeUMA_Locked(); } bool VideoCaptureJpegDecoderImpl::IsDecoding_Locked() const { @@ -233,10 +230,4 @@ return !decode_done_closure_.is_null(); } -void VideoCaptureJpegDecoderImpl::RecordInitDecodeUMA_Locked() { - lock_.AssertAcquired(); - UMA_HISTOGRAM_BOOLEAN("Media.VideoCaptureGpuJpegDecoder.InitDecodeSuccess", - decoder_status_ == INIT_PASSED); -} - } // namespace media
diff --git a/media/capture/video/chromeos/video_capture_jpeg_decoder_impl.h b/media/capture/video/chromeos/video_capture_jpeg_decoder_impl.h index 64f3375..8493555 100644 --- a/media/capture/video/chromeos/video_capture_jpeg_decoder_impl.h +++ b/media/capture/video/chromeos/video_capture_jpeg_decoder_impl.h
@@ -75,9 +75,6 @@ // Returns true if the decoding of last frame is not finished yet. bool IsDecoding_Locked() const; - // Records |decoder_status_| to histogram. - void RecordInitDecodeUMA_Locked(); - void DestroyDecoderOnIOThread(base::WaitableEvent* event); MojoMjpegDecodeAcceleratorFactoryCB jpeg_decoder_factory_;
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc index 0b544cd..062c77b 100644 --- a/media/filters/ffmpeg_demuxer.cc +++ b/media/filters/ffmpeg_demuxer.cc
@@ -75,6 +75,16 @@ return av_seek_frame(s, stream_index, timestamp, 0); } +bool IsStreamEnabled(container_names::MediaContainerName container, + AVStream* stream) { + // Track enabled state is only handled for MP4 files. + if (container != container_names::MediaContainerName::kContainerMOV) { + return true; + } + // The mov demuxer translates MOV_TKHD_FLAG_ENABLED to AV_DISPOSITION_DEFAULT. + return stream->disposition & AV_DISPOSITION_DEFAULT; +} + } // namespace static base::Time ExtractTimelineOffset( @@ -1291,6 +1301,37 @@ // If available, |start_time_| will be set to the lowest stream start time. start_time_ = kInfiniteDuration; + // Check if there is any enabled stream. If there are none, the stream enabled + // flag will be ignored. + bool has_disabled_stream = false; + bool has_enabled_stream = false; + for (size_t i = 0; i < format_context->nb_streams; ++i) { + AVStream* stream = format_context->streams[i]; + + // Only consider audio and video streams. + const AVMediaType codec_type = stream->codecpar->codec_type; + if (codec_type != AVMEDIA_TYPE_AUDIO && codec_type != AVMEDIA_TYPE_VIDEO) { + continue; + } + + if (!IsStreamEnabled(container(), stream)) { + has_disabled_stream = true; + } else { + has_enabled_stream = true; + } + + if (has_disabled_stream && has_enabled_stream) { + break; + } + } + // Display a warning if all streams are disabled. + if (has_disabled_stream && !has_enabled_stream) { + MEDIA_LOG(WARNING, media_log_) + << GetDisplayName() + << ": no tracks are enabled, track enabled flag will be ignored"; + } + + // Create an FFmpegDemuxerStreams for each enabled audio/video stream. base::TimeDelta max_duration; int supported_audio_track_count = 0; int supported_video_track_count = 0; @@ -1348,10 +1389,15 @@ continue; } - // Skip disabled tracks. The mov demuxer translates MOV_TKHD_FLAG_ENABLED to - // AV_DISPOSITION_DEFAULT. - if (container() == container_names::MediaContainerName::kContainerMOV && - !(stream->disposition & AV_DISPOSITION_DEFAULT)) { + // Discard disabled streams, if there is at least one that is enabled. + if (has_enabled_stream && !IsStreamEnabled(container(), stream)) { + if (codec_type == AVMEDIA_TYPE_AUDIO) { + MEDIA_LOG(INFO, media_log_) + << GetDisplayName() << ": skipping disabled audio track"; + } else if (codec_type == AVMEDIA_TYPE_VIDEO) { + MEDIA_LOG(INFO, media_log_) + << GetDisplayName() << ": skipping disabled video track"; + } stream->discard = AVDISCARD_ALL; continue; }
diff --git a/media/filters/ffmpeg_demuxer_unittest.cc b/media/filters/ffmpeg_demuxer_unittest.cc index 0ca8bce..b3f4e31 100644 --- a/media/filters/ffmpeg_demuxer_unittest.cc +++ b/media/filters/ffmpeg_demuxer_unittest.cc
@@ -493,6 +493,17 @@ std::vector<DemuxerStream*> streams = demuxer_->GetAllStreams(); EXPECT_EQ(1u, streams.size()); } + +TEST_F(FFmpegDemuxerTest, Initialize_Track_Disabled) { + // Open a file containing the following streams: + // Stream #0: Video (AVC), disabled + CreateDemuxer("track-disabled.mp4"); + InitializeDemuxer(); + + // The track enabled flag should be ignored when all tracks are disabled. + std::vector<DemuxerStream*> streams = demuxer_->GetAllStreams(); + EXPECT_EQ(1u, streams.size()); +} #endif TEST_F(FFmpegDemuxerTest, Initialize_Encrypted) {
diff --git a/media/gpu/av1_decoder.cc b/media/gpu/av1_decoder.cc index bf2c333..d39e2b80 100644 --- a/media/gpu/av1_decoder.cc +++ b/media/gpu/av1_decoder.cc
@@ -116,6 +116,12 @@ } } // namespace +scoped_refptr<AV1Picture> AV1Decoder::AV1Accelerator::CreateAV1PictureSecure( + bool apply_grain, + uint64_t secure_handle) { + return nullptr; +} + AV1Decoder::AV1Decoder(std::unique_ptr<AV1Accelerator> accelerator, VideoCodecProfile profile, const VideoColorSpace& container_color_space) @@ -164,6 +170,7 @@ ClearReferenceFrames(); parser_.reset(); decrypt_config_.reset(); + secure_handle_ = 0; buffer_pool_ = std::make_unique<libgav1::BufferPool>( /*on_frame_buffer_size_changed=*/nullptr, @@ -193,6 +200,12 @@ decrypt_config_ = decoder_buffer.decrypt_config()->Clone(); else decrypt_config_.reset(); + if (decoder_buffer.has_side_data() && + decoder_buffer.side_data()->secure_handle) { + secure_handle_ = decoder_buffer.side_data()->secure_handle; + } else { + secure_handle_ = 0; + } } void AV1Decoder::ClearCurrentFrame() { @@ -451,8 +464,11 @@ DCHECK(current_sequence_header_->film_grain_params_present || !frame_header.film_grain_params.apply_grain); - auto pic = accelerator_->CreateAV1Picture( - frame_header.film_grain_params.apply_grain); + auto pic = secure_handle_ ? accelerator_->CreateAV1PictureSecure( + frame_header.film_grain_params.apply_grain, + secure_handle_) + : accelerator_->CreateAV1Picture( + frame_header.film_grain_params.apply_grain); if (!pic) { clear_current_frame.ReplaceClosure(base::DoNothing()); return kRanOutOfSurfaces;
diff --git a/media/gpu/av1_decoder.h b/media/gpu/av1_decoder.h index a8a82e17..52b6d0cf6 100644 --- a/media/gpu/av1_decoder.h +++ b/media/gpu/av1_decoder.h
@@ -82,6 +82,16 @@ // case and treat it as normal, returning kRanOutOfSurfaces from Decode(). virtual scoped_refptr<AV1Picture> CreateAV1Picture(bool apply_grain) = 0; + // |secure_handle| is a reference to the corresponding secure memory when + // doing secure decoding on ARM. This is invoked instead of CreateAV1Picture + // when doing secure decoding on ARM. Default implementation returns + // nullptr. + // TODO(jkardatzke): Remove this once we move to the V4L2 flat stateless + // decoder and add a field to media::CodecPicture instead. + virtual scoped_refptr<AV1Picture> CreateAV1PictureSecure( + bool apply_grain, + uint64_t secure_handle); + // Submits |pic| to the driver for accelerated decoding. The following // parameters are also passed: // - |sequence_header|: the current OBU sequence header. @@ -177,6 +187,10 @@ size_t stream_size_ = 0; std::unique_ptr<DecryptConfig> decrypt_config_; + // Secure handle to pass through to the accelerator when doing secure playback + // on ARM. + uint64_t secure_handle_ = 0; + // Pending picture for decode when accelerator returns kTryAgain. scoped_refptr<AV1Picture> pending_pic_;
diff --git a/media/gpu/chromeos/video_decoder_pipeline.cc b/media/gpu/chromeos/video_decoder_pipeline.cc index 2ac3200..0ad8d51 100644 --- a/media/gpu/chromeos/video_decoder_pipeline.cc +++ b/media/gpu/chromeos/video_decoder_pipeline.cc
@@ -391,7 +391,9 @@ VideoDecoderType VideoDecoderPipeline::GetDecoderType() const { DCHECK_CALLED_ON_VALID_SEQUENCE(client_sequence_checker_); - // TODO(mcasas): query |decoder_| instead. + // TODO(mcasas): query |decoder_| instead. This is difficult because it can + // only be accessed on |decoder_sequence_checker_|: this method is supposed + // to be synchronous. if (uses_oop_video_decoder_) { return VideoDecoderType::kOutOfProcess; @@ -415,8 +417,16 @@ int VideoDecoderPipeline::GetMaxDecodeRequests() const { DCHECK_CALLED_ON_VALID_SEQUENCE(client_sequence_checker_); - // TODO(mcasas): query |decoder_| instead. - // This value comes from the number of buffers in the input queue in + // TODO(mcasas): query |decoder_| instead. This is difficult because it can + // only be accessed on |decoder_sequence_checker_|: this method is supposed + // to be synchronous. + +#if BUILDFLAG(USE_V4L2_CODEC) + if (base::FeatureList::IsEnabled(kV4L2FlatStatefulVideoDecoder)) { + return 4; + } +#endif + // This value comes from the (large) number of buffers in the input queue in // V4L2VideoDecoder. return 8; }
diff --git a/media/gpu/h264_decoder.cc b/media/gpu/h264_decoder.cc index f408c3d..aca19b5 100644 --- a/media/gpu/h264_decoder.cc +++ b/media/gpu/h264_decoder.cc
@@ -84,6 +84,11 @@ H264Decoder::H264Accelerator::~H264Accelerator() = default; +scoped_refptr<H264Picture> +H264Decoder::H264Accelerator::CreateH264PictureSecure(uint64_t secure_handle) { + return nullptr; +} + void H264Decoder::H264Accelerator::ProcessSPS( const H264SPS* sps, base::span<const uint8_t> sps_nalu_data) {} @@ -102,8 +107,7 @@ H264Decoder::H264Accelerator::Status H264Decoder::H264Accelerator::SetStream( base::span<const uint8_t> stream, - const DecryptConfig* decrypt_config, - uint64_t secure_handle) { + const DecryptConfig* decrypt_config) { return H264Decoder::H264Accelerator::Status::kNotSupported; } @@ -1464,7 +1468,7 @@ // originally set in case the accelerator needs to return kTryAgain. H264Accelerator::Status result = accelerator_->SetStream( base::span<const uint8_t>(current_stream_, current_stream_size_), - current_decrypt_config_.get(), secure_handle_); + current_decrypt_config_.get()); switch (result) { case H264Accelerator::Status::kOk: case H264Accelerator::Status::kNotSupported: @@ -1564,7 +1568,11 @@ } else { // New picture/finished previous one, try to start a new one // or tell the client we need more surfaces. - curr_pic_ = accelerator_->CreateH264Picture(); + if (secure_handle_) { + curr_pic_ = accelerator_->CreateH264PictureSecure(secure_handle_); + } else { + curr_pic_ = accelerator_->CreateH264Picture(); + } if (!curr_pic_) return kRanOutOfSurfaces; if (current_decrypt_config_)
diff --git a/media/gpu/h264_decoder.h b/media/gpu/h264_decoder.h index 9a37813..59f576d 100644 --- a/media/gpu/h264_decoder.h +++ b/media/gpu/h264_decoder.h
@@ -75,6 +75,15 @@ // this situation as normal and return from Decode() with kRanOutOfSurfaces. virtual scoped_refptr<H264Picture> CreateH264Picture() = 0; + // |secure_handle| is a reference to the corresponding secure memory when + // doing secure decoding on ARM. This is invoked instead of CreateAV1Picture + // when doing secure decoding on ARM. Default implementation returns + // nullptr. + // TODO(jkardatzke): Remove this once we move to the V4L2 flat stateless + // decoder and add a field to media::CodecPicture instead. + virtual scoped_refptr<H264Picture> CreateH264PictureSecure( + uint64_t secure_handle); + // Provides the raw NALU data for an SPS. The |sps| passed to // SubmitFrameMetadata() is always the most recent SPS passed to // ProcessSPS() with the same |seq_parameter_set_id|. @@ -171,8 +180,7 @@ // later. This method has a default implementation that returns // kNotSupported. virtual Status SetStream(base::span<const uint8_t> stream, - const DecryptConfig* decrypt_config, - uint64_t secure_handle); + const DecryptConfig* decrypt_config); // Notifies whether or not the current platform requires reference lists. // In general, implementations don't need it.
diff --git a/media/gpu/h264_decoder_unittest.cc b/media/gpu/h264_decoder_unittest.cc index 1ac5abdd..7636eb2 100644 --- a/media/gpu/h264_decoder_unittest.cc +++ b/media/gpu/h264_decoder_unittest.cc
@@ -141,10 +141,9 @@ size_t size, const std::vector<SubsampleEntry>& subsamples)); MOCK_METHOD1(OutputPicture, bool(scoped_refptr<H264Picture> pic)); - MOCK_METHOD3(SetStream, + MOCK_METHOD2(SetStream, Status(base::span<const uint8_t> stream, - const DecryptConfig* decrypt_config, - uint64_t secure_handle)); + const DecryptConfig* decrypt_config)); void Reset() override {} @@ -210,7 +209,7 @@ ON_CALL(*accelerator_, SubmitSlice(_, _, _, _, _, _, _, _)) .With(Args<6, 7>(SubsampleSizeMatches())) .WillByDefault(Return(H264Decoder::H264Accelerator::Status::kOk)); - ON_CALL(*accelerator_, SetStream(_, _, _)) + ON_CALL(*accelerator_, SetStream(_, _)) .WillByDefault( Return(H264Decoder::H264Accelerator::Status::kNotSupported)); } @@ -774,7 +773,7 @@ TEST_F(H264DecoderTest, SetStreamRetry) { SetInputFrameFiles({kBaselineFrame0}); - EXPECT_CALL(*accelerator_, SetStream(_, _, _)) + EXPECT_CALL(*accelerator_, SetStream(_, _)) .WillOnce(Return(H264Decoder::H264Accelerator::Status::kTryAgain)) .WillOnce(Return(H264Decoder::H264Accelerator::Status::kOk)); ASSERT_EQ(AcceleratedVideoDecoder::kTryAgain, Decode());
diff --git a/media/gpu/h265_decoder.cc b/media/gpu/h265_decoder.cc index a11f8d5..226e9791 100644 --- a/media/gpu/h265_decoder.cc +++ b/media/gpu/h265_decoder.cc
@@ -79,6 +79,11 @@ H265Decoder::H265Accelerator::~H265Accelerator() = default; +scoped_refptr<H265Picture> +H265Decoder::H265Accelerator::CreateH265PictureSecure(uint64_t secure_handle) { + return nullptr; +} + void H265Decoder::H265Accelerator::ProcessVPS( const H265VPS* vps, base::span<const uint8_t> vps_nalu_data) {} @@ -156,6 +161,12 @@ parser_.SetStream(ptr, size); current_decrypt_config_ = nullptr; } + if (decoder_buffer.has_side_data() && + decoder_buffer.side_data()->secure_handle) { + secure_handle_ = decoder_buffer.side_data()->secure_handle; + } else { + secure_handle_ = 0; + } } void H265Decoder::Reset() { @@ -182,6 +193,8 @@ parser_.Reset(); accelerator_->Reset(); + secure_handle_ = 0; + state_ = kAfterReset; } @@ -386,7 +399,11 @@ } else { // New picture, try to start a new one or tell client we need more // surfaces. - curr_pic_ = accelerator_->CreateH265Picture(); + if (secure_handle_) { + curr_pic_ = accelerator_->CreateH265PictureSecure(secure_handle_); + } else { + curr_pic_ = accelerator_->CreateH265Picture(); + } if (!curr_pic_) return kRanOutOfSurfaces; if (current_decrypt_config_) @@ -1254,6 +1271,8 @@ ref_pic_set_st_curr_after_.clear(); ref_pic_set_st_curr_before_.clear(); + secure_handle_ = 0; + return true; }
diff --git a/media/gpu/h265_decoder.h b/media/gpu/h265_decoder.h index 7bfe8feb1..10fa9c7 100644 --- a/media/gpu/h265_decoder.h +++ b/media/gpu/h265_decoder.h
@@ -80,6 +80,15 @@ // this situation as normal and return from Decode() with kRanOutOfSurfaces. virtual scoped_refptr<H265Picture> CreateH265Picture() = 0; + // |secure_handle| is a reference to the corresponding secure memory when + // doing secure decoding on ARM. This is invoked instead of CreateAV1Picture + // when doing secure decoding on ARM. Default implementation returns + // nullptr. + // TODO(jkardatzke): Remove this once we move to the V4L2 flat stateless + // decoder and add a field to media::CodecPicture instead. + virtual scoped_refptr<H265Picture> CreateH265PictureSecure( + uint64_t secure_handle); + // Provides the raw NALU data for a VPS. The |vps| passed to // SubmitFrameMetadata() is always the most recent VPS passed to // ProcessVPS() with the same |vps_video_parameter_set_id|. @@ -302,6 +311,10 @@ // Decrypting config for the most recent data passed to SetStream(). std::unique_ptr<DecryptConfig> current_decrypt_config_; + // Secure handle to pass through to the accelerator when doing secure playback + // on ARM. + uint64_t secure_handle_ = 0; + // Keep track of when SetStream() is called so that // H265Accelerator::SetStream() can be called. bool current_stream_has_been_changed_ = false;
diff --git a/media/gpu/test/video_decode_accelerator_perf_tests.cc b/media/gpu/test/video_decode_accelerator_perf_tests.cc index 75eea55c..6005e74 100644 --- a/media/gpu/test/video_decode_accelerator_perf_tests.cc +++ b/media/gpu/test/video_decode_accelerator_perf_tests.cc
@@ -526,7 +526,7 @@ #if BUILDFLAG(USE_V4L2_CODEC) std::unique_ptr<base::FeatureList> feature_list = std::make_unique<base::FeatureList>(); - feature_list->InitializeFromCommandLine( + feature_list->InitFromCommandLine( cmd_line->GetSwitchValueASCII(switches::kEnableFeatures), cmd_line->GetSwitchValueASCII(switches::kDisableFeatures)); if (feature_list->IsFeatureOverridden("V4L2FlatStatelessVideoDecoder")) {
diff --git a/media/gpu/test/video_decode_accelerator_tests.cc b/media/gpu/test/video_decode_accelerator_tests.cc index f151f7f..ff8a420 100644 --- a/media/gpu/test/video_decode_accelerator_tests.cc +++ b/media/gpu/test/video_decode_accelerator_tests.cc
@@ -853,7 +853,7 @@ #if BUILDFLAG(USE_V4L2_CODEC) std::unique_ptr<base::FeatureList> feature_list = std::make_unique<base::FeatureList>(); - feature_list->InitializeFromCommandLine( + feature_list->InitFromCommandLine( cmd_line->GetSwitchValueASCII(switches::kEnableFeatures), cmd_line->GetSwitchValueASCII(switches::kDisableFeatures)); if (feature_list->IsFeatureOverridden("V4L2FlatStatelessVideoDecoder")) {
diff --git a/media/gpu/v4l2/stateless/device.cc b/media/gpu/v4l2/stateless/device.cc index 596f5b8..27405af 100644 --- a/media/gpu/v4l2/stateless/device.cc +++ b/media/gpu/v4l2/stateless/device.cc
@@ -13,7 +13,6 @@ #endif #include <fcntl.h> -#include <linux/media.h> #include <linux/videodev2.h> #include <sys/ioctl.h> #include <sys/mman.h> @@ -240,6 +239,11 @@ planes_[plane].length = size; } +void Buffer::SetTimeAsFrameID(uint64_t usec) { + time_val_.tv_sec = 0; + time_val_.tv_usec = usec; +} + struct timeval Buffer::GetTimeval() const { return time_val_; }
diff --git a/media/gpu/v4l2/stateless/device.h b/media/gpu/v4l2/stateless/device.h index 930ddd9..8e6703ad 100644 --- a/media/gpu/v4l2/stateless/device.h +++ b/media/gpu/v4l2/stateless/device.h
@@ -56,6 +56,7 @@ BufferType GetBufferType() const { return buffer_type_; } MemoryType GetMemoryType() const { return memory_type_; } + void SetTimeAsFrameID(uint64_t usec); struct timeval GetTimeval() const; // Method for copying compressed input data into a Buffer's backing store. It @@ -200,6 +201,6 @@ bool OpenDevice(); }; -} // namespace media +} // namespace media #endif // MEDIA_GPU_V4L2_STATELESS_DEVICE_H_
diff --git a/media/gpu/v4l2/stateless/queue.cc b/media/gpu/v4l2/stateless/queue.cc index 50a6a1d..5ae45e3d 100644 --- a/media/gpu/v4l2/stateless/queue.cc +++ b/media/gpu/v4l2/stateless/queue.cc
@@ -5,6 +5,7 @@ #include "media/gpu/v4l2/stateless/queue.h" #include "base/containers/contains.h" +#include "base/notreached.h" #include "media/gpu/macros.h" namespace { @@ -96,6 +97,25 @@ return device_->StreamOff(buffer_type_); } +absl::optional<uint32_t> BaseQueue::GetFreeBufferIndex() { + // TODO(frkoenig): This is an expected error, there will be times that all of + // the buffers will be in the queue. For now give it a high severity for + // visibility. + if (free_buffer_indices_.empty()) { + DVLOGF(1) << "No buffers available for " << Description(); + return absl::nullopt; + } + + auto it = free_buffer_indices_.begin(); + uint32_t index = *it; + free_buffer_indices_.erase(index); + + DVLOGF(3) << free_buffer_indices_.size() << " buffers available for " + << Description(); + + return index; +} + // static std::unique_ptr<InputQueue> InputQueue::Create( scoped_refptr<StatelessDevice> device, @@ -137,6 +157,72 @@ return AllocateBuffers(kNumberInputPlanes); } +bool InputQueue::SubmitCompressedFrameData(void* ctrls, + const void* data, + size_t length, + uint32_t frame_id) { + // Failing to acquire a buffer is a normal part of the process. All of the + // input buffers can be full if the output buffers are not being cleared. + auto buffer_index = GetFreeBufferIndex(); + if (!buffer_index) { + DVLOGF(1) << "No free buffers to submit a compressed frame with."; + // TODO(frkoenig): This is a place holder. Correct error handling needs + // to be implemented. It may be better to obtain the buffer and pass it + // into this method so that retry is more straight forward. + NOTREACHED(); + return false; + } + + DVLOG(3) << "Submitting buffer " << buffer_index.value(); + + Buffer& buffer = buffers_[buffer_index.value()]; + + // Compressed input buffers only need one plane for data, + // uncompressed output buffers may need more than one plane. + if (1 != buffer.PlaneCount()) { + DVLOGF(1) << "Compressed buffer has more than one plane: " + << buffer.PlaneCount(); + return false; + } + + // Each request needs an FD. A pool of FD's can be reused, but require + // reinitialization after use. Instead a scoped FD is created, which will + // be closed at the end of this function. This is fine as the driver will + // keep the FD open until it is done using it. + const base::ScopedFD request_fd = device_->CreateRequestFD(); + + // |frame_id| is used for two things: + // 1. To track the buffer from compressed to uncompressed. The timestamp will + // be copied. + // 2. This value is also used for reference frame management. Future frames + // can reference this one by using the |frame_id|. + buffer.SetTimeAsFrameID(frame_id); + buffer.CopyDataIn(data, length); + + // This shouldn't happen. A buffer has been allocated and filled, there + // should be nothing preventing it from getting queued. + if (!device_->QueueBuffer(buffer, request_fd)) { + DVLOGF(1) << "Failed to queue buffer."; + return false; + } + + // Headers submission failure should never happen. There is no way to + // recover from this error. + if (!device_->SetHeaders(ctrls, request_fd)) { + DVLOGF(1) << "Unable to set headers to V4L2 at fd: " << request_fd.get(); + return false; + } + + // Everything has been allocated and this is the final submission. To error + // out here would mean that the driver is not in a state to decode video. + if (!device_->QueueRequest(request_fd)) { + DVLOGF(1) << "Unable to queue request at fd :" << request_fd.get(); + return false; + } + + return true; +} + std::string InputQueue::Description() { return "input"; }
diff --git a/media/gpu/v4l2/stateless/queue.h b/media/gpu/v4l2/stateless/queue.h index e317e6e9..fb09825 100644 --- a/media/gpu/v4l2/stateless/queue.h +++ b/media/gpu/v4l2/stateless/queue.h
@@ -35,6 +35,7 @@ protected: bool AllocateBuffers(uint32_t num_planes); virtual std::string Description() = 0; + absl::optional<uint32_t> GetFreeBufferIndex(); scoped_refptr<StatelessDevice> device_; const BufferType buffer_type_; @@ -59,6 +60,10 @@ const gfx::Size resolution); InputQueue(scoped_refptr<StatelessDevice> device, VideoCodec codec); + bool SubmitCompressedFrameData(void* ctrls, + const void* data, + size_t length, + uint32_t frame_id); bool PrepareBuffers() override; private: @@ -78,6 +83,9 @@ bool NegotiateFormat(); bool PrepareBuffers() override; + Fourcc GetQueueFormat() const { return buffer_format_.fourcc; } + gfx::Size GetVideoResolution() const { return buffer_format_.resolution; } + private: std::string Description() override; uint32_t BufferMinimumCount() override;
diff --git a/media/gpu/v4l2/stateless/stateless_decode_surface.cc b/media/gpu/v4l2/stateless/stateless_decode_surface.cc index 7e2b290..a8bad3e 100644 --- a/media/gpu/v4l2/stateless/stateless_decode_surface.cc +++ b/media/gpu/v4l2/stateless/stateless_decode_surface.cc
@@ -6,10 +6,8 @@ namespace media { -StatelessDecodeSurface::StatelessDecodeSurface(scoped_refptr<VideoFrame> frame) - : video_frame_(std::move(frame)) {} - -StatelessDecodeSurface::StatelessDecodeSurface() {} +StatelessDecodeSurface::StatelessDecodeSurface(uint32_t frame_id) + : frame_id_(frame_id) {} StatelessDecodeSurface::~StatelessDecodeSurface() {}
diff --git a/media/gpu/v4l2/stateless/stateless_decode_surface.h b/media/gpu/v4l2/stateless/stateless_decode_surface.h index 58de188..aa0cb8c 100644 --- a/media/gpu/v4l2/stateless/stateless_decode_surface.h +++ b/media/gpu/v4l2/stateless/stateless_decode_surface.h
@@ -12,8 +12,7 @@ class StatelessDecodeSurface : public base::RefCounted<StatelessDecodeSurface> { public: - StatelessDecodeSurface(scoped_refptr<VideoFrame> frame); - StatelessDecodeSurface(); + StatelessDecodeSurface(uint32_t frame_id); StatelessDecodeSurface(const StatelessDecodeSurface&) = delete; StatelessDecodeSurface& operator=(const StatelessDecodeSurface&) = delete; @@ -23,7 +22,9 @@ friend class base::RefCounted<StatelessDecodeSurface>; private: - scoped_refptr<VideoFrame> video_frame_; + // Identify this surface so that it can be matched up the the uncompressed + // buffer when it is done being decompressed. + const uint32_t frame_id_; }; } // namespace media
diff --git a/media/gpu/v4l2/stateless/stateless_decode_surface_handler.h b/media/gpu/v4l2/stateless/stateless_decode_surface_handler.h index e09a330..680521e7 100644 --- a/media/gpu/v4l2/stateless/stateless_decode_surface_handler.h +++ b/media/gpu/v4l2/stateless/stateless_decode_surface_handler.h
@@ -24,12 +24,12 @@ // The stateless api requires that the client parse the header information // and send that separately. |ctrls| is the parsed header while |data| is // the complete frame of compressed data with |size| being the length of - // the buffer. |bitstream_id| is an identifier for the driver to use for + // the buffer. |frame_id| is an identifier for the driver to use for // reference frame designation. virtual bool SubmitFrame(void* ctrls, const uint8_t* data, size_t size, - int32_t bitstream_id) = 0; + uint32_t frame_id) = 0; }; } // namespace media
diff --git a/media/gpu/v4l2/stateless/stateless_device.cc b/media/gpu/v4l2/stateless/stateless_device.cc index 145154c..d031510 100644 --- a/media/gpu/v4l2/stateless/stateless_device.cc +++ b/media/gpu/v4l2/stateless/stateless_device.cc
@@ -4,8 +4,12 @@ #include "media/gpu/v4l2/stateless/stateless_device.h" +#include <fcntl.h> +#include <linux/media.h> #include <linux/videodev2.h> +#include "base/posix/eintr_wrapper.h" +#include "base/strings/string_number_conversions.h" #include "build/build_config.h" #include "media/gpu/macros.h" #include "media/gpu/v4l2/v4l2_utils.h" @@ -20,8 +24,16 @@ namespace media { +StatelessDevice::StatelessDevice() {} + +StatelessDevice::~StatelessDevice() {} + bool StatelessDevice::Open() { - return OpenDevice(); + if (!OpenDevice()) { + return false; + } + + return OpenMedia(); } bool StatelessDevice::CheckCapabilities(VideoCodec codec) { @@ -72,8 +84,6 @@ return (IoctlDevice(VIDIOC_QUERYCTRL, &query_ctrl) == kIoctlOk); } -StatelessDevice::~StatelessDevice() {} - uint32_t StatelessDevice::VideoCodecToV4L2PixFmt(VideoCodec codec) { switch (codec) { case VideoCodec::kH264: @@ -115,6 +125,91 @@ return (IoctlDevice(VIDIOC_S_EXT_CTRLS, ext_ctrls) == kIoctlOk); } +// MEDIA_IOC_REQUEST_ALLOC +base::ScopedFD StatelessDevice::CreateRequestFD() { + DVLOGF(4); + int request_fd; + const int ret = Ioctl(media_fd_, MEDIA_IOC_REQUEST_ALLOC, &request_fd); + if (ret != kIoctlOk) { + VPLOGF(1) << "Failed to create request file descriptor."; + return base::ScopedFD(-1); + } + + return base::ScopedFD(request_fd); +} + +// MEDIA_REQUEST_IOC_QUEUE +bool StatelessDevice::QueueRequest(const base::ScopedFD& request_fd) { + DVLOGF(4); + return (Ioctl(request_fd, MEDIA_REQUEST_IOC_QUEUE, nullptr) == kIoctlOk); +} + +bool StatelessDevice::OpenMedia() { + DVLOGF(4); + + struct v4l2_capability caps; + if (IoctlDevice(VIDIOC_QUERYCAP, &caps) != kIoctlOk) { + return false; + } + + // Some devices, namely the RK3399, have multiple hardware decoder blocks. + // We have to find and use the matching media device, or the kernel gets + // confused. + // Note that the match persists for the lifetime of V4L2Device. In practice + // this should be fine, since |GetRequestsQueue()| is only called after + // the codec format is configured, and the VD/VDA instance is always tied + // to a specific format, so it will never need to switch media devices. + static const std::string kRequestDevicePrefix = "/dev/media-dec"; + + // We are sandboxed, so we can't query directory contents to check which + // devices are actually available. Try to open the first 10; if not present, + // we will just fail to open immediately. + base::ScopedFD media_fd; + for (int i = 0; i < 10; ++i) { + const auto path = kRequestDevicePrefix + base::NumberToString(i); + media_fd_.reset(HANDLE_EINTR(open(path.c_str(), O_RDWR, 0))); + if (!media_fd_.is_valid()) { + VPLOGF(2) << "Failed to open media device: " << path; + continue; + } + + struct media_device_info media_info; + if (Ioctl(media_fd_, MEDIA_IOC_DEVICE_INFO, &media_info) != kIoctlOk) { + continue; + } + + // Match the video driver and the media controller by the bus_info + // field. This works better than the driver field if there are multiple + // instances of the same decoder driver in the system. However old MediaTek + // drivers didn't fill in the bus_info field for the media drivers. + if (strlen(reinterpret_cast<const char*>(caps.bus_info)) > 0 && + strlen(reinterpret_cast<const char*>(media_info.bus_info)) > 0 && + strncmp(reinterpret_cast<const char*>(caps.bus_info), + reinterpret_cast<const char*>(media_info.bus_info), + sizeof(caps.bus_info))) { + continue; + } + + // Fall back to matching the video driver and the media controller by the + // driver field. The mtk-vcodec driver does not fill the card and bus fields + // properly, so those won't work. + if (strncmp(reinterpret_cast<const char*>(caps.driver), + reinterpret_cast<const char*>(media_info.driver), + sizeof(caps.driver))) { + continue; + } + + break; + } + + if (!media_fd_.is_valid()) { + VLOGF(1) << "Failed to open request queue fd."; + return false; + } + + return true; +} + std::string StatelessDevice::DevicePath() { // TODO(frkoenig) : better querying? return "/dev/video-dec0";
diff --git a/media/gpu/v4l2/stateless/stateless_device.h b/media/gpu/v4l2/stateless/stateless_device.h index 7d8c35ad..732a832 100644 --- a/media/gpu/v4l2/stateless/stateless_device.h +++ b/media/gpu/v4l2/stateless/stateless_device.h
@@ -5,15 +5,20 @@ #ifndef MEDIA_GPU_V4L2_STATELESS_STATELESS_DEVICE_H_ #define MEDIA_GPU_V4L2_STATELESS_STATELESS_DEVICE_H_ +#include "base/files/scoped_file.h" #include "media/gpu/v4l2/stateless/device.h" namespace media { class MEDIA_GPU_EXPORT StatelessDevice : public Device { public: + StatelessDevice(); + bool CheckCapabilities(VideoCodec codec) override; bool Open() override; bool IsCompressedVP9HeaderSupported(); + base::ScopedFD CreateRequestFD(); + bool QueueRequest(const base::ScopedFD& request_fd); // As part of the stateless uAPI the headers are parsed by the client // and sent to the device. When |request_fd| is invalid the driver parses @@ -28,7 +33,10 @@ private: uint32_t VideoCodecToV4L2PixFmt(VideoCodec codec) override; + bool OpenMedia(); std::string DevicePath() override; + + base::ScopedFD media_fd_; }; } // namespace media
diff --git a/media/gpu/v4l2/stateless/v4l2_stateless_video_decoder.cc b/media/gpu/v4l2/stateless/v4l2_stateless_video_decoder.cc index 300f2f8..ee4ed8f5 100644 --- a/media/gpu/v4l2/stateless/v4l2_stateless_video_decoder.cc +++ b/media/gpu/v4l2/stateless/v4l2_stateless_video_decoder.cc
@@ -6,6 +6,7 @@ #include "base/memory/ptr_util.h" #include "base/notreached.h" +#include "media/gpu/chromeos/image_processor.h" #include "media/gpu/gpu_video_decode_accelerator_helpers.h" #include "media/gpu/macros.h" #include "media/gpu/v4l2/stateless/utils.h" @@ -100,6 +101,8 @@ return; } + aspect_ratio_ = config.aspect_ratio(); + output_cb_ = std::move(output_cb); std::move(init_cb).Run(DecoderStatus::Codes::kOk); } @@ -162,13 +165,30 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(decoder_sequence_checker_); DVLOGF(4); - return base::MakeRefCounted<StatelessDecodeSurface>(); + // This function is called before decoding of the bitstream. A place to + // store the decoded frame should be available before the decode occurs. But + // that is not how the V4L2 stateless model works. The compressed buffer queue + // is independent of the decoded frame queue. + // The two queues need to be matched up. The metadata associated with the + // compressed data needs to be tracked. In V4L2 m2m model this is done by + // copying the timestamps from the compressed buffer to the decoded buffer. + // + // The surface needs to match up the decompressed buffer to the originating + // metadata. This can't be done with |bitstream_id| because |bitstream_id| is + // a per packet, not per frame, designator. But it is used to match up the + // incoming timestamp with the displayed frame. + + const uint32_t frame_id = + frame_id_generator_.GenerateNextId().GetUnsafeValue(); + + return base::MakeRefCounted<StatelessDecodeSurface>(frame_id); } bool V4L2StatelessVideoDecoder::SubmitFrame(void* ctrls, const uint8_t* data, size_t size, - int32_t bitstream_id) { + uint32_t frame_id) { + DCHECK_CALLED_ON_VALID_SEQUENCE(decoder_sequence_checker_); DVLOGF(4); if (!output_queue_) { if (!input_queue_->PrepareBuffers()) { @@ -191,10 +211,15 @@ return false; } + if (!SetupOutputFormatForPipeline()) { + return false; + } + output_queue_->StartStreaming(); } - return true; + DVLOGF(2) << "Submitting compressed frame " << frame_id << " to be decoded."; + return input_queue_->SubmitCompressedFrameData(ctrls, data, size, frame_id); } void V4L2StatelessVideoDecoder::SurfaceReady( @@ -238,6 +263,42 @@ return !!input_queue_; } +bool V4L2StatelessVideoDecoder::SetupOutputFormatForPipeline() { + DCHECK_CALLED_ON_VALID_SEQUENCE(decoder_sequence_checker_); + DVLOGF(4); + DCHECK(output_queue_); + + // The |output_queue_| has been already set up by the driver. This format + // needs to be consumed by those further down the pipeline, i.e. image + // processor, gpu, or display. + std::vector<ImageProcessor::PixelLayoutCandidate> candidates; + candidates.emplace_back(ImageProcessor::PixelLayoutCandidate{ + .fourcc = output_queue_->GetQueueFormat(), + .size = output_queue_->GetVideoResolution()}); + + const gfx::Rect visible_rect = decoder_->GetVisibleRect(); + const size_t num_codec_reference_frames = decoder_->GetNumReferenceFrames(); + // Verify |num_codec_reference_frames| has a reasonable value. Anecdotally + // 16 is the largest amount of reference frames seen, on an ITU-T H.264 test + // vector (CAPCM*1_Sand_E.h264). + CHECK_LE(num_codec_reference_frames, 32u); + + // The pipeline needs to pick an output format. If the |output_queue_| format + // can not be consumed by the rest of the pipeline an image processor will be + // needed. + CroStatus::Or<ImageProcessor::PixelLayoutCandidate> status_or_output_format = + client_->PickDecoderOutputFormat( + candidates, visible_rect, aspect_ratio_.GetNaturalSize(visible_rect), + /*output_size=*/absl::nullopt, num_codec_reference_frames, + /*use_protected=*/false, /*need_aux_frame_pool=*/false, + /*allocator=*/absl::nullopt); + if (!status_or_output_format.has_value()) { + return false; + } + + return true; +} + void V4L2StatelessVideoDecoder::ProcessCompressedBuffer( scoped_refptr<DecoderBuffer> compressed_buffer, VideoDecoder::DecodeCB decode_cb,
diff --git a/media/gpu/v4l2/stateless/v4l2_stateless_video_decoder.h b/media/gpu/v4l2/stateless/v4l2_stateless_video_decoder.h index 9793d52..0de04d833 100644 --- a/media/gpu/v4l2/stateless/v4l2_stateless_video_decoder.h +++ b/media/gpu/v4l2/stateless/v4l2_stateless_video_decoder.h
@@ -67,7 +67,7 @@ bool SubmitFrame(void* ctrls, const uint8_t* data, size_t size, - int32_t bitstream_id) override; + uint32_t frame_id) override; private: V4L2StatelessVideoDecoder( @@ -86,6 +86,11 @@ // can be created. bool CreateInputQueue(VideoCodecProfile profile, const gfx::Size resolution); + // The uncompressed format that the driver produces is setup by the + // |output_queue_|. This format then needs to be passed further down the + // pipeline. + bool SetupOutputFormatForPipeline(); + // Process the data in the |compressed_buffer| using the |decoder_|. void ProcessCompressedBuffer(scoped_refptr<DecoderBuffer> compressed_buffer, VideoDecoder::DecodeCB decode_cb, @@ -104,15 +109,25 @@ // Queue to hold compressed bitstream buffers to be submitted to the hardware std::unique_ptr<InputQueue> input_queue_; + // Queue to hold uncompressed image buffers returned by the hardware std::unique_ptr<OutputQueue> output_queue_; + // Aspect ratio from config to use for output frames. + VideoAspectRatio aspect_ratio_; + // Int32 safe ID generator, starting at 0. Generated IDs are used to uniquely // identify a Decode() request for stateless backends. BitstreamID is just // a "phantom type" (see StrongAlias), essentially just a name. struct BitstreamID {}; base::IdType32<BitstreamID>::Generator bitstream_id_generator_ GUARDED_BY_CONTEXT(decoder_sequence_checker_); + + // Unique enough identifier so that all outstanding reference frames have a + // unique identifier + struct FrameID {}; + base::IdTypeU32<FrameID>::Generator frame_id_generator_ + GUARDED_BY_CONTEXT(decoder_sequence_checker_); }; } // namespace media
diff --git a/media/gpu/v4l2/v4l2_decode_surface.cc b/media/gpu/v4l2/v4l2_decode_surface.cc index 81c06d03..80c76d95 100644 --- a/media/gpu/v4l2/v4l2_decode_surface.cc +++ b/media/gpu/v4l2/v4l2_decode_surface.cc
@@ -18,12 +18,14 @@ V4L2DecodeSurface::V4L2DecodeSurface(V4L2WritableBufferRef input_buffer, V4L2WritableBufferRef output_buffer, - scoped_refptr<VideoFrame> frame) + scoped_refptr<VideoFrame> frame, + uint64_t secure_handle) : input_buffer_(std::move(input_buffer)), output_buffer_(std::move(output_buffer)), video_frame_(std::move(frame)), output_record_(output_buffer_.BufferId()), - decoded_(false) { + decoded_(false), + secure_handle_(secure_handle) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); }
diff --git a/media/gpu/v4l2/v4l2_decode_surface.h b/media/gpu/v4l2/v4l2_decode_surface.h index 36d39bfd..e841e37 100644 --- a/media/gpu/v4l2/v4l2_decode_surface.h +++ b/media/gpu/v4l2/v4l2_decode_surface.h
@@ -31,9 +31,12 @@ // output in this transaction. // |frame| is optional, and allows the caller to keep a reference to a // VideoFrame for as long as this decode surface exists. + // |secure_handle| is a reference to the secure input memory when doing + // secure decoding on ARM, zero otherwise. V4L2DecodeSurface(V4L2WritableBufferRef input_buffer, V4L2WritableBufferRef output_buffer, - scoped_refptr<VideoFrame> frame); + scoped_refptr<VideoFrame> frame, + uint64_t secure_handle); V4L2DecodeSurface(const V4L2DecodeSurface&) = delete; V4L2DecodeSurface& operator=(const V4L2DecodeSurface&) = delete; @@ -72,6 +75,7 @@ scoped_refptr<VideoFrame> video_frame() const { return video_frame_; } gfx::Rect visible_rect() const { return visible_rect_; } const VideoColorSpace& color_space() const { return color_space_; } + uint64_t secure_handle() const { return secure_handle_; } std::string ToString() const; @@ -101,6 +105,11 @@ // The decoded surfaces of the reference frames, which is kept until the // surface has been decoded. std::vector<scoped_refptr<V4L2DecodeSurface>> reference_surfaces_; + + // Secure handle that identifies the buffer w/ the decrypted contents in the + // secure world. Used to resolve to the corresponding FD that references the + // secure world memory (V4L2 will resolve that fd back to this same value). + uint64_t secure_handle_ = 0; }; // An implementation of V4L2DecodeSurface that uses requests to associate @@ -110,10 +119,12 @@ V4L2RequestDecodeSurface(V4L2WritableBufferRef input_buffer, V4L2WritableBufferRef output_buffer, scoped_refptr<VideoFrame> frame, + uint64_t secure_handle, V4L2RequestRef request_ref) : V4L2DecodeSurface(std::move(input_buffer), std::move(output_buffer), - std::move(frame)), + std::move(frame), + secure_handle), request_ref_(std::move(request_ref)) {} V4L2RequestDecodeSurface(const V4L2RequestDecodeSurface&) = delete;
diff --git a/media/gpu/v4l2/v4l2_image_processor_backend.cc b/media/gpu/v4l2/v4l2_image_processor_backend.cc index d4219371..34b829d6 100644 --- a/media/gpu/v4l2/v4l2_image_processor_backend.cc +++ b/media/gpu/v4l2/v4l2_image_processor_backend.cc
@@ -27,7 +27,6 @@ #include "media/base/color_plane_layout.h" #include "media/base/media_util.h" #include "media/base/scopedfd_helper.h" -#include "media/base/status.h" #include "media/gpu/chromeos/fourcc.h" #include "media/gpu/chromeos/platform_video_frame_utils.h" #include "media/gpu/macros.h" @@ -37,8 +36,6 @@ namespace { -const char kImageProcessorTraceName[] = "V4L2ImageProcessorBackend"; - absl::optional<gfx::GpuMemoryBufferHandle> CreateHandle( const VideoFrame* frame) { gfx::GpuMemoryBufferHandle handle = CreateGpuMemoryBufferHandle(frame); @@ -863,12 +860,6 @@ } const auto timestamp = job_record->input_frame->timestamp(); - auto iter = buffer_tracers_.find(timestamp); - if (iter != buffer_tracers_.end()) { - iter->second->EndTrace(DecoderStatus::Codes::kOk); - buffer_tracers_.erase(iter); - } - output_frame->set_timestamp(timestamp); output_frame->set_color_space(job_record->input_frame->ColorSpace()); @@ -942,10 +933,6 @@ << job_record->input_frame->timestamp().InMilliseconds() << " to device."; - const auto timestamp = job_record->input_frame->timestamp(); - buffer_tracers_[timestamp] = - std::make_unique<ScopedDecodeTrace>(kImageProcessorTraceName, - /*is_key_frame=*/false, timestamp); return true; }
diff --git a/media/gpu/v4l2/v4l2_image_processor_backend.h b/media/gpu/v4l2/v4l2_image_processor_backend.h index a2220c92..75a6813c 100644 --- a/media/gpu/v4l2/v4l2_image_processor_backend.h +++ b/media/gpu/v4l2/v4l2_image_processor_backend.h
@@ -14,13 +14,11 @@ #include <linux/videodev2.h> #include "base/containers/queue.h" -#include "base/containers/small_map.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" #include "base/task/sequenced_task_runner.h" #include "base/task/single_thread_task_runner.h" -#include "media/base/decoder_status.h" #include "media/gpu/chromeos/image_processor_backend.h" #include "media/gpu/media_gpu_export.h" #include "media/gpu/v4l2/v4l2_device.h" @@ -177,9 +175,6 @@ scoped_refptr<base::SingleThreadTaskRunner> poll_task_runner_; SEQUENCE_CHECKER(poll_sequence_checker_); - base::small_map<std::map<base::TimeDelta, std::unique_ptr<ScopedDecodeTrace>>> - buffer_tracers_ GUARDED_BY_CONTEXT(sequence_checker_); - SEQUENCE_CHECKER(sequence_checker_); base::WeakPtr<V4L2ImageProcessorBackend> weak_this_;
diff --git a/media/gpu/v4l2/v4l2_video_decoder_backend_stateless.cc b/media/gpu/v4l2/v4l2_video_decoder_backend_stateless.cc index 3388ec5..7e288557 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_backend_stateless.cc +++ b/media/gpu/v4l2/v4l2_video_decoder_backend_stateless.cc
@@ -279,7 +279,7 @@ return new V4L2RequestDecodeSurface(std::move(*input_buf), std::move(*output_buf), std::move(frame), - std::move(*request_ref)); + secure_handle, std::move(*request_ref)); } scoped_refptr<V4L2DecodeSurface>
diff --git a/media/gpu/v4l2/v4l2_video_decoder_delegate_av1.cc b/media/gpu/v4l2/v4l2_video_decoder_delegate_av1.cc index 56d3ddb..f7f93836 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_delegate_av1.cc +++ b/media/gpu/v4l2/v4l2_video_decoder_delegate_av1.cc
@@ -753,6 +753,18 @@ return new V4L2AV1Picture(std::move(dec_surface)); } +scoped_refptr<AV1Picture> V4L2VideoDecoderDelegateAV1::CreateAV1PictureSecure( + bool apply_grain, + uint64_t secure_handle) { + scoped_refptr<V4L2DecodeSurface> dec_surface = + surface_handler_->CreateSecureSurface(secure_handle); + if (!dec_surface) { + return nullptr; + } + + return new V4L2AV1Picture(std::move(dec_surface)); +} + DecodeStatus V4L2VideoDecoderDelegateAV1::SubmitDecode( const AV1Picture& pic, const libgav1::ObuSequenceHeader& sequence_header, @@ -793,7 +805,8 @@ .controls = ext_ctrl_array}; const auto* v4l2_pic = static_cast<const V4L2AV1Picture*>(&pic); - v4l2_pic->dec_surface()->PrepareSetCtrls(&ext_ctrls); + auto dec_surface = v4l2_pic->dec_surface(); + dec_surface->PrepareSetCtrls(&ext_ctrls); if (device_->Ioctl(VIDIOC_S_EXT_CTRLS, &ext_ctrls) != 0) { RecordVidiocIoctlErrorUMA(VidiocIoctlRequests::kVidiocSExtCtrls); VPLOGF(1) << "ioctl() failed: VIDIOC_S_EXT_CTRLS"; @@ -809,11 +822,13 @@ ref_surfaces.emplace_back(std::move(v4l2_ref_pic->dec_surface())); } } - v4l2_pic->dec_surface()->SetReferenceSurfaces(std::move(ref_surfaces)); + dec_surface->SetReferenceSurfaces(std::move(ref_surfaces)); // Copies the frame data into the V4L2 buffer. - if (!surface_handler_->SubmitSlice(v4l2_pic->dec_surface().get(), - stream.data(), stream.size())) { + if (!surface_handler_->SubmitSlice( + dec_surface.get(), + dec_surface->secure_handle() ? nullptr : stream.data(), + stream.size())) { return DecodeStatus::kFail; }
diff --git a/media/gpu/v4l2/v4l2_video_decoder_delegate_av1.h b/media/gpu/v4l2/v4l2_video_decoder_delegate_av1.h index 2715977..12bb7a9c 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_delegate_av1.h +++ b/media/gpu/v4l2/v4l2_video_decoder_delegate_av1.h
@@ -31,6 +31,9 @@ // AV1Decoder::AV1Accelerator implementation. scoped_refptr<AV1Picture> CreateAV1Picture(bool apply_grain) override; + scoped_refptr<AV1Picture> CreateAV1PictureSecure( + bool apply_grain, + uint64_t secure_handle) override; Status SubmitDecode(const AV1Picture& pic, const libgav1::ObuSequenceHeader& sequence_header,
diff --git a/media/gpu/v4l2/v4l2_video_decoder_delegate_h264.cc b/media/gpu/v4l2/v4l2_video_decoder_delegate_h264.cc index 5ac8ae5..fbd27e2 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_delegate_h264.cc +++ b/media/gpu/v4l2/v4l2_video_decoder_delegate_h264.cc
@@ -68,12 +68,19 @@ V4L2VideoDecoderDelegateH264::~V4L2VideoDecoderDelegateH264() {} scoped_refptr<H264Picture> V4L2VideoDecoderDelegateH264::CreateH264Picture() { - scoped_refptr<V4L2DecodeSurface> dec_surface; - if (secure_handle_) { - dec_surface = surface_handler_->CreateSecureSurface(secure_handle_); - } else { - dec_surface = surface_handler_->CreateSurface(); + scoped_refptr<V4L2DecodeSurface> dec_surface = + surface_handler_->CreateSurface(); + if (!dec_surface) { + return nullptr; } + + return new V4L2H264Picture(dec_surface); +} + +scoped_refptr<H264Picture> +V4L2VideoDecoderDelegateH264::CreateH264PictureSecure(uint64_t secure_handle) { + scoped_refptr<V4L2DecodeSurface> dec_surface = + surface_handler_->CreateSecureSurface(secure_handle); if (!dec_surface) return nullptr; @@ -340,7 +347,7 @@ // Add the 3-bytes NAL start code. // TODO: don't do it here, but have it passed from the parser? const size_t data_copy_size = size + 3; - if (secure_handle_) { + if (dec_surface->secure_handle()) { // The secure world already post-processed the secure buffer so that all of // the slice NALUs w/ 3 byte start codes are the only contents. return surface_handler_->SubmitSlice(dec_surface.get(), nullptr, @@ -427,14 +434,6 @@ memset(&priv_->v4l2_decode_param, 0, sizeof(priv_->v4l2_decode_param)); } -H264Decoder::H264Accelerator::Status V4L2VideoDecoderDelegateH264::SetStream( - base::span<const uint8_t> /*stream*/, - const media::DecryptConfig* /*decrypt_config*/, - uint64_t secure_handle) { - secure_handle_ = secure_handle; - return Status::kOk; -} - scoped_refptr<V4L2DecodeSurface> V4L2VideoDecoderDelegateH264::H264PictureToV4L2DecodeSurface(H264Picture* pic) { V4L2H264Picture* v4l2_pic = pic->AsV4L2H264Picture();
diff --git a/media/gpu/v4l2/v4l2_video_decoder_delegate_h264.h b/media/gpu/v4l2/v4l2_video_decoder_delegate_h264.h index 25b366e..b8212f5 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_delegate_h264.h +++ b/media/gpu/v4l2/v4l2_video_decoder_delegate_h264.h
@@ -36,6 +36,8 @@ // H264Decoder::H264Accelerator implementation. scoped_refptr<H264Picture> CreateH264Picture() override; + scoped_refptr<H264Picture> CreateH264PictureSecure( + uint64_t secure_handle) override; Status SubmitFrameMetadata(const H264SPS* sps, const H264PPS* pps, const H264DPB& dpb, @@ -54,9 +56,6 @@ Status SubmitDecode(scoped_refptr<H264Picture> pic) override; bool OutputPicture(scoped_refptr<H264Picture> pic) override; void Reset() override; - Status SetStream(base::span<const uint8_t> stream, - const DecryptConfig* decrypt_config, - uint64_t secure_handle) override; private: std::vector<scoped_refptr<V4L2DecodeSurface>> H264DPBToV4L2DPB( @@ -70,11 +69,6 @@ // Contains the kernel-specific structures that we don't want to expose // outside of the compilation unit. const std::unique_ptr<V4L2VideoDecoderDelegateH264Private> priv_; - - // Secure handle that identifies the buffer w/ the decrypted contents in the - // secure world. Used to resolve to the corresponding FD that references the - // secure world memory (V4L2 will resolve that fd back to this same value). - uint64_t secure_handle_; }; } // namespace media
diff --git a/media/gpu/v4l2/v4l2_video_decoder_delegate_h265.cc b/media/gpu/v4l2/v4l2_video_decoder_delegate_h265.cc index 135f587..e0d51793 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_delegate_h265.cc +++ b/media/gpu/v4l2/v4l2_video_decoder_delegate_h265.cc
@@ -55,6 +55,17 @@ return new V4L2H265Picture(dec_surface); } +scoped_refptr<H265Picture> +V4L2VideoDecoderDelegateH265::CreateH265PictureSecure(uint64_t secure_handle) { + scoped_refptr<V4L2DecodeSurface> dec_surface = + surface_handler_->CreateSecureSurface(secure_handle); + if (!dec_surface) { + return nullptr; + } + + return new V4L2H265Picture(dec_surface); +} + std::vector<scoped_refptr<V4L2DecodeSurface>> V4L2VideoDecoderDelegateH265::FillInV4L2DPB( struct v4l2_ctrl_hevc_decode_params* v4l2_decode_param, @@ -475,6 +486,14 @@ // Add the 3-bytes NAL start code. // TODO: don't do it here, but have it passed from the parser? const size_t data_copy_size = size + 3; + if (dec_surface->secure_handle()) { + // The secure world already post-processed the secure buffer so that all of + // the slice NALUs w/ 3 byte start codes are the only contents. + return surface_handler_->SubmitSlice(dec_surface.get(), nullptr, + data_copy_size) + ? Status::kOk + : Status::kFail; + } std::unique_ptr<uint8_t[]> data_copy(new uint8_t[data_copy_size]); memset(data_copy.get(), 0, data_copy_size); data_copy[2] = 0x01;
diff --git a/media/gpu/v4l2/v4l2_video_decoder_delegate_h265.h b/media/gpu/v4l2/v4l2_video_decoder_delegate_h265.h index c0dd39b..eab46bdb 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_delegate_h265.h +++ b/media/gpu/v4l2/v4l2_video_decoder_delegate_h265.h
@@ -37,6 +37,8 @@ // H265Decoder::H265Accelerator implementation. scoped_refptr<H265Picture> CreateH265Picture() override; + scoped_refptr<H265Picture> CreateH265PictureSecure( + uint64_t secure_handle) override; Status SubmitFrameMetadata( const H265SPS* sps, const H265PPS* pps,
diff --git a/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.cc b/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.cc index 9716e60..fd34e94 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.cc +++ b/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.cc
@@ -167,6 +167,17 @@ return new V4L2VP9Picture(std::move(dec_surface)); } +scoped_refptr<VP9Picture> V4L2VideoDecoderDelegateVP9::CreateVP9PictureSecure( + uint64_t secure_handle) { + scoped_refptr<V4L2DecodeSurface> dec_surface = + surface_handler_->CreateSecureSurface(secure_handle); + if (!dec_surface) { + return nullptr; + } + + return new V4L2VP9Picture(std::move(dec_surface)); +} + DecodeStatus V4L2VideoDecoderDelegateVP9::SubmitDecode( scoped_refptr<VP9Picture> pic, const Vp9SegmentationParams& segm_params, @@ -311,8 +322,10 @@ dec_surface->SetReferenceSurfaces(std::move(ref_surfaces)); // Copy the frame data into the V4L2 buffer. - if (!surface_handler_->SubmitSlice(dec_surface.get(), frame_hdr->data, - frame_hdr->frame_size)) { + if (!surface_handler_->SubmitSlice( + dec_surface.get(), + dec_surface->secure_handle() ? nullptr : frame_hdr->data, + frame_hdr->frame_size)) { return DecodeStatus::kFail; }
diff --git a/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.h b/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.h index 304060f..15fecb8 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.h +++ b/media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.h
@@ -28,6 +28,8 @@ // VP9Decoder::VP9Accelerator implementation. scoped_refptr<VP9Picture> CreateVP9Picture() override; + scoped_refptr<VP9Picture> CreateVP9PictureSecure( + uint64_t secure_handle) override; Status SubmitDecode(scoped_refptr<VP9Picture> pic, const Vp9SegmentationParams& segm_params, const Vp9LoopFilterParams& lf_params,
diff --git a/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.cc b/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.cc index cc5fd889..123e437 100644 --- a/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.cc +++ b/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.cc
@@ -619,8 +619,7 @@ DecodeStatus H264VaapiVideoDecoderDelegate::SetStream( base::span<const uint8_t> /*stream*/, - const DecryptConfig* decrypt_config, - uint64_t /*secure_handle*/) { + const DecryptConfig* decrypt_config) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!decrypt_config) return Status::kOk;
diff --git a/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.h b/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.h index b6686a49..9b160e9 100644 --- a/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.h +++ b/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.h
@@ -68,8 +68,7 @@ bool OutputPicture(scoped_refptr<H264Picture> pic) override; void Reset() override; Status SetStream(base::span<const uint8_t> stream, - const DecryptConfig* decrypt_config, - uint64_t secure_handle) override; + const DecryptConfig* decrypt_config) override; bool RequiresRefLists() override;
diff --git a/media/gpu/vp9_decoder.cc b/media/gpu/vp9_decoder.cc index c08be08a..831f72e3 100644 --- a/media/gpu/vp9_decoder.cc +++ b/media/gpu/vp9_decoder.cc
@@ -102,6 +102,11 @@ VP9Decoder::VP9Accelerator::~VP9Accelerator() {} +scoped_refptr<VP9Picture> VP9Decoder::VP9Accelerator::CreateVP9PictureSecure( + uint64_t secure_handle) { + return nullptr; +} + VP9Decoder::VP9Decoder(std::unique_ptr<VP9Accelerator> accelerator, VideoCodecProfile profile, const VideoColorSpace& container_color_space) @@ -129,6 +134,12 @@ SetError(); return; } + if (decoder_buffer.has_side_data() && + decoder_buffer.side_data()->secure_handle) { + secure_handle_ = decoder_buffer.side_data()->secure_handle; + } else { + secure_handle_ = 0; + } parser_.SetStream(ptr, size, frame_sizes, decrypt_config ? decrypt_config->Clone() : nullptr); @@ -149,6 +160,8 @@ parser_.Reset(); + secure_handle_ = 0; + if (state_ == kDecoding) { state_ = kAfterReset; } @@ -335,7 +348,12 @@ return kConfigChange; } - scoped_refptr<VP9Picture> pic = accelerator_->CreateVP9Picture(); + scoped_refptr<VP9Picture> pic; + if (secure_handle_) { + pic = accelerator_->CreateVP9PictureSecure(secure_handle_); + } else { + pic = accelerator_->CreateVP9Picture(); + } if (!pic) { return kRanOutOfSurfaces; }
diff --git a/media/gpu/vp9_decoder.h b/media/gpu/vp9_decoder.h index f6870de..e6257a13 100644 --- a/media/gpu/vp9_decoder.h +++ b/media/gpu/vp9_decoder.h
@@ -71,6 +71,15 @@ // case and treat it as normal, returning kRanOutOfSurfaces from Decode(). virtual scoped_refptr<VP9Picture> CreateVP9Picture() = 0; + // |secure_handle| is a reference to the corresponding secure memory when + // doing secure decoding on ARM. This is invoked instead of CreateAV1Picture + // when doing secure decoding on ARM. Default implementation returns + // nullptr. + // TODO(jkardatzke): Remove this once we move to the V4L2 flat stateless + // decoder and add a field to media::CodecPicture instead. + virtual scoped_refptr<VP9Picture> CreateVP9PictureSecure( + uint64_t secure_handle); + // Submit decode for |pic| to be run in accelerator, taking as arguments // information contained in it, as well as current segmentation and loop // filter state in |segm_params| and |lf_params|, respectively, and using @@ -164,6 +173,11 @@ // picture. std::unique_ptr<Vp9FrameHeader> curr_frame_hdr_; std::unique_ptr<DecryptConfig> decrypt_config_; + + // Secure handle to pass through to the accelerator when doing secure playback + // on ARM. + uint64_t secure_handle_ = 0; + // Current frame size that is necessary to decode |curr_frame_hdr_|. gfx::Size curr_frame_size_;
diff --git a/media/mojo/mojom/watch_time_recorder.mojom b/media/mojo/mojom/watch_time_recorder.mojom index 7044c20a..1ef53df9 100644 --- a/media/mojo/mojom/watch_time_recorder.mojom +++ b/media/mojo/mojom/watch_time_recorder.mojom
@@ -97,7 +97,4 @@ UpdateUnderflowCount(int32 total_count); UpdateUnderflowDuration(int32 total_completed_count, mojo_base.mojom.TimeDelta total_duration); - - // Updates the last known media timestamp for the video. - OnCurrentTimestampChanged(mojo_base.mojom.TimeDelta last_timestamp); };
diff --git a/media/mojo/services/media_metrics_provider.cc b/media/mojo/services/media_metrics_provider.cc index 0f13845f..235f7a2 100644 --- a/media/mojo/services/media_metrics_provider.cc +++ b/media/mojo/services/media_metrics_provider.cc
@@ -50,7 +50,6 @@ learning::FeatureValue origin, VideoDecodePerfHistory::SaveCallback save_cb, GetLearningSessionCallback learning_session_cb, - RecordAggregateWatchTimeCallback record_playback_cb, IsShuttingDownCallback is_shutting_down_cb) : player_id_(g_player_id++), is_top_frame_(is_top_frame == FrameStatus::kTopFrame), @@ -58,7 +57,6 @@ origin_(origin), save_cb_(std::move(save_cb)), learning_session_cb_(std::move(learning_session_cb)), - record_playback_cb_(std::move(record_playback_cb)), is_shutting_down_cb_(std::move(is_shutting_down_cb)), uma_info_(is_incognito == BrowsingMode::kIncognito) {} @@ -189,14 +187,12 @@ learning::FeatureValue origin, VideoDecodePerfHistory::SaveCallback save_cb, GetLearningSessionCallback learning_session_cb, - GetRecordAggregateWatchTimeCallback get_record_playback_cb, IsShuttingDownCallback is_shutting_down_cb, mojo::PendingReceiver<mojom::MediaMetricsProvider> receiver) { mojo::MakeSelfOwnedReceiver( std::make_unique<MediaMetricsProvider>( is_incognito, is_top_frame, source_id, origin, std::move(save_cb), std::move(learning_session_cb), - std::move(get_record_playback_cb).Run(), std::move(is_shutting_down_cb)), std::move(receiver)); } @@ -321,8 +317,7 @@ mojo::MakeSelfOwnedReceiver( std::make_unique<WatchTimeRecorder>(std::move(properties), source_id_, - is_top_frame_, player_id_, - record_playback_cb_), + is_top_frame_, player_id_), std::move(receiver)); }
diff --git a/media/mojo/services/media_metrics_provider.h b/media/mojo/services/media_metrics_provider.h index 6fbfbfc0..4ccd59c 100644 --- a/media/mojo/services/media_metrics_provider.h +++ b/media/mojo/services/media_metrics_provider.h
@@ -38,15 +38,6 @@ using GetLearningSessionCallback = base::RepeatingCallback<learning::LearningSession*()>; - using RecordAggregateWatchTimeCallback = - base::RepeatingCallback<void(base::TimeDelta total_watch_time, - base::TimeDelta time_stamp, - bool has_video, - bool has_audio)>; - - using GetRecordAggregateWatchTimeCallback = - base::RepeatingCallback<RecordAggregateWatchTimeCallback(void)>; - using IsShuttingDownCallback = base::RepeatingCallback<bool(void)>; MediaMetricsProvider(BrowsingMode is_incognito, @@ -55,7 +46,6 @@ learning::FeatureValue origin, VideoDecodePerfHistory::SaveCallback save_cb, GetLearningSessionCallback learning_session_cb, - RecordAggregateWatchTimeCallback record_playback_cb, IsShuttingDownCallback is_shutting_down_cb); MediaMetricsProvider(const MediaMetricsProvider&) = delete; @@ -84,7 +74,6 @@ learning::FeatureValue origin, VideoDecodePerfHistory::SaveCallback save_cb, GetLearningSessionCallback learning_session_cb, - GetRecordAggregateWatchTimeCallback get_record_playback_cb, IsShuttingDownCallback is_shutting_down_cb, mojo::PendingReceiver<mojom::MediaMetricsProvider> receiver); @@ -163,7 +152,6 @@ const VideoDecodePerfHistory::SaveCallback save_cb_; const GetLearningSessionCallback learning_session_cb_; - const RecordAggregateWatchTimeCallback record_playback_cb_; const IsShuttingDownCallback is_shutting_down_cb_; // UMA pipeline packaged data
diff --git a/media/mojo/services/media_metrics_provider_unittest.cc b/media/mojo/services/media_metrics_provider_unittest.cc index 3a0c4ab..a9b179b1 100644 --- a/media/mojo/services/media_metrics_provider_unittest.cc +++ b/media/mojo/services/media_metrics_provider_unittest.cc
@@ -54,9 +54,6 @@ GetSourceId(), learning::FeatureValue(0), VideoDecodePerfHistory::SaveCallback(), MediaMetricsProvider::GetLearningSessionCallback(), - base::BindRepeating( - &MediaMetricsProviderTest::GetRecordAggregateWatchTimeCallback, - base::Unretained(this)), base::BindRepeating(&MediaMetricsProviderTest::IsShuttingDown, base::Unretained(this)), provider_.BindNewPipeAndPassReceiver()); @@ -65,11 +62,6 @@ ukm::SourceId GetSourceId() { return source_id_; } - MediaMetricsProvider::RecordAggregateWatchTimeCallback - GetRecordAggregateWatchTimeCallback() { - return base::NullCallback(); - } - MOCK_METHOD(bool, IsShuttingDown, ()); void ResetMetricRecorders() {
diff --git a/media/mojo/services/watch_time_recorder.cc b/media/mojo/services/watch_time_recorder.cc index 75f4420e1..19ba049 100644 --- a/media/mojo/services/watch_time_recorder.cc +++ b/media/mojo/services/watch_time_recorder.cc
@@ -8,7 +8,6 @@ #include "base/containers/contains.h" #include "base/containers/flat_set.h" -#include "base/functional/callback.h" #include "base/hash/hash.h" #include "base/metrics/histogram_functions.h" #include "base/ranges/algorithm.h" @@ -66,12 +65,10 @@ WatchTimeRecorder::WatchTimeUkmRecord::~WatchTimeUkmRecord() = default; -WatchTimeRecorder::WatchTimeRecorder( - mojom::PlaybackPropertiesPtr properties, - ukm::SourceId source_id, - bool is_top_frame, - uint64_t player_id, - RecordAggregateWatchTimeCallback record_playback_cb) +WatchTimeRecorder::WatchTimeRecorder(mojom::PlaybackPropertiesPtr properties, + ukm::SourceId source_id, + bool is_top_frame, + uint64_t player_id) : properties_(std::move(properties)), source_id_(source_id), is_top_frame_(is_top_frame), @@ -91,8 +88,7 @@ kRebuffersCountAudioVideoMse, kDiscardedWatchTimeAudioVideoMse}, {WatchTimeKey::kAudioVideoEme, kMeanTimeBetweenRebuffersAudioVideoEme, - kRebuffersCountAudioVideoEme, kDiscardedWatchTimeAudioVideoEme}}), - record_playback_cb_(std::move(record_playback_cb)) {} + kRebuffersCountAudioVideoEme, kDiscardedWatchTimeAudioVideoEme}}) {} WatchTimeRecorder::~WatchTimeRecorder() { FinalizeWatchTime({}); @@ -311,11 +307,6 @@ underflow_duration_ = total_duration; } -void WatchTimeRecorder::OnCurrentTimestampChanged( - base::TimeDelta current_timestamp) { - last_timestamp_ = current_timestamp; -} - void WatchTimeRecorder::RecordUkmPlaybackData() { // UKM may be unavailable in content_shell or other non-chrome/ builds; it // may also be unavailable if browser shutdown has started; so this may be a @@ -342,7 +333,6 @@ base::flat_set<AudioCodecProfile> aac_profiles; - base::TimeDelta total_foreground_audible_watch_time; for (auto& ukm_record : ukm_records_) { ukm::builders::Media_BasicPlayback builder(source_id_); @@ -368,11 +358,6 @@ DCHECK(!recorded_all_metric); recorded_all_metric = true; - // We should only add to the total watchtime if we were not in the - // background and not muted. - if (!properties_->is_muted && !properties_->is_background) - total_foreground_audible_watch_time += kv.second; - builder.SetWatchTime(kv.second.InMilliseconds()); if (ukm_record.total_underflow_count) { builder.SetMeanTimeBetweenRebuffers( @@ -469,12 +454,6 @@ base::UmaHistogramEnumeration("Media.AudioCodecProfile.AAC", profile); } - if (total_foreground_audible_watch_time.is_positive()) { - std::move(record_playback_cb_) - .Run(total_foreground_audible_watch_time, last_timestamp_, - properties_->has_video, properties_->has_audio); - } - ukm_records_.clear(); }
diff --git a/media/mojo/services/watch_time_recorder.h b/media/mojo/services/watch_time_recorder.h index ebb687a..26ba4f9a 100644 --- a/media/mojo/services/watch_time_recorder.h +++ b/media/mojo/services/watch_time_recorder.h
@@ -16,24 +16,16 @@ #include "media/mojo/mojom/watch_time_recorder.mojom.h" #include "media/mojo/services/media_mojo_export.h" #include "services/metrics/public/cpp/ukm_source_id.h" -#include "url/gurl.h" namespace media { // See mojom::WatchTimeRecorder for documentation. class MEDIA_MOJO_EXPORT WatchTimeRecorder : public mojom::WatchTimeRecorder { public: - using RecordAggregateWatchTimeCallback = - base::OnceCallback<void(base::TimeDelta total_watch_time, - base::TimeDelta time_stamp, - bool has_video, - bool has_audio)>; - WatchTimeRecorder(mojom::PlaybackPropertiesPtr properties, ukm::SourceId source_id, bool is_top_frame, - uint64_t player_id, - RecordAggregateWatchTimeCallback record_playback_cb); + uint64_t player_id); WatchTimeRecorder(const WatchTimeRecorder&) = delete; WatchTimeRecorder& operator=(const WatchTimeRecorder&) = delete; @@ -54,7 +46,6 @@ void UpdateUnderflowCount(int32_t total_count) override; void UpdateUnderflowDuration(int32_t total_completed_count, base::TimeDelta total_duration) override; - void OnCurrentTimestampChanged(base::TimeDelta current_timestamp) override; private: // Records a UKM event based on |aggregate_watch_time_info_|; only recorded @@ -128,9 +119,7 @@ PipelineStatusCodes pipeline_status_ = PIPELINE_OK; base::TimeDelta duration_ = kNoTimestamp; - base::TimeDelta last_timestamp_ = kNoTimestamp; absl::optional<bool> autoplay_initiated_; - RecordAggregateWatchTimeCallback record_playback_cb_; }; } // namespace media
diff --git a/media/mojo/services/watch_time_recorder_unittest.cc b/media/mojo/services/watch_time_recorder_unittest.cc index 15b3c6f..0e297b9 100644 --- a/media/mojo/services/watch_time_recorder_unittest.cc +++ b/media/mojo/services/watch_time_recorder_unittest.cc
@@ -33,10 +33,6 @@ using UkmEntry = ukm::builders::Media_BasicPlayback; -namespace content { -class RenderFrameHostDelegate; -} // namespace content - namespace media { constexpr char kTestOrigin[] = "https://test.google.com/"; @@ -70,9 +66,6 @@ MediaMetricsProvider::FrameStatus::kTopFrame, GetSourceId(), learning::FeatureValue(0), VideoDecodePerfHistory::SaveCallback(), MediaMetricsProvider::GetLearningSessionCallback(), - base::BindRepeating( - &WatchTimeRecorderTest::GetRecordAggregateWatchTimeCallback, - base::Unretained(this)), base::BindRepeating(&WatchTimeRecorderTest::IsShuttingDown, base::Unretained(this)), provider_.BindNewPipeAndPassReceiver()); @@ -190,17 +183,6 @@ ukm::SourceId GetSourceId() { return source_id_; } - MediaMetricsProvider::RecordAggregateWatchTimeCallback - GetRecordAggregateWatchTimeCallback() { - return base::BindRepeating( - [](base::WeakPtr<content::RenderFrameHostDelegate> delegate, - GURL last_committed_url, base::TimeDelta total_watch_time, - base::TimeDelta time_stamp, bool has_video, bool has_audio) { - // Do nothing as this mock callback will never be called. - }, - nullptr, GURL()); - } - MOCK_METHOD(bool, IsShuttingDown, ()); MOCK_METHOD0(GetCurrentMediaTime, base::TimeDelta());
diff --git a/media/renderers/video_frame_yuv_converter.cc b/media/renderers/video_frame_yuv_converter.cc index 4745ff2..8fe9ff0 100644 --- a/media/renderers/video_frame_yuv_converter.cc +++ b/media/renderers/video_frame_yuv_converter.cc
@@ -13,6 +13,7 @@ #include "gpu/command_buffer/common/shared_image_usage.h" #include "media/base/media_switches.h" #include "media/base/video_frame.h" +#include "media/base/video_util.h" #include "media/renderers/video_frame_yuv_mailboxes_holder.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkColorSpace.h" @@ -101,8 +102,8 @@ bool VideoFrameYUVConverter::IsVideoFrameFormatSupported( const VideoFrame& video_frame) { - return std::get<0>(VideoFrameYUVMailboxesHolder::VideoPixelFormatToSkiaValues( - video_frame.format())) != SkYUVAInfo::PlaneConfig::kUnknown; + return std::get<0>(VideoPixelFormatToSkiaValues(video_frame.format())) != + SkYUVAInfo::PlaneConfig::kUnknown; } bool VideoFrameYUVConverter::ConvertYUVVideoFrameNoCaching(
diff --git a/media/renderers/video_frame_yuv_mailboxes_holder.cc b/media/renderers/video_frame_yuv_mailboxes_holder.cc index 19b6c488..2f5ce2ef 100644 --- a/media/renderers/video_frame_yuv_mailboxes_holder.cc +++ b/media/renderers/video_frame_yuv_mailboxes_holder.cc
@@ -16,6 +16,7 @@ #include "gpu/command_buffer/client/shared_image_interface.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "media/base/media_switches.h" +#include "media/base/video_util.h" #include "third_party/skia/include/core/SkColorSpace.h" #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkSurface.h" @@ -377,28 +378,6 @@ } // static -std::tuple<SkYUVAInfo::PlaneConfig, SkYUVAInfo::Subsampling> -VideoFrameYUVMailboxesHolder::VideoPixelFormatToSkiaValues( - VideoPixelFormat video_format) { - // To expand support for additional VideoFormats expand this switch. Note that - // we do assume 8 bit formats. With that exception, anything else should work. - switch (video_format) { - case PIXEL_FORMAT_NV12: - case PIXEL_FORMAT_P016LE: - return {SkYUVAInfo::PlaneConfig::kY_UV, SkYUVAInfo::Subsampling::k420}; - case PIXEL_FORMAT_NV12A: - return {SkYUVAInfo::PlaneConfig::kY_UV_A, SkYUVAInfo::Subsampling::k420}; - case PIXEL_FORMAT_I420: - return {SkYUVAInfo::PlaneConfig::kY_U_V, SkYUVAInfo::Subsampling::k420}; - case PIXEL_FORMAT_I420A: - return {SkYUVAInfo::PlaneConfig::kY_U_V_A, SkYUVAInfo::Subsampling::k420}; - default: - return {SkYUVAInfo::PlaneConfig::kUnknown, - SkYUVAInfo::Subsampling::kUnknown}; - } -} - -// static SkYUVAInfo VideoFrameYUVMailboxesHolder::VideoFrameGetSkYUVAInfo( const VideoFrame* video_frame) { SkISize video_size{video_frame->coded_size().width(),
diff --git a/media/renderers/video_frame_yuv_mailboxes_holder.h b/media/renderers/video_frame_yuv_mailboxes_holder.h index 246edab..429ebea0 100644 --- a/media/renderers/video_frame_yuv_mailboxes_holder.h +++ b/media/renderers/video_frame_yuv_mailboxes_holder.h
@@ -58,10 +58,6 @@ const SkYUVAInfo& yuva_info() const { return yuva_info_; } - // Utility to convert a media pixel format to SkYUVAInfo. - static std::tuple<SkYUVAInfo::PlaneConfig, SkYUVAInfo::Subsampling> - VideoPixelFormatToSkiaValues(VideoPixelFormat video_format); - // Utility to populate a SkYUVAInfo from a video frame. static SkYUVAInfo VideoFrameGetSkYUVAInfo(const VideoFrame* video_frame);
diff --git a/media/renderers/video_resource_updater.cc b/media/renderers/video_resource_updater.cc index b3bbab8b..678814c 100644 --- a/media/renderers/video_resource_updater.cc +++ b/media/renderers/video_resource_updater.cc
@@ -330,8 +330,8 @@ // Returns true if the input VideoFrame format can be stored directly in the // provided output shared image format. -bool HasCompatibleFormat(VideoPixelFormat input_format, - viz::SharedImageFormat output_format) { +bool HasCompatibleRGBFormat(VideoPixelFormat input_format, + viz::SharedImageFormat output_format) { if (input_format == PIXEL_FORMAT_XBGR) return output_format == viz::SinglePlaneFormat::kRGBA_8888 || output_format == viz::SinglePlaneFormat::kRGBX_8888; @@ -345,6 +345,12 @@ return false; } +bool IsFrameFormat32BitRGB(VideoPixelFormat frame_format) { + return frame_format == PIXEL_FORMAT_XBGR || + frame_format == PIXEL_FORMAT_XRGB || + frame_format == PIXEL_FORMAT_ABGR || frame_format == PIXEL_FORMAT_ARGB; +} + // Returns if kRasterInterfaceInVideoResourceUpdater is enabled bool CanUseRasterInterface() { return base::FeatureList::IsEnabled( @@ -833,29 +839,6 @@ return CreateForSoftwarePlanes(std::move(video_frame)); } -viz::SharedImageFormat VideoResourceUpdater::YuvSharedImageFormat( - int bits_per_channel) { - DCHECK(context_provider_); - const auto& caps = context_provider_->ContextCapabilities(); - const auto& shared_image_caps = - context_provider_->SharedImageInterface()->GetCapabilities(); - if (caps.disable_one_component_textures) - return PaintCanvasVideoRenderer::GetRGBPixelsOutputFormat(); - if (bits_per_channel <= 8) { - DCHECK(shared_image_caps.supports_luminance_shared_images || - caps.texture_rg); - return GetSingleChannel8BitFormat(caps, shared_image_caps); - } - if (caps.texture_norm16 && shared_image_caps.supports_r16_shared_images) { - return viz::SinglePlaneFormat::kR_16; - } - if (caps.texture_half_float_linear && - shared_image_caps.supports_luminance_shared_images) { - return viz::SinglePlaneFormat::kLUMINANCE_F16; - } - return GetSingleChannel8BitFormat(caps, shared_image_caps); -} - bool VideoResourceUpdater::ReallocateUploadPixels(size_t needed_size) { // Free the existing data first so that the memory can be reused, if // possible. Note that the new array is purposely not initialized. @@ -1095,30 +1078,41 @@ return external_resources; } -VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes( - scoped_refptr<VideoFrame> video_frame) { - TRACE_EVENT0("media", "VideoResourceUpdater::CreateForSoftwarePlanes"); - const VideoPixelFormat input_frame_format = video_frame->format(); +viz::SharedImageFormat VideoResourceUpdater::YuvSharedImageFormat( + int bits_per_channel) { + DCHECK(context_provider_); + const auto& caps = context_provider_->ContextCapabilities(); + const auto& shared_image_caps = + context_provider_->SharedImageInterface()->GetCapabilities(); + if (caps.disable_one_component_textures) { + return PaintCanvasVideoRenderer::GetRGBPixelsOutputFormat(); + } + if (bits_per_channel <= 8) { + DCHECK(shared_image_caps.supports_luminance_shared_images || + caps.texture_rg); + return GetSingleChannel8BitFormat(caps, shared_image_caps); + } + if (caps.texture_norm16 && shared_image_caps.supports_r16_shared_images) { + return viz::SinglePlaneFormat::kR_16; + } + if (caps.texture_half_float_linear && + shared_image_caps.supports_luminance_shared_images) { + return viz::SinglePlaneFormat::kLUMINANCE_F16; + } + return GetSingleChannel8BitFormat(caps, shared_image_caps); +} - size_t bits_per_channel = video_frame->BitDepth(); - - const bool is_rgb = input_frame_format == PIXEL_FORMAT_XBGR || - input_frame_format == PIXEL_FORMAT_XRGB || - input_frame_format == PIXEL_FORMAT_ABGR || - input_frame_format == PIXEL_FORMAT_ARGB; - - DCHECK(IsYuvPlanar(input_frame_format) || - input_frame_format == PIXEL_FORMAT_Y16 || is_rgb); - +viz::SharedImageFormat VideoResourceUpdater::GetSoftwareOutputFormat( + VideoPixelFormat input_frame_format, + int bits_per_channel, + bool& texture_needs_rgb_conversion_out) { viz::SharedImageFormat output_si_format; - absl::optional<viz::SharedImageFormat> subplane_si_format; - gfx::ColorSpace output_color_space = video_frame->ColorSpace(); - bool texture_needs_rgb_conversion = false; - if (is_rgb) { + if (IsFrameFormat32BitRGB(input_frame_format)) { + texture_needs_rgb_conversion_out = false; output_si_format = GetRGBSharedImageFormat(input_frame_format); } else if (input_frame_format == PIXEL_FORMAT_Y16) { // Unable to display directly as yuv planes so convert it to RGB. - texture_needs_rgb_conversion = true; + texture_needs_rgb_conversion_out = true; } else if (!software_compositor()) { // Can be composited directly from yuv planes. output_si_format = YuvSharedImageFormat(bits_per_channel); @@ -1129,7 +1123,7 @@ // before texture upload. if (output_si_format == viz::SinglePlaneFormat::kRGBA_8888 || output_si_format == viz::SinglePlaneFormat::kBGRA_8888) { - texture_needs_rgb_conversion = true; + texture_needs_rgb_conversion_out = true; } // Some YUV resources have different sized planes. If we lack the proper @@ -1137,16 +1131,12 @@ // unpacking to I420/I016, but texture_rg and r16 support should be pretty // universal and we expect these frames to be rare. if (input_frame_format == PIXEL_FORMAT_NV12) { - if (output_si_format == viz::SinglePlaneFormat::kR_8) { - subplane_si_format = viz::SinglePlaneFormat::kRG_88; - } else { - texture_needs_rgb_conversion = true; + if (output_si_format != viz::SinglePlaneFormat::kR_8) { + texture_needs_rgb_conversion_out = true; } } else if (input_frame_format == PIXEL_FORMAT_P016LE) { - if (output_si_format == viz::SinglePlaneFormat::kR_16) { - subplane_si_format = viz::SinglePlaneFormat::kRG_1616; - } else { - texture_needs_rgb_conversion = true; + if (output_si_format != viz::SinglePlaneFormat::kR_16) { + texture_needs_rgb_conversion_out = true; } } else { DCHECK_EQ(VideoFrame::BytesPerElement(input_frame_format, 0), @@ -1154,18 +1144,301 @@ } } - size_t output_plane_count = VideoFrame::NumPlanes(input_frame_format); + if (software_compositor() || texture_needs_rgb_conversion_out) { + output_si_format = + software_compositor() + ? viz::SinglePlaneFormat::kRGBA_8888 + : PaintCanvasVideoRenderer::GetRGBPixelsOutputFormat(); + } + + return output_si_format; +} + +std::optional<viz::SharedImageFormat> +VideoResourceUpdater::GetSoftwareSubplaneFormat( + VideoPixelFormat input_frame_format, + viz::SharedImageFormat output_si_format) { + if (!software_compositor()) { + if (input_frame_format == PIXEL_FORMAT_NV12 && + output_si_format == viz::SinglePlaneFormat::kR_8) { + return viz::SinglePlaneFormat::kRG_88; + } else if (input_frame_format == PIXEL_FORMAT_P016LE && + output_si_format == viz::SinglePlaneFormat::kR_16) { + return viz::SinglePlaneFormat::kRG_1616; + } + } + return std::nullopt; +} + +void VideoResourceUpdater::TransferRGBPixelsToPaintCanvas( + scoped_refptr<VideoFrame> video_frame, + PlaneResource* plane_resource) { + DCHECK_EQ(plane_resource->si_format(), viz::SinglePlaneFormat::kRGBA_8888); + if (!video_renderer_) { + video_renderer_ = std::make_unique<PaintCanvasVideoRenderer>(); + } + + SoftwarePlaneResource* software_resource = plane_resource->AsSoftware(); + + // We know the format is RGBA_8888 from check above. + SkImageInfo info = SkImageInfo::MakeN32Premul( + gfx::SizeToSkISize(software_resource->resource_size())); + + SkBitmap sk_bitmap; + sk_bitmap.installPixels(info, software_resource->pixels(), + info.minRowBytes()); + // This is software path, so |canvas| and |video_frame| are always + // backed by software. + cc::SkiaPaintCanvas canvas(sk_bitmap); + cc::PaintFlags flags; + flags.setBlendMode(SkBlendMode::kSrc); + flags.setFilterQuality(cc::PaintFlags::FilterQuality::kLow); + + // Note that PaintCanvasVideoRenderer::Copy would copy to the origin, + // not |video_frame->visible_rect|, so call Paint instead. + // https://crbug.com/1090435 + video_renderer_->Paint(video_frame, &canvas, + gfx::RectF(video_frame->visible_rect()), flags, + media::kNoTransformation, nullptr); +} + +bool VideoResourceUpdater::WriteRGBPixelsToTexture( + scoped_refptr<VideoFrame> video_frame, + PlaneResource* plane_resource, + viz::SharedImageFormat output_si_format) { + HardwarePlaneResource* hardware_resource = plane_resource->AsHardware(); + size_t bytes_per_row = viz::ResourceSizes::CheckedWidthInBytes<size_t>( + video_frame->coded_size().width(), output_si_format); + const gfx::Size& plane_size = hardware_resource->resource_size(); + + const VideoPixelFormat input_frame_format = video_frame->format(); + // Note: Strides may be negative in case of bottom-up layouts. + const int stride = video_frame->stride(VideoFrame::kARGBPlane); + const bool has_compatible_stride = + stride > 0 && static_cast<size_t>(stride) == bytes_per_row; + + const uint8_t* source_pixels = nullptr; + if (HasCompatibleRGBFormat(input_frame_format, output_si_format) && + has_compatible_stride) { + // We can passthrough when the texture format matches. Since we + // always copy the entire coded area we don't have to worry about + // origin. + source_pixels = video_frame->data(VideoFrame::kARGBPlane); + } else { + size_t needed_size = bytes_per_row * video_frame->coded_size().height(); + if (upload_pixels_size_ < needed_size) { + if (!ReallocateUploadPixels(needed_size)) { + // Fail here if memory reallocation fails. + return false; + } + } + + // PCVR writes to origin, so offset upload pixels by start since + // we upload frames in coded size and pass on the visible rect to + // the compositor. Note: It'd save a few bytes not to do this... + auto* dest_ptr = upload_pixels_.get() + + video_frame->visible_rect().y() * bytes_per_row + + video_frame->visible_rect().x() * sizeof(uint32_t); + PaintCanvasVideoRenderer::ConvertVideoFrameToRGBPixels( + video_frame.get(), dest_ptr, bytes_per_row); + source_pixels = upload_pixels_.get(); + } + + // Copy pixels into texture. + if (CanUseRasterInterface()) { + auto* ri = RasterInterface(); + auto color_type = viz::ToClosestSkColorType( + /*gpu_compositing=*/true, output_si_format, /*plane_index=*/0); + SkImageInfo info = + SkImageInfo::Make(plane_size.width(), plane_size.height(), color_type, + kPremul_SkAlphaType); + SkPixmap pixmap = SkPixmap(info, source_pixels, bytes_per_row); + ri->WritePixels(hardware_resource->mailbox(), /*dst_x_offset=*/0, + /*dst_y_offset=*/0, /*dst_plane_index=*/0, + hardware_resource->texture_target(), pixmap); + } else { + auto* gl = ContextGL(); + HardwarePlaneResource::ScopedTexture scope(gl, hardware_resource); + gl->BindTexture(hardware_resource->texture_target(), scope.texture_id()); + gl->TexSubImage2D( + hardware_resource->texture_target(), /*level=*/0, /*xoffset=*/0, + /*yoffset=*/0, plane_size.width(), plane_size.height(), + viz::SharedImageFormatRestrictedSinglePlaneUtils::ToGLDataFormat( + output_si_format), + viz::SharedImageFormatRestrictedSinglePlaneUtils::ToGLDataType( + output_si_format), + source_pixels); + } + + return true; +} + +bool VideoResourceUpdater::WriteYUVPixelsPerPlaneToPerTexture( + scoped_refptr<VideoFrame> video_frame, + HardwarePlaneResource* plane_resource, + size_t bits_per_channel, + size_t plane_index, + HalfFloatMaker* half_float_maker) { + const viz::SharedImageFormat plane_si_format = plane_resource->si_format(); + + // |video_stride_bytes| is the width of the |video_frame| we are uploading + // (including non-frame data to fill in the stride). + const int video_stride_bytes = video_frame->stride(plane_index); + + // |resource_size_pixels| is the size of the destination resource. + const gfx::Size resource_size_pixels = plane_resource->resource_size(); + const size_t bytes_per_row = viz::ResourceSizes::CheckedWidthInBytes<size_t>( + resource_size_pixels.width(), plane_si_format); + + // Use 4-byte row alignment (OpenGL default) for upload performance. + // Assuming that GL_UNPACK_ALIGNMENT has not changed from default. + constexpr size_t kDefaultUnpackAlignment = 4; + const size_t upload_image_stride = cc::MathUtil::CheckedRoundUp<size_t>( + bytes_per_row, kDefaultUnpackAlignment); + + size_t resource_bit_depth = + static_cast<size_t>(plane_si_format.BitsPerPixel()); + // BitsPerPixel calculates bit depth for multiple channels together. So for + // planar formats that represent UV channels we need to divide by the number + // of channels. + if (plane_si_format == viz::SinglePlaneFormat::kRG_88 || + plane_si_format == viz::SinglePlaneFormat::kRG_1616) { + resource_bit_depth /= 2; + } + CHECK_LE(resource_bit_depth, 16u); + + // Data downshifting is needed if the resource bit depth is not enough. + const bool needs_bit_downshifting = bits_per_channel > resource_bit_depth; + // We need to convert the incoming data if we're transferring to half float, + // if the need a bit downshift or if the strides need to be reconciled. + const bool needs_conversion = + plane_si_format == viz::SinglePlaneFormat::kLUMINANCE_F16 || + needs_bit_downshifting; + + constexpr size_t kDefaultUnpackRowLength = 0; + GLuint unpack_row_length = kDefaultUnpackRowLength; + GLuint unpack_alignment = kDefaultUnpackAlignment; + + const uint8_t* pixels; + int pixels_stride_in_bytes; + + if (!needs_conversion) { + // Stride adaptation is needed if source and destination strides are + // different but they have the same bit depth. + const bool needs_stride_adaptation = + (bits_per_channel == resource_bit_depth) && + (upload_image_stride != static_cast<size_t>(video_stride_bytes)); + if (needs_stride_adaptation) { + const int bytes_per_element = + VideoFrame::BytesPerElement(video_frame->format(), plane_index); + // Stride is aligned to VideoFrameLayout::kFrameAddressAlignment (32) + // which should be divisible by pixel size for YUV formats (1, 2 or 4). + DCHECK_EQ(video_stride_bytes % bytes_per_element, 0); + // Unpack row length is in pixels not bytes. + unpack_row_length = video_stride_bytes / bytes_per_element; + // Use a non-standard alignment only if necessary. + if (video_stride_bytes % kDefaultUnpackAlignment != 0) { + unpack_alignment = bytes_per_element; + } + } + pixels = video_frame->data(plane_index); + pixels_stride_in_bytes = video_stride_bytes; + } else { + // Avoid malloc for each frame/plane if possible. + const size_t needed_size = + upload_image_stride * resource_size_pixels.height(); + if (upload_pixels_size_ < needed_size) { + if (!ReallocateUploadPixels(needed_size)) { + // Fail here if memory reallocation fails. + return false; + } + } + + if (plane_si_format == viz::SinglePlaneFormat::kLUMINANCE_F16) { + for (int row = 0; row < resource_size_pixels.height(); ++row) { + uint16_t* dst = reinterpret_cast<uint16_t*>( + &upload_pixels_[upload_image_stride * row]); + const uint16_t* src = reinterpret_cast<const uint16_t*>( + video_frame->data(plane_index) + (video_stride_bytes * row)); + half_float_maker->MakeHalfFloats(src, bytes_per_row / 2, dst); + } + } else if (needs_bit_downshifting) { + DCHECK(plane_si_format == viz::SinglePlaneFormat::kLUMINANCE_8 || + plane_si_format == viz::SinglePlaneFormat::kR_8); + const int scale = 0x10000 >> (bits_per_channel - 8); + libyuv::Convert16To8Plane( + reinterpret_cast<const uint16_t*>(video_frame->data(plane_index)), + video_stride_bytes / 2, upload_pixels_.get(), upload_image_stride, + scale, bytes_per_row, resource_size_pixels.height()); + } else { + NOTREACHED(); + } + + pixels = upload_pixels_.get(); + pixels_stride_in_bytes = upload_image_stride; + } + + // Copy pixels into texture. TexSubImage2D() is applicable because + // |yuv_si_format| is LUMINANCE_F16, R16_EXT, LUMINANCE_8 or RED_8. + if (CanUseRasterInterface()) { + auto* ri = RasterInterface(); + auto color_type = viz::ToClosestSkColorType( + /*gpu_compositing=*/true, plane_si_format, /*plane_index=*/0); + SkImageInfo info = SkImageInfo::Make(resource_size_pixels.width(), + resource_size_pixels.height(), + color_type, kPremul_SkAlphaType); + SkPixmap pixmap = SkPixmap(info, pixels, pixels_stride_in_bytes); + ri->WritePixels(plane_resource->mailbox(), /*dst_x_offset=*/0, + /*dst_y_offset=*/0, /*dst_plane_index=*/0, + plane_resource->texture_target(), pixmap); + } else { + auto* gl = ContextGL(); + HardwarePlaneResource::ScopedTexture scope(gl, plane_resource); + + gl->BindTexture(plane_resource->texture_target(), scope.texture_id()); + + gl->PixelStorei(GL_UNPACK_ROW_LENGTH, unpack_row_length); + gl->PixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment); + gl->TexSubImage2D( + plane_resource->texture_target(), /*level=*/0, /*xoffset=*/0, + /*yoffset=*/0, resource_size_pixels.width(), + resource_size_pixels.height(), + viz::SharedImageFormatRestrictedSinglePlaneUtils::ToGLDataFormat( + plane_si_format), + viz::SharedImageFormatRestrictedSinglePlaneUtils::ToGLDataType( + plane_si_format), + pixels); + gl->PixelStorei(GL_UNPACK_ROW_LENGTH, kDefaultUnpackRowLength); + gl->PixelStorei(GL_UNPACK_ALIGNMENT, kDefaultUnpackAlignment); + } + + return true; +} + +VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes( + scoped_refptr<VideoFrame> video_frame) { + TRACE_EVENT0("media", "VideoResourceUpdater::CreateForSoftwarePlanes"); + const VideoPixelFormat input_frame_format = video_frame->format(); + size_t bits_per_channel = video_frame->BitDepth(); + DCHECK(IsYuvPlanar(input_frame_format) || + input_frame_format == PIXEL_FORMAT_Y16 || + IsFrameFormat32BitRGB(input_frame_format)); + + bool texture_needs_rgb_conversion = false; + viz::SharedImageFormat output_si_format = GetSoftwareOutputFormat( + input_frame_format, bits_per_channel, texture_needs_rgb_conversion); + std::optional<viz::SharedImageFormat> subplane_si_format = + GetSoftwareSubplaneFormat(input_frame_format, output_si_format); + + gfx::ColorSpace output_color_space = video_frame->ColorSpace(); + size_t output_resource_count = VideoFrame::NumPlanes(input_frame_format); // TODO(skaslev): If we're in software compositing mode, we do the YUV -> RGB // conversion here. That involves an extra copy of each frame to a bitmap. // Obviously, this is suboptimal and should be addressed once ubercompositor // starts shaping up. if (software_compositor() || texture_needs_rgb_conversion) { - output_si_format = - software_compositor() - ? viz::SinglePlaneFormat::kRGBA_8888 - : PaintCanvasVideoRenderer::GetRGBPixelsOutputFormat(); - output_plane_count = 1; + output_resource_count = 1; bits_per_channel = 8; // The YUV to RGB conversion will be performed when we convert @@ -1175,8 +1448,8 @@ } std::vector<gfx::Size> outplane_plane_sizes; - outplane_plane_sizes.reserve(output_plane_count); - for (size_t i = 0; i < output_plane_count; ++i) { + outplane_plane_sizes.reserve(output_resource_count); + for (size_t i = 0; i < output_resource_count; ++i) { outplane_plane_sizes.push_back( SoftwarePlaneDimension(video_frame.get(), software_compositor(), i)); const gfx::Size& output_plane_resource_size = outplane_plane_sizes.back(); @@ -1210,8 +1483,8 @@ // Recycle or allocate resources for each video plane. std::vector<PlaneResource*> plane_resources; - plane_resources.reserve(output_plane_count); - for (size_t i = 0; i < output_plane_count; ++i) { + plane_resources.reserve(output_resource_count); + for (size_t i = 0; i < output_resource_count; ++i) { auto si_format = i == 0 ? output_si_format : subplane_si_format.value_or(output_si_format); DCHECK(si_format.is_single_plane()); @@ -1222,108 +1495,22 @@ } VideoFrameExternalResources external_resources; - external_resources.bits_per_channel = bits_per_channel; - if (software_compositor() || texture_needs_rgb_conversion || is_rgb) { + if (software_compositor() || texture_needs_rgb_conversion || + IsFrameFormat32BitRGB(input_frame_format)) { DCHECK_EQ(plane_resources.size(), 1u); PlaneResource* plane_resource = plane_resources[0]; if (!plane_resource->Matches(video_frame->unique_id(), 0)) { // We need to transfer data from |video_frame| to the plane resource. if (software_compositor()) { - DCHECK_EQ(plane_resource->si_format(), - viz::SinglePlaneFormat::kRGBA_8888); - - if (!video_renderer_) - video_renderer_ = std::make_unique<PaintCanvasVideoRenderer>(); - - SoftwarePlaneResource* software_resource = plane_resource->AsSoftware(); - - // We know the format is RGBA_8888 from check above. - SkImageInfo info = SkImageInfo::MakeN32Premul( - gfx::SizeToSkISize(software_resource->resource_size())); - - SkBitmap sk_bitmap; - sk_bitmap.installPixels(info, software_resource->pixels(), - info.minRowBytes()); - // This is software path, so |canvas| and |video_frame| are always - // backed by software. - cc::SkiaPaintCanvas canvas(sk_bitmap); - cc::PaintFlags flags; - flags.setBlendMode(SkBlendMode::kSrc); - flags.setFilterQuality(cc::PaintFlags::FilterQuality::kLow); - - // Note that PaintCanvasVideoRenderer::Copy would copy to the origin, - // not |video_frame->visible_rect|, so call Paint instead. - // https://crbug.com/1090435 - video_renderer_->Paint(video_frame, &canvas, - gfx::RectF(video_frame->visible_rect()), flags, - media::kNoTransformation, nullptr); + TransferRGBPixelsToPaintCanvas(video_frame, plane_resource); } else { - HardwarePlaneResource* hardware_resource = plane_resource->AsHardware(); - size_t bytes_per_row = viz::ResourceSizes::CheckedWidthInBytes<size_t>( - video_frame->coded_size().width(), output_si_format); - const gfx::Size& plane_size = hardware_resource->resource_size(); - - // Note: Strides may be negative in case of bottom-up layouts. - const int stride = video_frame->stride(VideoFrame::kARGBPlane); - const bool has_compatible_stride = - stride > 0 && static_cast<size_t>(stride) == bytes_per_row; - - const uint8_t* source_pixels = nullptr; - if (HasCompatibleFormat(input_frame_format, output_si_format) && - has_compatible_stride) { - // We can passthrough when the texture format matches. Since we - // always copy the entire coded area we don't have to worry about - // origin. - source_pixels = video_frame->data(VideoFrame::kARGBPlane); - } else { - size_t needed_size = - bytes_per_row * video_frame->coded_size().height(); - if (upload_pixels_size_ < needed_size) { - if (!ReallocateUploadPixels(needed_size)) { - // Fail here if memory reallocation fails. - return VideoFrameExternalResources(); - } - } - - // PCVR writes to origin, so offset upload pixels by start since - // we upload frames in coded size and pass on the visible rect to - // the compositor. Note: It'd save a few bytes not to do this... - auto* dest_ptr = upload_pixels_.get() + - video_frame->visible_rect().y() * bytes_per_row + - video_frame->visible_rect().x() * sizeof(uint32_t); - PaintCanvasVideoRenderer::ConvertVideoFrameToRGBPixels( - video_frame.get(), dest_ptr, bytes_per_row); - source_pixels = upload_pixels_.get(); - } - - // Copy pixels into texture. - if (CanUseRasterInterface()) { - auto* ri = RasterInterface(); - auto color_type = viz::ToClosestSkColorType( - /*gpu_compositing=*/true, output_si_format, /*plane_index=*/0); - SkImageInfo info = - SkImageInfo::Make(plane_size.width(), plane_size.height(), - color_type, kPremul_SkAlphaType); - SkPixmap pixmap = SkPixmap(info, source_pixels, bytes_per_row); - ri->WritePixels(hardware_resource->mailbox(), /*dst_x_offset=*/0, - /*dst_y_offset=*/0, /*dst_plane_index=*/0, - hardware_resource->texture_target(), pixmap); - } else { - auto* gl = ContextGL(); - HardwarePlaneResource::ScopedTexture scope(gl, hardware_resource); - gl->BindTexture(hardware_resource->texture_target(), - scope.texture_id()); - gl->TexSubImage2D( - hardware_resource->texture_target(), /*level=*/0, /*xoffset=*/0, - /*yoffset=*/0, plane_size.width(), plane_size.height(), - viz::SharedImageFormatRestrictedSinglePlaneUtils::ToGLDataFormat( - output_si_format), - viz::SharedImageFormatRestrictedSinglePlaneUtils::ToGLDataType( - output_si_format), - source_pixels); + if (!WriteRGBPixelsToTexture(video_frame, plane_resource, + output_si_format)) { + // Return empty resources if this fails. + return VideoFrameExternalResources(); } } plane_resource->SetUniqueId(video_frame->unique_id(), 0); @@ -1381,147 +1568,20 @@ HardwarePlaneResource* plane_resource = plane_resources[i]->AsHardware(); // Skip the transfer if this |video_frame|'s plane has been processed. - if (plane_resource->Matches(video_frame->unique_id(), i)) + if (plane_resource->Matches(video_frame->unique_id(), i)) { continue; + } const viz::SharedImageFormat plane_si_format = plane_resource->si_format(); DCHECK(plane_si_format == yuv_si_format || plane_si_format == subplane_si_format.value_or(yuv_si_format)); - // |video_stride_bytes| is the width of the |video_frame| we are uploading - // (including non-frame data to fill in the stride). - const int video_stride_bytes = video_frame->stride(i); - - // |resource_size_pixels| is the size of the destination resource. - const gfx::Size resource_size_pixels = plane_resource->resource_size(); - - const size_t bytes_per_row = - viz::ResourceSizes::CheckedWidthInBytes<size_t>( - resource_size_pixels.width(), plane_si_format); - - // Use 4-byte row alignment (OpenGL default) for upload performance. - // Assuming that GL_UNPACK_ALIGNMENT has not changed from default. - constexpr size_t kDefaultUnpackAlignment = 4; - const size_t upload_image_stride = cc::MathUtil::CheckedRoundUp<size_t>( - bytes_per_row, kDefaultUnpackAlignment); - - size_t resource_bit_depth = - static_cast<size_t>(plane_si_format.BitsPerPixel()); - // BitsPerPixel calculates bit depth for multiple channels together. So for - // planar formats that represent UV channels we need to divide by the number - // of channels. - if (plane_si_format == viz::SinglePlaneFormat::kRG_88 || - plane_si_format == viz::SinglePlaneFormat::kRG_1616) { - resource_bit_depth /= 2; + if (!WriteYUVPixelsPerPlaneToPerTexture(video_frame, plane_resource, + bits_per_channel, i, + half_float_maker.get())) { + // Return empty resources if this fails. + return VideoFrameExternalResources(); } - - CHECK_LE(resource_bit_depth, 16u); - - // Data downshifting is needed if the resource bit depth is not enough. - const bool needs_bit_downshifting = bits_per_channel > resource_bit_depth; - - // We need to convert the incoming data if we're transferring to half float, - // if the need a bit downshift or if the strides need to be reconciled. - const bool needs_conversion = - plane_si_format == viz::SinglePlaneFormat::kLUMINANCE_F16 || - needs_bit_downshifting; - - constexpr size_t kDefaultUnpackRowLength = 0; - GLuint unpack_row_length = kDefaultUnpackRowLength; - GLuint unpack_alignment = kDefaultUnpackAlignment; - - const uint8_t* pixels; - int pixels_stride_in_bytes; - - if (!needs_conversion) { - // Stride adaptation is needed if source and destination strides are - // different but they have the same bit depth. - const bool needs_stride_adaptation = - (bits_per_channel == resource_bit_depth) && - (upload_image_stride != static_cast<size_t>(video_stride_bytes)); - if (needs_stride_adaptation) { - const int bytes_per_element = - VideoFrame::BytesPerElement(video_frame->format(), i); - // Stride is aligned to VideoFrameLayout::kFrameAddressAlignment (32) - // which should be divisible by pixel size for YUV formats (1, 2 or 4). - DCHECK_EQ(video_stride_bytes % bytes_per_element, 0); - // Unpack row length is in pixels not bytes. - unpack_row_length = video_stride_bytes / bytes_per_element; - // Use a non-standard alignment only if necessary. - if (video_stride_bytes % kDefaultUnpackAlignment != 0) - unpack_alignment = bytes_per_element; - } - pixels = video_frame->data(i); - pixels_stride_in_bytes = video_stride_bytes; - } else { - // Avoid malloc for each frame/plane if possible. - const size_t needed_size = - upload_image_stride * resource_size_pixels.height(); - if (upload_pixels_size_ < needed_size) { - if (!ReallocateUploadPixels(needed_size)) { - // Fail here if memory reallocation fails. - return VideoFrameExternalResources(); - } - } - - if (plane_si_format == viz::SinglePlaneFormat::kLUMINANCE_F16) { - for (int row = 0; row < resource_size_pixels.height(); ++row) { - uint16_t* dst = reinterpret_cast<uint16_t*>( - &upload_pixels_[upload_image_stride * row]); - const uint16_t* src = reinterpret_cast<const uint16_t*>( - video_frame->data(i) + (video_stride_bytes * row)); - half_float_maker->MakeHalfFloats(src, bytes_per_row / 2, dst); - } - } else if (needs_bit_downshifting) { - DCHECK(plane_si_format == viz::SinglePlaneFormat::kLUMINANCE_8 || - plane_si_format == viz::SinglePlaneFormat::kR_8); - const int scale = 0x10000 >> (bits_per_channel - 8); - libyuv::Convert16To8Plane( - reinterpret_cast<const uint16_t*>(video_frame->data(i)), - video_stride_bytes / 2, upload_pixels_.get(), upload_image_stride, - scale, bytes_per_row, resource_size_pixels.height()); - } else { - NOTREACHED(); - } - - pixels = upload_pixels_.get(); - pixels_stride_in_bytes = upload_image_stride; - } - - // Copy pixels into texture. TexSubImage2D() is applicable because - // |yuv_si_format| is LUMINANCE_F16, R16_EXT, LUMINANCE_8 or RED_8. - if (CanUseRasterInterface()) { - auto* ri = RasterInterface(); - auto color_type = viz::ToClosestSkColorType( - /*gpu_compositing=*/true, plane_si_format, /*plane_index=*/0); - SkImageInfo info = SkImageInfo::Make(resource_size_pixels.width(), - resource_size_pixels.height(), - color_type, kPremul_SkAlphaType); - SkPixmap pixmap = SkPixmap(info, pixels, pixels_stride_in_bytes); - ri->WritePixels(plane_resource->mailbox(), /*dst_x_offset=*/0, - /*dst_y_offset=*/0, /*dst_plane_index=*/0, - plane_resource->texture_target(), pixmap); - } else { - auto* gl = ContextGL(); - HardwarePlaneResource::ScopedTexture scope(gl, plane_resource); - - gl->BindTexture(plane_resource->texture_target(), scope.texture_id()); - - gl->PixelStorei(GL_UNPACK_ROW_LENGTH, unpack_row_length); - gl->PixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment); - gl->TexSubImage2D( - plane_resource->texture_target(), /*level=*/0, /*xoffset=*/0, - /*yoffset=*/0, resource_size_pixels.width(), - resource_size_pixels.height(), - viz::SharedImageFormatRestrictedSinglePlaneUtils::ToGLDataFormat( - plane_si_format), - viz::SharedImageFormatRestrictedSinglePlaneUtils::ToGLDataType( - plane_si_format), - pixels); - gl->PixelStorei(GL_UNPACK_ROW_LENGTH, kDefaultUnpackRowLength); - gl->PixelStorei(GL_UNPACK_ALIGNMENT, kDefaultUnpackAlignment); - } - plane_resource->SetUniqueId(video_frame->unique_id(), i); }
diff --git a/media/renderers/video_resource_updater.h b/media/renderers/video_resource_updater.h index 36c2b7a..8863f242 100644 --- a/media/renderers/video_resource_updater.h +++ b/media/renderers/video_resource_updater.h
@@ -9,6 +9,7 @@ #include <stdint.h> #include <memory> +#include <optional> #include <vector> #include "base/memory/raw_ptr.h" @@ -23,6 +24,7 @@ #include "gpu/command_buffer/client/raster_interface.h" #include "media/base/media_export.h" #include "media/base/video_frame.h" +#include "media/video/half_float_maker.h" #include "ui/gfx/buffer_types.h" #include "ui/gfx/geometry/size.h" @@ -181,6 +183,41 @@ VideoFrameExternalResources CreateForHardwarePlanes( scoped_refptr<VideoFrame> video_frame); + // Get the shared image format for creating resource which is used for + // software compositing or GPU compositing with video frames without textures + // (pixel upload). + viz::SharedImageFormat GetSoftwareOutputFormat( + VideoPixelFormat input_frame_format, + int bits_per_channel, + bool& texture_needs_rgb_conversion_out); + + // Get the subplane shared image format used for creating + // SoftwarePlaneResource per plane for multiplanar formats. + std::optional<viz::SharedImageFormat> GetSoftwareSubplaneFormat( + VideoPixelFormat input_frame_format, + viz::SharedImageFormat output_si_format); + + // Transfer RGB pixels from the video frame to software resource through + // canvas via PaintCanvasVideoRenderer. + void TransferRGBPixelsToPaintCanvas(scoped_refptr<VideoFrame> video_frame, + PlaneResource* plane_resource); + + // Write/copy RGB pixels from video frame to hardware resource through + // WritePixels or TexSubImage2D. + bool WriteRGBPixelsToTexture(scoped_refptr<VideoFrame> video_frame, + PlaneResource* plane_resource, + viz::SharedImageFormat output_si_format); + + // Write/copy YUV pixels per plane from video frame to hardware resource + // through WritePixels or TexSubImage2D. Also perform bit downshifting for + // channel format mismatch between input frame and supported shared image + // format. + bool WriteYUVPixelsPerPlaneToPerTexture(scoped_refptr<VideoFrame> video_frame, + HardwarePlaneResource* plane_resource, + size_t bits_per_channel, + size_t plane_index, + HalfFloatMaker* half_float_maker); + // Get resources ready to be appended into DrawQuads. This is always used for // software compositing. This is also used for GPU compositing when the input // video frame has no textures.
diff --git a/media/test/data/README.md b/media/test/data/README.md index 2e14cf3..327c0d4a 100644 --- a/media/test/data/README.md +++ b/media/test/data/README.md
@@ -1541,6 +1541,12 @@ ffmpeg -f lavfi -i "color=c=white:d=1" -f lavfi -i "testsrc2=d=1" -map 0 -disposition:v:0 0 -map 1 -disposition:v:1 default -c:v libx264 multitrack-disabled.mp4 ```` +#### track-disabled.mp4 +H.264 video stream with the only track disabled, generated with +```` +ffmpeg -f lavfi -i "color=c=white:d=1" -map 0 -disposition:v:0 0 -c:v libx264 track-disabled.mp4 +```` + ### Multi-track WebM file #### multitrack-3video-2audio.webm
diff --git a/media/test/data/track-disabled.mp4 b/media/test/data/track-disabled.mp4 new file mode 100644 index 0000000..2946949 --- /dev/null +++ b/media/test/data/track-disabled.mp4 Binary files differ
diff --git a/media/test/media_bundle_data.filelist b/media/test/media_bundle_data.filelist index 5bfa8687..979d78e 100644 --- a/media/test/media_bundle_data.filelist +++ b/media/test/media_bundle_data.filelist
@@ -465,6 +465,7 @@ data/test-25fps.vp9_2.json data/test_key_system_instantiation.html data/tos-h264-opus.mp4 +data/track-disabled.mp4 data/trailing-garbage.mp3 data/tulip2.webm data/vorbis-extradata
diff --git a/media/unit_tests_bundle_data.filelist b/media/unit_tests_bundle_data.filelist index 0233604..d5ae9c5a 100644 --- a/media/unit_tests_bundle_data.filelist +++ b/media/unit_tests_bundle_data.filelist
@@ -477,6 +477,7 @@ //media/test/data/test-25fps.vp9_2.json //media/test/data/test_key_system_instantiation.html //media/test/data/tos-h264-opus.mp4 +//media/test/data/track-disabled.mp4 //media/test/data/trailing-garbage.mp3 //media/test/data/tulip2.webm //media/test/data/vorbis-extradata
diff --git a/media/video/av1_video_encoder.cc b/media/video/av1_video_encoder.cc index a381dec..0125d64db 100644 --- a/media/video/av1_video_encoder.cc +++ b/media/video/av1_video_encoder.cc
@@ -261,6 +261,9 @@ if (options.content_hint == ContentHint::Screen) { CALL_AOM_CONTROL(AV1E_SET_TUNE_CONTENT, AOM_CONTENT_SCREEN); + CALL_AOM_CONTROL(AV1E_SET_ENABLE_PALETTE, 1); + } else { + CALL_AOM_CONTROL(AV1E_SET_ENABLE_PALETTE, 0); } // Keep in mind that AV1E_SET_TILE_[COLUMNS|ROWS] uses log2 units.
diff --git a/mojo/core/core.cc b/mojo/core/core.cc index cca2027..157f71c 100644 --- a/mojo/core/core.cc +++ b/mojo/core/core.cc
@@ -59,7 +59,7 @@ // The pipe name which must be used for the sole pipe attachment on any isolated // invitation. -constexpr base::StringPiece kIsolatedInvitationPipeName = {"\0\0\0\0", 4}; +constexpr std::string_view kIsolatedInvitationPipeName = {"\0\0\0\0", 4}; void InvokeProcessErrorCallback(MojoProcessErrorHandler handler, uintptr_t context, @@ -192,7 +192,7 @@ void Core::ConnectIsolated(ConnectionParams connection_params, const ports::PortRef& port, - base::StringPiece connection_name) { + std::string_view connection_name) { RequestContext request_context; GetNodeController()->ConnectIsolated(std::move(connection_params), port, connection_name); @@ -1212,7 +1212,7 @@ return MOJO_RESULT_RESOURCE_EXHAUSTED; MojoResult result = invitation_dispatcher->AttachMessagePipe( - base::StringPiece(static_cast<const char*>(name), name_num_bytes), + std::string_view(static_cast<const char*>(name), name_num_bytes), std::move(remote_peer_port)); if (result != MOJO_RESULT_OK) { Close(local_handle); @@ -1238,7 +1238,7 @@ RequestContext request_context; - base::StringPiece name_string(static_cast<const char*>(name), name_num_bytes); + std::string_view name_string(static_cast<const char*>(name), name_num_bytes); scoped_refptr<Dispatcher> dispatcher = GetDispatcher(invitation_handle); if (!dispatcher || dispatcher->GetType() != Dispatcher::Type::INVITATION) return MOJO_RESULT_INVALID_ARGUMENT; @@ -1351,8 +1351,8 @@ if (is_isolated) { DCHECK_EQ(attached_ports.size(), 1u); DCHECK_EQ(attached_ports[0].first, kIsolatedInvitationPipeName); - base::StringPiece connection_name(options->isolated_connection_name, - options->isolated_connection_name_length); + std::string_view connection_name(options->isolated_connection_name, + options->isolated_connection_name_length); GetNodeController()->ConnectIsolated(std::move(connection_params), attached_ports[0].second, connection_name); @@ -1424,7 +1424,7 @@ ports::PortRef remote_port; node_controller->node()->CreatePortPair(&local_port, &remote_port); node_controller->ConnectIsolated(std::move(connection_params), remote_port, - base::StringPiece()); + std::string_view()); MojoResult result = dispatcher->AttachMessagePipe(kIsolatedInvitationPipeName, local_port); DCHECK_EQ(MOJO_RESULT_OK, result);
diff --git a/mojo/core/core.h b/mojo/core/core.h index f5f14f5..f3e17b1 100644 --- a/mojo/core/core.h +++ b/mojo/core/core.h
@@ -101,7 +101,7 @@ // connections. void ConnectIsolated(ConnectionParams connection_params, const ports::PortRef& port, - base::StringPiece connection_name); + std::string_view connection_name); MojoHandle AddDispatcher(scoped_refptr<Dispatcher> dispatcher);
diff --git a/mojo/core/core_ipcz_test.cc b/mojo/core/core_ipcz_test.cc index 7fbb508..3b3d389 100644 --- a/mojo/core/core_ipcz_test.cc +++ b/mojo/core/core_ipcz_test.cc
@@ -52,7 +52,7 @@ } } - MojoMessageHandle CreateMessage(base::StringPiece contents, + MojoMessageHandle CreateMessage(std::string_view contents, base::span<MojoHandle> handles = {}) { MojoMessageHandle message; EXPECT_EQ(MOJO_RESULT_OK, mojo().CreateMessage(nullptr, &message)); @@ -137,7 +137,7 @@ }; } - void WriteToMessagePipe(MojoHandle pipe, base::StringPiece contents) { + void WriteToMessagePipe(MojoHandle pipe, std::string_view contents) { MojoMessageHandle message = CreateMessage(contents); EXPECT_EQ(MOJO_RESULT_OK, mojo().WriteMessage(pipe, message, nullptr)); } @@ -275,7 +275,7 @@ MojoHandle a, b; EXPECT_EQ(MOJO_RESULT_OK, mojo().CreateMessagePipe(nullptr, &a, &b)); - constexpr base::StringPiece kMessage = "hellllooooo"; + constexpr std::string_view kMessage = "hellllooooo"; MojoMessageHandle message = CreateMessage(kMessage, {&b, 1u}); void* buffer; @@ -292,7 +292,7 @@ mojo().GetMessageData(message, &options, &buffer, &num_bytes, nullptr, nullptr)); EXPECT_EQ(kMessage, - base::StringPiece(static_cast<const char*>(buffer), num_bytes)); + std::string_view(static_cast<const char*>(buffer), num_bytes)); b = MOJO_HANDLE_INVALID; uint32_t num_handles = 1; @@ -316,7 +316,7 @@ MojoHandle a, b; EXPECT_EQ(MOJO_RESULT_OK, mojo().CreateMessagePipe(nullptr, &a, &b)); - constexpr base::StringPiece kMessage = "hellllooooo"; + constexpr std::string_view kMessage = "hellllooooo"; MojoMessageHandle message = CreateMessage(kMessage, {&b, 1u}); // Destroying the message must also close the attached pipe. @@ -340,7 +340,7 @@ MojoMessageHandle message; EXPECT_EQ(MOJO_RESULT_SHOULD_WAIT, mojo().ReadMessage(a, nullptr, &message)); - constexpr base::StringPiece kMessage = "bazongo"; + constexpr std::string_view kMessage = "bazongo"; EXPECT_EQ(MOJO_RESULT_OK, mojo().WriteMessage(a, CreateMessage(kMessage), nullptr)); @@ -480,7 +480,7 @@ } TEST_F(CoreIpczTest, BasicSharedBuffer) { - const base::StringPiece kContents = "steamed hams"; + const std::string_view kContents = "steamed hams"; MojoHandle buffer; EXPECT_EQ(MOJO_RESULT_OK, mojo().CreateSharedBuffer(kContents.size(), nullptr, &buffer)); @@ -536,8 +536,8 @@ EXPECT_EQ(MOJO_RESULT_OK, mojo().MapBuffer(readonly_buffer, 0, kContents.size(), nullptr, &address)); - EXPECT_EQ(kContents, base::StringPiece(static_cast<const char*>(address), - kContents.size())); + EXPECT_EQ(kContents, std::string_view(static_cast<const char*>(address), + kContents.size())); EXPECT_EQ(MOJO_RESULT_OK, mojo().Close(readonly_buffer)); } @@ -615,7 +615,7 @@ .struct_size = sizeof(write_options), .flags = MOJO_WRITE_DATA_FLAG_ALL_OR_NONE, }; - constexpr base::StringPiece kTestMessage = "hello, world!"; + constexpr std::string_view kTestMessage = "hello, world!"; uint32_t num_bytes = static_cast<uint32_t>(kTestMessage.size()); EXPECT_EQ( MOJO_RESULT_OUT_OF_RANGE, @@ -657,7 +657,7 @@ num_bytes = std::size(buffer); EXPECT_EQ(MOJO_RESULT_OK, mojo().ReadData(c, &read_options, buffer, &num_bytes)); - EXPECT_EQ("hello", base::StringPiece(buffer, num_bytes)); + EXPECT_EQ("hello", std::string_view(buffer, num_bytes)); CheckSignals(c, {.satisfied = MOJO_HANDLE_SIGNAL_READABLE}); // Discard does not require a buffer and copies no data, but it does consume @@ -680,7 +680,7 @@ num_bytes = 3; EXPECT_EQ(MOJO_RESULT_OK, mojo().ReadData(c, &read_options, buffer, &num_bytes)); - EXPECT_EQ("ell", base::StringPiece(buffer, num_bytes)); + EXPECT_EQ("ell", std::string_view(buffer, num_bytes)); CheckSignals(c, {.satisfied = MOJO_HANDLE_SIGNAL_READABLE}); // Finally, default options allow for short reads. @@ -691,7 +691,7 @@ mojo().ReadData(c, &read_options, bigger_buffer, &num_bytes)); CheckSignals(c, {.not_satisfied = MOJO_HANDLE_SIGNAL_READABLE}); - EXPECT_EQ("o", base::StringPiece(bigger_buffer, num_bytes)); + EXPECT_EQ("o", std::string_view(bigger_buffer, num_bytes)); EXPECT_EQ(MOJO_RESULT_OK, mojo().Close(p)); CheckSignals(c, {.not_satisfiable = MOJO_HANDLE_SIGNAL_READABLE | @@ -709,7 +709,7 @@ }; EXPECT_EQ(MOJO_RESULT_OK, mojo().CreateDataPipe(&options, &p, &c)); - const base::StringPiece kTestMessage = "hello, world!"; + const std::string_view kTestMessage = "hello, world!"; void* buffer; uint32_t num_bytes = static_cast<uint32_t>(kTestMessage.size()); @@ -726,7 +726,7 @@ mojo().BeginReadData(c, nullptr, &in_buffer, &num_bytes)); EXPECT_EQ(5u, num_bytes); EXPECT_EQ("hello", - base::StringPiece(static_cast<const char*>(in_buffer), num_bytes)); + std::string_view(static_cast<const char*>(in_buffer), num_bytes)); EXPECT_EQ(MOJO_RESULT_OK, mojo().Close(p)); EXPECT_EQ(MOJO_RESULT_OK, mojo().Close(c)); @@ -734,9 +734,9 @@ #if BUILDFLAG(USE_BLINK) -constexpr base::StringPiece kAttachmentName = "interesting pipe name"; +constexpr std::string_view kAttachmentName = "interesting pipe name"; -constexpr base::StringPiece kTestMessages[] = { +constexpr std::string_view kTestMessages[] = { "hello hello", "i don't know why you say goodbye", "actually nvm i do", @@ -852,7 +852,7 @@ }); } -constexpr base::StringPiece kDataPipeMessage = "hello, world!"; +constexpr std::string_view kDataPipeMessage = "hello, world!"; constexpr size_t kDataPipeCapacity = 8; static_assert(kDataPipeCapacity < kDataPipeMessage.size(), "Test requires a data pipe smaller than the test message.");
diff --git a/mojo/core/dispatcher.cc b/mojo/core/dispatcher.cc index 5878c18..64ce79e 100644 --- a/mojo/core/dispatcher.cc +++ b/mojo/core/dispatcher.cc
@@ -114,12 +114,12 @@ return MOJO_RESULT_INVALID_ARGUMENT; } -MojoResult Dispatcher::AttachMessagePipe(base::StringPiece name, +MojoResult Dispatcher::AttachMessagePipe(std::string_view name, ports::PortRef remote_peer_port) { return MOJO_RESULT_INVALID_ARGUMENT; } -MojoResult Dispatcher::ExtractMessagePipe(base::StringPiece name, +MojoResult Dispatcher::ExtractMessagePipe(std::string_view name, MojoHandle* message_pipe_handle) { return MOJO_RESULT_INVALID_ARGUMENT; }
diff --git a/mojo/core/dispatcher.h b/mojo/core/dispatcher.h index 82dc60a..d54e991e6 100644 --- a/mojo/core/dispatcher.h +++ b/mojo/core/dispatcher.h
@@ -207,13 +207,13 @@ // Supports the |MojoAttachMessagePipeToInvitation()| API if implemented by // this Dispatcher. Arguments correspond to the ones given to the original API // call. See |MojoAttachMessagePipeToInvitation()| documentation. - virtual MojoResult AttachMessagePipe(base::StringPiece name, + virtual MojoResult AttachMessagePipe(std::string_view name, ports::PortRef remote_peer_port); // Supports the |MojoExtractMessagePipeFromInvitation()| API if implemented by // this Dispatcher. Arguments correspond to the ones given to the original API // call. See |MojoExtractMessagePipeFromInvitation()| documentation. - virtual MojoResult ExtractMessagePipe(base::StringPiece name, + virtual MojoResult ExtractMessagePipe(std::string_view name, MojoHandle* message_pipe_handle); // Supports the |MojoSetQuota()| API if implemented by this Dispatcher.
diff --git a/mojo/core/invitation_dispatcher.cc b/mojo/core/invitation_dispatcher.cc index cadb3aeb..4ce0fbe 100644 --- a/mojo/core/invitation_dispatcher.cc +++ b/mojo/core/invitation_dispatcher.cc
@@ -31,7 +31,7 @@ } MojoResult InvitationDispatcher::AttachMessagePipe( - base::StringPiece name, + std::string_view name, ports::PortRef remote_peer_port) { base::AutoLock lock(lock_); auto result = attached_ports_.emplace(std::string(name), remote_peer_port); @@ -43,7 +43,7 @@ } MojoResult InvitationDispatcher::ExtractMessagePipe( - base::StringPiece name, + std::string_view name, MojoHandle* message_pipe_handle) { ports::PortRef remote_peer_port; {
diff --git a/mojo/core/invitation_dispatcher.h b/mojo/core/invitation_dispatcher.h index aa4146d6..5db87890 100644 --- a/mojo/core/invitation_dispatcher.h +++ b/mojo/core/invitation_dispatcher.h
@@ -26,9 +26,9 @@ // Dispatcher: Type GetType() const override; MojoResult Close() override; - MojoResult AttachMessagePipe(base::StringPiece name, + MojoResult AttachMessagePipe(std::string_view name, ports::PortRef remote_peer_port) override; - MojoResult ExtractMessagePipe(base::StringPiece name, + MojoResult ExtractMessagePipe(std::string_view name, MojoHandle* message_pipe_handle) override; using PortMapping = base::flat_map<std::string, ports::PortRef>;
diff --git a/mojo/core/invitation_unittest.cc b/mojo/core/invitation_unittest.cc index fab7e00..67f63b5 100644 --- a/mojo/core/invitation_unittest.cc +++ b/mojo/core/invitation_unittest.cc
@@ -80,15 +80,14 @@ base::CommandLine* custom_command_line = nullptr, base::LaunchOptions* custom_launch_options = nullptr); - static void SendInvitationToClient( - PlatformHandle endpoint_handle, - base::ProcessHandle process, - MojoHandle* primordial_pipes, - size_t num_primordial_pipes, - MojoSendInvitationFlags flags, - MojoProcessErrorHandler error_handler, - uintptr_t error_handler_context, - base::StringPiece isolated_invitation_name); + static void SendInvitationToClient(PlatformHandle endpoint_handle, + base::ProcessHandle process, + MojoHandle* primordial_pipes, + size_t num_primordial_pipes, + MojoSendInvitationFlags flags, + MojoProcessErrorHandler error_handler, + uintptr_t error_handler_context, + std::string_view isolated_invitation_name); static void WaitForProcessToTerminate(base::Process& process) { int wait_result = -1; @@ -105,7 +104,7 @@ void PrepareToPassRemoteEndpoint(PlatformChannel* channel, base::LaunchOptions* options, base::CommandLine* command_line, - base::StringPiece switch_name = {}) { + std::string_view switch_name = {}) { std::string value; #if BUILDFLAG(IS_FUCHSIA) channel->PrepareToPassRemoteEndpoint(&options->handles_to_transfer, &value); @@ -379,7 +378,7 @@ MojoSendInvitationFlags flags, MojoProcessErrorHandler error_handler, uintptr_t error_handler_context, - base::StringPiece isolated_invitation_name) { + std::string_view isolated_invitation_name) { MojoPlatformHandle handle; PlatformHandle::ToMojoPlatformHandle(std::move(endpoint_handle), &handle); CHECK_NE(handle.type, MOJO_PLATFORM_HANDLE_TYPE_INVALID); @@ -426,7 +425,7 @@ TestClientBase& operator=(const TestClientBase&) = delete; static MojoHandle AcceptInvitation(MojoAcceptInvitationFlags flags, - base::StringPiece switch_name = {}) { + std::string_view switch_name = {}) { const auto& command_line = *base::CommandLine::ForCurrentProcess(); PlatformChannelEndpoint channel_endpoint; if (switch_name.empty()) { @@ -1031,7 +1030,7 @@ MojoClose(client); } -MojoHandle CreateMemory(base::StringPiece contents) { +MojoHandle CreateMemory(std::string_view contents) { auto region = base::WritableSharedMemoryRegion::Create(contents.size()); auto mapping = region.Map(); memcpy(mapping.memory(), contents.data(), contents.size()); @@ -1044,8 +1043,8 @@ auto region = UnwrapReadOnlySharedMemoryRegion( ScopedSharedBufferHandle{SharedBufferHandle{handle}}); auto mapping = region.Map(); - base::StringPiece contents{reinterpret_cast<const char*>(mapping.memory()), - region.GetSize()}; + std::string_view contents{reinterpret_cast<const char*>(mapping.memory()), + region.GetSize()}; return std::string{contents}; }
diff --git a/mojo/core/ipcz_driver/ring_buffer_test.cc b/mojo/core/ipcz_driver/ring_buffer_test.cc index 2ba6301..05add9c9 100644 --- a/mojo/core/ipcz_driver/ring_buffer_test.cc +++ b/mojo/core/ipcz_driver/ring_buffer_test.cc
@@ -24,12 +24,12 @@ using RingBufferTest = testing::Test; -base::StringPiece AsString(base::span<const uint8_t> bytes) { - return base::StringPiece(reinterpret_cast<const char*>(bytes.data()), - bytes.size()); +std::string_view AsString(base::span<const uint8_t> bytes) { + return std::string_view(reinterpret_cast<const char*>(bytes.data()), + bytes.size()); } -base::span<const uint8_t> AsBytes(base::StringPiece s) { +base::span<const uint8_t> AsBytes(std::string_view s) { return base::as_bytes(base::make_span(s)).first(s.length()); } @@ -42,9 +42,9 @@ RingBuffer& buffer() { return buffer_; } - size_t Write(base::StringPiece s) { return buffer_.Write(AsBytes(s)); } + size_t Write(std::string_view s) { return buffer_.Write(AsBytes(s)); } - bool WriteAll(base::StringPiece s) { return buffer_.WriteAll(AsBytes(s)); } + bool WriteAll(std::string_view s) { return buffer_.WriteAll(AsBytes(s)); } std::string Read(size_t n) { std::vector<uint8_t> data(n);
diff --git a/mojo/core/message_unittest.cc b/mojo/core/message_unittest.cc index 995d981..6d5cf51 100644 --- a/mojo/core/message_unittest.cc +++ b/mojo/core/message_unittest.cc
@@ -587,7 +587,7 @@ &extracted_handle, &num_handles)); EXPECT_EQ(std::string(kTestMessageWithContext1).size(), num_bytes); EXPECT_EQ(std::string(kTestMessageWithContext1), - base::StringPiece(static_cast<char*>(buffer), num_bytes)); + std::string_view(static_cast<char*>(buffer), num_bytes)); // Confirm that the handle we extracted from the serialized message is still // connected to the same peer, despite the fact that its handle value may have
diff --git a/mojo/core/mojo_core.cc b/mojo/core/mojo_core.cc index 51219b5..191753f 100644 --- a/mojo/core/mojo_core.cc +++ b/mojo/core/mojo_core.cc
@@ -112,8 +112,8 @@ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); // If FieldTrialList::GetInstance() returns nullptr, - // FeatureList::InitializeFromCommandLine(), used by FeatureList:: - // InitializeInstance internally, creates no field trials. This causes + // FeatureList::InitFromCommandLine(), used by FeatureList:: + // InitInstance internally, creates no field trials. This causes // DCHECK() failure if we have an command line like // --enable-features=TestFeature:TestParam/TestValue. // We don't need to care about FieldTrialList duplication here, because @@ -121,7 +121,7 @@ // libmojo_core.so and the caller of LoadAndInitializeCoreLibrary doesn't // share FieldTrialList::GetInstance(). field_trial_list_ = std::make_unique<base::FieldTrialList>(); - base::FeatureList::InitializeInstance( + base::FeatureList::InitInstance( command_line->GetSwitchValueASCII(switches::kEnableFeatures), command_line->GetSwitchValueASCII(switches::kDisableFeatures)); #endif // !defined(COMPONENT_BUILD)
diff --git a/mojo/core/node_controller.cc b/mojo/core/node_controller.cc index 568df5a..654461b 100644 --- a/mojo/core/node_controller.cc +++ b/mojo/core/node_controller.cc
@@ -275,7 +275,7 @@ void NodeController::ConnectIsolated(ConnectionParams connection_params, const ports::PortRef& port, - base::StringPiece connection_name) { + std::string_view connection_name) { io_task_runner_->PostTask( FROM_HERE, base::BindOnce(&NodeController::ConnectIsolatedOnIOThread, @@ -1494,7 +1494,7 @@ NodeController::IsolatedConnection::IsolatedConnection( scoped_refptr<NodeChannel> channel, const ports::PortRef& local_port, - base::StringPiece name) + std::string_view name) : channel(std::move(channel)), local_port(local_port), name(name) {} NodeController::IsolatedConnection::~IsolatedConnection() = default;
diff --git a/mojo/core/node_controller.h b/mojo/core/node_controller.h index a8b6a8f..6bd08f5 100644 --- a/mojo/core/node_controller.h +++ b/mojo/core/node_controller.h
@@ -104,7 +104,7 @@ // the corresponding port in the peer node. void ConnectIsolated(ConnectionParams connection_params, const ports::PortRef& port, - base::StringPiece connection_name); + std::string_view connection_name); // Sets a port's observer. If |observer| is null the port's current observer // is removed. @@ -173,7 +173,7 @@ IsolatedConnection(IsolatedConnection&& other); IsolatedConnection(scoped_refptr<NodeChannel> channel, const ports::PortRef& local_port, - base::StringPiece name); + std::string_view name); ~IsolatedConnection(); IsolatedConnection& operator=(const IsolatedConnection& other);
diff --git a/mojo/core/ports/ports_unittest.cc b/mojo/core/ports/ports_unittest.cc index ebd84ef..e39e494 100644 --- a/mojo/core/ports/ports_unittest.cc +++ b/mojo/core/ports/ports_unittest.cc
@@ -45,7 +45,7 @@ public: static const TypeInfo kUserMessageTypeInfo; - TestMessage(const base::StringPiece& payload) + TestMessage(const std::string_view& payload) : UserMessage(&kUserMessageTypeInfo), payload_(payload) {} ~TestMessage() override = default; @@ -57,14 +57,14 @@ const UserMessage::TypeInfo TestMessage::kUserMessageTypeInfo = {}; -ScopedMessage NewUserMessageEvent(const base::StringPiece& payload, +ScopedMessage NewUserMessageEvent(const std::string_view& payload, size_t num_ports) { auto event = std::make_unique<UserMessageEvent>(num_ports); event->AttachMessage(std::make_unique<TestMessage>(payload)); return event; } -bool MessageEquals(const ScopedMessage& message, const base::StringPiece& s) { +bool MessageEquals(const ScopedMessage& message, const std::string_view& s) { return message->GetMessage<TestMessage>()->payload() == s; }
diff --git a/mojo/core/test/mojo_test_base.cc b/mojo/core/test/mojo_test_base.cc index 7d77ca50..5b3ed7f 100644 --- a/mojo/core/test/mojo_test_base.cc +++ b/mojo/core/test/mojo_test_base.cc
@@ -207,7 +207,7 @@ // static void MojoTestBase::WriteToBuffer(MojoHandle h, size_t offset, - const base::StringPiece& s) { + const std::string_view& s) { char* data; EXPECT_EQ(MOJO_RESULT_OK, MojoMapBuffer(h, offset, s.size(), nullptr, reinterpret_cast<void**>(&data))); @@ -218,11 +218,11 @@ // static void MojoTestBase::ExpectBufferContents(MojoHandle h, size_t offset, - const base::StringPiece& s) { + const std::string_view& s) { char* data; EXPECT_EQ(MOJO_RESULT_OK, MojoMapBuffer(h, offset, s.size(), nullptr, reinterpret_cast<void**>(&data))); - EXPECT_EQ(s, base::StringPiece(data, s.size())); + EXPECT_EQ(s, std::string_view(data, s.size())); EXPECT_EQ(MOJO_RESULT_OK, MojoUnmapBuffer(static_cast<void*>(data))); }
diff --git a/mojo/core/test/mojo_test_base.h b/mojo/core/test/mojo_test_base.h index 3fe650a..cc21aea 100644 --- a/mojo/core/test/mojo_test_base.h +++ b/mojo/core/test/mojo_test_base.h
@@ -145,12 +145,12 @@ // Maps a buffer, writes some data into it, and unmaps it. static void WriteToBuffer(MojoHandle h, size_t offset, - const base::StringPiece& s); + const std::string_view& s); // Maps a buffer, tests the value of some of its contents, and unmaps it. static void ExpectBufferContents(MojoHandle h, size_t offset, - const base::StringPiece& s); + const std::string_view& s); //////// Data pipe test utilities /////////
diff --git a/mojo/core/test/run_all_perftests.cc b/mojo/core/test/run_all_perftests.cc index 4668f05..887fa6f 100644 --- a/mojo/core/test/run_all_perftests.cc +++ b/mojo/core/test/run_all_perftests.cc
@@ -14,7 +14,7 @@ CHECK(base::CommandLine::Init(argc, argv)); const auto& cmd = *base::CommandLine::ForCurrentProcess(); auto features = std::make_unique<base::FeatureList>(); - features->InitializeFromCommandLine( + features->InitFromCommandLine( cmd.GetSwitchValueASCII(switches::kEnableFeatures), cmd.GetSwitchValueASCII(switches::kDisableFeatures)); base::FeatureList::SetInstance(std::move(features));
diff --git a/mojo/core/test/test_support_impl.cc b/mojo/core/test/test_support_impl.cc index e3389b6..7d5d416 100644 --- a/mojo/core/test/test_support_impl.cc +++ b/mojo/core/test/test_support_impl.cc
@@ -31,7 +31,7 @@ return base::FilePath(); } - for (const base::StringPiece& component : base::SplitStringPiece( + for (const std::string_view& component : base::SplitStringPiece( relative_path, "/", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { if (!component.empty()) path = path.AppendASCII(component);
diff --git a/net/extras/sqlite/sqlite_persistent_cookie_store.cc b/net/extras/sqlite/sqlite_persistent_cookie_store.cc index 3fda9a4..e639bf1b 100644 --- a/net/extras/sqlite/sqlite_persistent_cookie_store.cc +++ b/net/extras/sqlite/sqlite_persistent_cookie_store.cc
@@ -110,6 +110,7 @@ // Version number of the database. // +// Version 21 - 2023/11/22 - https://crrev.com/c/5049032 // Version 20 - 2023/11/14 - https://crrev.com/c/5030577 // Version 19 - 2023/09/22 - https://crrev.com/c/4704672 // Version 18 - 2022/04/19 - https://crrev.com/c/3594203 @@ -135,6 +136,8 @@ // Version 5 - 2011/12/05 - https://codereview.chromium.org/8533013 // Version 4 - 2009/09/01 - https://codereview.chromium.org/183021 // +// Version 21 removes the is_same_party column. +// // Version 20 changes the UNIQUE constraint to include the source_scheme and // source_port and begins to insert, update, and delete cookies based on their // source_scheme and source_port. @@ -169,10 +172,10 @@ // happens on Windows, on other OS, this migration is a no-op. // // Version 13 adds two new fields: "source_port" (the port number of the source -// origin, and "same_party" (boolean indicating whether the cookie had a +// origin, and "is_same_party" (boolean indicating whether the cookie had a // SameParty attribute). In migrating, source_port defaults to -1 // (url::PORT_UNSPECIFIED) for old entries for which the source port is unknown, -// and same_party defaults to false. +// and is_same_party defaults to false. // // Version 12 adds a column for "source_scheme" to store whether the // cookie was set from a URL with a cryptographic scheme. @@ -225,8 +228,8 @@ // Version 3 updated the database to include the last access time, so we can // expire them in decreasing order of use when we've reached the maximum // number of cookies. -const int kCurrentVersionNumber = 20; -const int kCompatibleVersionNumber = 20; +const int kCurrentVersionNumber = 21; +const int kCompatibleVersionNumber = 21; } // namespace @@ -682,6 +685,45 @@ return true; } +bool CreateV21Schema(sql::Database* db) { + CHECK(!db->DoesTableExist("cookies")); + + const char* kCreateTableQuery = + "CREATE TABLE cookies(" + "creation_utc INTEGER NOT NULL," + "host_key TEXT NOT NULL," + "top_frame_site_key TEXT NOT NULL," + "name TEXT NOT NULL," + "value TEXT NOT NULL," + "encrypted_value BLOB NOT NULL," + "path TEXT NOT NULL," + "expires_utc INTEGER NOT NULL," + "is_secure INTEGER NOT NULL," + "is_httponly INTEGER NOT NULL," + "last_access_utc INTEGER NOT NULL," + "has_expires INTEGER NOT NULL," + "is_persistent INTEGER NOT NULL," + "priority INTEGER NOT NULL," + "samesite INTEGER NOT NULL," + "source_scheme INTEGER NOT NULL," + "source_port INTEGER NOT NULL," + "last_update_utc INTEGER NOT NULL);"; + + const char* kCreateIndexQuery = + "CREATE UNIQUE INDEX cookies_unique_index " + "ON cookies(host_key, top_frame_site_key, name, path, source_scheme, " + "source_port)"; + + if (!db->Execute(kCreateTableQuery)) { + return false; + } + if (!db->Execute(kCreateIndexQuery)) { + return false; + } + + return true; +} + } // namespace void SQLitePersistentCookieStore::Backend::Load( @@ -754,7 +796,7 @@ if (db()->DoesTableExist("cookies")) return true; - return CreateV20Schema(db()); + return CreateV21Schema(db()); } bool SQLitePersistentCookieStore::Backend::DoInitializeDatabase() { @@ -828,15 +870,14 @@ "SELECT creation_utc, host_key, top_frame_site_key, name, value, path, " "expires_utc, is_secure, is_httponly, last_access_utc, has_expires, " "is_persistent, priority, encrypted_value, samesite, source_scheme, " - "source_port, is_same_party, last_update_utc FROM cookies WHERE " - "host_key = ?")); + "source_port, last_update_utc FROM cookies WHERE host_key = ?")); } else { smt.Assign(db()->GetCachedStatement( SQL_FROM_HERE, "SELECT creation_utc, host_key, top_frame_site_key, name, value, path, " "expires_utc, is_secure, is_httponly, last_access_utc, has_expires, " "is_persistent, priority, encrypted_value, samesite, source_scheme, " - "source_port, is_same_party, last_update_utc FROM cookies WHERE " + "source_port, last_update_utc FROM cookies WHERE " "host_key = ? AND " "is_persistent = 1")); } @@ -943,7 +984,7 @@ statement.ColumnTime(0), // creation_utc statement.ColumnTime(6), // expires_utc statement.ColumnTime(9), // last_access_utc - statement.ColumnTime(18), // last_update_utc + statement.ColumnTime(17), // last_update_utc statement.ColumnBool(7), // secure statement.ColumnBool(8), // http_only DBCookieSameSiteToCookieSameSite(static_cast<DBCookieSameSite>( @@ -1184,6 +1225,55 @@ } } + if (cur_version == 20) { + SCOPED_UMA_HISTOGRAM_TIMER("Cookie.TimeDatabaseMigrationToV21"); + + sql::Transaction transaction(db()); + if (!transaction.Begin()) { + return absl::nullopt; + } + + if (!db()->Execute("DROP TABLE IF EXISTS cookies_old")) { + return absl::nullopt; + } + if (!db()->Execute("ALTER TABLE cookies RENAME TO cookies_old")) { + return absl::nullopt; + } + if (!db()->Execute("DROP INDEX IF EXISTS cookies_unique_index")) { + return absl::nullopt; + } + + if (!CreateV21Schema(db())) { + return absl::nullopt; + } + + static constexpr char insert_cookies_sql[] = + "INSERT OR REPLACE INTO cookies " + "(creation_utc, host_key, top_frame_site_key, name, value, " + "encrypted_value, path, expires_utc, is_secure, is_httponly, " + "last_access_utc, has_expires, is_persistent, priority, samesite, " + "source_scheme, source_port, last_update_utc) " + "SELECT creation_utc, host_key, top_frame_site_key, name, value," + " encrypted_value, path, expires_utc, is_secure, is_httponly," + " last_access_utc, has_expires, is_persistent, priority, " + " samesite, source_scheme, source_port, last_update_utc " + "FROM cookies_old ORDER BY creation_utc ASC"; + if (!db()->Execute(insert_cookies_sql)) { + return absl::nullopt; + } + if (!db()->Execute("DROP TABLE cookies_old")) { + return absl::nullopt; + } + + ++cur_version; + if (!meta_table()->SetVersionNumber(cur_version) || + !meta_table()->SetCompatibleVersionNumber( + std::min(cur_version, kCompatibleVersionNumber)) || + !transaction.Commit()) { + return absl::nullopt; + } + } + // Put future migration cases here. return absl::make_optional(cur_version); @@ -1285,8 +1375,8 @@ "INSERT INTO cookies (creation_utc, host_key, top_frame_site_key, name, " "value, encrypted_value, path, expires_utc, is_secure, is_httponly, " "last_access_utc, has_expires, is_persistent, priority, samesite, " - "source_scheme, source_port, is_same_party, last_update_utc) " - "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)")); + "source_scheme, source_port, last_update_utc) " + "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)")); if (!add_statement.is_valid()) return; @@ -1354,8 +1444,7 @@ 14, CookieSameSiteToDBCookieSameSite(po->cc().SameSite())); add_statement.BindInt(15, static_cast<int>(po->cc().SourceScheme())); add_statement.BindInt(16, po->cc().SourcePort()); - add_statement.BindBool(17, false /* is_same_party */); - add_statement.BindTime(18, po->cc().LastUpdateDate()); + add_statement.BindTime(17, po->cc().LastUpdateDate()); if (!add_statement.Run()) { DLOG(WARNING) << "Could not add a cookie to the DB."; RecordCookieCommitProblem(COOKIE_COMMIT_PROBLEM_ADD);
diff --git a/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc b/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc index 1ac522f..152966d 100644 --- a/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc +++ b/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc
@@ -723,8 +723,8 @@ "INSERT INTO cookies (creation_utc, host_key, top_frame_site_key, name, " "value, encrypted_value, path, expires_utc, is_secure, is_httponly, " "samesite, last_access_utc, has_expires, is_persistent, priority, " - "source_scheme, source_port, is_same_party, last_update_utc) " - "VALUES (?,?,?,?,?,'',?,0,0,0,0,0,1,1,0,?,?,0,?)")); + "source_scheme, source_port, last_update_utc) " + "VALUES (?,?,?,?,?,'',?,0,0,0,0,0,1,1,0,?,?,?)")); ASSERT_TRUE(stmt.is_valid()); struct CookieInfo { @@ -1658,6 +1658,53 @@ return true; } +bool CreateV20Schema(sql::Database* db) { + sql::MetaTable meta_table; + if (!meta_table.Init(db, 20, 20)) { + return false; + } + + // Version 20 schema + static constexpr char kCreateSql[] = + "CREATE TABLE cookies(" + "creation_utc INTEGER NOT NULL," + "host_key TEXT NOT NULL," + "top_frame_site_key TEXT NOT NULL," + "name TEXT NOT NULL," + "value TEXT NOT NULL," + "encrypted_value BLOB NOT NULL," + "path TEXT NOT NULL," + "expires_utc INTEGER NOT NULL," + "is_secure INTEGER NOT NULL," + "is_httponly INTEGER NOT NULL," + "last_access_utc INTEGER NOT NULL," + "has_expires INTEGER NOT NULL," + "is_persistent INTEGER NOT NULL," + "priority INTEGER NOT NULL," + "samesite INTEGER NOT NULL," + "source_scheme INTEGER NOT NULL," + "source_port INTEGER NOT NULL," + "is_same_party INTEGER NOT NULL," + "last_update_utc INTEGER NOT NULL," + "UNIQUE (host_key, top_frame_site_key, name, path, source_scheme, " + "source_port))"; + + static constexpr char kCreateIndexSql[] = + "CREATE UNIQUE INDEX cookies_unique_index " + "ON cookies(host_key, top_frame_site_key, name, path, source_scheme, " + "source_port)"; + + if (!db->Execute(kCreateSql)) { + return false; + } + + if (!db->Execute(kCreateIndexSql)) { + return false; + } + + return true; +} + int GetDBCurrentVersionNumber(sql::Database* db) { static constexpr char kGetDBCurrentVersionQuery[] = "SELECT value FROM meta WHERE key='version'"; @@ -1670,9 +1717,6 @@ static base::Time now = base::Time::Now(); std::vector<CanonicalCookie> cookies; - // Note: These are all constructed with the default value of - // is_source_scheme_secure, which is false, but that doesn't matter because - // v11 doesn't store that info. cookies.push_back(*CanonicalCookie::CreateUnsafeCookieForTesting( "A", "B", "example.com", "/", now, now, now, now, true /* secure */, false /* httponly */, CookieSameSite::UNSPECIFIED, @@ -1761,7 +1805,11 @@ return AddV16CookiesToDB(db); } -bool AddV18CookiesToDB(sql::Database* db) { +// Versions 18, 19, and 20 use the same schema so they can reuse this function. +// AddV20CookiesToDB (and future versions) need to set max_expiration_delta to +// base::Days(400) to simulate expiration limits introduced in version 19. +bool AddV18CookiesToDB(sql::Database* db, + base::TimeDelta max_expiration_delta) { std::vector<CanonicalCookie> cookies = CookiesForMigrationTest(); sql::Statement statement(db->GetCachedStatement( SQL_FROM_HERE, @@ -1778,6 +1826,8 @@ return false; } for (const CanonicalCookie& cookie : cookies) { + base::Time max_expiration(cookie.CreationDate() + max_expiration_delta); + statement.Reset(true); statement.BindTime(0, cookie.CreationDate()); std::string top_frame_site_key; @@ -1789,7 +1839,7 @@ statement.BindString(4, cookie.Value()); statement.BindBlob(5, base::span<uint8_t>()); // encrypted_value statement.BindString(6, cookie.Path()); - statement.BindTime(7, cookie.ExpiryDate()); + statement.BindTime(7, std::min(cookie.ExpiryDate(), max_expiration)); statement.BindInt(8, cookie.IsSecure()); statement.BindInt(9, cookie.IsHttpOnly()); // Note that this, Priority(), and SourceScheme() below nominally rely on @@ -1817,6 +1867,10 @@ return true; } +bool AddV20CookiesToDB(sql::Database* db) { + return AddV18CookiesToDB(db, base::Days(400)); +} + // Confirm the cookie list passed in has the above cookies in it. void ConfirmCookiesAfterMigrationTest( std::vector<std::unique_ptr<CanonicalCookie>> read_in_cookies, @@ -1902,6 +1956,8 @@ : base::Time()); EXPECT_EQ(read_in_cookies[i]->ExpiryDate(), read_in_cookies[i]->CreationDate() + base::Days(399)); + + EXPECT_EQ(read_in_cookies.size(), static_cast<size_t>(i) + 1); } TEST_F(SQLitePersistentCookieStoreTest, UpgradeToSchemaVersion16) { @@ -1970,7 +2026,7 @@ ASSERT_TRUE(connection.Open(temp_dir_.GetPath().Append(kCookieFilename))); ASSERT_TRUE(CreateV18Schema(&connection)); ASSERT_EQ(GetDBCurrentVersionNumber(&connection), 18); - ASSERT_TRUE(AddV18CookiesToDB(&connection)); + ASSERT_TRUE(AddV18CookiesToDB(&connection, base::TimeDelta::Max())); std::vector<std::unique_ptr<CanonicalCookie>> read_in_cookies; CreateAndLoad(false, false, &read_in_cookies); @@ -1987,7 +2043,7 @@ // V19's schema is the same as V18, so we can reuse the creation function. ASSERT_TRUE(CreateV18Schema(&connection)); ASSERT_EQ(GetDBCurrentVersionNumber(&connection), 18); - ASSERT_TRUE(AddV18CookiesToDB(&connection)); + ASSERT_TRUE(AddV18CookiesToDB(&connection, base::TimeDelta::Max())); std::vector<std::unique_ptr<CanonicalCookie>> read_in_cookies; CreateAndLoad(/*crypt_cookies=*/false, /*restore_old_session_cookies=*/false, @@ -1998,6 +2054,23 @@ connection.Close(); } +TEST_F(SQLitePersistentCookieStoreTest, UpgradeToSchemaVersion21) { + // Open db. + sql::Database connection; + ASSERT_TRUE(connection.Open(temp_dir_.GetPath().Append(kCookieFilename))); + ASSERT_TRUE(CreateV20Schema(&connection)); + ASSERT_EQ(GetDBCurrentVersionNumber(&connection), 20); + ASSERT_TRUE(AddV20CookiesToDB(&connection)); + + std::vector<std::unique_ptr<CanonicalCookie>> read_in_cookies; + CreateAndLoad(/*crypt_cookies=*/false, /*restore_old_session_cookies=*/false, + &read_in_cookies); + ConfirmCookiesAfterMigrationTest(std::move(read_in_cookies), + /*expect_last_update_date=*/true); + ASSERT_GE(GetDBCurrentVersionNumber(&connection), 21); + connection.Close(); +} + class SQLitePersistentCookieStoreTest_OriginBoundCookies : public SQLitePersistentCookieStoreTest { public: @@ -2180,8 +2253,8 @@ "INSERT INTO cookies (creation_utc, host_key, top_frame_site_key, name, " "value, encrypted_value, path, expires_utc, is_secure, is_httponly, " "samesite, last_access_utc, has_expires, is_persistent, priority, " - "source_scheme, source_port, is_same_party, last_update_utc) " - "VALUES (?,?,?,?,?,'',?,?,1,0,0,?,1,1,0,?,?,0,?)")); + "source_scheme, source_port, last_update_utc) " + "VALUES (?,?,?,?,?,'',?,?,1,0,0,?,1,1,0,?,?,?)")); ASSERT_TRUE(stmt.is_valid()); base::Time creation(base::Time::Now());
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 95cfd07..385b299 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc
@@ -617,12 +617,17 @@ stream_->SetRequestHeadersCallback(request_headers_callback_); server_ssl_config_ = used_ssl_config; proxy_info_ = used_proxy_info; - response_.was_alpn_negotiated = stream_request_->was_alpn_negotiated(); + // TODO(crbug.com/621512): Remove `was_alpn_negotiated` when we remove + // chrome.loadTimes API. + response_.was_alpn_negotiated = + stream_request_->negotiated_protocol() != kProtoUnknown; response_.alpn_negotiated_protocol = NextProtoToString(stream_request_->negotiated_protocol()); response_.alternate_protocol_usage = stream_request_->alternate_protocol_usage(); - response_.was_fetched_via_spdy = stream_request_->using_spdy(); + // TODO(crbug.com/1286835): Stop using `was_fetched_via_spdy`. + response_.was_fetched_via_spdy = + stream_request_->negotiated_protocol() == kProtoHTTP2; response_.dns_aliases = stream_->GetDnsAliases(); SetProxyInfoInResponse(used_proxy_info, &response_); OnIOComplete(OK);
diff --git a/net/http/http_stream_factory_job.cc b/net/http/http_stream_factory_job.cc index 08e3d6f..972bacce 100644 --- a/net/http/http_stream_factory_job.cc +++ b/net/http/http_stream_factory_job.cc
@@ -40,6 +40,7 @@ #include "net/socket/client_socket_handle.h" #include "net/socket/client_socket_pool_manager.h" #include "net/socket/connect_job.h" +#include "net/socket/next_proto.h" #include "net/socket/ssl_client_socket.h" #include "net/socket/stream_socket.h" #include "net/spdy/bidirectional_stream_spdy_impl.h" @@ -360,16 +361,12 @@ return pool->HasActiveSocket(connection_group); } -bool HttpStreamFactory::Job::was_alpn_negotiated() const { - return was_alpn_negotiated_; -} - NextProto HttpStreamFactory::Job::negotiated_protocol() const { return negotiated_protocol_; } bool HttpStreamFactory::Job::using_spdy() const { - return using_spdy_; + return negotiated_protocol_ == kProtoHTTP2; } const ProxyInfo& HttpStreamFactory::Job::proxy_info() const { @@ -851,10 +848,6 @@ // actually need to preconnect any sockets, so we're done. if (job_type_ == PRECONNECT) return OK; - // TODO(crbug.com/1286835): Stop uing `was_alpn_negotiated_` and - // `using_spdy_`. - using_spdy_ = true; - was_alpn_negotiated_ = true; negotiated_protocol_ = kProtoHTTP2; next_state_ = STATE_CREATE_STREAM; return OK; @@ -1028,20 +1021,17 @@ // below. In the QUIC case, we only record it for origin connections. In // the TCP case, we also record it for non-tunneled, proxied requests. if (using_ssl_) { - // TODO(crbug.com/1286835): Stop uing `was_alpn_negotiated_`. - was_alpn_negotiated_ = true; negotiated_protocol_ = kProtoQUIC; } } else if (connection_->socket()->WasAlpnNegotiated()) { // Only connections that use TLS can negotiate ALPN. DCHECK(using_ssl_ || proxy_info_.is_secure_http_like()); - // TODO(crbug.com/1286835): Stop uing `was_alpn_negotiated_`. - was_alpn_negotiated_ = true; negotiated_protocol_ = connection_->socket()->GetNegotiatedProtocol(); + CHECK_NE(kProtoUnknown, negotiated_protocol_); net_log_.AddEvent(NetLogEventType::HTTP_STREAM_REQUEST_PROTO, [&] { return NetLogHttpStreamProtoParams(negotiated_protocol_); }); - if (negotiated_protocol_ == kProtoHTTP2) { + if (using_spdy()) { if (is_websocket_) { // WebSocket is not supported over a fresh HTTP/2 connection. This // should not be reachable. For the origin, we do not request HTTP/2 @@ -1055,8 +1045,6 @@ // and see if this is still needed. return ERR_NOT_IMPLEMENTED; } - // TODO(crbug.com/1286835): Stop uing `using_spdy_`. - using_spdy_ = true; } } } @@ -1064,8 +1052,9 @@ if (proxy_info_.is_quic() && using_quic_ && result < 0) return ReconsiderProxyAfterError(result); - if (expect_spdy_ && !using_spdy_) + if (expect_spdy_ && !using_spdy()) { return ERR_ALPN_NEGOTIATION_FAILED; + } // |result| may be the result of any of the stacked protocols. The following // logic is used when determining how to interpret an error. @@ -1148,7 +1137,7 @@ int HttpStreamFactory::Job::SetSpdyHttpStreamOrBidirectionalStreamImpl( base::WeakPtr<SpdySession> session) { - DCHECK(using_spdy_); + DCHECK(using_spdy()); auto dns_aliases = session_->spdy_session_pool()->GetDnsAliasesForSessionKey( spdy_session_key_); @@ -1189,7 +1178,7 @@ next_state_ = STATE_CREATE_STREAM_COMPLETE; - if (!using_spdy_) { + if (!using_spdy()) { DCHECK(!expect_spdy_); bool using_proxy = (proxy_info_.is_http_like()) && request_info_.url.SchemeIs(url::kHttpScheme); @@ -1218,7 +1207,7 @@ // last time Job checked above. if (!existing_spdy_session_) { // WebSocket over HTTP/2 is only allowed to use existing HTTP/2 connections. - // Therefore |using_spdy_| could not have been set unless a connection had + // Therefore `using_spdy()` could not have been set unless a connection had // already been found. DCHECK(!is_websocket_); @@ -1305,10 +1294,6 @@ return; } - // TODO(crbug.com/1286835): Stop uing `was_alpn_negotiated_` and - // `using_spdy_`. - using_spdy_ = true; - was_alpn_negotiated_ = true; negotiated_protocol_ = kProtoHTTP2; existing_spdy_session_ = spdy_session; next_state_ = STATE_CREATE_STREAM;
diff --git a/net/http/http_stream_factory_job.h b/net/http/http_stream_factory_job.h index 06d6d00e..52b9e78 100644 --- a/net/http/http_stream_factory_job.h +++ b/net/http/http_stream_factory_job.h
@@ -205,9 +205,7 @@ const GURL& origin_url() const { return origin_url_; } RequestPriority priority() const { return priority_; } - bool was_alpn_negotiated() const; NextProto negotiated_protocol() const; - bool using_spdy() const; const NetLogWithSource& net_log() const { return net_log_; } HttpStreamRequest::StreamType stream_type() const { return stream_type_; } @@ -366,6 +364,11 @@ // connection attempt to be made to an H2 server at a time. bool ShouldThrottleConnectForSpdy() const; + // True if Job actually uses HTTP/2. Note this describes both using HTTP/2 + // with an HTTPS origin, and proxying a cleartext HTTP request over an HTTP/2 + // proxy. This differs from `using_ssl_`, which only describes the origin. + bool using_spdy() const; + const HttpRequestInfo request_info_; RequestPriority priority_; const ProxyInfo proxy_info_; @@ -405,7 +408,7 @@ // True if handling a HTTPS request. Note this only describes the origin URL. // If false (an HTTP request), the request may still be sent over an HTTPS - // proxy. This differs from `using_quic_` and `using_spdy_`, which also + // proxy. This differs from `using_quic_` and `using_spdy()`, which also // describe some proxy cases. const bool using_ssl_; @@ -423,11 +426,6 @@ // the server does not negotiate HTTP/2 on a new socket. const bool expect_spdy_; - // True if Job actually uses HTTP/2. Note this describes both using HTTP/2 - // with an HTTPS origin, and proxying a cleartext HTTP request over an HTTP/2 - // proxy. This differs from `using_ssl_`, which only describes the origin. - bool using_spdy_ = false; - // True if this job might succeed with a different proxy config. bool should_reconsider_proxy_ = false; @@ -452,9 +450,6 @@ std::unique_ptr<WebSocketHandshakeStreamBase> websocket_stream_; std::unique_ptr<BidirectionalStreamImpl> bidirectional_stream_impl_; - // True if we negotiated ALPN. - bool was_alpn_negotiated_ = false; - // Protocol negotiated with the server. NextProto negotiated_protocol_ = kProtoUnknown;
diff --git a/net/http/http_stream_factory_job_controller.cc b/net/http/http_stream_factory_job_controller.cc index 9573c00..640cc2c 100644 --- a/net/http/http_stream_factory_job_controller.cc +++ b/net/http/http_stream_factory_job_controller.cc
@@ -1056,8 +1056,7 @@ if (request_) { AlternateProtocolUsage alternate_protocol_usage = CalculateAlternateProtocolUsage(job); - request_->Complete(job->was_alpn_negotiated(), job->negotiated_protocol(), - alternate_protocol_usage, job->using_spdy()); + request_->Complete(job->negotiated_protocol(), alternate_protocol_usage); ReportAlternateProtocolUsage(alternate_protocol_usage, HasGoogleHost(job->origin_url())); }
diff --git a/net/http/http_stream_request.cc b/net/http/http_stream_request.cc index 1d83967..82193af 100644 --- a/net/http/http_stream_request.cc +++ b/net/http/http_stream_request.cc
@@ -39,16 +39,12 @@ } void HttpStreamRequest::Complete( - bool was_alpn_negotiated, NextProto negotiated_protocol, - AlternateProtocolUsage alternate_protocol_usage, - bool using_spdy) { + AlternateProtocolUsage alternate_protocol_usage) { DCHECK(!completed_); completed_ = true; - was_alpn_negotiated_ = was_alpn_negotiated; negotiated_protocol_ = negotiated_protocol; alternate_protocol_usage_ = alternate_protocol_usage; - using_spdy_ = using_spdy; } int HttpStreamRequest::RestartTunnelWithProxyAuth() { @@ -63,11 +59,6 @@ return helper_->GetLoadState(); } -bool HttpStreamRequest::was_alpn_negotiated() const { - DCHECK(completed_); - return was_alpn_negotiated_; -} - NextProto HttpStreamRequest::negotiated_protocol() const { DCHECK(completed_); return negotiated_protocol_; @@ -78,11 +69,6 @@ return alternate_protocol_usage_; } -bool HttpStreamRequest::using_spdy() const { - DCHECK(completed_); - return using_spdy_; -} - const ConnectionAttempts& HttpStreamRequest::connection_attempts() const { return connection_attempts_; }
diff --git a/net/http/http_stream_request.h b/net/http/http_stream_request.h index 2df0199..7f01dce 100644 --- a/net/http/http_stream_request.h +++ b/net/http/http_stream_request.h
@@ -179,10 +179,8 @@ void SetPriority(RequestPriority priority); // Marks completion of the request. Must be called before OnStreamReady(). - void Complete(bool was_alpn_negotiated, - NextProto negotiated_protocol, - AlternateProtocolUsage alternate_protocol_usage, - bool using_spdy); + void Complete(NextProto negotiated_protocol, + AlternateProtocolUsage alternate_protocol_usage); // Called by |helper_| to record connection attempts made by the socket // layer in an attached Job for this stream request. @@ -191,9 +189,6 @@ // Returns the LoadState for the request. LoadState GetLoadState() const; - // Returns true if TLS/ALPN was negotiated for this stream. - bool was_alpn_negotiated() const; - // Protocol negotiated with the server. NextProto negotiated_protocol() const; @@ -201,9 +196,6 @@ // semantics. AlternateProtocolUsage alternate_protocol_usage() const; - // Returns true if this stream is being fetched over SPDY. - bool using_spdy() const; - // Returns socket-layer connection attempts made for this stream request. const ConnectionAttempts& connection_attempts() const; @@ -232,14 +224,12 @@ const NetLogWithSource net_log_; bool completed_ = false; - bool was_alpn_negotiated_ = false; // Protocol negotiated with the server. NextProto negotiated_protocol_ = kProtoUnknown; // The reason why Chrome uses a specific transport protocol for HTTP // semantics. AlternateProtocolUsage alternate_protocol_usage_ = AlternateProtocolUsage::ALTERNATE_PROTOCOL_USAGE_UNSPECIFIED_REASON; - bool using_spdy_ = false; ConnectionAttempts connection_attempts_; const StreamType stream_type_; };
diff --git a/ppapi/nacl_irt/ppapi_dispatcher.cc b/ppapi/nacl_irt/ppapi_dispatcher.cc index 8d021f9..6ff282f 100644 --- a/ppapi/nacl_irt/ppapi_dispatcher.cc +++ b/ppapi/nacl_irt/ppapi_dispatcher.cc
@@ -172,7 +172,7 @@ logging::InitLogging(settings); base::FeatureList::ClearInstanceForTesting(); - base::FeatureList::InitializeInstance( + base::FeatureList::InitInstance( base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kEnableFeatures), base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
diff --git a/remoting/base/protobuf_http_client_test_messages.proto b/remoting/base/protobuf_http_client_test_messages.proto index 118f0b46..48a4319a3 100644 --- a/remoting/base/protobuf_http_client_test_messages.proto +++ b/remoting/base/protobuf_http_client_test_messages.proto
@@ -15,3 +15,10 @@ message EchoResponse { string text = 1; } + +// Message with the same fields as the valid stream body, but with the wrong +// wire type. +message InvalidStreamBody { + int32 messages = 1; + int64 status = 2; +}
diff --git a/remoting/base/protobuf_http_stream_parser.cc b/remoting/base/protobuf_http_stream_parser.cc index 6bc23d9e..a7de4a71 100644 --- a/remoting/base/protobuf_http_stream_parser.cc +++ b/remoting/base/protobuf_http_stream_parser.cc
@@ -7,6 +7,7 @@ #include <string.h> #include "base/logging.h" +#include "base/strings/stringprintf.h" #include "net/base/io_buffer.h" #include "remoting/base/protobuf_http_client_messages.pb.h" #include "remoting/base/protobuf_http_status.h" @@ -117,7 +118,9 @@ int field_number = WireFormatLite::GetTagFieldNumber(message_tag); switch (field_number) { case protobufhttpclient::StreamBody::kMessagesFieldNumber: { - DCHECK_EQ(WireFormatLite::WireType::WIRETYPE_LENGTH_DELIMITED, wire_type); + if (!ValidateWireType(field_number, wire_type)) { + break; + } std::string message; if (!WireFormatLite::ReadBytes(input_stream, &message)) { VLOG(1) << "Can't read stream message yet."; @@ -129,7 +132,9 @@ } case protobufhttpclient::StreamBody::kStatusFieldNumber: { - DCHECK_EQ(WireFormatLite::WireType::WIRETYPE_LENGTH_DELIMITED, wire_type); + if (!ValidateWireType(field_number, wire_type)) { + break; + } protobufhttpclient::Status status; if (!WireFormatLite::ReadMessage(input_stream, &status)) { VLOG(1) << "Can't read status yet."; @@ -157,4 +162,19 @@ return true; } +bool ProtobufHttpStreamParser::ValidateWireType( + int field_number, + WireFormatLite::WireType wire_type) { + if (wire_type == WireFormatLite::WireType::WIRETYPE_LENGTH_DELIMITED) { + return true; + } + auto error_message = base::StringPrintf( + "Invalid wire type %d for field number %d", wire_type, field_number); + LOG(WARNING) << error_message; + std::move(stream_closed_callback_) + .Run( + ProtobufHttpStatus(ProtobufHttpStatus::Code::UNKNOWN, error_message)); + return false; +} + } // namespace remoting
diff --git a/remoting/base/protobuf_http_stream_parser.h b/remoting/base/protobuf_http_stream_parser.h index a1332b6..6ad3f9b 100644 --- a/remoting/base/protobuf_http_stream_parser.h +++ b/remoting/base/protobuf_http_stream_parser.h
@@ -10,6 +10,7 @@ #include "base/functional/callback.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" +#include "third_party/protobuf/src/google/protobuf/wire_format_lite.h" namespace google { namespace protobuf { @@ -54,6 +55,11 @@ void ParseStreamIfAvailable(); bool ParseOneField(google::protobuf::io::CodedInputStream* input_stream); + // This also closes the stream if the wire type is invalid. + bool ValidateWireType( + int field_number, + google::protobuf::internal::WireFormatLite::WireType wire_type); + MessageCallback message_callback_; StreamClosedCallback stream_closed_callback_; scoped_refptr<net::GrowableIOBuffer> read_buffer_;
diff --git a/remoting/base/protobuf_http_stream_parser_unittest.cc b/remoting/base/protobuf_http_stream_parser_unittest.cc index 7102f9f..9989151 100644 --- a/remoting/base/protobuf_http_stream_parser_unittest.cc +++ b/remoting/base/protobuf_http_stream_parser_unittest.cc
@@ -9,6 +9,7 @@ #include "base/test/mock_callback.h" #include "remoting/base/protobuf_http_client_messages.pb.h" +#include "remoting/base/protobuf_http_client_test_messages.pb.h" #include "remoting/base/protobuf_http_status.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -126,4 +127,24 @@ ASSERT_FALSE(stream_parser_.HasPendingData()); } +TEST_F(ProtobufHttpStreamParserTest, + ParseStreamBodyWithInvalidMessages_StreamIsClosed) { + EXPECT_CALL(stream_closed_callback_, Run(_)); + + protobufhttpclienttest::InvalidStreamBody stream_body; + stream_body.set_messages(1); + std::string stream_data = stream_body.SerializeAsString(); + stream_parser_.Append(stream_data); +} + +TEST_F(ProtobufHttpStreamParserTest, + ParseStreamBodyWithInvalidStatus_StreamIsClosed) { + EXPECT_CALL(stream_closed_callback_, Run(_)); + + protobufhttpclienttest::InvalidStreamBody stream_body; + stream_body.set_status(2); + std::string stream_data = stream_body.SerializeAsString(); + stream_parser_.Append(stream_data); +} + } // namespace remoting
diff --git a/remoting/host/BUILD.gn b/remoting/host/BUILD.gn index 7d622ae..47d2030 100644 --- a/remoting/host/BUILD.gn +++ b/remoting/host/BUILD.gn
@@ -560,12 +560,18 @@ "linux/desktop_resizer_wayland.h", "linux/ei_event_watcher_glib.cc", "linux/ei_event_watcher_glib.h", + "linux/gnome_display_config.cc", + "linux/gnome_display_config.h", + "linux/gnome_display_config_dbus_client.cc", + "linux/gnome_display_config_dbus_client.h", "linux/input_injector_wayland.cc", "linux/input_injector_wayland.h", "linux/remote_desktop_portal.cc", "linux/remote_desktop_portal.h", "linux/remote_desktop_portal_injector.cc", "linux/remote_desktop_portal_injector.h", + "linux/scoped_glib.cc", + "linux/scoped_glib.h", "linux/wayland_connection.cc", "linux/wayland_connection.h", "linux/wayland_desktop_capturer.cc",
diff --git a/remoting/host/linux/BUILD.gn b/remoting/host/linux/BUILD.gn index cefbf97b..be9b878 100644 --- a/remoting/host/linux/BUILD.gn +++ b/remoting/host/linux/BUILD.gn
@@ -152,6 +152,7 @@ sources = [ "audio_pipe_reader_unittest.cc", "certificate_watcher_unittest.cc", + "gnome_display_config_dbus_client_unittest.cc", "unicode_to_keysym_unittest.cc", "x11_character_injector_unittest.cc", "x_server_clipboard_unittest.cc",
diff --git a/remoting/host/linux/gnome_display_config.cc b/remoting/host/linux/gnome_display_config.cc new file mode 100644 index 0000000..4ad84b2 --- /dev/null +++ b/remoting/host/linux/gnome_display_config.cc
@@ -0,0 +1,168 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "remoting/host/linux/gnome_display_config.h" + +#include "base/ranges/algorithm.h" +#include "base/types/cxx23_to_underlying.h" +#include "remoting/base/logging.h" +#include "third_party/webrtc/modules/portal/scoped_glib.h" + +namespace remoting { + +//////////////////////////////////////////////////////////////////////////////// +// GnomeDisplayConfig::MonitorInfo + +GnomeDisplayConfig::MonitorInfo::MonitorInfo() = default; +GnomeDisplayConfig::MonitorInfo::MonitorInfo( + const GnomeDisplayConfig::MonitorInfo&) = default; +GnomeDisplayConfig::MonitorInfo& GnomeDisplayConfig::MonitorInfo::operator=( + const GnomeDisplayConfig::MonitorInfo&) = default; +GnomeDisplayConfig::MonitorInfo::~MonitorInfo() = default; + +const GnomeDisplayConfig::MonitorMode* +GnomeDisplayConfig::MonitorInfo::GetCurrentMode() const { + for (auto& mode : modes) { + if (mode.is_current) { + return &mode; + } + } + return nullptr; +} + +//////////////////////////////////////////////////////////////////////////////// +// GnomeDisplayConfig + +GnomeDisplayConfig::GnomeDisplayConfig() = default; +GnomeDisplayConfig::GnomeDisplayConfig(const GnomeDisplayConfig&) = default; +GnomeDisplayConfig& GnomeDisplayConfig::operator=(const GnomeDisplayConfig&) = + default; +GnomeDisplayConfig::~GnomeDisplayConfig() = default; + +void GnomeDisplayConfig::AddMonitorFromVariant(GVariant* monitor) { + // With the Xorg "video_dummy" driver, the "Connector" value is the name of + // the X11 RANDR Output: "DUMMYnn". + webrtc::Scoped<char> connector; + webrtc::Scoped<GVariantIter> modes; + constexpr char kMonitorFormat[] = "((ssss)a(siiddada{sv})a{sv})"; + if (!g_variant_check_format_string(monitor, kMonitorFormat, + /*copy_only=*/FALSE)) { + LOG(ERROR) << __func__ << " : monitor has incorrect type."; + return; + } + + g_variant_get(monitor, kMonitorFormat, connector.receive(), + /*vendor=*/nullptr, /*product_name=*/nullptr, + /*product_serial=*/nullptr, modes.receive(), + /*properties=*/nullptr); + + MonitorInfo info; + + while (true) { + webrtc::Scoped<char> mode_id; + gint32 mode_width; + gint32 mode_height; + gdouble mode_refresh; + webrtc::Scoped<GVariant> mode_properties; + if (!g_variant_iter_next(modes.get(), "(siiddad@a{sv})", mode_id.receive(), + &mode_width, &mode_height, &mode_refresh, + /*preferred_scale=*/nullptr, + /*supported_scales=*/nullptr, + mode_properties.receive())) { + break; + } + + MonitorMode mode; + mode.name = mode_id.get(); + mode.width = mode_width; + mode.height = mode_height; + gboolean is_current = FALSE; + g_variant_lookup(mode_properties.get(), "is-current", "b", &is_current); + mode.is_current = is_current; + info.modes.push_back(std::move(mode)); + } + + // Each connector name should be unique, since it is used as an + // identifier by the ApplyMonitorsConfig DBus API. Since this information + // comes from an external API, it is better to cleanly overwrite any + // previous value, rather than risk duplicating some monitor-modes. + monitors[connector.get()] = info; +} + +void GnomeDisplayConfig::AddLogicalMonitorFromVariant( + GVariant* logical_monitor) { + gint32 x; + gint32 y; + gdouble scale; + gboolean primary; + webrtc::Scoped<GVariantIter> monitors_iter; + constexpr char kLogicalMonitorFormat[] = "(iiduba(ssss)a{sv})"; + if (!g_variant_check_format_string(logical_monitor, kLogicalMonitorFormat, + /*copy_only=*/FALSE)) { + LOG(ERROR) << __func__ << " : logical_monitor has incorrect type."; + return; + } + + g_variant_get(logical_monitor, kLogicalMonitorFormat, &x, &y, &scale, + /*rotation=*/nullptr, &primary, monitors_iter.receive(), + /*properties=*/nullptr); + gsize num_monitors = g_variant_iter_n_children(monitors_iter.get()); + if (num_monitors != 1) { + LOG(ERROR) << "Logical monitor has unexpected number of monitors: " + << num_monitors; + return; + } + + webrtc::Scoped<char> connector; + bool result = g_variant_iter_next(monitors_iter.get(), "(ssss)", + connector.receive(), /*vendor=*/nullptr, + /*product=*/nullptr, /*serial=*/nullptr); + if (!result) { + LOG(ERROR) << "Failed to read monitor properties."; + return; + } + + MonitorInfo& info = monitors[connector.get()]; + info.x = x; + info.y = y; + info.scale = scale; + info.is_primary = primary; +} + +ScopedGVariant GnomeDisplayConfig::BuildMonitorsConfigParameters() const { + GVariantBuilder logical_monitors_builder; + g_variant_builder_init(&logical_monitors_builder, + G_VARIANT_TYPE("a(iiduba(ssa{sv}))")); + for (const auto& [id, monitor] : monitors) { + const auto* mode = monitor.GetCurrentMode(); + if (!mode) { + // This monitor is disabled, and should be skipped. GNOME will disable + // monitors that are not provided in the ApplyMonitorConfig() request. + continue; + } + + gint x = monitor.x; + gint y = monitor.y; + gdouble scale = monitor.scale; + guint transform = 0; // No rotation/reflection. + gboolean is_primary = monitor.is_primary; + GVariantBuilder monitor_list_builder; + g_variant_builder_init(&monitor_list_builder, G_VARIANT_TYPE("a(ssa{sv})")); + + const gchar* connector = id.c_str(); + const gchar* mode_id = mode->name.c_str(); + g_variant_builder_add(&monitor_list_builder, "(ssa{sv})", connector, + mode_id, nullptr); + + g_variant_builder_add(&logical_monitors_builder, "(iiduba(ssa{sv}))", x, y, + scale, transform, is_primary, &monitor_list_builder); + } + + return TakeGVariant(g_variant_new("(uua(iiduba(ssa{sv}))a{sv})", serial, + base::to_underlying(method), + &logical_monitors_builder, + /*properties=*/nullptr)); +} + +} // namespace remoting
diff --git a/remoting/host/linux/gnome_display_config.h b/remoting/host/linux/gnome_display_config.h new file mode 100644 index 0000000..d3a6dcb --- /dev/null +++ b/remoting/host/linux/gnome_display_config.h
@@ -0,0 +1,93 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef REMOTING_HOST_LINUX_GNOME_DISPLAY_CONFIG_H_ +#define REMOTING_HOST_LINUX_GNOME_DISPLAY_CONFIG_H_ + +#include <gio/gio.h> + +#include <map> +#include <string> +#include <vector> + +#include "remoting/host/linux/scoped_glib.h" + +namespace remoting { + +// This object stores information returned from GNOME's D-Bus API: +// org.gnome.Mutter.DisplayConfig.GetCurrentState(). The API returns information +// as GObject types (GVariant and so on), and this class provides helper +// methods to convert this to C++ types. The caller can read and modify this C++ +// data directly. A helper method can then be used to build a GVariant that can +// be passed to the D-Bus method: +// org.gnome.Mutter.DisplayConfig.ApplyMonitorsConfig(). +struct GnomeDisplayConfig { + // Type of the "method" parameter in the ApplyMonitorsConfig() API. The + // valid values are documented in the XML schema. + enum class Method : guint { + kVerify = 0, + kTemporary = 1, + kPersistent = 2, + }; + + struct MonitorMode { + std::string name; + int width; + int height; + bool is_current; + }; + + struct MonitorInfo { + MonitorInfo(); + MonitorInfo(const MonitorInfo&); + MonitorInfo& operator=(const MonitorInfo&); + ~MonitorInfo(); + + // Returns the first mode with is_current set, or nullptr. + const MonitorMode* GetCurrentMode() const; + + std::vector<MonitorMode> modes; + int x = 0; + int y = 0; + double scale = 1.0; + bool is_primary = false; + }; + + GnomeDisplayConfig(); + GnomeDisplayConfig(const GnomeDisplayConfig&); + GnomeDisplayConfig& operator=(const GnomeDisplayConfig&); + ~GnomeDisplayConfig(); + + // Called for each entry of the 'monitors' property returned by D-Bus + // GetCurrentState(). + void AddMonitorFromVariant(GVariant* monitor); + + // Called for each entry of the 'logical_monitors' property returned by D-Bus + // GetCurrentState(). Each logical monitor is assumed to have a single + // physical monitor (identified by connector-name), previously added by + // AddMonitorFromVariant(). + void AddLogicalMonitorFromVariant(GVariant* logical_monitor); + + // This converts the C++ data into a GVariant `logical_monitors` parameter + // to pass to D-Bus ApplyMonitorsConfig(). + ScopedGVariant BuildMonitorsConfigParameters() const; + + // The serial number returned by GNOME. When applying a new monitor config, + // GNOME will check that the serial number matches, to avoid race-conditions + // from trying to modify a stale config. + guint serial = 0; + + // This property is returned by the GNOME API. If true, GNOME will enforce + // that all monitors have the same scale property. + bool global_scale_required = false; + + // The "method" parameter to pass to the ApplyMonitorsConfig() API. + Method method = Method::kPersistent; + + std::map<std::string, MonitorInfo> monitors; +}; + +} // namespace remoting + +#endif // REMOTING_HOST_LINUX_GNOME_DISPLAY_CONFIG_H_
diff --git a/remoting/host/linux/gnome_display_config_dbus_client.cc b/remoting/host/linux/gnome_display_config_dbus_client.cc new file mode 100644 index 0000000..0d738f6 --- /dev/null +++ b/remoting/host/linux/gnome_display_config_dbus_client.cc
@@ -0,0 +1,244 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "remoting/host/linux/gnome_display_config_dbus_client.h" + +#include <string> +#include <utility> + +#include "base/ranges/algorithm.h" +#include "remoting/base/logging.h" +#include "third_party/webrtc/modules/portal/scoped_glib.h" + +namespace remoting { + +namespace { + +constexpr char kDisplayConfigInterfaceName[] = "org.gnome.Mutter.DisplayConfig"; +constexpr char kDisplayConfigObjectPath[] = "/org/gnome/Mutter/DisplayConfig"; + +std::string VariantToString(GVariant* variant) { + webrtc::Scoped<char> print_result(g_variant_print(variant, FALSE)); + if (print_result) { + return print_result.get(); + } else { + return std::string(); + } +} + +} // namespace + +GnomeDisplayConfigDBusClient::GnomeDisplayConfigDBusClient() { + weak_ptr_ = weak_factory_.GetWeakPtr(); + DETACH_FROM_SEQUENCE(sequence_checker_); +} + +GnomeDisplayConfigDBusClient::~GnomeDisplayConfigDBusClient() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (cancellable_) { + g_cancellable_cancel(cancellable_.get()); + } +} + +void GnomeDisplayConfigDBusClient::Init() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + caller_task_runner_ = base::SequencedTaskRunner::GetCurrentDefault(); + cancellable_ = TakeGObject(g_cancellable_new()); + g_bus_get(G_BUS_TYPE_SESSION, cancellable_.get(), + &GnomeDisplayConfigDBusClient::OnDBusGetReply, this); +} + +void GnomeDisplayConfigDBusClient::GetMonitorsConfig( + GnomeDisplayConfigDBusClient::Callback callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (!dbus_connection_) { + // The DBus connection is not yet made. When the connection is made, + // OnDBusGet() will check if there is any pending callback. If so, it + // will trigger a new call to the DBus GetCurrentState() method. + pending_callback_ = std::move(callback); + return; + } + + bool need_new_call = pending_callback_.is_null(); + pending_callback_ = std::move(callback); + if (need_new_call) { + CallDBusGetCurrentState(); + } +} + +void GnomeDisplayConfigDBusClient::ApplyMonitorsConfig( + GnomeDisplayConfig config) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + ScopedGVariant parameters = config.BuildMonitorsConfigParameters(); + HOST_LOG << "Applying monitors config: " << VariantToString(parameters.get()); + g_dbus_connection_call( + dbus_connection_.get(), kDisplayConfigInterfaceName, + kDisplayConfigObjectPath, kDisplayConfigInterfaceName, + "ApplyMonitorsConfig", parameters.get(), + /*reply_type=*/nullptr, G_DBUS_CALL_FLAGS_NO_AUTO_START, + /*timeout_msec=*/-1, cancellable_.get(), + &GnomeDisplayConfigDBusClient::OnApplyMonitorsConfigReply, this); +} + +void GnomeDisplayConfigDBusClient::FakeDisplayConfigForTest( + ScopedGVariant config) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + OnDisplayConfigCurrentState(std::move(config)); +} + +// static +void GnomeDisplayConfigDBusClient::OnDBusGetReply(GObject* object, + GAsyncResult* result, + gpointer user_data) { + webrtc::Scoped<GError> error; + ScopedGObject<GDBusConnection> dbus_connection = + TakeGObject(g_bus_get_finish(result, error.receive())); + if (!dbus_connection) { + LOG(ERROR) << "Failed to connect to the D-Bus session bus: " + << error->message; + return; + } + + auto* that = static_cast<GnomeDisplayConfigDBusClient*>(user_data); + that->caller_task_runner_->PostTask( + FROM_HERE, base::BindOnce(&GnomeDisplayConfigDBusClient::OnDBusGet, + that->weak_ptr_, std::move(dbus_connection))); +} + +// static +void GnomeDisplayConfigDBusClient::OnDisplayConfigCurrentStateReply( + GObject* object, + GAsyncResult* result, + gpointer user_data) { + auto* connection = reinterpret_cast<GDBusConnection*>(object); + webrtc::Scoped<GError> error; + ScopedGVariant config = TakeGVariant( + g_dbus_connection_call_finish(connection, result, error.receive())); + + auto* that = static_cast<GnomeDisplayConfigDBusClient*>(user_data); + + if (!config) { + LOG(ERROR) << "Failed to get current display configuration: " + << error->message; + that->caller_task_runner_->PostTask( + FROM_HERE, + base::BindOnce( + &GnomeDisplayConfigDBusClient::OnDisplayConfigCurrentStateError, + that->weak_ptr_)); + return; + } + + that->caller_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&GnomeDisplayConfigDBusClient::OnDisplayConfigCurrentState, + that->weak_ptr_, std::move(config))); +} + +// static +void GnomeDisplayConfigDBusClient::OnApplyMonitorsConfigReply( + GObject* source_object, + GAsyncResult* result, + gpointer user_data) { + auto* connection = reinterpret_cast<GDBusConnection*>(source_object); + webrtc::Scoped<GError> error; + ScopedGVariant method_result = TakeGVariant( + g_dbus_connection_call_finish(connection, result, error.receive())); + if (!method_result) { + LOG(ERROR) << "Failed to apply monitors config: " << error->message; + } +} + +void GnomeDisplayConfigDBusClient::CallDBusGetCurrentState() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(dbus_connection_.get()); + g_dbus_connection_call( + dbus_connection_.get(), kDisplayConfigInterfaceName, + kDisplayConfigObjectPath, kDisplayConfigInterfaceName, "GetCurrentState", + /*parameters=*/nullptr, + /*reply_type=*/nullptr, G_DBUS_CALL_FLAGS_NO_AUTO_START, + /*timeout_msec=*/-1, cancellable_.get(), + &GnomeDisplayConfigDBusClient::OnDisplayConfigCurrentStateReply, this); +} + +void GnomeDisplayConfigDBusClient::OnDBusGet( + ScopedGObject<GDBusConnection> dbus_connection) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + dbus_connection_ = std::move(dbus_connection); + HOST_LOG << "Got session D-Bus"; + + if (pending_callback_) { + CallDBusGetCurrentState(); + } +} + +void GnomeDisplayConfigDBusClient::OnDisplayConfigCurrentState( + ScopedGVariant config) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + std::string pretty_config = VariantToString(config.get()); + if (!pretty_config.empty()) { + HOST_LOG << "Got current display config: " << pretty_config; + } else { + LOG(ERROR) << "Unable to print display config"; + } + + GnomeDisplayConfig display_config; + + webrtc::Scoped<GVariantIter> monitors; + webrtc::Scoped<GVariantIter> logical_monitors; + webrtc::Scoped<GVariant> properties; + + constexpr char kCurrentStateFormat[] = + "(u" // serial + "a((ssss)a(siiddada{sv})a{sv})" // monitors + "a(iiduba(ssss)a{sv})" // logical_monitors + "@a{sv})"; // properties + + if (!g_variant_check_format_string(config.get(), kCurrentStateFormat, + /*copy_only=*/FALSE)) { + LOG(ERROR) << __func__ << " : config has incorrect type."; + pending_callback_.Reset(); + return; + } + + g_variant_get(config.get(), kCurrentStateFormat, &display_config.serial, + monitors.receive(), logical_monitors.receive(), + properties.receive()); + + while (true) { + webrtc::Scoped<GVariant> monitor; + if (!g_variant_iter_next(monitors.get(), "@((ssss)a(siiddada{sv})a{sv})", + monitor.receive())) { + break; + } + display_config.AddMonitorFromVariant(monitor.get()); + } + + while (true) { + webrtc::Scoped<GVariant> logical_monitor; + if (!g_variant_iter_next(logical_monitors.get(), "@(iiduba(ssss)a{sv})", + logical_monitor.receive())) { + break; + } + display_config.AddLogicalMonitorFromVariant(logical_monitor.get()); + } + + gboolean global_scale_required = FALSE; + g_variant_lookup(properties.get(), "global-scale-required", "b", + &global_scale_required); + display_config.global_scale_required = global_scale_required; + HOST_LOG << "Global scale required: " + << (global_scale_required ? "yes" : "no"); + + std::move(pending_callback_).Run(display_config); +} + +void GnomeDisplayConfigDBusClient::OnDisplayConfigCurrentStateError() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + // Reset the callback, so that subsequent calls to GetMonitorsConfig() will + // actually send a D-Bus request. + pending_callback_.Reset(); +} + +} // namespace remoting
diff --git a/remoting/host/linux/gnome_display_config_dbus_client.h b/remoting/host/linux/gnome_display_config_dbus_client.h new file mode 100644 index 0000000..3eae444 --- /dev/null +++ b/remoting/host/linux/gnome_display_config_dbus_client.h
@@ -0,0 +1,103 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef REMOTING_HOST_LINUX_GNOME_DISPLAY_CONFIG_DBUS_CLIENT_H_ +#define REMOTING_HOST_LINUX_GNOME_DISPLAY_CONFIG_DBUS_CLIENT_H_ + +#include <gio/gio.h> + +#include "base/functional/callback.h" +#include "base/memory/weak_ptr.h" +#include "base/sequence_checker.h" +#include "base/task/sequenced_task_runner.h" +#include "remoting/host/linux/gnome_display_config.h" +#include "remoting/host/linux/scoped_glib.h" +#include "ui/base/glib/scoped_gobject.h" + +namespace remoting { + +// This class provides a wrapper for the GNOME D-Bus API for querying the +// current display (monitor) configuration, and for applying a modified config. +// This wrapper never blocks the caller thread - the caller provides a +// OnceCallback to receive the current config. The caller can modify the +// returned GnomeDisplayConfig structure, and then ask GNOME to apply the +// changes. Note that applying a display config will take effect immediately, +// but will also cause GNOME to display a warning which allows the user to keep +// or revert the changes. +// +// Instances of this class only support a single callback at a time - later +// requests will cancel earlier ones. Changes to GNOME's display config +// should be infrequent, and if multiple operations are ongoing, only the +// latest operation should take effect. +class GnomeDisplayConfigDBusClient { + public: + using Callback = base::OnceCallback<void(GnomeDisplayConfig)>; + + GnomeDisplayConfigDBusClient(); + GnomeDisplayConfigDBusClient(const GnomeDisplayConfigDBusClient&) = delete; + GnomeDisplayConfigDBusClient& operator=(const GnomeDisplayConfigDBusClient&) = + delete; + ~GnomeDisplayConfigDBusClient(); + + // Initializes the object by requesting a D-Bus connection. This should be + // called on the same thread as all other public methods, including the dtor. + // The private static methods get called by GLib and may execute on a + // different thread. + void Init(); + + // Request the latest config from GNOME. On success, the config will be + // provided to the callback. + void GetMonitorsConfig(Callback callback); + + // Requests GNOME to apply a new config. If successful, the change will + // take immediate effect, but the user may see a popup window and they may + // choose to revert back to the previous settings. + void ApplyMonitorsConfig(GnomeDisplayConfig config); + + // Fakes a GetCurrentState() response from GNOME. This allows unittests to + // exercise this code without relying on GNOME or DBus services. + void FakeDisplayConfigForTest(ScopedGVariant config); + + private: + static void OnDBusGetReply(GObject* source_object, + GAsyncResult* result, + gpointer user_data); + static void OnDisplayConfigCurrentStateReply(GObject* source_object, + GAsyncResult* result, + gpointer user_data); + static void OnApplyMonitorsConfigReply(GObject* source_object, + GAsyncResult* result, + gpointer user_data); + + // Starts an async call to the DBus GetCurrentState() method. + void CallDBusGetCurrentState(); + + // Called by OnDBusGetReply(). + void OnDBusGet(ScopedGObject<GDBusConnection> dbus_connection); + + // Called by OnDisplayConfigCurrentStateReply(). + void OnDisplayConfigCurrentState(ScopedGVariant config); + + // Called by OnDisplayConfigCurrentStateReply() on error. + void OnDisplayConfigCurrentStateError(); + + base::WeakPtr<GnomeDisplayConfigDBusClient> weak_ptr_; + + scoped_refptr<base::SequencedTaskRunner> caller_task_runner_; + + ScopedGObject<GCancellable> cancellable_ + GUARDED_BY_CONTEXT(sequence_checker_); + ScopedGObject<GDBusConnection> dbus_connection_ + GUARDED_BY_CONTEXT(sequence_checker_); + + Callback pending_callback_ GUARDED_BY_CONTEXT(sequence_checker_); + + SEQUENCE_CHECKER(sequence_checker_); + + base::WeakPtrFactory<GnomeDisplayConfigDBusClient> weak_factory_{this}; +}; + +} // namespace remoting + +#endif // REMOTING_HOST_LINUX_GNOME_DISPLAY_CONFIG_DBUS_CLIENT_H_
diff --git a/remoting/host/linux/gnome_display_config_dbus_client_unittest.cc b/remoting/host/linux/gnome_display_config_dbus_client_unittest.cc new file mode 100644 index 0000000..328a9a7 --- /dev/null +++ b/remoting/host/linux/gnome_display_config_dbus_client_unittest.cc
@@ -0,0 +1,161 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "remoting/host/linux/gnome_display_config_dbus_client.h" + +#include "base/run_loop.h" +#include "base/test/task_environment.h" +#include "remoting/host/linux/scoped_glib.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/webrtc/modules/portal/scoped_glib.h" + +namespace remoting { + +namespace { + +// The return type of the D-Bus method +// org.gnome.Mutter.DisplayConfig.GetCurrentState(). +constexpr char kDisplayConfigType[] = + "(u" // serial + "a((ssss)a(siiddada{sv})a{sv})" // monitors + "a(iiduba(ssss)a{sv})" // logical_monitors + "a{sv})"; // properties + +// These strings are based on calling g_variant_print() on GVariants returned +// by the D-Bus API. The format is accepted by g_variant_parse(), as long as +// the correct type is provided. +constexpr char kSingleDisplayConfig[] = + "(123, [(('DUMMY0', 'unknown', 'unknown', 'unknown'), [('1024x768@60', " + "1024, 768, 60.0, 1.0, [1.0], {'is-current': <true>}), ('800x600@60', 800, " + "600, 60.0, 1.0, [1.0], {})], {})], [(0, 0, 1.0, 0, true, [('DUMMY0', " + "'unknown', 'unknown', 'unknown')], {})], {'global-scale-required': " + "<true>})"; +constexpr char kDualDisplayConfig[] = + "(124, [(('DUMMY0', 'unknown', 'unknown', 'unknown'), [('800x600@60', 800, " + "600, 60.0, 1.0, [1.0], {}), ('1600x1200@60', 1600, 1200, 60.0, 1.0, [1.0, " + "2.0], {'is-current': <true>})], {}), (('DUMMY1', 'unknown', 'unknown', " + "'unknown'), [('800x600@60', 800, 600, 60.0, 1.0, [1.0], {'is-current': " + "<true>}), ('1600x1200@60', 1600, 1200, 60.0, 1.0, [1.0, 2.0], {})], {})], " + "[(0, 0, 1.0, 0, true, [('DUMMY0', 'unknown', 'unknown', 'unknown')], {}), " + "(1600, 500, 1.0, 0, false, [('DUMMY1', 'unknown', 'unknown', 'unknown')], " + "{})], {'global-scale-required': <true>})"; + +ScopedGVariant CreateDisplayConfig(const char* serialized) { + webrtc::Scoped<GError> error; + auto variant = TakeGVariant(g_variant_parse( + G_VARIANT_TYPE(kDisplayConfigType), serialized, /*limit=*/nullptr, + /*endptr=*/nullptr, error.receive())); + if (error) { + ADD_FAILURE() << "g_variant_parse: " << error->message; + } + return variant; +} + +} // namespace + +class GnomeDisplayConfigDBusClientTest : public testing::Test { + protected: + base::test::SingleThreadTaskEnvironment task_environment_{ + base::test::TaskEnvironment::TimeSource::MOCK_TIME}; +}; + +TEST_F(GnomeDisplayConfigDBusClientTest, GetMonitorsConfigReturnsCorrectInfo) { + base::RunLoop run_loop; + GnomeDisplayConfigDBusClient client; + client.Init(); + + auto callback = [](GnomeDisplayConfig config) { + EXPECT_EQ(123U, config.serial); + EXPECT_TRUE(config.global_scale_required); + ASSERT_EQ(1U, config.monitors.count("DUMMY0")); + const auto& monitor = config.monitors["DUMMY0"]; + EXPECT_EQ(0, monitor.x); + EXPECT_EQ(0, monitor.y); + EXPECT_EQ(1.0, monitor.scale); + EXPECT_TRUE(monitor.is_primary); + ASSERT_EQ(2U, monitor.modes.size()); + const auto& mode1 = monitor.modes[0]; + const auto& mode2 = monitor.modes[1]; + EXPECT_EQ("1024x768@60", mode1.name); + EXPECT_EQ(1024, mode1.width); + EXPECT_EQ(768, mode1.height); + EXPECT_TRUE(mode1.is_current); + EXPECT_EQ("800x600@60", mode2.name); + EXPECT_EQ(800, mode2.width); + EXPECT_EQ(600, mode2.height); + EXPECT_FALSE(mode2.is_current); + }; + client.GetMonitorsConfig( + base::BindOnce(callback).Then(run_loop.QuitClosure())); + + ScopedGVariant config = CreateDisplayConfig(kSingleDisplayConfig); + ASSERT_NE(config.get(), nullptr); + client.FakeDisplayConfigForTest(std::move(config)); + + run_loop.Run(); +} + +TEST_F(GnomeDisplayConfigDBusClientTest, CorrectInfoForSecondMonitor) { + base::RunLoop run_loop; + GnomeDisplayConfigDBusClient client; + client.Init(); + + auto callback = [](GnomeDisplayConfig config) { + EXPECT_EQ(124U, config.serial); + ASSERT_EQ(1U, config.monitors.count("DUMMY1")); + const auto& monitor = config.monitors["DUMMY1"]; + EXPECT_EQ(1600, monitor.x); + EXPECT_EQ(500, monitor.y); + EXPECT_EQ(1.0, monitor.scale); + EXPECT_FALSE(monitor.is_primary); + ASSERT_EQ(2U, monitor.modes.size()); + const auto& mode1 = monitor.modes[0]; + const auto& mode2 = monitor.modes[1]; + EXPECT_EQ("800x600@60", mode1.name); + EXPECT_EQ(800, mode1.width); + EXPECT_EQ(600, mode1.height); + EXPECT_TRUE(mode1.is_current); + EXPECT_EQ("1600x1200@60", mode2.name); + EXPECT_EQ(1600, mode2.width); + EXPECT_EQ(1200, mode2.height); + EXPECT_FALSE(mode2.is_current); + }; + client.GetMonitorsConfig( + base::BindOnce(callback).Then(run_loop.QuitClosure())); + + ScopedGVariant config = CreateDisplayConfig(kDualDisplayConfig); + ASSERT_NE(config.get(), nullptr); + client.FakeDisplayConfigForTest(std::move(config)); + + run_loop.Run(); +} + +TEST_F(GnomeDisplayConfigDBusClientTest, CorrectConfigBuiltForGnome) { + GnomeDisplayConfig::MonitorMode mode; + mode.name = "800x600"; + mode.width = 800; + mode.height = 600; + mode.is_current = true; + + GnomeDisplayConfig::MonitorInfo dummy0; + dummy0.x = 10; + dummy0.y = 20; + dummy0.scale = 1.0; + dummy0.is_primary = true; + dummy0.modes = {mode}; + + GnomeDisplayConfig config; + config.serial = 123; + config.monitors["DUMMY0"] = dummy0; + + std::string expected_format = + "(123, 2, [(10, 20, 1.0, 0, true, [('DUMMY0', '800x600', {})])], {})"; + ScopedGVariant logical_monitors = config.BuildMonitorsConfigParameters(); + webrtc::Scoped<char> actual_format( + g_variant_print(logical_monitors.get(), FALSE)); + + EXPECT_EQ(expected_format, actual_format.get()); +} + +} // namespace remoting
diff --git a/remoting/host/linux/scoped_glib.cc b/remoting/host/linux/scoped_glib.cc new file mode 100644 index 0000000..2a04650 --- /dev/null +++ b/remoting/host/linux/scoped_glib.cc
@@ -0,0 +1,24 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "remoting/host/linux/scoped_glib.h" + +namespace remoting { + +namespace internal { + +void GVariantDeleter::operator()(GVariant* variant) { + g_variant_unref(variant); +} + +} // namespace internal + +ScopedGVariant TakeGVariant(GVariant* variant) { + if (variant && g_variant_is_floating(variant)) { + g_variant_ref_sink(variant); + } + return ScopedGVariant(variant); +} + +} // namespace remoting
diff --git a/remoting/host/linux/scoped_glib.h b/remoting/host/linux/scoped_glib.h new file mode 100644 index 0000000..69d2eb0 --- /dev/null +++ b/remoting/host/linux/scoped_glib.h
@@ -0,0 +1,33 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef REMOTING_HOST_LINUX_SCOPED_GLIB_H_ +#define REMOTING_HOST_LINUX_SCOPED_GLIB_H_ + +#include <gio/gio.h> + +#include <memory> + +// This file defines some scoper classes and utilities for some GLib types that +// are not derived from GObject. + +namespace remoting { + +namespace internal { + +struct GVariantDeleter { + void operator()(GVariant* variant); +}; + +} // namespace internal + +using ScopedGVariant = std::unique_ptr<GVariant, internal::GVariantDeleter>; + +// Takes ownership of a GVariant reference. If the reference is floating, it +// will be sunk. +ScopedGVariant TakeGVariant(GVariant* variant); + +} // namespace remoting + +#endif // REMOTING_HOST_LINUX_SCOPED_GLIB_H_
diff --git a/remoting/protocol/chromium_socket_factory.cc b/remoting/protocol/chromium_socket_factory.cc index 3560034f..628ef08 100644 --- a/remoting/protocol/chromium_socket_factory.cc +++ b/remoting/protocol/chromium_socket_factory.cc
@@ -25,10 +25,12 @@ #include "remoting/protocol/session_options_provider.h" #include "remoting/protocol/socket_util.h" #include "remoting/protocol/stream_packet_socket.h" +#include "third_party/webrtc/api/units/timestamp.h" #include "third_party/webrtc/media/base/rtp_utils.h" #include "third_party/webrtc/rtc_base/async_dns_resolver.h" #include "third_party/webrtc/rtc_base/async_packet_socket.h" #include "third_party/webrtc/rtc_base/net_helpers.h" +#include "third_party/webrtc/rtc_base/network/received_packet.h" #include "third_party/webrtc/rtc_base/socket.h" namespace remoting::protocol { @@ -396,8 +398,10 @@ LOG(ERROR) << "Failed to convert address received from RecvFrom()."; return; } - SignalReadPacket(this, receive_buffer_->data(), result, address, - rtc::TimeMicros()); + rtc::ReceivedPacket packet( + rtc::MakeArrayView(receive_buffer_->bytes(), result), address, + webrtc::Timestamp::Micros(rtc::TimeMicros())); + NotifyPacketReceived(packet); } else { LOG(ERROR) << "Received error when reading from UDP socket: " << result; }
diff --git a/remoting/protocol/chromium_socket_factory_unittest.cc b/remoting/protocol/chromium_socket_factory_unittest.cc index 7ab2fe8..56bde4e 100644 --- a/remoting/protocol/chromium_socket_factory_unittest.cc +++ b/remoting/protocol/chromium_socket_factory_unittest.cc
@@ -19,6 +19,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/webrtc/rtc_base/async_packet_socket.h" +#include "third_party/webrtc/rtc_base/network/received_packet.h" #include "third_party/webrtc/rtc_base/socket_address.h" #include "third_party/webrtc/rtc_base/time_utils.h" @@ -49,19 +50,19 @@ rtc::SocketAddress("127.0.0.1", 0), 0, 0)); ASSERT_TRUE(socket_.get() != nullptr); EXPECT_EQ(socket_->GetState(), rtc::AsyncPacketSocket::STATE_BOUND); - socket_->SignalReadPacket.connect(this, - &ChromiumSocketFactoryTest::OnPacket); + socket_->RegisterReceivedPacketCallback( + [&](rtc::AsyncPacketSocket* socket, const rtc::ReceivedPacket& packet) { + OnPacket(socket, packet); + }); } void OnPacket(rtc::AsyncPacketSocket* socket, - const char* data, - size_t size, - const rtc::SocketAddress& address, - const int64_t& packet_time) { + const rtc::ReceivedPacket& packet) { EXPECT_EQ(socket, socket_.get()); - last_packet_.assign(data, data + size); - last_address_ = address; - last_packet_time_ = packet_time; + last_packet_.assign(packet.payload().data(), + packet.payload().data() + packet.payload().size()); + last_address_ = packet.source_address(); + last_packet_time_ = packet.arrival_time()->us(); run_loop_.Quit(); }
diff --git a/sandbox/linux/bpf_dsl/codegen_unittest.cc b/sandbox/linux/bpf_dsl/codegen_unittest.cc index 6a2ff621..9ee291d 100644 --- a/sandbox/linux/bpf_dsl/codegen_unittest.cc +++ b/sandbox/linux/bpf_dsl/codegen_unittest.cc
@@ -8,11 +8,11 @@ #include <stdint.h> #include <map> +#include <string_view> #include <utility> #include <vector> #include "base/hash/md5.h" -#include "base/strings/string_piece.h" #include "sandbox/linux/system_headers/linux_filter.h" #include "testing/gtest/include/gtest/gtest.h" @@ -58,9 +58,8 @@ private: template <typename T> void HashValue(base::MD5Context* ctx, const T& value) { - base::MD5Update(ctx, - base::StringPiece(reinterpret_cast<const char*>(&value), - sizeof(value))); + base::MD5Update(ctx, std::string_view(reinterpret_cast<const char*>(&value), + sizeof(value))); } std::string Base16() const {
diff --git a/sandbox/linux/syscall_broker/broker_file_permission.h b/sandbox/linux/syscall_broker/broker_file_permission.h index e8e32cc..7771ae15 100644 --- a/sandbox/linux/syscall_broker/broker_file_permission.h +++ b/sandbox/linux/syscall_broker/broker_file_permission.h
@@ -9,7 +9,6 @@ #include <cstdint> #include <string> -#include "base/strings/string_piece.h" #include "sandbox/sandbox_export.h" namespace sandbox {
diff --git a/sandbox/linux/syscall_broker/broker_host.cc b/sandbox/linux/syscall_broker/broker_host.cc index 272dcbc..75dc01643 100644 --- a/sandbox/linux/syscall_broker/broker_host.cc +++ b/sandbox/linux/syscall_broker/broker_host.cc
@@ -23,7 +23,6 @@ #include "base/files/scoped_file.h" #include "base/logging.h" #include "base/posix/eintr_wrapper.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "sandbox/linux/services/syscall_wrappers.h"
diff --git a/sandbox/linux/syscall_broker/broker_process_unittest.cc b/sandbox/linux/syscall_broker/broker_process_unittest.cc index 10e7621..03dd3928 100644 --- a/sandbox/linux/syscall_broker/broker_process_unittest.cc +++ b/sandbox/linux/syscall_broker/broker_process_unittest.cc
@@ -18,6 +18,7 @@ #include <algorithm> #include <memory> #include <string> +#include <string_view> #include <vector> #include "base/containers/flat_map.h" @@ -751,16 +752,16 @@ ASSERT_GT(num_read, 0); - base::StringPiece status(buf, static_cast<size_t>(num_read)); - base::StringPiece tracer("Pid:\t"); + std::string_view status(buf, static_cast<size_t>(num_read)); + std::string_view tracer("Pid:\t"); - base::StringPiece::size_type pid_index = status.find(tracer); - ASSERT_NE(pid_index, base::StringPiece::npos); + std::string_view::size_type pid_index = status.find(tracer); + ASSERT_NE(pid_index, std::string_view::npos); pid_index += tracer.size(); - base::StringPiece::size_type pid_end_index = status.find('\n', pid_index); - ASSERT_NE(pid_end_index, base::StringPiece::npos); + std::string_view::size_type pid_end_index = status.find('\n', pid_index); + ASSERT_NE(pid_end_index, std::string_view::npos); - base::StringPiece pid_str(buf + pid_index, pid_end_index - pid_index); + std::string_view pid_str(buf + pid_index, pid_end_index - pid_index); int pid = 0; ASSERT_TRUE(base::StringToInt(pid_str, &pid));
diff --git a/sandbox/linux/tests/main.cc b/sandbox/linux/tests/main.cc index 7ba9e9f..8529dc0 100644 --- a/sandbox/linux/tests/main.cc +++ b/sandbox/linux/tests/main.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <string_view> + #include "base/at_exit.h" #include "base/base_switches.h" #include "base/command_line.h" @@ -41,8 +43,8 @@ #if !defined(SANDBOX_USES_BASE_TEST_SUITE) void UnitTestAssertHandler(const char* file, int line, - const base::StringPiece message, - const base::StringPiece stack_trace) { + const std::string_view message, + const std::string_view stack_trace) { _exit(1); } #endif
diff --git a/sandbox/policy/win/sandbox_win.cc b/sandbox/policy/win/sandbox_win.cc index 8a49455..322f0e4 100644 --- a/sandbox/policy/win/sandbox_win.cc +++ b/sandbox/policy/win/sandbox_win.cc
@@ -1127,7 +1127,7 @@ // static std::string SandboxWin::GetSandboxTagForDelegate( - base::StringPiece prefix, + std::string_view prefix, sandbox::mojom::Sandbox sandbox_type) { // sandbox.mojom.Sandbox has an operator << we can use for non-human values. std::ostringstream stream;
diff --git a/sandbox/policy/win/sandbox_win.h b/sandbox/policy/win/sandbox_win.h index 81698da..53b719a5 100644 --- a/sandbox/policy/win/sandbox_win.h +++ b/sandbox/policy/win/sandbox_win.h
@@ -8,6 +8,7 @@ #include <stdint.h> #include <string> +#include <string_view> #include <optional> #include "base/functional/bind.h" @@ -119,7 +120,7 @@ // Helper for sandbox delegates to generate a SandboxTag static std::string GetSandboxTagForDelegate( - base::StringPiece prefix, + std::string_view prefix, sandbox::mojom::Sandbox sandbox_type); private:
diff --git a/sandbox/win/src/broker_services.cc b/sandbox/win/src/broker_services.cc index 95a6e5d3..a0a2ae3 100644 --- a/sandbox/win/src/broker_services.cc +++ b/sandbox/win/src/broker_services.cc
@@ -334,7 +334,7 @@ } std::unique_ptr<TargetPolicy> BrokerServicesBase::CreatePolicy( - base::StringPiece tag) { + std::string_view tag) { // If you change the type of the object being created here you must also // change the downcast to it in SpawnTarget(). auto policy = std::make_unique<PolicyBase>(tag);
diff --git a/sandbox/win/src/broker_services.h b/sandbox/win/src/broker_services.h index 84705516..49a2e733 100644 --- a/sandbox/win/src/broker_services.h +++ b/sandbox/win/src/broker_services.h
@@ -9,6 +9,7 @@ #include <memory> #include <set> #include <string> +#include <string_view> #include <utility> #include "base/compiler_specific.h" @@ -50,7 +51,7 @@ ResultCode CreateAlternateDesktop(Desktop desktop) override; void DestroyDesktops() override; std::unique_ptr<TargetPolicy> CreatePolicy() override; - std::unique_ptr<TargetPolicy> CreatePolicy(base::StringPiece key) override; + std::unique_ptr<TargetPolicy> CreatePolicy(std::string_view key) override; ResultCode SpawnTarget(const wchar_t* exe_path, const wchar_t* command_line,
diff --git a/sandbox/win/src/policy_target_test.cc b/sandbox/win/src/policy_target_test.cc index 058f5d3..f302a5a 100644 --- a/sandbox/win/src/policy_target_test.cc +++ b/sandbox/win/src/policy_target_test.cc
@@ -4,12 +4,13 @@ #include <ntstatus.h> +#include <string_view> + #include "base/environment.h" #include "base/memory/read_only_shared_memory_region.h" #include "base/memory/writable_shared_memory_region.h" #include "base/scoped_environment_variable_override.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/win/scoped_process_information.h" #include "base/win/win_util.h" @@ -481,7 +482,7 @@ BrokerServices* broker = GetBroker(); ASSERT_TRUE(broker); - base::StringPiece contents = "Hello World"; + std::string_view contents = "Hello World"; base::WritableSharedMemoryRegion writable_region = base::WritableSharedMemoryRegion::Create(contents.size()); ASSERT_TRUE(writable_region.IsValid());
diff --git a/sandbox/win/src/process_mitigations_deathtest.cc b/sandbox/win/src/process_mitigations_deathtest.cc index 39405bf..5f03b459 100644 --- a/sandbox/win/src/process_mitigations_deathtest.cc +++ b/sandbox/win/src/process_mitigations_deathtest.cc
@@ -6,7 +6,6 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions_win.h" -#include "base/strings/string_piece.h" #include "sandbox/win/tests/common/controller.h" #include "testing/gtest/include/gtest/gtest.h" @@ -115,4 +114,4 @@ static_cast<ULONG>(runner.RunTest(test_command.c_str()))); } -} // namespace sandbox \ No newline at end of file +} // namespace sandbox
diff --git a/sandbox/win/src/sandbox.h b/sandbox/win/src/sandbox.h index 41b70a0..5d35fa9a 100644 --- a/sandbox/win/src/sandbox.h +++ b/sandbox/win/src/sandbox.h
@@ -24,8 +24,9 @@ #include <vector> #include <optional> +#include <string_view> + #include "base/containers/span.h" -#include "base/strings/string_piece.h" #include "base/win/windows_types.h" #include "sandbox/win/src/sandbox_policy.h" #include "sandbox/win/src/sandbox_types.h" @@ -103,7 +104,7 @@ // policy which never shares its TargetConfig state with another policy // object. For such an object both its TargetConfig and TargetPolicy methods // must be called every time. - virtual std::unique_ptr<TargetPolicy> CreatePolicy(base::StringPiece tag) = 0; + virtual std::unique_ptr<TargetPolicy> CreatePolicy(std::string_view tag) = 0; // Creates a new target (child process) in a suspended state and takes // ownership of |policy|.
diff --git a/sandbox/win/src/sandbox_policy_base.cc b/sandbox/win/src/sandbox_policy_base.cc index a76c420..f54b6c9 100644 --- a/sandbox/win/src/sandbox_policy_base.cc +++ b/sandbox/win/src/sandbox_policy_base.cc
@@ -443,7 +443,7 @@ zero_appshim_ = true; } -PolicyBase::PolicyBase(base::StringPiece tag) +PolicyBase::PolicyBase(std::string_view tag) : tag_(tag), config_(), config_ptr_(nullptr),
diff --git a/sandbox/win/src/sandbox_policy_base.h b/sandbox/win/src/sandbox_policy_base.h index 2c286365..090d51f 100644 --- a/sandbox/win/src/sandbox_policy_base.h +++ b/sandbox/win/src/sandbox_policy_base.h
@@ -11,6 +11,7 @@ #include <list> #include <memory> #include <string> +#include <string_view> #include <vector> #include <optional> @@ -20,7 +21,6 @@ #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/process/launch.h" -#include "base/strings/string_piece.h" #include "base/synchronization/lock.h" #include "base/win/access_token.h" #include "base/win/windows_types.h" @@ -165,7 +165,7 @@ class PolicyBase final : public TargetPolicy { public: - PolicyBase(base::StringPiece key); + PolicyBase(std::string_view key); ~PolicyBase() override; PolicyBase(const PolicyBase&) = delete;
diff --git a/sandbox/win/tests/common/controller.cc b/sandbox/win/tests/common/controller.cc index 22ef41c..4f80f9a 100644 --- a/sandbox/win/tests/common/controller.cc +++ b/sandbox/win/tests/common/controller.cc
@@ -6,6 +6,7 @@ #include <memory> #include <string> +#include <string_view> #include "base/check.h" #include "base/dcheck_is_on.h" @@ -391,7 +392,7 @@ // in read only mode and sleep infinitely if we succeed. if (0 == _wcsicmp(argv[3], L"shared_memory_handle")) { HANDLE raw_handle = nullptr; - base::StringPiece test_contents = "Hello World"; + std::string_view test_contents = "Hello World"; base::StringToUint(base::AsStringPiece16(argv[4]), reinterpret_cast<unsigned int*>(&raw_handle)); if (raw_handle == nullptr)
diff --git a/services/network/attribution/attribution_request_helper.cc b/services/network/attribution/attribution_request_helper.cc index 371fa73..97c4ff0 100644 --- a/services/network/attribution/attribution_request_helper.cc +++ b/services/network/attribution/attribution_request_helper.cc
@@ -21,7 +21,6 @@ #include "base/metrics/histogram_functions.h" #include "base/rand_util.h" #include "base/strings/strcat.h" -#include "base/strings/string_piece.h" #include "base/uuid.h" #include "net/base/isolation_info.h" #include "net/base/schemeful_site.h"
diff --git a/services/network/attribution/attribution_test_utils.cc b/services/network/attribution/attribution_test_utils.cc index 4b58f2c..4e67b19 100644 --- a/services/network/attribution/attribution_test_utils.cc +++ b/services/network/attribution/attribution_test_utils.cc
@@ -12,7 +12,6 @@ #include "base/ranges/algorithm.h" #include "base/strings/strcat.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "net/http/structured_headers.h" #include "net/test/embedded_test_server/http_request.h" @@ -42,7 +41,7 @@ return true; } -bool FakeCryptographer::AddKey(base::StringPiece key) { +bool FakeCryptographer::AddKey(std::string_view key) { if (should_fail_add_key_) { return false; } @@ -52,7 +51,7 @@ } absl::optional<std::string> FakeCryptographer::BeginIssuance( - base::StringPiece message) { + std::string_view message) { if (should_fail_begin_issuance_) { return absl::nullopt; } @@ -72,7 +71,7 @@ absl::optional<std::string> FakeCryptographer::ConfirmIssuanceAndBeginRedemption( - base::StringPiece blind_token) { + std::string_view blind_token) { if (should_fail_confirm_issuance_) { return absl::nullopt; } @@ -182,7 +181,7 @@ } std::vector<const std::string> DeserializeStructuredHeaderListOfStrings( - base::StringPiece header) { + std::string_view header) { absl::optional<net::structured_headers::List> parsed_list = net::structured_headers::ParseList(header); if (!parsed_list.has_value()) {
diff --git a/services/network/attribution/attribution_test_utils.h b/services/network/attribution/attribution_test_utils.h index 331ea6cb..6c40c6a 100644 --- a/services/network/attribution/attribution_test_utils.h +++ b/services/network/attribution/attribution_test_utils.h
@@ -8,8 +8,8 @@ #include <memory> #include <set> #include <string> +#include <string_view> -#include "base/strings/string_piece.h" #include "services/network/attribution/attribution_verification_mediator.h" #include "services/network/public/mojom/trust_tokens.mojom-shared.h" #include "services/network/trust_tokens/trust_token_key_commitments.h" @@ -33,12 +33,12 @@ bool Initialize( mojom::TrustTokenProtocolVersion issuer_configured_version) override; - bool AddKey(base::StringPiece key) override; + bool AddKey(std::string_view key) override; - absl::optional<std::string> BeginIssuance(base::StringPiece message) override; + absl::optional<std::string> BeginIssuance(std::string_view message) override; absl::optional<std::string> ConfirmIssuanceAndBeginRedemption( - base::StringPiece response_header) override; + std::string_view response_header) override; //*********************** // Helper methods below @@ -117,7 +117,7 @@ std::string SerializeStructureHeaderListOfStrings( const std::vector<std::string>& strings); std::vector<const std::string> DeserializeStructuredHeaderListOfStrings( - base::StringPiece header); + std::string_view header); } // namespace network
diff --git a/services/network/attribution/attribution_verification_mediator.h b/services/network/attribution/attribution_verification_mediator.h index 2421b319..679ad5f 100644 --- a/services/network/attribution/attribution_verification_mediator.h +++ b/services/network/attribution/attribution_verification_mediator.h
@@ -7,11 +7,11 @@ #include <memory> #include <string> +#include <string_view> #include <vector> #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" -#include "base/strings/string_piece.h" #include "net/http/http_request_headers.h" #include "net/http/http_response_headers.h" #include "services/network/public/mojom/trust_tokens.mojom-forward.h" @@ -89,7 +89,7 @@ // forbid adding duplicates; however, duplicates might contribute to an // overall limit on the number of permitted keys, so the caller may wish to // ensure this is called at most once per distinct key. - [[nodiscard]] virtual bool AddKey(base::StringPiece key) = 0; + [[nodiscard]] virtual bool AddKey(std::string_view key) = 0; // On success, returns a base64-encoded string representing the blinded // `message`. on error, returns nullopt. @@ -98,7 +98,7 @@ // to attest to. We "blind" it as part of the blind signature protocol // before sending it to the issuer for signature. [[nodiscard]] virtual absl::optional<std::string> BeginIssuance( - base::StringPiece message) = 0; + std::string_view message) = 0; // Given a base64-encoded issuance `response header`, attempts to unblind a // blind token represented by the header using the keys previously added by @@ -106,7 +106,7 @@ // Sec-Attribution-Reporting-Private-State-Token header. On error, it // returns nullopt. [[nodiscard]] virtual absl::optional<std::string> - ConfirmIssuanceAndBeginRedemption(base::StringPiece response_header) = 0; + ConfirmIssuanceAndBeginRedemption(std::string_view response_header) = 0; }; class MetricsRecorder {
diff --git a/services/network/attribution/attribution_verification_mediator_metrics_recorder.cc b/services/network/attribution/attribution_verification_mediator_metrics_recorder.cc index 76cf2e2..613583d 100644 --- a/services/network/attribution/attribution_verification_mediator_metrics_recorder.cc +++ b/services/network/attribution/attribution_verification_mediator_metrics_recorder.cc
@@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <string_view> + #include "services/network/attribution/attribution_verification_mediator_metrics_recorder.h" #include "base/check.h" #include "base/metrics/histogram_functions.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/time/time.h" #include "services/network/attribution/attribution_verification_mediator.h" @@ -31,7 +32,7 @@ void RecordTiming(TimeSpan time_span, bool is_success, base::TimeDelta delta) { // These must stay in sync with the corresponding histogram suffixes in // histograms.xml. - base::StringPiece time_span_string; + std::string_view time_span_string; switch (time_span) { case kGetKeyCommitment: time_span_string = "GetKeyCommitment"; @@ -52,7 +53,7 @@ time_span_string = "Total"; break; } - base::StringPiece outcome_string = is_success ? "Success" : "Failure"; + std::string_view outcome_string = is_success ? "Success" : "Failure"; base::UmaHistogramTimes( base::JoinString({"Conversions.ReportVerification.Duration",
diff --git a/services/network/attribution/attribution_verification_mediator_unittest.cc b/services/network/attribution/attribution_verification_mediator_unittest.cc index c5fd8d9..aa32cb4f 100644 --- a/services/network/attribution/attribution_verification_mediator_unittest.cc +++ b/services/network/attribution/attribution_verification_mediator_unittest.cc
@@ -9,7 +9,6 @@ #include <string> #include "base/run_loop.h" -#include "base/strings/string_piece.h" #include "base/test/bind.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/task_environment.h"
diff --git a/services/network/attribution/boringssl_verification_cryptographer.cc b/services/network/attribution/boringssl_verification_cryptographer.cc index 09a87eb..55573d68 100644 --- a/services/network/attribution/boringssl_verification_cryptographer.cc +++ b/services/network/attribution/boringssl_verification_cryptographer.cc
@@ -8,7 +8,6 @@ #include "base/base64.h" #include "base/containers/span.h" -#include "base/strings/string_piece.h" #include "base/time/time.h" #include "services/network/trust_tokens/boringssl_trust_token_state.h" #include "services/network/trust_tokens/scoped_boringssl_bytes.h" @@ -33,7 +32,7 @@ return !!state_; } -bool BoringsslVerificationCryptographer::AddKey(base::StringPiece key) { +bool BoringsslVerificationCryptographer::AddKey(std::string_view key) { if (!state_) { return false; } @@ -50,7 +49,7 @@ } absl::optional<std::string> BoringsslVerificationCryptographer::BeginIssuance( - base::StringPiece message) { + std::string_view message) { if (!state_) { return absl::nullopt; } @@ -70,7 +69,7 @@ absl::optional<std::string> BoringsslVerificationCryptographer::ConfirmIssuanceAndBeginRedemption( - base::StringPiece response_header) { + std::string_view response_header) { if (!state_) { return absl::nullopt; }
diff --git a/services/network/attribution/boringssl_verification_cryptographer.h b/services/network/attribution/boringssl_verification_cryptographer.h index d6b83d8..0255d065 100644 --- a/services/network/attribution/boringssl_verification_cryptographer.h +++ b/services/network/attribution/boringssl_verification_cryptographer.h
@@ -7,8 +7,8 @@ #include <memory> #include <string> +#include <string_view> -#include "base/strings/string_piece.h" #include "services/network/attribution/attribution_verification_mediator.h" #include "services/network/public/mojom/trust_tokens.mojom-shared.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -25,10 +25,10 @@ bool Initialize( mojom::TrustTokenProtocolVersion issuer_configured_version) override; - bool AddKey(base::StringPiece key) override; - absl::optional<std::string> BeginIssuance(base::StringPiece message) override; + bool AddKey(std::string_view key) override; + absl::optional<std::string> BeginIssuance(std::string_view message) override; absl::optional<std::string> ConfirmIssuanceAndBeginRedemption( - base::StringPiece response_header) override; + std::string_view response_header) override; private: // In the context of report verification, we always issue a single token as it
diff --git a/services/network/cors/cors_url_loader_tao_unittest.cc b/services/network/cors/cors_url_loader_tao_unittest.cc index 6475d25..3762ba82b 100644 --- a/services/network/cors/cors_url_loader_tao_unittest.cc +++ b/services/network/cors/cors_url_loader_tao_unittest.cc
@@ -8,7 +8,6 @@ #include <vector> #include "base/functional/callback_helpers.h" -#include "base/strings/string_piece.h" #include "base/test/metrics/histogram_tester.h" #include "mojo/public/cpp/bindings/message.h" #include "mojo/public/cpp/system/functions.h"
diff --git a/services/network/cors/cors_url_loader_test_util.cc b/services/network/cors/cors_url_loader_test_util.cc index b75a6da..98007fcc6 100644 --- a/services/network/cors/cors_url_loader_test_util.cc +++ b/services/network/cors/cors_url_loader_test_util.cc
@@ -352,9 +352,9 @@ net::RedirectInfo CorsURLLoaderTestBase::CreateRedirectInfo( int status_code, - base::StringPiece method, + std::string_view method, const GURL& url, - base::StringPiece referrer, + std::string_view referrer, net::ReferrerPolicy referrer_policy, net::SiteForCookies site_for_cookies) { net::RedirectInfo redirect_info;
diff --git a/services/network/cors/cors_url_loader_test_util.h b/services/network/cors/cors_url_loader_test_util.h index febbfb8..46b87165 100644 --- a/services/network/cors/cors_url_loader_test_util.h +++ b/services/network/cors/cors_url_loader_test_util.h
@@ -8,6 +8,7 @@ #include <cstdint> #include <memory> #include <string> +#include <string_view> #include <utility> #include <vector> @@ -312,9 +313,9 @@ static net::RedirectInfo CreateRedirectInfo( int status_code, - base::StringPiece method, + std::string_view method, const GURL& url, - base::StringPiece referrer = base::StringPiece(), + std::string_view referrer = std::string_view(), net::ReferrerPolicy referrer_policy = net::ReferrerPolicy::NO_REFERRER, net::SiteForCookies site_for_cookies = net::SiteForCookies());
diff --git a/services/network/cors/cors_url_loader_unittest.cc b/services/network/cors/cors_url_loader_unittest.cc index 8526016..45b88b1 100644 --- a/services/network/cors/cors_url_loader_unittest.cc +++ b/services/network/cors/cors_url_loader_unittest.cc
@@ -8,7 +8,6 @@ #include <vector> #include "base/functional/callback_helpers.h" -#include "base/strings/string_piece.h" #include "base/strings/stringprintf.h" #include "base/test/scoped_feature_list.h" #include "mojo/public/cpp/bindings/message.h"
diff --git a/services/network/cors/preflight_result.cc b/services/network/cors/preflight_result.cc index 5643be66..302f5fb 100644 --- a/services/network/cors/preflight_result.cc +++ b/services/network/cors/preflight_result.cc
@@ -5,13 +5,13 @@ #include "services/network/cors/preflight_result.h" #include <string> +#include <string_view> #include <vector> #include "base/feature_list.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/time/default_tick_clock.h" @@ -91,7 +91,7 @@ net::HttpUtil::ValuesIterator it(string->begin(), string->end(), ',', true); while (it.GetNext()) { - base::StringPiece value = it.value_piece(); + std::string_view value = it.value_piece(); if (!net::HttpUtil::IsToken(value)) { set->clear(); return false; @@ -104,7 +104,7 @@ // Joins the strings in the given `set ` with commas. std::string JoinSet(const base::flat_set<std::string>& set) { - std::vector<base::StringPiece> values(set.begin(), set.end()); + std::vector<std::string_view> values(set.begin(), set.end()); return base::JoinString(values, ","); }
diff --git a/services/network/ignore_errors_cert_verifier.cc b/services/network/ignore_errors_cert_verifier.cc index 4022737..61942ab5 100644 --- a/services/network/ignore_errors_cert_verifier.cc +++ b/services/network/ignore_errors_cert_verifier.cc
@@ -5,12 +5,12 @@ #include "services/network/ignore_errors_cert_verifier.h" #include <iterator> +#include <string_view> #include <utility> #include "base/base64.h" #include "base/memory/ref_counted.h" #include "base/ranges/algorithm.h" -#include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "crypto/sha2.h" #include "net/base/hash_value.h" @@ -60,7 +60,7 @@ std::unique_ptr<Request>* out_req, const net::NetLogWithSource& net_log) { SPKIHashSet spki_fingerprints; - base::StringPiece cert_spki; + std::string_view cert_spki; SHA256HashValue hash; if (net::asn1::ExtractSPKIFromDERCert( net::x509_util::CryptoBufferAsStringPiece(
diff --git a/services/network/ignore_errors_cert_verifier_unittest.cc b/services/network/ignore_errors_cert_verifier_unittest.cc index dc4b1402..fccf617 100644 --- a/services/network/ignore_errors_cert_verifier_unittest.cc +++ b/services/network/ignore_errors_cert_verifier_unittest.cc
@@ -4,12 +4,13 @@ #include "services/network/ignore_errors_cert_verifier.h" +#include <string_view> + #include "base/base64.h" #include "base/files/file_path.h" #include "base/memory/ptr_util.h" #include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "crypto/sha2.h" #include "net/base/net_errors.h" @@ -52,15 +53,15 @@ net::CertificateList certs = net::CreateCertificateListFromFile( certs_dir, "x509_verify_results.chain.pem", X509Certificate::FORMAT_AUTO); std::string hash_base64; - base::StringPiece cert_spki; + std::string_view cert_spki; SHA256HashValue hash; net::asn1::ExtractSPKIFromDERCert( net::x509_util::CryptoBufferAsStringPiece(certs[1]->cert_buffer()), &cert_spki); crypto::SHA256HashString(cert_spki, &hash, sizeof(SHA256HashValue)); - base::Base64Encode(base::StringPiece(reinterpret_cast<const char*>(hash.data), - sizeof(hash.data)), + base::Base64Encode(std::string_view(reinterpret_cast<const char*>(hash.data), + sizeof(hash.data)), &hash_base64); return {"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", "foobar", hash_base64, "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB="};
diff --git a/services/network/mdns_responder_unittest.cc b/services/network/mdns_responder_unittest.cc index dbc65c7c..2d9dfa0 100644 --- a/services/network/mdns_responder_unittest.cc +++ b/services/network/mdns_responder_unittest.cc
@@ -16,7 +16,6 @@ #include "base/functional/callback_helpers.h" #include "base/memory/scoped_refptr.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/task/single_thread_task_runner.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h"
diff --git a/services/network/network_context_unittest.cc b/services/network/network_context_unittest.cc index 5359f1a..4204e9c6 100644 --- a/services/network/network_context_unittest.cc +++ b/services/network/network_context_unittest.cc
@@ -8,6 +8,7 @@ #include <map> #include <memory> #include <string> +#include <string_view> #include <utility> #include <vector> @@ -413,7 +414,7 @@ std::unique_ptr<net::HostResolver> CreateResolver( net::HostResolverManager* manager, - base::StringPiece host_mapping_rules, + std::string_view host_mapping_rules, bool enable_caching) override { DCHECK(resolver_); return std::move(resolver_); @@ -423,7 +424,7 @@ std::unique_ptr<net::HostResolver> CreateStandaloneResolver( net::NetLog* net_log, const net::HostResolver::ManagerOptions& options, - base::StringPiece host_mapping_rules, + std::string_view host_mapping_rules, bool enable_caching) override { NOTREACHED(); return nullptr; @@ -496,7 +497,7 @@ // Looks up a value with the given name from the NetworkContext's // TransportSocketPool info dictionary. - int GetSocketPoolInfo(NetworkContext* context, base::StringPiece name) { + int GetSocketPoolInfo(NetworkContext* context, std::string_view name) { return context->url_request_context() ->http_transaction_factory() ->GetSession() @@ -4118,7 +4119,7 @@ std::unique_ptr<net::HostResolver> CreateResolver( net::HostResolverManager* manager, - base::StringPiece host_mapping_rules, + std::string_view host_mapping_rules, bool enable_caching) override { DCHECK(host_mapping_rules.empty()); auto resolve_context = std::make_unique<net::ResolveContext>( @@ -4132,7 +4133,7 @@ std::unique_ptr<net::HostResolver> CreateStandaloneResolver( net::NetLog* net_log, const net::HostResolver::ManagerOptions& options, - base::StringPiece host_mapping_rules, + std::string_view host_mapping_rules, bool enable_caching) override { DCHECK(host_mapping_rules.empty()); std::unique_ptr<net::ContextHostResolver> resolver =
diff --git a/services/network/network_service_memory_cache.cc b/services/network/network_service_memory_cache.cc index 413b9512..95012532 100644 --- a/services/network/network_service_memory_cache.cc +++ b/services/network/network_service_memory_cache.cc
@@ -6,6 +6,7 @@ #include <algorithm> #include <limits> +#include <string_view> #include "base/bit_cast.h" #include "base/memory/ref_counted_memory.h" @@ -13,7 +14,6 @@ #include "base/metrics/field_trial_params.h" #include "base/numerics/safe_conversions.h" #include "base/strings/strcat.h" -#include "base/strings/string_piece.h" #include "net/base/load_flags.h" #include "net/base/mime_sniffer.h" #include "net/base/network_isolation_key.h" @@ -137,7 +137,7 @@ const size_t size = std::min(static_cast<size_t>(net::kMaxBytesToSniff), content.size()); decision = analyzer->Sniff( - base::StringPiece(base::bit_cast<const char*>(content.front()), size)); + std::string_view(base::bit_cast<const char*>(content.front()), size)); if (decision == corb::ResponseAnalyzer::Decision::kSniffMore) decision = analyzer->HandleEndOfSniffableResponseBody(); DCHECK_NE(decision, corb::ResponseAnalyzer::Decision::kSniffMore);
diff --git a/services/network/network_service_unittest.cc b/services/network/network_service_unittest.cc index 5b62d78..23e12fcb 100644 --- a/services/network/network_service_unittest.cc +++ b/services/network/network_service_unittest.cc
@@ -5,6 +5,7 @@ #include "services/network/network_service.h" #include <memory> +#include <string_view> #include <utility> #include "base/base64.h" @@ -699,7 +700,7 @@ TEST_F(NetworkServiceTest, DisableDohUpgradeProviders) { auto FindProviderFeature = - [](base::StringPiece provider) -> base::test::FeatureRef { + [](std::string_view provider) -> base::test::FeatureRef { const auto it = base::ranges::find(net::DohProviderEntry::GetList(), provider, &net::DohProviderEntry::provider);
diff --git a/services/network/p2p/socket_tcp_unittest.cc b/services/network/p2p/socket_tcp_unittest.cc index 1d9eb36..09bf318 100644 --- a/services/network/p2p/socket_tcp_unittest.cc +++ b/services/network/p2p/socket_tcp_unittest.cc
@@ -8,6 +8,7 @@ #include <stdint.h> #include <memory> +#include <string_view> #include "base/memory/raw_ptr.h" #include "base/run_loop.h" @@ -493,9 +494,9 @@ auto context = context_builder->Build(); ProxyResolvingClientSocketFactory factory(context.get()); - base::StringPiece ssl_client_hello = + std::string_view ssl_client_hello = webrtc::FakeSSLClientSocket::GetSslClientHello(); - base::StringPiece ssl_server_hello = + std::string_view ssl_server_hello = webrtc::FakeSSLClientSocket::GetSslServerHello(); net::MockRead reads[] = { net::MockRead(net::ASYNC, ssl_server_hello.data(), @@ -551,9 +552,9 @@ auto context = context_builder->Build(); ProxyResolvingClientSocketFactory factory(context.get()); - base::StringPiece ssl_client_hello = + std::string_view ssl_client_hello = webrtc::FakeSSLClientSocket::GetSslClientHello(); - base::StringPiece ssl_server_hello = + std::string_view ssl_server_hello = webrtc::FakeSSLClientSocket::GetSslServerHello(); net::MockRead reads[] = { net::MockRead(net::ASYNC, ssl_server_hello.data(),
diff --git a/services/network/private_network_access_checker_unittest.cc b/services/network/private_network_access_checker_unittest.cc index 02318cd..cde62377 100644 --- a/services/network/private_network_access_checker_unittest.cc +++ b/services/network/private_network_access_checker_unittest.cc
@@ -4,8 +4,9 @@ #include "services/network/private_network_access_checker.h" +#include <string_view> + #include "base/strings/strcat.h" -#include "base/strings/string_piece.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/scoped_feature_list.h" #include "net/base/ip_address.h" @@ -29,7 +30,7 @@ using Result = PrivateNetworkAccessCheckResult; -constexpr base::StringPiece kCheckResultHistogramName = +constexpr std::string_view kCheckResultHistogramName = "Security.PrivateNetworkAccess.CheckResult"; constexpr char kNoAcceptChFrame[] = "";
diff --git a/services/network/proxy_auto_config_library_unittest.cc b/services/network/proxy_auto_config_library_unittest.cc index a3e0e90..60696c7 100644 --- a/services/network/proxy_auto_config_library_unittest.cc +++ b/services/network/proxy_auto_config_library_unittest.cc
@@ -7,6 +7,7 @@ #include <algorithm> #include <deque> #include <memory> +#include <string_view> #include "base/barrier_closure.h" #include "base/containers/circular_deque.h" @@ -93,7 +94,7 @@ EXPECT_EQ(1u, candidates.count(ip)); } -net::IPAddress CreateIPAddress(base::StringPiece literal) { +net::IPAddress CreateIPAddress(std::string_view literal) { net::IPAddress result; if (!result.AssignFromIPLiteral(literal)) { ADD_FAILURE() << "Failed parsing IP: " << literal; @@ -106,7 +107,7 @@ public: MockHostResolverProc() : HostResolverProc(nullptr) {} - void SetDnsResult(const std::vector<base::StringPiece>& ip_literals) { + void SetDnsResult(const std::vector<std::string_view>& ip_literals) { result_.clear(); for (const auto& ip : ip_literals) result_.push_back(net::IPEndPoint(CreateIPAddress(ip), 8080)); @@ -275,8 +276,8 @@ MockSocketFactory() = default; // Connect successes and failures that complete asynchronously - void AddUDPConnectSuccess(base::StringPiece peer_ip_literal, - base::StringPiece local_ip_literal, + void AddUDPConnectSuccess(std::string_view peer_ip_literal, + std::string_view local_ip_literal, int connect_order = -1) { auto peer_ip = CreateIPAddress(peer_ip_literal); auto local_ip = CreateIPAddress(local_ip_literal); @@ -288,7 +289,7 @@ connect_order); } - void AddUDPConnectFailure(base::StringPiece peer_ip, int connect_order = -1) { + void AddUDPConnectFailure(std::string_view peer_ip, int connect_order = -1) { AddUDPConnectResult(CreateIPAddress(peer_ip), net::IPAddress(), net::ERR_ADDRESS_UNREACHABLE, connect_order); }
diff --git a/services/network/proxy_resolving_client_socket_unittest.cc b/services/network/proxy_resolving_client_socket_unittest.cc index 4ae90952..b8fa684 100644 --- a/services/network/proxy_resolving_client_socket_unittest.cc +++ b/services/network/proxy_resolving_client_socket_unittest.cc
@@ -5,12 +5,12 @@ #include "services/network/proxy_resolving_client_socket.h" #include <string> +#include <string_view> #include <utility> #include <vector> #include "base/compiler_specific.h" #include "base/run_loop.h" -#include "base/strings/string_piece.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/test/scoped_feature_list.h" @@ -44,7 +44,7 @@ namespace { std::unique_ptr<net::ConfiguredProxyResolutionService> -CreateProxyResolutionService(base::StringPiece pac_result) { +CreateProxyResolutionService(std::string_view pac_result) { return net::ConfiguredProxyResolutionService::CreateFixedFromPacResultForTest( static_cast<std::string>(pac_result), TRAFFIC_ANNOTATION_FOR_TESTS); } @@ -73,7 +73,7 @@ } std::unique_ptr<net::URLRequestContextBuilder> CreateBuilder( - base::StringPiece pac_result = "PROXY bad:99; PROXY maybe:80; DIRECT") { + std::string_view pac_result = "PROXY bad:99; PROXY maybe:80; DIRECT") { auto builder = net::CreateTestURLRequestContextBuilder(); builder->set_proxy_resolution_service( CreateProxyResolutionService(pac_result)); @@ -336,7 +336,7 @@ }; const GURL kDestination("https://example.com:443"); for (auto test : kTestCases) { - base::StringPiece pac_result = + std::string_view pac_result = test.is_direct ? "DIRECT" : "PROXY myproxy.com:89"; auto context = CreateBuilder(pac_result)->Build(); net::StaticSocketDataProvider socket_data;
diff --git a/services/network/proxy_resolving_socket_mojo_unittest.cc b/services/network/proxy_resolving_socket_mojo_unittest.cc index 58e269a..44b82954 100644 --- a/services/network/proxy_resolving_socket_mojo_unittest.cc +++ b/services/network/proxy_resolving_socket_mojo_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include <string> +#include <string_view> #include <utility> #include <vector> @@ -338,9 +339,9 @@ Init("DIRECT"); set_fake_tls_handshake(true); - base::StringPiece client_hello = + std::string_view client_hello = webrtc::FakeSSLClientSocket::GetSslClientHello(); - base::StringPiece server_hello = + std::string_view server_hello = webrtc::FakeSSLClientSocket::GetSslServerHello(); std::vector<net::MockRead> reads = { net::MockRead(net::ASYNC, server_hello.data(), server_hello.length(), 1),
diff --git a/services/network/public/cpp/content_security_policy/content_security_policy.cc b/services/network/public/cpp/content_security_policy/content_security_policy.cc index 46d0285..a9c9a4a 100644 --- a/services/network/public/cpp/content_security_policy/content_security_policy.cc +++ b/services/network/public/cpp/content_security_policy/content_security_policy.cc
@@ -14,7 +14,6 @@ #include "base/ranges/algorithm.h" #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" @@ -36,7 +35,7 @@ using CSPDirectiveName = mojom::CSPDirectiveName; using DirectivesMap = - std::vector<std::pair<base::StringPiece, base::StringPiece>>; + std::vector<std::pair<std::string_view, std::string_view>>; namespace { @@ -56,7 +55,7 @@ return url.spec(); } -CSPDirectiveName ToCSPDirectiveName(base::StringPiece name) { +CSPDirectiveName ToCSPDirectiveName(std::string_view name) { if (base::EqualsCaseInsensitiveASCII(name, "base-uri")) { return CSPDirectiveName::BaseURI; } @@ -369,7 +368,7 @@ // Parses a "Content-Security-Policy" header. // Returns a map to the directives found. -DirectivesMap ParseHeaderValue(base::StringPiece header) { +DirectivesMap ParseHeaderValue(std::string_view header) { DirectivesMap result; // For each token returned by strictly splitting serialized on the @@ -383,11 +382,11 @@ // 4. Set directive name to be the result of running ASCII lowercase // on directive name. size_t pos = directive.find_first_of(base::kWhitespaceASCII); - base::StringPiece name = directive.substr(0, pos); + std::string_view name = directive.substr(0, pos); // 5. Let directive value be the result of splitting token on ASCII // whitespace. - base::StringPiece value; + std::string_view value; if (pos != std::string::npos) { value = base::TrimString(directive.substr(pos + 1), base::kWhitespaceASCII, base::TRIM_ALL); @@ -403,7 +402,7 @@ } // https://www.w3.org/TR/CSP3/#grammardef-scheme-part -bool ParseScheme(base::StringPiece scheme, mojom::CSPSource* csp_source) { +bool ParseScheme(std::string_view scheme, mojom::CSPSource* csp_source) { if (scheme.empty()) return false; @@ -424,7 +423,7 @@ } // https://www.w3.org/TR/CSP3/#grammardef-host-part -bool ParseHost(base::StringPiece host, mojom::CSPSource* csp_source) { +bool ParseHost(std::string_view host, mojom::CSPSource* csp_source) { if (host.size() == 0) return false; @@ -445,7 +444,7 @@ if (host.empty()) return false; - for (const base::StringPiece& piece : base::SplitStringPiece( + for (const std::string_view& piece : base::SplitStringPiece( host, ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL)) { if (piece.empty() || !base::ranges::all_of(piece, [](auto c) { return base::IsAsciiAlpha(c) || base::IsAsciiDigit(c) || c == '-'; @@ -458,7 +457,7 @@ } // https://www.w3.org/TR/CSP3/#grammardef-port-part -bool ParsePort(base::StringPiece port, mojom::CSPSource* csp_source) { +bool ParsePort(std::string_view port, mojom::CSPSource* csp_source) { if (port.empty()) return false; @@ -467,8 +466,8 @@ return true; } - if (!base::ranges::all_of( - port, base::IsAsciiDigit<base::StringPiece::value_type>)) { + if (!base::ranges::all_of(port, + base::IsAsciiDigit<std::string_view::value_type>)) { return false; } @@ -476,7 +475,7 @@ } // https://www.w3.org/TR/CSP3/#grammardef-path-part -bool ParsePath(base::StringPiece path, mojom::CSPSource* csp_source) { +bool ParsePath(std::string_view path, mojom::CSPSource* csp_source) { DCHECK_NE(0U, path.size()); if (path[0] != '/') return false; @@ -507,7 +506,7 @@ // Checks whether |expression| is a valid base64-encoded string. // Cf. https://w3c.github.io/webappsec-csp/#framework-directive-source-list. -bool IsBase64(base::StringPiece expression) { +bool IsBase64(std::string_view expression) { if (expression.empty()) return false; @@ -522,13 +521,13 @@ } // Parse a nonce-source, return false on error. -bool ParseNonce(base::StringPiece expression, std::string* nonce) { +bool ParseNonce(std::string_view expression, std::string* nonce) { if (!base::StartsWith(expression, "'nonce-", base::CompareCase::INSENSITIVE_ASCII)) { return false; } - base::StringPiece subexpression = + std::string_view subexpression = expression.substr(7, expression.length() - 8); if (!IsBase64(subexpression)) @@ -549,7 +548,7 @@ }; // Parse a hash-source, return false on error. -bool ParseHash(base::StringPiece expression, mojom::CSPHashSource* hash) { +bool ParseHash(std::string_view expression, mojom::CSPHashSource* hash) { static const SupportedPrefixesStruct SupportedPrefixes[] = { {"'sha256-", 8, mojom::CSPHashAlgorithm::SHA256}, {"'sha384-", 8, mojom::CSPHashAlgorithm::SHA384}, @@ -561,7 +560,7 @@ for (auto item : SupportedPrefixes) { if (base::StartsWith(expression, item.prefix, base::CompareCase::INSENSITIVE_ASCII)) { - base::StringPiece subexpression = expression.substr( + std::string_view subexpression = expression.substr( item.prefix_length, expression.length() - item.prefix_length - 1); if (!IsBase64(subexpression)) return false; @@ -594,9 +593,9 @@ // Append parsing errors to |parsing_errors|. mojom::CSPSourceListPtr ParseSourceList( CSPDirectiveName directive_name, - base::StringPiece directive_value, + std::string_view directive_value, std::vector<std::string>& parsing_errors) { - base::StringPiece value = + std::string_view value = base::TrimString(directive_value, base::kWhitespaceASCII, base::TRIM_ALL); auto directive = mojom::CSPSourceList::New(); @@ -604,7 +603,7 @@ if (base::EqualsCaseInsensitiveASCII(value, "'none'")) return directive; - std::vector<base::StringPiece> tokens = + std::vector<std::string_view> tokens = base::SplitStringPiece(value, base::kWhitespaceASCII, base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); @@ -749,7 +748,7 @@ // Parse the 'required-trusted-types-for' directive. // https://w3c.github.io/trusted-types/dist/spec/#require-trusted-types-for-csp-directive network::mojom::CSPRequireTrustedTypesFor ParseRequireTrustedTypesFor( - base::StringPiece value, + std::string_view value, std::vector<std::string>& parsing_errors) { network::mojom::CSPRequireTrustedTypesFor out = network::mojom::CSPRequireTrustedTypesFor::None; @@ -780,7 +779,7 @@ // This implements tt-policy-name from // https://w3c.github.io/trusted-types/dist/spec/#trusted-types-csp-directive -bool IsValidTrustedTypesPolicyName(base::StringPiece value) { +bool IsValidTrustedTypesPolicyName(std::string_view value) { return base::ranges::all_of(value, [](char c) { return base::IsAsciiAlpha(c) || base::IsAsciiDigit(c) || base::Contains("-#=_/@.%", c); @@ -790,10 +789,10 @@ // Parse the 'trusted-types' directive. // https://w3c.github.io/trusted-types/dist/spec/#trusted-types-csp-directive network::mojom::CSPTrustedTypesPtr ParseTrustedTypes( - base::StringPiece value, + std::string_view value, std::vector<std::string>& parsing_errors) { auto out = network::mojom::CSPTrustedTypes::New(); - std::vector<base::StringPiece> pieces = + std::vector<std::string_view> pieces = base::SplitStringPiece(value, base::kWhitespaceASCII, base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); @@ -828,11 +827,11 @@ // Parses a reporting directive. // https://w3c.github.io/webappsec-csp/#directives-reporting void ParseReportDirective(const GURL& request_url, - base::StringPiece value, + std::string_view value, bool using_reporting_api, std::vector<std::string>* report_endpoints, std::vector<std::string>& parsing_errors) { - std::vector<base::StringPiece> values = + std::vector<std::string_view> values = base::SplitStringPiece(value, base::kWhitespaceASCII, base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); @@ -883,7 +882,7 @@ } void WarnIfDirectiveValueNotEmpty( - const std::pair<base::StringPiece, base::StringPiece>& directive, + const std::pair<std::string_view, std::string_view>& directive, std::vector<std::string>& parsing_errors) { if (!directive.second.empty()) { parsing_errors.emplace_back(base::StringPrintf( @@ -941,7 +940,7 @@ } void AddContentSecurityPolicyFromHeader( - base::StringPiece header, + std::string_view header, mojom::ContentSecurityPolicyType type, mojom::ContentSecurityPolicySource source, const GURL& base_url, @@ -1264,7 +1263,7 @@ } std::vector<mojom::ContentSecurityPolicyPtr> ParseContentSecurityPolicies( - base::StringPiece header_value, + std::string_view header_value, mojom::ContentSecurityPolicyType type, mojom::ContentSecurityPolicySource source, const GURL& base_url) { @@ -1291,7 +1290,7 @@ if (!headers.GetNormalizedHeader("Allow-CSP-From", &allow_csp_from)) return nullptr; - base::StringPiece trimmed = + std::string_view trimmed = base::TrimWhitespaceASCII(allow_csp_from, base::TRIM_ALL); if (trimmed == "*") @@ -1307,7 +1306,7 @@ } bool ParseSource(CSPDirectiveName directive_name, - base::StringPiece expression, + std::string_view expression, mojom::CSPSource* csp_source, std::vector<std::string>& parsing_errors) { size_t position = expression.find_first_of(":/"); @@ -1350,7 +1349,7 @@ // ^ if (expression[0] == ':') { size_t port_end = expression.find_first_of("/"); - base::StringPiece port = expression.substr( + std::string_view port = expression.substr( 1, port_end == std::string::npos ? std::string::npos : port_end - 1); if (!ParsePort(port, csp_source)) { return false;
diff --git a/services/network/public/cpp/content_security_policy/content_security_policy.h b/services/network/public/cpp/content_security_policy/content_security_policy.h index fc258f4..2890b84 100644 --- a/services/network/public/cpp/content_security_policy/content_security_policy.h +++ b/services/network/public/cpp/content_security_policy/content_security_policy.h
@@ -5,8 +5,9 @@ #ifndef SERVICES_NETWORK_PUBLIC_CPP_CONTENT_SECURITY_POLICY_CONTENT_SECURITY_POLICY_H_ #define SERVICES_NETWORK_PUBLIC_CPP_CONTENT_SECURITY_POLICY_CONTENT_SECURITY_POLICY_H_ +#include <string_view> + #include "base/component_export.h" -#include "base/strings/string_piece.h" #include "services/network/public/mojom/content_security_policy.mojom.h" class GURL; @@ -76,7 +77,7 @@ COMPONENT_EXPORT(NETWORK_CPP) std::vector<mojom::ContentSecurityPolicyPtr> ParseContentSecurityPolicies( - base::StringPiece header, + std::string_view header, mojom::ContentSecurityPolicyType type, mojom::ContentSecurityPolicySource source, const GURL& base_url); @@ -95,7 +96,7 @@ // (for example, if there is a url with a non-empty query part). COMPONENT_EXPORT(NETWORK_CPP) bool ParseSource(mojom::CSPDirectiveName directive_name, - base::StringPiece expression, + std::string_view expression, mojom::CSPSource* csp_source, std::vector<std::string>& parsing_errors);
diff --git a/services/network/public/cpp/content_security_policy/content_security_policy_unittest.cc b/services/network/public/cpp/content_security_policy/content_security_policy_unittest.cc index 02e8d94..439178c 100644 --- a/services/network/public/cpp/content_security_policy/content_security_policy_unittest.cc +++ b/services/network/public/cpp/content_security_policy/content_security_policy_unittest.cc
@@ -6,7 +6,6 @@ #include "base/containers/contains.h" #include "base/memory/raw_ref.h" -#include "base/strings/string_piece.h" #include "base/strings/stringprintf.h" #include "base/test/scoped_feature_list.h" #include "net/http/http_response_headers.h" @@ -104,7 +103,7 @@ scheme_to_bypass_.push_back(scheme); } - bool SchemeShouldBypassCSP(const base::StringPiece& scheme) override { + bool SchemeShouldBypassCSP(const std::string_view& scheme) override { return base::Contains(scheme_to_bypass_, scheme); }
diff --git a/services/network/public/cpp/content_security_policy/csp_context.cc b/services/network/public/cpp/content_security_policy/csp_context.cc index 6df4376..bb700d1 100644 --- a/services/network/public/cpp/content_security_policy/csp_context.cc +++ b/services/network/public/cpp/content_security_policy/csp_context.cc
@@ -60,7 +60,7 @@ return result; } -bool CSPContext::SchemeShouldBypassCSP(const base::StringPiece& scheme) { +bool CSPContext::SchemeShouldBypassCSP(const std::string_view& scheme) { // Blink uses its SchemeRegistry to check if a scheme should be bypassed. // It can't be used on the browser process. It is used for two things: // 1) Bypassing the "chrome-extension" scheme when chrome is built with the
diff --git a/services/network/public/cpp/content_security_policy/csp_context.h b/services/network/public/cpp/content_security_policy/csp_context.h index 6474cf0..2cc75e8 100644 --- a/services/network/public/cpp/content_security_policy/csp_context.h +++ b/services/network/public/cpp/content_security_policy/csp_context.h
@@ -5,6 +5,8 @@ #ifndef SERVICES_NETWORK_PUBLIC_CPP_CONTENT_SECURITY_POLICY_CSP_CONTEXT_H_ #define SERVICES_NETWORK_PUBLIC_CPP_CONTENT_SECURITY_POLICY_CSP_CONTEXT_H_ +#include <string_view> + #include "services/network/public/cpp/content_security_policy/content_security_policy.h" #include "services/network/public/mojom/content_security_policy.mojom.h" @@ -84,7 +86,7 @@ // This is declared virtual only so that it can be overridden for unit // testing. - virtual bool SchemeShouldBypassCSP(const base::StringPiece& scheme); + virtual bool SchemeShouldBypassCSP(const std::string_view& scheme); }; } // namespace network
diff --git a/services/network/public/cpp/content_security_policy/csp_context_unittest.cc b/services/network/public/cpp/content_security_policy/csp_context_unittest.cc index 9e29764..2641124 100644 --- a/services/network/public/cpp/content_security_policy/csp_context_unittest.cc +++ b/services/network/public/cpp/content_security_policy/csp_context_unittest.cc
@@ -3,8 +3,8 @@ // found in the LICENSE file. #include <set> +#include <string_view> -#include "base/strings/string_piece.h" #include "services/network/public/cpp/content_security_policy/content_security_policy.h" #include "services/network/public/cpp/content_security_policy/csp_context.h" #include "services/network/public/mojom/content_security_policy.mojom.h" @@ -27,7 +27,7 @@ scheme_to_bypass_.insert(scheme); } - bool SchemeShouldBypassCSP(const base::StringPiece& scheme) override { + bool SchemeShouldBypassCSP(const std::string_view& scheme) override { return scheme_to_bypass_.count(std::string(scheme)); }
diff --git a/services/network/public/cpp/content_security_policy/csp_source.cc b/services/network/public/cpp/content_security_policy/csp_source.cc index 6d50e6f..f4f28daf 100644 --- a/services/network/public/cpp/content_security_policy/csp_source.cc +++ b/services/network/public/cpp/content_security_policy/csp_source.cc
@@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <sstream> - #include "services/network/public/cpp/content_security_policy/csp_source.h" +#include <sstream> +#include <string_view> + #include "base/check_op.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -22,7 +23,7 @@ return !source.host.empty() || source.is_host_wildcard; } -bool DecodePath(const base::StringPiece& path, std::string* output) { +bool DecodePath(const std::string_view& path, std::string* output) { url::RawCanonOutputT<char16_t> unescaped; url::DecodeURLEscapeSequences(path, url::DecodeURLMode::kUTF8OrIsomorphic, &unescaped);
diff --git a/services/network/public/cpp/corb/corb_api.h b/services/network/public/cpp/corb/corb_api.h index 59f26902..cfbbe275 100644 --- a/services/network/public/cpp/corb/corb_api.h +++ b/services/network/public/cpp/corb/corb_api.h
@@ -7,9 +7,9 @@ #include <memory> #include <set> +#include <string_view> #include "base/component_export.h" -#include "base/strings/string_piece.h" #include "services/network/public/mojom/fetch_api.mojom.h" #include "services/network/public/mojom/url_response_head.mojom-forward.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -77,7 +77,7 @@ // The Sniff method should be called if an earlier call to Init (or Sniff) // returned Decision::kSniffMore. This method will attempt to calculate the // `Decision` based on the (prefix of the) HTTP response body. - virtual Decision Sniff(base::StringPiece response_body) = 0; + virtual Decision Sniff(std::string_view response_body) = 0; // The HandleEndOfSniffableResponseBody should be called if earlier calls to // Init/Sniff returned kSniffMore, but there is nothing more to sniff (because
diff --git a/services/network/public/cpp/corb/corb_impl.cc b/services/network/public/cpp/corb/corb_impl.cc index 3ff878b9..3ea864a 100644 --- a/services/network/public/cpp/corb/corb_impl.cc +++ b/services/network/public/cpp/corb/corb_impl.cc
@@ -20,7 +20,6 @@ #include "base/metrics/histogram_macros.h" #include "base/notreached.h" #include "base/ranges/algorithm.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "net/base/mime_sniffer.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" @@ -32,7 +31,6 @@ #include "services/network/public/mojom/network_service.mojom.h" #include "services/network/public/mojom/url_response_head.mojom.h" -using base::StringPiece; using Decision = network::corb::ResponseAnalyzer::Decision; using MimeType = network::corb::CrossOriginReadBlocking::MimeType; using SniffingResult = network::corb::CrossOriginReadBlocking::SniffingResult; @@ -76,11 +74,11 @@ const char kJsonSuffix[] = "+json"; const char kXmlSuffix[] = "+xml"; -void AdvancePastWhitespace(StringPiece* data) { +void AdvancePastWhitespace(std::string_view* data) { size_t offset = data->find_first_not_of(" \t\r\n"); - if (offset == base::StringPiece::npos) { + if (offset == std::string_view::npos) { // |data| was entirely whitespace. - *data = StringPiece(); + *data = std::string_view(); } else { data->remove_prefix(offset); } @@ -91,8 +89,8 @@ // |signatures|, and kNo otherwise. // // When kYes is returned, the matching prefix is erased from |data|. -SniffingResult MatchesSignature(StringPiece* data, - const StringPiece signatures[], +SniffingResult MatchesSignature(std::string_view* data, + const std::string_view signatures[], size_t arr_size, base::CompareCase compare_case) { for (size_t i = 0; i < arr_size; ++i) { @@ -114,7 +112,7 @@ return CrossOriginReadBlocking::kNo; } -size_t FindFirstJavascriptLineTerminator(const base::StringPiece& hay, +size_t FindFirstJavascriptLineTerminator(const std::string_view& hay, size_t pos) { // https://www.ecma-international.org/ecma-262/8.0/index.html#prod-LineTerminator // defines LineTerminator ::= <LF> | <CR> | <LS> | <PS>. @@ -125,8 +123,9 @@ // In UTF8 encoding <LS> is 0xE2 0x80 0xA8 and <PS> is 0xE2 0x80 0xA9. while (true) { pos = hay.find_first_of("\n\r\xe2", pos); - if (pos == base::StringPiece::npos) + if (pos == std::string_view::npos) { break; + } if (hay[pos] != '\xe2') { DCHECK(hay[pos] == '\r' || hay[pos] == '\n'); @@ -135,7 +134,7 @@ // TODO(lukasza): Prevent matching 3 bytes that span/straddle 2 UTF8 // characters. - base::StringPiece substr = hay.substr(pos); + std::string_view substr = hay.substr(pos); if (base::StartsWith(substr, "\u2028") || base::StartsWith(substr, "\u2029")) break; @@ -156,26 +155,28 @@ // SingleLineHTMLCloseComment ECMAscript rule is taken into account which means // that characters following an HTML comment are consumed up to the nearest line // terminating character. -SniffingResult MaybeSkipHtmlComment(StringPiece* data) { - constexpr StringPiece kStartString = "<!--"; +SniffingResult MaybeSkipHtmlComment(std::string_view* data) { + constexpr std::string_view kStartString = "<!--"; if (!base::StartsWith(*data, kStartString)) { if (base::StartsWith(kStartString, *data)) return CrossOriginReadBlocking::kMaybe; return CrossOriginReadBlocking::kNo; } - constexpr StringPiece kEndString = "-->"; + constexpr std::string_view kEndString = "-->"; size_t end_of_html_comment = data->find(kEndString, kStartString.length()); - if (end_of_html_comment == StringPiece::npos) + if (end_of_html_comment == std::string_view::npos) { return CrossOriginReadBlocking::kMaybe; + } end_of_html_comment += kEndString.length(); // Skipping until the first line terminating character. See // https://crbug.com/839945 for the motivation behind this. size_t end_of_line = FindFirstJavascriptLineTerminator(*data, end_of_html_comment); - if (end_of_line == base::StringPiece::npos) + if (end_of_line == std::string_view::npos) { return CrossOriginReadBlocking::kMaybe; + } // Found real end of the combined HTML/JS comment. data->remove_prefix(end_of_line); @@ -211,7 +212,7 @@ // "application/pdf" even though Chrome happens to support this resource type. const auto& GetNeverSniffedMimeTypes() { static constexpr auto kNeverSniffedMimeTypes = base::MakeFixedFlatSet< - base::StringPiece>({ + std::string_view>({ // clang-format off // The types below (zip, protobuf, etc.) are based on most commonly used // content types according to HTTP Archive - see: @@ -286,8 +287,7 @@ } // namespace // static -bool CrossOriginReadBlocking::IsJavascriptMimeType( - base::StringPiece mime_type) { +bool CrossOriginReadBlocking::IsJavascriptMimeType(std::string_view mime_type) { constexpr auto kCaseInsensitive = base::CompareCase::INSENSITIVE_ASCII; for (const std::string& suffix : kJavaScriptSuffixes) { if (base::EndsWith(mime_type, suffix, kCaseInsensitive)) @@ -299,7 +299,7 @@ // static MimeType CrossOriginReadBlocking::GetCanonicalMimeType( - base::StringPiece mime_type) { + std::string_view mime_type) { // Checking for image/svg+xml and application/dash+xml early ensures that they // won't get classified as MimeType::kXml by the presence of the "+xml" // suffix. @@ -340,7 +340,7 @@ // static // This function is a slight modification of |net::SniffForHTML|. -SniffingResult CrossOriginReadBlocking::SniffForHTML(StringPiece data) { +SniffingResult CrossOriginReadBlocking::SniffForHTML(std::string_view data) { // The content sniffers used by Chrome and Firefox are using "<!--" as one of // the HTML signatures, but it also appears in valid JavaScript, considered as // well-formed JS by the browser. Since we do not want to block any JS, we @@ -355,21 +355,21 @@ // TODO(dsjang): Once CrossOriginReadBlocking is moved into the browser // process, we should do single-thread checking here for the static // initializer. - static constexpr StringPiece kHtmlSignatures[] = { - StringPiece("<!doctype html"), // HTML5 spec - StringPiece("<script"), // HTML5 spec, Mozilla - StringPiece("<html"), // HTML5 spec, Mozilla - StringPiece("<head"), // HTML5 spec, Mozilla - StringPiece("<iframe"), // Mozilla - StringPiece("<h1"), // Mozilla - StringPiece("<div"), // Mozilla - StringPiece("<font"), // Mozilla - StringPiece("<table"), // Mozilla - StringPiece("<a"), // Mozilla - StringPiece("<style"), // Mozilla - StringPiece("<title"), // Mozilla - StringPiece("<b"), // Mozilla (note: subsumes <body>, <br>) - StringPiece("<p") // Mozilla + static constexpr std::string_view kHtmlSignatures[] = { + std::string_view("<!doctype html"), // HTML5 spec + std::string_view("<script"), // HTML5 spec, Mozilla + std::string_view("<html"), // HTML5 spec, Mozilla + std::string_view("<head"), // HTML5 spec, Mozilla + std::string_view("<iframe"), // Mozilla + std::string_view("<h1"), // Mozilla + std::string_view("<div"), // Mozilla + std::string_view("<font"), // Mozilla + std::string_view("<table"), // Mozilla + std::string_view("<a"), // Mozilla + std::string_view("<style"), // Mozilla + std::string_view("<title"), // Mozilla + std::string_view("<b"), // Mozilla (note: subsumes <body>, <br>) + std::string_view("<p") // Mozilla }; while (data.length() > 0) { @@ -391,18 +391,19 @@ } // static -SniffingResult CrossOriginReadBlocking::SniffForXML(base::StringPiece data) { +SniffingResult CrossOriginReadBlocking::SniffForXML(std::string_view data) { // TODO(dsjang): Once CrossOriginReadBlocking is moved into the browser // process, we should do single-thread checking here for the static // initializer. AdvancePastWhitespace(&data); - static constexpr StringPiece kXmlSignatures[] = {StringPiece("<?xml")}; + static constexpr std::string_view kXmlSignatures[] = { + std::string_view("<?xml")}; return MatchesSignature(&data, kXmlSignatures, std::size(kXmlSignatures), base::CompareCase::SENSITIVE); } // static -SniffingResult CrossOriginReadBlocking::SniffForJSON(base::StringPiece data) { +SniffingResult CrossOriginReadBlocking::SniffForJSON(std::string_view data) { // Currently this function looks for an opening brace ('{'), followed by a // double-quoted string literal, followed by a colon. Importantly, such a // sequence is a Javascript syntax error: although the JSON object syntax is @@ -462,7 +463,7 @@ // static SniffingResult CrossOriginReadBlocking::SniffForFetchOnlyResource( - base::StringPiece data) { + std::string_view data) { // kScriptBreakingPrefixes contains prefixes that are conventionally used to // prevent a JSON response from becoming a valid Javascript program (an attack // vector known as XSSI). The presence of such a prefix is a strong signal @@ -474,7 +475,7 @@ // infinite loop. In either case, the prefix must create a guarantee that no // matter what bytes follow it, the entire response would be worthless to // execute as a <script>. - static constexpr StringPiece kScriptBreakingPrefixes[] = { + static constexpr std::string_view kScriptBreakingPrefixes[] = { // Parser breaker prefix. // // Built into angular.js (followed by a comma and a newline): @@ -484,19 +485,19 @@ // https://goo.gl/xP7FWn // // Observed on google.com (without a comma, followed by a newline). - StringPiece(")]}'"), + std::string_view(")]}'"), // Apache struts: https://struts.apache.org/plugins/json/#prefix - StringPiece("{}&&"), + std::string_view("{}&&"), // Spring framework (historically): https://goo.gl/JYPFAv - StringPiece("{} &&"), + std::string_view("{} &&"), // Infinite loops. - StringPiece("for(;;);"), // observed on facebook.com - StringPiece("while(1);"), - StringPiece("for (;;);"), - StringPiece("while (1);"), + std::string_view("for(;;);"), // observed on facebook.com + std::string_view("while(1);"), + std::string_view("for (;;);"), + std::string_view("while (1);"), }; SniffingResult has_parser_breaker = MatchesSignature( &data, kScriptBreakingPrefixes, std::size(kScriptBreakingPrefixes), @@ -516,7 +517,7 @@ // Called after data is read from the network. |sniffing_buffer| contains the // entire response body delivered thus far. - virtual void OnDataAvailable(base::StringPiece sniffing_buffer) = 0; + virtual void OnDataAvailable(std::string_view sniffing_buffer) = 0; // Returns true if the return value of IsConfirmedContentType() might change // with the addition of more data. Returns false if a final decision is @@ -546,7 +547,7 @@ SimpleConfirmationSniffer& operator=(const SimpleConfirmationSniffer*) = delete; - void OnDataAvailable(base::StringPiece sniffing_buffer) final { + void OnDataAvailable(std::string_view sniffing_buffer) final { // The sniffing functions don't support streaming, so with each new chunk of // data, call the sniffer on the whole buffer. last_sniff_result_ = (*sniffer_function_)(sniffing_buffer); @@ -906,7 +907,7 @@ } Decision CrossOriginReadBlocking::CorbResponseAnalyzer::Sniff( - base::StringPiece data) { + std::string_view data) { DCHECK(needs_sniffing()); DCHECK(!sniffers_.empty()); DCHECK(!found_blockable_content_);
diff --git a/services/network/public/cpp/corb/corb_impl.h b/services/network/public/cpp/corb/corb_impl.h index ad317b3..84d4f70 100644 --- a/services/network/public/cpp/corb/corb_impl.h +++ b/services/network/public/cpp/corb/corb_impl.h
@@ -7,11 +7,11 @@ #include <memory> #include <string> +#include <string_view> #include <vector> #include "base/component_export.h" #include "base/gtest_prod_util.h" -#include "base/strings/string_piece.h" #include "services/network/public/cpp/corb/corb_api.h" #include "services/network/public/mojom/fetch_api.mojom.h" #include "services/network/public/mojom/url_response_head.mojom-forward.h" @@ -116,7 +116,7 @@ mojom::RequestMode request_mode, mojom::RequestDestination /*request_destination_from_renderer*/, const network::mojom::URLResponseHead& response) override; - Decision Sniff(base::StringPiece data) override; + Decision Sniff(std::string_view data) override; Decision HandleEndOfSniffableResponseBody() override; bool ShouldReportBlockedResponse() const override; BlockedResponseHandling ShouldHandleBlockedResponseAs() const override; @@ -282,22 +282,22 @@ // Returns whether `mime_type` is a Javascript MIME type based on // https://mimesniff.spec.whatwg.org/#javascript-mime-type - static bool IsJavascriptMimeType(base::StringPiece mime_type); + static bool IsJavascriptMimeType(std::string_view mime_type); // Returns the representative mime type enum value of the mime type of // response. For example, this returns the same value for all text/xml mime // type families such as application/xml, application/rss+xml. - static MimeType GetCanonicalMimeType(base::StringPiece mime_type); + static MimeType GetCanonicalMimeType(std::string_view mime_type); - static SniffingResult SniffForHTML(base::StringPiece data); - static SniffingResult SniffForXML(base::StringPiece data); - static SniffingResult SniffForJSON(base::StringPiece data); + static SniffingResult SniffForHTML(std::string_view data); + static SniffingResult SniffForXML(std::string_view data); + static SniffingResult SniffForJSON(std::string_view data); // Sniff for patterns that indicate |data| only ought to be consumed by XHR() // or fetch(). This detects Javascript parser-breaker and particular JS // infinite-loop patterns, which are used conventionally as a defense against // JSON data exfiltration by means of a <script> tag. - static SniffingResult SniffForFetchOnlyResource(base::StringPiece data); + static SniffingResult SniffForFetchOnlyResource(std::string_view data); }; inline std::ostream& operator<<(
diff --git a/services/network/public/cpp/corb/corb_impl_unittest.cc b/services/network/public/cpp/corb/corb_impl_unittest.cc index e1b7df5a..d0e06f8 100644 --- a/services/network/public/cpp/corb/corb_impl_unittest.cc +++ b/services/network/public/cpp/corb/corb_impl_unittest.cc
@@ -9,10 +9,10 @@ #include <initializer_list> #include <memory> #include <string> +#include <string_view> #include <utility> #include <vector> -#include "base/strings/string_piece.h" #include "base/test/task_environment.h" #include "net/base/mime_sniffer.h" #include "net/http/http_util.h" @@ -27,7 +27,6 @@ #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" -using base::StringPiece; using CorbResponseAnalyzer = network::corb::CrossOriginReadBlocking::CorbResponseAnalyzer; using CrossOriginProtectionDecision = @@ -2161,7 +2160,7 @@ // Unlike CORB, ORB blocks all 206 responses, unless there was an earlier // request to the same URL and that earlier request was classified (based on // the MIME type or sniffing) as an audio-or-video response. - base::StringPiece description = scenario.description; + std::string_view description = scenario.description; if (description == "Blocked-by-ORB: text/plain 206 media" || description == "Blocked-by-ORB: Javascript 206" || description == "Blocked-by-ORB: application/octet-stream 206 (middle)") { @@ -2274,13 +2273,14 @@ EXPECT_EQ(SniffingResult::kYes, CORB::SniffForHTML("<!-- --> \x80 \n<b")); // Commented out html tag followed by non-html (" x"). - StringPiece commented_out_html_tag_data("<!-- <html> <?xml> \n<html>-->\nx"); + std::string_view commented_out_html_tag_data( + "<!-- <html> <?xml> \n<html>-->\nx"); EXPECT_EQ(SniffingResult::kNo, CORB::SniffForHTML(commented_out_html_tag_data)); // Prefixes of |commented_out_html_tag_data| should be indeterminate. // This covers testing "<!-" as well as "<!-- not terminated yet...". - StringPiece almost_html = commented_out_html_tag_data; + std::string_view almost_html = commented_out_html_tag_data; while (!almost_html.empty()) { almost_html.remove_suffix(1); EXPECT_EQ(SniffingResult::kMaybe, CORB::SniffForHTML(almost_html)) @@ -2297,9 +2297,10 @@ } TEST(CrossOriginReadBlockingTest, SniffForXML) { - StringPiece xml_data(" \t \r \n <?xml version=\"1.0\"?>\n <catalog"); - StringPiece non_xml_data(" var name=window.location;\nadfadf"); - StringPiece empty_data(""); + std::string_view xml_data( + " \t \r \n <?xml version=\"1.0\"?>\n <catalog"); + std::string_view non_xml_data(" var name=window.location;\nadfadf"); + std::string_view empty_data(""); EXPECT_EQ(SniffingResult::kYes, CrossOriginReadBlocking::SniffForXML(xml_data)); @@ -2312,12 +2313,12 @@ } TEST(CrossOriginReadBlockingTest, SniffForJSON) { - StringPiece json_data("\t\t\r\n { \"name\" : \"chrome\", "); - StringPiece json_corrupt_after_first_key( + std::string_view json_data("\t\t\r\n { \"name\" : \"chrome\", "); + std::string_view json_corrupt_after_first_key( "\t\t\r\n { \"name\" :^^^^!!@#\1\", "); - StringPiece json_data2("{ \"key \\\" \" \t\t\r\n:"); - StringPiece non_json_data0("\t\t\r\n { name : \"chrome\", "); - StringPiece non_json_data1("\t\t\r\n foo({ \"name\" : \"chrome\", "); + std::string_view json_data2("{ \"key \\\" \" \t\t\r\n:"); + std::string_view non_json_data0("\t\t\r\n { name : \"chrome\", "); + std::string_view non_json_data1("\t\t\r\n foo({ \"name\" : \"chrome\", "); EXPECT_EQ(SniffingResult::kYes, CrossOriginReadBlocking::SniffForJSON(json_data)); @@ -2328,7 +2329,7 @@ CrossOriginReadBlocking::SniffForJSON(json_data2)); // All prefixes prefixes of |json_data2| ought to be indeterminate. - StringPiece almost_json = json_data2; + std::string_view almost_json = json_data2; while (!almost_json.empty()) { almost_json.remove_suffix(1); EXPECT_EQ(SniffingResult::kMaybe,
diff --git a/services/network/public/cpp/corb/orb_impl.cc b/services/network/public/cpp/corb/orb_impl.cc index faff4d6..bd40928b 100644 --- a/services/network/public/cpp/corb/orb_impl.cc +++ b/services/network/public/cpp/corb/orb_impl.cc
@@ -8,7 +8,6 @@ #include "base/metrics/histogram_functions.h" #include "base/rand_util.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "net/base/mime_sniffer.h" #include "net/http/http_util.h" @@ -24,7 +23,7 @@ namespace { -bool IsNonSniffableImageMimeType(base::StringPiece mime_type) { +bool IsNonSniffableImageMimeType(std::string_view mime_type) { // TODO(lukasza): Once full Javascript sniffing is implemented, we may start // to undesirably block future (=unsniffable) image formats. We should // explicitly recognize MIME types of such image formats below. See also @@ -35,7 +34,7 @@ return base::EqualsCaseInsensitiveASCII(mime_type, "image/svg+xml"); } -bool IsAudioOrVideoMimeType(base::StringPiece mime_type) { +bool IsAudioOrVideoMimeType(std::string_view mime_type) { // TODO(lukasza): Restrict this to only known, non-sniffable audio/video types // (hopefully we can reach agreement on this approach + document this in ORB // spec). See also https://github.com/annevk/orb/issues/3. Notes: @@ -81,13 +80,13 @@ return false; } -bool IsTextCssMimeType(base::StringPiece mime_type) { +bool IsTextCssMimeType(std::string_view mime_type) { return base::EqualsCaseInsensitiveASCII(mime_type, "text/css"); } // ORB spec says that "An opaque-safelisted MIME type" is a JavaScript MIME type // or a MIME type whose essence is "text/css" or "image/svg+xml". -bool IsOpaqueSafelistedMimeType(base::StringPiece mime_type) { +bool IsOpaqueSafelistedMimeType(std::string_view mime_type) { // Based on the spec: Is it a MIME type whose essence is text/css [...] ? if (IsTextCssMimeType(mime_type)) return true; @@ -111,7 +110,7 @@ // ORB spec defines "an opaque-safelisted MIME type". Until we have full ORB // compliance, we'll need to handle some MIME types differently and run the // JavaScript-parser-breaker sniffer from CORB on these resources. -bool IsOpaqueSafelistedMimeTypeThatWeSniffAnyway(base::StringPiece mime_type) { +bool IsOpaqueSafelistedMimeTypeThatWeSniffAnyway(std::string_view mime_type) { // Based on the spec, but handled in HandleEndOfSniffableResponseBody: // Is it a JavaScript MIME type? if (CrossOriginReadBlocking::IsJavascriptMimeType(mime_type)) @@ -342,7 +341,7 @@ return Decision::kSniffMore; } -Decision OpaqueResponseBlockingAnalyzer::Sniff(base::StringPiece data) { +Decision OpaqueResponseBlockingAnalyzer::Sniff(std::string_view data) { std::string sniffed_mime_type; net::SniffMimeTypeFromLocalData(data, &sniffed_mime_type);
diff --git a/services/network/public/cpp/corb/orb_impl.h b/services/network/public/cpp/corb/orb_impl.h index 66d411c..a13cde2 100644 --- a/services/network/public/cpp/corb/orb_impl.h +++ b/services/network/public/cpp/corb/orb_impl.h
@@ -5,6 +5,8 @@ #ifndef SERVICES_NETWORK_PUBLIC_CPP_CORB_ORB_IMPL_H_ #define SERVICES_NETWORK_PUBLIC_CPP_CORB_ORB_IMPL_H_ +#include <string_view> + #include "base/component_export.h" #include "base/memory/raw_ptr.h" #include "services/network/public/cpp/corb/corb_api.h" @@ -38,7 +40,7 @@ mojom::RequestMode request_mode, mojom::RequestDestination request_destination_from_renderer, const network::mojom::URLResponseHead& response) override; - Decision Sniff(base::StringPiece data) override; + Decision Sniff(std::string_view data) override; Decision HandleEndOfSniffableResponseBody() override; bool ShouldReportBlockedResponse() const override; BlockedResponseHandling ShouldHandleBlockedResponseAs() const override;
diff --git a/services/network/public/cpp/cors/cors.cc b/services/network/public/cpp/cors/cors.cc index 85710e1..0a81feea 100644 --- a/services/network/public/cpp/cors/cors.cc +++ b/services/network/public/cpp/cors/cors.cc
@@ -5,6 +5,7 @@ #include "services/network/public/cpp/cors/cors.h" #include <set> +#include <string_view> #include <vector> #include "base/containers/contains.h" @@ -12,7 +13,6 @@ #include "base/feature_list.h" #include "base/metrics/histogram_functions.h" #include "base/ranges/algorithm.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "net/base/mime_util.h" #include "net/http/http_byte_range.h" @@ -292,7 +292,7 @@ } // CORS-Safelisted headers are the only headers permitted in a CORS request. - static constexpr auto safe_names = base::MakeFixedFlatSet<base::StringPiece>({ + static constexpr auto safe_names = base::MakeFixedFlatSet<std::string_view>({ // [Block 1 - Specification] // Headers in this section are included in the order listed by:
diff --git a/services/network/public/cpp/crash_keys.cc b/services/network/public/cpp/crash_keys.cc index 0a0d2bc..fb15f59 100644 --- a/services/network/public/cpp/crash_keys.cc +++ b/services/network/public/cpp/crash_keys.cc
@@ -18,7 +18,7 @@ } } // namespace -void SetDeserializationCrashKeyString(base::StringPiece str) { +void SetDeserializationCrashKeyString(std::string_view str) { base::debug::SetCrashKeyString(GetCrashKey(), std::move(str)); }
diff --git a/services/network/public/cpp/crash_keys.h b/services/network/public/cpp/crash_keys.h index d70e0fc..e1590f7 100644 --- a/services/network/public/cpp/crash_keys.h +++ b/services/network/public/cpp/crash_keys.h
@@ -5,14 +5,15 @@ #ifndef SERVICES_NETWORK_PUBLIC_CPP_CRASH_KEYS_H_ #define SERVICES_NETWORK_PUBLIC_CPP_CRASH_KEYS_H_ +#include <string_view> + #include "base/component_export.h" -#include "base/strings/string_piece.h" namespace network { namespace debug { COMPONENT_EXPORT(NETWORK_CPP_CRASH_KEYS) -void SetDeserializationCrashKeyString(base::StringPiece str); +void SetDeserializationCrashKeyString(std::string_view str); COMPONENT_EXPORT(NETWORK_CPP_CRASH_KEYS) void ClearDeserializationCrashKeyString();
diff --git a/services/network/public/cpp/cross_origin_embedder_policy_parser.cc b/services/network/public/cpp/cross_origin_embedder_policy_parser.cc index 7c80d2e..02553cd 100644 --- a/services/network/public/cpp/cross_origin_embedder_policy_parser.cc +++ b/services/network/public/cpp/cross_origin_embedder_policy_parser.cc
@@ -5,9 +5,9 @@ #include "services/network/public/cpp/cross_origin_embedder_policy_parser.h" #include <algorithm> +#include <string_view> #include <utility> -#include "base/strings/string_piece.h" #include "net/http/http_response_headers.h" #include "net/http/structured_headers.h" #include "services/network/public/cpp/cross_origin_embedder_policy.h" @@ -22,7 +22,7 @@ // [spec]: https://html.spec.whatwg.org/C/#obtain-an-embedder-policy std::pair<mojom::CrossOriginEmbedderPolicyValue, absl::optional<std::string>> -Parse(base::StringPiece header_value) { +Parse(std::string_view header_value) { using Item = net::structured_headers::Item; const auto item = net::structured_headers::ParseItem(header_value); if (!item || item->item.Type() != net::structured_headers::Item::kTokenType) {
diff --git a/services/network/public/cpp/cross_origin_opener_policy_parser.cc b/services/network/public/cpp/cross_origin_opener_policy_parser.cc index bc92645..db194117 100644 --- a/services/network/public/cpp/cross_origin_opener_policy_parser.cc +++ b/services/network/public/cpp/cross_origin_opener_policy_parser.cc
@@ -4,8 +4,9 @@ #include "services/network/public/cpp/cross_origin_opener_policy_parser.h" +#include <string_view> + #include "base/ranges/algorithm.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "net/http/http_response_headers.h" #include "net/http/structured_headers.h" @@ -30,7 +31,7 @@ // parsed values from |header|. // Note: if |header| is invalid, |value|, |soap_by_default_value| and // |endpoint| will not be modified. -void ParseHeader(base::StringPiece header_value, +void ParseHeader(std::string_view header_value, mojom::CrossOriginOpenerPolicyValue* value, mojom::CrossOriginOpenerPolicyValue* soap_by_default_value, absl::optional<std::string>* endpoint) {
diff --git a/services/network/public/cpp/cross_origin_opener_policy_parser_fuzzer.cc b/services/network/public/cpp/cross_origin_opener_policy_parser_fuzzer.cc index ff2fc2e..60fa3ac 100644 --- a/services/network/public/cpp/cross_origin_opener_policy_parser_fuzzer.cc +++ b/services/network/public/cpp/cross_origin_opener_policy_parser_fuzzer.cc
@@ -5,6 +5,7 @@ #include "services/network/public/cpp/cross_origin_opener_policy_parser.h" #include <string> +#include <string_view> #include "base/memory/scoped_refptr.h" #include "base/strings/strcat.h" @@ -12,7 +13,7 @@ #include "services/network/public/cpp/cross_origin_opener_policy.h" extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - base::StringPiece test_data(reinterpret_cast<const char*>(data), size); + std::string_view test_data(reinterpret_cast<const char*>(data), size); std::string header_string = base::StrCat( {"HTTP/1.1 200 OK\nCross-Origin-Opener-Policy: ", test_data, "\n\n"});
diff --git a/services/network/public/cpp/data_element.h b/services/network/public/cpp/data_element.h index bbe3921..1c7113d 100644 --- a/services/network/public/cpp/data_element.h +++ b/services/network/public/cpp/data_element.h
@@ -10,6 +10,7 @@ #include <limits> #include <memory> +#include <string_view> #include <type_traits> #include <utility> #include <vector> @@ -17,7 +18,6 @@ #include "base/component_export.h" #include "base/files/file_path.h" #include "base/notreached.h" -#include "base/strings/string_piece.h" #include "base/time/time.h" #include "base/types/strong_alias.h" #include "mojo/public/cpp/bindings/pending_remote.h" @@ -43,9 +43,9 @@ const std::vector<uint8_t>& bytes() const { return bytes_; } - base::StringPiece AsStringPiece() const { - return base::StringPiece(reinterpret_cast<const char*>(bytes_.data()), - bytes_.size()); + std::string_view AsStringPiece() const { + return std::string_view(reinterpret_cast<const char*>(bytes_.data()), + bytes_.size()); } DataElementBytes Clone() const;
diff --git a/services/network/public/cpp/data_pipe_to_source_stream_unittest.cc b/services/network/public/cpp/data_pipe_to_source_stream_unittest.cc index 6606a7fc..17eef2ea 100644 --- a/services/network/public/cpp/data_pipe_to_source_stream_unittest.cc +++ b/services/network/public/cpp/data_pipe_to_source_stream_unittest.cc
@@ -4,7 +4,8 @@ #include "services/network/public/cpp/data_pipe_to_source_stream.h" -#include "base/strings/string_piece.h" +#include <string_view> + #include "base/test/task_environment.h" #include "net/base/io_buffer.h" #include "net/base/test_completion_callback.h" @@ -48,7 +49,7 @@ : output_buffer_(base::MakeRefCounted<net::IOBufferWithSize>( GetParam().buffer_size)) {} - void Init(base::StringPiece message) { + void Init(std::string_view message) { message_ = message; const MojoCreateDataPipeOptions data_pipe_options{ sizeof(MojoCreateDataPipeOptions), MOJO_CREATE_DATA_PIPE_FLAG_NONE, 1, @@ -120,7 +121,7 @@ scoped_refptr<net::IOBufferWithSize> output_buffer_; std::unique_ptr<DataPipeToSourceStream> adapter_; mojo::ScopedDataPipeProducerHandle producer_end_; - base::StringPiece message_; + std::string_view message_; }; INSTANTIATE_TEST_SUITE_P(
diff --git a/services/network/public/cpp/header_util.cc b/services/network/public/cpp/header_util.cc index 10d3892..d044083 100644 --- a/services/network/public/cpp/header_util.cc +++ b/services/network/public/cpp/header_util.cc
@@ -73,8 +73,8 @@ } // namespace -bool IsRequestHeaderSafe(const base::StringPiece& key, - const base::StringPiece& value) { +bool IsRequestHeaderSafe(const std::string_view& key, + const std::string_view& value) { for (const auto* header : kUnsafeHeaders) { if (base::EqualsCaseInsensitiveASCII(header, key)) return false; @@ -118,7 +118,7 @@ return policy; } - std::vector<base::StringPiece> policy_tokens = + std::vector<std::string_view> policy_tokens = base::SplitStringPiece(referrer_policy_header, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
diff --git a/services/network/public/cpp/header_util.h b/services/network/public/cpp/header_util.h index 31933f3..e50b7a20 100644 --- a/services/network/public/cpp/header_util.h +++ b/services/network/public/cpp/header_util.h
@@ -5,8 +5,9 @@ #ifndef SERVICES_NETWORK_PUBLIC_CPP_HEADER_UTIL_H_ #define SERVICES_NETWORK_PUBLIC_CPP_HEADER_UTIL_H_ +#include <string_view> + #include "base/component_export.h" -#include "base/strings/string_piece.h" #include "services/network/public/mojom/referrer_policy.mojom.h" class GURL; @@ -22,8 +23,8 @@ // Checks if a single request header is safe to send. COMPONENT_EXPORT(NETWORK_CPP) -bool IsRequestHeaderSafe(const base::StringPiece& key, - const base::StringPiece& value); +bool IsRequestHeaderSafe(const std::string_view& key, + const std::string_view& value); // Checks if any single header in a set of request headers is not safe to send. // When adding sets of headers together, it's safe to call this on each set
diff --git a/services/network/public/cpp/header_util_unittest.cc b/services/network/public/cpp/header_util_unittest.cc index 4b32d9b..d876da32 100644 --- a/services/network/public/cpp/header_util_unittest.cc +++ b/services/network/public/cpp/header_util_unittest.cc
@@ -4,7 +4,6 @@ #include "services/network/public/cpp/header_util.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "net/http/http_request_headers.h"
diff --git a/services/network/public/cpp/host_resolver_mojom_traits.h b/services/network/public/cpp/host_resolver_mojom_traits.h index 415f9ba2..5b1267f 100644 --- a/services/network/public/cpp/host_resolver_mojom_traits.h +++ b/services/network/public/cpp/host_resolver_mojom_traits.h
@@ -6,6 +6,7 @@ #define SERVICES_NETWORK_PUBLIC_CPP_HOST_RESOLVER_MOJOM_TRAITS_H_ #include <string> +#include <string_view> #include <utility> #include <vector> @@ -36,7 +37,7 @@ StructTraits<network::mojom::DnsOverHttpsServerConfigDataView, net::DnsOverHttpsServerConfig> { public: - static base::StringPiece server_template( + static std::string_view server_template( const net::DnsOverHttpsServerConfig& server) { return server.server_template(); }
diff --git a/services/network/public/cpp/ip_address_space_util.cc b/services/network/public/cpp/ip_address_space_util.cc index c7f44f4d..29792be5 100644 --- a/services/network/public/cpp/ip_address_space_util.cc +++ b/services/network/public/cpp/ip_address_space_util.cc
@@ -10,7 +10,6 @@ #include "base/no_destructor.h" #include "base/numerics/safe_conversions.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "net/base/ip_address.h" #include "net/base/ip_endpoint.h" @@ -29,7 +28,7 @@ using net::IPEndPoint; // Parses a string of the form "<URL-safe IP address>:<port>". -absl::optional<IPEndPoint> ParseEndpoint(base::StringPiece str) { +absl::optional<IPEndPoint> ParseEndpoint(std::string_view str) { // Find the last colon character in `str`. We do not use // `base::SplitStringPiece()` because IPv6 address literals may contain colon // characters too. @@ -38,13 +37,13 @@ return absl::nullopt; } - base::StringPiece address_str = str.substr(0, pos); + std::string_view address_str = str.substr(0, pos); // Skip the colon. Note that this is safe because if `pos` is not `npos`, it // is guaranteed to be < `str.size()`, and `substr()` accepts arguments that // are <= `str.size()`. In other words, if the colon character is the last in // `str`, then `port_str` is assigned "". - base::StringPiece port_str = str.substr(pos + 1); + std::string_view port_str = str.substr(pos + 1); IPAddress address; if (!net::ParseURLHostnameToAddress(address_str, &address)) { @@ -68,7 +67,7 @@ return IPEndPoint(address, port); } -absl::optional<IPAddressSpace> ParseIPAddressSpace(base::StringPiece str) { +absl::optional<IPAddressSpace> ParseIPAddressSpace(std::string_view str) { if (str == "public") { return IPAddressSpace::kPublic; } @@ -94,8 +93,8 @@ }; // Parses an override from `str`, of the form "<endpoint>=<space>". -absl::optional<EndpointOverride> ParseEndpointOverride(base::StringPiece str) { - std::vector<base::StringPiece> tokens = base::SplitStringPiece( +absl::optional<EndpointOverride> ParseEndpointOverride(std::string_view str) { + std::vector<std::string_view> tokens = base::SplitStringPiece( str, "=", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); // There should be 2 parts: the endpoint and the address space. @@ -103,8 +102,8 @@ return absl::nullopt; } - base::StringPiece endpoint = tokens[0]; - base::StringPiece address_space = tokens[1]; + std::string_view endpoint = tokens[0]; + std::string_view address_space = tokens[1]; absl::optional<IPEndPoint> parsed_endpoint = ParseEndpoint(endpoint); if (!parsed_endpoint.has_value()) { @@ -124,14 +123,13 @@ } // Parses a comma-separated list of overrides. Ignores invalid entries. -std::vector<EndpointOverride> ParseEndpointOverrideList( - base::StringPiece list) { +std::vector<EndpointOverride> ParseEndpointOverrideList(std::string_view list) { // Since we skip invalid entries anyway, we can skip empty entries. - std::vector<base::StringPiece> tokens = base::SplitStringPiece( + std::vector<std::string_view> tokens = base::SplitStringPiece( list, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); std::vector<EndpointOverride> endpoint_overrides; - for (base::StringPiece token : tokens) { + for (std::string_view token : tokens) { absl::optional<EndpointOverride> parsed = ParseEndpointOverride(token); if (parsed.has_value()) { endpoint_overrides.push_back(*std::move(parsed)); @@ -276,7 +274,7 @@ } // namespace -base::StringPiece IPAddressSpaceToStringPiece(IPAddressSpace space) { +std::string_view IPAddressSpaceToStringPiece(IPAddressSpace space) { switch (space) { case IPAddressSpace::kUnknown: return "unknown";
diff --git a/services/network/public/cpp/ip_address_space_util.h b/services/network/public/cpp/ip_address_space_util.h index 3d9b753a..eb991b0 100644 --- a/services/network/public/cpp/ip_address_space_util.h +++ b/services/network/public/cpp/ip_address_space_util.h
@@ -5,11 +5,11 @@ #ifndef SERVICES_NETWORK_PUBLIC_CPP_IP_ADDRESS_SPACE_UTIL_H_ #define SERVICES_NETWORK_PUBLIC_CPP_IP_ADDRESS_SPACE_UTIL_H_ +#include <string_view> #include <vector> #include "base/component_export.h" #include "base/memory/raw_ptr_exclusion.h" -#include "base/strings/string_piece.h" #include "services/network/public/mojom/ip_address_space.mojom-forward.h" #include "services/network/public/mojom/parsed_headers.mojom-forward.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -27,7 +27,7 @@ namespace network { // Returns a human-readable string representing `space`, suitable for logging. -base::StringPiece COMPONENT_EXPORT(NETWORK_CPP) +std::string_view COMPONENT_EXPORT(NETWORK_CPP) IPAddressSpaceToStringPiece(mojom::IPAddressSpace space); // Returns the `IPAddressSpace` to which `address` belongs.
diff --git a/services/network/public/cpp/ip_address_space_util_unittest.cc b/services/network/public/cpp/ip_address_space_util_unittest.cc index 5885e2a..07306203 100644 --- a/services/network/public/cpp/ip_address_space_util_unittest.cc +++ b/services/network/public/cpp/ip_address_space_util_unittest.cc
@@ -170,7 +170,7 @@ IPAddressSpace::kPublic); } -IPAddress ParseIPAddress(base::StringPiece str) { +IPAddress ParseIPAddress(std::string_view str) { IPAddress address; EXPECT_TRUE(address.AssignFromIPLiteral(str)) << "Failed to parse IP address: " << str;
diff --git a/services/network/public/cpp/is_potentially_trustworthy.cc b/services/network/public/cpp/is_potentially_trustworthy.cc index a1f34ef4..c0098aa 100644 --- a/services/network/public/cpp/is_potentially_trustworthy.cc +++ b/services/network/public/cpp/is_potentially_trustworthy.cc
@@ -5,6 +5,7 @@ #include "services/network/public/cpp/is_potentially_trustworthy.h" #include <iterator> +#include <string_view> #include <utility> #include <vector> @@ -48,7 +49,7 @@ // IsValidWildcardPattern() ensures there is at least one '*'. DCHECK(!hostname_pattern.empty()); - std::vector<base::StringPiece> components = base::SplitStringPiece( + std::vector<std::string_view> components = base::SplitStringPiece( hostname_pattern, ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); // If there are more than 4, it can't match an IPv4 IP. if (components.size() > 4) @@ -260,7 +261,7 @@ return false; } -bool IsSchemeConsideredAuthenticated(base::StringPiece scheme) { +bool IsSchemeConsideredAuthenticated(std::string_view scheme) { // The code below is based on the specification at // https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-origin
diff --git a/services/network/public/cpp/is_potentially_trustworthy_unittest.cc b/services/network/public/cpp/is_potentially_trustworthy_unittest.cc index fea5e04..3eb3d93c 100644 --- a/services/network/public/cpp/is_potentially_trustworthy_unittest.cc +++ b/services/network/public/cpp/is_potentially_trustworthy_unittest.cc
@@ -221,7 +221,7 @@ static bool IsOriginPotentiallyTrustworthy(const OriginType& origin) { return network::IsOriginPotentiallyTrustworthy(origin); } - static bool IsUrlPotentiallyTrustworthy(base::StringPiece str) { + static bool IsUrlPotentiallyTrustworthy(std::string_view str) { return network::IsUrlPotentiallyTrustworthy(GURL(str)); } static bool IsOriginOfLocalhost(const OriginType& origin) {
diff --git a/services/network/public/cpp/is_potentially_trustworthy_unittest.h b/services/network/public/cpp/is_potentially_trustworthy_unittest.h index 3f5105f..fa7a92a 100644 --- a/services/network/public/cpp/is_potentially_trustworthy_unittest.h +++ b/services/network/public/cpp/is_potentially_trustworthy_unittest.h
@@ -5,8 +5,9 @@ #ifndef SERVICES_NETWORK_PUBLIC_CPP_IS_POTENTIALLY_TRUSTWORTHY_UNITTEST_H_ #define SERVICES_NETWORK_PUBLIC_CPP_IS_POTENTIALLY_TRUSTWORTHY_UNITTEST_H_ +#include <string_view> + #include "base/containers/contains.h" -#include "base/strings/string_piece.h" #include "base/test/scoped_command_line.h" #include "net/base/url_util.h" #include "services/network/public/cpp/is_potentially_trustworthy.h" @@ -22,7 +23,7 @@ // with a class that has to expose the same members as url::UrlOriginTestTraits // and the following extra members: // static bool IsOriginPotentiallyTrustworthy(const OriginType& origin); -// static bool IsUrlPotentiallyTrustworthy(base::StringPiece str); +// static bool IsUrlPotentiallyTrustworthy(std::string_view str); // static bool IsOriginOfLocalhost(const OriginType& origin); template <typename TTrustworthinessTraits> class AbstractTrustworthinessTest @@ -37,11 +38,11 @@ bool IsOriginPotentiallyTrustworthy(const OriginType& origin) { return TTrustworthinessTraits::IsOriginPotentiallyTrustworthy(origin); } - bool IsOriginPotentiallyTrustworthy(base::StringPiece str) { + bool IsOriginPotentiallyTrustworthy(std::string_view str) { auto origin = this->CreateOriginFromString(str); return TTrustworthinessTraits::IsOriginPotentiallyTrustworthy(origin); } - bool IsUrlPotentiallyTrustworthy(base::StringPiece str) { + bool IsUrlPotentiallyTrustworthy(std::string_view str) { return TTrustworthinessTraits::IsUrlPotentiallyTrustworthy(str); } bool IsOriginOfLocalhost(const OriginType& origin) {
diff --git a/services/network/public/cpp/net_ipc_param_traits.cc b/services/network/public/cpp/net_ipc_param_traits.cc index 3eae443..a141b46 100644 --- a/services/network/public/cpp/net_ipc_param_traits.cc +++ b/services/network/public/cpp/net_ipc_param_traits.cc
@@ -4,6 +4,8 @@ #include "services/network/public/cpp/net_ipc_param_traits.h" +#include <string_view> + #include "ipc/ipc_message_utils.h" #include "ipc/ipc_mojo_param_traits.h" #include "ipc/ipc_platform_file.h" @@ -76,7 +78,7 @@ bool ParamTraits<net::HashValue>::Read(const base::Pickle* m, base::PickleIterator* iter, param_type* r) { - base::StringPiece encoded; + std::string_view encoded; return iter->ReadStringPiece(&encoded) && r->FromString(encoded); }
diff --git a/services/network/public/cpp/parsed_headers_unittest.cc b/services/network/public/cpp/parsed_headers_unittest.cc index a3f086a..fa8bca03 100644 --- a/services/network/public/cpp/parsed_headers_unittest.cc +++ b/services/network/public/cpp/parsed_headers_unittest.cc
@@ -5,10 +5,10 @@ #include "services/network/public/cpp/parsed_headers.h" #include <string> +#include <string_view> #include <tuple> #include "base/memory/scoped_refptr.h" -#include "base/strings/string_piece.h" #include "base/test/scoped_feature_list.h" #include "base/types/expected.h" #include "net/http/http_response_headers.h" @@ -21,7 +21,7 @@ namespace network { namespace { -mojom::ParsedHeadersPtr ParseHeaders(const base::StringPiece headers) { +mojom::ParsedHeadersPtr ParseHeaders(const std::string_view headers) { std::string raw_headers = net::HttpUtil::AssembleRawHeaders(headers); auto parsed = base::MakeRefCounted<net::HttpResponseHeaders>(raw_headers); return network::PopulateParsedHeaders(parsed.get(), GURL("https://a.com")); @@ -29,7 +29,7 @@ class NoVarySearchPrefetchDisabledTest : public ::testing::Test, - public ::testing::WithParamInterface<base::StringPiece> { + public ::testing::WithParamInterface<std::string_view> { public: NoVarySearchPrefetchDisabledTest() { scoped_feature_list_.InitAndDisableFeature( @@ -47,7 +47,7 @@ EXPECT_FALSE(parsed_headers->no_vary_search_with_parse_error); } -constexpr base::StringPiece no_vary_search_prefetch_disabled_data[] = { +constexpr std::string_view no_vary_search_prefetch_disabled_data[] = { // No No-Vary-Search header. "HTTP/1.1 200 OK\r\n" "Set-Cookie: a\r\n" @@ -66,7 +66,7 @@ TEST(NoVarySearchPrefetchEnabledTest, ParsingNVSReturnsDefaultURLVariance) { base::test::ScopedFeatureList feature_list( network::features::kPrefetchNoVarySearch); - const base::StringPiece& headers = + const std::string_view& headers = "HTTP/1.1 200 OK\r\n" "Set-Cookie: a\r\n" "Set-Cookie: b\r\n\r\n"; @@ -83,7 +83,7 @@ TEST(NoVarySearchPrefetchEnabledTest, ParsingNVSReturnsDefaultValue) { base::test::ScopedFeatureList feature_list( network::features::kPrefetchNoVarySearch); - const base::StringPiece& headers = + const std::string_view& headers = "HTTP/1.1 200 OK\r\n" "Set-Cookie: a\r\n" "Set-Cookie: b\r\n" @@ -101,7 +101,7 @@ TEST(NoVarySearchPrefetchEnabledTest, ParsingNVSReturnsNotDictionary) { base::test::ScopedFeatureList feature_list( network::features::kPrefetchNoVarySearch); - const base::StringPiece& headers = + const std::string_view& headers = "HTTP/1.1 200 OK\r\n" "Set-Cookie: a\r\n" "Set-Cookie: b\r\n" @@ -119,7 +119,7 @@ TEST(NoVarySearchPrefetchEnabledTest, ParsingNVSReturnsUnknownDictionaryKey) { base::test::ScopedFeatureList feature_list( network::features::kPrefetchNoVarySearch); - const base::StringPiece& headers = + const std::string_view& headers = "HTTP/1.1 200 OK\r\n" "Set-Cookie: a\r\n" "Set-Cookie: b\r\n" @@ -137,7 +137,7 @@ TEST(NoVarySearchPrefetchEnabledTest, ParsingNVSReturnsNonBooleanKeyOrder) { base::test::ScopedFeatureList feature_list( network::features::kPrefetchNoVarySearch); - const base::StringPiece& headers = + const std::string_view& headers = "HTTP/1.1 200 OK\r\n" "Set-Cookie: a\r\n" "Set-Cookie: b\r\n" @@ -155,7 +155,7 @@ TEST(NoVarySearchPrefetchEnabledTest, ParsingNVSReturnsParamsNotStringList) { base::test::ScopedFeatureList feature_list( network::features::kPrefetchNoVarySearch); - const base::StringPiece& headers = + const std::string_view& headers = "HTTP/1.1 200 OK\r\n" "Set-Cookie: a\r\n" "Set-Cookie: b\r\n" @@ -173,7 +173,7 @@ TEST(NoVarySearchPrefetchEnabledTest, ParsingNVSReturnsExceptNotStringList) { base::test::ScopedFeatureList feature_list( network::features::kPrefetchNoVarySearch); - const base::StringPiece& headers = + const std::string_view& headers = "HTTP/1.1 200 OK\r\n" "Set-Cookie: a\r\n" "Set-Cookie: b\r\n" @@ -192,7 +192,7 @@ ParsingNVSReturnsExceptWithoutTrueParams) { base::test::ScopedFeatureList feature_list( network::features::kPrefetchNoVarySearch); - const base::StringPiece& headers = + const std::string_view& headers = "HTTP/1.1 200 OK\r\n" "Set-Cookie: a\r\n" "Set-Cookie: b\r\n" @@ -302,7 +302,7 @@ testing::ValuesIn(response_headers_tests)); TEST(ParseHeadersClientHintsTest, AcceptCHAndClearCHWithoutClearSiteDataTest) { - const base::StringPiece& headers = + const std::string_view& headers = "HTTP/1.1 200 OK\r\n" "Accept-CH: sec-ch-dpr\r\n" "Critical-CH: sec-ch-dpr\r\n\r\n"; @@ -323,7 +323,7 @@ TEST(ParseHeadersClientHintsTest, AcceptCHAndClearCHWithClearSiteDataCacheTest) { - const base::StringPiece& headers = + const std::string_view& headers = "HTTP/1.1 200 OK\r\n" "Accept-CH: sec-ch-dpr\r\n" "Critical-CH: sec-ch-dpr\r\n" @@ -339,7 +339,7 @@ TEST(ParseHeadersClientHintsTest, AcceptCHAndClearCHWithClearSiteDataClientHintsTest) { - const base::StringPiece& headers = + const std::string_view& headers = "HTTP/1.1 200 OK\r\n" "Accept-CH: sec-ch-dpr\r\n" "Critical-CH: sec-ch-dpr\r\n" @@ -355,7 +355,7 @@ TEST(ParseHeadersClientHintsTest, AcceptCHAndClearCHWithClearSiteDataCookiesTest) { - const base::StringPiece& headers = + const std::string_view& headers = "HTTP/1.1 200 OK\r\n" "Accept-CH: sec-ch-dpr\r\n" "Critical-CH: sec-ch-dpr\r\n" @@ -371,7 +371,7 @@ TEST(ParseHeadersClientHintsTest, AcceptCHAndClearCHWithClearSiteDataStorageTest) { - const base::StringPiece& headers = + const std::string_view& headers = "HTTP/1.1 200 OK\r\n" "Accept-CH: sec-ch-dpr\r\n" "Critical-CH: sec-ch-dpr\r\n" @@ -392,7 +392,7 @@ } TEST(ParseHeadersClientHintsTest, AcceptCHAndClearCHWithClearSiteDataAllTest) { - const base::StringPiece& headers = + const std::string_view& headers = "HTTP/1.1 200 OK\r\n" "Accept-CH: sec-ch-dpr\r\n" "Critical-CH: sec-ch-dpr\r\n"
diff --git a/services/network/public/cpp/private_network_access_check_result.cc b/services/network/public/cpp/private_network_access_check_result.cc index b096600..fba2f36 100644 --- a/services/network/public/cpp/private_network_access_check_result.cc +++ b/services/network/public/cpp/private_network_access_check_result.cc
@@ -6,7 +6,6 @@ #include <ostream> -#include "base/strings/string_piece.h" #include "services/network/public/mojom/cors.mojom-shared.h" namespace network { @@ -15,7 +14,7 @@ using Result = PrivateNetworkAccessCheckResult; -base::StringPiece PrivateNetworkAccessCheckResultToStringPiece(Result result) { +std::string_view PrivateNetworkAccessCheckResultToStringPiece(Result result) { switch (result) { case Result::kAllowedMissingClientSecurityState: return "allowed-missing-client-security-state";
diff --git a/services/network/public/cpp/private_network_access_check_result.h b/services/network/public/cpp/private_network_access_check_result.h index d568883..b3b6399f6 100644 --- a/services/network/public/cpp/private_network_access_check_result.h +++ b/services/network/public/cpp/private_network_access_check_result.h
@@ -6,9 +6,9 @@ #define SERVICES_NETWORK_PUBLIC_CPP_PRIVATE_NETWORK_ACCESS_CHECK_RESULT_H_ #include <iosfwd> +#include <string_view> #include "base/component_export.h" -#include "base/strings/string_piece.h" #include "services/network/public/mojom/cors.mojom-forward.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -69,7 +69,7 @@ }; // Returns a human-readable string representing `result`, suitable for logging. -base::StringPiece COMPONENT_EXPORT(NETWORK_CPP) +std::string_view COMPONENT_EXPORT(NETWORK_CPP) PrivateNetworkAccessCheckResultToStringPiece( PrivateNetworkAccessCheckResult result);
diff --git a/services/network/public/cpp/server/http_server.cc b/services/network/public/cpp/server/http_server.cc index bee028fd..bb58067 100644 --- a/services/network/public/cpp/server/http_server.cc +++ b/services/network/public/cpp/server/http_server.cc
@@ -76,7 +76,7 @@ void HttpServer::SendOverWebSocket( int connection_id, - base::StringPiece data, + std::string_view data, net::NetworkTrafficAnnotationTag traffic_annotation) { HttpConnection* connection = FindConnection(connection_id); if (connection == NULL)
diff --git a/services/network/public/cpp/server/http_server.h b/services/network/public/cpp/server/http_server.h index 6c74552c..67b8325 100644 --- a/services/network/public/cpp/server/http_server.h +++ b/services/network/public/cpp/server/http_server.h
@@ -11,11 +11,11 @@ #include <map> #include <memory> #include <string> +#include <string_view> #include "base/component_export.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" -#include "base/strings/string_piece.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/remote.h" #include "net/http/http_status_code.h" @@ -69,7 +69,7 @@ const HttpServerRequestInfo& request, net::NetworkTrafficAnnotationTag traffic_annotation); void SendOverWebSocket(int connection_id, - base::StringPiece data, + std::string_view data, net::NetworkTrafficAnnotationTag traffic_annotation); // Sends the provided data directly to the given connection. No validation is // performed that data constitutes a valid HTTP response. A valid HTTP
diff --git a/services/network/public/cpp/server/http_server_request_info.cc b/services/network/public/cpp/server/http_server_request_info.cc index 06bd653..13414a3 100644 --- a/services/network/public/cpp/server/http_server_request_info.cc +++ b/services/network/public/cpp/server/http_server_request_info.cc
@@ -4,6 +4,8 @@ #include "services/network/public/cpp/server/http_server_request_info.h" +#include <string_view> + #include "base/strings/string_split.h" #include "base/strings/string_util.h" @@ -32,7 +34,7 @@ DCHECK_EQ(base::ToLowerASCII(header_value), header_value); std::string complete_value = base::ToLowerASCII(GetHeaderValue(header_name)); - for (const base::StringPiece& cur : + for (const std::string_view& cur : base::SplitStringPiece(complete_value, ",", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) { if (base::TrimString(cur, " \t", base::TRIM_ALL) == header_value)
diff --git a/services/network/public/cpp/server/http_server_unittest.cc b/services/network/public/cpp/server/http_server_unittest.cc index abcbd30..53c34be 100644 --- a/services/network/public/cpp/server/http_server_unittest.cc +++ b/services/network/public/cpp/server/http_server_unittest.cc
@@ -6,6 +6,7 @@ #include <algorithm> #include <memory> +#include <string_view> #include <utility> #include <vector> @@ -145,7 +146,7 @@ DCHECK_LE(0, body_size); auto headers = base::MakeRefCounted<net::HttpResponseHeaders>( net::HttpUtil::AssembleRawHeaders( - base::StringPiece(response.data(), end_of_headers))); + std::string_view(response.data(), end_of_headers))); return body_size >= headers->GetContentLength(); }
diff --git a/services/network/public/cpp/server/web_socket.cc b/services/network/public/cpp/server/web_socket.cc index 9337d13..d872a4d 100644 --- a/services/network/public/cpp/server/web_socket.cc +++ b/services/network/public/cpp/server/web_socket.cc
@@ -117,7 +117,7 @@ return FRAME_ERROR; } const std::string& read_buf = connection_->read_buf(); - base::StringPiece frame(read_buf); + std::string_view frame(read_buf); int bytes_consumed = 0; const ParseResult result = encoder_->DecodeFrame(frame, &bytes_consumed, message); @@ -134,7 +134,7 @@ } void WebSocket::Send( - base::StringPiece message, + std::string_view message, net::WebSocketFrameHeader::OpCodeEnum op_code, const net::NetworkTrafficAnnotationTag traffic_annotation) { if (closed_)
diff --git a/services/network/public/cpp/server/web_socket.h b/services/network/public/cpp/server/web_socket.h index c173b02..6d95a05 100644 --- a/services/network/public/cpp/server/web_socket.h +++ b/services/network/public/cpp/server/web_socket.h
@@ -7,9 +7,9 @@ #include <memory> #include <string> +#include <string_view> #include "base/memory/raw_ptr.h" -#include "base/strings/string_piece.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "net/websockets/websocket_frame.h" @@ -41,7 +41,7 @@ void Accept(const HttpServerRequestInfo& request, const net::NetworkTrafficAnnotationTag traffic_annotation); ParseResult Read(std::string* message); - void Send(base::StringPiece message, + void Send(std::string_view message, net::WebSocketFrameHeader::OpCodeEnum op_code, const net::NetworkTrafficAnnotationTag traffic_annotation);
diff --git a/services/network/public/cpp/server/web_socket_encoder.cc b/services/network/public/cpp/server/web_socket_encoder.cc index fd53a93..85f27c5 100644 --- a/services/network/public/cpp/server/web_socket_encoder.cc +++ b/services/network/public/cpp/server/web_socket_encoder.cc
@@ -40,7 +40,7 @@ const size_t kEightBytePayloadLengthField = 127; const size_t kMaskingKeyWidthInBytes = 4; -WebSocket::ParseResult DecodeFrameHybi17(const base::StringPiece& frame, +WebSocket::ParseResult DecodeFrameHybi17(const std::string_view& frame, bool client_frame, int* bytes_consumed, std::string* output, @@ -145,7 +145,7 @@ return final ? WebSocket::FRAME_OK_FINAL : WebSocket::FRAME_OK_MIDDLE; } -void EncodeFrameHybi17(base::StringPiece message, +void EncodeFrameHybi17(std::string_view message, int masking_key, bool compressed, net::WebSocketFrameHeader::OpCodeEnum op_code, @@ -294,7 +294,7 @@ WebSocketEncoder::~WebSocketEncoder() = default; WebSocket::ParseResult WebSocketEncoder::DecodeFrame( - const base::StringPiece& frame, + const std::string_view& frame, int* bytes_consumed, std::string* output) { bool compressed; @@ -321,7 +321,7 @@ return result; } -void WebSocketEncoder::EncodeTextFrame(base::StringPiece frame, +void WebSocketEncoder::EncodeTextFrame(std::string_view frame, int masking_key, std::string* output) { std::string compressed; @@ -332,7 +332,7 @@ EncodeFrameHybi17(frame, masking_key, false, op_code, output); } -void WebSocketEncoder::EncodePongFrame(base::StringPiece frame, +void WebSocketEncoder::EncodePongFrame(std::string_view frame, int masking_key, std::string* output) { constexpr auto op_code = net::WebSocketFrameHeader::OpCodeEnum::kOpCodePong; @@ -361,7 +361,7 @@ return true; } -bool WebSocketEncoder::Deflate(base::StringPiece message, std::string* output) { +bool WebSocketEncoder::Deflate(std::string_view message, std::string* output) { if (!deflater_) return false; if (!deflater_->AddBytes(message.data(), message.length())) {
diff --git a/services/network/public/cpp/server/web_socket_encoder.h b/services/network/public/cpp/server/web_socket_encoder.h index f5218d96..36761549 100644 --- a/services/network/public/cpp/server/web_socket_encoder.h +++ b/services/network/public/cpp/server/web_socket_encoder.h
@@ -7,10 +7,10 @@ #include <memory> #include <string> +#include <string_view> #include <vector> #include "base/component_export.h" -#include "base/strings/string_piece.h" #include "net/websockets/websocket_deflater.h" #include "net/websockets/websocket_inflater.h" #include "services/network/public/cpp/server/web_socket.h" @@ -44,13 +44,13 @@ static std::unique_ptr<WebSocketEncoder> CreateClient( const std::string& response_extensions); - WebSocket::ParseResult DecodeFrame(const base::StringPiece& frame, + WebSocket::ParseResult DecodeFrame(const std::string_view& frame, int* bytes_consumed, std::string* output); - void EncodeTextFrame(base::StringPiece frame, + void EncodeTextFrame(std::string_view frame, int masking_key, std::string* output); - void EncodePongFrame(base::StringPiece frame, + void EncodePongFrame(std::string_view frame, int masking_key, std::string* output); @@ -70,7 +70,7 @@ bool is_current_message_compressed_ = false; bool Inflate(std::string* message); - bool Deflate(base::StringPiece message, std::string* output); + bool Deflate(std::string_view message, std::string* output); Type type_; std::unique_ptr<net::WebSocketDeflater> deflater_;
diff --git a/services/network/public/cpp/simple_host_resolver_unittest.cc b/services/network/public/cpp/simple_host_resolver_unittest.cc index dc757d7..546cbc3 100644 --- a/services/network/public/cpp/simple_host_resolver_unittest.cc +++ b/services/network/public/cpp/simple_host_resolver_unittest.cc
@@ -4,6 +4,8 @@ #include "services/network/public/cpp/simple_host_resolver.h" +#include <string_view> + #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" #include "base/strings/string_util.h" @@ -21,7 +23,7 @@ namespace network { namespace { -net::IPEndPoint CreateExpectedEndPoint(base::StringPiece address, +net::IPEndPoint CreateExpectedEndPoint(std::string_view address, uint16_t port) { net::IPAddress ip_address; CHECK(ip_address.AssignFromIPLiteral(address)); @@ -29,7 +31,7 @@ } std::string CreateMappingRules( - std::vector<std::pair<base::StringPiece, base::StringPiece>> + std::vector<std::pair<std::string_view, std::string_view>> host_ip_address_pairs) { std::vector<std::string> map_rules; for (auto [host, ip_address] : host_ip_address_pairs) { @@ -45,7 +47,7 @@ : TestNetworkContextWithHostResolver(std::move(host_resolver)) {} static std::unique_ptr<MockNetworkContext> CreateNetworkContext( - base::StringPiece host_mapping_rules) { + std::string_view host_mapping_rules) { return std::make_unique<MockNetworkContext>( net::HostResolver::CreateStandaloneResolver( net::NetLog::Get(), /*options=*/absl::nullopt, host_mapping_rules,
diff --git a/services/network/public/cpp/simple_url_loader.cc b/services/network/public/cpp/simple_url_loader.cc index cf8c2f5..c592778 100644 --- a/services/network/public/cpp/simple_url_loader.cc +++ b/services/network/public/cpp/simple_url_loader.cc
@@ -7,6 +7,7 @@ #include <stdint.h> #include <algorithm> +#include <string_view> #include <utility> #include "base/check_op.h" @@ -20,7 +21,6 @@ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" -#include "base/strings/string_piece.h" #include "base/task/sequenced_task_runner.h" #include "base/task/task_traits.h" #include "base/task/thread_pool.h" @@ -1202,7 +1202,7 @@ base::WeakPtr<DownloadAsStreamBodyHandler> weak_this( weak_ptr_factory_.GetWeakPtr()); stream_consumer_->OnDataReceived( - base::StringPiece(data, length), + std::string_view(data, length), base::BindOnce(&DownloadAsStreamBodyHandler::Resume, weak_ptr_factory_.GetWeakPtr())); // Protect against deletion.
diff --git a/services/network/public/cpp/simple_url_loader_stream_consumer.h b/services/network/public/cpp/simple_url_loader_stream_consumer.h index be3d6a7..d763de6f 100644 --- a/services/network/public/cpp/simple_url_loader_stream_consumer.h +++ b/services/network/public/cpp/simple_url_loader_stream_consumer.h
@@ -5,9 +5,10 @@ #ifndef SERVICES_NETWORK_PUBLIC_CPP_SIMPLE_URL_LOADER_STREAM_CONSUMER_H_ #define SERVICES_NETWORK_PUBLIC_CPP_SIMPLE_URL_LOADER_STREAM_CONSUMER_H_ +#include <string_view> + #include "base/component_export.h" #include "base/functional/callback_forward.h" -#include "base/strings/string_piece.h" namespace network { @@ -35,7 +36,7 @@ // this method before calling OnComplete, even if partial responses are set to // be treated as errors (the default behavior), as it may not yet be known if // the request will succeed or fail. - virtual void OnDataReceived(base::StringPiece string_piece, + virtual void OnDataReceived(std::string_view string_piece, base::OnceClosure resume) = 0; // Called on successful completion, or error. In the default configuration,
diff --git a/services/network/public/cpp/simple_url_loader_unittest.cc b/services/network/public/cpp/simple_url_loader_unittest.cc index a437333..1ab3cfa3 100644 --- a/services/network/public/cpp/simple_url_loader_unittest.cc +++ b/services/network/public/cpp/simple_url_loader_unittest.cc
@@ -8,6 +8,7 @@ #include <list> #include <string> +#include <string_view> #include <utility> #include <vector> @@ -25,7 +26,6 @@ #include "base/run_loop.h" #include "base/sequence_checker.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/strings/stringprintf.h" #include "base/task/sequenced_task_runner.h" #include "base/test/bind.h" @@ -425,7 +425,7 @@ // SimpleURLLoaderStreamConsumer implementation: - void OnDataReceived(base::StringPiece string_piece, + void OnDataReceived(std::string_view string_piece, base::OnceClosure resume) override { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); EXPECT_FALSE(done_);
diff --git a/services/network/public/cpp/structured_headers_mojom_traits.h b/services/network/public/cpp/structured_headers_mojom_traits.h index 0b77392..95ec2f7 100644 --- a/services/network/public/cpp/structured_headers_mojom_traits.h +++ b/services/network/public/cpp/structured_headers_mojom_traits.h
@@ -8,11 +8,11 @@ #include <stdint.h> #include <string> +#include <string_view> #include <utility> #include <vector> #include "base/component_export.h" -#include "base/strings/string_piece.h" #include "mojo/public/cpp/base/byte_string_mojom_traits.h" #include "mojo/public/cpp/bindings/struct_traits.h" #include "mojo/public/cpp/bindings/union_traits.h" @@ -38,12 +38,12 @@ return item.GetDecimal(); } - static base::StringPiece string_value( + static std::string_view string_value( const net::structured_headers::Item& item) { return item.GetString(); } - static base::StringPiece token_value( + static std::string_view token_value( const net::structured_headers::Item& item) { return item.GetString(); } @@ -65,7 +65,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_STRUCTURED_HEADERS) StructTraits<network::mojom::StructuredHeadersParameterDataView, std::pair<std::string, net::structured_headers::Item>> { - static base::StringPiece key( + static std::string_view key( const std::pair<std::string, net::structured_headers::Item>& param) { return param.first; }
diff --git a/services/network/public/cpp/supports_loading_mode/supports_loading_mode_parser.cc b/services/network/public/cpp/supports_loading_mode/supports_loading_mode_parser.cc index efe11558..8e30b00 100644 --- a/services/network/public/cpp/supports_loading_mode/supports_loading_mode_parser.cc +++ b/services/network/public/cpp/supports_loading_mode/supports_loading_mode_parser.cc
@@ -5,7 +5,6 @@ #include "services/network/public/cpp/supports_loading_mode/supports_loading_mode_parser.h" #include "base/ranges/algorithm.h" -#include "base/strings/string_piece.h" #include "net/http/http_response_headers.h" #include "net/http/structured_headers.h" #include "services/network/public/mojom/supports_loading_mode.mojom.h" @@ -15,9 +14,9 @@ namespace { -constexpr base::StringPiece kSupportsLoadingMode = "Supports-Loading-Mode"; +constexpr std::string_view kSupportsLoadingMode = "Supports-Loading-Mode"; constexpr struct KnownLoadingMode { - base::StringPiece token; + std::string_view token; mojom::LoadingMode enumerator; } kKnownLoadingModes[] = { {"default", mojom::LoadingMode::kDefault}, @@ -30,7 +29,7 @@ } // namespace mojom::SupportsLoadingModePtr ParseSupportsLoadingMode( - base::StringPiece header_value) { + std::string_view header_value) { // A parse error in the HTTP structured headers syntax is a parse error for // the header value as a whole. auto list = net::structured_headers::ParseList(header_value);
diff --git a/services/network/public/cpp/supports_loading_mode/supports_loading_mode_parser.h b/services/network/public/cpp/supports_loading_mode/supports_loading_mode_parser.h index 4dbf42d5..7223611 100644 --- a/services/network/public/cpp/supports_loading_mode/supports_loading_mode_parser.h +++ b/services/network/public/cpp/supports_loading_mode/supports_loading_mode_parser.h
@@ -5,8 +5,9 @@ #ifndef SERVICES_NETWORK_PUBLIC_CPP_SUPPORTS_LOADING_MODE_SUPPORTS_LOADING_MODE_PARSER_H_ #define SERVICES_NETWORK_PUBLIC_CPP_SUPPORTS_LOADING_MODE_SUPPORTS_LOADING_MODE_PARSER_H_ +#include <string_view> + #include "base/component_export.h" -#include "base/strings/string_piece.h" #include "services/network/public/mojom/supports_loading_mode.mojom-forward.h" namespace net { @@ -23,7 +24,7 @@ // Returns nullptr if the header syntax was invalid. COMPONENT_EXPORT(NETWORK_CPP) mojom::SupportsLoadingModePtr ParseSupportsLoadingMode( - base::StringPiece header_value); + std::string_view header_value); // Parse Supports-Loading-Modes from HTTP response headers. If multiple headers // are found, they are assumed to be canonicalized by joining them with commas,
diff --git a/services/network/public/cpp/supports_loading_mode/supports_loading_mode_parser_unittest.cc b/services/network/public/cpp/supports_loading_mode/supports_loading_mode_parser_unittest.cc index 9b474d3..1f176456 100644 --- a/services/network/public/cpp/supports_loading_mode/supports_loading_mode_parser_unittest.cc +++ b/services/network/public/cpp/supports_loading_mode/supports_loading_mode_parser_unittest.cc
@@ -4,7 +4,6 @@ #include "services/network/public/cpp/supports_loading_mode/supports_loading_mode_parser.h" -#include "base/strings/string_piece.h" #include "net/http/http_response_headers.h" #include "services/network/public/mojom/supports_loading_mode.mojom.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/services/network/public/cpp/trust_token_http_headers.cc b/services/network/public/cpp/trust_token_http_headers.cc index 16f1e70..6e03297 100644 --- a/services/network/public/cpp/trust_token_http_headers.cc +++ b/services/network/public/cpp/trust_token_http_headers.cc
@@ -5,12 +5,11 @@ #include "services/network/public/cpp/trust_token_http_headers.h" #include "base/no_destructor.h" -#include "base/strings/string_piece.h" namespace network { -const std::vector<base::StringPiece>& TrustTokensRequestHeaders() { - static base::NoDestructor<std::vector<base::StringPiece>> headers{ +const std::vector<std::string_view>& TrustTokensRequestHeaders() { + static base::NoDestructor<std::vector<std::string_view>> headers{ {kTrustTokensRequestHeaderSecSignature, kTrustTokensRequestHeaderSecRedemptionRecord, kTrustTokensRequestHeaderSecTime, kTrustTokensSecTrustTokenHeader,
diff --git a/services/network/public/cpp/trust_token_http_headers.h b/services/network/public/cpp/trust_token_http_headers.h index 19c9cdf..e3b64218 100644 --- a/services/network/public/cpp/trust_token_http_headers.h +++ b/services/network/public/cpp/trust_token_http_headers.h
@@ -5,10 +5,10 @@ #ifndef SERVICES_NETWORK_PUBLIC_CPP_TRUST_TOKEN_HTTP_HEADERS_H_ #define SERVICES_NETWORK_PUBLIC_CPP_TRUST_TOKEN_HTTP_HEADERS_H_ +#include <string_view> #include <vector> #include "base/component_export.h" -#include "base/strings/string_piece.h" namespace network { @@ -77,7 +77,7 @@ // In particular, this does *not* contain Signed-Headers because this header's // value is provided by the Trust Token API's client. COMPONENT_EXPORT(NETWORK_CPP) -const std::vector<base::StringPiece>& TrustTokensRequestHeaders(); +const std::vector<std::string_view>& TrustTokensRequestHeaders(); } // namespace network
diff --git a/services/network/public/cpp/web_sandbox_flags.cc b/services/network/public/cpp/web_sandbox_flags.cc index 1a28121..76befab2 100644 --- a/services/network/public/cpp/web_sandbox_flags.cc +++ b/services/network/public/cpp/web_sandbox_flags.cc
@@ -3,7 +3,9 @@ // found in the LICENSE file. #include "services/network/public/cpp/web_sandbox_flags.h" + #include <set> + #include "base/containers/cxx20_erase.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" @@ -18,7 +20,7 @@ // This is different from: base::kWhitespaceASCII. const char* kHtmlWhitespace = " \n\t\r\f"; -WebSandboxFlags ParseWebSandboxToken(const base::StringPiece& token) { +WebSandboxFlags ParseWebSandboxToken(const std::string_view& token) { constexpr struct { const char* token; WebSandboxFlags flags; @@ -59,12 +61,12 @@ // See: http://www.w3.org/TR/html5/the-iframe-element.html#attr-iframe-sandbox WebSandboxFlagsParsingResult ParseWebSandboxPolicy( - const base::StringPiece& input, + const std::string_view& input, WebSandboxFlags ignored_flags) { WebSandboxFlagsParsingResult out; out.flags = WebSandboxFlags::kAll; - std::vector<base::StringPiece> error_tokens; + std::vector<std::string_view> error_tokens; for (const auto& token : base::SplitStringPiece(input, kHtmlWhitespace, base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) { @@ -79,7 +81,7 @@ // Some tests expect the order of error tokens to be preserved, while // removing the duplicates: // See /fast/frames/sandboxed-iframe-attribute-parsing-03.html - std::set<base::StringPiece> set; + std::set<std::string_view> set; base::EraseIf(error_tokens, [&](auto x) { return !set.insert(x).second; }); out.error_message =
diff --git a/services/network/public/cpp/web_sandbox_flags.h b/services/network/public/cpp/web_sandbox_flags.h index 680f60a..4443007 100644 --- a/services/network/public/cpp/web_sandbox_flags.h +++ b/services/network/public/cpp/web_sandbox_flags.h
@@ -7,8 +7,9 @@ #include <cstdint> #include <string> +#include <string_view> + #include "base/component_export.h" -#include "base/strings/string_piece.h" namespace network { namespace mojom { @@ -62,7 +63,7 @@ // or from the network process. See: docs/security/rule-of-2.md. COMPONENT_EXPORT(NETWORK_CPP) WebSandboxFlagsParsingResult ParseWebSandboxPolicy( - const base::StringPiece& input, + const std::string_view& input, mojom::WebSandboxFlags ignored_flags); } // namespace network
diff --git a/services/network/public/cpp/x_frame_options_parser.cc b/services/network/public/cpp/x_frame_options_parser.cc index 38fc014..702ecbb 100644 --- a/services/network/public/cpp/x_frame_options_parser.cc +++ b/services/network/public/cpp/x_frame_options_parser.cc
@@ -5,7 +5,8 @@ #include "services/network/public/cpp/x_frame_options_parser.h" #include <string> -#include "base/strings/string_piece.h" +#include <string_view> + #include "base/strings/string_util.h" #include "net/http/http_response_headers.h" #include "services/network/public/mojom/x_frame_options.mojom-shared.h" @@ -24,8 +25,7 @@ while (headers.EnumerateHeader(&iter, "x-frame-options", &value)) { mojom::XFrameOptionsValue current = mojom::XFrameOptionsValue::kInvalid; - base::StringPiece trimmed = - base::TrimWhitespaceASCII(value, base::TRIM_ALL); + std::string_view trimmed = base::TrimWhitespaceASCII(value, base::TRIM_ALL); if (base::EqualsCaseInsensitiveASCII(trimmed, "deny")) current = mojom::XFrameOptionsValue::kDeny;
diff --git a/services/network/sct_auditing/sct_auditing_handler_unittest.cc b/services/network/sct_auditing/sct_auditing_handler_unittest.cc index cd42966..79ac7f5 100644 --- a/services/network/sct_auditing/sct_auditing_handler_unittest.cc +++ b/services/network/sct_auditing/sct_auditing_handler_unittest.cc
@@ -5,6 +5,7 @@ #include "services/network/sct_auditing/sct_auditing_handler.h" #include <memory> +#include <string_view> #include "base/base64.h" #include "base/feature_list.h" @@ -314,7 +315,7 @@ for (auto& sct_and_status : reporter.second->report()->certificate_report(0).included_sct()) { // Decode the SCT and check that only the valid SCT was included. - base::StringPiece encoded_sct(sct_and_status.serialized_sct()); + std::string_view encoded_sct(sct_and_status.serialized_sct()); scoped_refptr<net::ct::SignedCertificateTimestamp> decoded_sct; ASSERT_TRUE(net::ct::DecodeSignedCertificateTimestamp(&encoded_sct, &decoded_sct));
diff --git a/services/network/shared_dictionary/shared_dictionary_network_transaction.cc b/services/network/shared_dictionary/shared_dictionary_network_transaction.cc index 8da7d74a..1df02c92 100644 --- a/services/network/shared_dictionary/shared_dictionary_network_transaction.cc +++ b/services/network/shared_dictionary/shared_dictionary_network_transaction.cc
@@ -5,6 +5,7 @@ #include "services/network/shared_dictionary/shared_dictionary_network_transaction.h" #include <string> +#include <string_view> #include "base/feature_list.h" #include "base/functional/bind.h" @@ -67,7 +68,7 @@ }; void AddAcceptEncoding(net::HttpRequestHeaders* request_headers, - base::StringPiece encoding_header) { + std::string_view encoding_header) { std::string accept_encoding; request_headers->SetHeader( net::HttpRequestHeaders::kAcceptEncoding,
diff --git a/services/network/shared_storage/shared_storage_header_utils.cc b/services/network/shared_storage/shared_storage_header_utils.cc index 23b000ce..d43d10e 100644 --- a/services/network/shared_storage/shared_storage_header_utils.cc +++ b/services/network/shared_storage/shared_storage_header_utils.cc
@@ -5,7 +5,6 @@ #include "services/network/shared_storage/shared_storage_header_utils.h" #include "base/containers/fixed_flat_map.h" -#include "base/strings/string_piece.h" #include "net/http/http_request_headers.h" #include "net/http/structured_headers.h" #include "services/network/public/mojom/url_loader_network_service_observer.mojom.h" @@ -16,15 +15,14 @@ namespace { constexpr auto kSharedStorageOperationTypeMap = - base::MakeFixedFlatMap<base::StringPiece, - mojom::SharedStorageOperationType>( + base::MakeFixedFlatMap<std::string_view, mojom::SharedStorageOperationType>( {{"set", network::mojom::SharedStorageOperationType::kSet}, {"append", network::mojom::SharedStorageOperationType::kAppend}, {"delete", network::mojom::SharedStorageOperationType::kDelete}, {"clear", network::mojom::SharedStorageOperationType::kClear}}); constexpr auto kSharedStorageHeaderParamTypeMap = - base::MakeFixedFlatMap<base::StringPiece, SharedStorageHeaderParamType>( + base::MakeFixedFlatMap<std::string_view, SharedStorageHeaderParamType>( {{"key", SharedStorageHeaderParamType::kKey}, {"value", SharedStorageHeaderParamType::kValue}, {"ignore_if_present", @@ -33,7 +31,7 @@ } // namespace absl::optional<mojom::SharedStorageOperationType> -StringToSharedStorageOperationType(base::StringPiece operation_str) { +StringToSharedStorageOperationType(std::string_view operation_str) { auto* operation_it = kSharedStorageOperationTypeMap.find(base::ToLowerASCII(operation_str)); if (operation_it == kSharedStorageOperationTypeMap.end()) { @@ -44,7 +42,7 @@ } absl::optional<SharedStorageHeaderParamType> -StringToSharedStorageHeaderParamType(base::StringPiece param_str) { +StringToSharedStorageHeaderParamType(std::string_view param_str) { auto* param_it = kSharedStorageHeaderParamTypeMap.find(base::ToLowerASCII(param_str)); if (param_it == kSharedStorageHeaderParamTypeMap.end()) {
diff --git a/services/network/shared_storage/shared_storage_header_utils.h b/services/network/shared_storage/shared_storage_header_utils.h index d8767be1..be0ec91f 100644 --- a/services/network/shared_storage/shared_storage_header_utils.h +++ b/services/network/shared_storage/shared_storage_header_utils.h
@@ -5,7 +5,8 @@ #ifndef SERVICES_NETWORK_SHARED_STORAGE_SHARED_STORAGE_HEADER_UTILS_H_ #define SERVICES_NETWORK_SHARED_STORAGE_SHARED_STORAGE_HEADER_UTILS_H_ -#include "base/strings/string_piece.h" +#include <string_view> + #include "services/network/public/mojom/url_loader_network_service_observer.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -15,10 +16,10 @@ namespace network { -inline constexpr base::StringPiece kSecSharedStorageWritableHeader = +inline constexpr std::string_view kSecSharedStorageWritableHeader = "Sec-Shared-Storage-Writable"; -inline constexpr base::StringPiece kSecSharedStorageWritableValue = "?1"; -inline constexpr base::StringPiece kSharedStorageWriteHeader = +inline constexpr std::string_view kSecSharedStorageWritableValue = "?1"; +inline constexpr std::string_view kSharedStorageWriteHeader = "Shared-Storage-Write"; enum class SharedStorageHeaderParamType { @@ -28,10 +29,10 @@ }; absl::optional<network::mojom::SharedStorageOperationType> -StringToSharedStorageOperationType(base::StringPiece operation_str); +StringToSharedStorageOperationType(std::string_view operation_str); absl::optional<SharedStorageHeaderParamType> -StringToSharedStorageHeaderParamType(base::StringPiece param_str); +StringToSharedStorageHeaderParamType(std::string_view param_str); bool GetSecSharedStorageWritableHeader(const net::HttpRequestHeaders& headers);
diff --git a/services/network/shared_storage/shared_storage_request_helper.cc b/services/network/shared_storage/shared_storage_request_helper.cc index 9c5f570d..a1e8c8c 100644 --- a/services/network/shared_storage/shared_storage_request_helper.cc +++ b/services/network/shared_storage/shared_storage_request_helper.cc
@@ -13,7 +13,6 @@ #include "base/functional/bind.h" #include "base/functional/callback.h" #include "base/notreached.h" -#include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "net/http/structured_headers.h" #include "net/url_request/url_request.h" @@ -180,7 +179,7 @@ } bool SharedStorageRequestHelper::ProcessResponse(net::URLRequest& request, - base::StringPiece value, + std::string_view value, base::OnceClosure done) { DCHECK(observer_); DCHECK(done);
diff --git a/services/network/shared_storage/shared_storage_request_helper.h b/services/network/shared_storage/shared_storage_request_helper.h index 4551903..1035beeb 100644 --- a/services/network/shared_storage/shared_storage_request_helper.h +++ b/services/network/shared_storage/shared_storage_request_helper.h
@@ -7,12 +7,12 @@ #include <memory> #include <string> +#include <string_view> #include <utility> #include <vector> #include "base/functional/callback_forward.h" #include "base/memory/weak_ptr.h" -#include "base/strings/string_piece.h" #include "net/http/structured_headers.h" #include "services/network/public/mojom/url_loader_network_service_observer.mojom.h" #include "url/origin.h" @@ -71,7 +71,7 @@ private: bool ProcessResponse(net::URLRequest& request, - base::StringPiece value, + std::string_view value, base::OnceClosure done); void OnOperationsQueued(base::OnceClosure done);
diff --git a/services/network/ssl_config_service_mojo.cc b/services/network/ssl_config_service_mojo.cc index 8e128a5..9e087ba 100644 --- a/services/network/ssl_config_service_mojo.cc +++ b/services/network/ssl_config_service_mojo.cc
@@ -4,7 +4,8 @@ #include "services/network/ssl_config_service_mojo.h" -#include "base/strings/string_piece.h" +#include <string_view> + #include "base/strings/string_util.h" #include "mojo/public/cpp/bindings/type_converter.h" #include "services/network/ssl_config_type_converter.h" @@ -15,8 +16,8 @@ // Returns true if |hostname| is a subdomain of |pattern| (including if they are // equal). -bool IsSubdomain(const base::StringPiece hostname, - const base::StringPiece pattern) { +bool IsSubdomain(const std::string_view hostname, + const std::string_view pattern) { if (hostname == pattern) { return true; }
diff --git a/services/network/test/trust_token_request_handler.cc b/services/network/test/trust_token_request_handler.cc index 94f319c..d141b6af 100644 --- a/services/network/test/trust_token_request_handler.cc +++ b/services/network/test/trust_token_request_handler.cc
@@ -10,7 +10,6 @@ #include "base/functional/callback.h" #include "base/json/json_string_value_serializer.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" @@ -174,7 +173,7 @@ } absl::optional<std::string> TrustTokenRequestHandler::Issue( - base::StringPiece issuance_request) { + std::string_view issuance_request) { base::AutoLock lock(mutex_); if (rep_->issuance_outcome == ServerOperationOutcome::kUnconditionalFailure) { @@ -218,7 +217,7 @@ } absl::optional<std::string> TrustTokenRequestHandler::Redeem( - base::StringPiece redemption_request) { + std::string_view redemption_request) { base::AutoLock lock(mutex_); if (rep_->redemption_outcome ==
diff --git a/services/network/test/trust_token_request_handler.h b/services/network/test/trust_token_request_handler.h index 71d66c355..e0cc4ec 100644 --- a/services/network/test/trust_token_request_handler.h +++ b/services/network/test/trust_token_request_handler.h
@@ -7,8 +7,8 @@ #include <set> #include <string> +#include <string_view> -#include "base/strings/string_piece.h" #include "base/synchronization/lock.h" #include "base/time/time.h" #include "net/http/http_request_headers.h" @@ -102,12 +102,12 @@ // Given a base64-encoded issuance request, processes the // request and returns either nullopt (on error) or a base64-encoded response. - absl::optional<std::string> Issue(base::StringPiece issuance_request); + absl::optional<std::string> Issue(std::string_view issuance_request); // Given a base64-encoded redemption request, processes the // request and returns either nullopt (on error) or a string containing // the metadata values. - absl::optional<std::string> Redeem(base::StringPiece redemption_request); + absl::optional<std::string> Redeem(std::string_view redemption_request); // Stores a representation of a signed request with the given destination and // headers in a manner that can be retrieved for inspection by calling
diff --git a/services/network/test/trust_token_test_server_handler_registration.cc b/services/network/test/trust_token_test_server_handler_registration.cc index f428fce..56acb2da 100644 --- a/services/network/test/trust_token_test_server_handler_registration.cc +++ b/services/network/test/trust_token_test_server_handler_registration.cc
@@ -5,12 +5,12 @@ #include "services/network/test/trust_token_test_server_handler_registration.h" #include <memory> +#include <string_view> #include "base/base64.h" #include "base/check.h" #include "base/containers/contains.h" #include "base/logging.h" -#include "base/strings/string_piece.h" #include "base/test/bind.h" #include "net/http/http_request_headers.h" #include "net/test/embedded_test_server/http_request.h" @@ -39,7 +39,7 @@ // Constructs and returns an HTTP response bearing the given base64-encoded // Trust Tokens issuance or redemption protocol response message. std::unique_ptr<net::test_server::HttpResponse> MakeTrustTokenResponse( - base::StringPiece contents) { + std::string_view contents) { CHECK([&]() { std::string temp; return base::Base64Decode(contents, &temp);
diff --git a/services/network/test/trust_token_test_util.cc b/services/network/test/trust_token_test_util.cc index fefe918..ba47f4d 100644 --- a/services/network/test/trust_token_test_util.cc +++ b/services/network/test/trust_token_test_util.cc
@@ -25,7 +25,7 @@ TestURLRequestMaker::~TestURLRequestMaker() = default; std::unique_ptr<net::URLRequest> TestURLRequestMaker::MakeURLRequest( - base::StringPiece spec) { + std::string_view spec) { return context_->CreateRequest(GURL(spec), net::RequestPriority::DEFAULT_PRIORITY, &delegate_, TRAFFIC_ANNOTATION_FOR_TESTS); @@ -166,7 +166,7 @@ } std::string WrapKeyCommitmentsForIssuers( - base::flat_map<url::Origin, base::StringPiece> issuers_and_commitments) { + base::flat_map<url::Origin, std::string_view> issuers_and_commitments) { base::Value::Dict to_serialize; for (const auto& [issuer, commitment] : issuers_and_commitments) { // guard against accidentally passing an origin without a unique
diff --git a/services/network/test/trust_token_test_util.h b/services/network/test/trust_token_test_util.h index 587976d..5b06510 100644 --- a/services/network/test/trust_token_test_util.h +++ b/services/network/test/trust_token_test_util.h
@@ -7,11 +7,11 @@ #include <memory> #include <string> +#include <string_view> #include "base/component_export.h" #include "base/containers/flat_map.h" #include "base/json/json_string_value_serializer.h" -#include "base/strings/string_piece.h" #include "base/test/task_environment.h" #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" #include "net/url_request/url_request_test_util.h" @@ -39,7 +39,7 @@ TestURLRequestMaker& operator=(const TestURLRequestMaker&) = delete; // Constructs and returns a URLRequest with destination |spec|. - std::unique_ptr<net::URLRequest> MakeURLRequest(base::StringPiece spec); + std::unique_ptr<net::URLRequest> MakeURLRequest(std::string_view spec); protected: net::TestDelegate delegate_; @@ -65,7 +65,7 @@ TestURLRequestMaker request_maker_; - std::unique_ptr<net::URLRequest> MakeURLRequest(base::StringPiece spec) { + std::unique_ptr<net::URLRequest> MakeURLRequest(std::string_view spec) { return request_maker_.MakeURLRequest(spec); } @@ -216,7 +216,7 @@ // }}) // = R"( { "https://issuer.com": { "batchsize": 5 } } )" std::string WrapKeyCommitmentsForIssuers( - base::flat_map<url::Origin, base::StringPiece> issuers_and_commitments); + base::flat_map<url::Origin, std::string_view> issuers_and_commitments); } // namespace network
diff --git a/services/network/trust_tokens/boringssl_trust_token_issuance_cryptographer.cc b/services/network/trust_tokens/boringssl_trust_token_issuance_cryptographer.cc index 45cf4f78..acc31af 100644 --- a/services/network/trust_tokens/boringssl_trust_token_issuance_cryptographer.cc +++ b/services/network/trust_tokens/boringssl_trust_token_issuance_cryptographer.cc
@@ -9,7 +9,6 @@ #include "base/base64.h" #include "base/containers/span.h" -#include "base/strings/string_piece.h" #include "services/network/trust_tokens/boringssl_trust_token_state.h" #include "services/network/trust_tokens/scoped_boringssl_bytes.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -40,7 +39,7 @@ return !!state_; } -bool BoringsslTrustTokenIssuanceCryptographer::AddKey(base::StringPiece key) { +bool BoringsslTrustTokenIssuanceCryptographer::AddKey(std::string_view key) { if (!state_) { return false; } @@ -75,7 +74,7 @@ std::unique_ptr<UnblindedTokens> BoringsslTrustTokenIssuanceCryptographer::ConfirmIssuance( - base::StringPiece response_header) { + std::string_view response_header) { if (!state_) { return nullptr; }
diff --git a/services/network/trust_tokens/boringssl_trust_token_issuance_cryptographer.h b/services/network/trust_tokens/boringssl_trust_token_issuance_cryptographer.h index 210d0d3..7b6dc89 100644 --- a/services/network/trust_tokens/boringssl_trust_token_issuance_cryptographer.h +++ b/services/network/trust_tokens/boringssl_trust_token_issuance_cryptographer.h
@@ -7,9 +7,9 @@ #include <memory> #include <string> +#include <string_view> #include "base/containers/flat_map.h" -#include "base/strings/string_piece.h" #include "services/network/public/mojom/trust_tokens.mojom-shared.h" #include "services/network/trust_tokens/trust_token_request_issuance_helper.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -29,10 +29,10 @@ // TrustTokenRequestIssuanceHelper::Cryptographer implementation: bool Initialize(mojom::TrustTokenProtocolVersion issuer_configured_version, int issuer_configured_batch_size) override; - bool AddKey(base::StringPiece key) override; + bool AddKey(std::string_view key) override; absl::optional<std::string> BeginIssuance(size_t num_tokens) override; std::unique_ptr<UnblindedTokens> ConfirmIssuance( - base::StringPiece response_header) override; + std::string_view response_header) override; private: // Maintains Trust Tokens protocol state.
diff --git a/services/network/trust_tokens/boringssl_trust_token_redemption_cryptographer.cc b/services/network/trust_tokens/boringssl_trust_token_redemption_cryptographer.cc index ed2a3fc..d3fac72 100644 --- a/services/network/trust_tokens/boringssl_trust_token_redemption_cryptographer.cc +++ b/services/network/trust_tokens/boringssl_trust_token_redemption_cryptographer.cc
@@ -8,7 +8,6 @@ #include "base/base64.h" #include "base/containers/span.h" -#include "base/strings/string_piece.h" #include "base/time/time.h" #include "services/network/trust_tokens/boringssl_trust_token_state.h" #include "services/network/trust_tokens/scoped_boringssl_bytes.h" @@ -73,7 +72,7 @@ absl::optional<std::string> BoringsslTrustTokenRedemptionCryptographer::ConfirmRedemption( - base::StringPiece response_header) { + std::string_view response_header) { if (!state_) { return absl::nullopt; }
diff --git a/services/network/trust_tokens/boringssl_trust_token_redemption_cryptographer.h b/services/network/trust_tokens/boringssl_trust_token_redemption_cryptographer.h index 01375f1..5bca7c20 100644 --- a/services/network/trust_tokens/boringssl_trust_token_redemption_cryptographer.h +++ b/services/network/trust_tokens/boringssl_trust_token_redemption_cryptographer.h
@@ -6,8 +6,8 @@ #define SERVICES_NETWORK_TRUST_TOKENS_BORINGSSL_TRUST_TOKEN_REDEMPTION_CRYPTOGRAPHER_H_ #include <memory> +#include <string_view> -#include "base/strings/string_piece.h" #include "services/network/public/mojom/trust_tokens.mojom-shared.h" #include "services/network/trust_tokens/trust_token_request_redemption_helper.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -32,7 +32,7 @@ TrustToken token, const url::Origin& top_level_origin) override; absl::optional<std::string> ConfirmRedemption( - base::StringPiece response_header) override; + std::string_view response_header) override; private: // Maintains Trust Tokens protocol state.
diff --git a/services/network/trust_tokens/sqlite_trust_token_persister.cc b/services/network/trust_tokens/sqlite_trust_token_persister.cc index 0fa9d932..a05e702 100644 --- a/services/network/trust_tokens/sqlite_trust_token_persister.cc +++ b/services/network/trust_tokens/sqlite_trust_token_persister.cc
@@ -4,6 +4,8 @@ #include "services/network/trust_tokens/sqlite_trust_token_persister.h" +#include <string_view> + #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/memory/scoped_refptr.h" @@ -42,7 +44,7 @@ // // The parameters |issuer| and |toplevel| are pointers-to-optionals because // SuitableTrustTokenOrigin does not have a default constructor. -bool FromKey(base::StringPiece key_from_database, +bool FromKey(std::string_view key_from_database, absl::optional<SuitableTrustTokenOrigin>* issuer, absl::optional<SuitableTrustTokenOrigin>* toplevel) { DCHECK(issuer);
diff --git a/services/network/trust_tokens/test/trust_token_key_commitment_parser_fuzzer.cc b/services/network/trust_tokens/test/trust_token_key_commitment_parser_fuzzer.cc index 6f0f060..0a0868f 100644 --- a/services/network/trust_tokens/test/trust_token_key_commitment_parser_fuzzer.cc +++ b/services/network/trust_tokens/test/trust_token_key_commitment_parser_fuzzer.cc
@@ -5,13 +5,14 @@ #include "services/network/trust_tokens/trust_token_key_commitment_parser.h" #include <memory> +#include <string_view> #include "services/network/public/mojom/trust_tokens.mojom.h" namespace network { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - base::StringPiece string_input(reinterpret_cast<const char*>(data), size); + std::string_view string_input(reinterpret_cast<const char*>(data), size); TrustTokenKeyCommitmentParser().Parse(string_input); TrustTokenKeyCommitmentParser().ParseMultipleIssuers(string_input); return 0;
diff --git a/services/network/trust_tokens/trust_token_client_data_canonicalization.h b/services/network/trust_tokens/trust_token_client_data_canonicalization.h index 5e4a0c17..27225ca 100644 --- a/services/network/trust_tokens/trust_token_client_data_canonicalization.h +++ b/services/network/trust_tokens/trust_token_client_data_canonicalization.h
@@ -7,7 +7,6 @@ #include <vector> -#include "base/strings/string_piece.h" #include "base/time/time.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "url/origin.h"
diff --git a/services/network/trust_tokens/trust_token_client_data_canonicalization_unittest.cc b/services/network/trust_tokens/trust_token_client_data_canonicalization_unittest.cc index 1f27051..f579577 100644 --- a/services/network/trust_tokens/trust_token_client_data_canonicalization_unittest.cc +++ b/services/network/trust_tokens/trust_token_client_data_canonicalization_unittest.cc
@@ -5,7 +5,6 @@ #include "services/network/trust_tokens/trust_token_client_data_canonicalization.h" #include "base/containers/span.h" -#include "base/strings/string_piece.h" #include "base/test/task_environment.h" #include "base/time/time.h" #include "components/cbor/reader.h"
diff --git a/services/network/trust_tokens/trust_token_cryptographers_test.cc b/services/network/trust_tokens/trust_token_cryptographers_test.cc index c7247ef..8815f541 100644 --- a/services/network/trust_tokens/trust_token_cryptographers_test.cc +++ b/services/network/trust_tokens/trust_token_cryptographers_test.cc
@@ -4,9 +4,9 @@ #include <memory> #include <string> +#include <string_view> #include <vector> -#include "base/strings/string_piece.h" #include "services/network/public/mojom/trust_tokens.mojom-shared.h" #include "services/network/trust_tokens/boringssl_trust_token_issuance_cryptographer.h" #include "services/network/trust_tokens/boringssl_trust_token_redemption_cryptographer.h" @@ -33,12 +33,12 @@ // led to the test running for 2.5 sec on a debug build. constexpr size_t kNumTokensToRequest = 3; -base::StringPiece as_string(base::span<const uint8_t> bytes) { - return base::StringPiece(reinterpret_cast<const char*>(bytes.data()), - bytes.size()); +std::string_view as_string(base::span<const uint8_t> bytes) { + return std::string_view(reinterpret_cast<const char*>(bytes.data()), + bytes.size()); } -base::StringPiece as_string(const std::vector<uint8_t>& bytes) { +std::string_view as_string(const std::vector<uint8_t>& bytes) { return as_string(base::make_span(bytes)); }
diff --git a/services/network/trust_tokens/trust_token_key_commitment_controller.h b/services/network/trust_tokens/trust_token_key_commitment_controller.h index 66ba4d5..ef9e60d 100644 --- a/services/network/trust_tokens/trust_token_key_commitment_controller.h +++ b/services/network/trust_tokens/trust_token_key_commitment_controller.h
@@ -6,11 +6,11 @@ #define SERVICES_NETWORK_TRUST_TOKENS_TRUST_TOKEN_KEY_COMMITMENT_CONTROLLER_H_ #include <memory> +#include <string_view> #include <vector> #include "base/functional/callback.h" #include "base/memory/weak_ptr.h" -#include "base/strings/string_piece.h" #include "services/network/public/cpp/simple_url_loader.h" #include "services/network/public/mojom/trust_tokens.mojom-forward.h" #include "url/gurl.h" @@ -72,7 +72,7 @@ public: virtual ~Parser() = default; virtual mojom::TrustTokenKeyCommitmentResultPtr Parse( - base::StringPiece response_body) = 0; + std::string_view response_body) = 0; }; // Constructor. Immediately starts a request:
diff --git a/services/network/trust_tokens/trust_token_key_commitment_controller_unittest.cc b/services/network/trust_tokens/trust_token_key_commitment_controller_unittest.cc index fa4edf5e..94af55d 100644 --- a/services/network/trust_tokens/trust_token_key_commitment_controller_unittest.cc +++ b/services/network/trust_tokens/trust_token_key_commitment_controller_unittest.cc
@@ -43,7 +43,7 @@ : public TrustTokenKeyCommitmentController::Parser { public: mojom::TrustTokenKeyCommitmentResultPtr Parse( - base::StringPiece response_body) override { + std::string_view response_body) override { return DeterministicallyReturnedValue(); } static mojom::TrustTokenKeyCommitmentResultPtr @@ -57,7 +57,7 @@ class FailingKeyCommitmentParser : public TrustTokenKeyCommitmentController::Parser { mojom::TrustTokenKeyCommitmentResultPtr Parse( - base::StringPiece response_body) override { + std::string_view response_body) override { return nullptr; } };
diff --git a/services/network/trust_tokens/trust_token_key_commitment_parser.cc b/services/network/trust_tokens/trust_token_key_commitment_parser.cc index 21d5f9d..06016a3 100644 --- a/services/network/trust_tokens/trust_token_key_commitment_parser.cc +++ b/services/network/trust_tokens/trust_token_key_commitment_parser.cc
@@ -9,7 +9,6 @@ #include "base/numerics/safe_conversions.h" #include "base/ranges/algorithm.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" #include "base/values.h" #include "services/network/public/mojom/trust_tokens.mojom.h" #include "services/network/trust_tokens/suitable_trust_token_origin.h" @@ -29,7 +28,7 @@ // Parses a single key label. If |in| is the string representation of an integer // in in the representable range of uint32_t, returns true. Otherwise, returns // false. -bool ParseSingleKeyLabel(base::StringPiece in) { +bool ParseSingleKeyLabel(std::string_view in) { uint64_t key_label_in_uint64; if (!base::StringToUint64(in, &key_label_in_uint64)) return false; @@ -168,7 +167,7 @@ } // namespace mojom::TrustTokenKeyCommitmentResultPtr TrustTokenKeyCommitmentParser::Parse( - base::StringPiece response_body) { + std::string_view response_body) { absl::optional<base::Value> maybe_value = base::JSONReader::Read(response_body); if (!maybe_value) @@ -180,7 +179,7 @@ std::unique_ptr<base::flat_map<SuitableTrustTokenOrigin, mojom::TrustTokenKeyCommitmentResultPtr>> TrustTokenKeyCommitmentParser::ParseMultipleIssuers( - base::StringPiece response_body) { + std::string_view response_body) { absl::optional<base::Value> maybe_value = base::JSONReader::Read(response_body); if (!maybe_value)
diff --git a/services/network/trust_tokens/trust_token_key_commitment_parser.h b/services/network/trust_tokens/trust_token_key_commitment_parser.h index 691b568c..fba800e6 100644 --- a/services/network/trust_tokens/trust_token_key_commitment_parser.h +++ b/services/network/trust_tokens/trust_token_key_commitment_parser.h
@@ -6,8 +6,8 @@ #define SERVICES_NETWORK_TRUST_TOKENS_TRUST_TOKEN_KEY_COMMITMENT_PARSER_H_ #include <memory> +#include <string_view> -#include "base/strings/string_piece.h" #include "services/network/public/mojom/trust_tokens.mojom-forward.h" #include "services/network/trust_tokens/suitable_trust_token_origin.h" #include "services/network/trust_tokens/trust_token_key_commitment_controller.h" @@ -48,7 +48,7 @@ // // https://docs.google.com/document/d/1TNnya6B8pyomDK2F1R9CL3dY10OAmqWlnCxsWyOBDVQ/edit#heading=h.wkezf6pcskvh mojom::TrustTokenKeyCommitmentResultPtr Parse( - base::StringPiece response_body) override; + std::string_view response_body) override; // Like |Parse|, except that the input is expected to be of the form // { "https://some-issuer.example": <JSON in the form expected by |Parse|> @@ -72,7 +72,7 @@ // or the value fails to parse. std::unique_ptr<base::flat_map<SuitableTrustTokenOrigin, mojom::TrustTokenKeyCommitmentResultPtr>> - ParseMultipleIssuers(base::StringPiece response_body); + ParseMultipleIssuers(std::string_view response_body); }; } // namespace network
diff --git a/services/network/trust_tokens/trust_token_key_commitments.cc b/services/network/trust_tokens/trust_token_key_commitments.cc index ff07cd2..d14e604 100644 --- a/services/network/trust_tokens/trust_token_key_commitments.cc +++ b/services/network/trust_tokens/trust_token_key_commitments.cc
@@ -94,7 +94,7 @@ commitments_.replace(std::move(filtered)); } -void TrustTokenKeyCommitments::ParseAndSet(base::StringPiece raw_commitments) { +void TrustTokenKeyCommitments::ParseAndSet(std::string_view raw_commitments) { TrustTokenKeyCommitmentParser parser; if (auto parsed = parser.ParseMultipleIssuers(raw_commitments)) commitments_.swap(*parsed);
diff --git a/services/network/trust_tokens/trust_token_key_commitments.h b/services/network/trust_tokens/trust_token_key_commitments.h index aa0324b4..4e409ab7 100644 --- a/services/network/trust_tokens/trust_token_key_commitments.h +++ b/services/network/trust_tokens/trust_token_key_commitments.h
@@ -5,6 +5,8 @@ #ifndef SERVICES_NETWORK_TRUST_TOKENS_TRUST_TOKEN_KEY_COMMITMENTS_H_ #define SERVICES_NETWORK_TRUST_TOKENS_TRUST_TOKEN_KEY_COMMITMENTS_H_ +#include <string_view> + #include "base/containers/flat_map.h" #include "base/functional/callback.h" #include "services/network/public/mojom/trust_tokens.mojom.h" @@ -37,7 +39,7 @@ // of a collection of issuers' key commitments according to the format // specified, for now, in the Trust Tokens design doc: // https://docs.google.com/document/d/1TNnya6B8pyomDK2F1R9CL3dY10OAmqWlnCxsWyOBDVQ/edit#heading=h.z52drgpfgulz. - void ParseAndSet(base::StringPiece raw_commitments); + void ParseAndSet(std::string_view raw_commitments); // TrustTokenKeyCommitmentGetter implementation: //
diff --git a/services/network/trust_tokens/trust_token_operation_metrics_recorder.cc b/services/network/trust_tokens/trust_token_operation_metrics_recorder.cc index 52adbd8..a5e9751 100644 --- a/services/network/trust_tokens/trust_token_operation_metrics_recorder.cc +++ b/services/network/trust_tokens/trust_token_operation_metrics_recorder.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <string_view> + #include "services/network/trust_tokens/trust_token_operation_metrics_recorder.h" #include "base/metrics/histogram_functions.h" #include "base/strings/string_util.h" @@ -26,7 +28,7 @@ // These must stay in sync with the corresponding histogram suffixes in // histograms.xml. -base::StringPiece StatusToSuccessOrFailure( +std::string_view StatusToSuccessOrFailure( mojom::TrustTokenOperationStatus status) { switch (status) { case mojom::TrustTokenOperationStatus::kOk: @@ -41,7 +43,7 @@ // These must stay in sync with the corresponding histogram suffixes in // histograms.xml. -base::StringPiece TypeToString(mojom::TrustTokenOperationType type) { +std::string_view TypeToString(mojom::TrustTokenOperationType type) { switch (type) { case mojom::TrustTokenOperationType::kIssuance: return "Issuance";
diff --git a/services/network/trust_tokens/trust_token_request_helper_factory.cc b/services/network/trust_tokens/trust_token_request_helper_factory.cc index b1b431d..09b5bfd 100644 --- a/services/network/trust_tokens/trust_token_request_helper_factory.cc +++ b/services/network/trust_tokens/trust_token_request_helper_factory.cc
@@ -5,6 +5,7 @@ #include "services/network/trust_tokens/trust_token_request_helper_factory.h" #include <memory> +#include <string_view> #include <utility> #include "base/metrics/histogram_functions.h" @@ -35,7 +36,7 @@ using Outcome = internal::TrustTokenRequestHelperFactoryOutcome; -base::StringPiece OutcomeToString(Outcome outcome) { +std::string_view OutcomeToString(Outcome outcome) { switch (outcome) { case Outcome::kSuccessfullyCreatedAnIssuanceHelper: return "Successfully created an issuance helper"; @@ -100,7 +101,7 @@ return; } - for (base::StringPiece header : TrustTokensRequestHeaders()) { + for (std::string_view header : TrustTokensRequestHeaders()) { if (headers.HasHeader(header)) { LogOutcome( net_log, params.operation,
diff --git a/services/network/trust_tokens/trust_token_request_helper_factory_unittest.cc b/services/network/trust_tokens/trust_token_request_helper_factory_unittest.cc index 4df883d..a9d6dd7f 100644 --- a/services/network/trust_tokens/trust_token_request_helper_factory_unittest.cc +++ b/services/network/trust_tokens/trust_token_request_helper_factory_unittest.cc
@@ -4,6 +4,8 @@ #include "services/network/trust_tokens/trust_token_request_helper_factory.h" +#include <string_view> + #include "base/no_destructor.h" #include "base/strings/strcat.h" #include "base/test/bind.h" @@ -156,7 +158,7 @@ TEST_F(TrustTokenRequestHelperFactoryTest, ForbiddenHeaders) { base::HistogramTester histogram_tester; - for (const base::StringPiece& header : TrustTokensRequestHeaders()) { + for (const std::string_view& header : TrustTokensRequestHeaders()) { std::unique_ptr<net::URLRequest> my_request = CreateSuitableRequest(); my_request->SetExtraRequestHeaderByName(std::string(header), " ", /*overwrite=*/true);
diff --git a/services/network/trust_tokens/trust_token_request_issuance_helper.cc b/services/network/trust_tokens/trust_token_request_issuance_helper.cc index a07852f6..d383b46 100644 --- a/services/network/trust_tokens/trust_token_request_issuance_helper.cc +++ b/services/network/trust_tokens/trust_token_request_issuance_helper.cc
@@ -70,7 +70,7 @@ return {std::move(cryptographer), std::move(unblinded_tokens)}; } -base::Value::Dict CreateLogValue(base::StringPiece outcome) { +base::Value::Dict CreateLogValue(std::string_view outcome) { return base::Value::Dict().Set("outcome", outcome); } @@ -78,7 +78,7 @@ enum NetLogOp { kBegin, kFinalize }; void LogOutcome(const net::NetLogWithSource& log, NetLogOp begin_or_finalize, - base::StringPiece outcome) { + std::string_view outcome) { log.EndEvent( begin_or_finalize == kBegin ? net::NetLogEventType::TRUST_TOKEN_OPERATION_BEGIN_ISSUANCE
diff --git a/services/network/trust_tokens/trust_token_request_issuance_helper.h b/services/network/trust_tokens/trust_token_request_issuance_helper.h index df34fea..3c5dc15 100644 --- a/services/network/trust_tokens/trust_token_request_issuance_helper.h +++ b/services/network/trust_tokens/trust_token_request_issuance_helper.h
@@ -8,12 +8,12 @@ #include <memory> #include <set> #include <string> +#include <string_view> #include <vector> #include "base/functional/callback_forward.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" -#include "base/strings/string_piece.h" #include "net/log/net_log_with_source.h" #include "services/network/public/mojom/trust_tokens.mojom-shared.h" #include "services/network/trust_tokens/proto/public.pb.h" @@ -70,7 +70,7 @@ // forbid adding duplicates; however, duplicates might contribute to an // overall limit on the number of permitted keys, so the caller may wish to // ensure this is called at most once per distinct key. - virtual bool AddKey(base::StringPiece key) = 0; + virtual bool AddKey(std::string_view key) = 0; // On success, returns a base64-encoded string representing |num_tokens| // many blinded, unsigned trust tokens; on error, returns nullopt. The @@ -95,7 +95,7 @@ // with the key (from the issuer's key commitment registry) that // successfully validated the signed tokens. Otherwise, returns nullptr. virtual std::unique_ptr<UnblindedTokens> ConfirmIssuance( - base::StringPiece response_header) = 0; + std::string_view response_header) = 0; }; // Creates a new issuance helper.
diff --git a/services/network/trust_tokens/trust_token_request_issuance_helper_unittest.cc b/services/network/trust_tokens/trust_token_request_issuance_helper_unittest.cc index c628ce3..890c9985 100644 --- a/services/network/trust_tokens/trust_token_request_issuance_helper_unittest.cc +++ b/services/network/trust_tokens/trust_token_request_issuance_helper_unittest.cc
@@ -95,11 +95,11 @@ MOCK_METHOD2(Initialize, bool(mojom::TrustTokenProtocolVersion issuer_configured_version, int issuer_configured_batch_size)); - MOCK_METHOD1(AddKey, bool(base::StringPiece key)); + MOCK_METHOD1(AddKey, bool(std::string_view key)); MOCK_METHOD1(BeginIssuance, absl::optional<std::string>(size_t num_tokens)); MOCK_METHOD1( ConfirmIssuance, - std::unique_ptr<UnblindedTokens>(base::StringPiece response_header)); + std::unique_ptr<UnblindedTokens>(std::string_view response_header)); }; class MockExpiryDelegate : public TrustTokenStore::RecordExpiryDelegate {
diff --git a/services/network/trust_tokens/trust_token_request_redemption_helper.cc b/services/network/trust_tokens/trust_token_request_redemption_helper.cc index 1d611bf..b84b741 100644 --- a/services/network/trust_tokens/trust_token_request_redemption_helper.cc +++ b/services/network/trust_tokens/trust_token_request_redemption_helper.cc
@@ -27,7 +27,7 @@ namespace { -base::Value::Dict CreateLogValue(base::StringPiece outcome) { +base::Value::Dict CreateLogValue(std::string_view outcome) { return base::Value::Dict().Set("outcome", outcome); } @@ -35,7 +35,7 @@ enum NetLogOp { kBegin, kFinalize }; void LogOutcome(const net::NetLogWithSource& log, NetLogOp begin_or_finalize, - base::StringPiece outcome) { + std::string_view outcome) { log.EndEvent( begin_or_finalize == kBegin ? net::NetLogEventType::TRUST_TOKEN_OPERATION_BEGIN_REDEMPTION
diff --git a/services/network/trust_tokens/trust_token_request_redemption_helper.h b/services/network/trust_tokens/trust_token_request_redemption_helper.h index a0a763b..5327c88b 100644 --- a/services/network/trust_tokens/trust_token_request_redemption_helper.h +++ b/services/network/trust_tokens/trust_token_request_redemption_helper.h
@@ -7,11 +7,11 @@ #include <memory> #include <string> +#include <string_view> #include "base/functional/callback_forward.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" -#include "base/strings/string_piece.h" #include "net/log/net_log_with_source.h" #include "services/network/public/mojom/trust_tokens.mojom.h" #include "services/network/trust_tokens/proto/public.pb.h" @@ -92,7 +92,7 @@ // The Trust Tokens design doc is currently the normative source for the // RR's format. virtual absl::optional<std::string> ConfirmRedemption( - base::StringPiece response_header) = 0; + std::string_view response_header) = 0; }; // Creates a new redemption helper.
diff --git a/services/network/trust_tokens/trust_token_request_redemption_helper_unittest.cc b/services/network/trust_tokens/trust_token_request_redemption_helper_unittest.cc index fdf1cf9..44b3194 100644 --- a/services/network/trust_tokens/trust_token_request_redemption_helper_unittest.cc +++ b/services/network/trust_tokens/trust_token_request_redemption_helper_unittest.cc
@@ -89,7 +89,7 @@ const url::Origin& top_level_origin)); MOCK_METHOD1(ConfirmRedemption, - absl::optional<std::string>(base::StringPiece response_header)); + absl::optional<std::string>(std::string_view response_header)); }; } // namespace
diff --git a/services/network/trust_tokens/trust_token_request_signing_helper.cc b/services/network/trust_tokens/trust_token_request_signing_helper.cc index ee9bc12..bdad04a3 100644 --- a/services/network/trust_tokens/trust_token_request_signing_helper.cc +++ b/services/network/trust_tokens/trust_token_request_signing_helper.cc
@@ -7,6 +7,7 @@ #include <iterator> #include <memory> #include <string> +#include <string_view> #include <tuple> #include "base/base64.h" @@ -38,7 +39,7 @@ const char kRedemptionRecordHeaderRedemptionRecordKey[] = "redemption-record"; -void LogOutcome(const net::NetLogWithSource& log, base::StringPiece outcome) { +void LogOutcome(const net::NetLogWithSource& log, std::string_view outcome) { log.EndEvent( net::NetLogEventType::TRUST_TOKEN_OPERATION_BEGIN_SIGNING, [outcome]() { return base::Value::Dict().Set("outcome", outcome); });
diff --git a/services/network/trust_tokens/trust_token_request_signing_helper_unittest.cc b/services/network/trust_tokens/trust_token_request_signing_helper_unittest.cc index 833324a..f71ff9f 100644 --- a/services/network/trust_tokens/trust_token_request_signing_helper_unittest.cc +++ b/services/network/trust_tokens/trust_token_request_signing_helper_unittest.cc
@@ -7,6 +7,7 @@ #include <iterator> #include <memory> #include <string> +#include <string_view> #include <vector> #include "base/base64.h" @@ -66,7 +67,7 @@ return Matches(other_matcher)(header); } -SuitableTrustTokenOrigin CreateSuitableOriginOrDie(base::StringPiece spec) { +SuitableTrustTokenOrigin CreateSuitableOriginOrDie(std::string_view spec) { absl::optional<SuitableTrustTokenOrigin> maybe_origin = SuitableTrustTokenOrigin::Create(GURL(spec)); CHECK(maybe_origin) << "Failed to create a SuitableTrustTokenOrigin!"; @@ -74,7 +75,7 @@ } bool ExtractRedemptionRecordsFromHeader( - base::StringPiece sec_redemption_record_header, + std::string_view sec_redemption_record_header, std::map<SuitableTrustTokenOrigin, std::string>* redemption_records_per_issuer_out, std::string* error_out) {
diff --git a/services/network/trust_tokens/trust_token_store.cc b/services/network/trust_tokens/trust_token_store.cc index aefb06a..92d8c68 100644 --- a/services/network/trust_tokens/trust_token_store.cc +++ b/services/network/trust_tokens/trust_token_store.cc
@@ -164,9 +164,9 @@ const SuitableTrustTokenOrigin& issuer, const std::vector<mojom::TrustTokenVerificationKeyPtr>& keys) { DCHECK([&keys]() { - std::set<base::StringPiece> unique_keys; + std::set<std::string_view> unique_keys; for (const auto& key : keys) - unique_keys.insert(base::StringPiece(key->body)); + unique_keys.insert(std::string_view(key->body)); return unique_keys.size() == keys.size(); }()); @@ -190,7 +190,7 @@ void TrustTokenStore::AddTokens(const SuitableTrustTokenOrigin& issuer, base::span<const std::string> token_bodies, - base::StringPiece issuing_key) { + std::string_view issuing_key) { auto config = persister_->GetIssuerConfig(issuer); if (!config) config = std::make_unique<TrustTokenIssuerConfig>();
diff --git a/services/network/trust_tokens/trust_token_store.h b/services/network/trust_tokens/trust_token_store.h index eb75103..36b22c736 100644 --- a/services/network/trust_tokens/trust_token_store.h +++ b/services/network/trust_tokens/trust_token_store.h
@@ -7,6 +7,7 @@ #include <memory> #include <string> +#include <string_view> #include <vector> #include "base/functional/callback.h" @@ -144,7 +145,7 @@ // tokens issued against non-current keys. virtual void AddTokens(const SuitableTrustTokenOrigin& issuer, base::span<const std::string> token_bodies, - base::StringPiece issuing_key); + std::string_view issuing_key); // Returns the number of tokens stored for |issuer|. [[nodiscard]] virtual int CountTokens(const SuitableTrustTokenOrigin& issuer);
diff --git a/services/network/trust_tokens/types.cc b/services/network/trust_tokens/types.cc index fda7d5c..0a4460c 100644 --- a/services/network/trust_tokens/types.cc +++ b/services/network/trust_tokens/types.cc
@@ -21,7 +21,7 @@ return timestamp; } -base::StringPiece TrustTokenOperationTypeToString( +std::string_view TrustTokenOperationTypeToString( mojom::TrustTokenOperationType type) { // WARNING: These values are used to construct histogram names. When making // changes, please make sure that the Trust Tokens-related histograms
diff --git a/services/network/trust_tokens/types.h b/services/network/trust_tokens/types.h index 42664f1..720a7c2c 100644 --- a/services/network/trust_tokens/types.h +++ b/services/network/trust_tokens/types.h
@@ -6,8 +6,8 @@ #define SERVICES_NETWORK_TRUST_TOKENS_TYPES_H_ #include <string> +#include <string_view> -#include "base/strings/string_piece.h" #include "base/time/time.h" #include "services/network/public/mojom/trust_tokens.mojom-shared.h" #include "services/network/trust_tokens/proto/public.pb.h" @@ -26,7 +26,7 @@ Timestamp TimeToTimestamp(base::Time time); // Serializes a TrustTokenOperationType. -base::StringPiece TrustTokenOperationTypeToString( +std::string_view TrustTokenOperationTypeToString( mojom::TrustTokenOperationType type); // Serializes a mojom::TrustTokenProtocolVersion.
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc index e2b57e8..d6520afe 100644 --- a/services/network/url_loader.cc +++ b/services/network/url_loader.cc
@@ -9,6 +9,7 @@ #include <map> #include <memory> #include <string> +#include <string_view> #include <utility> #include <vector> @@ -1963,7 +1964,7 @@ if (data_length > net::kMaxBytesToSniff) data_length = net::kMaxBytesToSniff; - base::StringPiece data(pending_write_->buffer(), data_length); + std::string_view data(pending_write_->buffer(), data_length); bool stop_sniffing_after_processing_current_data = (num_bytes <= 0 || pending_write_buffer_offset_ >= net::kMaxBytesToSniff);
diff --git a/services/network/web_transport.cc b/services/network/web_transport.cc index 44dc480..6d28efb 100644 --- a/services/network/web_transport.cc +++ b/services/network/web_transport.cc
@@ -707,7 +707,7 @@ } } -void WebTransport::OnDatagramReceived(base::StringPiece datagram) { +void WebTransport::OnDatagramReceived(std::string_view datagram) { if (torn_down_ || closing_) { return; }
diff --git a/services/network/web_transport.h b/services/network/web_transport.h index 88da530..18b1b18 100644 --- a/services/network/web_transport.h +++ b/services/network/web_transport.h
@@ -6,6 +6,7 @@ #define SERVICES_NETWORK_WEB_TRANSPORT_H_ #include <memory> +#include <string_view> #include "base/containers/queue.h" #include "base/memory/raw_ptr.h" @@ -79,7 +80,7 @@ void OnError(const net::WebTransportError& error) override; void OnIncomingBidirectionalStreamAvailable() override; void OnIncomingUnidirectionalStreamAvailable() override; - void OnDatagramReceived(base::StringPiece datagram) override; + void OnDatagramReceived(std::string_view datagram) override; void OnCanCreateNewOutgoingBidirectionalStream() override; void OnCanCreateNewOutgoingUnidirectionalStream() override; void OnDatagramProcessed(absl::optional<quic::MessageStatus> status) override;
diff --git a/services/network/web_transport_unittest.cc b/services/network/web_transport_unittest.cc index 17a89db..0cc1b22 100644 --- a/services/network/web_transport_unittest.cc +++ b/services/network/web_transport_unittest.cc
@@ -44,7 +44,7 @@ std::unique_ptr<net::HostResolver> CreateResolver( net::HostResolverManager* manager, - base::StringPiece host_mapping_rules, + std::string_view host_mapping_rules, bool enable_caching) override { DCHECK(resolver_); return std::move(resolver_); @@ -54,7 +54,7 @@ std::unique_ptr<net::HostResolver> CreateStandaloneResolver( net::NetLog* net_log, const net::HostResolver::ManagerOptions& options, - base::StringPiece host_mapping_rules, + std::string_view host_mapping_rules, bool enable_caching) override { NOTREACHED(); return nullptr; @@ -298,7 +298,7 @@ return version; } -class WebTransportTest : public testing::TestWithParam<base::StringPiece> { +class WebTransportTest : public testing::TestWithParam<std::string_view> { public: WebTransportTest() : WebTransportTest( @@ -366,7 +366,7 @@ std::move(fingerprints), std::move(handshake_client)); } - GURL GetURL(base::StringPiece suffix) { + GURL GetURL(std::string_view suffix) { int port = http_server_->server_address().port(); return GURL(base::StrCat( {"https://test.example.com:", base::NumberToString(port), suffix}));
diff --git a/services/on_device_model/ml/chrome_ml_api.h b/services/on_device_model/ml/chrome_ml_api.h index 8f68402..f40cb26 100644 --- a/services/on_device_model/ml/chrome_ml_api.h +++ b/services/on_device_model/ml/chrome_ml_api.h
@@ -31,6 +31,9 @@ // Opaque handle to an instance of a ChromeML model. using ChromeMLModel = uintptr_t; +// Function called to release resources. +using ChromeMLDisposeFn = std::function<void()>; + // Describes a ChromeML model's underlying tensors. struct ChromeMLModelData { // Points to a serialized description of the model's tensors. @@ -39,12 +42,18 @@ // The size in bytes of the serialized proto at `model_proto_data`. size_t model_proto_size; + // Called when the model_proto data is no longer needed. + const ChromeMLDisposeFn* model_proto_dispose; + // Points to raw tensor weight data, indexed by fields encoded in the above // proto. This memory must be mutable. void* weights_data; // The size in bytes of the data at `weights_data`. size_t weights_size; + + // Called when the weights data is no longer needed. + const ChromeMLDisposeFn* weights_dispose; }; // Describes a model to use with ChromeML. @@ -55,6 +64,9 @@ // The size in bytes of the serialized proto at `sentencepiece_model_data`. size_t sentencepiece_model_proto_size; + // Called when the sentencepiece_model_proto data is no longer needed. + const ChromeMLDisposeFn* sentencepiece_model_proto_dispose; + // The model data to use. const ChromeMLModelData* model_data;
diff --git a/services/on_device_model/ml/on_device_model_executor.cc b/services/on_device_model/ml/on_device_model_executor.cc index 8650f2f..f776aec 100644 --- a/services/on_device_model/ml/on_device_model_executor.cc +++ b/services/on_device_model/ml/on_device_model_executor.cc
@@ -278,21 +278,24 @@ return LoadModelResult::kGpuBlocked; } on_device_model::ModelAssets assets = std::move(params->assets); + sentencepiece_model_proto_ = std::make_unique<base::MemoryMappedFile>(); if (!assets.sp_model.IsValid() || - !sentencepiece_model_proto_.Initialize(std::move(assets.sp_model))) { + !sentencepiece_model_proto_->Initialize(std::move(assets.sp_model))) { LOG(ERROR) << "Unable to load sentencepiece model"; return LoadModelResult::kFailedToLoadLibrary; } + model_proto_ = std::make_unique<base::MemoryMappedFile>(); if (!assets.model.IsValid() || - !model_proto_.Initialize(std::move(assets.model))) { + !model_proto_->Initialize(std::move(assets.model))) { LOG(ERROR) << "Unable to load model"; return LoadModelResult::kFailedToLoadLibrary; } + weights_ = std::make_unique<base::MemoryMappedFile>(); if (!assets.weights.IsValid() || - !weights_.Initialize(std::move(assets.weights), - base::MemoryMappedFile::READ_WRITE_COPY)) { + !weights_->Initialize(std::move(assets.weights), + base::MemoryMappedFile::READ_WRITE_COPY)) { LOG(ERROR) << "Unable to load weights"; return LoadModelResult::kFailedToLoadLibrary; } @@ -306,15 +309,24 @@ } } + auto model_proto_dispose = + CreateWeakCallbackFn(&OnDeviceModelExecutor::DisposeModelProto, this); + auto weights_dispose = + CreateWeakCallbackFn(&OnDeviceModelExecutor::DisposeWeights, this); const ChromeMLModelData data = { - .model_proto_data = model_proto_.data(), - .model_proto_size = model_proto_.length(), - .weights_data = weights_.mutable_bytes().data(), - .weights_size = weights_.length(), + .model_proto_data = model_proto_->data(), + .model_proto_size = model_proto_->length(), + .model_proto_dispose = &model_proto_dispose, + .weights_data = weights_->mutable_bytes().data(), + .weights_size = weights_->length(), + .weights_dispose = &weights_dispose, }; + auto sentencepiece_model_proto_dispose = + CreateWeakCallbackFn(&OnDeviceModelExecutor::DisposeSentencepiece, this); ChromeMLModelDescriptor descriptor = { - .sentencepiece_model_proto_data = sentencepiece_model_proto_.data(), - .sentencepiece_model_proto_size = sentencepiece_model_proto_.length(), + .sentencepiece_model_proto_data = sentencepiece_model_proto_->data(), + .sentencepiece_model_proto_size = sentencepiece_model_proto_->length(), + .sentencepiece_model_proto_dispose = &sentencepiece_model_proto_dispose, .model_data = &data, .max_tokens = params->max_tokens, }; @@ -332,6 +344,18 @@ : LoadModelResult::kFailedToLoadLibrary; } +void OnDeviceModelExecutor::DisposeSentencepiece() { + sentencepiece_model_proto_ = nullptr; +} + +void OnDeviceModelExecutor::DisposeModelProto() { + model_proto_ = nullptr; +} + +void OnDeviceModelExecutor::DisposeWeights() { + weights_ = nullptr; +} + // static void OnDeviceModelExecutor::Schedule(uintptr_t context, std::function<void()>* fn) {
diff --git a/services/on_device_model/ml/on_device_model_executor.h b/services/on_device_model/ml/on_device_model_executor.h index fccf958..4ae7751 100644 --- a/services/on_device_model/ml/on_device_model_executor.h +++ b/services/on_device_model/ml/on_device_model_executor.h
@@ -23,7 +23,9 @@ // Uses the ChromeML API to create a model based on the params passed to // |Create()|. This is the main interface for interacting with the model. -class OnDeviceModelExecutor : public on_device_model::OnDeviceModel { +class OnDeviceModelExecutor + : public on_device_model::OnDeviceModel, + public base::SupportsWeakPtr<OnDeviceModelExecutor> { public: explicit OnDeviceModelExecutor(base::PassKey<OnDeviceModelExecutor>, const ChromeML& chrome_ml); @@ -43,13 +45,17 @@ on_device_model::mojom::LoadModelResult Init( on_device_model::mojom::LoadModelParamsPtr params); + void DisposeSentencepiece(); + void DisposeModelProto(); + void DisposeWeights(); + static void Schedule(uintptr_t context, std::function<void()>* fn); const raw_ref<const ChromeML> chrome_ml_; - base::MemoryMappedFile sentencepiece_model_proto_; - base::MemoryMappedFile model_proto_; - base::MemoryMappedFile weights_; + std::unique_ptr<base::MemoryMappedFile> sentencepiece_model_proto_; + std::unique_ptr<base::MemoryMappedFile> model_proto_; + std::unique_ptr<base::MemoryMappedFile> weights_; base::MemoryMappedFile ts_data_; base::MemoryMappedFile ts_sp_model_;
diff --git a/services/on_device_model/pre_sandbox_init.cc b/services/on_device_model/pre_sandbox_init.cc index c00ed68..425c9aa 100644 --- a/services/on_device_model/pre_sandbox_init.cc +++ b/services/on_device_model/pre_sandbox_init.cc
@@ -16,6 +16,7 @@ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #include "gpu/config/gpu_info_collector.h" // nogncheck +#include "third_party/dawn/include/dawn/dawn_proc.h" // nogncheck #include "third_party/dawn/include/dawn/native/DawnNative.h" // nogncheck #include "third_party/dawn/include/dawn/webgpu_cpp.h" // nogncheck #endif @@ -77,6 +78,7 @@ // Warm any relevant drivers before attempting to bring up the sandbox. For // good measure we initialize a device instance for any adapter with an // appropriate backend on top of any integrated or discrete GPU. + dawnProcSetProcs(&dawn::native::GetProcs()); auto instance = std::make_unique<dawn::native::Instance>(); const wgpu::RequestAdapterOptions adapter_options{ .backendType = wgpu::BackendType::Vulkan,
diff --git a/services/service_manager/public/cpp/service_executable/main.cc b/services/service_manager/public/cpp/service_executable/main.cc index 4d1906e..ed6ef1a 100644 --- a/services/service_manager/public/cpp/service_executable/main.cc +++ b/services/service_manager/public/cpp/service_executable/main.cc
@@ -100,7 +100,7 @@ // --disable-features. std::unique_ptr<base::FeatureList> feature_list = std::make_unique<base::FeatureList>(); - feature_list->InitializeFromCommandLine( + feature_list->InitFromCommandLine( command_line->GetSwitchValueASCII(switches::kEnableFeatures), command_line->GetSwitchValueASCII(switches::kDisableFeatures));
diff --git a/services/webnn/dml/graph_impl.cc b/services/webnn/dml/graph_impl.cc index 8da39e5..ba06e36 100644 --- a/services/webnn/dml/graph_impl.cc +++ b/services/webnn/dml/graph_impl.cc
@@ -145,6 +145,8 @@ } std::string OpTagToString(Operation::Tag tag) { switch (tag) { + case Operation::Tag::kBatchNormalization: + return "batchNormalization"; case Operation::Tag::kClamp: return "clamp"; case Operation::Tag::kConcat:
diff --git a/services/webnn/public/mojom/webnn_graph.mojom b/services/webnn/public/mojom/webnn_graph.mojom index d4d6531..1efdf9c 100644 --- a/services/webnn/public/mojom/webnn_graph.mojom +++ b/services/webnn/public/mojom/webnn_graph.mojom
@@ -30,6 +30,45 @@ string? name; }; +// Represents normalizing the tensor values of input features across +// the batch dimension. +// +// This operator performs the following batch normalization, defined as: +// Output = Scale * ((Input - Mean) / sqrt(Variance + Epsilon)) + Bias +// +// If Activation is provided, the output will be further processed: +// Output = Activation(Output) +struct BatchNormalization { + // The id of input operand is used to get the `Operand` description from + // `GraphInfo.id_to_operand_map`. + uint64 input_operand_id; + // The id of mean operand is used to get the `Operand` description from + // `GraphInfo.id_to_operand_map`. + uint64 mean_operand_id; + // The id of variance operand is used to get the `Operand` description from + // `GraphInfo.id_to_operand_map`. + uint64 variance_operand_id; + // The id of output operand is used to get the `Operand` description from + // `GraphInfo.id_to_operand_map`. + uint64 output_operand_id; + + // The optional 1-D tensor of the bias values whose size is equal to the + // size of the input dimension denoted by axis. + uint64? scale_operand_id; + // The optional 1-D tensor of the scaling values whose is equal to the size + // of the input dimension denoted by axis. + uint64? bias_operand_id; + // A scalar which specifies the index to the feature count dimension of the + // input shape for which the mean and variance values are. + uint32 axis = 1; + // A float scalar which specifies a small value to prevent computational + // error due to divide-by-zero. + float epsilon = 1e-5; + // The optional activation function that immediately follows the + // batchNormalization. + Activation? activation; +}; + // Clamp the input tensor element-wise within a range specified by the minimum // and maximum values. struct Clamp { @@ -531,6 +570,7 @@ // Holds one of operator. union Operation { // Keep the order as the same as build methods of `MLGraphBuilder`. + BatchNormalization batch_normalization; Clamp clamp; Concat concat; Conv2d conv2d;
diff --git a/services/webnn/webnn_graph_impl.cc b/services/webnn/webnn_graph_impl.cc index 692521b..6a28e8c 100644 --- a/services/webnn/webnn_graph_impl.cc +++ b/services/webnn/webnn_graph_impl.cc
@@ -162,6 +162,27 @@ return operand_iterator->second.get(); } +webnn::BatchNormalizationAttributes ConvertToBatchNormalizationAttributes( + const IdToOperandMap& id_to_operand_map, + const mojom::BatchNormalizationPtr& batch_normalization) { + webnn::BatchNormalizationAttributes component_attributes; + const auto& scale_operand_id = batch_normalization->scale_operand_id; + if (scale_operand_id) { + const mojom::OperandPtr& scale_operand = + id_to_operand_map.at(scale_operand_id.value()); + component_attributes.scale = ConvertToComponentOperand(scale_operand.get()); + } + const auto& bias_operand_id = batch_normalization->bias_operand_id; + if (bias_operand_id) { + const mojom::OperandPtr& bias_operand = + id_to_operand_map.at(bias_operand_id.value()); + component_attributes.bias = ConvertToComponentOperand(bias_operand.get()); + } + component_attributes.axis = batch_normalization->axis; + + return component_attributes; +} + template <typename Conv2dAttributesType> Conv2dAttributesType ConvertToConv2dAttributes( const IdToOperandMap& id_to_operand_map, @@ -334,6 +355,57 @@ // The output shape is not expected. return false; } + + return true; +} + +bool ValidateBatchNormalization( + const IdToOperandMap& id_to_operand_map, + const mojom::BatchNormalizationPtr& batch_normalization) { + const auto* input = + GetMojoOperand(id_to_operand_map, batch_normalization->input_operand_id); + const auto* mean = + GetMojoOperand(id_to_operand_map, batch_normalization->mean_operand_id); + const auto* variance = GetMojoOperand( + id_to_operand_map, batch_normalization->variance_operand_id); + const auto* output = + GetMojoOperand(id_to_operand_map, batch_normalization->output_operand_id); + if (!input || !mean || !variance || !output || output == input || + output == mean || output == variance) { + // The batchNormalization operator is invalid. + return false; + } + const auto& scale_operand_id = batch_normalization->scale_operand_id; + if (scale_operand_id && + !id_to_operand_map.contains(scale_operand_id.value())) { + // The scale operand is invalid. + return false; + } + const auto& bias_operand_id = batch_normalization->bias_operand_id; + if (bias_operand_id && !id_to_operand_map.contains(bias_operand_id.value())) { + // The bias operand is invalid. + return false; + } + + // Validate the activation if the option is configured. + const auto& activation = batch_normalization->activation; + if (activation && !ValidateActivation(activation)) { + // The activation is invalid. + return false; + } + + const auto validated_output = ValidateBatchNormalizationAndInferOutput( + ConvertToComponentOperand(input), ConvertToComponentOperand(mean), + ConvertToComponentOperand(variance), + ConvertToBatchNormalizationAttributes(id_to_operand_map, + batch_normalization)); + if (!validated_output.has_value()) { + return false; + } + if (validated_output != ConvertToComponentOperand(output)) { + return false; + } + return true; } @@ -937,6 +1009,9 @@ bool ValidateOperation(const IdToOperandMap& id_to_operand_map, const mojom::OperationPtr& operation) { switch (operation->which()) { + case mojom::Operation::Tag::kBatchNormalization: + return ValidateBatchNormalization(id_to_operand_map, + operation->get_batch_normalization()); case mojom::Operation::Tag::kClamp: return ValidateClamp(id_to_operand_map, operation->get_clamp()); case mojom::Operation::Tag::kConcat:
diff --git a/services/webnn/webnn_graph_impl_unittest.cc b/services/webnn/webnn_graph_impl_unittest.cc index 0923f40..08b5253 100644 --- a/services/webnn/webnn_graph_impl_unittest.cc +++ b/services/webnn/webnn_graph_impl_unittest.cc
@@ -292,6 +292,440 @@ } } +struct BatchNormalizationTester { + OperandInfo input; + OperandInfo mean; + OperandInfo variance; + absl::optional<OperandInfo> scale; + absl::optional<OperandInfo> bias; + struct BatchNormalizationAttributes { + absl::optional<uint64_t> scale_operand_id; + absl::optional<uint64_t> bias_operand_id; + uint32_t axis = 1; + float epsilon = 1e-5; + absl::optional<mojom::Activation::Tag> activation; + absl::optional<ClampTester::ClampAttributes> clamp_attributes; + absl::optional<float> elu_alpha; + absl::optional<float> leaky_relu_alpha; + }; + BatchNormalizationAttributes attributes; + OperandInfo output; + bool expected; + + void Test() { + // Build the graph with mojo type. + GraphInfoBuilder builder; + uint64_t input_operand_id = + builder.BuildInput("input", input.dimensions, input.type); + uint64_t mean_operand_id = + builder.BuildInput("mean", mean.dimensions, mean.type); + uint64_t variance_operand_id = + builder.BuildInput("variance", variance.dimensions, variance.type); + uint64_t output_operand_id = + builder.BuildOutput("output", output.dimensions, output.type); + + if (scale) { + attributes.scale_operand_id = + builder.BuildInput("scale", scale->dimensions, scale->type); + } + if (bias) { + attributes.bias_operand_id = + builder.BuildInput("bias", bias->dimensions, bias->type); + } + builder.BuildBatchNormalization(input_operand_id, mean_operand_id, + variance_operand_id, output_operand_id, + std::move(attributes)); + EXPECT_EQ(WebNNGraphImpl::ValidateGraph(builder.GetGraphInfo()), expected); + } +}; + +TEST_F(WebNNGraphImplTest, BatchNormalizationTest) { + { + // Test building batchNormalization with default option. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = true} + .Test(); + } + { + // Test building batchNormalization with axis = 3. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {3}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {3}}, + .attributes = {.axis = 3}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = true} + .Test(); + } + { + // Test building gemm with setting optional bias and scale. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .scale = OperandInfo{.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .bias = OperandInfo{.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = true} + .Test(); + } + { + // Test batchNormalization with clamp activation. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .attributes = {.activation = mojom::Activation::Tag::kClamp, + .clamp_attributes = + ClampTester::ClampAttributes{.min_value = 1.0, + .max_value = 6.0}}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = true} + .Test(); + } + { + // Test batchNormalization with elu activation. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .attributes = {.activation = mojom::Activation::Tag::kElu, + .elu_alpha = 1.0}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = true} + .Test(); + } + { + // Test batchNormalization with leaky relu activation. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .attributes = {.activation = mojom::Activation::Tag::kLeakyRelu, + .leaky_relu_alpha = 0.01}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = true} + .Test(); + } + { + // Test batchNormalization with relu activation. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .attributes = {.activation = mojom::Activation::Tag::kRelu}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = true} + .Test(); + } + { + // Test BatchNormalization with sigmoid activation. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .attributes = {.activation = mojom::Activation::Tag::kSigmoid}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = true} + .Test(); + } + { + // Test BatchNormalization with softmax activation. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .attributes = {.activation = mojom::Activation::Tag::kSoftmax}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = true} + .Test(); + } + { + // Test batchNormalization with tanh activation. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .attributes = {.activation = mojom::Activation::Tag::kTanh}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = true} + .Test(); + } + { + // Test the invalid graph when elu activation has alpha < 0. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .attributes = {.activation = mojom::Activation::Tag::kElu, + .elu_alpha = -1.0}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = false} + .Test(); + } + { + // Test building batchNormalization when input data type and mean data + // type mismatched. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kInt32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = false} + .Test(); + } + { + // Test building batchNormalization when the size of mean is not equal to + // the size of the input dimension denoted by axis. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {3}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = false} + .Test(); + } + { + // Test building batchNormalization when input data type and variance data + // type mismatched. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kInt32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = false} + .Test(); + } + { + // Test building batchNormalization when the size of variance is not equal + // to the size of the input dimension denoted by axis. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1}}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = false} + .Test(); + } + { + // Test building batchNormalization when input data is not floating point + // type. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kInt32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kInt32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kInt32, + .dimensions = {2}}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = false} + .Test(); + } + { + // Test building batchNormalization when axis is out of range [0, N-1]. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {3}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {3}}, + .attributes = {.axis = 4}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = false} + .Test(); + } + { + // Test batchNormalization when input data type and scale data type + // mismatched. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .scale = OperandInfo{.type = mojom::Operand::DataType::kInt32, + .dimensions = {2}}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = false} + .Test(); + } + { + // Test building batchNormalization when the size of scale is not equal + // to the size of the input dimension denoted by axis. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .scale = OperandInfo{.type = mojom::Operand::DataType::kFloat32, + .dimensions = {3}}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = false} + .Test(); + } + { + // Test batchNormalization when input data type and bias data type + // mismatched. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .bias = OperandInfo{.type = mojom::Operand::DataType::kInt32, + .dimensions = {2}}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = false} + .Test(); + } + { + // Test building batchNormalization when the size of bias is not equal + // to the size of the input dimension denoted by axis. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .bias = OperandInfo{.type = mojom::Operand::DataType::kFloat32, + .dimensions = {3}}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .expected = false} + .Test(); + } + { + // Test the invalid graph for output type is not the same as input type. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .bias = OperandInfo{.type = mojom::Operand::DataType::kFloat32, + .dimensions = {3}}, + .output = {.type = mojom::Operand::DataType::kInt32, + .dimensions = {1, 2, 3, 3}}, + .expected = false} + .Test(); + } + { + // Test the invalid graph for output shape is not the same as input shape. + BatchNormalizationTester{ + .input = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 2, 3, 3}}, + .mean = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2}}, + .variance = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {2}}, + .bias = OperandInfo{.type = mojom::Operand::DataType::kFloat32, + .dimensions = {3}}, + .output = {.type = mojom::Operand::DataType::kFloat32, + .dimensions = {1, 1, 3, 3}}, + .expected = false} + .Test(); + } + { + // Test the invalid graph for input operand == output operand. + GraphInfoBuilder builder; + uint64_t input_operand_id = builder.BuildInput( + "input", {1, 2, 3, 4}, mojom::Operand::DataType::kFloat32); + uint64_t mean_operand_id = + builder.BuildInput("mean", {2}, mojom::Operand::DataType::kFloat32); + uint64_t variance_operand_id = + builder.BuildInput("variance", {2}, mojom::Operand::DataType::kFloat32); + builder.BuildBatchNormalization( + input_operand_id, mean_operand_id, variance_operand_id, + input_operand_id, + BatchNormalizationTester::BatchNormalizationAttributes{}); + EXPECT_FALSE(WebNNGraphImpl::ValidateGraph(builder.GetGraphInfo())); + } + { + // Test the invalid graph for mean operand == output operand. + GraphInfoBuilder builder; + uint64_t input_operand_id = builder.BuildInput( + "input", {1, 2, 3, 4}, mojom::Operand::DataType::kFloat32); + uint64_t mean_operand_id = + builder.BuildInput("mean", {2}, mojom::Operand::DataType::kFloat32); + uint64_t variance_operand_id = + builder.BuildInput("variance", {2}, mojom::Operand::DataType::kFloat32); + builder.BuildBatchNormalization( + input_operand_id, mean_operand_id, variance_operand_id, mean_operand_id, + BatchNormalizationTester::BatchNormalizationAttributes{}); + EXPECT_FALSE(WebNNGraphImpl::ValidateGraph(builder.GetGraphInfo())); + } + { + // Test the invalid graph for variance operand == output operand. + GraphInfoBuilder builder; + uint64_t input_operand_id = builder.BuildInput( + "input", {1, 2, 3, 4}, mojom::Operand::DataType::kFloat32); + uint64_t mean_operand_id = + builder.BuildInput("mean", {2}, mojom::Operand::DataType::kFloat32); + uint64_t variance_operand_id = + builder.BuildInput("variance", {2}, mojom::Operand::DataType::kFloat32); + builder.BuildBatchNormalization( + input_operand_id, mean_operand_id, variance_operand_id, + variance_operand_id, + BatchNormalizationTester::BatchNormalizationAttributes{}); + EXPECT_FALSE(WebNNGraphImpl::ValidateGraph(builder.GetGraphInfo())); + } +} + struct ConcatTester { std::vector<OperandInfo> inputs; uint32_t axis; @@ -350,7 +784,8 @@ .Test(); } { - // Test concat operator when the inputs' datatypes don't match each other. + // Test concat operator when the inputs' datatypes don't match each + // other. ConcatTester{.inputs = {{.type = mojom::Operand::DataType::kFloat32, .dimensions = {3, 1, 5, 6}}, {.type = mojom::Operand::DataType::kInt32, @@ -413,8 +848,8 @@ .Test(); } { - // Test concat operator when the output datatype doesn't match the inputs' - // datatypes. + // Test concat operator when the output datatype doesn't match the + // inputs' datatypes. ConcatTester{.inputs = {{.type = mojom::Operand::DataType::kFloat32, .dimensions = {3, 1, 5, 6}}, {.type = mojom::Operand::DataType::kFloat32, @@ -729,8 +1164,8 @@ .Test(); } { - // Test the invalid graph when the number of filter input channels doesn't - // match the result of input channels divided by groups + // Test the invalid graph when the number of filter input channels + // doesn't match the result of input channels divided by groups Conv2dTester{.type = mojom::Conv2d_Type::kDirect, .input = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {1, 1, 5, 5}}, @@ -866,7 +1301,8 @@ .Test(); } { - // Test convTranspose2d with strides = [2, 2] and padding = [1, 1, 1, 1]. + // Test convTranspose2d with strides = [2, 2] and padding = [1, 1, 1, + // 1]. Conv2dTester{.type = mojom::Conv2d_Type::kTransposed, .input = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {1, 1, 3, 3}}, @@ -996,8 +1432,8 @@ .Test(); } { - // Test the invalid graph when the number of input channels is not equal to - // the number of filter input channels. + // Test the invalid graph when the number of input channels is not equal + // to the number of filter input channels. Conv2dTester{.type = mojom::Conv2d_Type::kTransposed, .input = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {1, 1, 3, 3}}, @@ -1010,8 +1446,8 @@ .Test(); } { - // Test the invalid graph when the number of output channels doesn't match - // the result of filter output channels multiplied by groups + // Test the invalid graph when the number of output channels doesn't + // match the result of filter output channels multiplied by groups Conv2dTester{.type = mojom::Conv2d_Type::kTransposed, .input = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {1, 1, 3, 3}}, @@ -1139,8 +1575,8 @@ }; TEST_F(WebNNGraphImplTest, ElementWiseBinaryTest) { - // Testing building with two input dimensions - {8, 1, 6, 1} and {7, 1, 5}. - // Both the a and b dimensions have axes with length one that are + // Testing building with two input dimensions - {8, 1, 6, 1} and {7, 1, + // 5}. Both the a and b dimensions have axes with length one that are // expanded to a larger size during the broadcast operation. // a_dimensions (4d) 8 * 1 * 6 * 1 // b_dimensions (3d) 7 * 1 * 5 @@ -1530,8 +1966,8 @@ .Test(); } { - // Test the invalid element-wise abs graph for the input with unsupported - // data type. + // Test the invalid element-wise abs graph for the input with + // unsupported data type. ElementWiseUnaryTester{.kind = mojom::ElementWiseUnary::Kind::kAbs, .input = {.type = mojom::Operand::DataType::kUint32, .dimensions = {1, 2, 3, 4}}, @@ -1541,8 +1977,8 @@ .Test(); } { - // Test the invalid element-wise neg graph for the input with unsupported - // data type. + // Test the invalid element-wise neg graph for the input with + // unsupported data type. ElementWiseUnaryTester{.kind = mojom::ElementWiseUnary::Kind::kNeg, .input = {.type = mojom::Operand::DataType::kUint8, .dimensions = {1, 2, 3, 4}}, @@ -1552,8 +1988,8 @@ .Test(); } { - // Test the invalid element-wise ceil graph for the input with unsupported - // data type. + // Test the invalid element-wise ceil graph for the input with + // unsupported data type. ElementWiseUnaryTester{.kind = mojom::ElementWiseUnary::Kind::kCeil, .input = {.type = mojom::Operand::DataType::kUint32, .dimensions = {1, 2, 3, 4}}, @@ -1563,8 +1999,8 @@ .Test(); } { - // Test the invalid element-wise cos graph for the input with unsupported - // data type. + // Test the invalid element-wise cos graph for the input with + // unsupported data type. ElementWiseUnaryTester{.kind = mojom::ElementWiseUnary::Kind::kCos, .input = {.type = mojom::Operand::DataType::kUint32, .dimensions = {1, 2, 3, 4}}, @@ -1574,8 +2010,8 @@ .Test(); } { - // Test the invalid element-wise exp graph for the input with unsupported - // data type. + // Test the invalid element-wise exp graph for the input with + // unsupported data type. ElementWiseUnaryTester{.kind = mojom::ElementWiseUnary::Kind::kExp, .input = {.type = mojom::Operand::DataType::kUint8, .dimensions = {1, 2, 3, 4}}, @@ -1585,8 +2021,8 @@ .Test(); } { - // Test the invalid element-wise floor graph for the input with unsupported - // data type. + // Test the invalid element-wise floor graph for the input with + // unsupported data type. ElementWiseUnaryTester{.kind = mojom::ElementWiseUnary::Kind::kFloor, .input = {.type = mojom::Operand::DataType::kInt8, .dimensions = {1, 2, 3, 4}}, @@ -1596,8 +2032,8 @@ .Test(); } { - // Test the invalid element-wise log graph for the input with unsupported - // data type. + // Test the invalid element-wise log graph for the input with + // unsupported data type. ElementWiseUnaryTester{.kind = mojom::ElementWiseUnary::Kind::kLog, .input = {.type = mojom::Operand::DataType::kInt32, .dimensions = {1, 2, 3, 4}}, @@ -1607,8 +2043,8 @@ .Test(); } { - // Test the invalid element-wise sin graph for the input with unsupported - // data type. + // Test the invalid element-wise sin graph for the input with + // unsupported data type. ElementWiseUnaryTester{.kind = mojom::ElementWiseUnary::Kind::kSin, .input = {.type = mojom::Operand::DataType::kUint32, .dimensions = {1, 2, 3, 4}}, @@ -1618,8 +2054,8 @@ .Test(); } { - // Test the invalid element-wise tan graph for the input with unsupported - // data type. + // Test the invalid element-wise tan graph for the input with + // unsupported data type. ElementWiseUnaryTester{.kind = mojom::ElementWiseUnary::Kind::kTan, .input = {.type = mojom::Operand::DataType::kUint32, .dimensions = {1, 2, 3, 4}}, @@ -1757,7 +2193,8 @@ TEST_F(WebNNGraphImplTest, ExpandTest) { { - // Test building expand with the output shapes that are the same as input. + // Test building expand with the output shapes that are the same as + // input. ExpandTester{.input = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {2, 6}}, .output = {.type = mojom::Operand::DataType::kFloat32, @@ -1775,8 +2212,8 @@ .Test(); } { - // Test building expand with the output shapes that are broadcastable and the - // number of output shapes larger than input. + // Test building expand with the output shapes that are broadcastable + // and the number of output shapes larger than input. ExpandTester{.input = {.type = mojom::Operand::DataType::kInt32, .dimensions = {2, 5}}, .output = {.type = mojom::Operand::DataType::kInt32, @@ -1785,8 +2222,8 @@ .Test(); } { - // Test the invalid graph when the input shapes are not the same as output - // shape and not broadcastable. + // Test the invalid graph when the input shapes are not the same as + // output shape and not broadcastable. ExpandTester{.input = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {3, 6, 2}}, .output = {.type = mojom::Operand::DataType::kFloat32, @@ -2609,8 +3046,8 @@ .Test(); } { - // Test the invalid graph for the input type is not one of float types for - // reduceLogSum. + // Test the invalid graph for the input type is not one of float types + // for reduceLogSum. ReduceTester{ .kind = mojom::Reduce::Kind::kLogSum, .input = {.type = mojom::Operand::DataType::kInt32, @@ -2622,8 +3059,8 @@ .Test(); } { - // Test the invalid graph for the input type is not one of float types for - // reduceLogSumExp. + // Test the invalid graph for the input type is not one of float types + // for reduceLogSumExp. ReduceTester{ .kind = mojom::Reduce::Kind::kLogSumExp, .input = {.type = mojom::Operand::DataType::kInt32, @@ -2635,8 +3072,8 @@ .Test(); } { - // Test the invalid graph for the input type is not one of float types for - // reduceL2. + // Test the invalid graph for the input type is not one of float types + // for reduceL2. ReduceTester{ .kind = mojom::Reduce::Kind::kL2, .input = {.type = mojom::Operand::DataType::kInt32, @@ -2648,8 +3085,8 @@ .Test(); } { - // Test the invalid graph for the input type is not one of float types for - // reduceMean. + // Test the invalid graph for the input type is not one of float types + // for reduceMean. ReduceTester{ .kind = mojom::Reduce::Kind::kMean, .input = {.type = mojom::Operand::DataType::kInt32, @@ -2775,8 +3212,8 @@ .Test(); } { - // Test resample2d with "Linear" mode, axes = [1, 2] and explicit scales = - // [2, 2]. + // Test resample2d with "Linear" mode, axes = [1, 2] and explicit scales + // = [2, 2]. Resample2dTester{ .input = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {1, 2, 4, 1}}, @@ -2789,8 +3226,8 @@ .Test(); } { - // Test resample2d with "Linear" mode, axes = [1, 2] and explicit scales = - // [2, 2.2] which is not exactly output dimensions / input dimensions. + // Test resample2d with "Linear" mode, axes = [1, 2] and explicit scales + // = [2, 2.2] which is not exactly output dimensions / input dimensions. Resample2dTester{ .input = {.type = mojom::Operand::DataType::kFloat32, .dimensions = {1, 2, 4, 1}}, @@ -2923,8 +3360,8 @@ .expected = false} .Test(); } - // Test the invalid graph when the dimension of output doesn't equal to the - // dimension of input except along the axes. + // Test the invalid graph when the dimension of output doesn't equal to + // the dimension of input except along the axes. { // With explicit scales. Resample2dTester{ @@ -3225,7 +3662,8 @@ GraphInfoBuilder builder; uint64_t input_operand_id = builder.BuildInput("input", {2}, mojom::Operand::DataType::kFloat32); - builder.BuildLeakyRelu(input_operand_id, input_operand_id, /*alpha*/ 1.0); + builder.BuildLeakyRelu(input_operand_id, input_operand_id, + /*alpha*/ 1.0); EXPECT_FALSE(WebNNGraphImpl::ValidateGraph(builder.GetGraphInfo())); } @@ -3236,7 +3674,8 @@ builder.BuildInput("input", {2}, mojom::Operand::DataType::kFloat32); uint64_t output_operand_id = builder.BuildOutput("output", {2}, mojom::Operand::DataType::kFloat32); - builder.BuildLeakyRelu(input_operand_id, output_operand_id, /*alpha*/ NAN); + builder.BuildLeakyRelu(input_operand_id, output_operand_id, + /*alpha*/ NAN); EXPECT_FALSE(WebNNGraphImpl::ValidateGraph(builder.GetGraphInfo())); }
diff --git a/services/webnn/webnn_test_utils.h b/services/webnn/webnn_test_utils.h index 30e2d0f..717be91 100644 --- a/services/webnn/webnn_test_utils.h +++ b/services/webnn/webnn_test_utils.h
@@ -39,6 +39,87 @@ const std::vector<uint32_t>& dimensions, mojom::Operand::DataType type); + // A `ActivationAttributes` type should have the following members: + // struct ActivationAttributes { + // absl::optional<mojom::Activation::Tag> activation; + // absl::optional<ClampTester::ClampAttributes> clamp_attributes; + // absl::optional<float> elu_alpha; + // absl::optional<float> leaky_relu_alpha; + // }; + template <typename ActivationAttributes> + mojom::ActivationPtr CreateActivation( + const ActivationAttributes& attributes) { + switch (attributes.activation.value()) { + case mojom::Activation::Tag::kClamp: { + const auto clamp_attributes = attributes.clamp_attributes; + CHECK(clamp_attributes.has_value()); + auto clamp = mojom::Clamp::New(); + clamp->min_value = clamp_attributes->min_value; + clamp->max_value = clamp_attributes->max_value; + return mojom::Activation::NewClamp(std::move(clamp)); + } + case mojom::Activation::Tag::kElu: { + auto elu = mojom::Elu::New(); + CHECK(attributes.elu_alpha.has_value()); + elu->alpha = attributes.elu_alpha.value(); + return mojom::Activation::NewElu(std::move(elu)); + } + case mojom::Activation::Tag::kLeakyRelu: { + auto leaky_relu = mojom::LeakyRelu::New(); + CHECK(attributes.leaky_relu_alpha.has_value()); + leaky_relu->alpha = attributes.leaky_relu_alpha.value(); + return mojom::Activation::NewLeakyRelu(std::move(leaky_relu)); + } + case mojom::Activation::Tag::kRelu: + return mojom::Activation::NewRelu(mojom::Relu::New()); + case mojom::Activation::Tag::kSigmoid: + return mojom::Activation::NewSigmoid(mojom::Sigmoid::New()); + case mojom::Activation::Tag::kSoftmax: + return mojom::Activation::NewSoftmax(mojom::Softmax::New()); + case mojom::Activation::Tag::kTanh: + return mojom::Activation::NewTanh(mojom::Tanh::New()); + default: + NOTREACHED(); + } + } + + // A `BatchNormalizationAttributes` type should have the following members: + // struct BatchNormalizationAttributes { + // absl::optional<uint64_t> scale_operand_id; + // absl::optional<uint64_t> bias_operand_id; + // uint32_t axis = 1; + // float epsilon = 1e-5; + // absl::optional<mojom::Activation::Tag> activation; + // absl::optional<ClampTester::ClampAttributes> clamp_attributes; + // absl::optional<float> elu_alpha; + // absl::optional<float> leaky_relu_alpha; + // }; + template <typename BatchNormalizationAttributes> + void BuildBatchNormalization(uint64_t input_operand_id, + uint64_t mean_operand_id, + uint64_t variance_operand_id, + uint64_t output_operand_id, + const BatchNormalizationAttributes& attributes) { + mojom::BatchNormalizationPtr batch_normalization = + mojom::BatchNormalization::New(); + batch_normalization->input_operand_id = input_operand_id; + batch_normalization->mean_operand_id = mean_operand_id; + batch_normalization->variance_operand_id = variance_operand_id; + batch_normalization->output_operand_id = output_operand_id; + + batch_normalization->scale_operand_id = attributes.scale_operand_id; + batch_normalization->bias_operand_id = attributes.bias_operand_id; + batch_normalization->axis = attributes.axis; + batch_normalization->epsilon = attributes.epsilon; + + if (attributes.activation.has_value()) { + batch_normalization->activation = std::move(CreateActivation(attributes)); + } + + graph_info_->operations.push_back(mojom::Operation::NewBatchNormalization( + std::move(batch_normalization))); + } + void BuildClamp(uint64_t input_operand_id, uint64_t output_operand_id, float min_value, @@ -92,46 +173,7 @@ conv2d->bias_operand_id = bias_operand_id; if (attributes.activation.has_value()) { - switch (attributes.activation.value()) { - case mojom::Activation::Tag::kClamp: { - auto clamp_attributes = attributes.clamp_attributes; - CHECK(clamp_attributes.has_value()); - auto clamp = mojom::Clamp::New(); - clamp->min_value = clamp_attributes->min_value; - clamp->max_value = clamp_attributes->max_value; - conv2d->activation = mojom::Activation::NewClamp(std::move(clamp)); - break; - } - case mojom::Activation::Tag::kElu: { - auto elu = mojom::Elu::New(); - CHECK(attributes.elu_alpha.has_value()); - elu->alpha = attributes.elu_alpha.value(); - conv2d->activation = mojom::Activation::NewElu(std::move(elu)); - break; - } - case mojom::Activation::Tag::kLeakyRelu: { - auto leaky_relu = mojom::LeakyRelu::New(); - CHECK(attributes.leaky_relu_alpha.has_value()); - leaky_relu->alpha = attributes.leaky_relu_alpha.value(); - conv2d->activation = - mojom::Activation::NewLeakyRelu(std::move(leaky_relu)); - break; - } - case mojom::Activation::Tag::kRelu: - conv2d->activation = mojom::Activation::NewRelu(mojom::Relu::New()); - break; - case mojom::Activation::Tag::kSigmoid: - conv2d->activation = - mojom::Activation::NewSigmoid(mojom::Sigmoid::New()); - break; - case mojom::Activation::Tag::kSoftmax: - conv2d->activation = - mojom::Activation::NewSoftmax(mojom::Softmax::New()); - break; - case mojom::Activation::Tag::kTanh: - conv2d->activation = mojom::Activation::NewTanh(mojom::Tanh::New()); - break; - } + conv2d->activation = std::move(CreateActivation(attributes)); } graph_info_->operations.push_back(
diff --git a/testing/buildbot/PRESUBMIT.py b/testing/buildbot/PRESUBMIT.py index 3f923939..439635b 100644 --- a/testing/buildbot/PRESUBMIT.py +++ b/testing/buildbot/PRESUBMIT.py
@@ -14,8 +14,8 @@ # The time module's handling of timezones is abysmal, so the boundaries are # precomputed in UNIX time -_FREEZE_START = 1671177600 # 2022/12/16 00:00 -0800 -_FREEZE_END = 1672646400 # 2023/01/02 00:00 -0800 +_FREEZE_START = 1702627200 # 2023/12/15 00:00 -0800 +_FREEZE_END = 1704182400 # 2024/01/02 00:00 -0800 def CheckFreeze(input_api, output_api):
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index ab18a1e6..316c1571 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -6218,9 +6218,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6156.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6157.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6156.0", + "description": "Run with ash-chrome version 121.0.6157.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6230,8 +6230,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6156.0", - "revision": "version:121.0.6156.0" + "location": "lacros_version_skew_tests_v121.0.6157.0", + "revision": "version:121.0.6157.0" } ], "dimensions": { @@ -6368,9 +6368,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6156.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6157.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6156.0", + "description": "Run with ash-chrome version 121.0.6157.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6380,8 +6380,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6156.0", - "revision": "version:121.0.6156.0" + "location": "lacros_version_skew_tests_v121.0.6157.0", + "revision": "version:121.0.6157.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.coverage.json b/testing/buildbot/chromium.coverage.json index 61ad3d87e..85db0ee 100644 --- a/testing/buildbot/chromium.coverage.json +++ b/testing/buildbot/chromium.coverage.json
@@ -20593,9 +20593,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6156.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6157.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6156.0", + "description": "Run with ash-chrome version 121.0.6157.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -20605,8 +20605,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6156.0", - "revision": "version:121.0.6156.0" + "location": "lacros_version_skew_tests_v121.0.6157.0", + "revision": "version:121.0.6157.0" } ], "dimensions": { @@ -20743,9 +20743,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6156.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6157.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6156.0", + "description": "Run with ash-chrome version 121.0.6157.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -20755,8 +20755,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6156.0", - "revision": "version:121.0.6156.0" + "location": "lacros_version_skew_tests_v121.0.6157.0", + "revision": "version:121.0.6157.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 1813af3..4db0dcb2 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -43754,9 +43754,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6156.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6157.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6156.0", + "description": "Run with ash-chrome version 121.0.6157.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -43765,8 +43765,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6156.0", - "revision": "version:121.0.6156.0" + "location": "lacros_version_skew_tests_v121.0.6157.0", + "revision": "version:121.0.6157.0" } ], "dimensions": { @@ -43904,9 +43904,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6156.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6157.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6156.0", + "description": "Run with ash-chrome version 121.0.6157.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -43915,8 +43915,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6156.0", - "revision": "version:121.0.6156.0" + "location": "lacros_version_skew_tests_v121.0.6157.0", + "revision": "version:121.0.6157.0" } ], "dimensions": { @@ -45228,9 +45228,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6156.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6157.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6156.0", + "description": "Run with ash-chrome version 121.0.6157.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -45239,8 +45239,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6156.0", - "revision": "version:121.0.6156.0" + "location": "lacros_version_skew_tests_v121.0.6157.0", + "revision": "version:121.0.6157.0" } ], "dimensions": { @@ -45378,9 +45378,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6156.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6157.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6156.0", + "description": "Run with ash-chrome version 121.0.6157.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -45389,8 +45389,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6156.0", - "revision": "version:121.0.6156.0" + "location": "lacros_version_skew_tests_v121.0.6157.0", + "revision": "version:121.0.6157.0" } ], "dimensions": { @@ -46088,9 +46088,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6156.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6157.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 121.0.6156.0", + "description": "Run with ash-chrome version 121.0.6157.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -46099,8 +46099,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6156.0", - "revision": "version:121.0.6156.0" + "location": "lacros_version_skew_tests_v121.0.6157.0", + "revision": "version:121.0.6157.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index a4b92c8..966b071 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -6828,7 +6828,7 @@ "os": "Ubuntu-20.04" }, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 4 + "shards": 8 }, "test": "interactive_ui_tests", "test_id_prefix": "ninja://chrome/test:interactive_ui_tests/" @@ -16312,12 +16312,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.filter;../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6156.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6157.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 121.0.6156.0", + "description": "Run with ash-chrome version 121.0.6157.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16327,8 +16327,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6156.0", - "revision": "version:121.0.6156.0" + "location": "lacros_version_skew_tests_v121.0.6157.0", + "revision": "version:121.0.6157.0" } ], "dimensions": { @@ -16482,12 +16482,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.filter;../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6156.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6157.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 121.0.6156.0", + "description": "Run with ash-chrome version 121.0.6157.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16497,8 +16497,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v121.0.6156.0", - "revision": "version:121.0.6156.0" + "location": "lacros_version_skew_tests_v121.0.6157.0", + "revision": "version:121.0.6157.0" } ], "dimensions": {
diff --git a/testing/buildbot/filters/ios.use_blink.components_unittests.filter b/testing/buildbot/filters/ios.use_blink.components_unittests.filter index 5526a703..812d693f 100644 --- a/testing/buildbot/filters/ios.use_blink.components_unittests.filter +++ b/testing/buildbot/filters/ios.use_blink.components_unittests.filter
@@ -1,4 +1,144 @@ +# TODO(crbug.com/1427365): remove lines as more tests are supported on the platform. + # TODO(crbug.com/1505584): currently fail with use_blink. -AutofillAcrossIframesTest.FeatureDisabled -AutofillAcrossIframesTest.NoChildFrames -AutofillAcrossIframesTest.WithChildFrames + +# TODO(crbug.com/1505321): Test currently fails on iOS blink. +-AutofillAgentTests.OnFormDataFilledTestWithFrameMessagingUsingRendererIDs +-AutofillAgentTests.CheckIfSuggestionsAvailable_NonUserInitiatedActivity +-AutofillAgentTests.DriverFillSpecificFormField +-AutofillAgentTests.DriverPreviewSpecificFormField +-AutofillAgentTests.FillSpecificFormField +-AutofillAgentTests.FrameInitializationOrderFrames +-AutofillAgentTests.UpdateFieldManagerWithFillingResults +-AutofillAgentTests.onSuggestionsReady_ClearForm +-AutofillAgentTests.onSuggestionsReady_ClearFormWithGPay +-AutofillAgentTests.onSuggestionsReady_ShowAccountCards +-AutofillAgentTests.showAutofillPopup_EmptyIconInCreditCardSuggestion +-AutofillAgentTests.showAutofillPopup_PlusAddresses +-AutofillAgentTests.showAutofillPopup_PreferCustomIconForCreditCardSuggestions +-AutofillAgentTests.showAutofillPopup_ShowIconForCreditCardSuggestionsOnly +-AutofillAgentTests.showAutofillPopup_ShowVirtualCards + +# TODO(crbug.com/1505322): Test currently fails on iOS blink. +-FillJsTest.GetCanonicalActionForForm +-FillJsTest.GetAriaDescriptionInvalid +-FillJsTest.GetAriaDescriptionMulti +-FillJsTest.GetAriaDescriptionSingle +-FillJsTest.GetAriaLabel +-FillJsTest.GetAriaLabelledByFallback +-FillJsTest.GetAriaLabelledByInvalid +-FillJsTest.GetAriaLabelledByMulti +-FillJsTest.GetAriaLabelledBySingle +-FillJsTest.GetAriaLabelledByTakesPrecedence +-FillJsTest.ShouldAutocompleteOneTimeCode + +# TODO(crbug.com/1505327): Test currently fails on iOS blink. +-FormActivityTabHelperTest.TestObserverDocumentSubmitted +-FormActivityTabHelperTest.FormRemovalRegistered +-FormActivityTabHelperTest.TestFormSubmittedHook + +# TODO(crbug.com/1505328): Test currently fails on iOS blink. +-FormJsTest.KeyUpEventFocused +-FormJsTest.AddCustomElement +-FormJsTest.AddForm +-FormJsTest.AddInput +-FormJsTest.AddOption +-FormJsTest.AddSelect +-FormJsTest.FocusMainFrame +-FormJsTest.FocusSameOriginIFrame +-FormJsTest.FormSameOriginIFrame +-FormJsTest.FormSubmitMainFrame +-FormJsTest.GetIframeElements +-FormJsTest.KeyUpEventNotFocused +-FormJsTest.RemoveForm +-FormJsTest.RemoveFormlessPasswordFields + +# TODO(crbug.com/1505332): Test currently fails on iOS blink. +-PasswordFormHelperTest.FindPasswordFormsInView +-PasswordFormHelperTest.ExtractPasswordFormData +-PasswordFormHelperTest.FillPasswordFormWithFillData +-PasswordFormHelperTest.FillPasswordFormWithFillDataFillingFailure +-PasswordFormHelperTest.FillPasswordIntoFormWithUserTypedUsername +-PasswordFormHelperTest.HandleFormSubmittedMessage +-PasswordFormHelperTest.HandleFormSubmittedMessage_CantExtractFormData +-PasswordFormHelperTest.HandleFormSubmittedMessage_InvalidFormat +-PasswordFormHelperTest.HandleFormSubmittedMessage_NoFormMatchingId +-PasswordFormHelperTest.HandleFormSubmittedMessage_NoTrustedUrl +-PasswordFormHelperTest.HandleFormSubmittedMessage_NoWebState + +# TODO(crbug.com/1481427): Test currently fails on iOS blink. +-SharedPasswordControllerTest.PasswordManagerIsNotNotifiedAboutHeuristicsPredictions +-SharedPasswordControllerTest.CheckIfSuggestionsAvailableForFormCrossOriginIframe +-SharedPasswordControllerTest.CheckNoSuggestionsAreAvailableForNonPasswordForm +-SharedPasswordControllerTest.DeclinePasswordGenerationDialog +-SharedPasswordControllerTest.DidRegisterFormActivityForFormCrossOriginIframe +-SharedPasswordControllerTest.DidRegisterFormRemovalForFormCrossOriginIframe +-SharedPasswordControllerTest.DoesntInterpretElementAdditionsAsFormSubmission +-SharedPasswordControllerTest.FormHelperDidSubmitFormForFormCrossOriginIframe +-SharedPasswordControllerTest.FormHelperSetsUpUniqueIDsForNewFrame +-SharedPasswordControllerTest.FormsArePropagatedOnHTMLPageLoad +-SharedPasswordControllerTest.FrameDidBecomeAvailableCrossOriginIframe +-SharedPasswordControllerTest.FrameWillBecomeUnavailableCrossOriginIframe +-SharedPasswordControllerTest.LastFocusedFieldData +-SharedPasswordControllerTest.NoFormsArePropagatedOnNonHTMLPageLoad +-SharedPasswordControllerTest.PasswordManagerDidNavigationMainFrameOnNavigationFinished +-SharedPasswordControllerTest.PasswordManagerIsNotifiedAboutServerPredictions +-SharedPasswordControllerTest.PresavesGeneratedPassword +-SharedPasswordControllerTest.RetrieveSuggestionsForFormCrossOriginIframe +-SharedPasswordControllerTest.ReturnsGenerateSuggestionIfFormIsEligibleForGeneration +-SharedPasswordControllerTest.ReturnsNoSuggestionsIfFrameDestroyed +-SharedPasswordControllerTest.ReturnsNoSuggestionsIfNoneAreAvailable +-SharedPasswordControllerTest.ReturnsSuggestionsIfAvailable +-SharedPasswordControllerTest.SuggestsGeneratedPassword +-SharedPasswordControllerTest.TriggerPasswordGeneration + +# TODO(crbug.com/1505334): Test currently fails on iOS blink. +-SecurityStateUtilsTest.GetMaliciousContentStatus +-SecurityStateUtilsTest.GetSecurityLevelForWebStateMaliciousContent + +# TODO(crbug.com/1505338): Test currently fails on iOS blink. +-AccountConsistencyServiceTest.SigninAddCookieOnMainDomains +-AccountConsistencyServiceTest.AddChromeConnectedCookiesOnCookiesRemoved +-AccountConsistencyServiceTest.ChromeManageAccountsDefault +-AccountConsistencyServiceTest.ChromeManageAccountsNoHeader +-AccountConsistencyServiceTest.ChromeManageAccountsNotOnGaia +-AccountConsistencyServiceTest.ChromeManageAccountsShowAddAccount +-AccountConsistencyServiceTest.ChromeNotShowConsistencyPromoOnPageLoadFailure +-AccountConsistencyServiceTest.ChromeNotShowConsistencyPromoOnPageLoadFailureRedirect +-AccountConsistencyServiceTest.ChromeShowConsistencyPromo +-AccountConsistencyServiceTest.DeleteChromeConnectedCookiesAfterSet +-AccountConsistencyServiceTest.DomainsClearedOnBrowsingDataRemoved +-AccountConsistencyServiceTest.DomainsWithCookieLoadedFromPrefs +-AccountConsistencyServiceTest.GAIACookieMissingOnSignin +-AccountConsistencyServiceTest.SetChromeConnectedCookie +-AccountConsistencyServiceTest.SetChromeConnectedCookiesAfterDelete +-AccountConsistencyServiceTest.SetChromeConnectedCookiesSignedOutGaiaVisitor +-AccountConsistencyServiceTest.SetChromeConnectedCookiesSignedOutGoogleVisitor +-AccountConsistencyServiceTest.SetGaiaCookieUpdateAfterDelay +-AccountConsistencyServiceTest.SetGaiaCookieUpdateBeforeDelay +-AccountConsistencyServiceTest.SignInSignOut +-AccountConsistencyServiceTest.SignOutWithoutDomains + +# TODO(crbug.com/1505343): Test currently fails on iOS blink. +-ActiveStateManagerImplTest.ActiveState +-ActiveStateManagerImplTest.ObserverMethod + +# TODO(crbug.com/1505345): Test currently fails on iOS blink. +-JsTranslateWebFrameManagerTest.Inject +-JsTranslateWebFrameManagerTest.Reinject +-JsTranslateWebFrameManagerTest.Revert +-JsTranslateWebFrameManagerTest.Translate + +# TODO(crbug.com/1505346): Test currently fails on iOS blink. +-TranslateControllerTest.OnTranslateSendRequestWithValidCommand +-TranslateControllerTest.OnTranslateSendRequestWithBadURL +-TranslateControllerTest.OnTranslateSendRequestWithBadMethod + +# TODO(crbug.com/1505348): Test currently fails on iOS blink. +-UkmUrlRecorderTest.Basic +-UkmUrlRecorderTest.IgnoreDownloadUrl +-UkmUrlRecorderTest.IgnoreUrlInSubframe +-UkmUrlRecorderTest.InitialUrl
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index 482edc8f..0b78cb96 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl
@@ -45,26 +45,22 @@ "label": "//third_party/angle/src/tests:angle_deqp_gles2_tests", "type": "windowed_test_launcher", }, + "angle_deqp_gles31_rotate180_tests": { + "label": "//third_party/angle/src/tests:angle_deqp_gles31_rotate180_tests", + "type": "windowed_test_launcher", + }, + "angle_deqp_gles31_rotate270_tests": { + "label": "//third_party/angle/src/tests:angle_deqp_gles31_rotate270_tests", + "type": "windowed_test_launcher", + }, + "angle_deqp_gles31_rotate90_tests": { + "label": "//third_party/angle/src/tests:angle_deqp_gles31_rotate90_tests", + "type": "windowed_test_launcher", + }, "angle_deqp_gles31_tests": { "label": "//third_party/angle/src/tests:angle_deqp_gles31_tests", "type": "windowed_test_launcher", }, - "angle_deqp_gles3_tests": { - "label": "//third_party/angle/src/tests:angle_deqp_gles3_tests", - "type": "windowed_test_launcher", - }, - "angle_deqp_khr_gles2_tests": { - "label": "//third_party/angle/src/tests:angle_deqp_khr_gles2_tests", - "type": "windowed_test_launcher", - }, - "angle_deqp_khr_gles3_tests": { - "label": "//third_party/angle/src/tests:angle_deqp_khr_gles3_tests", - "type": "windowed_test_launcher", - }, - "angle_deqp_khr_gles31_tests": { - "label": "//third_party/angle/src/tests:angle_deqp_khr_gles31_tests", - "type": "windowed_test_launcher", - }, "angle_deqp_gles3_rotate180_tests": { "label": "//third_party/angle/src/tests:angle_deqp_gles3_rotate180_tests", "type": "windowed_test_launcher", @@ -77,16 +73,20 @@ "label": "//third_party/angle/src/tests:angle_deqp_gles3_rotate90_tests", "type": "windowed_test_launcher", }, - "angle_deqp_gles31_rotate180_tests": { - "label": "//third_party/angle/src/tests:angle_deqp_gles31_rotate180_tests", + "angle_deqp_gles3_tests": { + "label": "//third_party/angle/src/tests:angle_deqp_gles3_tests", "type": "windowed_test_launcher", }, - "angle_deqp_gles31_rotate270_tests": { - "label": "//third_party/angle/src/tests:angle_deqp_gles31_rotate270_tests", + "angle_deqp_khr_gles2_tests": { + "label": "//third_party/angle/src/tests:angle_deqp_khr_gles2_tests", "type": "windowed_test_launcher", }, - "angle_deqp_gles31_rotate90_tests": { - "label": "//third_party/angle/src/tests:angle_deqp_gles31_rotate90_tests", + "angle_deqp_khr_gles31_tests": { + "label": "//third_party/angle/src/tests:angle_deqp_khr_gles31_tests", + "type": "windowed_test_launcher", + }, + "angle_deqp_khr_gles3_tests": { + "label": "//third_party/angle/src/tests:angle_deqp_khr_gles3_tests", "type": "windowed_test_launcher", }, "angle_end2end_tests": { @@ -113,16 +113,16 @@ "label": "//chrome/test:ash_crosapi_tests", "type": "windowed_test_launcher", }, - "ash_webui_unittests": { - "label": "//ash/webui:ash_webui_unittests", + "ash_pixeltests": { + "label": "//ash:ash_pixeltests", "type": "windowed_test_launcher", }, "ash_unittests": { "label": "//ash:ash_unittests", "type": "windowed_test_launcher", }, - "ash_pixeltests": { - "label": "//ash:ash_pixeltests", + "ash_webui_unittests": { + "label": "//ash/webui:ash_webui_unittests", "type": "windowed_test_launcher", }, "aura_unittests": { @@ -231,6 +231,14 @@ "label": "//build/android:build_junit_tests", "type": "generated_script", }, + "build_rust_tests": { + "label": "//build/rust/tests:build_rust_tests", + "type": "generated_script", + }, + "capture_unittests": { + "label": "//media/capture:capture_unittests", + "type": "windowed_test_launcher", + }, "captured_sites_interactive_tests": { "label": "//chrome/test:captured_sites_interactive_tests", "type": "windowed_test_launcher", @@ -238,30 +246,6 @@ "--disable-extensions", ], }, - "capture_unittests": { - "label": "//media/capture:capture_unittests", - "type": "windowed_test_launcher", - }, - "cast_display_settings_unittests": { - "label": "//chromecast/ui/display_settings:cast_display_settings_unittests", - "type": "console_test_launcher", - }, - "cast_runner_browsertests": { - "label": "//fuchsia_web/runners:cast_runner_browsertests", - "type": "console_test_launcher", - }, - "cast_runner_integration_tests": { - "label": "//fuchsia_web/runners:cast_runner_integration_tests", - "type": "console_test_launcher", - }, - "cast_runner_pkg": { - "label": "//fuchsia_web/runners:cast_runner_pkg", - "type": "additional_compile_target", - }, - "cast_runner_unittests": { - "label": "//fuchsia_web/runners:cast_runner_unittests", - "type": "console_test_launcher", - }, "cast_audio_backend_unittests": { "label": "//chromecast/media/cma/backend:cast_audio_backend_unittests", "type": "console_test_launcher", @@ -282,6 +266,10 @@ "label": "//chromecast/crash:cast_crash_unittests", "type": "console_test_launcher", }, + "cast_display_settings_unittests": { + "label": "//chromecast/ui/display_settings:cast_display_settings_unittests", + "type": "console_test_launcher", + }, "cast_graphics_unittests": { "label": "//chromecast/graphics:cast_graphics_unittests", "type": "console_test_launcher", @@ -294,6 +282,22 @@ "label": "//chromecast/media:cast_media_unittests", "type": "console_test_launcher", }, + "cast_runner_browsertests": { + "label": "//fuchsia_web/runners:cast_runner_browsertests", + "type": "console_test_launcher", + }, + "cast_runner_integration_tests": { + "label": "//fuchsia_web/runners:cast_runner_integration_tests", + "type": "console_test_launcher", + }, + "cast_runner_pkg": { + "label": "//fuchsia_web/runners:cast_runner_pkg", + "type": "additional_compile_target", + }, + "cast_runner_unittests": { + "label": "//fuchsia_web/runners:cast_runner_unittests", + "type": "console_test_launcher", + }, "cast_shell": { "label": "//chromecast:cast_shell", "type": "additional_compile_target", @@ -330,6 +334,30 @@ "label": "//chrome:chrome", "type": "additional_compile_target", }, + "chrome/browser/media/router": { + "label": "//chrome/browser/media/router:router", + "type": "additional_compile_target", + }, + "chrome/browser/media/router:openscreen_unittests": { + "label": "//chrome/browser/media/router:openscreen_unittests", + "type": "additional_compile_target", + }, + "chrome/browser/media/router:unittests": { + "label": "//chrome/browser/media/router:unittests", + "type": "additional_compile_target", + }, + "chrome/installer/linux": { + "label": "//chrome/installer/linux:linux", + "type": "additional_compile_target", + }, + "chrome/installer/mac": { + "label": "//chrome/installer/mac:mac", + "type": "additional_compile_target", + }, + "chrome/updater:all": { + "label": "//chrome/updater:all", + "type": "additional_compile_target", + }, "chrome_all_tast_tests": { "label": "//chromeos:chrome_all_tast_tests", "type": "generated_script", @@ -359,6 +387,14 @@ "label": "//chrome/chrome_elf:chrome_elf_unittests", "type": "console_test_launcher", }, + "chrome_ios_wpt": { + "label": "//ios/chrome/test/wpt:chrome_ios_wpt", + "type": "generated_script", + "args": [ + "--results-directory", + "${ISOLATED_OUTDIR}", + ], + }, "chrome_java_test_pagecontroller_junit_tests": { "label": "//chrome/test/android:chrome_java_test_pagecontroller_junit_tests", "type": "generated_script", @@ -391,14 +427,14 @@ "label": "//chrome:chrome_private_code_test", "type": "generated_script", }, - "chrome_public_apk_baseline_profile_generator": { - "label": "//chrome/test/android:chrome_public_apk_baseline_profile_generator", - "type": "console_test_launcher", - }, "chrome_public_apk": { "label": "//chrome/android:chrome_public_apk", "type": "additional_compile_target", }, + "chrome_public_apk_baseline_profile_generator": { + "label": "//chrome/test/android:chrome_public_apk_baseline_profile_generator", + "type": "console_test_launcher", + }, "chrome_public_smoke_test": { "label": "//chrome/android:chrome_public_smoke_test", "type": "console_test_launcher", @@ -431,6 +467,14 @@ "label": "//chrome/test:chrome_sizes", "type": "generated_script", }, + "chrome_wpt_tests": { + "label": "//:chrome_wpt_tests", + "type": "generated_script", + "args": [ + "--results-directory", + "${ISOLATED_OUTDIR}", + ], + }, "chromedriver": { "label": "//chrome/test/chromedriver:chromedriver_server", "type": "additional_compile_target", @@ -462,62 +506,6 @@ "--browser-name=chrome-headless-shell", ], }, - "chromeos_integration_tests": { - "label": "//chrome/test:chromeos_integration_tests", - "type": "windowed_test_launcher", - }, - "chrome_wpt_tests": { - "label": "//:chrome_wpt_tests", - "type": "generated_script", - "args": [ - "--results-directory", - "${ISOLATED_OUTDIR}", - ], - }, - "content_shell_wpt": { - "label": "//:content_shell_wpt", - "type": "generated_script", - "args": [ - "--results-directory", - "${ISOLATED_OUTDIR}", - ], - }, - "chrome_ios_wpt": { - "label": "//ios/chrome/test/wpt:chrome_ios_wpt", - "type": "generated_script", - "args": [ - "--results-directory", - "${ISOLATED_OUTDIR}", - ], - }, - "chrome/browser/media/router": { - "label": "//chrome/browser/media/router:router", - "type": "additional_compile_target", - }, - "chrome/browser/media/router:openscreen_unittests": { - "label": "//chrome/browser/media/router:openscreen_unittests", - "type": "additional_compile_target", - }, - "chrome/browser/media/router:unittests": { - "label": "//chrome/browser/media/router:unittests", - "type": "additional_compile_target", - }, - "chrome/installer/linux": { - "label": "//chrome/installer/linux:linux", - "type": "additional_compile_target", - }, - "chrome/installer/mac": { - "label": "//chrome/installer/mac:mac", - "type": "additional_compile_target", - }, - "variations_smoke_tests": { - "label": "//chrome/test:variations_smoke_tests", - "type": "generated_script", - }, - "variations_desktop_smoke_tests": { - "label": "//chrome/test/variations:variations_desktop_smoke_tests", - "type": "generated_script", - }, "chromedriver_replay_unittests": { "label": "//chrome/test/chromedriver:chromedriver_replay_unittests", "type": "script", @@ -531,6 +519,10 @@ "label": "//chromeos/components:chromeos_components_unittests", "type": "console_test_launcher", }, + "chromeos_integration_tests": { + "label": "//chrome/test:chromeos_integration_tests", + "type": "windowed_test_launcher", + }, "chromeos_unittests": { "label": "//chromeos:chromeos_unittests", "type": "console_test_launcher", @@ -558,14 +550,6 @@ "src/third_party/android_sdk/public/platform-tools/adb", ], }, - "components/media_router/common/providers/cast/channel": { - "label": "//components/media_router/common/providers/cast/channel:cast_channel", - "type": "additional_compile_target", - }, - "components/media_router/common/providers/cast/channel:unit_tests": { - "label": "//components/media_router/common/providers/cast/channel:unit_tests", - "type": "additional_compile_target", - }, "components/media_router/common/providers/cast/certificate": { "label": "//components/media_router/common/providers/cast/certificate", "type": "additional_compile_target", @@ -574,6 +558,14 @@ "label": "//components/media_router/common/providers/cast/certificate:unit_tests", "type": "additional_compile_target", }, + "components/media_router/common/providers/cast/channel": { + "label": "//components/media_router/common/providers/cast/channel:cast_channel", + "type": "additional_compile_target", + }, + "components/media_router/common/providers/cast/channel:unit_tests": { + "label": "//components/media_router/common/providers/cast/channel:unit_tests", + "type": "additional_compile_target", + }, "components/mirroring/browser": { "label": "//components/mirroring/browser:browser", "type": "additional_compile_target", @@ -641,6 +633,14 @@ "label": "//content/shell/android:content_shell_test_apk", "type": "console_test_launcher", }, + "content_shell_wpt": { + "label": "//:content_shell_wpt", + "type": "generated_script", + "args": [ + "--results-directory", + "${ISOLATED_OUTDIR}", + ], + }, "content_unittests": { "label": "//content/test:content_unittests", "type": "windowed_test_launcher", @@ -705,6 +705,14 @@ "label": "//crypto:crypto_unittests", "type": "console_test_launcher", }, + "ct_telemetry_perf_tests_without_chrome": { + "label": "//chrome/test:ct_telemetry_perf_tests_without_chrome", + "type": "script", + "script": "//testing/scripts/run_performance_tests.py", + "args": [ + "../../tools/perf/run_benchmark", + ], + }, "dawn_end2end_tests": { "label": "//third_party/dawn/src/dawn/tests:dawn_end2end_tests", "type": "windowed_test_launcher", @@ -776,6 +784,10 @@ "label": "//extensions:extensions_unittests", "type": "windowed_test_launcher", }, + "fake_libva_driver_unittest": { + "label": "//media/gpu/vaapi/test/fake_libva_driver:fake_libva_driver_unittest", + "type": "console_test_launcher", + }, "filesystem_service_unittests": { "label": "//components/services/filesystem:filesystem_service_unittests", "type": "console_test_launcher", @@ -802,10 +814,6 @@ "label": "//chrome/credential_provider/test:gcp_unittests", "type": "console_test_launcher", }, - "test_ash_chrome_cipd_yaml": { - "label": "//chrome/test:test_ash_chrome_cipd_yaml", - "type": "additional_compile_target", - }, "gfx_unittests": { "label": "//ui/gfx:gfx_unittests", "type": "console_test_launcher", @@ -913,18 +921,14 @@ "label": "//ios/chrome/test:all_fuzzer_tests", "type": "additional_compile_target", }, - "ios_chrome_clusterfuzz_asan_build": { - "label": "//ios/chrome/test/wpt:ios_chrome_clusterfuzz_asan_build", - "type": "additional_compile_target", - }, - "ios_chrome_unittests": { - "label": "//ios/chrome/test:ios_chrome_unittests", - "type": "generated_script", - }, "ios_chrome_bookmarks_eg2tests_module": { "label": "//ios/chrome/test/earl_grey2:ios_chrome_bookmarks_eg2tests_module", "type": "generated_script", }, + "ios_chrome_clusterfuzz_asan_build": { + "label": "//ios/chrome/test/wpt:ios_chrome_clusterfuzz_asan_build", + "type": "additional_compile_target", + }, "ios_chrome_integration_eg2tests_module": { "label": "//ios/chrome/test/earl_grey2:ios_chrome_integration_eg2tests_module", "type": "generated_script", @@ -945,18 +949,22 @@ "label": "//ios/chrome/test/earl_grey2:ios_chrome_ui_eg2tests_module", "type": "generated_script", }, + "ios_chrome_unittests": { + "label": "//ios/chrome/test:ios_chrome_unittests", + "type": "generated_script", + }, "ios_chrome_web_eg2tests_module": { "label": "//ios/chrome/test/earl_grey2:ios_chrome_web_eg2tests_module", "type": "generated_script", }, - "ios_crash_xcuitests_module": { - "label": "//third_party/crashpad/crashpad/test/ios:ios_crash_xcuitests_module", - "type": "generated_script", - }, "ios_components_unittests": { "label": "//ios/components:ios_components_unittests", "type": "generated_script", }, + "ios_crash_xcuitests_module": { + "label": "//third_party/crashpad/crashpad/test/ios:ios_crash_xcuitests_module", + "type": "generated_script", + }, "ios_net_unittests": { "label": "//ios/net:ios_net_unittests", "type": "generated_script", @@ -1150,14 +1158,6 @@ "label": "//components/module_installer/android:module_installer_junit_tests", "type": "generated_script", }, - "monochrome_public_smoke_test": { - "label": "//chrome/android:monochrome_public_smoke_test", - "type": "console_test_launcher", - }, - "monochrome_public_bundle_smoke_test": { - "label": "//chrome/android:monochrome_public_bundle_smoke_test", - "type": "console_test_launcher", - }, "mojo_python_unittests": { "label": "//mojo/public/tools:mojo_python_unittests", "type": "script", @@ -1206,6 +1206,14 @@ "apks/MonochromePublic.apk.pathmap.txt", ], }, + "monochrome_public_bundle_smoke_test": { + "label": "//chrome/android:monochrome_public_bundle_smoke_test", + "type": "console_test_launcher", + }, + "monochrome_public_smoke_test": { + "label": "//chrome/android:monochrome_public_smoke_test", + "type": "console_test_launcher", + }, "monochrome_public_test_ar_apk": { "label": "//chrome/android:monochrome_public_test_ar_apk", "type": "console_test_launcher", @@ -1228,10 +1236,6 @@ "label": "//components/nacl/loader:nacl_loader_unittests", "type": "console_test_launcher", }, - "build_rust_tests": { - "label": "//build/rust/tests:build_rust_tests", - "type": "generated_script", - }, "native_theme_unittests": { "label": "//ui/native_theme:native_theme_unittests", "type": "windowed_test_launcher", @@ -1340,14 +1344,14 @@ "label": "//chrome/test:performance_test_suite_android_clank_monochrome_bundle", "type": "generated_script", }, - "performance_test_suite_android_clank_trichrome_chrome_google_64_32_bundle": { - "label": "//chrome/test:performance_test_suite_android_clank_trichrome_chrome_google_64_32_bundle", - "type": "generated_script", - }, "performance_test_suite_android_clank_trichrome_bundle": { "label": "//chrome/test:performance_test_suite_android_clank_trichrome_bundle", "type": "generated_script", }, + "performance_test_suite_android_clank_trichrome_chrome_google_64_32_bundle": { + "label": "//chrome/test:performance_test_suite_android_clank_trichrome_chrome_google_64_32_bundle", + "type": "generated_script", + }, "performance_test_suite_eve": { "label": "//chrome/test:performance_test_suite_eve", "type": "generated_script", @@ -1488,10 +1492,6 @@ "label": "//chrome/installer/setup:setup_unittests", "type": "console_test_launcher", }, - "shell_encryption_unittests": { - "label": "//third_party/shell-encryption:shell_encryption_unittests", - "type": "console_test_launcher", - }, "shell_dialogs_unittests": { "label": "//ui/shell_dialogs:shell_dialogs_unittests", "type": "console_test_launcher", @@ -1499,6 +1499,10 @@ "--test-launcher-jobs=1", ], }, + "shell_encryption_unittests": { + "label": "//third_party/shell-encryption:shell_encryption_unittests", + "type": "console_test_launcher", + }, "skia_unittests": { "label": "//skia:skia_unittests", "type": "console_test_launcher", @@ -1511,14 +1515,14 @@ "label": "//sql:sql_unittests", "type": "console_test_launcher", }, - "strip_lacros_files": { - "label": "//chrome:strip_lacros_files", - "type": "additional_compile_target", - }, "storage_unittests": { "label": "//storage:storage_unittests", "type": "console_test_launcher", }, + "strip_lacros_files": { + "label": "//chrome:strip_lacros_files", + "type": "additional_compile_target", + }, "symupload": { "label": "//third_party/breakpad:symupload", "type": "additional_compile_target", @@ -1607,14 +1611,6 @@ "-v", ], }, - "ct_telemetry_perf_tests_without_chrome": { - "label": "//chrome/test:ct_telemetry_perf_tests_without_chrome", - "type": "script", - "script": "//testing/scripts/run_performance_tests.py", - "args": [ - "../../tools/perf/run_benchmark", - ], - }, "telemetry_perf_unittests": { "label": "//chrome/test:telemetry_perf_unittests", "type": "script", @@ -1655,6 +1651,10 @@ "../../", ], }, + "test_ash_chrome_cipd_yaml": { + "label": "//chrome/test:test_ash_chrome_cipd_yaml", + "type": "additional_compile_target", + }, "test_cpp_including_rust_unittests": { "label": "//build/rust/tests/test_cpp_including_rust:test_cpp_including_rust_unittests", "type": "console_test_launcher", @@ -1721,6 +1721,10 @@ "label": "//ui/touch_selection:ui_touch_selection_unittests", "type": "windowed_test_launcher", }, + "ui_unittests": { + "label": "//ui/tests:ui_unittests", + "type": "console_test_launcher", + }, "unit_tests": { "label": "//chrome/test:unit_tests", "type": "windowed_test_launcher", @@ -1761,14 +1765,6 @@ "--ui-test-action-timeout=40000", ], }, - "chrome/updater:all": { - "label": "//chrome/updater:all", - "type": "additional_compile_target", - }, - "ui_unittests": { - "label": "//ui/tests:ui_unittests", - "type": "console_test_launcher", - }, "upload_trace_processor": { "label": "//tools/perf/core/perfetto_binary_roller:upload_trace_processor", "type": "generated_script", @@ -1793,26 +1789,30 @@ "label": "//media/gpu/vaapi:vaapi_unittest", "type": "console_test_launcher", }, - "fake_libva_driver_unittest": { - "label": "//media/gpu/vaapi/test/fake_libva_driver:fake_libva_driver_unittest", - "type": "console_test_launcher", + "variations_desktop_smoke_tests": { + "label": "//chrome/test/variations:variations_desktop_smoke_tests", + "type": "generated_script", }, - "video_decode_accelerator_tests": { - "label": "//media/gpu/test:video_decode_accelerator_tests", - "type": "additional_compile_target", + "variations_smoke_tests": { + "label": "//chrome/test:variations_smoke_tests", + "type": "generated_script", }, "video_decode_accelerator_perf_tests": { "label": "//media/gpu/test:video_decode_accelerator_perf_tests", "type": "additional_compile_target", }, - "video_encode_accelerator_tests": { - "label": "//media/gpu/test:video_encode_accelerator_tests", + "video_decode_accelerator_tests": { + "label": "//media/gpu/test:video_decode_accelerator_tests", "type": "additional_compile_target", }, "video_encode_accelerator_perf_tests": { "label": "//media/gpu/test:video_encode_accelerator_perf_tests", "type": "additional_compile_target", }, + "video_encode_accelerator_tests": { + "label": "//media/gpu/test:video_encode_accelerator_tests", + "type": "additional_compile_target", + }, "views_examples_unittests": { "label": "//ui/views/examples:views_examples_unittests", "type": "windowed_test_launcher", @@ -1918,6 +1918,20 @@ "${ISOLATED_OUTDIR}", ], }, + "webview_64_cts_tests": { + "label": "//android_webview/test:webview_64_cts_tests", + "type": "script", + "script": "//android_webview/tools/run_cts.py", + "args": [ + "--skip-expected-failures", + "--use-webview-provider", + "apks/SystemWebView64.apk", + "--apk-under-test", + "apks/SystemWebView64.apk", + "--use-apk-under-test-flags-file", + "-v", + ], + }, "webview_cts_tests": { "label": "//android_webview/test:webview_cts_tests", "type": "script", @@ -1932,6 +1946,26 @@ "-v", ], }, + "webview_instrumentation_test_apk": { + "label": "//android_webview/test:webview_instrumentation_test_apk", + "type": "console_test_launcher", + }, + "webview_trichrome_64_cts_tests": { + "label": "//android_webview/test:webview_trichrome_64_cts_tests", + "type": "script", + "script": "//android_webview/tools/run_cts.py", + "args": [ + "--skip-expected-failures", + "--additional-apk", + "apks/TrichromeLibrary64.apk", + "--use-webview-provider", + "apks/TrichromeWebView64.apk", + "--apk-under-test", + "apks/TrichromeWebView64.apk", + "--use-apk-under-test-flags-file", + "-v", + ], + }, "webview_trichrome_cts_tests": { "label": "//android_webview/test:webview_trichrome_cts_tests", "type": "script", @@ -1948,40 +1982,6 @@ "-v", ], }, - "webview_trichrome_64_cts_tests": { - "label": "//android_webview/test:webview_trichrome_64_cts_tests", - "type": "script", - "script": "//android_webview/tools/run_cts.py", - "args": [ - "--skip-expected-failures", - "--additional-apk", - "apks/TrichromeLibrary64.apk", - "--use-webview-provider", - "apks/TrichromeWebView64.apk", - "--apk-under-test", - "apks/TrichromeWebView64.apk", - "--use-apk-under-test-flags-file", - "-v", - ], - }, - "webview_64_cts_tests": { - "label": "//android_webview/test:webview_64_cts_tests", - "type": "script", - "script": "//android_webview/tools/run_cts.py", - "args": [ - "--skip-expected-failures", - "--use-webview-provider", - "apks/SystemWebView64.apk", - "--apk-under-test", - "apks/SystemWebView64.apk", - "--use-apk-under-test-flags-file", - "-v", - ], - }, - "webview_instrumentation_test_apk": { - "label": "//android_webview/test:webview_instrumentation_test_apk", - "type": "console_test_launcher", - }, "webview_ui_test_app_test_apk": { "label": "//android_webview/tools/automated_ui_tests:webview_ui_test_app_test_apk", "type": "console_test_launcher",
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index c36955a..90ba536 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -3093,7 +3093,7 @@ }, 'Linux MSan Tests': { 'swarming': { - 'shards': 4, + 'shards': 8, }, }, 'Linux TSan Tests': {
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 1c94dfaf..2f4f4fb 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -5756,9 +5756,9 @@ 'compound_suites': { 'android_10_rel_gtests': [ - 'android_trichrome_smoke_tests', 'android_ar_gtests', 'android_ddready_vr_gtests', + 'android_trichrome_smoke_tests', ], 'android_12_dbg_emulator_gtests': [ @@ -5768,9 +5768,9 @@ 'android_marshmallow_gtests': [ 'android_smoke_tests', 'android_specific_chromium_gtests', + 'chrome_public_tests', 'chromium_gtests', 'chromium_gtests_for_devices_with_graphical_output', - 'chrome_public_tests', 'linux_flavor_specific_chromium_gtests', 'vr_android_specific_chromium_tests', 'vr_platform_specific_chromium_gtests', @@ -5828,8 +5828,8 @@ ], 'android_pie_rel_gtests': [ - 'android_pie_rel_reduced_capacity_gtests', 'android_monochrome_smoke_tests', + 'android_pie_rel_reduced_capacity_gtests', 'android_smoke_tests', 'chrome_public_tests', 'system_webview_shell_instrumentation_tests', @@ -5864,15 +5864,15 @@ ], 'chromeos_vm_gtests': [ - 'chromeos_system_friendly_gtests', 'chromeos_integration_tests', + 'chromeos_system_friendly_gtests', ], 'chromeos_vm_gtests_and_tast': [ 'chromeos_browser_all_tast_tests', 'chromeos_browser_integration_tests', - 'chromeos_system_friendly_gtests', 'chromeos_integration_tests', + 'chromeos_system_friendly_gtests', ], 'chromeos_vm_tast': [ @@ -5883,9 +5883,9 @@ 'chromium_android_gtests': [ 'android_smoke_tests', 'android_specific_chromium_gtests', + 'chrome_public_tests', 'chromium_gtests', 'chromium_gtests_for_devices_with_graphical_output', - 'chrome_public_tests', 'linux_flavor_specific_chromium_gtests', 'vr_android_specific_chromium_tests', 'vr_platform_specific_chromium_gtests', @@ -5905,10 +5905,10 @@ 'chromium_gtests_for_linux_and_mac_only', 'chromium_gtests_for_linux_only', 'chromium_gtests_for_win_and_linux_only', - 'linux_flavor_specific_chromium_gtests', - 'linux_specific_xr_gtests', 'gl_gtests_passthrough', 'gpu_fyi_vulkan_swiftshader_gtests', + 'linux_flavor_specific_chromium_gtests', + 'linux_specific_xr_gtests', 'non_android_and_cast_and_chromeos_chromium_gtests', 'non_android_chromium_gtests_no_nacl', 'vr_platform_specific_chromium_gtests', @@ -5922,19 +5922,19 @@ 'chromium_gtests_for_linux_and_mac_only', 'chromium_gtests_for_linux_only', 'chromium_gtests_for_win_and_linux_only', + 'gl_gtests_passthrough', 'linux_flavor_specific_chromium_gtests', 'linux_specific_xr_gtests', - 'gl_gtests_passthrough', 'non_android_and_cast_and_chromeos_chromium_gtests', 'non_android_chromium_gtests_no_nacl', 'vr_platform_specific_chromium_gtests', ], 'chromium_linux_blink_rel_isolated_scripts': [ + 'chromium_web_tests_high_dpi_isolated_scripts', 'chromium_webkit_isolated_scripts', 'linux_specific_chromium_isolated_scripts', 'vulkan_swiftshader_isolated_scripts', - 'chromium_web_tests_high_dpi_isolated_scripts', ], 'chromium_linux_cast_audio_gtests': [ @@ -5989,29 +5989,32 @@ 'chromium_linux_rel_isolated_scripts': [ 'chromedriver_py_tests_isolated_scripts', + 'chromium_web_tests_high_dpi_isolated_scripts', 'desktop_chromium_isolated_scripts', 'linux_specific_chromium_isolated_scripts', 'mojo_python_unittests_isolated_scripts', 'pytype_tests', 'telemetry_perf_unittests_isolated_scripts', 'vulkan_swiftshader_isolated_scripts', - 'chromium_web_tests_high_dpi_isolated_scripts', ], 'chromium_linux_rel_isolated_scripts_code_coverage': [ 'chromedriver_py_tests_isolated_scripts', + 'chromium_web_tests_high_dpi_isolated_scripts', 'desktop_chromium_isolated_scripts', + 'gpu_dawn_webgpu_blink_web_tests', 'linux_specific_chromium_isolated_scripts', 'mojo_python_unittests_isolated_scripts', 'pytype_tests', 'telemetry_perf_unittests_isolated_scripts_xvfb', 'vulkan_swiftshader_isolated_scripts', - 'chromium_web_tests_high_dpi_isolated_scripts', - 'gpu_dawn_webgpu_blink_web_tests', ], 'chromium_linux_rel_isolated_scripts_once': [ 'chromedriver_py_tests_isolated_scripts', + 'chromium_web_tests_brfetch_isolated_scripts', + 'chromium_web_tests_high_dpi_isolated_scripts', + 'chromium_wpt_tests_isolated_scripts', 'desktop_chromium_isolated_scripts', 'desktop_once_isolated_scripts', 'linux_specific_chromium_isolated_scripts', @@ -6019,9 +6022,6 @@ 'pytype_tests', 'telemetry_perf_unittests_isolated_scripts', 'vulkan_swiftshader_isolated_scripts', - 'chromium_web_tests_high_dpi_isolated_scripts', - 'chromium_web_tests_brfetch_isolated_scripts', - 'chromium_wpt_tests_isolated_scripts', ], 'chromium_mac_gtests': [ @@ -6172,8 +6172,8 @@ ], 'devtools_gtests': [ - 'devtools_browser_tests', 'blink_unittests', + 'devtools_browser_tests', ], 'fuchsia_accessibility_browsertests': [ @@ -6220,8 +6220,8 @@ 'gpu_angle_win_intel_nvidia_telemetry_tests': [ 'gpu_info_collection_telemetry_tests', 'gpu_webgl2_conformance_d3d11_passthrough_telemetry_tests', - 'gpu_webgl_conformance_d3d9_passthrough_telemetry_tests', 'gpu_webgl_conformance_d3d11_passthrough_telemetry_tests', + 'gpu_webgl_conformance_d3d9_passthrough_telemetry_tests', 'gpu_webgl_conformance_vulkan_passthrough_telemetry_tests', ], @@ -6276,29 +6276,29 @@ ], 'gpu_dawn_compat_telemetry_tests': [ + 'gpu_dawn_web_platform_webgpu_cts_force_swiftshader', 'gpu_dawn_webgpu_compat_cts', 'gpu_dawn_webgpu_cts', - 'gpu_dawn_web_platform_webgpu_cts_force_swiftshader', ], 'gpu_dawn_integration_asan_gtests_passthrough': [ + 'gpu_common_gtests_passthrough', 'gpu_dawn_gtests', 'gpu_dawn_gtests_no_dxc', - 'gpu_common_gtests_passthrough', ], 'gpu_dawn_integration_gtests_passthrough': [ + 'gpu_common_gtests_passthrough', 'gpu_dawn_gtests', 'gpu_dawn_gtests_with_validation', - 'gpu_common_gtests_passthrough', ], 'gpu_dawn_integration_gtests_passthrough_win_x64': [ + 'gpu_common_gtests_passthrough', 'gpu_dawn_gtests', - 'gpu_dawn_gtests_with_validation', 'gpu_dawn_gtests_no_dxc', 'gpu_dawn_gtests_no_dxc_with_validation', - 'gpu_common_gtests_passthrough', + 'gpu_dawn_gtests_with_validation', ], 'gpu_dawn_isolated_scripts': [ @@ -6309,14 +6309,14 @@ ], 'gpu_dawn_telemetry_tests': [ - 'gpu_dawn_webgpu_cts', 'gpu_dawn_web_platform_webgpu_cts_force_swiftshader', + 'gpu_dawn_webgpu_cts', ], 'gpu_dawn_telemetry_win_x64_tests': [ + 'gpu_dawn_web_platform_webgpu_cts_force_swiftshader', 'gpu_dawn_webgpu_cts', 'gpu_dawn_webgpu_cts_dxc', - 'gpu_dawn_web_platform_webgpu_cts_force_swiftshader', ], 'gpu_dawn_tsan_gtests': [ @@ -6368,9 +6368,9 @@ 'gpu_mediapipe_validating_telemetry_tests', 'gpu_validating_telemetry_tests', 'gpu_webcodecs_validating_telemetry_test', - 'gpu_webgl_conformance_validating_telemetry_tests', 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests', 'gpu_webgl2_conformance_validating_telemetry_tests', + 'gpu_webgl_conformance_validating_telemetry_tests', ], 'gpu_fyi_lacros_release_telemetry_tests': [ @@ -6413,9 +6413,9 @@ 'gpu_common_and_optional_telemetry_tests', 'gpu_mediapipe_passthrough_telemetry_tests', 'gpu_passthrough_telemetry_tests', + 'gpu_skia_renderer_vulkan_passthrough_telemetry_tests', 'gpu_webgl2_conformance_gl_passthrough_telemetry_tests', 'gpu_webgl_conformance_gl_passthrough_telemetry_tests', - 'gpu_skia_renderer_vulkan_passthrough_telemetry_tests', ], 'gpu_fyi_mac_debug_gtests': [ @@ -6555,10 +6555,10 @@ 'gpu_passthrough_telemetry_tests', 'gpu_validating_telemetry_tests', 'gpu_webcodecs_validating_telemetry_test', - 'gpu_webgl_conformance_gles_passthrough_telemetry_tests', - 'gpu_webgl_conformance_validating_telemetry_tests', 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests', 'gpu_webgl2_conformance_validating_telemetry_tests', + 'gpu_webgl_conformance_gles_passthrough_telemetry_tests', + 'gpu_webgl_conformance_validating_telemetry_tests', ], 'gpu_swangle_telemetry_tests': [ @@ -6603,18 +6603,18 @@ ], 'linux_chromeos_specific_and_lacros_dependent_gtests': [ + 'ash_pixel_gtests', 'aura_gtests', 'chromium_gtests', 'chromium_gtests_for_devices_with_graphical_output', 'chromium_gtests_for_linux_and_chromeos_only', 'chromium_gtests_for_win_and_linux_only', + 'linux_chromeos_browser_tests_require_lacros', 'linux_chromeos_lacros_gtests', 'linux_chromeos_specific_gtests', - 'linux_chromeos_browser_tests_require_lacros', 'linux_flavor_specific_chromium_gtests', 'non_android_chromium_gtests', 'pixel_experimental_browser_tests_gtests', - 'ash_pixel_gtests', ], 'linux_viz_gtests': [ @@ -6677,8 +6677,8 @@ 'wpt_web_tests_content_shell_multiple_flags': [ 'wpt_web_tests_content_shell', - 'wpt_web_tests_not_site_per_process', 'wpt_web_tests_highdpi', + 'wpt_web_tests_not_site_per_process', ], }, @@ -6686,9 +6686,9 @@ 'android_11_emulator_gtests': { 'android_emulator_specific_chrome_public_tests': {}, - 'android_trichrome_smoke_tests': {}, 'android_smoke_tests': {}, 'android_specific_chromium_gtests': {}, + 'android_trichrome_smoke_tests': {}, 'chromium_gtests': {}, 'chromium_gtests_for_devices_with_graphical_output': {}, 'linux_flavor_specific_chromium_gtests': {}, @@ -6705,9 +6705,9 @@ 'android_12_emulator_gtests': { 'android_12_fieldtrial_webview_tests': {}, 'android_emulator_specific_chrome_public_tests': {}, - 'android_trichrome_smoke_tests': {}, 'android_smoke_tests': {}, 'android_specific_chromium_gtests': {}, + 'android_trichrome_smoke_tests': {}, 'chrome_profile_generator_tests': {}, 'chromium_gtests': {}, 'chromium_gtests_for_devices_with_graphical_output': {}, @@ -6726,9 +6726,9 @@ 'android_12l_emulator_gtests': { 'android_emulator_specific_chrome_public_tests': {}, - 'android_trichrome_smoke_tests': {}, 'android_smoke_tests': {}, 'android_specific_chromium_gtests': {}, + 'android_trichrome_smoke_tests': {}, 'chromium_gtests': {}, 'chromium_gtests_for_devices_with_graphical_output': {}, 'linux_flavor_specific_chromium_gtests': {}, @@ -6738,9 +6738,9 @@ 'android_13_emulator_gtests': { 'android_emulator_specific_chrome_public_tests': {}, - 'android_trichrome_smoke_tests': {}, 'android_smoke_tests': {}, 'android_specific_chromium_gtests': {}, + 'android_trichrome_smoke_tests': {}, 'chromium_gtests': {}, 'chromium_gtests_for_devices_with_graphical_output': {}, 'linux_flavor_specific_chromium_gtests': {}, @@ -6757,6 +6757,13 @@ 'android_fieldtrial_rel_webview_tests': { 'fieldtrial_android_tests': {}, + 'system_webview_shell_instrumentation_tests': { + 'variants': [ + 'DISABLE_FIELD_TRIAL_CONFIG_WEBVIEW_COMMANDLINE', + 'SINGLE_GROUP_PER_STUDY_PREFER_EXISTING_BEHAVIOR_WEBVIEW_COMMANDLINE', + 'SINGLE_GROUP_PER_STUDY_PREFER_NEW_BEHAVIOR_WEBVIEW_COMMANDLINE', + ], + }, 'webview_bot_instrumentation_test_apk_gtest': { 'variants': [ 'DISABLE_FIELD_TRIAL_CONFIG', @@ -6778,13 +6785,6 @@ 'SINGLE_GROUP_PER_STUDY_PREFER_NEW_BEHAVIOR', ], }, - 'system_webview_shell_instrumentation_tests': { - 'variants': [ - 'DISABLE_FIELD_TRIAL_CONFIG_WEBVIEW_COMMANDLINE', - 'SINGLE_GROUP_PER_STUDY_PREFER_EXISTING_BEHAVIOR_WEBVIEW_COMMANDLINE', - 'SINGLE_GROUP_PER_STUDY_PREFER_NEW_BEHAVIOR_WEBVIEW_COMMANDLINE', - ], - }, }, 'chromeos_brya_skylab_tests': { @@ -6962,12 +6962,12 @@ 'CROS_JACUZZI_RELEASE_LKGM', ], }, - 'gpu_webgl_conformance_gles_passthrough_telemetry_tests': { + 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests': { 'variants': [ 'CROS_JACUZZI_RELEASE_LKGM', ], }, - 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests': { + 'gpu_webgl_conformance_gles_passthrough_telemetry_tests': { 'variants': [ 'CROS_JACUZZI_RELEASE_LKGM', ], @@ -6995,12 +6995,12 @@ 'CROS_VOLTEER_PUBLIC_RELEASE_ASH_LKGM', ], }, - 'gpu_webgl_conformance_gles_passthrough_telemetry_tests': { + 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests': { 'variants': [ 'CROS_VOLTEER_PUBLIC_RELEASE_ASH_LKGM', ], }, - 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests': { + 'gpu_webgl_conformance_gles_passthrough_telemetry_tests': { 'variants': [ 'CROS_VOLTEER_PUBLIC_RELEASE_ASH_LKGM', ], @@ -7013,12 +7013,12 @@ 'LACROS_ASH_TOT', ], }, - 'gpu_webgl_conformance_gles_passthrough_telemetry_tests': { + 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests': { 'variants': [ 'LACROS_ASH_TOT', ], }, - 'gpu_webgl2_conformance_gles_passthrough_telemetry_tests': { + 'gpu_webgl_conformance_gles_passthrough_telemetry_tests': { 'variants': [ 'LACROS_ASH_TOT', ], @@ -7031,16 +7031,12 @@ 'SIM_IPHONE_14_16_4', ], }, - 'ios_eg2_tests': { + 'ios_crash_xcuitests': { 'mixins': [ 'xcode_parallelization', - 'record_failed_tests', ], 'variants': [ 'SIM_IPHONE_14_16_4', - 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPAD_10TH_GEN_16_4', - 'SIM_IPAD_PRO_6TH_GEN_16_4', ], }, 'ios_eg2_cq_tests': { @@ -7049,25 +7045,29 @@ 'record_failed_tests', ], 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_10TH_GEN_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', + 'SIM_IPHONE_14_16_4', + ], + }, + 'ios_eg2_tests': { + 'mixins': [ + 'xcode_parallelization', + 'record_failed_tests', + ], + 'variants': [ + 'SIM_IPAD_10TH_GEN_16_4', + 'SIM_IPAD_AIR_5TH_GEN_16_4', + 'SIM_IPAD_PRO_6TH_GEN_16_4', + 'SIM_IPHONE_14_16_4', ], }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_14_16_4', - 'SIM_IPHONE_14_PRO_MAX_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_16_4', - ], - }, - 'ios_crash_xcuitests': { - 'mixins': [ - 'xcode_parallelization', - ], - 'variants': [ 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_PRO_MAX_16_4', ], }, }, @@ -7086,34 +7086,34 @@ 'SIM_IPHONE_14_16_4', ], }, - 'ios_eg2_tests': { - 'mixins': [ - 'xcode_parallelization', - 'record_failed_tests', - ], - 'variants': [ - 'SIM_IPHONE_14_16_4', - 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPAD_PRO_6TH_GEN_16_4', - ], - }, 'ios_eg2_cq_tests': { 'mixins': [ 'xcode_parallelization', 'record_failed_tests', ], 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_16_4', + 'SIM_IPHONE_14_16_4', + ], + }, + 'ios_eg2_tests': { + 'mixins': [ + 'xcode_parallelization', + 'record_failed_tests', + ], + 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_16_4', + 'SIM_IPAD_PRO_6TH_GEN_16_4', + 'SIM_IPHONE_14_16_4', ], }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_14_16_4', - 'SIM_IPHONE_SE_3RD_GEN_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_16_4', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_SE_3RD_GEN_16_4', ], }, }, @@ -7121,35 +7121,8 @@ 'ios17_beta_simulator_tests': { 'ios_common_tests': { 'variants': [ - 'SIM_IPHONE_14_17_2', 'SIM_IPAD_AIR_5TH_GEN_17_2', - ], - }, - 'ios_eg2_tests': { - 'mixins': [ - 'xcode_parallelization', - 'record_failed_tests', - ], - 'variants': [ 'SIM_IPHONE_14_17_2', - 'SIM_IPAD_AIR_5TH_GEN_17_2', - ], - }, - 'ios_eg2_cq_tests': { - 'mixins': [ - 'xcode_parallelization', - 'record_failed_tests', - ], - 'variants': [ - 'SIM_IPHONE_14_17_2', - 'SIM_IPAD_AIR_5TH_GEN_17_2', - ], - }, - 'ios_screen_size_dependent_tests': { - 'variants': [ - 'SIM_IPHONE_14_17_2', - 'SIM_IPHONE_SE_3RD_GEN_17_2', - 'SIM_IPAD_AIR_5TH_GEN_17_2', ], }, 'ios_crash_xcuitests': { @@ -7157,8 +7130,35 @@ 'xcode_parallelization', ], 'variants': [ - 'SIM_IPHONE_14_17_2', 'SIM_IPAD_AIR_5TH_GEN_17_2', + 'SIM_IPHONE_14_17_2', + ], + }, + 'ios_eg2_cq_tests': { + 'mixins': [ + 'xcode_parallelization', + 'record_failed_tests', + ], + 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_17_2', + 'SIM_IPHONE_14_17_2', + ], + }, + 'ios_eg2_tests': { + 'mixins': [ + 'xcode_parallelization', + 'record_failed_tests', + ], + 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_17_2', + 'SIM_IPHONE_14_17_2', + ], + }, + 'ios_screen_size_dependent_tests': { + 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_17_2', + 'SIM_IPHONE_14_17_2', + 'SIM_IPHONE_SE_3RD_GEN_17_2', ], }, }, @@ -7166,17 +7166,8 @@ 'ios17_sdk_simulator_tests': { 'ios_common_tests': { 'variants': [ - 'SIM_IPHONE_14_17_2', 'SIM_IPAD_AIR_5TH_GEN_17_2', - ], - }, - 'ios_eg2_tests': { - 'mixins': [ - 'xcode_parallelization', - ], - 'variants': [ 'SIM_IPHONE_14_17_2', - 'SIM_IPAD_AIR_5TH_GEN_17_2', ], }, 'ios_eg2_cq_tests': { @@ -7188,11 +7179,20 @@ 'SIM_IPHONE_14_17_2', ], }, + 'ios_eg2_tests': { + 'mixins': [ + 'xcode_parallelization', + ], + 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_17_2', + 'SIM_IPHONE_14_17_2', + ], + }, 'ios_screen_size_dependent_tests': { 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_17_2', 'SIM_IPHONE_14_17_2', 'SIM_IPHONE_SE_3RD_GEN_17_2', - 'SIM_IPAD_AIR_5TH_GEN_17_2', ], }, }, @@ -7200,14 +7200,14 @@ 'ios_asan_tests': { 'ios_common_tests': { 'variants': [ - 'SIM_IPHONE_X_15_5', 'SIM_IPAD_AIR_2_15_5', + 'SIM_IPHONE_X_15_5', ], }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_X_15_5', 'SIM_IPAD_AIR_2_15_5', + 'SIM_IPHONE_X_15_5', ], }, }, @@ -7239,10 +7239,10 @@ 'ios_code_coverage_tests': { 'ios_common_tests': { 'variants': [ - 'SIM_IPHONE_14_PLUS_16_4', - 'SIM_IPHONE_14_PLUS_17_0', 'SIM_IPHONE_14_16_4', 'SIM_IPHONE_14_17_0', + 'SIM_IPHONE_14_PLUS_16_4', + 'SIM_IPHONE_14_PLUS_17_0', ], }, 'ios_eg2_cq_tests': { @@ -7250,12 +7250,12 @@ 'xcode_parallelization', ], 'variants': [ - 'SIM_IPHONE_14_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_AIR_5TH_GEN_16_4', 'SIM_IPAD_AIR_5TH_GEN_17_0', 'SIM_IPAD_PRO_6TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, 'ios_eg2_tests': { @@ -7263,18 +7263,18 @@ 'xcode_parallelization', ], 'variants': [ - 'SIM_IPHONE_14_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_PRO_6TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_14_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_PRO_6TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, }, @@ -7286,42 +7286,42 @@ 'SIM_IPHONE_14_17_0', ], }, - 'ios_eg2_tests': { - 'mixins': [ - 'xcode_parallelization', - 'record_failed_tests', - ], - 'variants': [ - 'SIM_IPHONE_14_17_0', - 'SIM_IPAD_AIR_5TH_GEN_17_0', - ], - }, 'ios_eg2_cq_tests': { 'mixins': [ 'xcode_parallelization', 'record_failed_tests', ], 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_10TH_GEN_16_4', - 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPAD_PRO_6TH_GEN_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_10TH_GEN_17_0', + 'SIM_IPAD_AIR_5TH_GEN_16_4', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPAD_PRO_6TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', + ], + }, + 'ios_eg2_tests': { + 'mixins': [ + 'xcode_parallelization', + 'record_failed_tests', + ], + 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_14_17_0', ], }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_14_PRO_MAX_16_4', - 'SIM_IPHONE_14_16_4', - 'SIM_IPHONE_SE_3RD_GEN_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPHONE_14_PRO_MAX_17_0', - 'SIM_IPHONE_14_17_0', - 'SIM_IPHONE_SE_3RD_GEN_17_0', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', + 'SIM_IPHONE_14_PRO_MAX_16_4', + 'SIM_IPHONE_14_PRO_MAX_17_0', + 'SIM_IPHONE_SE_3RD_GEN_16_4', + 'SIM_IPHONE_SE_3RD_GEN_17_0', ], }, }, @@ -7333,28 +7333,28 @@ 'SIM_IPHONE_14_PLUS_17_0', ], }, - 'ios_eg2_tests': { - 'mixins': [ - 'xcode_parallelization', - ], - 'variants': [ - 'SIM_IPHONE_14_16_4', - 'SIM_IPHONE_14_17_0', - 'SIM_IPAD_PRO_6TH_GEN_16_4', - 'SIM_IPAD_PRO_6TH_GEN_17_0', - ], - }, 'ios_eg2_cq_tests': { 'mixins': [ 'xcode_parallelization', ], 'variants': [ + 'SIM_IPAD_AIR_5TH_GEN_16_4', + 'SIM_IPAD_AIR_5TH_GEN_17_0', 'SIM_IPAD_PRO_6TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_17_0', 'SIM_IPHONE_14_16_4', 'SIM_IPHONE_14_17_0', - 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPAD_AIR_5TH_GEN_17_0', + ], + }, + 'ios_eg2_tests': { + 'mixins': [ + 'xcode_parallelization', + ], + 'variants': [ + 'SIM_IPAD_PRO_6TH_GEN_16_4', + 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, 'ios_screen_size_dependent_tests': { @@ -7401,15 +7401,14 @@ }, 'ios_simulator_noncq_tests': { - 'ios_eg2_tests': { + 'ios_crash_xcuitests': { 'mixins': [ 'xcode_parallelization', - 'record_failed_tests', ], 'variants': [ 'SIM_IPHONE_13_15_5', - 'SIM_IPAD_PRO_6TH_GEN_16_4', - 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_SE_3RD_GEN_16_4', + 'SIM_IPHONE_SE_3RD_GEN_17_0', ], }, 'ios_eg2_cq_tests': { @@ -7418,31 +7417,32 @@ 'record_failed_tests', ], 'variants': [ - 'SIM_IPHONE_13_15_5', 'SIM_IPAD_AIR_5TH_GEN_16_4', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_13_15_5', + ], + }, + 'ios_eg2_tests': { + 'mixins': [ + 'xcode_parallelization', + 'record_failed_tests', + ], + 'variants': [ + 'SIM_IPAD_PRO_6TH_GEN_16_4', + 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_13_15_5', ], }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_SE_3RD_GEN_15_5', 'SIM_IPAD_AIR_5TH_GEN_15_5', - 'SIM_IPHONE_14_PLUS_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPHONE_SE_3RD_GEN_16_4', - 'SIM_IPAD_PRO_6TH_GEN_16_4', - 'SIM_IPHONE_14_PLUS_17_0', 'SIM_IPAD_AIR_5TH_GEN_17_0', - 'SIM_IPHONE_SE_3RD_GEN_17_0', + 'SIM_IPAD_PRO_6TH_GEN_16_4', 'SIM_IPAD_PRO_6TH_GEN_17_0', - ], - }, - 'ios_crash_xcuitests': { - 'mixins': [ - 'xcode_parallelization', - ], - 'variants': [ - 'SIM_IPHONE_13_15_5', + 'SIM_IPHONE_14_PLUS_16_4', + 'SIM_IPHONE_14_PLUS_17_0', + 'SIM_IPHONE_SE_3RD_GEN_15_5', 'SIM_IPHONE_SE_3RD_GEN_16_4', 'SIM_IPHONE_SE_3RD_GEN_17_0', ], @@ -7467,10 +7467,10 @@ }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_PRO_6TH_GEN_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_PRO_6TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, }, @@ -7478,10 +7478,10 @@ 'ios_webkit_tot_tests': { 'ios_common_tests': { 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, 'ios_eg2_cq_tests': { @@ -7489,10 +7489,10 @@ 'xcode_parallelization', ], 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, 'ios_eg2_tests': { @@ -7500,18 +7500,18 @@ 'xcode_parallelization', ], 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, 'ios_screen_size_dependent_tests': { 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, }, @@ -7519,10 +7519,10 @@ 'ios_webrtc_fyi_tests': { 'ios_remoting_fyi_unittests': { 'variants': [ - 'SIM_IPHONE_14_16_4', 'SIM_IPAD_AIR_5TH_GEN_16_4', - 'SIM_IPHONE_14_17_0', 'SIM_IPAD_AIR_5TH_GEN_17_0', + 'SIM_IPHONE_14_16_4', + 'SIM_IPHONE_14_17_0', ], }, }, @@ -7530,8 +7530,8 @@ 'lacros_amd64_generic_rel_skylab_fyi': { 'lacros_skylab_tests': { 'variants': [ - 'CROS_OCTOPUS_PUBLIC_LKGM', 'CROS_EVE_PUBLIC_LKGM', + 'CROS_OCTOPUS_PUBLIC_LKGM', ], }, }, @@ -7547,8 +7547,8 @@ 'lacros_arm64_generic_rel_skylab_fyi': { 'lacros_skylab_tests': { 'variants': [ - 'CROS_JACUZZI_PUBLIC_LKGM', 'CROS_JACUZZI_CQ_PUBLIC_LKGM', + 'CROS_JACUZZI_PUBLIC_LKGM', 'CROS_TROGDOR_PUBLIC_LKGM', ], }, @@ -7631,8 +7631,8 @@ 'lacros_skylab_arm': { 'lacros_skylab_tests_version_skew': { 'variants': [ - 'CROS_JACUZZI_RELEASE_DEV', 'CROS_JACUZZI_RELEASE_BETA', + 'CROS_JACUZZI_RELEASE_DEV', 'CROS_JACUZZI_RELEASE_STABLE', ], }, @@ -7649,38 +7649,19 @@ 'lacros_skylab_arm_fyi': { 'lacros_skylab_arm_tests_fyi': { 'variants': [ - 'CROS_HANA_RELEASE_LKGM', - 'CROS_HANA_RELEASE_DEV', 'CROS_HANA_RELEASE_BETA', + 'CROS_HANA_RELEASE_DEV', + 'CROS_HANA_RELEASE_LKGM', 'CROS_HANA_RELEASE_STABLE', - 'CROS_STRONGBAD_RELEASE_LKGM', - 'CROS_STRONGBAD_RELEASE_DEV', 'CROS_STRONGBAD_RELEASE_BETA', + 'CROS_STRONGBAD_RELEASE_DEV', + 'CROS_STRONGBAD_RELEASE_LKGM', 'CROS_STRONGBAD_RELEASE_STABLE', ], }, }, 'lacros_skylab_tests_amd64_generic': { - 'lacros_skylab_tests_version_skew': { - 'variants': [ - 'CROS_BRYA_RELEASE_DEV', - 'CROS_BRYA_RELEASE_BETA', - 'CROS_BRYA_RELEASE_STABLE', - 'CROS_DEDEDE_RELEASE_DEV', - 'CROS_DEDEDE_RELEASE_BETA', - 'CROS_DEDEDE_RELEASE_STABLE', - 'CROS_FIZZ_RELEASE_DEV', - 'CROS_FIZZ_RELEASE_BETA', - 'CROS_FIZZ_RELEASE_STABLE', - 'CROS_GUYBRUSH_RELEASE_DEV', - 'CROS_GUYBRUSH_RELEASE_BETA', - 'CROS_GUYBRUSH_RELEASE_STABLE', - 'CROS_PUFF_RELEASE_DEV', - 'CROS_PUFF_RELEASE_BETA', - 'CROS_PUFF_RELEASE_STABLE', - ], - }, 'lacros_skylab_tests': { 'variants': [ 'CROS_BRYA_RELEASE_LKGM', @@ -7690,6 +7671,25 @@ 'CROS_PUFF_RELEASE_LKGM', ], }, + 'lacros_skylab_tests_version_skew': { + 'variants': [ + 'CROS_BRYA_RELEASE_BETA', + 'CROS_BRYA_RELEASE_DEV', + 'CROS_BRYA_RELEASE_STABLE', + 'CROS_DEDEDE_RELEASE_BETA', + 'CROS_DEDEDE_RELEASE_DEV', + 'CROS_DEDEDE_RELEASE_STABLE', + 'CROS_FIZZ_RELEASE_BETA', + 'CROS_FIZZ_RELEASE_DEV', + 'CROS_FIZZ_RELEASE_STABLE', + 'CROS_GUYBRUSH_RELEASE_BETA', + 'CROS_GUYBRUSH_RELEASE_DEV', + 'CROS_GUYBRUSH_RELEASE_STABLE', + 'CROS_PUFF_RELEASE_BETA', + 'CROS_PUFF_RELEASE_DEV', + 'CROS_PUFF_RELEASE_STABLE', + ], + }, 'lacros_skylab_tests_with_gtests': { 'variants': [ 'CROS_BRYA_RELEASE_LKGM', @@ -7704,21 +7704,21 @@ 'lacros_skylab_tests_amd64_generic_fyi': { 'lacros_skylab_amd64_fyi': { 'variants': [ - 'CROS_OCTOPUS_RELEASE_LKGM', - 'CROS_OCTOPUS_RELEASE_DEV', 'CROS_OCTOPUS_RELEASE_BETA', + 'CROS_OCTOPUS_RELEASE_DEV', + 'CROS_OCTOPUS_RELEASE_LKGM', 'CROS_OCTOPUS_RELEASE_STABLE', ], }, }, 'lacros_skylab_tests_amd64_generic_rel': { - 'lacros_skylab_tests': { + 'chromeos_integration_tests': { 'variants': [ 'CROS_VOLTEER_PUBLIC_LKGM', ], }, - 'chromeos_integration_tests': { + 'lacros_skylab_tests': { 'variants': [ 'CROS_VOLTEER_PUBLIC_LKGM', ], @@ -7733,33 +7733,33 @@ 'chromium_gtests_for_win_and_linux_only': {}, 'linux_chromeos_lacros_gtests': {}, 'linux_flavor_specific_chromium_gtests': {}, - 'linux_lacros_specific_gtests': {}, - 'non_android_chromium_gtests': {}, 'linux_lacros_chrome_browsertests_non_version_skew': {}, 'linux_lacros_chrome_browsertests_version_skew': { 'variants': [ + 'LACROS_VERSION_SKEW_BETA', 'LACROS_VERSION_SKEW_CANARY', 'LACROS_VERSION_SKEW_DEV', - 'LACROS_VERSION_SKEW_BETA', 'LACROS_VERSION_SKEW_STABLE', ], }, 'linux_lacros_chrome_interactive_ui_tests_version_skew': { 'variants': [ + 'LACROS_VERSION_SKEW_BETA', 'LACROS_VERSION_SKEW_CANARY', 'LACROS_VERSION_SKEW_DEV', - 'LACROS_VERSION_SKEW_BETA', 'LACROS_VERSION_SKEW_STABLE', ], }, + 'linux_lacros_specific_gtests': {}, + 'non_android_chromium_gtests': {}, }, 'linux_lacros_version_skew_tests': { 'linux_lacros_chrome_interactive_ui_tests_version_skew': { 'variants': [ + 'LACROS_VERSION_SKEW_BETA', 'LACROS_VERSION_SKEW_CANARY', 'LACROS_VERSION_SKEW_DEV', - 'LACROS_VERSION_SKEW_BETA', 'LACROS_VERSION_SKEW_STABLE', ], }, @@ -7815,6 +7815,12 @@ 'MAC_RETINA_NVIDIA_GPU_STABLE', ], }, + 'gpu_gl_passthrough_ganesh_telemetry_tests': { + 'variants': [ + 'MAC_MINI_INTEL_GPU_STABLE', + 'MAC_RETINA_AMD_GPU_STABLE', + ], + }, 'gpu_mediapipe_passthrough_telemetry_tests': { 'variants': [ 'MAC_MINI_INTEL_GPU_STABLE', @@ -7822,12 +7828,6 @@ 'MAC_RETINA_NVIDIA_GPU_STABLE', ], }, - 'gpu_gl_passthrough_ganesh_telemetry_tests': { - 'variants': [ - 'MAC_MINI_INTEL_GPU_STABLE', - 'MAC_RETINA_AMD_GPU_STABLE', - ], - }, 'gpu_metal_passthrough_graphite_telemetry_tests': { 'variants': [ 'MAC_MINI_INTEL_GPU_STABLE',
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index bbf30ba..9afeeb0 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -5,6 +5,379 @@ # 3. Run //infra/config/scripts/sync-pyl-files.py { + 'CROS_BRYA_RELEASE_ASH_LKGM': { + 'identifier': 'BRYA_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'brya', + 'use_lkgm': True, + 'dut_pool': 'chrome', + }, + }, + 'CROS_BRYA_RELEASE_BETA': { + 'identifier': 'BRYA_RELEASE_BETA', + 'skylab': { + 'cros_board': 'brya', + 'cros_img': 'brya-release/R120-15662.16.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_BRYA_RELEASE_DEV': { + 'identifier': 'BRYA_RELEASE_DEV', + 'skylab': { + 'cros_board': 'brya', + 'cros_img': 'brya-release/R121-15678.0.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_BRYA_RELEASE_LKGM': { + 'identifier': 'BRYA_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'brya', + 'use_lkgm': True, + 'dut_pool': 'chrome', + }, + }, + 'CROS_BRYA_RELEASE_STABLE': { + 'identifier': 'BRYA_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'brya', + 'cros_img': 'brya-release/R119-15633.44.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_DEDEDE_RELEASE_BETA': { + 'identifier': 'DEDEDE_RELEASE_BETA', + 'skylab': { + 'cros_board': 'dedede', + 'cros_img': 'dedede-release/R120-15662.16.0', + }, + }, + 'CROS_DEDEDE_RELEASE_DEV': { + 'identifier': 'DEDEDE_RELEASE_DEV', + 'skylab': { + 'cros_board': 'dedede', + 'cros_img': 'dedede-release/R121-15678.0.0', + }, + }, + 'CROS_DEDEDE_RELEASE_LKGM': { + 'identifier': 'DEDEDE_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'dedede', + 'use_lkgm': True, + }, + }, + 'CROS_DEDEDE_RELEASE_STABLE': { + 'identifier': 'DEDEDE_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'dedede', + 'cros_img': 'dedede-release/R119-15633.44.0', + }, + }, + 'CROS_EVE_PUBLIC_LKGM': { + 'identifier': 'EVE_PUBLIC_LKGM', + 'skylab': { + 'cros_board': 'eve', + 'cros_img': 'eve-public/R121-15684.0.0', + 'bucket': 'chromiumos-image-archive', + 'dut_pool': 'chromium', + 'public_builder': 'cros_test_platform_public', + 'public_builder_bucket': 'testplatform-public', + }, + }, + 'CROS_FIZZ_RELEASE_BETA': { + 'identifier': 'FIZZ_RELEASE_BETA', + 'skylab': { + 'cros_board': 'fizz', + 'cros_img': 'fizz-release/R120-15662.16.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_FIZZ_RELEASE_DEV': { + 'identifier': 'FIZZ_RELEASE_DEV', + 'skylab': { + 'cros_board': 'fizz', + 'cros_img': 'fizz-release/R121-15678.0.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_FIZZ_RELEASE_LKGM': { + 'identifier': 'FIZZ_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'fizz', + 'use_lkgm': True, + 'dut_pool': 'chrome', + }, + }, + 'CROS_FIZZ_RELEASE_STABLE': { + 'identifier': 'FIZZ_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'fizz', + 'cros_img': 'fizz-release/R119-15633.44.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_GUYBRUSH_RELEASE_BETA': { + 'identifier': 'GUYBRUSH_RELEASE_BETA', + 'skylab': { + 'cros_board': 'guybrush', + 'cros_img': 'guybrush-release/R120-15662.16.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_GUYBRUSH_RELEASE_DEV': { + 'identifier': 'GUYBRUSH_RELEASE_DEV', + 'skylab': { + 'cros_board': 'guybrush', + 'cros_img': 'guybrush-release/R121-15678.0.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_GUYBRUSH_RELEASE_LKGM': { + 'identifier': 'GUYBRUSH_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'guybrush', + 'use_lkgm': True, + 'dut_pool': 'chrome', + }, + }, + 'CROS_GUYBRUSH_RELEASE_STABLE': { + 'identifier': 'GUYBRUSH_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'guybrush', + 'cros_img': 'guybrush-release/R119-15633.44.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_HANA_RELEASE_BETA': { + 'identifier': 'HANA_RELEASE_BETA', + 'skylab': { + 'cros_board': 'hana', + 'cros_img': 'hana-release/R120-15662.16.0', + }, + }, + 'CROS_HANA_RELEASE_DEV': { + 'identifier': 'HANA_RELEASE_DEV', + 'skylab': { + 'cros_board': 'hana', + 'cros_img': 'hana-release/R121-15678.0.0', + }, + }, + 'CROS_HANA_RELEASE_LKGM': { + 'identifier': 'HANA_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'hana', + 'use_lkgm': True, + }, + }, + 'CROS_HANA_RELEASE_STABLE': { + 'identifier': 'HANA_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'hana', + 'cros_img': 'hana-release/R119-15633.44.0', + }, + }, + 'CROS_JACUZZI_CQ_PUBLIC_LKGM': { + 'identifier': 'JACUZZI_CQ_PUBLIC_LKGM', + 'skylab': { + 'cros_board': 'jacuzzi', + 'cros_img': 'jacuzzi-public/R121-15673.0.0', + 'bucket': 'chromiumos-image-archive', + 'public_builder': 'cros_test_platform_public', + 'public_builder_bucket': 'testplatform-public', + }, + }, + 'CROS_JACUZZI_PUBLIC_LKGM': { + 'identifier': 'JACUZZI_PUBLIC_LKGM', + 'skylab': { + 'cros_board': 'jacuzzi', + 'cros_img': 'jacuzzi-public/R121-15673.0.0', + 'bucket': 'chromiumos-image-archive', + }, + }, + 'CROS_JACUZZI_RELEASE_BETA': { + 'identifier': 'JACUZZI_RELEASE_BETA', + 'skylab': { + 'cros_board': 'jacuzzi', + 'cros_img': 'jacuzzi-release/R120-15662.16.0', + }, + }, + 'CROS_JACUZZI_RELEASE_CHROME_FROM_TLS_ASH_LKGM': { + 'identifier': 'JACUZZI_RELEASE_CHROME_FROM_TLS_LKGM', + 'skylab': { + 'cros_board': 'jacuzzi', + 'use_lkgm': True, + }, + }, + 'CROS_JACUZZI_RELEASE_DEV': { + 'identifier': 'JACUZZI_RELEASE_DEV', + 'skylab': { + 'cros_board': 'jacuzzi', + 'cros_img': 'jacuzzi-release/R121-15678.0.0', + }, + }, + 'CROS_JACUZZI_RELEASE_LKGM': { + 'identifier': 'JACUZZI_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'jacuzzi', + 'use_lkgm': True, + }, + }, + 'CROS_JACUZZI_RELEASE_STABLE': { + 'identifier': 'JACUZZI_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'jacuzzi', + 'cros_img': 'jacuzzi-release/R119-15633.44.0', + }, + }, + 'CROS_OCTOPUS_PUBLIC_LKGM': { + 'identifier': 'OCTOPUS_PUBLIC_LKGM', + 'skylab': { + 'cros_board': 'octopus', + 'cros_img': 'octopus-public/R121-15684.0.0', + 'bucket': 'chromiumos-image-archive', + }, + }, + 'CROS_OCTOPUS_RELEASE_BETA': { + 'identifier': 'OCTOPUS_RELEASE_BETA', + 'skylab': { + 'cros_board': 'octopus', + 'cros_img': 'octopus-release/R120-15662.16.0', + }, + }, + 'CROS_OCTOPUS_RELEASE_CHROME_FROM_TLS_ASH_LKGM': { + 'identifier': 'OCTOPUS_RELEASE_CHROME_FROM_TLS_LKGM', + 'skylab': { + 'cros_board': 'octopus', + 'use_lkgm': True, + }, + }, + 'CROS_OCTOPUS_RELEASE_DEV': { + 'identifier': 'OCTOPUS_RELEASE_DEV', + 'skylab': { + 'cros_board': 'octopus', + 'cros_img': 'octopus-release/R121-15678.0.0', + }, + }, + 'CROS_OCTOPUS_RELEASE_LKGM': { + 'identifier': 'OCTOPUS_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'octopus', + 'use_lkgm': True, + }, + }, + 'CROS_OCTOPUS_RELEASE_STABLE': { + 'identifier': 'OCTOPUS_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'octopus', + 'cros_img': 'octopus-release/R119-15633.44.0', + }, + }, + 'CROS_PUFF_RELEASE_BETA': { + 'identifier': 'PUFF_RELEASE_BETA', + 'skylab': { + 'cros_board': 'puff', + 'cros_img': 'puff-release/R120-15662.16.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_PUFF_RELEASE_DEV': { + 'identifier': 'PUFF_RELEASE_DEV', + 'skylab': { + 'cros_board': 'puff', + 'cros_img': 'puff-release/R121-15678.0.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_PUFF_RELEASE_LKGM': { + 'identifier': 'PUFF_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'puff', + 'use_lkgm': True, + 'dut_pool': 'chrome', + }, + }, + 'CROS_PUFF_RELEASE_STABLE': { + 'identifier': 'PUFF_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'puff', + 'cros_img': 'puff-release/R118-15604.57.0', + 'dut_pool': 'chrome', + }, + }, + 'CROS_STRONGBAD_RELEASE_BETA': { + 'identifier': 'STRONGBAD_RELEASE_BETA', + 'skylab': { + 'cros_board': 'strongbad', + 'cros_img': 'strongbad-release/R120-15662.16.0', + }, + }, + 'CROS_STRONGBAD_RELEASE_DEV': { + 'identifier': 'strongbad_RELEASE_DEV', + 'skylab': { + 'cros_board': 'strongbad', + 'cros_img': 'strongbad-release/R121-15678.0.0', + }, + }, + 'CROS_STRONGBAD_RELEASE_LKGM': { + 'identifier': 'STRONGBAD_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'strongbad', + 'use_lkgm': True, + }, + }, + 'CROS_STRONGBAD_RELEASE_STABLE': { + 'identifier': 'STRONGBAD_RELEASE_STABLE', + 'skylab': { + 'cros_board': 'strongbad', + 'cros_img': 'strongbad-release/R119-15633.44.0', + }, + }, + 'CROS_TROGDOR_PUBLIC_LKGM': { + 'identifier': 'TROGDOR_PUBLIC_LKGM', + 'skylab': { + 'cros_board': 'trogdor', + 'cros_img': 'trogdor-public/R121-15684.0.0', + 'bucket': 'chromiumos-image-archive', + }, + }, + 'CROS_TROGDOR_RELEASE_ASH_LKGM': { + 'identifier': 'TROGDOR_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'trogdor', + 'use_lkgm': True, + }, + }, + 'CROS_VOLTEER_PUBLIC_LKGM': { + 'identifier': 'VOLTEER_PUBLIC_LKGM', + 'skylab': { + 'cros_board': 'volteer', + 'cros_model': 'voxel', + 'cros_img': 'volteer-public/R121-15684.0.0', + 'bucket': 'chromiumos-image-archive', + 'dut_pool': 'chromium', + 'public_builder': 'cros_test_platform_public', + 'public_builder_bucket': 'testplatform-public', + }, + }, + 'CROS_VOLTEER_PUBLIC_RELEASE_ASH_LKGM': { + 'identifier': 'VOLTEER_PUBLIC_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'volteer', + 'cros_model': 'voxel', + 'use_lkgm': True, + 'bucket': 'chromiumos-image-archive', + 'dut_pool': 'chromium', + 'public_builder': 'cros_test_platform_public', + 'public_builder_bucket': 'testplatform-public', + }, + }, + 'CROS_VOLTEER_RELEASE_ASH_LKGM': { + 'identifier': 'VOLTEER_RELEASE_LKGM', + 'skylab': { + 'cros_board': 'volteer', + 'use_lkgm': True, + }, + }, 'DISABLE_FIELD_TRIAL_CONFIG': { 'identifier': 'Disable Field Trial Config', 'args': [ @@ -19,46 +392,6 @@ '--webview-command-line-arg=--webview-verbose-logging', ], }, - 'SINGLE_GROUP_PER_STUDY_PREFER_EXISTING_BEHAVIOR': { - 'identifier': 'Single Group Per Study Prefer Existing Behavior Field Trial Config', - 'args': [ - '--variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_existing_behavior/seed.json', - '--accept-empty-variations-seed-signature', - '--webview-verbose-logging', - '--disable-field-trial-config', - '--fake-variations-channel=stable', - ], - }, - 'SINGLE_GROUP_PER_STUDY_PREFER_NEW_BEHAVIOR': { - 'identifier': 'Single Group Per Study Prefer New Behavior Field Trial Config', - 'args': [ - '--variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_new_behavior/seed.json', - '--accept-empty-variations-seed-signature', - '--webview-verbose-logging', - '--disable-field-trial-config', - '--fake-variations-channel=stable', - ], - }, - 'SINGLE_GROUP_PER_STUDY_PREFER_EXISTING_BEHAVIOR_WEBVIEW_COMMANDLINE': { - 'identifier': 'Single Group Per Study Prefer Existing Behavior Field Trial Config', - 'args': [ - '--webview-variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_existing_behavior/seed.json', - '--webview-command-line-arg=--accept-empty-variations-seed-signature', - '--webview-command-line-arg=--webview-verbose-logging', - '--webview-command-line-arg=--disable-field-trial-config', - '--webview-command-line-arg=--fake-variations-channel=stable', - ], - }, - 'SINGLE_GROUP_PER_STUDY_PREFER_NEW_BEHAVIOR_WEBVIEW_COMMANDLINE': { - 'identifier': 'Single Group Per Study Prefer New Behavior Field Trial Config', - 'args': [ - '--webview-variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_new_behavior/seed.json', - '--webview-command-line-arg=--accept-empty-variations-seed-signature', - '--webview-command-line-arg=--webview-verbose-logging', - '--webview-command-line-arg=--disable-field-trial-config', - '--webview-command-line-arg=--fake-variations-channel=stable', - ], - }, 'IPHONE_7_15_4_1': { 'identifier': 'iPhone 7 15.4.1', 'swarming': { @@ -68,18 +401,68 @@ }, }, }, - 'LACROS_VERSION_SKEW_CANARY': { - 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 121.0.6156.0', + 'LACROS_AMD64_GENERIC': { + 'identifier': 'amd64-generic', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6156.0/test_ash_chrome', + '--board=amd64-generic', + '--use-vm', + ], + 'swarming': { + 'dimensions': { + 'cpu': 'x86-64', + 'kvm': '1', + 'os': 'Ubuntu-22.04', + }, + }, + }, + 'LACROS_ASH_TOT': { + 'identifier': 'Ash ToT', + 'args': [ + '--deploy-lacros', + ], + }, + 'LACROS_EVE': { + 'identifier': 'eve', + 'args': [ + '--board=eve', + '--flash', + ], + 'ci_only': True, + 'swarming': { + 'dimensions': { + 'os': 'ChromeOS', + 'device_type': 'eve', + }, + }, + }, + 'LACROS_VERSION_SKEW_BETA': { + 'identifier': 'Lacros version skew testing ash beta', + 'description': 'Run with ash-chrome version 120.0.6099.25', + 'args': [ + '--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6099.25/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v121.0.6156.0', - 'revision': 'version:121.0.6156.0', + 'location': 'lacros_version_skew_tests_v120.0.6099.25', + 'revision': 'version:120.0.6099.25', + }, + ], + }, + }, + 'LACROS_VERSION_SKEW_CANARY': { + 'identifier': 'Lacros version skew testing ash canary', + 'description': 'Run with ash-chrome version 121.0.6157.0', + 'args': [ + '--ash-chrome-path-override=../../lacros_version_skew_tests_v121.0.6157.0/test_ash_chrome', + ], + 'swarming': { + 'cipd_packages': [ + { + 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', + 'location': 'lacros_version_skew_tests_v121.0.6157.0', + 'revision': 'version:121.0.6157.0', }, ], }, @@ -100,22 +483,6 @@ ], }, }, - 'LACROS_VERSION_SKEW_BETA': { - 'identifier': 'Lacros version skew testing ash beta', - 'description': 'Run with ash-chrome version 120.0.6099.25', - 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6099.25/test_ash_chrome', - ], - 'swarming': { - 'cipd_packages': [ - { - 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v120.0.6099.25', - 'revision': 'version:120.0.6099.25', - }, - ], - }, - }, 'LACROS_VERSION_SKEW_STABLE': { 'identifier': 'Lacros version skew testing ash stable', 'description': 'Run with ash-chrome version 119.0.6045.192', @@ -162,6 +529,54 @@ 'mac_retina_nvidia_gpu_stable', ], }, + 'MODEL_VALIDATION_BASE': { + 'identifier': 'MODEL_VALIDATION_BASE', + }, + 'MODEL_VALIDATION_TRUNK': { + 'identifier': 'MODEL_VALIDATION_TRUNK', + 'linux_args': [ + '--chromedriver', + 'chromedriver', + '--binary', + 'chrome', + ], + 'mac_args': [ + '--chromedriver', + 'chromedriver', + '--binary', + 'Chromium.app/Contents/MacOS/Chromium', + ], + 'win_args': [ + '--chromedriver', + 'chromedriver.exe', + '--binary', + 'Chrome.exe', + ], + }, + 'SIM_IPAD_10TH_GEN_16_4': { + 'identifier': 'iPad (10th generation) 16.4', + 'args': [ + '--platform', + 'iPad (10th generation)', + '--version', + '16.4', + ], + 'mixins': [ + 'ios_runtime_cache_16_4', + ], + }, + 'SIM_IPAD_10TH_GEN_17_0': { + 'identifier': 'iPad (10th generation) 17.0', + 'args': [ + '--platform', + 'iPad (10th generation)', + '--version', + '17.0', + ], + 'mixins': [ + 'ios_runtime_cache_17_0', + ], + }, 'SIM_IPAD_AIR_2_15_5': { 'identifier': 'iPad Air 2 15.5', 'args': [ @@ -246,42 +661,6 @@ 'ios_runtime_cache_17_0', ], }, - 'SIM_IPAD_10TH_GEN_16_4': { - 'identifier': 'iPad (10th generation) 16.4', - 'args': [ - '--platform', - 'iPad (10th generation)', - '--version', - '16.4', - ], - 'mixins': [ - 'ios_runtime_cache_16_4', - ], - }, - 'SIM_IPAD_10TH_GEN_17_0': { - 'identifier': 'iPad (10th generation) 17.0', - 'args': [ - '--platform', - 'iPad (10th generation)', - '--version', - '17.0', - ], - 'mixins': [ - 'ios_runtime_cache_17_0', - ], - }, - 'SIM_IPHONE_6S_15_5': { - 'identifier': 'iPhone 6s 15.5', - 'args': [ - '--platform', - 'iPhone 6s', - '--version', - '15.5', - ], - 'mixins': [ - 'ios_runtime_cache_15_5', - ], - }, 'SIM_IPHONE_13_15_5': { 'identifier': 'iPhone 13 15.5', 'args': [ @@ -378,6 +757,18 @@ 'ios_runtime_cache_17_0', ], }, + 'SIM_IPHONE_6S_15_5': { + 'identifier': 'iPhone 6s 15.5', + 'args': [ + '--platform', + 'iPhone 6s', + '--version', + '15.5', + ], + 'mixins': [ + 'ios_runtime_cache_15_5', + ], + }, 'SIM_IPHONE_SE_3RD_GEN_15_5': { 'identifier': 'iPhone SE (3rd generation) 15.5', 'args': [ @@ -438,6 +829,46 @@ 'ios_runtime_cache_15_5', ], }, + 'SINGLE_GROUP_PER_STUDY_PREFER_EXISTING_BEHAVIOR': { + 'identifier': 'Single Group Per Study Prefer Existing Behavior Field Trial Config', + 'args': [ + '--variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_existing_behavior/seed.json', + '--accept-empty-variations-seed-signature', + '--webview-verbose-logging', + '--disable-field-trial-config', + '--fake-variations-channel=stable', + ], + }, + 'SINGLE_GROUP_PER_STUDY_PREFER_EXISTING_BEHAVIOR_WEBVIEW_COMMANDLINE': { + 'identifier': 'Single Group Per Study Prefer Existing Behavior Field Trial Config', + 'args': [ + '--webview-variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_existing_behavior/seed.json', + '--webview-command-line-arg=--accept-empty-variations-seed-signature', + '--webview-command-line-arg=--webview-verbose-logging', + '--webview-command-line-arg=--disable-field-trial-config', + '--webview-command-line-arg=--fake-variations-channel=stable', + ], + }, + 'SINGLE_GROUP_PER_STUDY_PREFER_NEW_BEHAVIOR': { + 'identifier': 'Single Group Per Study Prefer New Behavior Field Trial Config', + 'args': [ + '--variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_new_behavior/seed.json', + '--accept-empty-variations-seed-signature', + '--webview-verbose-logging', + '--disable-field-trial-config', + '--fake-variations-channel=stable', + ], + }, + 'SINGLE_GROUP_PER_STUDY_PREFER_NEW_BEHAVIOR_WEBVIEW_COMMANDLINE': { + 'identifier': 'Single Group Per Study Prefer New Behavior Field Trial Config', + 'args': [ + '--webview-variations-test-seed-path=../../third_party/chromium-variations/single_group_per_study_prefer_new_behavior/seed.json', + '--webview-command-line-arg=--accept-empty-variations-seed-signature', + '--webview-command-line-arg=--webview-verbose-logging', + '--webview-command-line-arg=--disable-field-trial-config', + '--webview-command-line-arg=--fake-variations-channel=stable', + ], + }, 'WEBVIEW_TRICHROME_FULL_CTS_TESTS': { 'identifier': 'full_mode', 'swarming': { @@ -452,413 +883,6 @@ '--test-apk-as-instant', ], }, - 'CROS_BRYA_RELEASE_ASH_LKGM': { - 'identifier': 'BRYA_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'brya', - 'use_lkgm': True, - 'dut_pool': 'chrome', - }, - }, - 'CROS_BRYA_RELEASE_LKGM': { - 'identifier': 'BRYA_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'brya', - 'use_lkgm': True, - 'dut_pool': 'chrome', - }, - }, - 'CROS_BRYA_RELEASE_DEV': { - 'identifier': 'BRYA_RELEASE_DEV', - 'skylab': { - 'cros_board': 'brya', - 'cros_img': 'brya-release/R121-15678.0.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_BRYA_RELEASE_BETA': { - 'identifier': 'BRYA_RELEASE_BETA', - 'skylab': { - 'cros_board': 'brya', - 'cros_img': 'brya-release/R120-15662.16.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_BRYA_RELEASE_STABLE': { - 'identifier': 'BRYA_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'brya', - 'cros_img': 'brya-release/R119-15633.44.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_DEDEDE_RELEASE_LKGM': { - 'identifier': 'DEDEDE_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'dedede', - 'use_lkgm': True, - }, - }, - 'CROS_DEDEDE_RELEASE_DEV': { - 'identifier': 'DEDEDE_RELEASE_DEV', - 'skylab': { - 'cros_board': 'dedede', - 'cros_img': 'dedede-release/R121-15678.0.0', - }, - }, - 'CROS_DEDEDE_RELEASE_BETA': { - 'identifier': 'DEDEDE_RELEASE_BETA', - 'skylab': { - 'cros_board': 'dedede', - 'cros_img': 'dedede-release/R120-15662.16.0', - }, - }, - 'CROS_DEDEDE_RELEASE_STABLE': { - 'identifier': 'DEDEDE_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'dedede', - 'cros_img': 'dedede-release/R119-15633.44.0', - }, - }, - 'CROS_FIZZ_RELEASE_LKGM': { - 'identifier': 'FIZZ_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'fizz', - 'use_lkgm': True, - 'dut_pool': 'chrome', - }, - }, - 'CROS_FIZZ_RELEASE_DEV': { - 'identifier': 'FIZZ_RELEASE_DEV', - 'skylab': { - 'cros_board': 'fizz', - 'cros_img': 'fizz-release/R121-15678.0.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_FIZZ_RELEASE_BETA': { - 'identifier': 'FIZZ_RELEASE_BETA', - 'skylab': { - 'cros_board': 'fizz', - 'cros_img': 'fizz-release/R120-15662.16.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_FIZZ_RELEASE_STABLE': { - 'identifier': 'FIZZ_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'fizz', - 'cros_img': 'fizz-release/R119-15633.44.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_GUYBRUSH_RELEASE_LKGM': { - 'identifier': 'GUYBRUSH_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'guybrush', - 'use_lkgm': True, - 'dut_pool': 'chrome', - }, - }, - 'CROS_GUYBRUSH_RELEASE_DEV': { - 'identifier': 'GUYBRUSH_RELEASE_DEV', - 'skylab': { - 'cros_board': 'guybrush', - 'cros_img': 'guybrush-release/R121-15678.0.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_GUYBRUSH_RELEASE_BETA': { - 'identifier': 'GUYBRUSH_RELEASE_BETA', - 'skylab': { - 'cros_board': 'guybrush', - 'cros_img': 'guybrush-release/R120-15662.16.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_GUYBRUSH_RELEASE_STABLE': { - 'identifier': 'GUYBRUSH_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'guybrush', - 'cros_img': 'guybrush-release/R119-15633.44.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_PUFF_RELEASE_LKGM': { - 'identifier': 'PUFF_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'puff', - 'use_lkgm': True, - 'dut_pool': 'chrome', - }, - }, - 'CROS_PUFF_RELEASE_DEV': { - 'identifier': 'PUFF_RELEASE_DEV', - 'skylab': { - 'cros_board': 'puff', - 'cros_img': 'puff-release/R121-15678.0.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_PUFF_RELEASE_BETA': { - 'identifier': 'PUFF_RELEASE_BETA', - 'skylab': { - 'cros_board': 'puff', - 'cros_img': 'puff-release/R120-15662.16.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_PUFF_RELEASE_STABLE': { - 'identifier': 'PUFF_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'puff', - 'cros_img': 'puff-release/R118-15604.57.0', - 'dut_pool': 'chrome', - }, - }, - 'CROS_EVE_PUBLIC_LKGM': { - 'identifier': 'EVE_PUBLIC_LKGM', - 'skylab': { - 'cros_board': 'eve', - 'cros_img': 'eve-public/R121-15684.0.0', - 'bucket': 'chromiumos-image-archive', - 'dut_pool': 'chromium', - 'public_builder': 'cros_test_platform_public', - 'public_builder_bucket': 'testplatform-public', - }, - }, - 'CROS_HANA_RELEASE_LKGM': { - 'identifier': 'HANA_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'hana', - 'use_lkgm': True, - }, - }, - 'CROS_HANA_RELEASE_DEV': { - 'identifier': 'HANA_RELEASE_DEV', - 'skylab': { - 'cros_board': 'hana', - 'cros_img': 'hana-release/R121-15678.0.0', - }, - }, - 'CROS_HANA_RELEASE_BETA': { - 'identifier': 'HANA_RELEASE_BETA', - 'skylab': { - 'cros_board': 'hana', - 'cros_img': 'hana-release/R120-15662.16.0', - }, - }, - 'CROS_HANA_RELEASE_STABLE': { - 'identifier': 'HANA_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'hana', - 'cros_img': 'hana-release/R119-15633.44.0', - }, - }, - 'CROS_JACUZZI_RELEASE_LKGM': { - 'identifier': 'JACUZZI_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'jacuzzi', - 'use_lkgm': True, - }, - }, - 'CROS_JACUZZI_RELEASE_DEV': { - 'identifier': 'JACUZZI_RELEASE_DEV', - 'skylab': { - 'cros_board': 'jacuzzi', - 'cros_img': 'jacuzzi-release/R121-15678.0.0', - }, - }, - 'CROS_JACUZZI_RELEASE_BETA': { - 'identifier': 'JACUZZI_RELEASE_BETA', - 'skylab': { - 'cros_board': 'jacuzzi', - 'cros_img': 'jacuzzi-release/R120-15662.16.0', - }, - }, - 'CROS_JACUZZI_RELEASE_CHROME_FROM_TLS_ASH_LKGM': { - 'identifier': 'JACUZZI_RELEASE_CHROME_FROM_TLS_LKGM', - 'skylab': { - 'cros_board': 'jacuzzi', - 'use_lkgm': True, - }, - }, - 'CROS_JACUZZI_RELEASE_STABLE': { - 'identifier': 'JACUZZI_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'jacuzzi', - 'cros_img': 'jacuzzi-release/R119-15633.44.0', - }, - }, - 'CROS_JACUZZI_PUBLIC_LKGM': { - 'identifier': 'JACUZZI_PUBLIC_LKGM', - 'skylab': { - 'cros_board': 'jacuzzi', - 'cros_img': 'jacuzzi-public/R121-15673.0.0', - 'bucket': 'chromiumos-image-archive', - }, - }, - 'CROS_JACUZZI_CQ_PUBLIC_LKGM': { - 'identifier': 'JACUZZI_CQ_PUBLIC_LKGM', - 'skylab': { - 'cros_board': 'jacuzzi', - 'cros_img': 'jacuzzi-public/R121-15673.0.0', - 'bucket': 'chromiumos-image-archive', - 'public_builder': 'cros_test_platform_public', - 'public_builder_bucket': 'testplatform-public', - }, - }, - 'CROS_TROGDOR_PUBLIC_LKGM': { - 'identifier': 'TROGDOR_PUBLIC_LKGM', - 'skylab': { - 'cros_board': 'trogdor', - 'cros_img': 'trogdor-public/R121-15684.0.0', - 'bucket': 'chromiumos-image-archive', - }, - }, - 'CROS_OCTOPUS_PUBLIC_LKGM': { - 'identifier': 'OCTOPUS_PUBLIC_LKGM', - 'skylab': { - 'cros_board': 'octopus', - 'cros_img': 'octopus-public/R121-15684.0.0', - 'bucket': 'chromiumos-image-archive', - }, - }, - 'CROS_OCTOPUS_RELEASE_CHROME_FROM_TLS_ASH_LKGM': { - 'identifier': 'OCTOPUS_RELEASE_CHROME_FROM_TLS_LKGM', - 'skylab': { - 'cros_board': 'octopus', - 'use_lkgm': True, - }, - }, - 'CROS_OCTOPUS_RELEASE_LKGM': { - 'identifier': 'OCTOPUS_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'octopus', - 'use_lkgm': True, - }, - }, - 'CROS_OCTOPUS_RELEASE_DEV': { - 'identifier': 'OCTOPUS_RELEASE_DEV', - 'skylab': { - 'cros_board': 'octopus', - 'cros_img': 'octopus-release/R121-15678.0.0', - }, - }, - 'CROS_OCTOPUS_RELEASE_BETA': { - 'identifier': 'OCTOPUS_RELEASE_BETA', - 'skylab': { - 'cros_board': 'octopus', - 'cros_img': 'octopus-release/R120-15662.16.0', - }, - }, - 'CROS_OCTOPUS_RELEASE_STABLE': { - 'identifier': 'OCTOPUS_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'octopus', - 'cros_img': 'octopus-release/R119-15633.44.0', - }, - }, - 'CROS_STRONGBAD_RELEASE_LKGM': { - 'identifier': 'STRONGBAD_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'strongbad', - 'use_lkgm': True, - }, - }, - 'CROS_STRONGBAD_RELEASE_DEV': { - 'identifier': 'strongbad_RELEASE_DEV', - 'skylab': { - 'cros_board': 'strongbad', - 'cros_img': 'strongbad-release/R121-15678.0.0', - }, - }, - 'CROS_STRONGBAD_RELEASE_BETA': { - 'identifier': 'STRONGBAD_RELEASE_BETA', - 'skylab': { - 'cros_board': 'strongbad', - 'cros_img': 'strongbad-release/R120-15662.16.0', - }, - }, - 'CROS_STRONGBAD_RELEASE_STABLE': { - 'identifier': 'STRONGBAD_RELEASE_STABLE', - 'skylab': { - 'cros_board': 'strongbad', - 'cros_img': 'strongbad-release/R119-15633.44.0', - }, - }, - 'CROS_TROGDOR_RELEASE_ASH_LKGM': { - 'identifier': 'TROGDOR_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'trogdor', - 'use_lkgm': True, - }, - }, - 'CROS_VOLTEER_PUBLIC_LKGM': { - 'identifier': 'VOLTEER_PUBLIC_LKGM', - 'skylab': { - 'cros_board': 'volteer', - 'cros_model': 'voxel', - 'cros_img': 'volteer-public/R121-15684.0.0', - 'bucket': 'chromiumos-image-archive', - 'dut_pool': 'chromium', - 'public_builder': 'cros_test_platform_public', - 'public_builder_bucket': 'testplatform-public', - }, - }, - 'CROS_VOLTEER_PUBLIC_RELEASE_ASH_LKGM': { - 'identifier': 'VOLTEER_PUBLIC_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'volteer', - 'cros_model': 'voxel', - 'use_lkgm': True, - 'bucket': 'chromiumos-image-archive', - 'dut_pool': 'chromium', - 'public_builder': 'cros_test_platform_public', - 'public_builder_bucket': 'testplatform-public', - }, - }, - 'CROS_VOLTEER_RELEASE_ASH_LKGM': { - 'identifier': 'VOLTEER_RELEASE_LKGM', - 'skylab': { - 'cros_board': 'volteer', - 'use_lkgm': True, - }, - }, - 'LACROS_AMD64_GENERIC': { - 'identifier': 'amd64-generic', - 'args': [ - '--board=amd64-generic', - '--use-vm', - ], - 'swarming': { - 'dimensions': { - 'cpu': 'x86-64', - 'kvm': '1', - 'os': 'Ubuntu-22.04', - }, - }, - }, - 'LACROS_ASH_TOT': { - 'identifier': 'Ash ToT', - 'args': [ - '--deploy-lacros', - ], - }, - 'LACROS_EVE': { - 'identifier': 'eve', - 'args': [ - '--board=eve', - '--flash', - ], - 'ci_only': True, - 'swarming': { - 'dimensions': { - 'os': 'ChromeOS', - 'device_type': 'eve', - }, - }, - }, 'WIN10_INTEL_UHD_630_STABLE': { 'identifier': '8086:9bc5', 'mixins': [ @@ -872,28 +896,4 @@ 'win10_nvidia_gtx_1660_stable', ], }, - 'MODEL_VALIDATION_BASE': { - 'identifier': 'MODEL_VALIDATION_BASE', - }, - 'MODEL_VALIDATION_TRUNK': { - 'identifier': 'MODEL_VALIDATION_TRUNK', - 'linux_args': [ - '--chromedriver', - 'chromedriver', - '--binary', - 'chrome', - ], - 'mac_args': [ - '--chromedriver', - 'chromedriver', - '--binary', - 'Chromium.app/Contents/MacOS/Chromium', - ], - 'win_args': [ - '--chromedriver', - 'chromedriver.exe', - '--binary', - 'Chrome.exe', - ], - }, }
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 5c19428..2107418 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -3344,21 +3344,6 @@ ] } ], - "ChromeOSARCVMArcOnDemand": [ - { - "platforms": [ - "chromeos" - ], - "experiments": [ - { - "name": "Disabled_20231010", - "disable_features": [ - "ArcOnDemand" - ] - } - ] - } - ], "ChromeOSARCVMLmkPerceptibleMinState": [ { "platforms": [ @@ -4237,6 +4222,26 @@ ] } ], + "ComposeModelQualityLogging": [ + { + "platforms": [ + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "ComposeLoggingEnabled_Dogfood", + "params": { + "model_execution_feature_compose": "true" + }, + "enable_features": [ + "ModelQualityLogging" + ] + } + ] + } + ], "CompositeBGColorAnimationExp4": [ { "platforms": [ @@ -7119,21 +7124,6 @@ ] } ], - "FillingAcrossAffiliatedWebsitesAndroid": [ - { - "platforms": [ - "android" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "FillingAcrossAffiliatedWebsitesAndroid" - ] - } - ] - } - ], "FilteringScrollPrediction": [ { "platforms": [ @@ -8696,30 +8686,6 @@ ] } ], - "IOSHideFeedWithSearchChoice": [ - { - "platforms": [ - "ios" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "IOSHideFeedWithSearchChoice" - ] - }, - { - "name": "Enabled with targeting", - "params": { - "IOSHideFeedWithSearchChoiceTargeted": "true" - }, - "enable_features": [ - "IOSHideFeedWithSearchChoice" - ] - } - ] - } - ], "IOSIPHForSafariSwitcher": [ { "platforms": [ @@ -8738,28 +8704,6 @@ ] } ], - "IOSInactiveTabs": [ - { - "platforms": [ - "ios" - ], - "experiments": [ - { - "name": "NoCount-TwoWeeks", - "params": { - "variant": "tab-inactivity-threshold-two-weeks" - }, - "enable_features": [ - "TabInactivityThreshold" - ], - "disable_features": [ - "InactiveTabsMoveLimit", - "ShowInactiveTabsCount" - ] - } - ] - } - ], "IOSIncognitoDownloadsWarning": [ { "platforms": [ @@ -9996,7 +9940,7 @@ { "name": "Enabled", "params": { - "available_languages": "en-US,fr-FR,it-IT,de-DE,hi-IN,pt-BR,ja-JP" + "available_languages": "en-US,fr-FR,it-IT,de-DE,es-ES,ja-JP,hi-IN,pt-BR" }, "enable_features": [ "LiveCaptionExperimentalLanguages" @@ -10829,8 +10773,8 @@ ], "experiments": [ { - "name": "Enabled", - "enable_features": [ + "name": "Disabled_20231128", + "disable_features": [ "NoAppCompatClearInChildren" ] } @@ -11656,6 +11600,7 @@ "OmniboxPrefBasedConsentHelper": [ { "platforms": [ + "android", "chromeos", "chromeos_lacros", "ios", @@ -12151,12 +12096,19 @@ ], "experiments": [ { - "name": "Enabled_Dogfood", + "name": "Enabled_From_121_Dogfood", "enable_features": [ "MantaService", "OrcaDogfood", "OrcaOnWorkspace" ] + }, + { + "name": "Enabled_Pre_121_Dogfood", + "enable_features": [ + "MantaService", + "OrcaDogfood" + ] } ] } @@ -14112,6 +14064,27 @@ ] } ], + "ProtectedAudiencesKAnonymityEnforcementStudy": [ + { + "platforms": [ + "android", + "chromeos", + "chromeos_lacros", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "FledgeConsiderKAnonymity", + "FledgeEnforceKAnonymity" + ] + } + ] + } + ], "ProtectedAudiencesNegativeTargetingStudy": [ { "platforms": [ @@ -17467,6 +17440,36 @@ ] } ], + "SidePanelCompanionDesktopM116Plus": [ + { + "platforms": [ + "chromeos", + "chromeos_lacros", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "EnabledContextualLensPanel_20231129", + "params": { + "open-companion-for-image-search": "false", + "open-companion-for-web-search": "false", + "open-contextual-lens-panel": "true", + "open-links-in-current-tab": "false" + }, + "enable_features": [ + "SidePanelCompanion", + "VisualSearchSuggestions" + ], + "disable_features": [ + "CompanionEnableNewBadgesInContextMenu", + "SideSearch" + ] + } + ] + } + ], "SidePanelJourneys": [ { "platforms": [ @@ -20873,7 +20876,11 @@ "experiments": [ { "name": "Enabled1", + "params": { + "IOSHideFeedWithSearchChoiceTargeted": "true" + }, "enable_features": [ + "IOSHideFeedWithSearchChoice", "SearchEngineChoice", "SearchEngineChoiceFre" ]
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn index 064aeed..4c09d3c 100644 --- a/third_party/android_deps/BUILD.gn +++ b/third_party/android_deps/BUILD.gn
@@ -1291,6 +1291,15 @@ } # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. + java_prebuilt("net_bytebuddy_byte_buddy_java") { + jar_path = "libs/net_bytebuddy_byte_buddy/byte-buddy-1.14.5.jar" + output_name = "net_bytebuddy_byte_buddy" + supports_android = true + enable_bytecode_checks = false + testonly = true + } + + # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. java_prebuilt("org_ccil_cowan_tagsoup_tagsoup_java") { jar_path = "libs/org_ccil_cowan_tagsoup_tagsoup/tagsoup-1.2.1.jar" output_name = "org_ccil_cowan_tagsoup_tagsoup" @@ -2299,22 +2308,6 @@ } # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. - java_prebuilt("net_bytebuddy_byte_buddy_java") { - jar_path = "libs/net_bytebuddy_byte_buddy/byte-buddy-1.14.5.jar" - output_name = "net_bytebuddy_byte_buddy" - supports_android = true - enable_bytecode_checks = false - - # To remove visibility constraint, add this dependency to - # //third_party/android_deps/build.gradle. - visibility = [ - ":*", - "//third_party/androidx:*", - ] - testonly = true - } - - # This is generated, do not edit. Update BuildConfigGenerator.groovy instead. java_prebuilt("net_bytebuddy_byte_buddy_agent_java") { jar_path = "libs/net_bytebuddy_byte_buddy_agent/byte-buddy-agent-1.14.5.jar" output_name = "net_bytebuddy_byte_buddy_agent"
diff --git a/third_party/android_deps/build.gradle b/third_party/android_deps/build.gradle index e265962..cf14ae3 100644 --- a/third_party/android_deps/build.gradle +++ b/third_party/android_deps/build.gradle
@@ -183,6 +183,9 @@ androidTestCompile "org.mockito:mockito-core:${mockitoVersion}" androidTestCompile "org.mockito:mockito-subclass:${mockitoVersion}" + // Used by //third_party/byte_buddy + androidTestCompile "net.bytebuddy:byte-buddy:1.14.5" + // Use testCompile to have is_robolectric = true set on targets. testCompile "org.robolectric:robolectric:4.11.1" }
diff --git a/third_party/angle b/third_party/angle index d696b40..58a32ac 160000 --- a/third_party/angle +++ b/third_party/angle
@@ -1 +1 @@ -Subproject commit d696b40fad24202791ecb40d9ea13a2ab4be15cf +Subproject commit 58a32acce662472ccc6b098ae14b54769bd8b8dd
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc index 980102e8..63998d0 100644 --- a/third_party/blink/common/features.cc +++ b/third_party/blink/common/features.cc
@@ -1515,6 +1515,10 @@ "PrivateAggregationApiMultipleCloudProviders", base::FEATURE_ENABLED_BY_DEFAULT); +BASE_FEATURE(kPrivateNetworkAccessNullIpAddress, + "PrivateNetworkAccessNullIpAddress", + base::FEATURE_DISABLED_BY_DEFAULT); + BASE_FEATURE(kProcessHtmlDataImmediately, "ProcessHtmlDataImmediately", base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/third_party/blink/common/media/watch_time_component_unittest.cc b/third_party/blink/common/media/watch_time_component_unittest.cc index 62c65c9..2805c91b 100644 --- a/third_party/blink/common/media/watch_time_component_unittest.cc +++ b/third_party/blink/common/media/watch_time_component_unittest.cc
@@ -29,7 +29,6 @@ MOCK_METHOD2(UpdateUnderflowDuration, void(int32_t, base::TimeDelta)); MOCK_METHOD1(UpdateSecondaryProperties, void(media::mojom::SecondaryPlaybackPropertiesPtr)); - MOCK_METHOD1(OnCurrentTimestampChanged, void(base::TimeDelta)); }; class WatchTimeComponentTest : public testing::Test {
diff --git a/third_party/blink/common/media/watch_time_reporter.cc b/third_party/blink/common/media/watch_time_reporter.cc index 933f14c..7323ee5 100644 --- a/third_party/blink/common/media/watch_time_reporter.cc +++ b/third_party/blink/common/media/watch_time_reporter.cc
@@ -531,9 +531,6 @@ display_type_component_->RecordWatchTime(current_timestamp); if (controls_component_) controls_component_->RecordWatchTime(current_timestamp); - - // Update the last timestamp with the current timestamp. - recorder_->OnCurrentTimestampChanged(current_timestamp); } void WatchTimeReporter::UpdateWatchTime() {
diff --git a/third_party/blink/public/common/OWNERS b/third_party/blink/public/common/OWNERS index cf5d039..ea823cfc 100644 --- a/third_party/blink/public/common/OWNERS +++ b/third_party/blink/public/common/OWNERS
@@ -1,4 +1,3 @@ -jam@chromium.org pfeldman@chromium.org # To ensure security review.
diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h index d5bdbc1..4cb464a 100644 --- a/third_party/blink/public/common/features.h +++ b/third_party/blink/public/common/features.h
@@ -932,6 +932,8 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE( kPrivateAggregationApiMultipleCloudProviders); +BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kPrivateNetworkAccessNullIpAddress); + // If set, HTMLDocumentParser processes data immediately rather than after a // delay. This is further controlled by the feature params starting with the // same name. Also note that this only applies to uses that are normally
diff --git a/third_party/blink/public/mojom/webauthn/authenticator.mojom b/third_party/blink/public/mojom/webauthn/authenticator.mojom index dcf468ed..0172bcd 100644 --- a/third_party/blink/public/mojom/webauthn/authenticator.mojom +++ b/third_party/blink/public/mojom/webauthn/authenticator.mojom
@@ -44,7 +44,6 @@ BAD_RELYING_PARTY_ID_JSON_PARSE_ERROR, BAD_RELYING_PARTY_ID_NO_JSON_MATCH, BAD_RELYING_PARTY_ID_NO_JSON_MATCH_HIT_LIMITS, - BAD_RELYING_PARTY_ID_NO_JSON_MATCH_EXTENSION, CANNOT_READ_AND_WRITE_LARGE_BLOB, INVALID_ALLOW_CREDENTIALS_FOR_LARGE_BLOB, FAILED_TO_SAVE_CREDENTIAL_ID_FOR_PAYMENT_EXTENSION,
diff --git a/third_party/blink/public/platform/web_media_player.h b/third_party/blink/public/platform/web_media_player.h index 3fef2de0..b651e0e 100644 --- a/third_party/blink/public/platform/web_media_player.h +++ b/third_party/blink/public/platform/web_media_player.h
@@ -129,7 +129,6 @@ int height; base::TimeDelta media_time; media::VideoFrameMetadata metadata; - scoped_refptr<media::VideoFrame> frame; base::TimeDelta rendering_interval; base::TimeDelta average_frame_duration; };
diff --git a/third_party/blink/public/web/web_array_buffer_converter.h b/third_party/blink/public/web/web_array_buffer_converter.h index 1e58f0d..7b653ab4 100644 --- a/third_party/blink/public/web/web_array_buffer_converter.h +++ b/third_party/blink/public/web/web_array_buffer_converter.h
@@ -37,7 +37,6 @@ namespace v8 { class Isolate; -class Object; class Value; } @@ -45,9 +44,7 @@ class BLINK_EXPORT WebArrayBufferConverter { public: - static v8::Local<v8::Value> ToV8Value(WebArrayBuffer*, - v8::Local<v8::Object>, - v8::Isolate*); + static v8::Local<v8::Value> ToV8Value(WebArrayBuffer*, v8::Isolate*); static WebArrayBuffer* CreateFromV8Value(v8::Local<v8::Value>, v8::Isolate*); };
diff --git a/third_party/blink/public/web/web_dom_file_system.h b/third_party/blink/public/web/web_dom_file_system.h index 5bdcdd1..3d125a6 100644 --- a/third_party/blink/public/web/web_dom_file_system.h +++ b/third_party/blink/public/web/web_dom_file_system.h
@@ -40,7 +40,6 @@ namespace v8 { class Isolate; -class Object; class Value; } @@ -89,11 +88,9 @@ WebFileSystemType GetType() const; WebURL RootURL() const; - v8::Local<v8::Value> ToV8Value(v8::Local<v8::Object> creation_context, - v8::Isolate*); + v8::Local<v8::Value> ToV8Value(v8::Isolate*); v8::Local<v8::Value> CreateV8Entry(const WebString& path, EntryType, - v8::Local<v8::Object> creation_context, v8::Isolate*); bool IsNull() const { return private_.IsNull(); }
diff --git a/third_party/blink/public/web/web_node.h b/third_party/blink/public/web/web_node.h index 5d6f7c6..6268801 100644 --- a/third_party/blink/public/web/web_node.h +++ b/third_party/blink/public/web/web_node.h
@@ -110,8 +110,7 @@ bool IsInsideFocusableElementOrARIAWidget() const; - v8::Local<v8::Value> ToV8Value(v8::Local<v8::Object> creation_context, - v8::Isolate*); + v8::Local<v8::Value> ToV8Value(v8::Isolate*); int GetDomNodeId() const;
diff --git a/third_party/blink/renderer/core/animation/compositor_animations_test.cc b/third_party/blink/renderer/core/animation/compositor_animations_test.cc index 82ce5ba..dba5f6e 100644 --- a/third_party/blink/renderer/core/animation/compositor_animations_test.cc +++ b/third_party/blink/renderer/core/animation/compositor_animations_test.cc
@@ -1035,16 +1035,16 @@ // The effect should snap between keyframes at the halfway points. animation->setCurrentTime(MakeGarbageCollected<V8CSSNumberish>(450), ASSERT_NO_EXCEPTION); - EXPECT_NEAR(element_->getBoundingClientRect()->x(), 100.0, 0.001); + EXPECT_NEAR(element_->GetBoundingClientRect()->x(), 100.0, 0.001); animation->setCurrentTime(MakeGarbageCollected<V8CSSNumberish>(550), ASSERT_NO_EXCEPTION); - EXPECT_NEAR(element_->getBoundingClientRect()->x(), 200.0, 0.001); + EXPECT_NEAR(element_->GetBoundingClientRect()->x(), 200.0, 0.001); animation->setCurrentTime(MakeGarbageCollected<V8CSSNumberish>(1450), ASSERT_NO_EXCEPTION); - EXPECT_NEAR(element_->getBoundingClientRect()->x(), 200.0, 0.001); + EXPECT_NEAR(element_->GetBoundingClientRect()->x(), 200.0, 0.001); animation->setCurrentTime(MakeGarbageCollected<V8CSSNumberish>(1550), ASSERT_NO_EXCEPTION); - EXPECT_NEAR(element_->getBoundingClientRect()->x(), 300.0, 0.001); + EXPECT_NEAR(element_->GetBoundingClientRect()->x(), 300.0, 0.001); } TEST_P(AnimationCompositorAnimationsTest, @@ -1071,7 +1071,7 @@ // jump to the nearest keyframe. animation->setCurrentTime(MakeGarbageCollected<V8CSSNumberish>(500), ASSERT_NO_EXCEPTION); - EXPECT_NEAR(element_->getBoundingClientRect()->x(), 150.0, 0.001); + EXPECT_NEAR(element_->GetBoundingClientRect()->x(), 150.0, 0.001); } TEST_P(AnimationCompositorAnimationsTest, @@ -1112,7 +1112,7 @@ // to the nearest keyframe. animation->setCurrentTime(MakeGarbageCollected<V8CSSNumberish>(400), ASSERT_NO_EXCEPTION); - EXPECT_NEAR(element_->getBoundingClientRect()->x(), 100.0, 0.001); + EXPECT_NEAR(element_->GetBoundingClientRect()->x(), 100.0, 0.001); // As the child document does support reduce motion, its animation will not be // snapped. @@ -1121,7 +1121,7 @@ Animation* child_animation = child_element->getAnimations()[0]; child_animation->setCurrentTime(MakeGarbageCollected<V8CSSNumberish>(400), ASSERT_NO_EXCEPTION); - EXPECT_NEAR(child_element->getBoundingClientRect()->x(), 140.0, 0.001); + EXPECT_NEAR(child_element->GetBoundingClientRect()->x(), 140.0, 0.001); } TEST_P(AnimationCompositorAnimationsTest, CheckCanStartForceReduceMotion) {
diff --git a/third_party/blink/renderer/core/annotation/annotation_agent_impl_test.cc b/third_party/blink/renderer/core/annotation/annotation_agent_impl_test.cc index af737c7..25b215f 100644 --- a/third_party/blink/renderer/core/annotation/annotation_agent_impl_test.cc +++ b/third_party/blink/renderer/core/annotation/annotation_agent_impl_test.cc
@@ -1257,7 +1257,7 @@ ASSERT_FALSE(agent_foo->NeedsAttachment()); // Text is still offscreen. - ASSERT_LT(p->getBoundingClientRect()->bottom(), 0); + ASSERT_LT(p->GetBoundingClientRect()->bottom(), 0); EXPECT_FALSE(agent_foo->IsAttached()); } @@ -1274,7 +1274,7 @@ ASSERT_FALSE(agent_foo->NeedsAttachment()); // Text is now within the viewport. - ASSERT_GT(p->getBoundingClientRect()->bottom(), 0); + ASSERT_GT(p->GetBoundingClientRect()->bottom(), 0); EXPECT_TRUE(agent_foo->IsAttached()); }
diff --git a/third_party/blink/renderer/core/css/css_grouping_rule.idl b/third_party/blink/renderer/core/css/css_grouping_rule.idl index e6b8d74..2a3db77 100644 --- a/third_party/blink/renderer/core/css/css_grouping_rule.idl +++ b/third_party/blink/renderer/core/css/css_grouping_rule.idl
@@ -8,6 +8,6 @@ Exposed=Window ] interface CSSGroupingRule : CSSRule { [SameObject] readonly attribute CSSRuleList cssRules; - [RaisesException, CallWith=ExecutionContext] unsigned long insertRule(DOMString rule, unsigned long index); + [RaisesException, CallWith=ExecutionContext] unsigned long insertRule(CSSOMString rule, optional unsigned long index = 0); [RaisesException] void deleteRule(unsigned long index); };
diff --git a/third_party/blink/renderer/core/css/properties/computed_style_utils.cc b/third_party/blink/renderer/core/css/properties/computed_style_utils.cc index 593570d..277cd83 100644 --- a/third_party/blink/renderer/core/css/properties/computed_style_utils.cc +++ b/third_party/blink/renderer/core/css/properties/computed_style_utils.cc
@@ -769,7 +769,6 @@ const LayoutObject* layout_object) { std::pair<const Length*, const Length*> positions; bool is_horizontal_property; - // TODO(crbug.com/1477314): inset-area should probably be included. switch (property.PropertyID()) { case CSSPropertyID::kLeft: positions = std::make_pair(&style.UsedLeft(), &style.UsedRight());
diff --git a/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc b/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc index c749bba..0be1196 100644 --- a/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc +++ b/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc
@@ -5606,6 +5606,13 @@ bool& is_auto_repeat, bool& all_tracks_are_fixed_sized) { CSSParserTokenRange args = ConsumeFunction(range); + + // <name-repeat> syntax for subgrids only supports `auto-fill`. + if (is_subgrid_track_list && + IdentMatches<CSSValueID::kAutoFit>(args.Peek().Id())) { + return false; + } + is_auto_repeat = IdentMatches<CSSValueID::kAutoFill, CSSValueID::kAutoFit>( args.Peek().Id()); CSSValueList* repeated_values;
diff --git a/third_party/blink/renderer/core/display_lock/display_lock_context_test.cc b/third_party/blink/renderer/core/display_lock/display_lock_context_test.cc index 13cd2cc..3a944fb 100644 --- a/third_party/blink/renderer/core/display_lock/display_lock_context_test.cc +++ b/third_party/blink/renderer/core/display_lock/display_lock_context_test.cc
@@ -3184,8 +3184,8 @@ EXPECT_FALSE(visible->GetLayoutObject()->SelfNeedsFullLayout()); EXPECT_FALSE(hidden->GetLayoutObject()->SelfNeedsFullLayout()); - auto* visible_rect = visible->getBoundingClientRect(); - auto* hidden_rect = hidden->getBoundingClientRect(); + auto* visible_rect = visible->GetBoundingClientRect(); + auto* hidden_rect = hidden->GetBoundingClientRect(); EXPECT_FLOAT_EQ(visible_rect->height(), 100); EXPECT_FLOAT_EQ(hidden_rect->height(), 200); @@ -3503,7 +3503,7 @@ auto* parent = GetDocument().getElementById(AtomicString("parent")); // Force update all layout objects - grandchild->getBoundingClientRect(); + grandchild->GetBoundingClientRect(); ASSERT_TRUE(locked->GetLayoutObject()); ASSERT_TRUE(grandchild->GetLayoutObject());
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc index 7d28cecd..a321ec9c 100644 --- a/third_party/blink/renderer/core/dom/element.cc +++ b/third_party/blink/renderer/core/dom/element.cc
@@ -179,7 +179,6 @@ #include "third_party/blink/renderer/core/layout/layout_text_combine.h" #include "third_party/blink/renderer/core/layout/layout_text_fragment.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/page/chrome_client.h" #include "third_party/blink/renderer/core/page/focus_controller.h" #include "third_party/blink/renderer/core/page/page.h" @@ -2193,12 +2192,16 @@ return result; } -DOMRect* Element::getBoundingClientRect() { +DOMRect* Element::GetBoundingClientRect() { GetDocument().EnsurePaintLocationDataValidForNode( this, DocumentUpdateReason::kJavaScript); return DOMRect::FromRectF(GetBoundingClientRectNoLifecycleUpdate()); } +DOMRect* Element::GetBoundingClientRectForBinding() { + return GetBoundingClientRect(); +} + const AtomicString& Element::computedRole() { Document& document = GetDocument(); if (!document.IsActive() || !document.View()) {
diff --git a/third_party/blink/renderer/core/dom/element.h b/third_party/blink/renderer/core/dom/element.h index 3e84176..2304a42 100644 --- a/third_party/blink/renderer/core/dom/element.h +++ b/third_party/blink/renderer/core/dom/element.h
@@ -414,7 +414,8 @@ gfx::RectF GetBoundingClientRectNoLifecycleUpdateNoAdjustment() const; // Returns a rectangle in CSS pixel units. i.e. ignorign zoom. gfx::RectF GetBoundingClientRectNoLifecycleUpdate() const; - DOMRect* getBoundingClientRect(); + DOMRect* GetBoundingClientRect(); + DOMRect* GetBoundingClientRectForBinding(); // Call the NoLifecycleUpdate variants if you are sure that the lifcycle is // already updated to at least pre-paint clean.
diff --git a/third_party/blink/renderer/core/dom/element.idl b/third_party/blink/renderer/core/dom/element.idl index 1f3c6c2d..8410eca7 100644 --- a/third_party/blink/renderer/core/dom/element.idl +++ b/third_party/blink/renderer/core/dom/element.idl
@@ -101,7 +101,7 @@ [CEReactions, RaisesException=Setter] attribute [LegacyNullToEmptyString, StringContext=TrustedHTML] DOMString outerHTML; [CEReactions, RaisesException] void insertAdjacentHTML(DOMString position, HTMLString text); // https://github.com/whatwg/html/pull/9538 - [RuntimeEnabled=HTMLUnsafeMethods,RaisesException,MeasureAs=SetHTMLUnsafe] void setHTMLUnsafe(DOMString html); + [RuntimeEnabled=HTMLUnsafeMethods,RaisesException,MeasureAs=SetHTMLUnsafe,CEReactions] void setHTMLUnsafe(DOMString html); // Declarative Shadow DOM getInnerHTML() function. [Affects=Nothing, MeasureAs=ElementGetInnerHTML] HTMLString getInnerHTML(optional GetInnerHTMLOptions options = {}); @@ -114,7 +114,7 @@ // CSSOM View Module // https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface [Measure] DOMRectList getClientRects(); - [Affects=Nothing, Measure, RuntimeCallStatsCounter=ElementGetBoundingClientRect] DOMRect getBoundingClientRect(); + [Affects=Nothing, Measure, RuntimeCallStatsCounter=ElementGetBoundingClientRect, ImplementedAs=GetBoundingClientRectForBinding] DOMRect getBoundingClientRect(); // https://drafts.csswg.org/cssom-view/#dom-element-checkvisibility [MeasureAs=ElementCheckVisibility] boolean checkVisibility(optional CheckVisibilityOptions options = {});
diff --git a/third_party/blink/renderer/core/dom/element_test.cc b/third_party/blink/renderer/core/dom/element_test.cc index 06d523a..f452afe2 100644 --- a/third_party/blink/renderer/core/dom/element_test.cc +++ b/third_party/blink/renderer/core/dom/element_test.cc
@@ -66,7 +66,7 @@ // The sticky element should remain at (0, 25) relative to the viewport due to // the constraints. - DOMRect* bounding_client_rect = sticky->getBoundingClientRect(); + DOMRect* bounding_client_rect = sticky->GetBoundingClientRect(); EXPECT_EQ(0, bounding_client_rect->top()); EXPECT_EQ(25, bounding_client_rect->left()); @@ -78,7 +78,7 @@ // Requesting the bounding client rect should cause both layout and // compositing inputs clean to be run, and the sticky result shouldn't change. - bounding_client_rect = sticky->getBoundingClientRect(); + bounding_client_rect = sticky->GetBoundingClientRect(); EXPECT_EQ(DocumentLifecycle::kLayoutClean, document.Lifecycle().GetState()); EXPECT_EQ(0, bounding_client_rect->top()); EXPECT_EQ(25, bounding_client_rect->left()); @@ -305,7 +305,7 @@ )HTML"); Element* rect = document.getElementById(AtomicString("rect")); - DOMRect* rect_bounding_client_rect = rect->getBoundingClientRect(); + DOMRect* rect_bounding_client_rect = rect->GetBoundingClientRect(); EXPECT_EQ(10, rect_bounding_client_rect->left()); EXPECT_EQ(100, rect_bounding_client_rect->top()); EXPECT_EQ(100, rect_bounding_client_rect->width()); @@ -315,7 +315,7 @@ // TODO(pdr): Should we should be excluding the stroke (here, and below)? // See: https://github.com/w3c/svgwg/issues/339 and Element::ClientQuads. Element* stroke = document.getElementById(AtomicString("stroke")); - DOMRect* stroke_bounding_client_rect = stroke->getBoundingClientRect(); + DOMRect* stroke_bounding_client_rect = stroke->GetBoundingClientRect(); EXPECT_EQ(10, stroke_bounding_client_rect->left()); EXPECT_EQ(100, stroke_bounding_client_rect->top()); EXPECT_EQ(100, stroke_bounding_client_rect->width()); @@ -327,7 +327,7 @@ Element* stroke_transformed = document.getElementById(AtomicString("stroke_transformed")); DOMRect* stroke_transformedbounding_client_rect = - stroke_transformed->getBoundingClientRect(); + stroke_transformed->GetBoundingClientRect(); EXPECT_EQ(13, stroke_transformedbounding_client_rect->left()); EXPECT_EQ(105, stroke_transformedbounding_client_rect->top()); EXPECT_EQ(100, stroke_transformedbounding_client_rect->width()); @@ -337,7 +337,7 @@ EXPECT_EQ(gfx::Rect(13, 105, 100, 71), stroke_transformed->BoundsInWidget()); Element* foreign = document.getElementById(AtomicString("foreign")); - DOMRect* foreign_bounding_client_rect = foreign->getBoundingClientRect(); + DOMRect* foreign_bounding_client_rect = foreign->GetBoundingClientRect(); EXPECT_EQ(10, foreign_bounding_client_rect->left()); EXPECT_EQ(100, foreign_bounding_client_rect->top()); EXPECT_EQ(100, foreign_bounding_client_rect->width()); @@ -347,7 +347,7 @@ Element* foreign_transformed = document.getElementById(AtomicString("foreign_transformed")); DOMRect* foreign_transformed_bounding_client_rect = - foreign_transformed->getBoundingClientRect(); + foreign_transformed->GetBoundingClientRect(); EXPECT_EQ(13, foreign_transformed_bounding_client_rect->left()); EXPECT_EQ(105, foreign_transformed_bounding_client_rect->top()); EXPECT_EQ(100, foreign_transformed_bounding_client_rect->width()); @@ -355,7 +355,7 @@ EXPECT_EQ(gfx::Rect(13, 105, 100, 71), foreign_transformed->BoundsInWidget()); Element* svg = document.getElementById(AtomicString("svg")); - DOMRect* svg_bounding_client_rect = svg->getBoundingClientRect(); + DOMRect* svg_bounding_client_rect = svg->GetBoundingClientRect(); EXPECT_EQ(10, svg_bounding_client_rect->left()); EXPECT_EQ(100, svg_bounding_client_rect->top()); EXPECT_EQ(100, svg_bounding_client_rect->width()); @@ -364,7 +364,7 @@ Element* svg_stroke = document.getElementById(AtomicString("svg_stroke")); DOMRect* svg_stroke_bounding_client_rect = - svg_stroke->getBoundingClientRect(); + svg_stroke->GetBoundingClientRect(); EXPECT_EQ(10, svg_stroke_bounding_client_rect->left()); EXPECT_EQ(100, svg_stroke_bounding_client_rect->top()); EXPECT_EQ(100, svg_stroke_bounding_client_rect->width());
diff --git a/third_party/blink/renderer/core/dom/shadow_root.idl b/third_party/blink/renderer/core/dom/shadow_root.idl index 92ffe1a..da00322e 100644 --- a/third_party/blink/renderer/core/dom/shadow_root.idl +++ b/third_party/blink/renderer/core/dom/shadow_root.idl
@@ -69,7 +69,7 @@ Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName, (DOMString or ElementCreationOptions) options); - [RuntimeEnabled=HTMLUnsafeMethods,RaisesException,MeasureAs=SetHTMLUnsafe] void setHTMLUnsafe(DOMString string); + [RuntimeEnabled=HTMLUnsafeMethods,RaisesException,MeasureAs=SetHTMLUnsafe,CEReactions] void setHTMLUnsafe(DOMString string); }; ShadowRoot includes DocumentOrShadowRoot;
diff --git a/third_party/blink/renderer/core/editing/caret_display_item_client.cc b/third_party/blink/renderer/core/editing/caret_display_item_client.cc index 0c8a6a05..672231d0 100644 --- a/third_party/blink/renderer/core/editing/caret_display_item_client.cc +++ b/third_party/blink/renderer/core/editing/caret_display_item_client.cc
@@ -32,7 +32,7 @@ #include "third_party/blink/renderer/core/frame/local_frame_view.h" #include "third_party/blink/renderer/core/layout/layout_block.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/object_paint_invalidator.h" #include "third_party/blink/renderer/core/paint/paint_auto_dark_mode.h" #include "third_party/blink/renderer/core/paint/paint_info.h"
diff --git a/third_party/blink/renderer/core/editing/editing_utilities.cc b/third_party/blink/renderer/core/editing/editing_utilities.cc index 101a8a60..2ef76ba 100644 --- a/third_party/blink/renderer/core/editing/editing_utilities.cc +++ b/third_party/blink/renderer/core/editing/editing_utilities.cc
@@ -513,8 +513,15 @@ // Make sure not to move out of |highest_root| const PositionTemplate<Strategy> boundary = PositionTemplate<Strategy>::LastPositionInNode(highest_root); + // `NextVisuallyDistinctCandidate` is similar to `NextCandidate`, but + // it skips the next visually equivalent of `editable_position`. + // `editable_position` is already "visually distinct" relative to + // `position`, so use `NextCandidate` here. + // See http://crbug.com/1406207 for more details. const PositionTemplate<Strategy> next_candidate = - NextVisuallyDistinctCandidate(editable_position); + RuntimeEnabledFeatures::NextSiblingPositionUseNextCandidateEnabled() + ? NextCandidate(editable_position) + : NextVisuallyDistinctCandidate(editable_position); editable_position = next_candidate.IsNotNull() ? std::min(boundary, next_candidate) : boundary;
diff --git a/third_party/blink/renderer/core/editing/layout_selection.cc b/third_party/blink/renderer/core/editing/layout_selection.cc index b1ba295..bb53bb7 100644 --- a/third_party/blink/renderer/core/editing/layout_selection.cc +++ b/third_party/blink/renderer/core/editing/layout_selection.cc
@@ -31,6 +31,7 @@ #include "third_party/blink/renderer/core/editing/visible_position.h" #include "third_party/blink/renderer/core/editing/visible_units.h" #include "third_party/blink/renderer/core/html/forms/text_control_element.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/inline/fragment_item.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/inline/offset_mapping.h" @@ -38,7 +39,6 @@ #include "third_party/blink/renderer/core/layout/layout_text.h" #include "third_party/blink/renderer/core/layout/layout_text_fragment.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h"
diff --git a/third_party/blink/renderer/core/editing/local_caret_rect_test.cc b/third_party/blink/renderer/core/editing/local_caret_rect_test.cc index 76d6f3f..93970043 100644 --- a/third_party/blink/renderer/core/editing/local_caret_rect_test.cc +++ b/third_party/blink/renderer/core/editing/local_caret_rect_test.cc
@@ -10,7 +10,7 @@ #include "third_party/blink/renderer/core/editing/visible_position.h" #include "third_party/blink/renderer/core/html/forms/text_control_element.h" #include "third_party/blink/renderer/core/layout/layout_object.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" #include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
diff --git a/third_party/blink/renderer/core/editing/selection_modifier.cc b/third_party/blink/renderer/core/editing/selection_modifier.cc index ab8192f..e0f9a3e 100644 --- a/third_party/blink/renderer/core/editing/selection_modifier.cc +++ b/third_party/blink/renderer/core/editing/selection_modifier.cc
@@ -42,7 +42,7 @@ #include "third_party/blink/renderer/core/layout/inline/caret_position.h" #include "third_party/blink/renderer/core/layout/inline/offset_mapping.h" #include "third_party/blink/renderer/core/layout/layout_block.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" #include "third_party/blink/renderer/core/page/spatial_navigation.h" namespace blink {
diff --git a/third_party/blink/renderer/core/exported/web_array_buffer_converter.cc b/third_party/blink/renderer/core/exported/web_array_buffer_converter.cc index 48fc93e76..e53e6dafd 100644 --- a/third_party/blink/renderer/core/exported/web_array_buffer_converter.cc +++ b/third_party/blink/renderer/core/exported/web_array_buffer_converter.cc
@@ -38,12 +38,7 @@ v8::Local<v8::Value> WebArrayBufferConverter::ToV8Value( WebArrayBuffer* buffer, - v8::Local<v8::Object> creation_context, v8::Isolate* isolate) { - // We no longer use |creationContext| because it's often misused and points - // to a context faked by user script. - DCHECK(creation_context->GetCreationContextChecked() == - isolate->GetCurrentContext()); if (!buffer) return v8::Local<v8::Value>(); return ToV8(*buffer, isolate->GetCurrentContext()->Global(), isolate);
diff --git a/third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc b/third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc index 0056050..8d4fa7b 100644 --- a/third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc +++ b/third_party/blink/renderer/core/exported/web_media_player_impl_unittest.cc
@@ -424,9 +424,6 @@ ukm::kInvalidSourceId, media::learning::FeatureValue(0), media::VideoDecodePerfHistory::SaveCallback(), media::MediaMetricsProvider::GetLearningSessionCallback(), - WTF::BindRepeating( - &WebMediaPlayerImplTest::GetRecordAggregateWatchTimeCallback, - WTF::Unretained(this)), WTF::BindRepeating(&WebMediaPlayerImplTest::IsShuttingDown, WTF::Unretained(this)), provider.BindNewPipeAndPassReceiver()); @@ -495,11 +492,6 @@ wmpi_->OnDurationChange(); } - media::MediaMetricsProvider::RecordAggregateWatchTimeCallback - GetRecordAggregateWatchTimeCallback() { - return base::NullCallback(); - } - MOCK_METHOD(bool, IsShuttingDown, ()); base::TimeDelta GetCurrentTimeInternal() {
diff --git a/third_party/blink/renderer/core/exported/web_node.cc b/third_party/blink/renderer/core/exported/web_node.cc index e5b27c39..cffa5e9 100644 --- a/third_party/blink/renderer/core/exported/web_node.cc +++ b/third_party/blink/renderer/core/exported/web_node.cc
@@ -159,12 +159,7 @@ *this->ConstUnwrap<Node>()); } -v8::Local<v8::Value> WebNode::ToV8Value(v8::Local<v8::Object> creation_context, - v8::Isolate* isolate) { - // We no longer use |creation_context| because it's often misused and points - // to a context faked by user script. - DCHECK(creation_context->GetCreationContextChecked() == - isolate->GetCurrentContext()); +v8::Local<v8::Value> WebNode::ToV8Value(v8::Isolate* isolate) { if (!private_.Get()) return v8::Local<v8::Value>(); return ToV8(private_.Get(), isolate->GetCurrentContext()->Global(), isolate);
diff --git a/third_party/blink/renderer/core/exported/web_page_popup_impl.cc b/third_party/blink/renderer/core/exported/web_page_popup_impl.cc index 205ffb8..40eb6df 100644 --- a/third_party/blink/renderer/core/exported/web_page_popup_impl.cc +++ b/third_party/blink/renderer/core/exported/web_page_popup_impl.cc
@@ -410,7 +410,7 @@ std::move(data)); popup_owner_client_rect_ = - popup_client_->OwnerElement().getBoundingClientRect(); + popup_client_->OwnerElement().GetBoundingClientRect(); popup_widget_host_->ShowPopup( initial_rect_, GetAnchorRectInScreen(), WTF::BindOnce(&WebPagePopupImpl::DidShowPopup, WTF::Unretained(this))); @@ -557,7 +557,7 @@ if (!page_ && !popup_client_) return; - DOMRect* dom_rect = popup_client_->OwnerElement().getBoundingClientRect(); + DOMRect* dom_rect = popup_client_->OwnerElement().GetBoundingClientRect(); bool forced_update = (*dom_rect != *popup_owner_client_rect_); if (forced_update) popup_owner_client_rect_ = dom_rect;
diff --git a/third_party/blink/renderer/core/fragment_directive/text_fragment_anchor.cc b/third_party/blink/renderer/core/fragment_directive/text_fragment_anchor.cc index 415c9258..c8bc6bd7 100644 --- a/third_party/blink/renderer/core/fragment_directive/text_fragment_anchor.cc +++ b/third_party/blink/renderer/core/fragment_directive/text_fragment_anchor.cc
@@ -56,7 +56,8 @@ return false; } - if (frame.GetDocument()->contentType() != "text/html") { + AtomicString content_type = frame.GetDocument()->contentType(); + if (content_type != "text/html" && content_type != "text/plain") { TRACE_EVENT_INSTANT("blink", "CheckSecurityRestrictions", "Result", "Invalid ContentType"); return false;
diff --git a/third_party/blink/renderer/core/fragment_directive/text_fragment_anchor_test.cc b/third_party/blink/renderer/core/fragment_directive/text_fragment_anchor_test.cc index cc34fae..5fb8771 100644 --- a/third_party/blink/renderer/core/fragment_directive/text_fragment_anchor_test.cc +++ b/third_party/blink/renderer/core/fragment_directive/text_fragment_anchor_test.cc
@@ -2179,7 +2179,7 @@ WebMouseEvent mouse_down_event(WebInputEvent::Type::kMouseDown, WebInputEvent::kNoModifiers, WebInputEvent::GetStaticTimeStampForTests()); - const DOMRect* middle_rect = middle_element->getBoundingClientRect(); + const DOMRect* middle_rect = middle_element->GetBoundingClientRect(); gfx::PointF middle_elem_point(((middle_rect->left() + 1)), ((middle_rect->top() + 1))); mouse_down_event.SetPositionInWidget(middle_elem_point.x(), @@ -2203,7 +2203,7 @@ EXPECT_TRUE(selection.SelectedText().empty()); // Create a mouse event at the center of <p> four. - const DOMRect* last_rect = last_element->getBoundingClientRect(); + const DOMRect* last_rect = last_element->GetBoundingClientRect(); gfx::PointF last_elem_point(((last_rect->left() + 1)), ((last_rect->top() + 1))); mouse_down_event.SetPositionInWidget(last_elem_point.x(),
diff --git a/third_party/blink/renderer/core/frame/browser_controls_test.cc b/third_party/blink/renderer/core/frame/browser_controls_test.cc index 35cd045..a60e19e 100644 --- a/third_party/blink/renderer/core/frame/browser_controls_test.cc +++ b/third_party/blink/renderer/core/frame/browser_controls_test.cc
@@ -953,8 +953,8 @@ // having 150px of height. Element* abs_pos = GetElementById(WebString::FromUTF8("abs")); Element* fixed_pos = GetElementById(WebString::FromUTF8("fixed")); - EXPECT_FLOAT_EQ(150.f, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(150.f, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(150.f, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(150.f, fixed_pos->GetBoundingClientRect()->height()); // The layout size on the LocalFrameView should not include the browser // controls. @@ -970,8 +970,8 @@ // Hiding the browser controls shouldn't change the height of the initial // containing block for non-position: fixed. Position: fixed however should // use the entire height of the viewport however. - EXPECT_FLOAT_EQ(150.f, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(200.f, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(150.f, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(200.f, fixed_pos->GetBoundingClientRect()->height()); // The layout size should not change as a result of browser controls hiding. EXPECT_EQ(300, GetFrame()->View()->GetLayoutSize().height()); @@ -1035,8 +1035,8 @@ false); Compositor().BeginFrame(); - EXPECT_FLOAT_EQ(200.f, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(200.f, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(200.f, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(200.f, fixed_pos->GetBoundingClientRect()->height()); EXPECT_EQ(400, GetDocument().GetFrame()->View()->GetLayoutSize().height()); @@ -1046,8 +1046,8 @@ cc::BrowserControlsState::kBoth, cc::BrowserControlsState::kBoth, false); Compositor().BeginFrame(); - EXPECT_FLOAT_EQ(150.f, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(200.f, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(150.f, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(200.f, fixed_pos->GetBoundingClientRect()->height()); EXPECT_EQ(300, GetDocument().GetFrame()->View()->GetLayoutSize().height()); @@ -1057,8 +1057,8 @@ WebView().ResizeWithBrowserControls(gfx::Size(400, 300), 100.f, 0, true); Compositor().BeginFrame(); - EXPECT_FLOAT_EQ(150.f, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(150.f, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(150.f, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(150.f, fixed_pos->GetBoundingClientRect()->height()); EXPECT_EQ(300, GetDocument().GetFrame()->View()->GetLayoutSize().height()); @@ -1069,8 +1069,8 @@ false); Compositor().BeginFrame(); - EXPECT_FLOAT_EQ(200.f, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(200.f, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(200.f, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(200.f, fixed_pos->GetBoundingClientRect()->height()); EXPECT_EQ(400, GetDocument().GetFrame()->View()->GetLayoutSize().height()); @@ -1088,8 +1088,8 @@ false); Compositor().BeginFrame(); - EXPECT_FLOAT_EQ(200.f, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(200.f, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(200.f, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(200.f, fixed_pos->GetBoundingClientRect()->height()); EXPECT_EQ(400, GetDocument().GetFrame()->View()->GetLayoutSize().height()); } @@ -1125,14 +1125,14 @@ GetDocument().getElementById(WebString::FromUTF8("sticky")); ASSERT_EQ(100.f, WebView().GetBrowserControls().ContentOffset()); ASSERT_EQ(300, GetDocument().GetFrame()->View()->GetLayoutSize().height()); - EXPECT_FLOAT_EQ(300.f, sticky_pos->getBoundingClientRect()->bottom()); + EXPECT_FLOAT_EQ(300.f, sticky_pos->GetBoundingClientRect()->bottom()); // Hide the browser controls. VerticalScroll(-100.f); WebView().ResizeWithBrowserControls(gfx::Size(400, 400), 100.f, 0, false); Compositor().BeginFrame(); ASSERT_EQ(300, GetDocument().GetFrame()->View()->GetLayoutSize().height()); - EXPECT_FLOAT_EQ(400.f, sticky_pos->getBoundingClientRect()->bottom()); + EXPECT_FLOAT_EQ(400.f, sticky_pos->GetBoundingClientRect()->bottom()); // Now lock the controls in a hidden state. The layout and elements should // resize without a WebView::resize. @@ -1141,7 +1141,7 @@ false); Compositor().BeginFrame(); EXPECT_EQ(400, GetDocument().GetFrame()->View()->GetLayoutSize().height()); - EXPECT_FLOAT_EQ(400.f, sticky_pos->getBoundingClientRect()->bottom()); + EXPECT_FLOAT_EQ(400.f, sticky_pos->GetBoundingClientRect()->bottom()); // Unlock the controls, the sizes should change even though the controls are // still hidden. @@ -1149,7 +1149,7 @@ cc::BrowserControlsState::kBoth, cc::BrowserControlsState::kBoth, false); Compositor().BeginFrame(); EXPECT_EQ(300, GetDocument().GetFrame()->View()->GetLayoutSize().height()); - EXPECT_FLOAT_EQ(400.f, sticky_pos->getBoundingClientRect()->bottom()); + EXPECT_FLOAT_EQ(400.f, sticky_pos->GetBoundingClientRect()->bottom()); // Now lock the controls in a shown state. Compositor().LayerTreeHost()->UpdateBrowserControlsState( @@ -1157,7 +1157,7 @@ WebView().ResizeWithBrowserControls(gfx::Size(400, 300), 100.f, 0, true); Compositor().BeginFrame(); EXPECT_EQ(300, GetDocument().GetFrame()->View()->GetLayoutSize().height()); - EXPECT_FLOAT_EQ(300.f, sticky_pos->getBoundingClientRect()->bottom()); + EXPECT_FLOAT_EQ(300.f, sticky_pos->GetBoundingClientRect()->bottom()); } // Ensure that browser controls do not affect "static" viewport units @@ -1181,8 +1181,8 @@ // controls are hidden. Element* abs_pos = GetElementById(WebString::FromUTF8("abs")); Element* fixed_pos = GetElementById(WebString::FromUTF8("fixed")); - EXPECT_FLOAT_EQ(param.height, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(param.height, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(param.height, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(param.height, fixed_pos->GetBoundingClientRect()->height()); // The size used for viewport units should not be reduced by the top // controls. @@ -1200,8 +1200,8 @@ // Static *vh units should be static with respect to the browser controls so // neither <div> should change size as a result of the browser controls // hiding. - EXPECT_FLOAT_EQ(param.height, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(param.height, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(param.height, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(param.height, fixed_pos->GetBoundingClientRect()->height()); // The viewport size used for static *vh units should not change as a result // of top controls hiding. @@ -1209,14 +1209,14 @@ GetFrame()->View()->LargeViewportSizeForViewportUnits().height()); // Static *vw units should not change when scrollbar disappears. - EXPECT_FLOAT_EQ(param.width, abs_pos->getBoundingClientRect()->width()); - EXPECT_FLOAT_EQ(param.width, fixed_pos->getBoundingClientRect()->width()); + EXPECT_FLOAT_EQ(param.width, abs_pos->GetBoundingClientRect()->width()); + EXPECT_FLOAT_EQ(param.width, fixed_pos->GetBoundingClientRect()->width()); Element* spacer = GetElementById(WebString::FromUTF8("spacer")); ASSERT_TRUE(spacer); spacer->remove(); UpdateAllLifecyclePhases(); - EXPECT_FLOAT_EQ(param.width, abs_pos->getBoundingClientRect()->width()); - EXPECT_FLOAT_EQ(param.width, fixed_pos->getBoundingClientRect()->width()); + EXPECT_FLOAT_EQ(param.width, abs_pos->GetBoundingClientRect()->width()); + EXPECT_FLOAT_EQ(param.width, fixed_pos->GetBoundingClientRect()->width()); } static ViewportUnitTestCase viewport_unit_test_cases[] = { @@ -1245,8 +1245,8 @@ // 'dvh' units should respond according to the current state of the controls. Element* abs_pos = GetElementById(WebString::FromUTF8("abs")); Element* fixed_pos = GetElementById(WebString::FromUTF8("fixed")); - EXPECT_FLOAT_EQ(150.f, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(150.f, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(150.f, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(150.f, fixed_pos->GetBoundingClientRect()->height()); // The size used for viewport units should not be reduced by the top // controls. @@ -1263,8 +1263,8 @@ // dvh units should be dynamic with respect to the browser controls so both // <div>s should change size as a result of the browser controls hiding. - EXPECT_FLOAT_EQ(200.f, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(200.f, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(200.f, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(200.f, fixed_pos->GetBoundingClientRect()->height()); // The viewport size used for dvh units should change as a result of top // controls hiding. @@ -1286,14 +1286,14 @@ GetFrame()->View()->DynamicViewportSizeForViewportUnits().height()); // dvw units should not change when scrollbar disappears. - EXPECT_FLOAT_EQ(200.f, abs_pos->getBoundingClientRect()->width()); - EXPECT_FLOAT_EQ(200.f, fixed_pos->getBoundingClientRect()->width()); + EXPECT_FLOAT_EQ(200.f, abs_pos->GetBoundingClientRect()->width()); + EXPECT_FLOAT_EQ(200.f, fixed_pos->GetBoundingClientRect()->width()); Element* spacer = GetElementById(WebString::FromUTF8("spacer")); ASSERT_TRUE(spacer); spacer->remove(); UpdateAllLifecyclePhases(); - EXPECT_FLOAT_EQ(200.f, abs_pos->getBoundingClientRect()->width()); - EXPECT_FLOAT_EQ(200.f, fixed_pos->getBoundingClientRect()->width()); + EXPECT_FLOAT_EQ(200.f, abs_pos->GetBoundingClientRect()->width()); + EXPECT_FLOAT_EQ(200.f, fixed_pos->GetBoundingClientRect()->width()); } // Ensure that on a legacy page (there's a non-1 minimum scale) 100vh units fill @@ -1321,8 +1321,8 @@ // so we expect 50vh to be 400px. Element* abs_pos = GetElementById(WebString::FromUTF8("abs")); Element* fixed_pos = GetElementById(WebString::FromUTF8("fixed")); - EXPECT_FLOAT_EQ(400.f, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(400.f, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(400.f, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(400.f, fixed_pos->GetBoundingClientRect()->height()); // The size used for viewport units should not be reduced by the top // controls. @@ -1338,8 +1338,8 @@ // vh units should be static with respect to the browser controls so neighter // <div> should change size are a result of the browser controls hiding. - EXPECT_FLOAT_EQ(400.f, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(400.f, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(400.f, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(400.f, fixed_pos->GetBoundingClientRect()->height()); // The viewport size used for vh units should not change as a result of top // controls hiding. @@ -1394,8 +1394,8 @@ Element* abs_pos = GetElementById(WebString::FromUTF8("abs")); Element* fixed_pos = GetElementById(WebString::FromUTF8("fixed")); float div_height = 0.5f * (300 + (100 - 20)); - EXPECT_FLOAT_EQ(div_height, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(div_height, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(div_height, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(div_height, fixed_pos->GetBoundingClientRect()->height()); // The size used for viewport units should be reduced by the top controls // min-height. @@ -1412,8 +1412,8 @@ // vh units should be static with respect to the browser controls so neither // <div> should change size are a result of the browser controls hiding. - EXPECT_FLOAT_EQ(190.f, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(190.f, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(190.f, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(190.f, fixed_pos->GetBoundingClientRect()->height()); // The viewport size used for vh units should not change as a result of top // controls hiding. @@ -1443,8 +1443,8 @@ Element* abs_pos = GetElementById(WebString::FromUTF8("abs")); Element* fixed_pos = GetElementById(WebString::FromUTF8("fixed")); float div_height = 0.5f * (250 + (100 - 20) + (50 - 10)); - EXPECT_FLOAT_EQ(div_height, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(div_height, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(div_height, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(div_height, fixed_pos->GetBoundingClientRect()->height()); // The size used for viewport units should be reduced by the top/bottom // controls min-height. @@ -1462,8 +1462,8 @@ // vh units should be static with respect to the browser controls so neither // <div> should change size are a result of the browser controls hiding. - EXPECT_FLOAT_EQ(185.f, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(185.f, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(185.f, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(185.f, fixed_pos->GetBoundingClientRect()->height()); // The viewport size used for vh units should not change as a result of the // controls hiding. @@ -1492,8 +1492,8 @@ Element* abs_pos = GetElementById(WebString::FromUTF8("abs")); Element* fixed_pos = GetElementById(WebString::FromUTF8("fixed")); float div_height = 0.5f * (250 + (100 - 20) + (50 - 10)); - EXPECT_FLOAT_EQ(div_height, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(div_height, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(div_height, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(div_height, fixed_pos->GetBoundingClientRect()->height()); // The size used for viewport units should be reduced by the top/bottom // controls min-height. @@ -1671,8 +1671,8 @@ // Make sure we're not adding the browser controls height to the vh units // as when they're locked to hidden, the ICB fills the entire viewport // already. - EXPECT_FLOAT_EQ(200.f, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(200.f, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(200.f, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(200.f, fixed_pos->GetBoundingClientRect()->height()); EXPECT_EQ( 400, GetDocument().View()->LargeViewportSizeForViewportUnits().height()); @@ -1692,8 +1692,8 @@ // Make sure we're not adding the browser controls height to the vh units as // when they're locked to shown, the ICB fills the entire viewport already. - EXPECT_FLOAT_EQ(150.f, abs_pos->getBoundingClientRect()->height()); - EXPECT_FLOAT_EQ(150.f, fixed_pos->getBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(150.f, abs_pos->GetBoundingClientRect()->height()); + EXPECT_FLOAT_EQ(150.f, fixed_pos->GetBoundingClientRect()->height()); EXPECT_EQ( 400, GetDocument().View()->LargeViewportSizeForViewportUnits().height());
diff --git a/third_party/blink/renderer/core/frame/deprecation/deprecation.cc b/third_party/blink/renderer/core/frame/deprecation/deprecation.cc index f5975e6f..448c33f 100644 --- a/third_party/blink/renderer/core/frame/deprecation/deprecation.cc +++ b/third_party/blink/renderer/core/frame/deprecation/deprecation.cc
@@ -25,6 +25,7 @@ #include "third_party/blink/renderer/core/page/page.h" #include "third_party/blink/renderer/core/workers/worker_or_worklet_global_scope.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" +#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" namespace blink { @@ -45,9 +46,10 @@ std::unique_ptr<SourceLocation> source_location = CaptureSourceLocation(context); frame->GetLocalFrameHostRemote().SendLegacyTechEvent( - info.type_, mojom::blink::LegacyTechEventCodeLocation::New( - source_location->Url(), source_location->LineNumber(), - source_location->ColumnNumber())); + info.type_, + mojom::blink::LegacyTechEventCodeLocation::New( + source_location->Url() ? source_location->Url() : String(""), + source_location->LineNumber(), source_location->ColumnNumber())); } } }
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.cc b/third_party/blink/renderer/core/frame/local_frame_view.cc index 079954437..36687676 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.cc +++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -105,6 +105,7 @@ #include "third_party/blink/renderer/core/intersection_observer/intersection_observation.h" #include "third_party/blink/renderer/core/intersection_observer/intersection_observer_controller.h" #include "third_party/blink/renderer/core/layout/adjust_for_absolute_zoom.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/geometry/transform_state.h" #include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h" #include "third_party/blink/renderer/core/layout/layout_counter.h" @@ -112,9 +113,8 @@ #include "third_party/blink/renderer/core/layout/layout_embedded_object.h" #include "third_party/blink/renderer/core/layout/layout_shift_tracker.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_root.h" #include "third_party/blink/renderer/core/layout/text_autosizer.h" #include "third_party/blink/renderer/core/layout/traced_layout_object.h"
diff --git a/third_party/blink/renderer/core/frame/web_frame_test.cc b/third_party/blink/renderer/core/frame/web_frame_test.cc index 3bb97dc..650ebab 100644 --- a/third_party/blink/renderer/core/frame/web_frame_test.cc +++ b/third_party/blink/renderer/core/frame/web_frame_test.cc
@@ -12801,10 +12801,10 @@ ->ScrollFocusedEditableElementIntoView(); Element* input = GetDocument().getElementById(AtomicString("target")); - gfx::Rect input_rect(input->getBoundingClientRect()->top(), - input->getBoundingClientRect()->left(), - input->getBoundingClientRect()->width(), - input->getBoundingClientRect()->height()); + gfx::Rect input_rect(input->GetBoundingClientRect()->top(), + input->GetBoundingClientRect()->left(), + input->GetBoundingClientRect()->width(), + input->GetBoundingClientRect()->height()); gfx::Rect visible_content_rect(frame_view->Size()); EXPECT_TRUE(visible_content_rect.Contains(input_rect)) @@ -12926,7 +12926,7 @@ ScrollOffset(2000 - 440, 3000 - 450), mojom::blink::ScrollType::kProgrammatic); Element* target = GetDocument().QuerySelector(AtomicString("#target")); - DOMRect* rect = target->getBoundingClientRect(); + DOMRect* rect = target->GetBoundingClientRect(); ASSERT_EQ(440, rect->left()); ASSERT_EQ(450, rect->top());
diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_test.cc b/third_party/blink/renderer/core/frame/web_frame_widget_test.cc index 3591b91..814f57d 100644 --- a/third_party/blink/renderer/core/frame/web_frame_widget_test.cc +++ b/third_party/blink/renderer/core/frame/web_frame_widget_test.cc
@@ -967,7 +967,7 @@ second->SetValue("ABCD EFGH"); second->Focus(); gfx::Point origin = - second->getBoundingClientRect()->ToEnclosingRect().origin(); + second->GetBoundingClientRect()->ToEnclosingRect().origin(); widget->UpdateAllLifecyclePhases(DocumentUpdateReason::kTest); expected = Vector({gfx::Rect(origin.x(), origin.y(), 90, 10)}); actual = widget->GetVisibleLineBoundsOnScreen(); @@ -1335,7 +1335,7 @@ // Focus the element and check the line bounds. first->Focus(); gfx::Point origin = - first->getBoundingClientRect()->ToEnclosingRect().origin(); + first->GetBoundingClientRect()->ToEnclosingRect().origin(); String text = "hello world"; for (wtf_size_t i = 0; i < text.length(); ++i) { first->SetValue(first->Value() + text[i]); @@ -1401,7 +1401,7 @@ first->Focus(); first->SetValue("hello world\rgoodbye world"); gfx::Point origin = - first->getBoundingClientRect()->ToEnclosingRect().origin(); + first->GetBoundingClientRect()->ToEnclosingRect().origin(); String last_line = "goodbye world"; for (wtf_size_t i = last_line.length() - 1; i > 0; --i) {
diff --git a/third_party/blink/renderer/core/html/forms/file_input_type.cc b/third_party/blink/renderer/core/html/forms/file_input_type.cc index 52621e2..3f91980a 100644 --- a/third_party/blink/renderer/core/html/forms/file_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/file_input_type.cc
@@ -39,7 +39,7 @@ #include "third_party/blink/renderer/core/input_type_names.h" #include "third_party/blink/renderer/core/inspector/console_message.h" #include "third_party/blink/renderer/core/keywords.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/page/chrome_client.h" #include "third_party/blink/renderer/core/page/drag_data.h" #include "third_party/blink/renderer/core/probe/core_probes.h"
diff --git a/third_party/blink/renderer/core/html/forms/html_input_element.cc b/third_party/blink/renderer/core/html/forms/html_input_element.cc index 964f247..594b7b5f 100644 --- a/third_party/blink/renderer/core/html/forms/html_input_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_input_element.cc
@@ -1218,7 +1218,7 @@ } // Prevent fade out and displaying strong password label in narrow forms. - if (getBoundingClientRect()->width() < kMinStrongPasswordLabelWidth) { + if (GetBoundingClientRect()->width() < kMinStrongPasswordLabelWidth) { should_show_strong_password_label_ = false; } const AtomicString fade_out("fade-out-password");
diff --git a/third_party/blink/renderer/core/html/forms/html_select_element.cc b/third_party/blink/renderer/core/html/forms/html_select_element.cc index fc51897..098ae33 100644 --- a/third_party/blink/renderer/core/html/forms/html_select_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_select_element.cc
@@ -62,8 +62,8 @@ #include "third_party/blink/renderer/core/layout/flex/layout_flexible_box.h" #include "third_party/blink/renderer/core/layout/hit_test_request.h" #include "third_party/blink/renderer/core/layout/hit_test_result.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_theme.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/page/chrome_client.h" #include "third_party/blink/renderer/core/page/page.h" #include "third_party/blink/renderer/core/page/spatial_navigation.h"
diff --git a/third_party/blink/renderer/core/html/forms/input_type_view.cc b/third_party/blink/renderer/core/html/forms/input_type_view.cc index 7f764c4..5e8805f9 100644 --- a/third_party/blink/renderer/core/html/forms/input_type_view.cc +++ b/third_party/blink/renderer/core/html/forms/input_type_view.cc
@@ -36,7 +36,7 @@ #include "third_party/blink/renderer/core/html/forms/form_controller.h" #include "third_party/blink/renderer/core/html/forms/html_form_element.h" #include "third_party/blink/renderer/core/html/forms/html_input_element.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/html/forms/password_input_type.cc b/third_party/blink/renderer/core/html/forms/password_input_type.cc index 4d4636e..3fd15d38 100644 --- a/third_party/blink/renderer/core/html/forms/password_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/password_input_type.cc
@@ -194,7 +194,7 @@ 0.7; // 0.7em which is enough for ~2 chars. const int kLeftMarginPx = 3; // 3px const int kRightMarginPx = 3; // 3px - float current_width = GetElement().getBoundingClientRect()->width(); + float current_width = GetElement().GetBoundingClientRect()->width(); float width_needed = GetElement().ComputedStyleRef().FontSize() * (kRevealButtonWidthEm + kPasswordMinWidthEm) + kLeftMarginPx + kRightMarginPx;
diff --git a/third_party/blink/renderer/core/html/forms/slider_thumb_element.cc b/third_party/blink/renderer/core/html/forms/slider_thumb_element.cc index 88048a5..1ad1a14 100644 --- a/third_party/blink/renderer/core/html/forms/slider_thumb_element.cc +++ b/third_party/blink/renderer/core/html/forms/slider_thumb_element.cc
@@ -44,8 +44,8 @@ #include "third_party/blink/renderer/core/html/shadow/shadow_element_names.h" #include "third_party/blink/renderer/core/input/event_handler.h" #include "third_party/blink/renderer/core/layout/flex/layout_flexible_box.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_theme.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" #include "ui/base/ui_base_features.h" namespace blink {
diff --git a/third_party/blink/renderer/core/html/forms/slider_track_element.cc b/third_party/blink/renderer/core/html/forms/slider_track_element.cc index 372995f..7c3ebb7 100644 --- a/third_party/blink/renderer/core/html/forms/slider_track_element.cc +++ b/third_party/blink/renderer/core/html/forms/slider_track_element.cc
@@ -4,7 +4,7 @@ #include "third_party/blink/renderer/core/html/forms/slider_track_element.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/html/html_details_element.cc b/third_party/blink/renderer/core/html/html_details_element.cc index 4db6715..c15330c 100644 --- a/third_party/blink/renderer/core/html/html_details_element.cc +++ b/third_party/blink/renderer/core/html/html_details_element.cc
@@ -38,7 +38,7 @@ #include "third_party/blink/renderer/core/html/html_summary_element.h" #include "third_party/blink/renderer/core/html/shadow/shadow_element_names.h" #include "third_party/blink/renderer/core/html_names.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
diff --git a/third_party/blink/renderer/core/html/html_frame_set_element.cc b/third_party/blink/renderer/core/html/html_frame_set_element.cc index 51fc3e51..a0d14a5e 100644 --- a/third_party/blink/renderer/core/html/html_frame_set_element.cc +++ b/third_party/blink/renderer/core/html/html_frame_set_element.cc
@@ -39,7 +39,7 @@ #include "third_party/blink/renderer/core/input/event_handler.h" #include "third_party/blink/renderer/core/layout/layout_frame_set.h" #include "third_party/blink/renderer/core/layout/ng/frame_set_layout_data.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/instrumentation/use_counter.h" namespace blink {
diff --git a/third_party/blink/renderer/core/html/html_image_element.cc b/third_party/blink/renderer/core/html/html_image_element.cc index fe7e59bb2..58b8a0bd 100644 --- a/third_party/blink/renderer/core/html/html_image_element.cc +++ b/third_party/blink/renderer/core/html/html_image_element.cc
@@ -57,7 +57,7 @@ #include "third_party/blink/renderer/core/layout/adjust_for_absolute_zoom.h" #include "third_party/blink/renderer/core/layout/layout_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_image.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/lcp_critical_path_predictor/lcp_critical_path_predictor.h" #include "third_party/blink/renderer/core/loader/resource/image_resource_content.h" #include "third_party/blink/renderer/core/media_type_names.h"
diff --git a/third_party/blink/renderer/core/html/image_document_test.cc b/third_party/blink/renderer/core/html/image_document_test.cc index a0a2cf5c..40bb49f 100644 --- a/third_party/blink/renderer/core/html/image_document_test.cc +++ b/third_party/blink/renderer/core/html/image_document_test.cc
@@ -367,7 +367,7 @@ Compositor().BeginFrame(); HTMLImageElement* img = GetDocument().ImageElement(); - DOMRect* rect = img->getBoundingClientRect(); + DOMRect* rect = img->GetBoundingClientRect(); // Some initial sanity checking. We'll use the BoundingClientRect for the // image location since that's relative to the layout viewport and the layout @@ -384,7 +384,7 @@ // layout size so the image location shouldn't change. WebView().ResizeWithBrowserControls(gfx::Size(5, 50), 10, 10, false); Compositor().BeginFrame(); - rect = img->getBoundingClientRect(); + rect = img->GetBoundingClientRect(); EXPECT_EQ(50, rect->width()); EXPECT_EQ(50, rect->height()); EXPECT_EQ(0, rect->x()); @@ -457,7 +457,7 @@ EXPECT_EQ(1.f, GetVisualViewport().Scale()); EXPECT_EQ(100, GetVisualViewport().Width()); EXPECT_EQ(100, GetVisualViewport().Height()); - DOMRect* rect = img->getBoundingClientRect(); + DOMRect* rect = img->GetBoundingClientRect(); EXPECT_EQ(25, rect->x()); EXPECT_EQ(25, rect->y()); @@ -482,7 +482,7 @@ EXPECT_EQ(0.1f, GetVisualViewport().Scale()); EXPECT_EQ(20, GetVisualViewport().Width()); EXPECT_EQ(100, GetVisualViewport().Height()); - rect = img->getBoundingClientRect(); + rect = img->GetBoundingClientRect(); EXPECT_EQ(0, rect->x()); EXPECT_EQ(40, rect->y()); }
diff --git a/third_party/blink/renderer/core/html/keywords.json5 b/third_party/blink/renderer/core/html/keywords.json5 index d57b7b09..b436b9f0 100644 --- a/third_party/blink/renderer/core/html/keywords.json5 +++ b/third_party/blink/renderer/core/html/keywords.json5
@@ -88,7 +88,7 @@ "playpause", "pause", "play", - "mute", + "toggleMuted", // loading attribute // https://github.com/scott-little/lazyload#ways-the-loading-attribute-can-be-used
diff --git a/third_party/blink/renderer/core/html/media/html_media_element.cc b/third_party/blink/renderer/core/html/media/html_media_element.cc index 721191d..6d71d6af 100644 --- a/third_party/blink/renderer/core/html/media/html_media_element.cc +++ b/third_party/blink/renderer/core/html/media/html_media_element.cc
@@ -1458,7 +1458,7 @@ if (!(EqualIgnoringASCIICase(action, keywords::kPlaypause) || EqualIgnoringASCIICase(action, keywords::kPause) || EqualIgnoringASCIICase(action, keywords::kPlay) || - EqualIgnoringASCIICase(action, keywords::kMute))) { + EqualIgnoringASCIICase(action, keywords::kToggleMuted))) { return false; } Document& document = GetDocument(); @@ -1499,7 +1499,7 @@ } return true; } else { - CHECK(EqualIgnoringASCIICase(action, keywords::kMute)); + CHECK(EqualIgnoringASCIICase(action, keywords::kToggleMuted)); // No user activation check as `setMuted` already handles the autoplay // policy check. setMuted(!muted_);
diff --git a/third_party/blink/renderer/core/html/track/text_track_container.cc b/third_party/blink/renderer/core/html/track/text_track_container.cc index 6ea0e8e..2d4621cb 100644 --- a/third_party/blink/renderer/core/html/track/text_track_container.cc +++ b/third_party/blink/renderer/core/html/track/text_track_container.cc
@@ -33,8 +33,8 @@ #include "third_party/blink/renderer/core/html/media/html_video_element.h" #include "third_party/blink/renderer/core/html/track/cue_timeline.h" #include "third_party/blink/renderer/core/html/track/text_track.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_video.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/resize_observer/resize_observer.h" #include "third_party/blink/renderer/core/resize_observer/resize_observer_entry.h" #include "ui/accessibility/accessibility_features.h"
diff --git a/third_party/blink/renderer/core/html/track/vtt/vtt_cue_box.cc b/third_party/blink/renderer/core/html/track/vtt/vtt_cue_box.cc index be85714..e861f27 100644 --- a/third_party/blink/renderer/core/html/track/vtt/vtt_cue_box.cc +++ b/third_party/blink/renderer/core/html/track/vtt/vtt_cue_box.cc
@@ -34,7 +34,7 @@ #include "third_party/blink/renderer/core/html/track/text_track_container.h" #include "third_party/blink/renderer/core/html/track/vtt/vtt_cue.h" #include "third_party/blink/renderer/core/html/track/vtt/vtt_cue_layout_algorithm.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/resize_observer/resize_observer.h" #include "third_party/blink/renderer/core/resize_observer/resize_observer_entry.h" #include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
diff --git a/third_party/blink/renderer/core/html/track/vtt/vtt_region.cc b/third_party/blink/renderer/core/html/track/vtt/vtt_region.cc index 24fe699..0aa51653 100644 --- a/third_party/blink/renderer/core/html/track/vtt/vtt_region.cc +++ b/third_party/blink/renderer/core/html/track/vtt/vtt_region.cc
@@ -286,7 +286,7 @@ DVLOG(VTT_LOG_LEVEL) << "willRemoveVTTCueBox"; DCHECK(cue_container_->contains(box)); - double box_height = box->getBoundingClientRect()->height(); + double box_height = box->GetBoundingClientRect()->height(); cue_container_->classList().Remove(TextTrackCueContainerScrollingClass()); @@ -321,11 +321,11 @@ cue_container_->classList().Add(TextTrackCueContainerScrollingClass()); double region_bottom = - region_display_tree_->getBoundingClientRect()->bottom(); + region_display_tree_->GetBoundingClientRect()->bottom(); // Find first cue that is not entirely displayed and scroll it upwards. for (Element& child : ElementTraversal::ChildrenOf(*cue_container_)) { - DOMRect* client_rect = child.getBoundingClientRect(); + DOMRect* client_rect = child.GetBoundingClientRect(); double child_bottom = client_rect->bottom(); if (region_bottom >= child_bottom)
diff --git a/third_party/blink/renderer/core/inspector/inspector_highlight.cc b/third_party/blink/renderer/core/inspector/inspector_highlight.cc index 9d29c80d..47d6b06 100644 --- a/third_party/blink/renderer/core/inspector/inspector_highlight.cc +++ b/third_party/blink/renderer/core/inspector/inspector_highlight.cc
@@ -34,7 +34,7 @@ #include "third_party/blink/renderer/core/layout/layout_object.h" #include "third_party/blink/renderer/core/layout/layout_view.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/shapes/shape_outside_info.h" #include "third_party/blink/renderer/core/page/chrome_client.h" #include "third_party/blink/renderer/core/page/page.h" @@ -380,7 +380,7 @@ if (!layout_object || !containing_view) return element_info; - // layoutObject the getBoundingClientRect() data in the tooltip + // layoutObject the GetBoundingClientRect() data in the tooltip // to be consistent with the rulers (see http://crbug.com/262338). DCHECK(element->GetDocument().Lifecycle().GetState() >=
diff --git a/third_party/blink/renderer/core/inspector/inspector_page_agent.cc b/third_party/blink/renderer/core/inspector/inspector_page_agent.cc index 73b5bffa..5236173 100644 --- a/third_party/blink/renderer/core/inspector/inspector_page_agent.cc +++ b/third_party/blink/renderer/core/inspector/inspector_page_agent.cc
@@ -296,14 +296,9 @@ *result = Base64Encode(base::as_bytes(base::make_span(buffer_data, buffer_size))); *base64_encoded = true; - } else if (text_content.IsNull()) { + } else { *result = ""; *base64_encoded = false; - } else { - DCHECK(!text_content.Is8Bit()); - *result = Base64Encode( - base::as_bytes(base::make_span(StringUTF8Adaptor(text_content)))); - *base64_encoded = true; } }
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_node.cc b/third_party/blink/renderer/core/layout/block_node.cc similarity index 98% rename from third_party/blink/renderer/core/layout/ng/ng_block_node.cc rename to third_party/blink/renderer/core/layout/block_node.cc index b680e17..ee59ec9 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_node.cc +++ b/third_party/blink/renderer/core/layout/block_node.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include <memory> @@ -12,6 +12,8 @@ #include "third_party/blink/renderer/core/html/forms/html_input_element.h" #include "third_party/blink/renderer/core/html/html_marquee_element.h" #include "third_party/blink/renderer/core/input_type_names.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/custom/custom_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/custom/layout_custom.h" #include "third_party/blink/renderer/core/layout/flex/flex_layout_algorithm.h" @@ -24,11 +26,14 @@ #include "third_party/blink/renderer/core/layout/intrinsic_sizing_info.h" #include "third_party/blink/renderer/core/layout/layout_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_inline.h" +#include "third_party/blink/renderer/core/layout/layout_input_node.h" #include "third_party/blink/renderer/core/layout/layout_multi_column_flow_thread.h" #include "third_party/blink/renderer/core/layout/layout_multi_column_set.h" #include "third_party/blink/renderer/core/layout/layout_multi_column_spanner_placeholder.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_video.h" #include "third_party/blink/renderer/core/layout/layout_view.h" +#include "third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h" #include "third_party/blink/renderer/core/layout/list/layout_list_item.h" #include "third_party/blink/renderer/core/layout/mathml/math_fraction_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/mathml/math_layout_utils.h" @@ -41,28 +46,23 @@ #include "third_party/blink/renderer/core/layout/mathml/math_token_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/mathml/math_under_over_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/min_max_sizes.h" -#include "third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_disable_side_effects_scope.h" #include "third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment_repeater.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_frame_set_layout_algorithm.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_layout_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_page_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/ng/ng_replaced_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/ng/ng_simplified_layout_algorithm.h" -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" #include "third_party/blink/renderer/core/layout/shapes/shape_outside_info.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" #include "third_party/blink/renderer/core/layout/table/layout_table_cell.h" #include "third_party/blink/renderer/core/layout/table/table_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/table/table_row_layout_algorithm.h" @@ -780,6 +780,9 @@ // Computing MinMax after layout. Do not modify the |LayoutObject| tree, paint // properties, and other global states. if (DisableLayoutSideEffectsScope::IsDisabled()) { + if (RuntimeEnabledFeatures::LayoutNewMeasureCacheEnabled()) { + box_->AddMeasureLayoutResult(layout_result); + } return; }
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_node.h b/third_party/blink/renderer/core/layout/block_node.h similarity index 97% rename from third_party/blink/renderer/core/layout/ng/ng_block_node.h rename to third_party/blink/renderer/core/layout/block_node.h index 9312de8..6bd07f5 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_node.h +++ b/third_party/blink/renderer/core/layout/block_node.h
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_BLOCK_NODE_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_BLOCK_NODE_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_BLOCK_NODE_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_BLOCK_NODE_H_ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/layout/geometry/physical_offset.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h" +#include "third_party/blink/renderer/core/layout/layout_input_node.h" #include "third_party/blink/renderer/platform/fonts/font_baseline.h" #include "third_party/blink/renderer/platform/wtf/casting.h" @@ -314,4 +314,4 @@ WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::BlockNode) -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_BLOCK_NODE_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_BLOCK_NODE_H_
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_node_test.cc b/third_party/blink/renderer/core/layout/block_node_test.cc similarity index 97% rename from third_party/blink/renderer/core/layout/ng/ng_block_node_test.cc rename to third_party/blink/renderer/core/layout/block_node_test.cc index e057049..61cc1d6 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_node_test.cc +++ b/third_party/blink/renderer/core/layout/block_node_test.cc
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/min_max_sizes.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/build.gni b/third_party/blink/renderer/core/layout/build.gni index 6833d6e..0944652 100644 --- a/third_party/blink/renderer/core/layout/build.gni +++ b/third_party/blink/renderer/core/layout/build.gni
@@ -18,10 +18,10 @@ blink_core_hot_sources_layout = [ "layout_block_flow_hot.cc", "layout_box_hot.cc", + "layout_ng_block_flow.cc", + "layout_ng_block_flow.h", "layout_object_hot.cc", "layout_object_inl.h", - "ng/layout_ng_block_flow.cc", - "ng/layout_ng_block_flow.h", "text_autosizer.cc", "text_autosizer.h", ] @@ -30,6 +30,12 @@ "anchor_position_scroll_data.cc", "anchor_position_scroll_data.h", "background_bleed_avoidance.h", + "block_node.cc", + "block_node.h", + "constraint_space.cc", + "constraint_space.h", + "constraint_space_builder.cc", + "constraint_space_builder.h", "content_change_type.h", "counter_node.cc", "counter_node.h", @@ -168,6 +174,8 @@ "hit_test_request.h", "hit_test_result.cc", "hit_test_result.h", + "ink_overflow.cc", + "ink_overflow.h", "inline/abstract_inline_text_box.cc", "inline/abstract_inline_text_box.h", "inline/caret_position.cc", @@ -288,6 +296,8 @@ "layout_image_resource_style_image.h", "layout_inline.cc", "layout_inline.h", + "layout_input_node.cc", + "layout_input_node.h", "layout_media.cc", "layout_media.h", "layout_multi_column_flow_thread.cc", @@ -307,6 +317,8 @@ "layout_quote.h", "layout_replaced.cc", "layout_replaced.h", + "layout_result.cc", + "layout_result.h", "layout_ruby.cc", "layout_ruby.h", "layout_ruby_as_block.cc", @@ -347,6 +359,7 @@ "layout_view_transition_root.h", "layout_word_break.cc", "layout_word_break.h", + "legacy_layout_tree_walking.h", "list/layout_inline_list_item.cc", "list/layout_inline_list_item.h", "list/layout_inside_list_marker.cc", @@ -391,6 +404,8 @@ "mathml/math_under_over_layout_algorithm.cc", "mathml/math_under_over_layout_algorithm.h", "mathml/mathml_paint_info.h", + "measure_cache.cc", + "measure_cache.h", "min_max_sizes.cc", "min_max_sizes.h", "min_max_sizes_cache.h", @@ -399,7 +414,6 @@ "ng/frame_set_layout_data.h", "ng/layout_box_utils.cc", "ng/layout_box_utils.h", - "ng/legacy_layout_tree_walking.h", "ng/ng_absolute_utils.cc", "ng/ng_absolute_utils.h", "ng/ng_anchor_query.cc", @@ -416,8 +430,6 @@ "ng/ng_block_layout_algorithm.h", "ng/ng_block_layout_algorithm_utils.cc", "ng/ng_block_layout_algorithm_utils.h", - "ng/ng_block_node.cc", - "ng/ng_block_node.h", "ng/ng_box_fragment.cc", "ng/ng_box_fragment.h", "ng/ng_box_fragment_builder.cc", @@ -428,10 +440,6 @@ "ng/ng_column_layout_algorithm.cc", "ng/ng_column_layout_algorithm.h", "ng/ng_column_spanner_path.h", - "ng/ng_constraint_space.cc", - "ng/ng_constraint_space.h", - "ng/ng_constraint_space_builder.cc", - "ng/ng_constraint_space_builder.h", "ng/ng_disable_side_effects_scope.cc", "ng/ng_disable_side_effects_scope.h", "ng/ng_early_break.h", @@ -449,34 +457,18 @@ "ng/ng_fragmentation_utils.h", "ng/ng_frame_set_layout_algorithm.cc", "ng/ng_frame_set_layout_algorithm.h", - "ng/ng_ink_overflow.cc", - "ng/ng_ink_overflow.h", "ng/ng_layout_algorithm.h", - "ng/ng_layout_input_node.cc", - "ng/ng_layout_input_node.h", - "ng/ng_layout_overflow_calculator.cc", - "ng/ng_layout_overflow_calculator.h", - "ng/ng_layout_result.cc", - "ng/ng_layout_result.h", "ng/ng_layout_utils.cc", "ng/ng_layout_utils.h", "ng/ng_length_utils.cc", "ng/ng_length_utils.h", - "ng/ng_link.h", "ng/ng_logical_link.h", "ng/ng_out_of_flow_layout_part.cc", "ng/ng_out_of_flow_layout_part.h", "ng/ng_out_of_flow_positioned_node.cc", "ng/ng_out_of_flow_positioned_node.h", - "ng/ng_outline_type.h", - "ng/ng_outline_utils.cc", - "ng/ng_outline_utils.h", "ng/ng_page_layout_algorithm.cc", "ng/ng_page_layout_algorithm.h", - "ng/ng_physical_box_fragment.cc", - "ng/ng_physical_box_fragment.h", - "ng/ng_physical_fragment.cc", - "ng/ng_physical_fragment.h", "ng/ng_positioned_float.cc", "ng/ng_positioned_float.h", "ng/ng_relative_utils.cc", @@ -487,23 +479,29 @@ "ng/ng_simplified_layout_algorithm.h", "ng/ng_simplified_oof_layout_algorithm.cc", "ng/ng_simplified_oof_layout_algorithm.h", - "ng/ng_space_utils.cc", - "ng/ng_space_utils.h", - "ng/ng_text_decoration_offset.cc", - "ng/ng_text_decoration_offset.h", "ng/ng_unpositioned_float.h", "ng/non_overflowing_scroll_range.h", - "ng/physical_fragment_rare_data.cc", - "ng/physical_fragment_rare_data.h", "outline_rect_collector.cc", "outline_rect_collector.h", + "outline_type.h", + "outline_utils.cc", + "outline_utils.h", "overflow_model.h", + "physical_box_fragment.cc", + "physical_box_fragment.h", + "physical_fragment.cc", + "physical_fragment.h", + "physical_fragment_link.h", + "physical_fragment_rare_data.cc", + "physical_fragment_rare_data.h", "pointer_events_hit_rules.cc", "pointer_events_hit_rules.h", "ruby_container.cc", "ruby_container.h", "scroll_anchor.cc", "scroll_anchor.h", + "scrollable_overflow_calculator.cc", + "scrollable_overflow_calculator.h", "selection_state.cc", "selection_state.h", "shapes/box_shape.cc", @@ -519,6 +517,8 @@ "shapes/shape_interval.h", "shapes/shape_outside_info.cc", "shapes/shape_outside_info.h", + "space_utils.cc", + "space_utils.h", "svg/layout_svg_block.cc", "svg/layout_svg_block.h", "svg/layout_svg_container.cc", @@ -634,6 +634,8 @@ "table/table_row_layout_algorithm.h", "table/table_section_layout_algorithm.cc", "table/table_section_layout_algorithm.h", + "text_decoration_offset.cc", + "text_decoration_offset.h", "text_utils.cc", "text_utils.h", "traced_layout_object.cc", @@ -689,6 +691,8 @@ blink_core_tests_layout = [ "anchor_position_scroll_data_test.cc", + "block_node_test.cc", + "constraint_space_builder_test.cc", "custom/layout_worklet_test.cc", "exclusions/exclusion_space_test.cc", "flex/flex_layout_algorithm_test.cc", @@ -705,6 +709,7 @@ "grid/grid_layout_algorithm_test.cc", "grid/grid_track_collection_test.cc", "hit_testing_test.cc", + "ink_overflow_test.cc", "inline/abstract_inline_text_box_test.cc", "inline/caret_position_test.cc", "inline/fragment_item_test.cc", @@ -733,6 +738,7 @@ "layout_image_test.cc", "layout_image_resource_test.cc", "layout_inline_test.cc", + "layout_input_node_test.cc", "layout_media_test.cc", "layout_multi_column_flow_thread_test.cc", "layout_multi_column_set_test.cc", @@ -740,6 +746,7 @@ "layout_progress_test.cc", "layout_quote_test.cc", "layout_replaced_test.cc", + "layout_result_caching_test.cc", "layout_ruby_column_test.cc", "layout_shift_region_test.cc", "layout_shift_tracker_test.cc", @@ -762,23 +769,18 @@ "ng/ng_base_layout_algorithm_test.h", "ng/ng_block_child_iterator_test.cc", "ng/ng_block_layout_algorithm_test.cc", - "ng/ng_block_node_test.cc", "ng/ng_column_layout_algorithm_test.cc", - "ng/ng_constraint_space_builder_test.cc", "ng/ng_fieldset_layout_algorithm_test.cc", "ng/ng_fragmentation_test.cc", - "ng/ng_ink_overflow_test.cc", "ng/ng_inline_layout_test.cc", - "ng/ng_layout_input_node_test.cc", - "ng/ng_layout_result_caching_test.cc", "ng/ng_length_utils_test.cc", "ng/ng_out_of_flow_layout_part_test.cc", - "ng/ng_physical_box_fragment_test.cc", - "ng/ng_physical_fragment_test.cc", "ng/ng_relative_utils_test.cc", "outline_rect_collector_test.cc", "overflow_model_test.cc", "paint_containment_test.cc", + "physical_box_fragment_test.cc", + "physical_fragment_test.cc", "scroll_anchor_test.cc", "scrollbars_test.cc", "selection_state_test.cc",
diff --git a/third_party/blink/renderer/core/layout/ng/ng_constraint_space.cc b/third_party/blink/renderer/core/layout/constraint_space.cc similarity index 85% rename from third_party/blink/renderer/core/layout/ng/ng_constraint_space.cc rename to third_party/blink/renderer/core/layout/constraint_space.cc index 9d867f7..b3689a007 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_constraint_space.cc +++ b/third_party/blink/renderer/core/layout/constraint_space.cc
@@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include <algorithm> #include <memory> +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/layout_block.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_view.h" #include "third_party/blink/renderer/core/layout/ng/layout_box_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/platform/wtf/size_assertions.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_constraint_space.h b/third_party/blink/renderer/core/layout/constraint_space.h similarity index 99% rename from third_party/blink/renderer/core/layout/ng/ng_constraint_space.h rename to third_party/blink/renderer/core/layout/constraint_space.h index 7abacae..dfca931 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_constraint_space.h +++ b/third_party/blink/renderer/core/layout/constraint_space.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_CONSTRAINT_SPACE_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_CONSTRAINT_SPACE_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CONSTRAINT_SPACE_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CONSTRAINT_SPACE_H_ #include "base/check_op.h" #include "base/notreached.h" @@ -1667,4 +1667,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_CONSTRAINT_SPACE_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CONSTRAINT_SPACE_H_
diff --git a/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.cc b/third_party/blink/renderer/core/layout/constraint_space_builder.cc similarity index 96% rename from third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.cc rename to third_party/blink/renderer/core/layout/constraint_space_builder.cc index 72583ff..10da839a 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.cc +++ b/third_party/blink/renderer/core/layout/constraint_space_builder.cc
@@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h b/third_party/blink/renderer/core/layout/constraint_space_builder.h similarity index 97% rename from third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h rename to third_party/blink/renderer/core/layout/constraint_space_builder.h index d399f51..72392a93 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h +++ b/third_party/blink/renderer/core/layout/constraint_space_builder.h
@@ -2,18 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_CONSTRAINT_SPACE_BUILDER_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_CONSTRAINT_SPACE_BUILDER_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CONSTRAINT_SPACE_BUILDER_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CONSTRAINT_SPACE_BUILDER_H_ #include "base/check_op.h" #include "base/dcheck_is_on.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/geometry/bfc_offset.h" #include "third_party/blink/renderer/core/layout/geometry/logical_size.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" #include "third_party/blink/renderer/core/layout/ng/ng_floats_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" #include "third_party/blink/renderer/platform/text/text_direction.h" #include "third_party/blink/renderer/platform/text/writing_mode.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" @@ -630,4 +630,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_CONSTRAINT_SPACE_BUILDER_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CONSTRAINT_SPACE_BUILDER_H_
diff --git a/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder_test.cc b/third_party/blink/renderer/core/layout/constraint_space_builder_test.cc similarity index 96% rename from third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder_test.cc rename to third_party/blink/renderer/core/layout/constraint_space_builder_test.cc index fd509466..fc94aa9 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder_test.cc +++ b/third_party/blink/renderer/core/layout/constraint_space_builder_test.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
diff --git a/third_party/blink/renderer/core/layout/custom/css_layout_definition.cc b/third_party/blink/renderer/core/layout/custom/css_layout_definition.cc index a6aa4a2..44ce1bd 100644 --- a/third_party/blink/renderer/core/layout/custom/css_layout_definition.cc +++ b/third_party/blink/renderer/core/layout/custom/css_layout_definition.cc
@@ -21,14 +21,14 @@ #include "third_party/blink/renderer/core/css/cssom/prepopulated_computed_style_property_map.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" #include "third_party/blink/renderer/core/inspector/console_message.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/custom/custom_layout_child.h" #include "third_party/blink/renderer/core/layout/custom/custom_layout_constraints.h" #include "third_party/blink/renderer/core/layout/custom/custom_layout_edges.h" #include "third_party/blink/renderer/core/layout/custom/custom_layout_fragment.h" #include "third_party/blink/renderer/core/layout/custom/custom_layout_scope.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h" +#include "third_party/blink/renderer/core/layout/layout_input_node.h" #include "third_party/blink/renderer/platform/bindings/script_state.h" #include "third_party/blink/renderer/platform/bindings/v8_binding_macros.h" #include "third_party/blink/renderer/platform/bindings/v8_object_constructor.h"
diff --git a/third_party/blink/renderer/core/layout/custom/custom_layout_child.h b/third_party/blink/renderer/core/layout/custom/custom_layout_child.h index 620dc15..d8ef78d 100644 --- a/third_party/blink/renderer/core/layout/custom/custom_layout_child.h +++ b/third_party/blink/renderer/core/layout/custom/custom_layout_child.h
@@ -7,7 +7,7 @@ #include "third_party/blink/renderer/bindings/core/v8/script_promise.h" #include "third_party/blink/renderer/core/css/cssom/prepopulated_computed_style_property_map.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h" +#include "third_party/blink/renderer/core/layout/layout_input_node.h" #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h"
diff --git a/third_party/blink/renderer/core/layout/custom/custom_layout_fragment.cc b/third_party/blink/renderer/core/layout/custom/custom_layout_fragment.cc index 18b7879..36983fe 100644 --- a/third_party/blink/renderer/core/layout/custom/custom_layout_fragment.cc +++ b/third_party/blink/renderer/core/layout/custom/custom_layout_fragment.cc
@@ -7,7 +7,7 @@ #include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" #include "third_party/blink/renderer/core/layout/custom/custom_layout_child.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/custom/custom_layout_work_task.cc b/third_party/blink/renderer/core/layout/custom/custom_layout_work_task.cc index 4bed4ae8..8bbf783 100644 --- a/third_party/blink/renderer/core/layout/custom/custom_layout_work_task.cc +++ b/third_party/blink/renderer/core/layout/custom/custom_layout_work_task.cc
@@ -6,16 +6,16 @@ #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" #include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/custom/custom_intrinsic_sizes.h" #include "third_party/blink/renderer/core/layout/custom/custom_layout_child.h" #include "third_party/blink/renderer/core/layout/custom/custom_layout_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/custom/layout_custom.h b/third_party/blink/renderer/core/layout/custom/layout_custom.h index e2379f3f..8c00173 100644 --- a/third_party/blink/renderer/core/layout/custom/layout_custom.h +++ b/third_party/blink/renderer/core/layout/custom/layout_custom.h
@@ -5,7 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_LAYOUT_CUSTOM_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_CUSTOM_LAYOUT_CUSTOM_H_ -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/platform/wtf/casting.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/depth_ordered_layout_object_list.cc b/third_party/blink/renderer/core/layout/depth_ordered_layout_object_list.cc index dc3ec68..39e6a1a 100644 --- a/third_party/blink/renderer/core/layout/depth_ordered_layout_object_list.cc +++ b/third_party/blink/renderer/core/layout/depth_ordered_layout_object_list.cc
@@ -8,7 +8,7 @@ #include "third_party/blink/renderer/core/css/style_engine.h" #include "third_party/blink/renderer/core/frame/local_frame_view.h" #include "third_party/blink/renderer/core/layout/layout_object.h" -#include "third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h" +#include "third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/exclusions/layout_opportunity.cc b/third_party/blink/renderer/core/layout/exclusions/layout_opportunity.cc index ddfae4b..7b69384 100644 --- a/third_party/blink/renderer/core/layout/exclusions/layout_opportunity.cc +++ b/third_party/blink/renderer/core/layout/exclusions/layout_opportunity.cc
@@ -4,8 +4,8 @@ #include "third_party/blink/renderer/core/layout/exclusions/layout_opportunity.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/layout_box.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" #include "third_party/blink/renderer/core/layout/shapes/shape_outside_info.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/flex/flex_child_iterator.h b/third_party/blink/renderer/core/layout/flex/flex_child_iterator.h index 94dde505..d73bb874 100644 --- a/third_party/blink/renderer/core/layout/flex/flex_child_iterator.h +++ b/third_party/blink/renderer/core/layout/flex/flex_child_iterator.h
@@ -6,7 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_FLEX_FLEX_CHILD_ITERATOR_H_ #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/platform/wtf/vector.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/flex/flex_layout_algorithm.cc b/third_party/blink/renderer/core/layout/flex/flex_layout_algorithm.cc index 88b8a4c8..4abdc666 100644 --- a/third_party/blink/renderer/core/layout/flex/flex_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/flex/flex_layout_algorithm.cc
@@ -7,6 +7,8 @@ #include <memory> #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/frame/web_feature.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/flex/devtools_flex_info.h" #include "third_party/blink/renderer/core/layout/flex/flex_child_iterator.h" #include "third_party/blink/renderer/core/layout/flex/flex_item_iterator.h" @@ -17,18 +19,16 @@ #include "third_party/blink/renderer/core/layout/geometry/box_strut.h" #include "third_party/blink/renderer/core/layout/geometry/logical_size.h" #include "third_party/blink/renderer/core/layout/layout_box.h" +#include "third_party/blink/renderer/core/layout/layout_input_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_baseline_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_disable_side_effects_scope.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" #include "third_party/blink/renderer/core/layout/table/table_node.h" #include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h" #include "third_party/blink/renderer/core/style/computed_style.h"
diff --git a/third_party/blink/renderer/core/layout/flex/flex_layout_algorithm_test.cc b/third_party/blink/renderer/core/layout/flex/flex_layout_algorithm_test.cc index 32e0864..cc90746 100644 --- a/third_party/blink/renderer/core/layout/flex/flex_layout_algorithm_test.cc +++ b/third_party/blink/renderer/core/layout/flex/flex_layout_algorithm_test.cc
@@ -3,11 +3,11 @@ // found in the LICENSE file. #include "testing/gmock/include/gmock/gmock.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/flex/flexible_box_algorithm.h" #include "third_party/blink/renderer/core/layout/flex/layout_flexible_box.h" #include "third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/flex/flexible_box_algorithm.h b/third_party/blink/renderer/core/layout/flex/flexible_box_algorithm.h index 65bd1eb..fbb1ba1 100644 --- a/third_party/blink/renderer/core/layout/flex/flexible_box_algorithm.h +++ b/third_party/blink/renderer/core/layout/flex/flexible_box_algorithm.h
@@ -32,11 +32,11 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_FLEX_FLEXIBLE_BOX_ALGORITHM_H_ #include "base/check_op.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/geometry/flex_offset.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/min_max_sizes.h" #include "third_party/blink/renderer/core/layout/ng/ng_baseline_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/geometry/layout_point.h" #include "third_party/blink/renderer/platform/geometry/layout_unit.h"
diff --git a/third_party/blink/renderer/core/layout/flex/layout_flexible_box.cc b/third_party/blink/renderer/core/layout/flex/layout_flexible_box.cc index 4e0036aa..7578b7fa 100644 --- a/third_party/blink/renderer/core/layout/flex/layout_flexible_box.cc +++ b/third_party/blink/renderer/core/layout/flex/layout_flexible_box.cc
@@ -6,13 +6,13 @@ #include "third_party/blink/renderer/core/html/forms/html_select_element.h" #include "third_party/blink/renderer/core/inspector/inspector_trace_events.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/flex/flex_layout_algorithm.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/flex/ng_flex_line.h b/third_party/blink/renderer/core/layout/flex/ng_flex_line.h index 70e683f1..6864a472 100644 --- a/third_party/blink/renderer/core/layout/flex/ng_flex_line.h +++ b/third_party/blink/renderer/core/layout/flex/ng_flex_line.h
@@ -5,8 +5,8 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_FLEX_NG_FLEX_LINE_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_FLEX_NG_FLEX_LINE_H_ +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/geometry/flex_offset.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/platform/wtf/vector.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/forms/layout_fieldset.h b/third_party/blink/renderer/core/layout/forms/layout_fieldset.h index d506fa0..841762e 100644 --- a/third_party/blink/renderer/core/layout/forms/layout_fieldset.h +++ b/third_party/blink/renderer/core/layout/forms/layout_fieldset.h
@@ -6,7 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_FORMS_LAYOUT_FIELDSET_H_ #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/forms/layout_text_control_inner_editor.h b/third_party/blink/renderer/core/layout/forms/layout_text_control_inner_editor.h index 47a16fb..c63500150 100644 --- a/third_party/blink/renderer/core/layout/forms/layout_text_control_inner_editor.h +++ b/third_party/blink/renderer/core/layout/forms/layout_text_control_inner_editor.h
@@ -5,7 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_FORMS_LAYOUT_TEXT_CONTROL_INNER_EDITOR_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_FORMS_LAYOUT_TEXT_CONTROL_INNER_EDITOR_H_ -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/forms/layout_text_control_multi_line.h b/third_party/blink/renderer/core/layout/forms/layout_text_control_multi_line.h index 5df905cb..b3538c6 100644 --- a/third_party/blink/renderer/core/layout/forms/layout_text_control_multi_line.h +++ b/third_party/blink/renderer/core/layout/forms/layout_text_control_multi_line.h
@@ -5,7 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_FORMS_LAYOUT_TEXT_CONTROL_MULTI_LINE_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_FORMS_LAYOUT_TEXT_CONTROL_MULTI_LINE_H_ -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/forms/layout_text_control_single_line.h b/third_party/blink/renderer/core/layout/forms/layout_text_control_single_line.h index ad3ca6e..cf0c848 100644 --- a/third_party/blink/renderer/core/layout/forms/layout_text_control_single_line.h +++ b/third_party/blink/renderer/core/layout/forms/layout_text_control_single_line.h
@@ -5,7 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_FORMS_LAYOUT_TEXT_CONTROL_SINGLE_LINE_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_FORMS_LAYOUT_TEXT_CONTROL_SINGLE_LINE_H_ -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/grid/grid_item.h b/third_party/blink/renderer/core/layout/grid/grid_item.h index 5e4cec3..900a150 100644 --- a/third_party/blink/renderer/core/layout/grid/grid_item.h +++ b/third_party/blink/renderer/core/layout/grid/grid_item.h
@@ -6,10 +6,10 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_GRID_GRID_ITEM_H_ #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/grid/grid_track_collection.h" #include "third_party/blink/renderer/core/layout/ng/ng_baseline_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" #include "third_party/blink/renderer/platform/wtf/vector.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc b/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc index 07334d3..3ec5ca9 100644 --- a/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc
@@ -4,14 +4,14 @@ #include "third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_disable_side_effects_scope.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" #include "third_party/blink/renderer/core/layout/ng/ng_relative_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h" namespace blink { @@ -417,8 +417,10 @@ // TODO(crbug.com/1272533): This should be |depends_on_block_constraints| // (rather than false). However we need more cache slots to handle the - // performance degredation we currently experience. See bug for more details. - return MinMaxSizesResult(sizes, /* depends_on_block_constraints */ false); + // performance degradation we currently experience. See bug for more details. + return MinMaxSizesResult( + sizes, RuntimeEnabledFeatures::LayoutNewMeasureCacheEnabled() && + depends_on_block_constraints); } MinMaxSizesResult GridLayoutAlgorithm::ComputeMinMaxSizes(
diff --git a/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.h b/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.h index e880d9f..9b7827f 100644 --- a/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.h +++ b/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.h
@@ -6,13 +6,13 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_GRID_GRID_LAYOUT_ALGORITHM_H_ #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/grid/grid_break_token_data.h" #include "third_party/blink/renderer/core/layout/grid/grid_node.h" #include "third_party/blink/renderer/core/layout/grid/grid_placement.h" #include "third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" #include "third_party/blink/renderer/core/layout/ng/ng_layout_algorithm.h" #include "third_party/blink/renderer/platform/wtf/vector.h"
diff --git a/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm_test.cc b/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm_test.cc index 985332b..95866c47 100644 --- a/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm_test.cc +++ b/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm_test.cc
@@ -7,7 +7,7 @@ #include "build/build_config.h" #include "third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/grid/grid_node.h b/third_party/blink/renderer/core/layout/grid/grid_node.h index 27665aa6..41906caf 100644 --- a/third_party/blink/renderer/core/layout/grid/grid_node.h +++ b/third_party/blink/renderer/core/layout/grid/grid_node.h
@@ -6,9 +6,9 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_GRID_GRID_NODE_H_ #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/grid/layout_grid.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/grid/grid_item.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" +#include "third_party/blink/renderer/core/layout/grid/layout_grid.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/grid/layout_grid.cc b/third_party/blink/renderer/core/layout/grid/layout_grid.cc index 06eb07e..7c7c67bb 100644 --- a/third_party/blink/renderer/core/layout/grid/layout_grid.cc +++ b/third_party/blink/renderer/core/layout/grid/layout_grid.cc
@@ -4,7 +4,7 @@ #include "third_party/blink/renderer/core/layout/grid/layout_grid.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/hit_test_result.cc b/third_party/blink/renderer/core/layout/hit_test_result.cc index c40422d..11ec561 100644 --- a/third_party/blink/renderer/core/layout/hit_test_result.cc +++ b/third_party/blink/renderer/core/layout/hit_test_result.cc
@@ -48,7 +48,7 @@ #include "third_party/blink/renderer/core/layout/layout_embedded_content.h" #include "third_party/blink/renderer/core/layout/layout_image.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/page/page.h" #include "third_party/blink/renderer/core/page/scrolling/top_document_root_scroller_controller.h" #include "third_party/blink/renderer/core/scroll/scrollbar.h"
diff --git a/third_party/blink/renderer/core/layout/hit_testing_test.cc b/third_party/blink/renderer/core/layout/hit_testing_test.cc index 7f3ae872..48fd610 100644 --- a/third_party/blink/renderer/core/layout/hit_testing_test.cc +++ b/third_party/blink/renderer/core/layout/hit_testing_test.cc
@@ -9,7 +9,7 @@ #include "third_party/blink/renderer/core/dom/events/native_event_listener.h" #include "third_party/blink/renderer/core/editing/position_with_affinity.h" #include "third_party/blink/renderer/core/editing/text_affinity.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" #include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_ink_overflow.cc b/third_party/blink/renderer/core/layout/ink_overflow.cc similarity index 97% rename from third_party/blink/renderer/core/layout/ng/ng_ink_overflow.cc rename to third_party/blink/renderer/core/layout/ink_overflow.cc index c685cec6..a1458b8 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_ink_overflow.cc +++ b/third_party/blink/renderer/core/layout/ink_overflow.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_ink_overflow.h" +#include "third_party/blink/renderer/core/layout/ink_overflow.h" #include "build/chromeos_buildflags.h" #include "third_party/blink/renderer/core/editing/markers/custom_highlight_marker.h" @@ -12,7 +12,7 @@ #include "third_party/blink/renderer/core/layout/geometry/logical_rect.h" #include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h" #include "third_party/blink/renderer/core/layout/inline/fragment_item.h" -#include "third_party/blink/renderer/core/layout/ng/ng_text_decoration_offset.h" +#include "third_party/blink/renderer/core/layout/text_decoration_offset.h" #include "third_party/blink/renderer/core/paint/ng/marker_range_mapping_context.h" #include "third_party/blink/renderer/core/paint/ng/ng_highlight_painter.h" #include "third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.h" @@ -26,14 +26,14 @@ namespace { -struct SameSizeAsNGInkOverflow { +struct SameSizeAsInkOverflow { void* pointer; #if DCHECK_IS_ON() InkOverflow::Type type; #endif }; -ASSERT_SIZE(InkOverflow, SameSizeAsNGInkOverflow); +ASSERT_SIZE(InkOverflow, SameSizeAsInkOverflow); inline bool HasOverflow(const PhysicalRect& rect, const PhysicalSize& size) { if (rect.IsEmpty()) @@ -361,7 +361,7 @@ const TextFragmentPaintInfo& text_info, const ComputedStyle& style, const PhysicalRect& rect_in_container, - const NGInlinePaintContext* inline_context, + const InlinePaintContext* inline_context, PhysicalRect* ink_overflow_out) { CheckType(type); DCHECK(type == Type::kNotSet || type == Type::kInvalidated); @@ -452,7 +452,7 @@ const ComputedStyle& style, const Font& scaled_font, const PhysicalRect& rect_in_container, - const NGInlinePaintContext* inline_context) { + const InlinePaintContext* inline_context) { // Glyph bounds is in logical coordinate, origin at the alphabetic baseline. const gfx::RectF text_ink_bounds = scaled_font.TextInkBounds(text_info); LogicalRect ink_overflow = LogicalRect::EnclosingRect(text_ink_bounds); @@ -536,7 +536,7 @@ const Font& scaled_font, const PhysicalOffset& container_offset, const LogicalRect& ink_overflow, - const NGInlinePaintContext* inline_context) { + const InlinePaintContext* inline_context) { LogicalRect accumulated_bound; if (!scaled_font.PrimaryFont()) { return accumulated_bound; @@ -619,7 +619,7 @@ const Font& scaled_font, const PhysicalOffset& offset_in_container, const LogicalRect& ink_overflow, - const NGInlinePaintContext* inline_context, + const InlinePaintContext* inline_context, const AppliedTextDecoration* decoration_override) { DCHECK(style.HasAppliedTextDecorations() || decoration_override); // SVGText is currently the only reason we use decoration_override, @@ -666,7 +666,7 @@ const Font& scaled_font, const PhysicalOffset& offset_in_container, const LogicalRect& ink_overflow, - const NGInlinePaintContext* inline_context) { + const InlinePaintContext* inline_context) { LogicalRect accumulated_bound; auto* pseudo_style = fragment_item->Type() == FragmentItem::kSvgText @@ -713,7 +713,7 @@ const Font& scaled_font, const PhysicalOffset& offset_in_container, const LogicalRect& ink_overflow, - const NGInlinePaintContext* inline_context) { + const InlinePaintContext* inline_context) { LogicalRect accumulated_bound; const TextOffsetRange fragment_dom_offsets = NGHighlightPainter::GetFragmentDOMOffsets(
diff --git a/third_party/blink/renderer/core/layout/ng/ng_ink_overflow.h b/third_party/blink/renderer/core/layout/ink_overflow.h similarity index 93% rename from third_party/blink/renderer/core/layout/ng/ng_ink_overflow.h rename to third_party/blink/renderer/core/layout/ink_overflow.h index b4e1de1..433ffc0e 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_ink_overflow.h +++ b/third_party/blink/renderer/core/layout/ink_overflow.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_INK_OVERFLOW_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_INK_OVERFLOW_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_INK_OVERFLOW_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_INK_OVERFLOW_H_ #include "base/check_op.h" #include "base/dcheck_is_on.h" @@ -21,7 +21,7 @@ class Font; class FragmentItem; class InlineCursor; -class NGInlinePaintContext; +class InlinePaintContext; class Text; struct LogicalRect; struct TextFragmentPaintInfo; @@ -125,7 +125,7 @@ const TextFragmentPaintInfo& text_info, const ComputedStyle& style, const PhysicalRect& rect_in_container, - const NGInlinePaintContext* inline_context, + const InlinePaintContext* inline_context, PhysicalRect* ink_overflow_out); // Compute and set ink overflow for SVG text. @@ -148,7 +148,7 @@ const ComputedStyle& style, const Font& scaled_font, const PhysicalRect& rect_in_container, - const NGInlinePaintContext* inline_context); + const InlinePaintContext* inline_context); // Returns ink-overflow with emphasis mark overflow in logical direction. // |size| is a size of text item, e.g. |FragmentItem::Size()|. @@ -170,7 +170,7 @@ const Font& scaled_font, const PhysicalOffset& container_offset, const LogicalRect& ink_overflow, - const NGInlinePaintContext* inline_context); + const InlinePaintContext* inline_context); #if DCHECK_IS_ON() struct ReadUnsetAsNoneScope { @@ -190,7 +190,7 @@ const Font& scaled_font, const PhysicalOffset& offset_in_container, const LogicalRect& ink_overflow, - const NGInlinePaintContext* inline_context, + const InlinePaintContext* inline_context, const AppliedTextDecoration* decoration_override = nullptr); // For all markers but custom highlights. i.e. those with only one @@ -204,7 +204,7 @@ const Font& scaled_font, const PhysicalOffset& offset_in_container, const LogicalRect& ink_overflow, - const NGInlinePaintContext* inline_context); + const InlinePaintContext* inline_context); static LogicalRect ComputeCustomHighlightOverflow( const DocumentMarkerVector& markers, @@ -214,7 +214,7 @@ const Font& scaled_font, const PhysicalOffset& offset_in_container, const LogicalRect& ink_overflow, - const NGInlinePaintContext* inline_context); + const InlinePaintContext* inline_context); PhysicalRect FromOutsets(const PhysicalSize& size) const; @@ -281,4 +281,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_INK_OVERFLOW_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_INK_OVERFLOW_H_
diff --git a/third_party/blink/renderer/core/layout/ng/ng_ink_overflow_test.cc b/third_party/blink/renderer/core/layout/ink_overflow_test.cc similarity index 98% rename from third_party/blink/renderer/core/layout/ng/ng_ink_overflow_test.cc rename to third_party/blink/renderer/core/layout/ink_overflow_test.cc index 7619a9e..37c01c2 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_ink_overflow_test.cc +++ b/third_party/blink/renderer/core/layout/ink_overflow_test.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_ink_overflow.h" +#include "third_party/blink/renderer/core/layout/ink_overflow.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/blink/renderer/core/layout/inline/README.md b/third_party/blink/renderer/core/layout/inline/README.md index dda1891..5703777 100644 --- a/third_party/blink/renderer/core/layout/inline/README.md +++ b/third_party/blink/renderer/core/layout/inline/README.md
@@ -370,30 +370,30 @@ [UAX#9 Resolving Embedding Levels]: http://www.unicode.org/reports/tr9/#Resolving_Embedding_Levels [UAX#9 Reordering Resolved Levels]: http://www.unicode.org/reports/tr9/#Reordering_Resolved_Levels -[BaselineAlgorithmType]: ../ng/ng_constraint_space.h +[BaselineAlgorithmType]: ../constraint_space.h [BidiParagraph]: ../../../platform/text/bidi_paragraph.h -[BlockNode]: ../ng/ng_block_node.h +[BlockNode]: ../block_node.h [BoxFragmentBuilder]: ../ng/ng_box_fragment_builder.h -[ConstraintSpace]: ../ng/ng_constraint_space.h -[ConstraintSpaceBuilder]: ../ng/ng_constraint_space_builder.h +[ConstraintSpace]: ../constraint_space.h +[ConstraintSpaceBuilder]: ../constraint_space_builder.h [FontBaseline]: ../../../platform/fonts/font_baseline.h -[FragmentItem]: ng_fragment_item.h -[FragmentItems]: ng_fragment_items.h -[InlineBoxState]: ng_inline_box_state.h -[InlineItem]: ng_inline_item.h -[InlineItemResult]: ng_inline_item_result.h -[InlineLayoutAlgorithm]: ng_inline_layout_algorithm.h -[InlineNode]: ng_inline_node.h -[LayoutInputNode]: ../ng/ng_layout_input_node.h -[LineBreaker]: ng_line_breaker.h +[FragmentItem]: fragment_item.h +[FragmentItems]: fragment_items.h +[InlineBoxState]: inline_box_state.h +[InlineItem]: inline_item.h +[InlineItemResult]: inline_item_result.h +[InlineLayoutAlgorithm]: inline_layout_algorithm.h +[InlineNode]: inline_node.h +[LayoutInputNode]: ../layout_input_node.h +[LineBreaker]: line_breaker.h [LogicalBoxFragment]: ../ng/ng_box_fragment.h -[LogicalLineItem]: ng_logical_line_item.h -[LogicalLineItems]: ng_logical_line_items.h +[LogicalLineItem]: logical_line_item.h +[LogicalLineItems]: logical_line_items.h [NGBaselineRequest]: ng_baseline.h [NGPhysicalTextFragment]: ng_physical_text_fragment.h [OffsetMapping]: ng_offset_mapping.h -[PhysicalBoxFragment]: ../ng/ng_physical_box_fragment.h -[PhysicalFragment]: ../ng/ng_physical_fragment.h -[PhysicalLineBoxFragment]: ng_physical_line_box_fragment.h +[PhysicalBoxFragment]: ../physical_box_fragment.h +[PhysicalFragment]: ../physical_fragment.h +[PhysicalLineBoxFragment]: physical_line_box_fragment.h [ShapeResult]: ../../../platform/fonts/shaping/shape_result.h [ShapingLineBreaker]: ../../../platform/fonts/shaping/shaping_line_breaker.h
diff --git a/third_party/blink/renderer/core/layout/inline/abstract_inline_text_box_test.cc b/third_party/blink/renderer/core/layout/inline/abstract_inline_text_box_test.cc index 4b3afd75..d2a281d 100644 --- a/third_party/blink/renderer/core/layout/inline/abstract_inline_text_box_test.cc +++ b/third_party/blink/renderer/core/layout/inline/abstract_inline_text_box_test.cc
@@ -6,7 +6,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" #include "third_party/blink/renderer/platform/heap/heap_test_objects.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
diff --git a/third_party/blink/renderer/core/layout/inline/caret_rect.cc b/third_party/blink/renderer/core/layout/inline/caret_rect.cc index 8257119f..70478c7 100644 --- a/third_party/blink/renderer/core/layout/inline/caret_rect.cc +++ b/third_party/blink/renderer/core/layout/inline/caret_rect.cc
@@ -10,7 +10,7 @@ #include "third_party/blink/renderer/core/layout/inline/caret_position.h" #include "third_party/blink/renderer/core/layout/layout_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_text_combine.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/wtf/math_extras.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/inline/fragment_item.cc b/third_party/blink/renderer/core/layout/inline/fragment_item.cc index f8e67a3..76726aa1 100644 --- a/third_party/blink/renderer/core/layout/inline/fragment_item.cc +++ b/third_party/blink/renderer/core/layout/inline/fragment_item.cc
@@ -13,7 +13,7 @@ #include "third_party/blink/renderer/core/layout/inline/inline_item.h" #include "third_party/blink/renderer/core/layout/inline/inline_item_result.h" #include "third_party/blink/renderer/core/layout/layout_text_combine.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_inline_text.h" #include "third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.h" #include "third_party/blink/renderer/platform/fonts/text_fragment_paint_info.h" @@ -821,7 +821,7 @@ PhysicalRect FragmentItem::RecalcInkOverflowForCursor( InlineCursor* cursor, - NGInlinePaintContext* inline_context) { + InlinePaintContext* inline_context) { DCHECK(cursor); DCHECK(!cursor->Current() || cursor->IsAtFirst()); PhysicalRect contents_ink_overflow; @@ -848,7 +848,7 @@ } void FragmentItem::RecalcInkOverflow(const InlineCursor& cursor, - NGInlinePaintContext* inline_context, + InlinePaintContext* inline_context, PhysicalRect* self_and_contents_rect_out) { DCHECK_EQ(this, cursor.CurrentItem()); @@ -882,8 +882,8 @@ } // Create |ScopedInlineItem| here because the decoration box is not // supported for SVG. - NGInlinePaintContext::ScopedInlineItem scoped_inline_item(*this, - inline_context); + InlinePaintContext::ScopedInlineItem scoped_inline_item(*this, + inline_context); ink_overflow_type_ = static_cast<unsigned>(ink_overflow_.SetTextInkOverflow( InkOverflowType(), cursor, paint_info, Style(), @@ -917,8 +917,8 @@ } DCHECK(box_fragment->IsInlineBox()); - NGInlinePaintContext::ScopedInlineItem scoped_inline_item(*this, - inline_context); + InlinePaintContext::ScopedInlineItem scoped_inline_item(*this, + inline_context); const PhysicalRect contents_rect = RecalcInkOverflowForDescendantsOf(cursor, inline_context); DCHECK(box_fragment->Children().empty()); @@ -929,7 +929,7 @@ } if (Type() == kLine) { - NGInlinePaintContext::ScopedLineBox scoped_line_box(cursor, inline_context); + InlinePaintContext::ScopedLineBox scoped_line_box(cursor, inline_context); PhysicalRect contents_rect = RecalcInkOverflowForDescendantsOf(cursor, inline_context); const auto* const text_combine = @@ -948,7 +948,7 @@ PhysicalRect FragmentItem::RecalcInkOverflowForDescendantsOf( const InlineCursor& cursor, - NGInlinePaintContext* inline_context) const { + InlinePaintContext* inline_context) const { // Re-compute descendants, then compute the contents ink overflow from them. InlineCursor descendants_cursor = cursor.CursorForDescendants(); PhysicalRect contents_rect =
diff --git a/third_party/blink/renderer/core/layout/inline/fragment_item.h b/third_party/blink/renderer/core/layout/inline/fragment_item.h index fd03ea8..553ebe6 100644 --- a/third_party/blink/renderer/core/layout/inline/fragment_item.h +++ b/third_party/blink/renderer/core/layout/inline/fragment_item.h
@@ -11,11 +11,11 @@ #include "base/notreached.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/layout/geometry/logical_offset.h" +#include "third_party/blink/renderer/core/layout/ink_overflow.h" #include "third_party/blink/renderer/core/layout/inline/line_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/inline/text_item_type.h" #include "third_party/blink/renderer/core/layout/inline/text_offset_range.h" #include "third_party/blink/renderer/core/layout/layout_object.h" -#include "third_party/blink/renderer/core/layout/ng/ng_ink_overflow.h" #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h" #include "third_party/blink/renderer/platform/graphics/paint/display_item_client.h" #include "third_party/blink/renderer/platform/transforms/affine_transform.h" @@ -25,7 +25,7 @@ class FragmentItems; class InlineBreakToken; -class NGInlinePaintContext; +class InlinePaintContext; struct LogicalLineItem; struct TextFragmentPaintInfo; @@ -312,7 +312,7 @@ // Re-compute the ink overflow for the |cursor| until its end. static PhysicalRect RecalcInkOverflowForCursor( InlineCursor* cursor, - NGInlinePaintContext* inline_context); + InlinePaintContext* inline_context); // Painters can use const methods only, except for these explicitly declared // methods. @@ -322,7 +322,7 @@ public: void InvalidateInkOverflow() { return item_.InvalidateInkOverflow(); } void RecalcInkOverflow(const InlineCursor& cursor, - NGInlinePaintContext* inline_context, + InlinePaintContext* inline_context, PhysicalRect* self_and_contents_rect_out) { return item_.RecalcInkOverflow(cursor, inline_context, self_and_contents_rect_out); @@ -564,11 +564,11 @@ // Re-compute the ink overflow for this item. |cursor| should be at |this|. void RecalcInkOverflow(const InlineCursor& cursor, - NGInlinePaintContext* inline_context, + InlinePaintContext* inline_context, PhysicalRect* self_and_contents_rect_out); PhysicalRect RecalcInkOverflowForDescendantsOf( const InlineCursor& cursor, - NGInlinePaintContext* inline_context) const; + InlinePaintContext* inline_context) const; // Compute the inline position from text offset, in logical coordinate // relative to this fragment.
diff --git a/third_party/blink/renderer/core/layout/inline/fragment_item_test.cc b/third_party/blink/renderer/core/layout/inline/fragment_item_test.cc index 095693fc..0d58d498 100644 --- a/third_party/blink/renderer/core/layout/inline/fragment_item_test.cc +++ b/third_party/blink/renderer/core/layout/inline/fragment_item_test.cc
@@ -10,7 +10,7 @@ #include "third_party/blink/renderer/core/layout/inline/fragment_items.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/layout_block_flow.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
diff --git a/third_party/blink/renderer/core/layout/inline/fragment_items.cc b/third_party/blink/renderer/core/layout/inline/fragment_items.cc index bc1fd82..b32ebe7d 100644 --- a/third_party/blink/renderer/core/layout/inline/fragment_items.cc +++ b/third_party/blink/renderer/core/layout/inline/fragment_items.cc
@@ -8,7 +8,7 @@ #include "third_party/blink/renderer/core/layout/inline/fragment_items_builder.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/layout_block.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
diff --git a/third_party/blink/renderer/core/layout/inline/fragment_items_builder.cc b/third_party/blink/renderer/core/layout/inline/fragment_items_builder.cc index 52e89495..3725cc3b 100644 --- a/third_party/blink/renderer/core/layout/inline/fragment_items_builder.cc +++ b/third_party/blink/renderer/core/layout/inline/fragment_items_builder.cc
@@ -8,7 +8,7 @@ #include "third_party/blink/renderer/core/layout/inline/fragment_items.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/svg/svg_text_layout_algorithm.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/inline/fragment_items_test.cc b/third_party/blink/renderer/core/layout/inline/fragment_items_test.cc index 40ab100..a323b8e 100644 --- a/third_party/blink/renderer/core/layout/inline/fragment_items_test.cc +++ b/third_party/blink/renderer/core/layout/inline/fragment_items_test.cc
@@ -7,7 +7,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/renderer/core/layout/layout_box.h" #include "third_party/blink/renderer/core/layout/layout_inline.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" #include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
diff --git a/third_party/blink/renderer/core/layout/inline/initial_letter_utils.cc b/third_party/blink/renderer/core/layout/inline/initial_letter_utils.cc index e1bcb05..9e16a5c 100644 --- a/third_party/blink/renderer/core/layout/inline/initial_letter_utils.cc +++ b/third_party/blink/renderer/core/layout/inline/initial_letter_utils.cc
@@ -11,7 +11,7 @@ #include "third_party/blink/renderer/core/layout/inline/line_utils.h" #include "third_party/blink/renderer/core/layout/inline/logical_line_item.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/text/writing_direction_mode.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/inline/inline_box_state.cc b/third_party/blink/renderer/core/layout/inline/inline_box_state.cc index 2703cb4..e679725b 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_box_state.cc +++ b/third_party/blink/renderer/core/layout/inline/inline_box_state.cc
@@ -10,10 +10,10 @@ #include "third_party/blink/renderer/core/layout/inline/inline_item_result.h" #include "third_party/blink/renderer/core/layout/inline/line_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/inline/line_utils.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_text_combine.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_relative_utils.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_inline_text.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/core/svg/svg_length_functions.h"
diff --git a/third_party/blink/renderer/core/layout/inline/inline_containing_block_utils.cc b/third_party/blink/renderer/core/layout/inline/inline_containing_block_utils.cc index de34fb63..936d512 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_containing_block_utils.cc +++ b/third_party/blink/renderer/core/layout/inline/inline_containing_block_utils.cc
@@ -7,7 +7,7 @@ #include "third_party/blink/renderer/core/layout/layout_box.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/geometry/layout_unit.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/inline/inline_cursor.cc b/third_party/blink/renderer/core/layout/inline/inline_cursor.cc index 058d58b..c2f912b 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_cursor.cc +++ b/third_party/blink/renderer/core/layout/inline/inline_cursor.cc
@@ -10,14 +10,14 @@ #include "third_party/blink/renderer/core/editing/position_with_affinity.h" #include "third_party/blink/renderer/core/html/html_br_element.h" #include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h" -#include "third_party/blink/renderer/core/layout/layout_block_flow.h" -#include "third_party/blink/renderer/core/layout/layout_text.h" -#include "third_party/blink/renderer/core/layout/layout_text_combine.h" #include "third_party/blink/renderer/core/layout/inline/fragment_items.h" #include "third_party/blink/renderer/core/layout/inline/inline_item_span.h" #include "third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h" +#include "third_party/blink/renderer/core/layout/layout_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_text.h" +#include "third_party/blink/renderer/core/layout/layout_text_combine.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.h" namespace blink { @@ -471,7 +471,7 @@ void InlineCursorPosition::RecalcInkOverflow( const InlineCursor& cursor, - NGInlinePaintContext* inline_context) const { + InlinePaintContext* inline_context) const { DCHECK(item_); DCHECK_EQ(item_, cursor.Current().Item()); PhysicalRect self_and_contents_rect;
diff --git a/third_party/blink/renderer/core/layout/inline/inline_cursor.h b/third_party/blink/renderer/core/layout/inline/inline_cursor.h index 376c39c..6c74e118 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_cursor.h +++ b/third_party/blink/renderer/core/layout/inline/inline_cursor.h
@@ -26,11 +26,11 @@ class InlineBackwardCursor; class InlineBreakToken; class InlineCursor; +class InlinePaintContext; class LayoutBlockFlow; class LayoutInline; class LayoutObject; class LayoutUnit; -class NGInlinePaintContext; class Node; class PhysicalBoxFragment; class ShapeResultView; @@ -160,7 +160,7 @@ } void RecalcInkOverflow(const InlineCursor& cursor, - NGInlinePaintContext* inline_context) const; + InlinePaintContext* inline_context) const; // Returns start/end of offset in text content of current text fragment. // It is error when this cursor doesn't point to text fragment.
diff --git a/third_party/blink/renderer/core/layout/inline/inline_cursor_test.cc b/third_party/blink/renderer/core/layout/inline/inline_cursor_test.cc index d4af6e5..a3af5cb0 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_cursor_test.cc +++ b/third_party/blink/renderer/core/layout/inline/inline_cursor_test.cc
@@ -12,7 +12,7 @@ #include "third_party/blink/renderer/core/layout/inline/inline_node_data.h" #include "third_party/blink/renderer/core/layout/layout_image.h" #include "third_party/blink/renderer/core/layout/layout_text.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/inline/inline_item_result.cc b/third_party/blink/renderer/core/layout/inline/inline_item_result.cc index eb223b6..64bb8db 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_item_result.cc +++ b/third_party/blink/renderer/core/layout/inline/inline_item_result.cc
@@ -5,7 +5,7 @@ #include "third_party/blink/renderer/core/layout/inline/inline_item_result.h" #include "third_party/blink/renderer/core/layout/inline/inline_item.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.h" #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h"
diff --git a/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.cc b/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.cc index d8e4c90e0..6b59d31d 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.cc
@@ -12,6 +12,7 @@ #include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom-shared.h" #include "third_party/blink/renderer/core/css/resolver/style_resolver.h" #include "third_party/blink/renderer/core/html/forms/html_input_element.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/inline/initial_letter_utils.h" #include "third_party/blink/renderer/core/layout/inline/inline_box_state.h" #include "third_party/blink/renderer/core/layout/inline/inline_break_token.h" @@ -26,21 +27,20 @@ #include "third_party/blink/renderer/core/layout/inline/paragraph_line_breaker.h" #include "third_party/blink/renderer/core/layout/inline/ruby_utils.h" #include "third_party/blink/renderer/core/layout/inline/score_line_breaker.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_text_combine.h" #include "third_party/blink/renderer/core/layout/list/layout_outside_list_marker.h" #include "third_party/blink/renderer/core/layout/list/unpositioned_list_marker.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" #include "third_party/blink/renderer/core/layout/ng/ng_disable_side_effects_scope.h" #include "third_party/blink/renderer/core/layout/ng/ng_floats_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_positioned_float.h" #include "third_party/blink/renderer/core/layout/ng/ng_relative_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_inline_text.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_spacing.h"
diff --git a/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.h b/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.h index 6f9f24f6..b65325f 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.h +++ b/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.h
@@ -8,10 +8,10 @@ #include "base/dcheck_is_on.h" #include "base/notreached.h" #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/inline/inline_node.h" #include "third_party/blink/renderer/core/layout/inline/logical_line_item.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h" #include "third_party/blink/renderer/platform/fonts/font_baseline.h"
diff --git a/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm_test.cc b/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm_test.cc index 19de473..ae6e23a 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm_test.cc +++ b/third_party/blink/renderer/core/layout/inline/inline_layout_algorithm_test.cc
@@ -8,6 +8,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "third_party/blink/renderer/core/dom/tag_collection.h" #include "third_party/blink/renderer/core/html/forms/html_text_area_element.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/inline/inline_box_state.h" #include "third_party/blink/renderer/core/layout/inline/inline_break_token.h" #include "third_party/blink/renderer/core/layout/inline/inline_child_layout_context.h" @@ -15,10 +16,9 @@ #include "third_party/blink/renderer/core/layout/inline/inline_node.h" #include "third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h" #include "third_party/blink/renderer/core/layout/layout_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" namespace blink { namespace {
diff --git a/third_party/blink/renderer/core/layout/inline/inline_node.cc b/third_party/blink/renderer/core/layout/inline/inline_node.cc index 1834b6e..1f9fc7a 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_node.cc +++ b/third_party/blink/renderer/core/layout/inline/inline_node.cc
@@ -12,6 +12,8 @@ #include "base/ranges/algorithm.h" #include "base/trace_event/trace_event.h" #include "third_party/blink/renderer/core/frame/web_feature.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/inline/initial_letter_utils.h" #include "third_party/blink/renderer/core/layout/inline/inline_break_token.h" #include "third_party/blink/renderer/core/layout/inline/inline_item.h" @@ -26,20 +28,18 @@ #include "third_party/blink/renderer/core/layout/layout_inline.h" #include "third_party/blink/renderer/core/layout/layout_object.h" #include "third_party/blink/renderer/core/layout/layout_object_inlines.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_text.h" #include "third_party/blink/renderer/core/layout/layout_text_combine.h" +#include "third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h" #include "third_party/blink/renderer/core/layout/list/layout_inline_list_item.h" #include "third_party/blink/renderer/core/layout/list/layout_list_item.h" #include "third_party/blink/renderer/core/layout/list/list_marker.h" -#include "third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_positioned_float.h" -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_inline_text.h" #include "third_party/blink/renderer/core/layout/svg/svg_inline_node_data.h" #include "third_party/blink/renderer/core/layout/svg/svg_text_layout_attributes_builder.h"
diff --git a/third_party/blink/renderer/core/layout/inline/inline_node.h b/third_party/blink/renderer/core/layout/inline/inline_node.h index c64c305a..f69ce93 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_node.h +++ b/third_party/blink/renderer/core/layout/inline/inline_node.h
@@ -9,7 +9,7 @@ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/layout/inline/inline_node_data.h" #include "third_party/blink/renderer/core/layout/layout_block_flow.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h" +#include "third_party/blink/renderer/core/layout/layout_input_node.h" #include "third_party/blink/renderer/core/layout/svg/svg_character_data.h" #include "third_party/blink/renderer/platform/wtf/casting.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
diff --git a/third_party/blink/renderer/core/layout/inline/inline_node_test.cc b/third_party/blink/renderer/core/layout/inline/inline_node_test.cc index 5d9117e..972fd3e 100644 --- a/third_party/blink/renderer/core/layout/inline/inline_node_test.cc +++ b/third_party/blink/renderer/core/layout/inline/inline_node_test.cc
@@ -11,17 +11,17 @@ #include "third_party/blink/renderer/core/dom/pseudo_element.h" #include "third_party/blink/renderer/core/dom/text.h" #include "third_party/blink/renderer/core/html_names.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/inline/inline_child_layout_context.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/inline/inline_item_span.h" #include "third_party/blink/renderer/core/layout/inline/inline_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_text_combine.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_text.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/core/svg_names.h"
diff --git a/third_party/blink/renderer/core/layout/inline/line_box_fragment_builder.cc b/third_party/blink/renderer/core/layout/inline/line_box_fragment_builder.cc index 146b742d..c095d6f 100644 --- a/third_party/blink/renderer/core/layout/inline/line_box_fragment_builder.cc +++ b/third_party/blink/renderer/core/layout/inline/line_box_fragment_builder.cc
@@ -10,11 +10,11 @@ #include "third_party/blink/renderer/core/layout/inline/inline_node.h" #include "third_party/blink/renderer/core/layout/inline/logical_line_item.h" #include "third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_positioned_float.h" #include "third_party/blink/renderer/core/layout/ng/ng_relative_utils.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/inline/line_box_fragment_builder.h b/third_party/blink/renderer/core/layout/inline/line_box_fragment_builder.h index 089973b..91f6ebc 100644 --- a/third_party/blink/renderer/core/layout/inline/line_box_fragment_builder.h +++ b/third_party/blink/renderer/core/layout/inline/line_box_fragment_builder.h
@@ -10,10 +10,10 @@ #include "third_party/blink/renderer/core/layout/inline/inline_break_token.h" #include "third_party/blink/renderer/core/layout/inline/inline_node.h" #include "third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_positioned_float.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" #include "third_party/blink/renderer/platform/fonts/font_height.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
diff --git a/third_party/blink/renderer/core/layout/inline/line_breaker.cc b/third_party/blink/renderer/core/layout/inline/line_breaker.cc index 8bec564..4c164f7 100644 --- a/third_party/blink/renderer/core/layout/inline/line_breaker.cc +++ b/third_party/blink/renderer/core/layout/inline/line_breaker.cc
@@ -7,6 +7,8 @@ #include "base/containers/adapters.h" #include "base/ranges/algorithm.h" #include "third_party/blink/renderer/core/frame/web_feature.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/inline/inline_break_token.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/inline/inline_item_segment.h" @@ -16,16 +18,14 @@ #include "third_party/blink/renderer/core/layout/inline/ruby_utils.h" #include "third_party/blink/renderer/core/layout/layout_text_combine.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_floats_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_positioned_float.h" -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" #include "third_party/blink/renderer/core/layout/svg/resolved_text_layout_attributes_iterator.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/core/svg/svg_text_content_element.h"
diff --git a/third_party/blink/renderer/core/layout/inline/line_breaker_test.cc b/third_party/blink/renderer/core/layout/inline/line_breaker_test.cc index f31600c..838853e6 100644 --- a/third_party/blink/renderer/core/layout/inline/line_breaker_test.cc +++ b/third_party/blink/renderer/core/layout/inline/line_breaker_test.cc
@@ -5,14 +5,14 @@ #include "third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/inline/inline_break_token.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/inline/inline_node.h" #include "third_party/blink/renderer/core/layout/inline/line_breaker.h" #include "third_party/blink/renderer/core/layout/inline/line_info.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_positioned_float.h" #include "third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h" #include "third_party/blink/renderer/core/testing/mock_hyphenation.h"
diff --git a/third_party/blink/renderer/core/layout/inline/line_info.h b/third_party/blink/renderer/core/layout/inline/line_info.h index b74d2e9c..bf086b36 100644 --- a/third_party/blink/renderer/core/layout/inline/line_info.h +++ b/third_party/blink/renderer/core/layout/inline/line_info.h
@@ -11,8 +11,8 @@ #include "third_party/blink/renderer/core/layout/geometry/bfc_offset.h" #include "third_party/blink/renderer/core/layout/inline/inline_item_result.h" #include "third_party/blink/renderer/core/layout/inline/inline_item_text_index.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/style/computed_style_base_constants.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/inline/line_truncator.cc b/third_party/blink/renderer/core/layout/inline/line_truncator.cc index 58086f8..4a46313a 100644 --- a/third_party/blink/renderer/core/layout/inline/line_truncator.cc +++ b/third_party/blink/renderer/core/layout/inline/line_truncator.cc
@@ -9,7 +9,7 @@ #include "third_party/blink/renderer/core/layout/inline/inline_item_result.h" #include "third_party/blink/renderer/core/layout/inline/line_info.h" #include "third_party/blink/renderer/core/layout/inline/logical_line_item.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/fonts/font_baseline.h" #include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.h" #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h"
diff --git a/third_party/blink/renderer/core/layout/inline/line_widths_test.cc b/third_party/blink/renderer/core/layout/inline/line_widths_test.cc index 2a6d2ed..dde4096 100644 --- a/third_party/blink/renderer/core/layout/inline/line_widths_test.cc +++ b/third_party/blink/renderer/core/layout/inline/line_widths_test.cc
@@ -10,7 +10,7 @@ #include "third_party/blink/renderer/core/layout/inline/inline_node.h" #include "third_party/blink/renderer/core/layout/inline/leading_floats.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/inline/logical_line_item.h b/third_party/blink/renderer/core/layout/inline/logical_line_item.h index f96a1351..86a578d 100644 --- a/third_party/blink/renderer/core/layout/inline/logical_line_item.h +++ b/third_party/blink/renderer/core/layout/inline/logical_line_item.h
@@ -11,7 +11,7 @@ #include "third_party/blink/renderer/core/layout/inline/inline_item_result.h" #include "third_party/blink/renderer/core/layout/inline/inline_item_text_index.h" #include "third_party/blink/renderer/core/layout/inline/text_offset_range.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
diff --git a/third_party/blink/renderer/core/layout/inline/offset_mapping.cc b/third_party/blink/renderer/core/layout/inline/offset_mapping.cc index 47c6bcba..0932fe95 100644 --- a/third_party/blink/renderer/core/layout/inline/offset_mapping.cc +++ b/third_party/blink/renderer/core/layout/inline/offset_mapping.cc
@@ -13,9 +13,9 @@ #include "third_party/blink/renderer/core/editing/editing_utilities.h" #include "third_party/blink/renderer/core/editing/ephemeral_range.h" #include "third_party/blink/renderer/core/editing/position.h" -#include "third_party/blink/renderer/core/layout/layout_text_fragment.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/inline/inline_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" +#include "third_party/blink/renderer/core/layout/layout_text_fragment.h" #include "third_party/blink/renderer/platform/text/character.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/inline/offset_mapping_test.cc b/third_party/blink/renderer/core/layout/inline/offset_mapping_test.cc index d604329..cc48299 100644 --- a/third_party/blink/renderer/core/layout/inline/offset_mapping_test.cc +++ b/third_party/blink/renderer/core/layout/inline/offset_mapping_test.cc
@@ -9,8 +9,8 @@ #include "third_party/blink/renderer/core/editing/ephemeral_range.h" #include "third_party/blink/renderer/core/editing/position.h" #include "third_party/blink/renderer/core/layout/inline/inline_node.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_text_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
diff --git a/third_party/blink/renderer/core/layout/inline/paragraph_line_breaker_test.cc b/third_party/blink/renderer/core/layout/inline/paragraph_line_breaker_test.cc index 8afad6cc..dc7153f7 100644 --- a/third_party/blink/renderer/core/layout/inline/paragraph_line_breaker_test.cc +++ b/third_party/blink/renderer/core/layout/inline/paragraph_line_breaker_test.cc
@@ -4,9 +4,9 @@ #include "third_party/blink/renderer/core/layout/inline/paragraph_line_breaker.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/inline/inline_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.cc b/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.cc index ba2b23f..1caf6b57 100644 --- a/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.cc +++ b/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.cc
@@ -9,8 +9,8 @@ #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/inline/line_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_relative_utils.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/wtf/size_assertions.h"
diff --git a/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h b/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h index 8c9e244a..60dc24a 100644 --- a/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h +++ b/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h
@@ -6,7 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_INLINE_PHYSICAL_LINE_BOX_FRAGMENT_H_ #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" #include "third_party/blink/renderer/platform/fonts/font_height.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment_test.cc b/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment_test.cc index 2636380..4973658b 100644 --- a/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment_test.cc +++ b/third_party/blink/renderer/core/layout/inline/physical_line_box_fragment_test.cc
@@ -5,7 +5,7 @@ #include "third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/inline/ruby_utils.cc b/third_party/blink/renderer/core/layout/inline/ruby_utils.cc index 42344eb1..49a12d0 100644 --- a/third_party/blink/renderer/core/layout/inline/ruby_utils.cc +++ b/third_party/blink/renderer/core/layout/inline/ruby_utils.cc
@@ -9,7 +9,7 @@ #include "third_party/blink/renderer/core/layout/inline/inline_item_result.h" #include "third_party/blink/renderer/core/layout/inline/line_info.h" #include "third_party/blink/renderer/core/layout/inline/logical_line_item.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/fonts/font_height.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/inline/score_line_breaker_test.cc b/third_party/blink/renderer/core/layout/inline/score_line_breaker_test.cc index f029b529..d7324b12 100644 --- a/third_party/blink/renderer/core/layout/inline/score_line_breaker_test.cc +++ b/third_party/blink/renderer/core/layout/inline/score_line_breaker_test.cc
@@ -4,14 +4,14 @@ #include "third_party/blink/renderer/core/layout/inline/score_line_breaker.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/inline/inline_node.h" #include "third_party/blink/renderer/core/layout/inline/leading_floats.h" #include "third_party/blink/renderer/core/layout/inline/line_break_point.h" #include "third_party/blink/renderer/core/layout/inline/line_info_list.h" #include "third_party/blink/renderer/core/layout/inline/line_widths.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/layout_block.cc b/third_party/blink/renderer/core/layout/layout_block.cc index cac7dd81..14d7cc3 100644 --- a/third_party/blink/renderer/core/layout/layout_block.cc +++ b/third_party/blink/renderer/core/layout/layout_block.cc
@@ -44,20 +44,20 @@ #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/html/html_marquee_element.h" #include "third_party/blink/renderer/core/html_names.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/flex/layout_flexible_box.h" #include "third_party/blink/renderer/core/layout/hit_test_location.h" #include "third_party/blink/renderer/core/layout/hit_test_result.h" #include "third_party/blink/renderer/core/layout/layout_inline.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_object_inlines.h" #include "third_party/blink/renderer/core/layout/layout_theme.h" #include "third_party/blink/renderer/core/layout/layout_view.h" +#include "third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h" #include "third_party/blink/renderer/core/layout/mathml/layout_mathml_block.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" -#include "third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" #include "third_party/blink/renderer/core/layout/ng/ng_disable_side_effects_scope.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_text.h" #include "third_party/blink/renderer/core/layout/text_autosizer.h" #include "third_party/blink/renderer/core/page/page.h"
diff --git a/third_party/blink/renderer/core/layout/layout_block_flow.cc b/third_party/blink/renderer/core/layout/layout_block_flow.cc index 44cdb645..127b6f6 100644 --- a/third_party/blink/renderer/core/layout/layout_block_flow.cc +++ b/third_party/blink/renderer/core/layout/layout_block_flow.cc
@@ -49,16 +49,16 @@ #include "third_party/blink/renderer/core/layout/layout_inline.h" #include "third_party/blink/renderer/core/layout/layout_multi_column_flow_thread.h" #include "third_party/blink/renderer/core/layout/layout_multi_column_spanner_placeholder.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_object_inlines.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" -#include "third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h" +#include "third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h" #include "third_party/blink/renderer/core/layout/ng/ng_absolute_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/shapes/shape_outside_info.h" #include "third_party/blink/renderer/core/layout/text_autosizer.h" #include "third_party/blink/renderer/core/paint/block_flow_paint_invalidator.h"
diff --git a/third_party/blink/renderer/core/layout/layout_block_flow_test.cc b/third_party/blink/renderer/core/layout/layout_block_flow_test.cc index 55f956707..795029d 100644 --- a/third_party/blink/renderer/core/layout/layout_block_flow_test.cc +++ b/third_party/blink/renderer/core/layout/layout_block_flow_test.cc
@@ -29,7 +29,7 @@ GetElementById("text")->setAttribute(AtomicString("font-size"), AtomicString("100")); UpdateAllLifecyclePhasesForTest(); - // The test passes if no DCHECK failure in ng_ink_overflow.cc. + // The test passes if no DCHECK failure in ink_overflow.cc. } } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/layout_block_test.cc b/third_party/blink/renderer/core/layout/layout_block_test.cc index e1ab3f3..2a5fd684 100644 --- a/third_party/blink/renderer/core/layout/layout_block_test.cc +++ b/third_party/blink/renderer/core/layout/layout_block_test.cc
@@ -10,7 +10,7 @@ #include "third_party/blink/renderer/core/dom/element_traversal.h" #include "third_party/blink/renderer/core/layout/layout_block.h" #include "third_party/blink/renderer/core/layout/layout_block_flow.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" #include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
diff --git a/third_party/blink/renderer/core/layout/layout_box.cc b/third_party/blink/renderer/core/layout/layout_box.cc index 8d746716..23fb7b5 100644 --- a/third_party/blink/renderer/core/layout/layout_box.cc +++ b/third_party/blink/renderer/core/layout/layout_box.cc
@@ -59,6 +59,8 @@ #include "third_party/blink/renderer/core/input/event_handler.h" #include "third_party/blink/renderer/core/input_type_names.h" #include "third_party/blink/renderer/core/layout/anchor_position_scroll_data.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/custom/custom_layout_child.h" #include "third_party/blink/renderer/core/layout/custom/layout_custom.h" #include "third_party/blink/renderer/core/layout/custom/layout_worklet.h" @@ -76,15 +78,14 @@ #include "third_party/blink/renderer/core/layout/layout_multi_column_spanner_placeholder.h" #include "third_party/blink/renderer/core/layout/layout_object.h" #include "third_party/blink/renderer/core/layout/layout_object_inlines.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h" +#include "third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h" +#include "third_party/blink/renderer/core/layout/measure_cache.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_disable_side_effects_scope.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_layout_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/shapes/shape_outside_info.h" @@ -137,6 +138,7 @@ LayoutUnit intrinsic_logical_widths_initial_block_size; Member<void*> min_max_sizes_cache; Member<void*> result; + Member<void*> cache; HeapVector<Member<const LayoutResult>, 1> layout_results; wtf_size_t first_fragment_item_index_; Member<void*> members[2]; @@ -472,6 +474,7 @@ void LayoutBox::Trace(Visitor* visitor) const { visitor->Trace(min_max_sizes_cache_); visitor->Trace(measure_result_); + visitor->Trace(measure_cache_); visitor->Trace(layout_results_); visitor->Trace(overflow_); visitor->Trace(rare_data_); @@ -513,6 +516,9 @@ } if (measure_result_) measure_result_->GetPhysicalFragment().LayoutObjectWillBeDestroyed(); + if (measure_cache_) { + measure_cache_->LayoutObjectWillBeDestroyed(); + } for (auto result : layout_results_) result->GetPhysicalFragment().LayoutObjectWillBeDestroyed(); } @@ -2573,6 +2579,30 @@ return IndexOf(fragment) != kNotFound; } +void LayoutBox::AddMeasureLayoutResult(const LayoutResult* result) { + DCHECK(RuntimeEnabledFeatures::LayoutNewMeasureCacheEnabled()); + + // Ensure the given result is valid for the measure cache. + if (result->Status() != LayoutResult::kSuccess) { + return; + } + if (result->GetConstraintSpaceForCaching().CacheSlot() != + LayoutResultCacheSlot::kMeasure) { + return; + } + DCHECK( + To<PhysicalBoxFragment>(result->GetPhysicalFragment()).IsOnlyForNode()); + + if (!measure_cache_) { + measure_cache_ = MakeGarbageCollected<MeasureCache>(); + } + // Clear out old measure results if we need non-simplifed layout. + if (NeedsLayout() && !NeedsSimplifiedLayoutOnly()) { + measure_cache_->Clear(); + } + measure_cache_->Add(result); +} + void LayoutBox::SetCachedLayoutResult(const LayoutResult* result, wtf_size_t index) { NOT_DESTROYED(); @@ -2584,15 +2614,31 @@ DCHECK_EQ(index, 0u); // We don't early return here, when setting the "measure" result we also // set the "layout" result. - if (measure_result_) + if (measure_result_) { InvalidateItems(*measure_result_); - measure_result_ = result; + } + if (measure_cache_) { + measure_cache_->InvalidateItems(); + } + if (RuntimeEnabledFeatures::LayoutNewMeasureCacheEnabled()) { + AddMeasureLayoutResult(result); + } else { + measure_result_ = result; + } + if (IsTableCell()) { + To<LayoutTableCell>(this)->InvalidateLayoutResultCacheAfterMeasure(); + } } else { // We have a "layout" result, and we may need to clear the old "measure" // result if we needed non-simplified layout. - if (measure_result_ && NeedsLayout() && !NeedsSimplifiedLayoutOnly()) { - InvalidateItems(*measure_result_); - measure_result_ = nullptr; + if (NeedsLayout() && !NeedsSimplifiedLayoutOnly()) { + if (measure_result_) { + InvalidateItems(*measure_result_); + measure_result_ = nullptr; + } + if (measure_cache_) { + measure_cache_->Clear(); + } } } @@ -2605,6 +2651,9 @@ measure_result_->GetMutableForLayoutBoxCachedResults() .SetFragmentChildrenInvalid(); } + if (measure_cache_) { + measure_cache_->SetFragmentChildrenInvalid(result); + } SetLayoutResult(result, index); } @@ -2779,22 +2828,15 @@ } } +// static void LayoutBox::InvalidateItems(const LayoutResult& result) { - NOT_DESTROYED(); // Invalidate if inline |DisplayItemClient|s will be destroyed. const auto& box_fragment = To<PhysicalBoxFragment>(result.GetPhysicalFragment()); if (!box_fragment.HasItems()) return; -#if DCHECK_IS_ON() - // Column fragments are not really associated with a layout object. - if (IsLayoutFlowThread()) { - DCHECK(box_fragment.IsColumnBox()); - } else { - DCHECK_EQ(this, box_fragment.GetLayoutObject()); - } -#endif - ObjectPaintInvalidator(*this).SlowSetPaintingLayerNeedsRepaint(); + ObjectPaintInvalidator(*box_fragment.GetLayoutObject()) + .SlowSetPaintingLayerNeedsRepaint(); } const LayoutResult* LayoutBox::GetCachedLayoutResult( @@ -2809,10 +2851,13 @@ return result; } -const LayoutResult* LayoutBox::GetCachedMeasureResult() const { +const LayoutResult* LayoutBox::GetCachedMeasureResult( + const ConstraintSpace& space, + absl::optional<FragmentGeometry>* fragment_geometry) const { NOT_DESTROYED(); - if (!measure_result_) + if (!measure_result_ && !measure_cache_) { return nullptr; + } // If we've already had an actual layout pass, and the node fragmented, we // cannot reliably re-use the measure result. What we want to avoid here is @@ -2828,11 +2873,10 @@ } } - // TODO(mstensho): Measure-results can never fragment, can they? This check - // could probably be removed. - if (!To<PhysicalBoxFragment>(measure_result_->GetPhysicalFragment()) - .IsOnlyForNode()) { - return nullptr; + if (measure_cache_) { + DCHECK(!measure_result_); + return measure_cache_->Find(BlockNode(const_cast<LayoutBox*>(this)), space, + fragment_geometry); } return measure_result_.Get(); @@ -2843,6 +2887,13 @@ return GetCachedLayoutResult(nullptr); } +const LayoutResult* LayoutBox::GetSingleCachedMeasureResultForTesting() const { + if (measure_cache_) { + return measure_cache_->GetLastForTesting(); + } + return measure_result_.Get(); +} + const LayoutResult* LayoutBox::GetLayoutResult(wtf_size_t i) const { NOT_DESTROYED(); return layout_results_[i].Get();
diff --git a/third_party/blink/renderer/core/layout/layout_box.h b/third_party/blink/renderer/core/layout/layout_box.h index cc8fa4d..392cb588 100644 --- a/third_party/blink/renderer/core/layout/layout_box.h +++ b/third_party/blink/renderer/core/layout/layout_box.h
@@ -52,6 +52,7 @@ class EarlyBreak; class LayoutMultiColumnSpannerPlaceholder; class LayoutResult; +class MeasureCache; class ShapeOutsideInfo; class WritingModeConverter; enum class LayoutCacheStatus; @@ -620,8 +621,9 @@ void ClearFirstInlineFragmentItemIndex() final; void SetFirstInlineFragmentItemIndex(wtf_size_t) final; - void InvalidateItems(const LayoutResult&); + static void InvalidateItems(const LayoutResult&); + void AddMeasureLayoutResult(const LayoutResult*); void SetCachedLayoutResult(const LayoutResult*, wtf_size_t index); // Store one layout result (with its physical fragment) at the specified @@ -672,12 +674,18 @@ } const LayoutResult* GetCachedLayoutResult(const BlockBreakToken*) const; - const LayoutResult* GetCachedMeasureResult() const; + const LayoutResult* GetCachedMeasureResult( + const ConstraintSpace&, + absl::optional<FragmentGeometry>* fragment_geometry) const; // Call in situations where we know that there's at most one fragment. A // DCHECK will fail if there are multiple fragments. const LayoutResult* GetSingleCachedLayoutResult() const; + // Retrieves the last (retrieved or set) measure LayoutResult, for + // unit-testing purposes only. + const LayoutResult* GetSingleCachedMeasureResultForTesting() const; + // Returns the last layout result for this block flow with the given // constraint space and break token, or null if it is not up-to-date or // otherwise unavailable. @@ -972,13 +980,6 @@ // Inherit other flipping methods from LayoutObject. using LayoutObject::FlipForWritingMode; - void DeprecatedFlipForWritingMode(DeprecatedLayoutRect& rect) const { - NOT_DESTROYED(); - if (LIKELY(!HasFlippedBlocksWritingMode())) - return; - rect = FlipForWritingMode(rect).ToLayoutRect(); - } - // Passing |flipped_blocks_container| causes flipped-block flipping w.r.t. // that container, or LocationContainer() otherwise. PhysicalOffset PhysicalLocation( @@ -1502,6 +1503,7 @@ Member<MinMaxSizesCache> min_max_sizes_cache_; Member<const LayoutResult> measure_result_; + Member<MeasureCache> measure_cache_; LayoutResultList layout_results_; // LayoutBoxUtils is used for the LayoutNG code querying protected methods on
diff --git a/third_party/blink/renderer/core/layout/layout_box_hot.cc b/third_party/blink/renderer/core/layout/layout_box_hot.cc index 46c3af9..d147831 100644 --- a/third_party/blink/renderer/core/layout/layout_box_hot.cc +++ b/third_party/blink/renderer/core/layout/layout_box_hot.cc
@@ -5,15 +5,15 @@ #include "third_party/blink/renderer/core/layout/layout_box.h" #include "third_party/blink/renderer/core/editing/editing_utilities.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/geometry/fragment_geometry.h" #include "third_party/blink/renderer/core/layout/layout_block.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" #include "third_party/blink/renderer/core/layout/ng/ng_disable_side_effects_scope.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_layout_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" namespace blink { @@ -81,23 +81,25 @@ return nullptr; } + if (ShouldSkipLayoutCache()) { + return nullptr; + } + + if (early_break) { + return nullptr; + } + const bool use_layout_cache_slot = new_space.CacheSlot() == LayoutResultCacheSlot::kLayout && !layout_results_.empty(); const LayoutResult* cached_layout_result = - use_layout_cache_slot ? GetCachedLayoutResult(break_token) - : GetCachedMeasureResult(); + use_layout_cache_slot + ? GetCachedLayoutResult(break_token) + : GetCachedMeasureResult(new_space, initial_fragment_geometry); if (!cached_layout_result) return nullptr; - if (early_break) - return nullptr; - - if (ShouldSkipLayoutCache()) { - return nullptr; - } - DCHECK_EQ(cached_layout_result->Status(), LayoutResult::kSuccess); // Set our initial temporary cache status to "hit". @@ -154,9 +156,13 @@ } BlockNode node(this); - LayoutCacheStatus size_cache_status = CalculateSizeBasedLayoutCacheStatus( - node, break_token, *cached_layout_result, new_space, - initial_fragment_geometry); + LayoutCacheStatus size_cache_status = LayoutCacheStatus::kHit; + if (use_layout_cache_slot || + !RuntimeEnabledFeatures::LayoutNewMeasureCacheEnabled()) { + size_cache_status = CalculateSizeBasedLayoutCacheStatus( + node, break_token, *cached_layout_result, new_space, + initial_fragment_geometry); + } // If our size may change (or we know a descendants size may change), we miss // the cache.
diff --git a/third_party/blink/renderer/core/layout/layout_box_model_object.cc b/third_party/blink/renderer/core/layout/layout_box_model_object.cc index 3786a7d..7a87b00 100644 --- a/third_party/blink/renderer/core/layout/layout_box_model_object.cc +++ b/third_party/blink/renderer/core/layout/layout_box_model_object.cc
@@ -33,15 +33,15 @@ #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/html/html_body_element.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/geometry/transform_state.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/layout_block.h" #include "third_party/blink/renderer/core/layout/layout_inline.h" #include "third_party/blink/renderer/core/layout/layout_object_inlines.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" +#include "third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h" #include "third_party/blink/renderer/core/layout/table/layout_table_section.h" #include "third_party/blink/renderer/core/page/scrolling/sticky_position_scrolling_constraints.h" #include "third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.h" @@ -415,9 +415,9 @@ if (IsInline() && IsInLayoutNGInlineFormattingContext()) { DCHECK(HasSelfPaintingLayer()); InlineCursor cursor; - NGInlinePaintContext inline_context; + InlinePaintContext inline_context; for (cursor.MoveTo(*this); cursor; cursor.MoveToNextForSameLayoutObject()) { - NGInlinePaintContext::ScopedInlineBoxAncestors scoped_items( + InlinePaintContext::ScopedInlineBoxAncestors scoped_items( cursor, &inline_context); cursor.Current().RecalcInkOverflow(cursor, &inline_context); }
diff --git a/third_party/blink/renderer/core/layout/layout_box_model_object_test.cc b/third_party/blink/renderer/core/layout/layout_box_model_object_test.cc index 1876c2f..a3ba5f9 100644 --- a/third_party/blink/renderer/core/layout/layout_box_model_object_test.cc +++ b/third_party/blink/renderer/core/layout/layout_box_model_object_test.cc
@@ -10,7 +10,7 @@ #include "third_party/blink/renderer/core/dom/dom_token_list.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/html/html_element.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/page/scrolling/sticky_position_scrolling_constraints.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" #include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
diff --git a/third_party/blink/renderer/core/layout/layout_font_accessor_win.cc b/third_party/blink/renderer/core/layout/layout_font_accessor_win.cc index d883e45..6daf456 100644 --- a/third_party/blink/renderer/core/layout/layout_font_accessor_win.cc +++ b/third_party/blink/renderer/core/layout/layout_font_accessor_win.cc
@@ -11,8 +11,8 @@ #include "third_party/blink/renderer/core/layout/layout_box.h" #include "third_party/blink/renderer/core/layout/layout_object.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_link.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment_link.h" #include "third_party/blink/renderer/platform/fonts/font_platform_data.h" #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h" #include "third_party/blink/renderer/platform/fonts/simple_font_data.h"
diff --git a/third_party/blink/renderer/core/layout/layout_inline.cc b/third_party/blink/renderer/core/layout/layout_inline.cc index 5a477d31..798ff05 100644 --- a/third_party/blink/renderer/core/layout/layout_inline.cc +++ b/third_party/blink/renderer/core/layout/layout_inline.cc
@@ -35,12 +35,12 @@ #include "third_party/blink/renderer/core/layout/inline/fragment_item.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/layout_block.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_object_inlines.h" #include "third_party/blink/renderer/core/layout/layout_theme.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" -#include "third_party/blink/renderer/core/layout/ng/ng_outline_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/outline_utils.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/text_autosizer.h" #include "third_party/blink/renderer/core/page/page.h" #include "third_party/blink/renderer/core/paint/box_painter.h" @@ -629,7 +629,7 @@ // up to the fragment itself. Compute this offset. const PhysicalOffset child_offset = accumulated_offset + item.OffsetInContainerFragment(); - NGInlinePaintContext inline_context; + InlinePaintContext inline_context; if (NGBoxFragmentPainter(cursor, item, *box_fragment, &inline_context) .NodeAtPoint(result, hit_test_location, child_offset, accumulated_offset, phase)) {
diff --git a/third_party/blink/renderer/core/layout/layout_inline_test.cc b/third_party/blink/renderer/core/layout/layout_inline_test.cc index 4145934..5c0ae7e 100644 --- a/third_party/blink/renderer/core/layout/layout_inline_test.cc +++ b/third_party/blink/renderer/core/layout/layout_inline_test.cc
@@ -9,7 +9,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/layout_block_flow.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_input_node.cc b/third_party/blink/renderer/core/layout/layout_input_node.cc similarity index 97% rename from third_party/blink/renderer/core/layout/ng/ng_layout_input_node.cc rename to third_party/blink/renderer/core/layout/layout_input_node.cc index 584cf2d..9b7b600 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_input_node.cc +++ b/third_party/blink/renderer/core/layout/layout_input_node.cc
@@ -2,21 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h" +#include "third_party/blink/renderer/core/layout/layout_input_node.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/html/forms/html_input_element.h" #include "third_party/blink/renderer/core/html/shadow/shadow_element_utils.h" #include "third_party/blink/renderer/core/input_type_names.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/geometry/logical_size.h" #include "third_party/blink/renderer/core/layout/inline/inline_node.h" #include "third_party/blink/renderer/core/layout/intrinsic_sizing_info.h" #include "third_party/blink/renderer/core/layout/layout_replaced.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_view.h" #include "third_party/blink/renderer/core/layout/list/layout_list_item.h" #include "third_party/blink/renderer/core/layout/min_max_sizes.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/table/layout_table_cell.h" #include "third_party/blink/renderer/core/layout/table/layout_table_column.h" #include "third_party/blink/renderer/core/layout/table/layout_table_section.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h b/third_party/blink/renderer/core/layout/layout_input_node.h similarity index 97% rename from third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h rename to third_party/blink/renderer/core/layout/layout_input_node.h index 25edcca5..78be66e6 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h +++ b/third_party/blink/renderer/core/layout/layout_input_node.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_LAYOUT_INPUT_NODE_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_LAYOUT_INPUT_NODE_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_INPUT_NODE_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_INPUT_NODE_H_ #include "base/dcheck_is_on.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -323,4 +323,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_LAYOUT_INPUT_NODE_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_INPUT_NODE_H_
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_input_node_test.cc b/third_party/blink/renderer/core/layout/layout_input_node_test.cc similarity index 97% rename from third_party/blink/renderer/core/layout/ng/ng_layout_input_node_test.cc rename to third_party/blink/renderer/core/layout/layout_input_node_test.cc index ddbeb01e..4c124c6 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_input_node_test.cc +++ b/third_party/blink/renderer/core/layout/layout_input_node_test.cc
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h" +#include "third_party/blink/renderer/core/layout/layout_input_node.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/layout_multi_column_flow_thread.cc b/third_party/blink/renderer/core/layout/layout_multi_column_flow_thread.cc index c5904e6..483dcab 100644 --- a/third_party/blink/renderer/core/layout/layout_multi_column_flow_thread.cc +++ b/third_party/blink/renderer/core/layout/layout_multi_column_flow_thread.cc
@@ -32,7 +32,7 @@ #include "third_party/blink/renderer/core/layout/layout_view.h" #include "third_party/blink/renderer/core/layout/multi_column_fragmentainer_group.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/view_fragmentation_context.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/layout_multi_column_set.cc b/third_party/blink/renderer/core/layout/layout_multi_column_set.cc index 043a9766..2ec2621 100644 --- a/third_party/blink/renderer/core/layout/layout_multi_column_set.cc +++ b/third_party/blink/renderer/core/layout/layout_multi_column_set.cc
@@ -32,7 +32,7 @@ #include "third_party/blink/renderer/core/layout/layout_multi_column_spanner_placeholder.h" #include "third_party/blink/renderer/core/layout/multi_column_fragmentainer_group.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.cc b/third_party/blink/renderer/core/layout/layout_ng_block_flow.cc similarity index 96% rename from third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.cc rename to third_party/blink/renderer/core/layout/layout_ng_block_flow.cc index 5ec87a95..baf6657 100644 --- a/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.cc +++ b/third_party/blink/renderer/core/layout/layout_ng_block_flow.cc
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/editing/position_with_affinity.h" #include "third_party/blink/renderer/core/layout/inline/inline_node_data.h" #include "third_party/blink/renderer/core/layout/layout_object.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h b/third_party/blink/renderer/core/layout/layout_ng_block_flow.h similarity index 89% rename from third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h rename to third_party/blink/renderer/core/layout/layout_ng_block_flow.h index 1dce01b..b1b511b 100644 --- a/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h +++ b/third_party/blink/renderer/core/layout/layout_ng_block_flow.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LAYOUT_NG_BLOCK_FLOW_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LAYOUT_NG_BLOCK_FLOW_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_NG_BLOCK_FLOW_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_NG_BLOCK_FLOW_H_ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/layout/layout_block_flow.h" @@ -62,4 +62,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LAYOUT_NG_BLOCK_FLOW_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_NG_BLOCK_FLOW_H_
diff --git a/third_party/blink/renderer/core/layout/layout_object.cc b/third_party/blink/renderer/core/layout/layout_object.cc index 0e79a4f3..08a6c7e 100644 --- a/third_party/blink/renderer/core/layout/layout_object.cc +++ b/third_party/blink/renderer/core/layout/layout_object.cc
@@ -69,6 +69,7 @@ #include "third_party/blink/renderer/core/input/event_handler.h" #include "third_party/blink/renderer/core/inspector/inspector_trace_events.h" #include "third_party/blink/renderer/core/intersection_observer/element_intersection_observer_data.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/custom/layout_custom.h" #include "third_party/blink/renderer/core/layout/flex/layout_flexible_box.h" #include "third_party/blink/renderer/core/layout/forms/layout_fieldset.h" @@ -82,8 +83,10 @@ #include "third_party/blink/renderer/core/layout/layout_image_resource_style_image.h" #include "third_party/blink/renderer/core/layout/layout_inline.h" #include "third_party/blink/renderer/core/layout/layout_multi_column_spanner_placeholder.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_object_inl.h" #include "third_party/blink/renderer/core/layout/layout_object_inlines.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_ruby.h" #include "third_party/blink/renderer/core/layout/layout_ruby_as_block.h" #include "third_party/blink/renderer/core/layout/layout_ruby_column.h" @@ -97,11 +100,8 @@ #include "third_party/blink/renderer/core/layout/list/layout_list_item.h" #include "third_party/blink/renderer/core/layout/list/layout_outside_list_marker.h" #include "third_party/blink/renderer/core/layout/mathml/layout_mathml_block.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/table/layout_table.h" #include "third_party/blink/renderer/core/layout/table/layout_table_caption.h" #include "third_party/blink/renderer/core/layout/table/layout_table_cell.h"
diff --git a/third_party/blink/renderer/core/layout/layout_object.h b/third_party/blink/renderer/core/layout/layout_object.h index aad25bb..0b48785 100644 --- a/third_party/blink/renderer/core/layout/layout_object.h +++ b/third_party/blink/renderer/core/layout/layout_object.h
@@ -49,9 +49,9 @@ #include "third_party/blink/renderer/core/layout/layout_object_child_list.h" #include "third_party/blink/renderer/core/layout/map_coordinates_flags.h" #include "third_party/blink/renderer/core/layout/min_max_sizes.h" -#include "third_party/blink/renderer/core/layout/ng/ng_outline_type.h" #include "third_party/blink/renderer/core/layout/ng/ng_style_variant.h" #include "third_party/blink/renderer/core/layout/outline_rect_collector.h" +#include "third_party/blink/renderer/core/layout/outline_type.h" #include "third_party/blink/renderer/core/layout/selection_state.h" #include "third_party/blink/renderer/core/loader/resource/image_resource_observer.h" #include "third_party/blink/renderer/core/paint/fragment_data.h" @@ -1480,15 +1480,6 @@ return {FlipForWritingModeInternal(p.left, LayoutUnit(), box_for_flipping), p.top}; } - [[nodiscard]] PhysicalOffset FlipForWritingMode( - const LayoutPoint& p, - const LayoutBox* box_for_flipping = nullptr) const { - NOT_DESTROYED(); - if (LIKELY(!HasFlippedBlocksWritingMode())) - return PhysicalOffset(p); - return {FlipForWritingModeInternal(p.X(), LayoutUnit(), box_for_flipping), - p.Y()}; - } bool HasLayer() const { NOT_DESTROYED();
diff --git a/third_party/blink/renderer/core/layout/layout_object_hot.cc b/third_party/blink/renderer/core/layout/layout_object_hot.cc index df217c7..20a8d8a 100644 --- a/third_party/blink/renderer/core/layout/layout_object_hot.cc +++ b/third_party/blink/renderer/core/layout/layout_object_hot.cc
@@ -10,10 +10,10 @@ #include "third_party/blink/renderer/core/layout/layout_box.h" #include "third_party/blink/renderer/core/layout/layout_custom_scrollbar_part.h" #include "third_party/blink/renderer/core/layout/layout_multi_column_spanner_placeholder.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_object_inl.h" #include "third_party/blink/renderer/core/layout/layout_text.h" #include "third_party/blink/renderer/core/layout/layout_text_combine.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/layout_progress.h b/third_party/blink/renderer/core/layout/layout_progress.h index f68e1bc..c312fb9 100644 --- a/third_party/blink/renderer/core/layout/layout_progress.h +++ b/third_party/blink/renderer/core/layout/layout_progress.h
@@ -23,7 +23,7 @@ #include "base/time/time.h" #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/layout_replaced.cc b/third_party/blink/renderer/core/layout/layout_replaced.cc index 8430457..c6cc00e2 100644 --- a/third_party/blink/renderer/core/layout/layout_replaced.cc +++ b/third_party/blink/renderer/core/layout/layout_replaced.cc
@@ -42,7 +42,7 @@ #include "third_party/blink/renderer/core/layout/layout_view_transition_content.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/paint_info.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" #include "third_party/blink/renderer/core/paint/replaced_painter.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_result.cc b/third_party/blink/renderer/core/layout/layout_result.cc similarity index 98% rename from third_party/blink/renderer/core/layout/ng/ng_layout_result.cc rename to third_party/blink/renderer/core/layout/layout_result.cc index e1eabdf..bda2d5b 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_result.cc +++ b/third_party/blink/renderer/core/layout/layout_result.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include <memory> #include <utility> @@ -11,7 +11,7 @@ #include "third_party/blink/renderer/core/layout/inline/line_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_column_spanner_path.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_positioned_float.h" #include "third_party/blink/renderer/platform/geometry/layout_unit.h" #include "third_party/blink/renderer/platform/wtf/size_assertions.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_result.h b/third_party/blink/renderer/core/layout/layout_result.h similarity index 98% rename from third_party/blink/renderer/core/layout/ng/ng_layout_result.h rename to third_party/blink/renderer/core/layout/layout_result.h index 21f8c68c..b636eae6 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_result.h +++ b/third_party/blink/renderer/core/layout/layout_result.h
@@ -2,27 +2,27 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_LAYOUT_RESULT_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_LAYOUT_RESULT_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_RESULT_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_RESULT_H_ #include "base/check_op.h" #include "base/dcheck_is_on.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h" #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/exclusions/exclusion_space.h" #include "third_party/blink/renderer/core/layout/flex/devtools_flex_info.h" #include "third_party/blink/renderer/core/layout/geometry/bfc_offset.h" #include "third_party/blink/renderer/core/layout/geometry/margin_strut.h" #include "third_party/blink/renderer/core/layout/grid/layout_grid.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_break_appeal.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" #include "third_party/blink/renderer/core/layout/ng/ng_early_break.h" #include "third_party/blink/renderer/core/layout/ng/ng_floats_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_link.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment_link.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" #include "third_party/blink/renderer/core/layout/ng/non_overflowing_scroll_range.h" #include "third_party/blink/renderer/core/style/computed_style_constants.h" #include "third_party/blink/renderer/platform/wtf/bit_field.h" @@ -557,6 +557,7 @@ protected: friend class LayoutBox; + friend class MeasureCache; void SetFragmentChildrenInvalid() { layout_result_->physical_fragment_->SetChildrenInvalid(); @@ -1034,4 +1035,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_LAYOUT_RESULT_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_RESULT_H_
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_result_caching_test.cc b/third_party/blink/renderer/core/layout/layout_result_caching_test.cc similarity index 98% rename from third_party/blink/renderer/core/layout/ng/ng_layout_result_caching_test.cc rename to third_party/blink/renderer/core/layout/layout_result_caching_test.cc index 84be8e1..597a4ffd 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_result_caching_test.cc +++ b/third_party/blink/renderer/core/layout/layout_result_caching_test.cc
@@ -4,7 +4,7 @@ #include "third_party/blink/renderer/core/layout/geometry/fragment_geometry.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_layout_utils.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" @@ -1652,7 +1652,8 @@ auto* target1 = To<LayoutBlock>(GetLayoutObjectByElementId("target1")); const LayoutResult* result1 = target1->GetSingleCachedLayoutResult(); - const LayoutResult* measure1 = target1->GetCachedMeasureResult(); + const LayoutResult* measure1 = + target1->GetSingleCachedMeasureResultForTesting(); EXPECT_EQ(measure1->IntrinsicBlockSize(), 100); EXPECT_EQ(result1->GetPhysicalFragment().Size().height, 200); @@ -1700,14 +1701,16 @@ // Both "target1", and "target1" should have only had one "measure" pass // performed. const LayoutResult* result1 = target1->GetSingleCachedLayoutResult(); - const LayoutResult* measure1 = target1->GetCachedMeasureResult(); + const LayoutResult* measure1 = + target1->GetSingleCachedMeasureResultForTesting(); EXPECT_EQ(result1->GetConstraintSpaceForCaching().CacheSlot(), LayoutResultCacheSlot::kMeasure); EXPECT_NE(result1, nullptr); EXPECT_EQ(result1, measure1); const LayoutResult* result2 = target2->GetSingleCachedLayoutResult(); - const LayoutResult* measure2 = target2->GetCachedMeasureResult(); + const LayoutResult* measure2 = + target2->GetSingleCachedMeasureResultForTesting(); EXPECT_EQ(result2->GetConstraintSpaceForCaching().CacheSlot(), LayoutResultCacheSlot::kMeasure); EXPECT_NE(result2, nullptr); @@ -1726,7 +1729,8 @@ // "target" should be stretched, and miss the measure cache. const LayoutResult* result = target->GetSingleCachedLayoutResult(); - const LayoutResult* measure = target->GetCachedMeasureResult(); + const LayoutResult* measure = + target->GetSingleCachedMeasureResultForTesting(); EXPECT_NE(measure, nullptr); EXPECT_NE(result, nullptr); EXPECT_EQ(measure->GetConstraintSpaceForCaching().CacheSlot(), @@ -1748,7 +1752,8 @@ // "target" should be stretched, and miss the measure cache. const LayoutResult* result = target->GetSingleCachedLayoutResult(); - const LayoutResult* measure = target->GetCachedMeasureResult(); + const LayoutResult* measure = + target->GetSingleCachedMeasureResultForTesting(); EXPECT_NE(measure, nullptr); EXPECT_NE(result, nullptr); EXPECT_EQ(measure->GetConstraintSpaceForCaching().CacheSlot(), @@ -1773,7 +1778,8 @@ // "target" should align to the baseline, but hit the cache. const LayoutResult* result = target->GetSingleCachedLayoutResult(); - const LayoutResult* measure = target->GetCachedMeasureResult(); + const LayoutResult* measure = + target->GetSingleCachedMeasureResultForTesting(); EXPECT_EQ(result->GetConstraintSpaceForCaching().CacheSlot(), LayoutResultCacheSlot::kMeasure); EXPECT_NE(result, nullptr); @@ -1795,7 +1801,8 @@ // "target" should align to the baseline, but miss the cache. const LayoutResult* result = target->GetSingleCachedLayoutResult(); - const LayoutResult* measure = target->GetCachedMeasureResult(); + const LayoutResult* measure = + target->GetSingleCachedMeasureResultForTesting(); EXPECT_NE(measure, nullptr); EXPECT_NE(result, nullptr); EXPECT_EQ(measure->GetConstraintSpaceForCaching().CacheSlot(),
diff --git a/third_party/blink/renderer/core/layout/layout_ruby_as_block.h b/third_party/blink/renderer/core/layout/layout_ruby_as_block.h index 404646d..823f28d7d 100644 --- a/third_party/blink/renderer/core/layout/layout_ruby_as_block.h +++ b/third_party/blink/renderer/core/layout/layout_ruby_as_block.h
@@ -6,7 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_RUBY_AS_BLOCK_H_ #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/layout_ruby_base.h b/third_party/blink/renderer/core/layout/layout_ruby_base.h index 40c7e05..7b081d6 100644 --- a/third_party/blink/renderer/core/layout/layout_ruby_base.h +++ b/third_party/blink/renderer/core/layout/layout_ruby_base.h
@@ -6,7 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_RUBY_BASE_H_ #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/layout_ruby_column.h b/third_party/blink/renderer/core/layout/layout_ruby_column.h index 0caa21b..ce852d33 100644 --- a/third_party/blink/renderer/core/layout/layout_ruby_column.h +++ b/third_party/blink/renderer/core/layout/layout_ruby_column.h
@@ -6,7 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_RUBY_COLUMN_H_ #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/layout_ruby_text.h b/third_party/blink/renderer/core/layout/layout_ruby_text.h index 89fc15f9..6eb8b597 100644 --- a/third_party/blink/renderer/core/layout/layout_ruby_text.h +++ b/third_party/blink/renderer/core/layout/layout_ruby_text.h
@@ -6,7 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_RUBY_TEXT_H_ #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/layout_text.cc b/third_party/blink/renderer/core/layout/layout_text.cc index 5c1e9510..c03c5f8 100644 --- a/third_party/blink/renderer/core/layout/layout_text.cc +++ b/third_party/blink/renderer/core/layout/layout_text.cc
@@ -53,11 +53,11 @@ #include "third_party/blink/renderer/core/layout/inline/inline_node.h" #include "third_party/blink/renderer/core/layout/inline/offset_mapping.h" #include "third_party/blink/renderer/core/layout/layout_block.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_object_inlines.h" #include "third_party/blink/renderer/core/layout/layout_text_combine.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_inline_text.h" #include "third_party/blink/renderer/core/layout/text_autosizer.h" #include "third_party/blink/renderer/core/paint/object_paint_invalidator.h"
diff --git a/third_party/blink/renderer/core/layout/layout_text_combine.cc b/third_party/blink/renderer/core/layout/layout_text_combine.cc index fedc88dc..9614323 100644 --- a/third_party/blink/renderer/core/layout/layout_text_combine.cc +++ b/third_party/blink/renderer/core/layout/layout_text_combine.cc
@@ -9,11 +9,11 @@ #include "third_party/blink/renderer/core/layout/geometry/logical_rect.h" #include "third_party/blink/renderer/core/layout/geometry/physical_rect.h" #include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h" +#include "third_party/blink/renderer/core/layout/ink_overflow.h" #include "third_party/blink/renderer/core/layout/inline/fragment_item.h" #include "third_party/blink/renderer/core/layout/inline/inline_node_data.h" #include "third_party/blink/renderer/core/layout/layout_text.h" -#include "third_party/blink/renderer/core/layout/ng/ng_ink_overflow.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/line_relative_rect.h" #include "third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.h" #include "third_party/blink/renderer/platform/fonts/font.h"
diff --git a/third_party/blink/renderer/core/layout/layout_text_combine.h b/third_party/blink/renderer/core/layout/layout_text_combine.h index 97c6cf3..c8fc0115 100644 --- a/third_party/blink/renderer/core/layout/layout_text_combine.h +++ b/third_party/blink/renderer/core/layout/layout_text_combine.h
@@ -7,7 +7,7 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/paint/line_relative_rect.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/layout_text_combine_test.cc b/third_party/blink/renderer/core/layout/layout_text_combine_test.cc index 9d19f42..85a116b8 100644 --- a/third_party/blink/renderer/core/layout/layout_text_combine_test.cc +++ b/third_party/blink/renderer/core/layout/layout_text_combine_test.cc
@@ -12,7 +12,7 @@ #include "third_party/blink/renderer/core/html/html_br_element.h" #include "third_party/blink/renderer/core/layout/inline/fragment_item.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/layout_tree_as_text.cc b/third_party/blink/renderer/core/layout/layout_tree_as_text.cc index d323236..b8ba272 100644 --- a/third_party/blink/renderer/core/layout/layout_tree_as_text.cc +++ b/third_party/blink/renderer/core/layout/layout_tree_as_text.cc
@@ -46,7 +46,7 @@ #include "third_party/blink/renderer/core/layout/layout_view.h" #include "third_party/blink/renderer/core/layout/list/layout_list_item.h" #include "third_party/blink/renderer/core/layout/list/list_marker.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_image.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_inline.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_inline_text.h"
diff --git a/third_party/blink/renderer/core/layout/layout_view.cc b/third_party/blink/renderer/core/layout/layout_view.cc index 1fef940..dbf6ad3 100644 --- a/third_party/blink/renderer/core/layout/layout_view.cc +++ b/third_party/blink/renderer/core/layout/layout_view.cc
@@ -41,17 +41,17 @@ #include "third_party/blink/renderer/core/html/plugin_document.h" #include "third_party/blink/renderer/core/input/event_handler.h" #include "third_party/blink/renderer/core/inspector/inspector_trace_events.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/geometry/transform_state.h" #include "third_party/blink/renderer/core/layout/hit_test_result.h" #include "third_party/blink/renderer/core/layout/layout_counter.h" #include "third_party/blink/renderer/core/layout/layout_embedded_content.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_view_transition_root.h" #include "third_party/blink/renderer/core/layout/list/layout_inline_list_item.h" #include "third_party/blink/renderer/core/layout/list/layout_list_item.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_root.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_text.h" #include "third_party/blink/renderer/core/layout/view_fragmentation_context.h"
diff --git a/third_party/blink/renderer/core/layout/layout_view.h b/third_party/blink/renderer/core/layout/layout_view.h index c28a267..edca8dbd 100644 --- a/third_party/blink/renderer/core/layout/layout_view.h +++ b/third_party/blink/renderer/core/layout/layout_view.h
@@ -29,8 +29,8 @@ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/layout/hit_test_cache.h" #include "third_party/blink/renderer/core/layout/hit_test_result.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_quote.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/scroll/scrollable_area.h" #include "third_party/blink/renderer/platform/graphics/overlay_scrollbar_clip_behavior.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h"
diff --git a/third_party/blink/renderer/core/layout/layout_view_transition_root.h b/third_party/blink/renderer/core/layout/layout_view_transition_root.h index 64c0799..769fedec 100644 --- a/third_party/blink/renderer/core/layout/layout_view_transition_root.h +++ b/third_party/blink/renderer/core/layout/layout_view_transition_root.h
@@ -6,7 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_VIEW_TRANSITION_ROOT_H_ #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h b/third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h similarity index 91% rename from third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h rename to third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h index 59f8fea0d..3383339 100644 --- a/third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h +++ b/third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LEGACY_LAYOUT_TREE_WALKING_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LEGACY_LAYOUT_TREE_WALKING_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LEGACY_LAYOUT_TREE_WALKING_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LEGACY_LAYOUT_TREE_WALKING_H_ #include "third_party/blink/renderer/core/layout/layout_block_flow.h" @@ -64,4 +64,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_LEGACY_LAYOUT_TREE_WALKING_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LEGACY_LAYOUT_TREE_WALKING_H_
diff --git a/third_party/blink/renderer/core/layout/list/README.md b/third_party/blink/renderer/core/layout/list/README.md index ae4f4be..afa05d21 100644 --- a/third_party/blink/renderer/core/layout/list/README.md +++ b/third_party/blink/renderer/core/layout/list/README.md
@@ -139,5 +139,5 @@ [LayoutListItem]: layout_list_item.h [LayoutInsideListMarker]: layout_inside_list_marker.h [LayoutOutsideListMarker]: layout_outside_list_marker.h -[LayoutResult]: ../ng/ng_layout_result.h +[LayoutResult]: ../layout_result.h [PaintLayer]: ../../paint/PaintLayer.h
diff --git a/third_party/blink/renderer/core/layout/list/layout_list_item.cc b/third_party/blink/renderer/core/layout/list/layout_list_item.cc index 9bab328..1fab4e32 100644 --- a/third_party/blink/renderer/core/layout/list/layout_list_item.cc +++ b/third_party/blink/renderer/core/layout/list/layout_list_item.cc
@@ -5,9 +5,9 @@ #include "third_party/blink/renderer/core/layout/list/layout_list_item.h" #include "third_party/blink/renderer/core/layout/layout_view.h" +#include "third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h" #include "third_party/blink/renderer/core/layout/list/layout_inline_list_item.h" #include "third_party/blink/renderer/core/layout/list/list_marker.h" -#include "third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/list/layout_list_item.h b/third_party/blink/renderer/core/layout/list/layout_list_item.h index ae77e08..56275b4 100644 --- a/third_party/blink/renderer/core/layout/list/layout_list_item.h +++ b/third_party/blink/renderer/core/layout/list/layout_list_item.h
@@ -7,7 +7,7 @@ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/html/list_item_ordinal.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/list/layout_outside_list_marker.h b/third_party/blink/renderer/core/layout/list/layout_outside_list_marker.h index 2d28d3f..8557d16 100644 --- a/third_party/blink/renderer/core/layout/list/layout_outside_list_marker.h +++ b/third_party/blink/renderer/core/layout/list/layout_outside_list_marker.h
@@ -6,8 +6,8 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LIST_LAYOUT_OUTSIDE_LIST_MARKER_H_ #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/layout/list/list_marker.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/list/unpositioned_list_marker.cc b/third_party/blink/renderer/core/layout/list/unpositioned_list_marker.cc index 3597c74..0d6f2bd0 100644 --- a/third_party/blink/renderer/core/layout/list/unpositioned_list_marker.cc +++ b/third_party/blink/renderer/core/layout/list/unpositioned_list_marker.cc
@@ -4,13 +4,13 @@ #include "third_party/blink/renderer/core/layout/list/unpositioned_list_marker.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/inline/fragment_items_builder.h" #include "third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/list/layout_outside_list_marker.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/mathml/layout_mathml_block.cc b/third_party/blink/renderer/core/layout/mathml/layout_mathml_block.cc index 35eb8eed..4cf8b3e5 100644 --- a/third_party/blink/renderer/core/layout/mathml/layout_mathml_block.cc +++ b/third_party/blink/renderer/core/layout/mathml/layout_mathml_block.cc
@@ -4,7 +4,7 @@ #include "third_party/blink/renderer/core/layout/mathml/layout_mathml_block.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/mathml/mathml_element.h" #include "third_party/blink/renderer/core/mathml/mathml_under_over_element.h"
diff --git a/third_party/blink/renderer/core/layout/mathml/layout_mathml_block_flow.h b/third_party/blink/renderer/core/layout/mathml/layout_mathml_block_flow.h index a943732a..be3b21f 100644 --- a/third_party/blink/renderer/core/layout/mathml/layout_mathml_block_flow.h +++ b/third_party/blink/renderer/core/layout/mathml/layout_mathml_block_flow.h
@@ -5,7 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_MATHML_LAYOUT_MATHML_BLOCK_FLOW_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_MATHML_LAYOUT_MATHML_BLOCK_FLOW_H_ -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/mathml/math_fraction_layout_algorithm.cc b/third_party/blink/renderer/core/layout/mathml/math_fraction_layout_algorithm.cc index 9ea38eb..28d87a28 100644 --- a/third_party/blink/renderer/core/layout/mathml/math_fraction_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/mathml/math_fraction_layout_algorithm.cc
@@ -8,7 +8,7 @@ #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/fonts/opentype/open_type_math_support.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/mathml/math_layout_utils.cc b/third_party/blink/renderer/core/layout/mathml/math_layout_utils.cc index d9e8f8c7..1160ccd 100644 --- a/third_party/blink/renderer/core/layout/mathml/math_layout_utils.cc +++ b/third_party/blink/renderer/core/layout/mathml/math_layout_utils.cc
@@ -4,11 +4,11 @@ #include "third_party/blink/renderer/core/layout/mathml/math_layout_utils.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/layout_box.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" #include "third_party/blink/renderer/core/mathml/mathml_fraction_element.h" #include "third_party/blink/renderer/core/mathml/mathml_operator_element.h" #include "third_party/blink/renderer/core/mathml/mathml_radical_element.h"
diff --git a/third_party/blink/renderer/core/layout/mathml/math_layout_utils.h b/third_party/blink/renderer/core/layout/mathml/math_layout_utils.h index bfa3c75..6ed8cc57 100644 --- a/third_party/blink/renderer/core/layout/mathml/math_layout_utils.h +++ b/third_party/blink/renderer/core/layout/mathml/math_layout_utils.h
@@ -6,7 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_MATHML_MATH_LAYOUT_UTILS_H_ #include "third_party/abseil-cpp/absl/types/optional.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/fonts/opentype/open_type_math_support.h"
diff --git a/third_party/blink/renderer/core/layout/mathml/math_operator_layout_algorithm.h b/third_party/blink/renderer/core/layout/mathml/math_operator_layout_algorithm.h index fba8fb47..d28f078 100644 --- a/third_party/blink/renderer/core/layout/mathml/math_operator_layout_algorithm.h +++ b/third_party/blink/renderer/core/layout/mathml/math_operator_layout_algorithm.h
@@ -6,8 +6,8 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_MATHML_MATH_OPERATOR_LAYOUT_ALGORITHM_H_ #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_layout_algorithm.h"
diff --git a/third_party/blink/renderer/core/layout/mathml/math_padded_layout_algorithm.cc b/third_party/blink/renderer/core/layout/mathml/math_padded_layout_algorithm.cc index 18dadc5..2266ddc 100644 --- a/third_party/blink/renderer/core/layout/mathml/math_padded_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/mathml/math_padded_layout_algorithm.cc
@@ -9,7 +9,7 @@ #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/mathml_names.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/mathml/math_radical_layout_algorithm.cc b/third_party/blink/renderer/core/layout/mathml/math_radical_layout_algorithm.cc index 335cde8..64e1662 100644 --- a/third_party/blink/renderer/core/layout/mathml/math_radical_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/mathml/math_radical_layout_algorithm.cc
@@ -9,7 +9,7 @@ #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/fonts/shaping/stretchy_operator_shaper.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/mathml/math_row_layout_algorithm.cc b/third_party/blink/renderer/core/layout/mathml/math_row_layout_algorithm.cc index 44cc42b..60fbb2ed 100644 --- a/third_party/blink/renderer/core/layout/mathml/math_row_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/mathml/math_row_layout_algorithm.cc
@@ -11,7 +11,7 @@ #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/mathml/mathml_element.h" #include "third_party/blink/renderer/core/mathml/mathml_operator_element.h"
diff --git a/third_party/blink/renderer/core/layout/mathml/math_row_layout_algorithm.h b/third_party/blink/renderer/core/layout/mathml/math_row_layout_algorithm.h index 95c2364..3f6fbba 100644 --- a/third_party/blink/renderer/core/layout/mathml/math_row_layout_algorithm.h +++ b/third_party/blink/renderer/core/layout/mathml/math_row_layout_algorithm.h
@@ -6,8 +6,8 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_MATHML_MATH_ROW_LAYOUT_ALGORITHM_H_ #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_layout_algorithm.h"
diff --git a/third_party/blink/renderer/core/layout/mathml/math_token_layout_algorithm.h b/third_party/blink/renderer/core/layout/mathml/math_token_layout_algorithm.h index 45d322e..370a07f 100644 --- a/third_party/blink/renderer/core/layout/mathml/math_token_layout_algorithm.h +++ b/third_party/blink/renderer/core/layout/mathml/math_token_layout_algorithm.h
@@ -6,9 +6,9 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_MATHML_MATH_TOKEN_LAYOUT_ALGORITHM_H_ #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_layout_algorithm.h"
diff --git a/third_party/blink/renderer/core/layout/mathml/math_under_over_layout_algorithm.cc b/third_party/blink/renderer/core/layout/mathml/math_under_over_layout_algorithm.cc index 21843cf..b211251 100644 --- a/third_party/blink/renderer/core/layout/mathml/math_under_over_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/mathml/math_under_over_layout_algorithm.cc
@@ -9,7 +9,7 @@ #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/mathml/mathml_operator_element.h" #include "third_party/blink/renderer/core/mathml/mathml_under_over_element.h"
diff --git a/third_party/blink/renderer/core/layout/measure_cache.cc b/third_party/blink/renderer/core/layout/measure_cache.cc new file mode 100644 index 0000000..583a785 --- /dev/null +++ b/third_party/blink/renderer/core/layout/measure_cache.cc
@@ -0,0 +1,75 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/core/layout/measure_cache.h" + +#include "third_party/blink/renderer/core/layout/geometry/fragment_geometry.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" +#include "third_party/blink/renderer/core/layout/ng/ng_layout_utils.h" + +namespace blink { + +const LayoutResult* MeasureCache::Find( + const BlockNode& node, + const ConstraintSpace& new_space, + absl::optional<FragmentGeometry>* fragment_geometry) { + for (auto it = cache_.rbegin(); it != cache_.rend(); ++it) { + const auto* result = it->Get(); + if (CalculateSizeBasedLayoutCacheStatus(node, nullptr, *result, new_space, + fragment_geometry) != + LayoutCacheStatus::kHit) { + continue; + } + + if (it == cache_.rbegin()) { + return result; + } + + // Shift this result to the back of the cache. + cache_.EraseAt(static_cast<wtf_size_t>(std::distance(it, cache_.rend())) - + 1u); + cache_.emplace_back(result); + return result; + } + + return nullptr; +} + +void MeasureCache::Add(const LayoutResult* result) { + if (cache_.size() == kMaxCacheEntries) { + cache_.EraseAt(0); + } + cache_.push_back(result); +} + +void MeasureCache::Clear() { + InvalidateItems(); + cache_.resize(0); +} + +void MeasureCache::LayoutObjectWillBeDestroyed() { + for (auto& entry : cache_) { + entry->GetPhysicalFragment().LayoutObjectWillBeDestroyed(); + } +} + +void MeasureCache::InvalidateItems() { + for (auto& entry : cache_) { + LayoutBox::InvalidateItems(*entry); + } +} + +void MeasureCache::SetFragmentChildrenInvalid(const LayoutResult* except) { + for (auto& entry : cache_) { + if (entry != except) { + entry->GetMutableForLayoutBoxCachedResults().SetFragmentChildrenInvalid(); + } + } +} + +const LayoutResult* MeasureCache::GetLastForTesting() const { + return cache_.empty() ? nullptr : cache_.back().Get(); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/core/layout/measure_cache.h b/third_party/blink/renderer/core/layout/measure_cache.h new file mode 100644 index 0000000..fb9b4e007 --- /dev/null +++ b/third_party/blink/renderer/core/layout/measure_cache.h
@@ -0,0 +1,58 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_MEASURE_CACHE_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_MEASURE_CACHE_H_ + +#include "third_party/abseil-cpp/absl/types/optional.h" +#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" +#include "third_party/blink/renderer/platform/heap/garbage_collected.h" +#include "third_party/blink/renderer/platform/heap/member.h" + +namespace blink { + +class LayoutResult; +class ConstraintSpace; +class BlockNode; +struct FragmentGeometry; + +// Implements an N-way LRU cache for "measure" layout results. +// +// Some layout algorithms (grid in particular) will measure an element multiple +// times with different constraint spaces. +// +// This cache is designed to handle these multiple measure passes. +class MeasureCache final : public GarbageCollected<MeasureCache> { + public: + // A single layout pass of[1] can add up to 6 entries into this cache due to + // grid's multi-pass algorithm. + // + // [1] perf_tests/layout/grid-with-block-constraints-dependence.html + static constexpr unsigned kMaxCacheEntries = 8; + + void Trace(Visitor* visitor) const { visitor->Trace(cache_); } + + // Finds a layout result match. Performs a full size-based cache test, + // potentially populating `fragment_geometry`. + const LayoutResult* Find(const BlockNode& node, + const ConstraintSpace& new_space, + absl::optional<FragmentGeometry>* fragment_geometry); + + void Add(const LayoutResult* result); + + void Clear(); + + void InvalidateItems(); + void LayoutObjectWillBeDestroyed(); + void SetFragmentChildrenInvalid(const LayoutResult* except); + + const LayoutResult* GetLastForTesting() const; + + private: + HeapVector<Member<const LayoutResult>, 2> cache_; +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_MEASURE_CACHE_H_
diff --git a/third_party/blink/renderer/core/layout/min_max_sizes_cache.h b/third_party/blink/renderer/core/layout/min_max_sizes_cache.h index 91b7681a..08dc3be0 100644 --- a/third_party/blink/renderer/core/layout/min_max_sizes_cache.h +++ b/third_party/blink/renderer/core/layout/min_max_sizes_cache.h
@@ -24,7 +24,11 @@ // This cache is designed to handle these cases. class MinMaxSizesCache final : public GarbageCollected<MinMaxSizesCache> { public: - static constexpr unsigned kMaxCacheEntries = 4; + // A single layout pass of[1] can add up to 10 entries into this cache due to + // grid's multi-pass algorithm. + // + // [1] perf_tests/layout/grid-with-block-constraints-dependence.html + static constexpr unsigned kMaxCacheEntries = 8; void Trace(Visitor*) const {} @@ -79,7 +83,7 @@ void Clear() { cache_.resize(0); } private: - Vector<Entry, kMaxCacheEntries> cache_; + Vector<Entry, 2> cache_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/ng/BlockLayout.md b/third_party/blink/renderer/core/layout/ng/BlockLayout.md index b874335..d6d2ebf9 100644 --- a/third_party/blink/renderer/core/layout/ng/BlockLayout.md +++ b/third_party/blink/renderer/core/layout/ng/BlockLayout.md
@@ -13,7 +13,7 @@ Our block layout implementation is based on the principle that children place *themselves* within the block formatting context. This information is -communicated with the optional [LayoutResult::BfcOffset](https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/layout/ng/ng_layout_result.h). +communicated with the optional [LayoutResult::BfcOffset](https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/layout/layout_result.h). A child's BFCOffset is optional as empty blocks cannot place themselves within the BFC. They may be affected by siblings.
diff --git a/third_party/blink/renderer/core/layout/ng/README.md b/third_party/blink/renderer/core/layout/ng/README.md index b88539b..ed2c1d6 100644 --- a/third_party/blink/renderer/core/layout/ng/README.md +++ b/third_party/blink/renderer/core/layout/ng/README.md
@@ -17,16 +17,16 @@ The input to an [NGLayoutAlgorithm](ng_layout_algorithm.h) is the same tuple for every kind of layout: - - The [BlockNode](ng_block_node.h) which we are currently performing layout for. The + - The [BlockNode](../block_node.h) which we are currently performing layout for. The following information is accessed: - The [ComputedStyle](../../style/ComputedStyle.h) for the node which we are currently performing laying for. - - The list of children [BlockNode](ng_block_node.h)es to perform layout upon, and their + - The list of children [BlockNode](../block_node.h)es to perform layout upon, and their respective style objects. - - The [ConstraintSpace](ng_constraint_space.h) which represents the "space" + - The [ConstraintSpace](../constraint_space.h) which represents the "space" in which the current layout should produce a [PhysicalFragment](ng_physical_fragment.h). @@ -79,7 +79,7 @@ Here's how it works: * We store the input constraint space and the resulting fragment on the - [LayoutNGBlockFlow](layout_ng_block_flow.h). However, we only do that if + [LayoutNGBlockFlow](../layout_ng_block_flow.h). However, we only do that if we have no break token to simplify the initial implementation. We call `LayoutNGBlockFlow::SetCachedLayoutResult` from `BlockNode::Layout`. * Once cached, `BlockNode::Layout` checks at the beginning if we already
diff --git a/third_party/blink/renderer/core/layout/ng/block-fragmentation-tutorial.md b/third_party/blink/renderer/core/layout/ng/block-fragmentation-tutorial.md index f009b5b..1c47c0a 100644 --- a/third_party/blink/renderer/core/layout/ng/block-fragmentation-tutorial.md +++ b/third_party/blink/renderer/core/layout/ng/block-fragmentation-tutorial.md
@@ -69,7 +69,7 @@ content is taller than the fragmentainer, there's really nothing we can do about it. -[GetConstraintSpace().HasBlockFragmentation()](ng_constraint_space.h) returns +[GetConstraintSpace().HasBlockFragmentation()](../constraint_space.h) returns true for anything that *participates* in block fragmentation. A multicol container *establishes* a [fragmentation context](https://www.w3.org/TR/css-break-3/#fragmentation-context). It is a @@ -113,7 +113,7 @@ how much space we can use before we need to insert a break. See [FragmentainerSpaceLeft()](ng_fragmentation_utils.h). If content is [monolithic](https://www.w3.org/TR/css-break-3/#monolithic) (i.e. truly -unbreakable), [LayoutInputNode::IsMonolithic()](ng_layout_input_node.h) will +unbreakable), [LayoutInputNode::IsMonolithic()](../layout_input_node.h) will return true. Being monolithic means that we cannot break inside the element (but we may break before or after it). @@ -158,7 +158,7 @@ for each unfinished child. Block break tokens form a tree. Children are found in [BlockBreakToken::ChildBreakTokens()](ng_block_break_token.h). These will need to be resumed and laid out by passing the corresponding child break token - to [LayoutInputNode::Layout()](ng_layout_input_node.h). When done with all + to [LayoutInputNode::Layout()](../layout_input_node.h). When done with all the incoming child break tokens, and as long as we didn't break again, proceed with the consecutive siblings of the node associated with the last incoming child break token. @@ -230,7 +230,7 @@ As mentioned earlier, normally the right thing to do before performing block fragmentation steps is to check if -[GetConstraintSpace().HasBlockFragmentation()](ng_constraint_space.h) returns +[GetConstraintSpace().HasBlockFragmentation()](../constraint_space.h) returns true, but there are situations where we may already have generated fragments from a node, but need to stop it from fragmenting any further. This happens when overflow is clipped
diff --git a/third_party/blink/renderer/core/layout/ng/layout_box_utils.cc b/third_party/blink/renderer/core/layout/ng/layout_box_utils.cc index 0cddd16..d0f321aa 100644 --- a/third_party/blink/renderer/core/layout/ng/layout_box_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/layout_box_utils.cc
@@ -4,16 +4,16 @@ #include "third_party/blink/renderer/core/layout/ng/layout_box_utils.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/geometry/box_strut.h" #include "third_party/blink/renderer/core/layout/geometry/static_position.h" #include "third_party/blink/renderer/core/layout/layout_block.h" #include "third_party/blink/renderer/core/layout/layout_box.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_absolute_utils.cc b/third_party/blink/renderer/core/layout/ng/ng_absolute_utils.cc index b6edf24..df1f9841 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_absolute_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_absolute_utils.cc
@@ -5,11 +5,12 @@ #include "third_party/blink/renderer/core/layout/ng/ng_absolute_utils.h" #include <algorithm> + +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/geometry/static_position.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/style/computed_style.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_absolute_utils.h b/third_party/blink/renderer/core/layout/ng/ng_absolute_utils.h index fae7cc91..012f503f 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_absolute_utils.h +++ b/third_party/blink/renderer/core/layout/ng/ng_absolute_utils.h
@@ -10,7 +10,7 @@ #include "third_party/blink/renderer/core/layout/geometry/logical_size.h" #include "third_party/blink/renderer/core/layout/geometry/physical_size.h" #include "third_party/blink/renderer/core/layout/min_max_sizes.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/geometry/layout_unit.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_absolute_utils_test.cc b/third_party/blink/renderer/core/layout/ng/ng_absolute_utils_test.cc index a8e2df42..3c769a6 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_absolute_utils_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_absolute_utils_test.cc
@@ -4,10 +4,10 @@ #include "third_party/blink/renderer/core/layout/ng/ng_absolute_utils.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/geometry/static_position.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_anchor_query_map.cc b/third_party/blink/renderer/core/layout/ng/ng_anchor_query_map.cc index 99f53d0..3b67f59 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_anchor_query_map.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_anchor_query_map.cc
@@ -7,7 +7,7 @@ #include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/ng/ng_logical_link.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_anchor_query_test.cc b/third_party/blink/renderer/core/layout/ng/ng_anchor_query_test.cc index 9509a7d..31c33033 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_anchor_query_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_anchor_query_test.cc
@@ -7,7 +7,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "third_party/blink/renderer/core/dom/dom_token_list.h" #include "third_party/blink/renderer/core/layout/layout_block_flow.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.cc b/third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.cc index b313aec..17f479c 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.cc
@@ -5,14 +5,14 @@ #include "third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.h" #include "third_party/blink/renderer/core/dom/element.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.h b/third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.h index 81bcd2b..fe860e1 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.h +++ b/third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.h
@@ -6,8 +6,8 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_BASE_LAYOUT_ALGORITHM_TEST_H_ #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/geometry/logical_size.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" #include "third_party/blink/renderer/platform/text/text_direction.h" #include "third_party/blink/renderer/platform/text/writing_mode.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.cc b/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.cc index 73cad6d..1486efc 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.cc
@@ -4,10 +4,10 @@ #include "third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/inline/inline_break_token.h" +#include "third_party/blink/renderer/core/layout/layout_input_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.h b/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.h index af3c4db..a4d9377 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.h +++ b/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.h
@@ -7,7 +7,7 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h" +#include "third_party/blink/renderer/core/layout/layout_input_node.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator_test.cc b/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator_test.cc index caa270c..985f187 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator_test.cc
@@ -6,11 +6,11 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/renderer/core/css/style_engine.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc index 65f423c..a54cc1c 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc
@@ -11,31 +11,31 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/html/forms/html_input_element.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/inline/inline_node.h" #include "third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h" #include "third_party/blink/renderer/core/layout/layout_multi_column_flow_thread.h" #include "third_party/blink/renderer/core/layout/layout_object.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" +#include "third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h" #include "third_party/blink/renderer/core/layout/list/unpositioned_list_marker.h" -#include "third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_column_spanner_path.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_early_break.h" #include "third_party/blink/renderer/core/layout/ng/ng_floats_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_positioned_float.h" -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" #include "third_party/blink/renderer/core/layout/table/table_layout_utils.h" #include "third_party/blink/renderer/core/mathml/mathml_element.h" #include "third_party/blink/renderer/core/mathml_names.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.h b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.h index 2b30132b..d0991b18 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.h +++ b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.h
@@ -8,15 +8,15 @@ #include "base/memory/scoped_refptr.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/exclusions/exclusion_space.h" #include "third_party/blink/renderer/core/layout/geometry/margin_strut.h" #include "third_party/blink/renderer/core/layout/inline/inline_child_layout_context.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_floats_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_layout_algorithm.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h" #include "third_party/blink/renderer/platform/geometry/layout_unit.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc index 7d86377..4a014459 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc
@@ -8,16 +8,16 @@ #include "third_party/blink/renderer/core/dom/dom_token_list.h" #include "third_party/blink/renderer/core/dom/node_computed_style.h" #include "third_party/blink/renderer/core/dom/tag_collection.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" #include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_box_fragment.cc b/third_party/blink/renderer/core/layout/ng/ng_box_fragment.cc index 3551310c..9446dd27e 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_box_fragment.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_box_fragment.cc
@@ -4,10 +4,10 @@ #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h" #include "third_party/blink/renderer/core/layout/layout_box.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_box_fragment.h b/third_party/blink/renderer/core/layout/ng/ng_box_fragment.h index 6b7e4642..c96e62f 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_box_fragment.h +++ b/third_party/blink/renderer/core/layout/ng/ng_box_fragment.h
@@ -8,7 +8,7 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/text/writing_mode.h" #include "third_party/blink/renderer/platform/wtf/casting.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc b/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc index 06c60ba..a8cffae7 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc
@@ -4,22 +4,22 @@ #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/exclusions/exclusion_space.h" #include "third_party/blink/renderer/core/layout/inline/inline_break_token.h" #include "third_party/blink/renderer/core/layout/inline/inline_node.h" #include "third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h" #include "third_party/blink/renderer/core/layout/layout_object.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_column_spanner_path.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_positioned_float.h" #include "third_party/blink/renderer/core/layout/ng/ng_relative_utils.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h b/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h index 1bfae73..4d51806d 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h +++ b/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h
@@ -9,21 +9,21 @@ #include "base/dcheck_is_on.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/flex/devtools_flex_info.h" #include "third_party/blink/renderer/core/layout/geometry/box_sides.h" #include "third_party/blink/renderer/core/layout/geometry/box_strut.h" #include "third_party/blink/renderer/core/layout/geometry/fragment_geometry.h" #include "third_party/blink/renderer/core/layout/geometry/physical_rect.h" #include "third_party/blink/renderer/core/layout/inline/fragment_items_builder.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/mathml/mathml_paint_info.h" #include "third_party/blink/renderer/core/layout/ng/frame_set_layout_data.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" +#include "third_party/blink/renderer/core/layout/scrollable_overflow_calculator.h" #include "third_party/blink/renderer/core/layout/table/table_borders.h" #include "third_party/blink/renderer/core/layout/table/table_fragment_data.h" #include "third_party/blink/renderer/core/style/computed_style_constants.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_break_token.h b/third_party/blink/renderer/core/layout/ng/ng_break_token.h index d3783e4..de7f347c 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_break_token.h +++ b/third_party/blink/renderer/core/layout/ng/ng_break_token.h
@@ -8,7 +8,7 @@ #include "base/check_op.h" #include "base/dcheck_is_on.h" #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h" +#include "third_party/blink/renderer/core/layout/layout_input_node.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc index 74202a3..5629f819 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc
@@ -5,6 +5,8 @@ #include "third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.h" #include <algorithm> + +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/geometry/fragment_geometry.h" #include "third_party/blink/renderer/core/layout/geometry/logical_size.h" #include "third_party/blink/renderer/core/layout/geometry/margin_strut.h" @@ -13,11 +15,10 @@ #include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_column_spanner_path.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/table/table_layout_utils.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm_test.cc b/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm_test.cc index f00cb00..1c415db 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm_test.cc
@@ -8,7 +8,7 @@ #include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_column_spanner_path.h b/third_party/blink/renderer/core/layout/ng/ng_column_spanner_path.h index 1a6d5bb..c3cb827 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_column_spanner_path.h +++ b/third_party/blink/renderer/core/layout/ng/ng_column_spanner_path.h
@@ -5,7 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_COLUMN_SPANNER_PATH_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_COLUMN_SPANNER_PATH_H_ -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" +#include "third_party/blink/renderer/core/layout/block_node.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_early_break.h b/third_party/blink/renderer/core/layout/ng/ng_early_break.h index 4c4704c..799e5f6 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_early_break.h +++ b/third_party/blink/renderer/core/layout/ng/ng_early_break.h
@@ -7,7 +7,7 @@ #include "base/check_op.h" #include "base/memory/scoped_refptr.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_break_appeal.h" #include "third_party/blink/renderer/platform/wtf/gc_plugin.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm.cc index 4ea0feb6..6db8abe 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm.cc
@@ -4,18 +4,18 @@ #include "third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_fieldset_break_token_data.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm_test.cc b/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm_test.cc index fdf15a2..6649cdb8 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm_test.cc
@@ -7,7 +7,7 @@ #include "third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_floats_utils.cc b/third_party/blink/renderer/core/layout/ng/ng_floats_utils.cc index b231c01..0f3cba2 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_floats_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_floats_utils.cc
@@ -5,20 +5,20 @@ #include "third_party/blink/renderer/core/layout/ng/ng_floats_utils.h" #include "third_party/blink/renderer/core/frame/local_frame_view.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/layout_box.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/min_max_sizes.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_positioned_float.h" -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" #include "third_party/blink/renderer/core/style/computed_style.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_fragment.h b/third_party/blink/renderer/core/layout/ng/ng_fragment.h index 163522ae..2ec1be3 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_fragment.h +++ b/third_party/blink/renderer/core/layout/ng/ng_fragment.h
@@ -6,7 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_FRAGMENT_H_ #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" #include "third_party/blink/renderer/platform/geometry/layout_unit.h" #include "third_party/blink/renderer/platform/text/writing_direction_mode.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_fragment_builder.cc b/third_party/blink/renderer/core/layout/ng/ng_fragment_builder.cc index fcd78028..8eff99a 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_fragment_builder.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_fragment_builder.cc
@@ -7,8 +7,8 @@ #include "base/containers/contains.h" #include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom-shared.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" #include "third_party/blink/renderer/core/style/computed_style_base_constants.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_fragment_builder.h b/third_party/blink/renderer/core/layout/ng/ng_fragment_builder.h index ab63370..4677e10f 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_fragment_builder.h +++ b/third_party/blink/renderer/core/layout/ng/ng_fragment_builder.h
@@ -7,16 +7,16 @@ #include "base/memory/scoped_refptr.h" #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/geometry/logical_size.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/list/unpositioned_list_marker.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_break_appeal.h" #include "third_party/blink/renderer/core/layout/ng/ng_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_logical_link.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_style_variant.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" #include "third_party/blink/renderer/core/scroll/scroll_start_targets.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_fragment_repeater.cc b/third_party/blink/renderer/core/layout/ng/ng_fragment_repeater.cc index 3e7be67..2a25fe75 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_fragment_repeater.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_fragment_repeater.cc
@@ -7,10 +7,10 @@ #include "third_party/blink/renderer/core/layout/inline/fragment_items.h" #include "third_party/blink/renderer/core/layout/inline/physical_line_box_fragment.h" #include "third_party/blink/renderer/core/layout/layout_box.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" -#include "third_party/blink/renderer/core/layout/ng/ng_link.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment_link.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_fragmentation_test.cc b/third_party/blink/renderer/core/layout/ng/ng_fragmentation_test.cc index 2bead13..34c8f895 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_fragmentation_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_fragmentation_test.cc
@@ -5,7 +5,7 @@ #include "third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.cc b/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.cc index 2e1604f..b6074233 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.cc
@@ -7,13 +7,13 @@ #include "base/containers/adapters.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/dom/element.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/style/computed_style.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h b/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h index bbb6b9a..1161e34 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h +++ b/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h
@@ -6,15 +6,15 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_FRAGMENTATION_UTILS_H_ #include "third_party/abseil-cpp/absl/types/optional.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/geometry/box_strut.h" #include "third_party/blink/renderer/core/layout/inline/inline_break_token.h" #include "third_party/blink/renderer/core/layout/inline/inline_item.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_column_spanner_path.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" #include "third_party/blink/renderer/core/style/computed_style_constants.h" #include "third_party/blink/renderer/platform/geometry/layout_unit.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_inline_layout_test.cc b/third_party/blink/renderer/core/layout/ng/ng_inline_layout_test.cc index 1368acf..aec8c97 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_inline_layout_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_inline_layout_test.cc
@@ -3,11 +3,11 @@ // found in the LICENSE file. #include "third_party/blink/renderer/core/exported/web_view_impl.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/inline/inline_node.h" #include "third_party/blink/renderer/core/layout/layout_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/testing/sim/sim_compositor.h" #include "third_party/blink/renderer/core/testing/sim/sim_request.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_algorithm.h b/third_party/blink/renderer/core/layout/ng/ng_layout_algorithm.h index a75aab2c..a39a972 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_algorithm.h +++ b/third_party/blink/renderer/core/layout/ng/ng_layout_algorithm.h
@@ -6,10 +6,10 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_LAYOUT_ALGORITHM_H_ #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/min_max_sizes.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_utils.cc b/third_party/blink/renderer/core/layout/ng/ng_layout_utils.cc index 018046a..04573e03 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_layout_utils.cc
@@ -5,12 +5,12 @@ #include "third_party/blink/renderer/core/layout/ng/ng_layout_utils.h" #include "third_party/blink/renderer/core/html/html_element.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_utils.h b/third_party/blink/renderer/core/layout/ng/ng_layout_utils.h index 46a59ec..f9ffe8b 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_utils.h +++ b/third_party/blink/renderer/core/layout/ng/ng_layout_utils.h
@@ -6,7 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_LAYOUT_UTILS_H_ #include "third_party/abseil-cpp/absl/types/optional.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" +#include "third_party/blink/renderer/core/layout/block_node.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_length_utils.cc b/third_party/blink/renderer/core/layout/ng/ng_length_utils.cc index 994b12d2..4f42a8937 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_length_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_length_utils.cc
@@ -7,15 +7,15 @@ #include <algorithm> #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/html/html_element.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/geometry/box_strut.h" #include "third_party/blink/renderer/core/layout/geometry/logical_size.h" #include "third_party/blink/renderer/core/layout/layout_box.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_root.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/geometry/layout_unit.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_length_utils.h b/third_party/blink/renderer/core/layout/ng/ng_length_utils.h index ccb042752..2014118 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_length_utils.h +++ b/third_party/blink/renderer/core/layout/ng/ng_length_utils.h
@@ -7,13 +7,13 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/geometry/box_strut.h" #include "third_party/blink/renderer/core/layout/geometry/fragment_geometry.h" #include "third_party/blink/renderer/core/layout/geometry/logical_size.h" #include "third_party/blink/renderer/core/layout/geometry/physical_size.h" #include "third_party/blink/renderer/core/layout/min_max_sizes.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" #include "third_party/blink/renderer/core/layout/table/table_node.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/core/style/computed_style_constants.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_length_utils_test.cc b/third_party/blink/renderer/core/layout/ng/ng_length_utils_test.cc index d985afb..22bf319 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_length_utils_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_length_utils_test.cc
@@ -6,9 +6,9 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/renderer/core/css/resolver/style_resolver.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" #include "third_party/blink/renderer/platform/geometry/calculation_value.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc index 2aa5e22..19df29bb 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc
@@ -10,6 +10,7 @@ #include "third_party/blink/renderer/core/dom/node_computed_style.h" #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/layout/anchor_position_scroll_data.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h" #include "third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/grid/grid_placement.h" @@ -18,20 +19,19 @@ #include "third_party/blink/renderer/core/layout/layout_box.h" #include "third_party/blink/renderer/core/layout/layout_inline.h" #include "third_party/blink/renderer/core/layout/layout_object.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_view.h" +#include "third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h" #include "third_party/blink/renderer/core/layout/ng/layout_box_utils.h" -#include "third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h" #include "third_party/blink/renderer/core/layout/ng/ng_absolute_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_anchor_query_map.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_disable_side_effects_scope.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_simplified_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/ng/ng_simplified_oof_layout_algorithm.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" #include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h" #include "third_party/blink/renderer/core/style/computed_style.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h index aab18383..a49483ee 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h +++ b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h
@@ -7,14 +7,14 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/geometry/logical_rect.h" #include "third_party/blink/renderer/core/layout/geometry/physical_offset.h" #include "third_party/blink/renderer/core/layout/geometry/static_position.h" #include "third_party/blink/renderer/core/layout/inline/inline_containing_block_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_absolute_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" #include "third_party/blink/renderer/core/layout/ng/non_overflowing_scroll_range.h" #include "third_party/blink/renderer/core/style/computed_style_base_constants.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part_test.cc b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part_test.cc index a16d953..1e4aa45 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part_test.cc
@@ -4,12 +4,12 @@ #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/layout_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_base_layout_algorithm_test.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.h b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.h index 625d69b..a0f673b 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.h +++ b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.h
@@ -7,10 +7,10 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/geometry/static_position.h" #include "third_party/blink/renderer/core/layout/layout_inline.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_page_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_page_layout_algorithm.cc index 72a0568..1a8d526 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_page_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_page_layout_algorithm.cc
@@ -5,13 +5,14 @@ #include "third_party/blink/renderer/core/layout/ng/ng_page_layout_algorithm.h" #include <algorithm> + +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/layout_view.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/style/computed_style.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_positioned_float.h b/third_party/blink/renderer/core/layout/ng/ng_positioned_float.h index aaafd821..a92fa7e 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_positioned_float.h +++ b/third_party/blink/renderer/core/layout/ng/ng_positioned_float.h
@@ -8,7 +8,7 @@ #include "base/memory/scoped_refptr.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/layout/geometry/bfc_offset.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_relative_utils.cc b/third_party/blink/renderer/core/layout/ng/ng_relative_utils.cc index d37546d..c321371 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_relative_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_relative_utils.cc
@@ -5,10 +5,10 @@ #include "third_party/blink/renderer/core/layout/ng/ng_relative_utils.h" #include "third_party/abseil-cpp/absl/types/optional.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/geometry/physical_offset.h" #include "third_party/blink/renderer/core/layout/geometry/physical_size.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/geometry/length_functions.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_relative_utils.h b/third_party/blink/renderer/core/layout/ng/ng_relative_utils.h index aaf1025..324c00b 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_relative_utils.h +++ b/third_party/blink/renderer/core/layout/ng/ng_relative_utils.h
@@ -8,7 +8,7 @@ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/layout/geometry/logical_size.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/text/text_direction.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_simplified_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_simplified_layout_algorithm.cc index d4381c8f..2931ea5 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_simplified_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_simplified_layout_algorithm.cc
@@ -4,19 +4,19 @@ #include "third_party/blink/renderer/core/layout/ng/ng_simplified_layout_algorithm.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_relative_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_simplified_oof_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_simplified_oof_layout_algorithm.cc index 0caa4e5..2b0037e 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_simplified_oof_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_simplified_oof_layout_algorithm.cc
@@ -5,11 +5,11 @@ #include "third_party/blink/renderer/core/layout/ng/ng_simplified_oof_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_relative_utils.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h b/third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h index ba0917e..98cda1f 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h +++ b/third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h
@@ -7,12 +7,12 @@ #include "base/memory/scoped_refptr.h" #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/geometry/bfc_offset.h" #include "third_party/blink/renderer/core/layout/geometry/box_strut.h" #include "third_party/blink/renderer/core/layout/geometry/logical_size.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/core/style/computed_style_constants.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_outline_type.h b/third_party/blink/renderer/core/layout/outline_type.h similarity index 77% rename from third_party/blink/renderer/core/layout/ng/ng_outline_type.h rename to third_party/blink/renderer/core/layout/outline_type.h index 1d69de8..6cffd1a 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_outline_type.h +++ b/third_party/blink/renderer/core/layout/outline_type.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_OUTLINE_TYPE_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_OUTLINE_TYPE_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_OUTLINE_TYPE_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_OUTLINE_TYPE_H_ namespace blink { @@ -25,4 +25,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_OUTLINE_TYPE_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_OUTLINE_TYPE_H_
diff --git a/third_party/blink/renderer/core/layout/ng/ng_outline_utils.cc b/third_party/blink/renderer/core/layout/outline_utils.cc similarity index 89% rename from third_party/blink/renderer/core/layout/ng/ng_outline_utils.cc rename to third_party/blink/renderer/core/layout/outline_utils.cc index f1b04ff..a0951f9d 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_outline_utils.cc +++ b/third_party/blink/renderer/core/layout/outline_utils.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_outline_utils.h" +#include "third_party/blink/renderer/core/layout/outline_utils.h" #include "third_party/blink/renderer/core/layout/layout_theme.h" #include "third_party/blink/renderer/core/style/computed_style.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_outline_utils.h b/third_party/blink/renderer/core/layout/outline_utils.h similarity index 72% rename from third_party/blink/renderer/core/layout/ng/ng_outline_utils.h rename to third_party/blink/renderer/core/layout/outline_utils.h index b4b5a97..3bd5b95 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_outline_utils.h +++ b/third_party/blink/renderer/core/layout/outline_utils.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_OUTLINE_UTILS_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_OUTLINE_UTILS_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_OUTLINE_UTILS_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_OUTLINE_UTILS_H_ namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc b/third_party/blink/renderer/core/layout/physical_box_fragment.cc similarity index 99% rename from third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc rename to third_party/blink/renderer/core/layout/physical_box_fragment.cc index 16089a0c..9d041e9 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc +++ b/third_party/blink/renderer/core/layout/physical_box_fragment.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "build/chromeos_buildflags.h" #include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h" @@ -25,8 +25,8 @@ #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_disable_side_effects_scope.h" -#include "third_party/blink/renderer/core/layout/ng/ng_outline_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_relative_utils.h" +#include "third_party/blink/renderer/core/layout/outline_utils.h" #include "third_party/blink/renderer/core/layout/table/layout_table_cell.h" #include "third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.h" #include "third_party/blink/renderer/core/paint/outline_painter.h" @@ -1124,7 +1124,7 @@ PhysicalRect contents_rect; if (const FragmentItems* items = Items()) { InlineCursor cursor(*this, *items); - NGInlinePaintContext child_inline_context; + InlinePaintContext child_inline_context; contents_rect = FragmentItem::RecalcInkOverflowForCursor( &cursor, &child_inline_context);
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h b/third_party/blink/renderer/core/layout/physical_box_fragment.h similarity index 98% rename from third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h rename to third_party/blink/renderer/core/layout/physical_box_fragment.h index 6e7438a..6b64b64c 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h +++ b/third_party/blink/renderer/core/layout/physical_box_fragment.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_PHYSICAL_BOX_FRAGMENT_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_PHYSICAL_BOX_FRAGMENT_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_PHYSICAL_BOX_FRAGMENT_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_PHYSICAL_BOX_FRAGMENT_H_ #include "base/dcheck_is_on.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -14,8 +14,8 @@ #include "third_party/blink/renderer/core/layout/inline/fragment_items.h" #include "third_party/blink/renderer/core/layout/mathml/mathml_paint_info.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment_rare_data.h" #include "third_party/blink/renderer/core/layout/table/table_borders.h" #include "third_party/blink/renderer/core/layout/table/table_fragment_data.h" #include "third_party/blink/renderer/core/style/style_overflow_clip_margin.h" @@ -646,4 +646,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_PHYSICAL_BOX_FRAGMENT_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_PHYSICAL_BOX_FRAGMENT_H_
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment_test.cc b/third_party/blink/renderer/core/layout/physical_box_fragment_test.cc similarity index 98% rename from third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment_test.cc rename to third_party/blink/renderer/core/layout/physical_box_fragment_test.cc index 01eca77..edd0dc4 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment_test.cc +++ b/third_party/blink/renderer/core/layout/physical_box_fragment_test.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/geometry/physical_offset.h" #include "third_party/blink/renderer/core/layout/geometry/physical_rect.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc b/third_party/blink/renderer/core/layout/physical_fragment.cc similarity index 98% rename from third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc rename to third_party/blink/renderer/core/layout/physical_fragment.cc index b9472b5..5aadd6a 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc +++ b/third_party/blink/renderer/core/layout/physical_fragment.cc
@@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "base/ranges/algorithm.h" #include "third_party/blink/renderer/core/dom/document_lifecycle.h" #include "third_party/blink/renderer/core/html/shadow/shadow_element_utils.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/geometry/box_strut.h" #include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" @@ -16,10 +17,9 @@ #include "third_party/blink/renderer/core/layout/layout_block.h" #include "third_party/blink/renderer/core/layout/layout_text_combine.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/scrollable_overflow_calculator.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h" #include "third_party/blink/renderer/platform/wtf/size_assertions.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h b/third_party/blink/renderer/core/layout/physical_fragment.h similarity index 98% rename from third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h rename to third_party/blink/renderer/core/layout/physical_fragment.h index 7ea99ee..cc958891 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h +++ b/third_party/blink/renderer/core/layout/physical_fragment.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_PHYSICAL_FRAGMENT_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_PHYSICAL_FRAGMENT_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_PHYSICAL_FRAGMENT_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_PHYSICAL_FRAGMENT_H_ #include <unicode/ubidi.h> @@ -21,9 +21,9 @@ #include "third_party/blink/renderer/core/layout/layout_inline.h" #include "third_party/blink/renderer/core/layout/ng/ng_anchor_query.h" #include "third_party/blink/renderer/core/layout/ng/ng_break_token.h" -#include "third_party/blink/renderer/core/layout/ng/ng_ink_overflow.h" -#include "third_party/blink/renderer/core/layout/ng/ng_link.h" +#include "third_party/blink/renderer/core/layout/ink_overflow.h" #include "third_party/blink/renderer/core/layout/ng/ng_style_variant.h" +#include "third_party/blink/renderer/core/layout/physical_fragment_link.h" #include "third_party/blink/renderer/core/scroll/scroll_start_targets.h" #include "third_party/blink/renderer/platform/graphics/touch_action.h" #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h" @@ -836,4 +836,4 @@ CORE_EXPORT void ShowEntireFragmentTree(const blink::PhysicalFragment* target); #endif // DCHECK_IS_ON() -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_PHYSICAL_FRAGMENT_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_PHYSICAL_FRAGMENT_H_
diff --git a/third_party/blink/renderer/core/layout/ng/ng_link.h b/third_party/blink/renderer/core/layout/physical_fragment_link.h similarity index 85% rename from third_party/blink/renderer/core/layout/ng/ng_link.h rename to third_party/blink/renderer/core/layout/physical_fragment_link.h index dca3f24..3e3f9249 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_link.h +++ b/third_party/blink/renderer/core/layout/physical_fragment_link.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_LINK_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_LINK_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_PHYSICAL_FRAGMENT_LINK_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_PHYSICAL_FRAGMENT_LINK_H_ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/layout/geometry/physical_offset.h" @@ -40,4 +40,4 @@ WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::PhysicalFragmentLink) -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_LINK_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_PHYSICAL_FRAGMENT_LINK_H_
diff --git a/third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.cc b/third_party/blink/renderer/core/layout/physical_fragment_rare_data.cc similarity index 98% rename from third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.cc rename to third_party/blink/renderer/core/layout/physical_fragment_rare_data.cc index fc491d0..7bbc7d2 100644 --- a/third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.cc +++ b/third_party/blink/renderer/core/layout/physical_fragment_rare_data.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.h" +#include "third_party/blink/renderer/core/layout/physical_fragment_rare_data.h" #include "third_party/blink/renderer/core/layout/ng/frame_set_layout_data.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h"
diff --git a/third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.h b/third_party/blink/renderer/core/layout/physical_fragment_rare_data.h similarity index 95% rename from third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.h rename to third_party/blink/renderer/core/layout/physical_fragment_rare_data.h index 9bee51c9..c642978 100644 --- a/third_party/blink/renderer/core/layout/ng/physical_fragment_rare_data.h +++ b/third_party/blink/renderer/core/layout/physical_fragment_rare_data.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_PHYSICAL_FRAGMENT_RARE_DATA_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_PHYSICAL_FRAGMENT_RARE_DATA_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_PHYSICAL_FRAGMENT_RARE_DATA_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_PHYSICAL_FRAGMENT_RARE_DATA_H_ #include <climits> @@ -163,4 +163,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_PHYSICAL_FRAGMENT_RARE_DATA_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_PHYSICAL_FRAGMENT_RARE_DATA_H_
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment_test.cc b/third_party/blink/renderer/core/layout/physical_fragment_test.cc similarity index 97% rename from third_party/blink/renderer/core/layout/ng/ng_physical_fragment_test.cc rename to third_party/blink/renderer/core/layout/physical_fragment_test.cc index 46b1707..23e938aa 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_fragment_test.cc +++ b/third_party/blink/renderer/core/layout/physical_fragment_test.cc
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h" #include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
diff --git a/third_party/blink/renderer/core/layout/scroll_anchor.cc b/third_party/blink/renderer/core/layout/scroll_anchor.cc index fad6111..24c8f77b 100644 --- a/third_party/blink/renderer/core/layout/scroll_anchor.cc +++ b/third_party/blink/renderer/core/layout/scroll_anchor.cc
@@ -20,8 +20,8 @@ #include "third_party/blink/renderer/core/frame/web_feature.h" #include "third_party/blink/renderer/core/layout/layout_block_flow.h" #include "third_party/blink/renderer/core/layout/layout_box.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" #include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h" #include "third_party/blink/renderer/platform/instrumentation/histogram.h"
diff --git a/third_party/blink/renderer/core/layout/scroll_anchor_test.cc b/third_party/blink/renderer/core/layout/scroll_anchor_test.cc index 4b62ba0..5576ad0 100644 --- a/third_party/blink/renderer/core/layout/scroll_anchor_test.cc +++ b/third_party/blink/renderer/core/layout/scroll_anchor_test.cc
@@ -170,7 +170,7 @@ // Scroll the visual viewport to bring #text to the top. int top = GetDocument() .getElementById(AtomicString("text")) - ->getBoundingClientRect() + ->GetBoundingClientRect() ->top(); v_viewport.SetLocation(gfx::PointF(0, top)); @@ -1158,7 +1158,7 @@ // Save the old bounds for comparison. auto* old_bounds = GetDocument() .getElementById(AtomicString("target")) - ->getBoundingClientRect(); + ->GetBoundingClientRect(); GetDocument() .getElementById(AtomicString("growing")) @@ -1167,7 +1167,7 @@ auto* new_bounds = GetDocument() .getElementById(AtomicString("target")) - ->getBoundingClientRect(); + ->GetBoundingClientRect(); // The y coordinate of the target should not change. EXPECT_EQ(old_bounds->y(), new_bounds->y()); @@ -1208,10 +1208,10 @@ // Save the old bounds for comparison. auto* old_focus_bounds = GetDocument() .getElementById(AtomicString("focus_target")) - ->getBoundingClientRect(); + ->GetBoundingClientRect(); auto* old_find_bounds = GetDocument() .getElementById(AtomicString("find_target")) - ->getBoundingClientRect(); + ->GetBoundingClientRect(); GetDocument() .getElementById(AtomicString("growing")) @@ -1220,10 +1220,10 @@ auto* new_focus_bounds = GetDocument() .getElementById(AtomicString("focus_target")) - ->getBoundingClientRect(); + ->GetBoundingClientRect(); auto* new_find_bounds = GetDocument() .getElementById(AtomicString("find_target")) - ->getBoundingClientRect(); + ->GetBoundingClientRect(); // `focus_target` should remain where it is, since it is prioritized. // `find_target`, however, is shifted. @@ -1265,7 +1265,7 @@ // regardless of scroll anchoring. auto* old_bounds = GetDocument() .getElementById(AtomicString("check")) - ->getBoundingClientRect(); + ->GetBoundingClientRect(); GetDocument() .getElementById(AtomicString("growing")) @@ -1274,7 +1274,7 @@ auto* new_bounds = GetDocument() .getElementById(AtomicString("check")) - ->getBoundingClientRect(); + ->GetBoundingClientRect(); // The y coordinate of #check should change since #target is not a valid // anchor, so we should have selected one of the spacers as the anchor.
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.cc b/third_party/blink/renderer/core/layout/scrollable_overflow_calculator.cc similarity index 96% rename from third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.cc rename to third_party/blink/renderer/core/layout/scrollable_overflow_calculator.cc index e919521..d6ca1494 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.cc +++ b/third_party/blink/renderer/core/layout/scrollable_overflow_calculator.cc
@@ -2,19 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.h" +#include "third_party/blink/renderer/core/layout/scrollable_overflow_calculator.h" #include "third_party/blink/renderer/core/frame/web_feature.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/layout_box.h" #include "third_party/blink/renderer/core/layout/layout_text_combine.h" -#include "third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" +#include "third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment.h" #include "third_party/blink/renderer/core/style/style_overflow_clip_margin.h" #include "third_party/blink/renderer/platform/geometry/layout_unit.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.h b/third_party/blink/renderer/core/layout/scrollable_overflow_calculator.h similarity index 89% rename from third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.h rename to third_party/blink/renderer/core/layout/scrollable_overflow_calculator.h index 1c27c66..64c18d3 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.h +++ b/third_party/blink/renderer/core/layout/scrollable_overflow_calculator.h
@@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_LAYOUT_OVERFLOW_CALCULATOR_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_LAYOUT_OVERFLOW_CALCULATOR_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_SCROLLABLE_OVERFLOW_CALCULATOR_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_SCROLLABLE_OVERFLOW_CALCULATOR_H_ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/geometry/logical_rect.h" #include "third_party/blink/renderer/core/layout/inline/fragment_items_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" namespace blink { @@ -97,4 +97,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_LAYOUT_OVERFLOW_CALCULATOR_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_SCROLLABLE_OVERFLOW_CALCULATOR_H_
diff --git a/third_party/blink/renderer/core/layout/ng/ng_space_utils.cc b/third_party/blink/renderer/core/layout/space_utils.cc similarity index 93% rename from third_party/blink/renderer/core/layout/ng/ng_space_utils.cc rename to third_party/blink/renderer/core/layout/space_utils.cc index 0ba046a..f2bcaf5 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_space_utils.cc +++ b/third_party/blink/renderer/core/layout/space_utils.cc
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/geometry/bfc_offset.h" #include "third_party/blink/renderer/core/layout/layout_box.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/text/writing_mode.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_space_utils.h b/third_party/blink/renderer/core/layout/space_utils.h similarity index 87% rename from third_party/blink/renderer/core/layout/ng/ng_space_utils.h rename to third_party/blink/renderer/core/layout/space_utils.h index 5e37dbc..9a538692 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_space_utils.h +++ b/third_party/blink/renderer/core/layout/space_utils.h
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_SPACE_UTILS_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_SPACE_UTILS_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_SPACE_UTILS_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_SPACE_UTILS_H_ #include "base/memory/scoped_refptr.h" #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h" +#include "third_party/blink/renderer/core/layout/layout_input_node.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/geometry/layout_unit.h" @@ -50,4 +50,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_SPACE_UTILS_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_SPACE_UTILS_H_
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_block.h b/third_party/blink/renderer/core/layout/svg/layout_svg_block.h index fbccb0f..4ee673b 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_block.h +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_block.h
@@ -20,7 +20,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_SVG_LAYOUT_SVG_BLOCK_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_SVG_LAYOUT_SVG_BLOCK_H_ -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object.cc index 9e11ad5f..586dbec 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object.cc
@@ -4,9 +4,9 @@ #include "third_party/blink/renderer/core/layout/svg/layout_svg_foreign_object.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/svg/svg_resources.h" #include "third_party/blink/renderer/core/layout/svg/transformed_hit_test_location.h" #include "third_party/blink/renderer/core/paint/paint_layer.h"
diff --git a/third_party/blink/renderer/core/layout/svg/layout_svg_text.cc b/third_party/blink/renderer/core/layout/svg/layout_svg_text.cc index 08fb283..24026527 100644 --- a/third_party/blink/renderer/core/layout/svg/layout_svg_text.cc +++ b/third_party/blink/renderer/core/layout/svg/layout_svg_text.cc
@@ -7,10 +7,10 @@ #include <limits> #include "third_party/blink/renderer/core/editing/position_with_affinity.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/inline/fragment_item.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_inline_text.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_resource_container.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_root.h"
diff --git a/third_party/blink/renderer/core/layout/svg/svg_text_query.cc b/third_party/blink/renderer/core/layout/svg/svg_text_query.cc index 22b7535..8444d5ee 100644 --- a/third_party/blink/renderer/core/layout/svg/svg_text_query.cc +++ b/third_party/blink/renderer/core/layout/svg/svg_text_query.cc
@@ -9,7 +9,7 @@ #include "third_party/blink/renderer/core/layout/inline/fragment_item.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" #include "third_party/blink/renderer/core/layout/layout_box.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_inline_text.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_text.h" #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h"
diff --git a/third_party/blink/renderer/core/layout/table/layout_table.cc b/third_party/blink/renderer/core/layout/table/layout_table.cc index 98f5668..7e4592b3 100644 --- a/third_party/blink/renderer/core/layout/table/layout_table.cc +++ b/third_party/blink/renderer/core/layout/table/layout_table.cc
@@ -5,11 +5,11 @@ #include "third_party/blink/renderer/core/layout/table/layout_table.h" #include "third_party/blink/renderer/core/css/resolver/style_resolver.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/table/layout_table_caption.h" #include "third_party/blink/renderer/core/layout/table/layout_table_cell.h" #include "third_party/blink/renderer/core/layout/table/layout_table_column.h"
diff --git a/third_party/blink/renderer/core/layout/table/layout_table_caption.cc b/third_party/blink/renderer/core/layout/table/layout_table_caption.cc index 2cd3a7a..2e72b70ff7 100644 --- a/third_party/blink/renderer/core/layout/table/layout_table_caption.cc +++ b/third_party/blink/renderer/core/layout/table/layout_table_caption.cc
@@ -4,16 +4,6 @@ #include "third_party/blink/renderer/core/layout/table/layout_table_caption.h" -#include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" -#include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" -#include "third_party/blink/renderer/core/layout/table/layout_table.h" - namespace blink { LayoutTableCaption::LayoutTableCaption(Element* element)
diff --git a/third_party/blink/renderer/core/layout/table/layout_table_caption.h b/third_party/blink/renderer/core/layout/table/layout_table_caption.h index 8b83466..aed70bb 100644 --- a/third_party/blink/renderer/core/layout/table/layout_table_caption.h +++ b/third_party/blink/renderer/core/layout/table/layout_table_caption.h
@@ -6,7 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_TABLE_LAYOUT_TABLE_CAPTION_H_ #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/table/layout_table_cell.cc b/third_party/blink/renderer/core/layout/table/layout_table_cell.cc index 751facf..9c4eff92 100644 --- a/third_party/blink/renderer/core/layout/table/layout_table_cell.cc +++ b/third_party/blink/renderer/core/layout/table/layout_table_cell.cc
@@ -7,11 +7,10 @@ #include "third_party/blink/renderer/core/css/resolver/style_resolver.h" #include "third_party/blink/renderer/core/html/html_table_cell_element.h" #include "third_party/blink/renderer/core/html/table_constants.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_positioned_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/table/layout_table.h" #include "third_party/blink/renderer/core/layout/table/layout_table_row.h" #include "third_party/blink/renderer/core/layout/table/layout_table_section.h" @@ -36,6 +35,18 @@ return new_cell; } +void LayoutTableCell::InvalidateLayoutResultCacheAfterMeasure() const { + NOT_DESTROYED(); + if (LayoutBox* row = ParentBox()) { + DCHECK(row->IsTableRow()); + row->SetShouldSkipLayoutCache(true); + if (LayoutBox* section = row->ParentBox()) { + DCHECK(section->IsTableSection()); + section->SetShouldSkipLayoutCache(true); + } + } +} + LayoutUnit LayoutTableCell::BorderTop() const { NOT_DESTROYED(); // TODO(1061423) Should return cell border, not fragment border.
diff --git a/third_party/blink/renderer/core/layout/table/layout_table_cell.h b/third_party/blink/renderer/core/layout/table/layout_table_cell.h index e434e0b4..6410cf7 100644 --- a/third_party/blink/renderer/core/layout/table/layout_table_cell.h +++ b/third_party/blink/renderer/core/layout/table/layout_table_cell.h
@@ -7,7 +7,7 @@ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/html/table_constants.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" namespace blink { @@ -42,6 +42,14 @@ intrinsical_logical_widths_border_sizes_ = border_sizes; } + // This method is called after a new *measure* layout-result is set. + // Tables are special in that the table accesses the table-cells directly + // for computing the size of the table-grid (bypassing the section/row). + // Due to this when we set a new measure layout-result, we also invalidate + // the layout-result cache of the associated section/row (as the cell + // fragment would be in the incorrect state). + void InvalidateLayoutResultCacheAfterMeasure() const; + LayoutUnit BorderTop() const override; LayoutUnit BorderBottom() const override; LayoutUnit BorderLeft() const override;
diff --git a/third_party/blink/renderer/core/layout/table/layout_table_column.cc b/third_party/blink/renderer/core/layout/table/layout_table_column.cc index 5c2783a..6334f301 100644 --- a/third_party/blink/renderer/core/layout/table/layout_table_column.cc +++ b/third_party/blink/renderer/core/layout/table/layout_table_column.cc
@@ -5,7 +5,7 @@ #include "third_party/blink/renderer/core/layout/table/layout_table_column.h" #include "third_party/blink/renderer/core/html/html_table_col_element.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/table/layout_table.h" #include "third_party/blink/renderer/core/layout/table/table_borders.h" #include "third_party/blink/renderer/core/layout/table/table_layout_algorithm_types.h"
diff --git a/third_party/blink/renderer/core/layout/table/layout_table_column_visitor.h b/third_party/blink/renderer/core/layout/table/layout_table_column_visitor.h index d97133e..8d1da83 100644 --- a/third_party/blink/renderer/core/layout/table/layout_table_column_visitor.h +++ b/third_party/blink/renderer/core/layout/table/layout_table_column_visitor.h
@@ -5,7 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_TABLE_LAYOUT_TABLE_COLUMN_VISITOR_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_TABLE_LAYOUT_TABLE_COLUMN_VISITOR_H_ -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/table/layout_table_column.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/table/table_borders.cc b/third_party/blink/renderer/core/layout/table/table_borders.cc index ef7f897..fa73345 100644 --- a/third_party/blink/renderer/core/layout/table/table_borders.cc +++ b/third_party/blink/renderer/core/layout/table/table_borders.cc
@@ -6,9 +6,9 @@ #include "third_party/blink/renderer/core/css/properties/longhands.h" #include "third_party/blink/renderer/core/frame/web_feature.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/table/layout_table.h" #include "third_party/blink/renderer/core/layout/table/layout_table_column_visitor.h"
diff --git a/third_party/blink/renderer/core/layout/table/table_child_iterator.h b/third_party/blink/renderer/core/layout/table/table_child_iterator.h index 3fc88e2..fa75c15 100644 --- a/third_party/blink/renderer/core/layout/table/table_child_iterator.h +++ b/third_party/blink/renderer/core/layout/table/table_child_iterator.h
@@ -7,7 +7,7 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/table/table_layout_algorithm_types.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/table/table_fragment_data.h b/third_party/blink/renderer/core/layout/table/table_fragment_data.h index 0edd7c78..15ac68d 100644 --- a/third_party/blink/renderer/core/layout/table/table_fragment_data.h +++ b/third_party/blink/renderer/core/layout/table/table_fragment_data.h
@@ -6,7 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_TABLE_TABLE_FRAGMENT_DATA_H_ #include "base/dcheck_is_on.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_input_node.h" +#include "third_party/blink/renderer/core/layout/layout_input_node.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/geometry/layout_unit.h" #include "third_party/blink/renderer/platform/wtf/vector.h"
diff --git a/third_party/blink/renderer/core/layout/table/table_layout_algorithm.cc b/third_party/blink/renderer/core/layout/table/table_layout_algorithm.cc index 3bb2e76..f3aeb8a 100644 --- a/third_party/blink/renderer/core/layout/table/table_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/table/table_layout_algorithm.cc
@@ -4,18 +4,18 @@ #include "third_party/blink/renderer/core/layout/table/table_layout_algorithm.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/mathml/math_layout_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_disable_side_effects_scope.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_space_utils.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/space_utils.h" #include "third_party/blink/renderer/core/layout/table/layout_table.h" #include "third_party/blink/renderer/core/layout/table/layout_table_caption.h" #include "third_party/blink/renderer/core/layout/table/layout_table_cell.h"
diff --git a/third_party/blink/renderer/core/layout/table/table_layout_algorithm_types.cc b/third_party/blink/renderer/core/layout/table/table_layout_algorithm_types.cc index b2c8b01a..1ad15aa 100644 --- a/third_party/blink/renderer/core/layout/table/table_layout_algorithm_types.cc +++ b/third_party/blink/renderer/core/layout/table/table_layout_algorithm_types.cc
@@ -4,8 +4,8 @@ #include "third_party/blink/renderer/core/layout/table/table_layout_algorithm_types.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/table/layout_table_caption.h" #include "third_party/blink/renderer/core/layout/table/layout_table_cell.h" #include "third_party/blink/renderer/core/layout/table/layout_table_column.h"
diff --git a/third_party/blink/renderer/core/layout/table/table_layout_algorithm_types.h b/third_party/blink/renderer/core/layout/table/table_layout_algorithm_types.h index eb5ff9ab..45e8620f7 100644 --- a/third_party/blink/renderer/core/layout/table/table_layout_algorithm_types.h +++ b/third_party/blink/renderer/core/layout/table/table_layout_algorithm_types.h
@@ -8,9 +8,9 @@ #include "base/memory/scoped_refptr.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/geometry/box_strut.h" #include "third_party/blink/renderer/core/layout/min_max_sizes.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/style/computed_style_constants.h" #include "third_party/blink/renderer/platform/geometry/length.h" #include "third_party/blink/renderer/platform/wtf/ref_counted.h" @@ -18,9 +18,7 @@ namespace blink { -class BlockNode; class ComputedStyle; -class LayoutInputNode; // Define constraint classes for TableLayoutAlgorithm. class CORE_EXPORT TableTypes {
diff --git a/third_party/blink/renderer/core/layout/table/table_layout_utils.cc b/third_party/blink/renderer/core/layout/table/table_layout_utils.cc index d325922..c274581 100644 --- a/third_party/blink/renderer/core/layout/table/table_layout_utils.cc +++ b/third_party/blink/renderer/core/layout/table/table_layout_utils.cc
@@ -4,18 +4,18 @@ #include "third_party/blink/renderer/core/layout/table/table_layout_utils.h" +#include "third_party/blink/renderer/core/layout/block_node.h" +#include "third_party/blink/renderer/core/layout/constraint_space.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/geometry/logical_size.h" +#include "third_party/blink/renderer/core/layout/layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_disable_side_effects_scope.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_layout_result.h" #include "third_party/blink/renderer/core/layout/ng/ng_length_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/table/layout_table.h" #include "third_party/blink/renderer/core/layout/table/layout_table_cell.h" #include "third_party/blink/renderer/core/layout/table/layout_table_column.h" @@ -229,12 +229,8 @@ /* is_initial_block_size_indefinite */ true, is_table_block_size_specified, has_collapsed_borders, LayoutResultCacheSlot::kMeasure, &space_builder); - const auto cell_space = space_builder.ToConstraintSpace(); - absl::optional<DisableLayoutSideEffectsScope> disable_side_effects; - if (!cell.GetLayoutBox()->NeedsLayout()) { - disable_side_effects.emplace(); - } + const auto cell_space = space_builder.ToConstraintSpace(); const LayoutResult* layout_result = cell.Layout(cell_space); const LogicalBoxFragment fragment(
diff --git a/third_party/blink/renderer/core/layout/table/table_node.h b/third_party/blink/renderer/core/layout/table/table_node.h index bbaff24..2c6db90 100644 --- a/third_party/blink/renderer/core/layout/table/table_node.h +++ b/third_party/blink/renderer/core/layout/table/table_node.h
@@ -6,8 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_TABLE_TABLE_NODE_H_ #include "third_party/blink/renderer/core/core_export.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" - +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/table/table_borders.h" #include "third_party/blink/renderer/core/layout/table/table_layout_algorithm_types.h"
diff --git a/third_party/blink/renderer/core/layout/table/table_row_layout_algorithm.cc b/third_party/blink/renderer/core/layout/table/table_row_layout_algorithm.cc index 624f276..8f0b9b24 100644 --- a/third_party/blink/renderer/core/layout/table/table_row_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/table/table_row_layout_algorithm.cc
@@ -4,14 +4,14 @@ #include "third_party/blink/renderer/core/layout/table/table_row_layout_algorithm.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/table/layout_table_cell.h" #include "third_party/blink/renderer/core/layout/table/table_layout_utils.h" #include "third_party/blink/renderer/core/layout/table/table_row_break_token_data.h"
diff --git a/third_party/blink/renderer/core/layout/table/table_section_layout_algorithm.cc b/third_party/blink/renderer/core/layout/table/table_section_layout_algorithm.cc index d560c0df..592a9154 100644 --- a/third_party/blink/renderer/core/layout/table/table_section_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/table/table_section_layout_algorithm.cc
@@ -4,13 +4,13 @@ #include "third_party/blink/renderer/core/layout/table/table_section_layout_algorithm.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" #include "third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" namespace blink {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_text_decoration_offset.cc b/third_party/blink/renderer/core/layout/text_decoration_offset.cc similarity index 96% rename from third_party/blink/renderer/core/layout/ng/ng_text_decoration_offset.cc rename to third_party/blink/renderer/core/layout/text_decoration_offset.cc index 4ce95bf..c132c30d 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_text_decoration_offset.cc +++ b/third_party/blink/renderer/core/layout/text_decoration_offset.cc
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "third_party/blink/renderer/core/layout/ng/ng_text_decoration_offset.h" +#include "third_party/blink/renderer/core/layout/text_decoration_offset.h" #include "third_party/blink/renderer/core/layout/inline/fragment_item.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/text_decoration_info.h" #include "third_party/blink/renderer/core/style/computed_style.h"
diff --git a/third_party/blink/renderer/core/layout/ng/ng_text_decoration_offset.h b/third_party/blink/renderer/core/layout/text_decoration_offset.h similarity index 87% rename from third_party/blink/renderer/core/layout/ng/ng_text_decoration_offset.h rename to third_party/blink/renderer/core/layout/text_decoration_offset.h index 7f14d59c..7cef0017 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_text_decoration_offset.h +++ b/third_party/blink/renderer/core/layout/text_decoration_offset.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_TEXT_DECORATION_OFFSET_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_TEXT_DECORATION_OFFSET_H_ +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_TEXT_DECORATION_OFFSET_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_TEXT_DECORATION_OFFSET_H_ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/platform/fonts/font_baseline.h" @@ -48,4 +48,4 @@ } // namespace blink -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_NG_TEXT_DECORATION_OFFSET_H_ +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_TEXT_DECORATION_OFFSET_H_
diff --git a/third_party/blink/renderer/core/page/context_menu_controller_test.cc b/third_party/blink/renderer/core/page/context_menu_controller_test.cc index 76b6fc02..6c0d784 100644 --- a/third_party/blink/renderer/core/page/context_menu_controller_test.cc +++ b/third_party/blink/renderer/core/page/context_menu_controller_test.cc
@@ -178,7 +178,7 @@ } bool ShowContextMenuForElement(Element* element, WebMenuSourceType source) { - const DOMRect* rect = element->getBoundingClientRect(); + const DOMRect* rect = element->GetBoundingClientRect(); PhysicalOffset location(LayoutUnit((rect->left() + rect->right()) / 2), LayoutUnit((rect->top() + rect->bottom()) / 2)); ContextMenuAllowedScope context_menu_allowed_scope; @@ -308,7 +308,7 @@ HasVideo()) .WillRepeatedly(Return(false)); - DOMRect* rect = video->getBoundingClientRect(); + DOMRect* rect = video->GetBoundingClientRect(); PhysicalOffset location(LayoutUnit((rect->left() + rect->right()) / 2), LayoutUnit((rect->top() + rect->bottom()) / 2)); EXPECT_TRUE(ShowContextMenu(location, kMenuSourceMouse)); @@ -369,7 +369,7 @@ HasAudio()) .WillRepeatedly(Return(true)); - DOMRect* rect = video->getBoundingClientRect(); + DOMRect* rect = video->GetBoundingClientRect(); PhysicalOffset location(LayoutUnit((rect->left() + rect->right()) / 2), LayoutUnit((rect->top() + rect->bottom()) / 2)); EXPECT_TRUE(ShowContextMenu(location, kMenuSourceMouse)); @@ -426,7 +426,7 @@ HasVideo()) .WillRepeatedly(Return(true)); - DOMRect* rect = video->getBoundingClientRect(); + DOMRect* rect = video->GetBoundingClientRect(); PhysicalOffset location(LayoutUnit((rect->left() + rect->right()) / 2), LayoutUnit((rect->top() + rect->bottom()) / 2)); EXPECT_TRUE(ShowContextMenu(location, kMenuSourceMouse)); @@ -483,7 +483,7 @@ HasVideo()) .WillRepeatedly(Return(true)); - DOMRect* rect = video->getBoundingClientRect(); + DOMRect* rect = video->GetBoundingClientRect(); PhysicalOffset location(LayoutUnit((rect->left() + rect->right()) / 2), LayoutUnit((rect->top() + rect->bottom()) / 2)); EXPECT_TRUE(ShowContextMenu(location, kMenuSourceMouse)); @@ -542,7 +542,7 @@ HasVideo()) .WillRepeatedly(Return(true)); - DOMRect* rect = video->getBoundingClientRect(); + DOMRect* rect = video->GetBoundingClientRect(); PhysicalOffset location(LayoutUnit((rect->left() + rect->right()) / 2), LayoutUnit((rect->top() + rect->bottom()) / 2)); EXPECT_TRUE(ShowContextMenu(location, kMenuSourceMouse)); @@ -604,7 +604,7 @@ .WillRepeatedly(Return(std::numeric_limits<double>::infinity())); DurationChanged(video.Get()); - DOMRect* rect = video->getBoundingClientRect(); + DOMRect* rect = video->GetBoundingClientRect(); PhysicalOffset location(LayoutUnit((rect->left() + rect->right()) / 2), LayoutUnit((rect->top() + rect->bottom()) / 2)); EXPECT_TRUE(ShowContextMenu(location, kMenuSourceMouse)); @@ -766,7 +766,7 @@ document->UpdateStyleAndLayout(DocumentUpdateReason::kTest); // Select the 'Sample' of |input|. - DOMRect* rect = input_element->getBoundingClientRect(); + DOMRect* rect = input_element->GetBoundingClientRect(); WebGestureEvent gesture_event( WebInputEvent::Type::kGestureLongPress, WebInputEvent::kNoModifiers, base::TimeTicks::Now(), WebGestureDevice::kTouchscreen); @@ -846,7 +846,7 @@ FrameSelection& selection = document->GetFrame()->Selection(); // Select the 'Sample' of |textarea|. - DOMRect* rect = editable_element->getBoundingClientRect(); + DOMRect* rect = editable_element->GetBoundingClientRect(); WebGestureEvent gesture_event( WebInputEvent::Type::kGestureLongPress, WebInputEvent::kNoModifiers, base::TimeTicks::Now(), WebGestureDevice::kTouchscreen);
diff --git a/third_party/blink/renderer/core/page/print_context.cc b/third_party/blink/renderer/core/page/print_context.cc index 0f4b359..4007ea20 100644 --- a/third_party/blink/renderer/core/page/print_context.cc +++ b/third_party/blink/renderer/core/page/print_context.cc
@@ -28,8 +28,8 @@ #include "third_party/blink/renderer/core/frame/local_frame_view.h" #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_link.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment_link.h" #include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h" #include "third_party/blink/renderer/platform/graphics/graphics_context.h" #include "ui/gfx/geometry/size_f.h"
diff --git a/third_party/blink/renderer/core/page/scrolling/root_scroller_test.cc b/third_party/blink/renderer/core/page/scrolling/root_scroller_test.cc index 33e9af6..0b0d4c7 100644 --- a/third_party/blink/renderer/core/page/scrolling/root_scroller_test.cc +++ b/third_party/blink/renderer/core/page/scrolling/root_scroller_test.cc
@@ -734,7 +734,7 @@ UpdateAllLifecyclePhases(MainFrameView()); // The visual viewport should remain fully filled by the target. - DOMRect* rect = target->getBoundingClientRect(); + DOMRect* rect = target->GetBoundingClientRect(); EXPECT_EQ(rect->left(), GetVisualViewport().GetScrollOffset().x()); EXPECT_EQ(rect->top(), GetVisualViewport().GetScrollOffset().y()); }
diff --git a/third_party/blink/renderer/core/page/scrolling/scroll_metrics_test.cc b/third_party/blink/renderer/core/page/scrolling/scroll_metrics_test.cc index c1104d6..95cedc1 100644 --- a/third_party/blink/renderer/core/page/scrolling/scroll_metrics_test.cc +++ b/third_party/blink/renderer/core/page/scrolling/scroll_metrics_test.cc
@@ -109,8 +109,8 @@ void ScrollMetricsTest::Scroll(Element* element, const WebGestureDevice device) { DCHECK(element); - DCHECK(element->getBoundingClientRect()); - DOMRect* rect = element->getBoundingClientRect(); + DCHECK(element->GetBoundingClientRect()); + DOMRect* rect = element->GetBoundingClientRect(); ScrollBeginEventBuilder scroll_begin( gfx::PointF(rect->left() + rect->width() / 2, rect->top() + rect->height() / 2),
diff --git a/third_party/blink/renderer/core/page/scrolling/snap_coordinator.cc b/third_party/blink/renderer/core/page/scrolling/snap_coordinator.cc index 26fdbaf..3b5062d 100644 --- a/third_party/blink/renderer/core/page/scrolling/snap_coordinator.cc +++ b/third_party/blink/renderer/core/page/scrolling/snap_coordinator.cc
@@ -13,7 +13,7 @@ #include "third_party/blink/renderer/core/layout/layout_block.h" #include "third_party/blink/renderer/core/layout/layout_box.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h" #include "third_party/blink/renderer/platform/geometry/length_functions.h" #include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
diff --git a/third_party/blink/renderer/core/page/scrolling/snap_coordinator_test.cc b/third_party/blink/renderer/core/page/scrolling/snap_coordinator_test.cc index bc2fc45..6c22d9f9 100644 --- a/third_party/blink/renderer/core/page/scrolling/snap_coordinator_test.cc +++ b/third_party/blink/renderer/core/page/scrolling/snap_coordinator_test.cc
@@ -18,7 +18,7 @@ #include "third_party/blink/renderer/core/html/html_element.h" #include "third_party/blink/renderer/core/layout/layout_box.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h" #include "third_party/blink/renderer/core/scroll/scroll_types.h" #include "third_party/blink/renderer/core/style/computed_style.h"
diff --git a/third_party/blink/renderer/core/paint/background_image_geometry.cc b/third_party/blink/renderer/core/paint/background_image_geometry.cc index c3f263b0..ecb3bb91 100644 --- a/third_party/blink/renderer/core/paint/background_image_geometry.cc +++ b/third_party/blink/renderer/core/paint/background_image_geometry.cc
@@ -10,7 +10,7 @@ #include "third_party/blink/renderer/core/layout/layout_box_model_object.h" #include "third_party/blink/renderer/core/layout/layout_view.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/table/layout_table_cell.h" #include "third_party/blink/renderer/core/paint/paint_info.h" #include "third_party/blink/renderer/core/paint/paint_layer.h"
diff --git a/third_party/blink/renderer/core/paint/box_decoration_data.h b/third_party/blink/renderer/core/paint/box_decoration_data.h index 530c3c0..32bd8c7 100644 --- a/third_party/blink/renderer/core/paint/box_decoration_data.h +++ b/third_party/blink/renderer/core/paint/box_decoration_data.h
@@ -10,7 +10,7 @@ #include "third_party/blink/renderer/core/layout/background_bleed_avoidance.h" #include "third_party/blink/renderer/core/layout/layout_box.h" #include "third_party/blink/renderer/core/layout/layout_replaced.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/paint_info.h" #include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/platform/graphics/color.h"
diff --git a/third_party/blink/renderer/core/paint/box_paint_invalidator.cc b/third_party/blink/renderer/core/paint/box_paint_invalidator.cc index 8d39da8..7180477 100644 --- a/third_party/blink/renderer/core/paint/box_paint_invalidator.cc +++ b/third_party/blink/renderer/core/paint/box_paint_invalidator.cc
@@ -5,9 +5,9 @@ #include "third_party/blink/renderer/core/paint/box_paint_invalidator.h" #include "third_party/blink/renderer/core/frame/settings.h" +#include "third_party/blink/renderer/core/layout/ink_overflow.h" #include "third_party/blink/renderer/core/layout/layout_replaced.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_ink_overflow.h" #include "third_party/blink/renderer/core/paint/object_paint_invalidator.h" #include "third_party/blink/renderer/core/paint/paint_invalidator.h" #include "third_party/blink/renderer/core/paint/paint_layer.h"
diff --git a/third_party/blink/renderer/core/paint/cull_rect_updater.cc b/third_party/blink/renderer/core/paint/cull_rect_updater.cc index 2b27a319..245ba33 100644 --- a/third_party/blink/renderer/core/paint/cull_rect_updater.cc +++ b/third_party/blink/renderer/core/paint/cull_rect_updater.cc
@@ -9,7 +9,7 @@ #include "third_party/blink/renderer/core/frame/local_frame_view.h" #include "third_party/blink/renderer/core/layout/layout_embedded_content.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/fragment_data_iterator.h" #include "third_party/blink/renderer/core/paint/object_paint_properties.h" #include "third_party/blink/renderer/core/paint/paint_layer.h"
diff --git a/third_party/blink/renderer/core/paint/fragment_data_iterator.cc b/third_party/blink/renderer/core/paint/fragment_data_iterator.cc index 92627141..4e15b60 100644 --- a/third_party/blink/renderer/core/paint/fragment_data_iterator.cc +++ b/third_party/blink/renderer/core/paint/fragment_data_iterator.cc
@@ -6,7 +6,7 @@ #include "third_party/blink/renderer/core/layout/inline/fragment_item.h" #include "third_party/blink/renderer/core/layout/layout_box.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/fragment_data.h" namespace blink {
diff --git a/third_party/blink/renderer/core/paint/ng/README.md b/third_party/blink/renderer/core/paint/ng/README.md index 1b335d8..69529ab 100644 --- a/third_party/blink/renderer/core/paint/ng/README.md +++ b/third_party/blink/renderer/core/paint/ng/README.md
@@ -79,5 +79,5 @@ [LayoutNG]: ../../layout/ng/README.md [NGPaintFragment]: ng_paint_fragment.h -[PhysicalFragment]: ../../layout/ng/ng_physical_fragment.h +[PhysicalFragment]: ../../layout/physical_fragment.h [fragmentainer]: https://drafts.csswg.org/css-break/#fragmentation-container
diff --git a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc index ebb8142..bf7d9536 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
@@ -22,8 +22,8 @@ #include "third_party/blink/renderer/core/layout/layout_view.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_outline_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/outline_utils.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/pointer_events_hit_rules.h" #include "third_party/blink/renderer/core/layout/table/layout_table.h" #include "third_party/blink/renderer/core/layout/table/layout_table_cell.h" @@ -396,7 +396,7 @@ ->VisualOverflowRectIncludingFilters(); } -NGInlinePaintContext& NGBoxFragmentPainter::EnsureInlineContext() { +InlinePaintContext& NGBoxFragmentPainter::EnsureInlineContext() { if (!inline_context_) inline_context_ = &inline_context_storage_.emplace(); return *inline_context_; @@ -527,7 +527,7 @@ } if (UNLIKELY(text_combine) && - NGTextCombinePainter::ShouldPaint(*text_combine)) { + TextCombinePainter::ShouldPaint(*text_combine)) { if (recorder) { // Paint text decorations and emphasis marks without scaling and share. DCHECK(text_combine->NeedsAffineTransformInPaint()); @@ -540,7 +540,7 @@ paint_info.phase, text_combine->VisualRectForPaint(paint_offset)); } - NGTextCombinePainter::Paint(info, paint_offset, *text_combine); + TextCombinePainter::Paint(info, paint_offset, *text_combine); } // If we haven't painted overflow controls, paint scrollbars after we painted @@ -1586,9 +1586,9 @@ } // Paint the background of the `::first-line` line box. - if (NGLineBoxFragmentPainter::NeedsPaint(line_box_fragment)) { - NGLineBoxFragmentPainter line_box_painter(line_box_fragment, line_box_item, - GetPhysicalFragment()); + if (LineBoxFragmentPainter::NeedsPaint(line_box_fragment)) { + LineBoxFragmentPainter line_box_painter(line_box_fragment, line_box_item, + GetPhysicalFragment()); line_box_painter.PaintBackgroundBorderShadow(paint_info, child_offset); } } @@ -1628,8 +1628,8 @@ DCHECK(line_box_fragment); PaintLineBox(*line_box_fragment, *child_item->GetDisplayItemClient(), *child_item, paint_info, child_offset); - NGInlinePaintContext::ScopedLineBox scoped_line_box(*children, - inline_context_); + InlinePaintContext::ScopedLineBox scoped_line_box(*children, + inline_context_); InlineCursor line_box_cursor = children->CursorForDescendants(); PaintInlineItems(paint_info, paint_offset, child_item->OffsetInContainerFragment(), @@ -1711,8 +1711,8 @@ ScopedDisplayItemFragment display_item_fragment(paint_info.context, item.FragmentId()); DCHECK(inline_context_); - NGInlinePaintContext::ScopedInlineItem scoped_item(item, inline_context_); - NGTextFragmentPainter text_painter(cursor, parent_offset, inline_context_); + InlinePaintContext::ScopedInlineItem scoped_item(item, inline_context_); + TextFragmentPainter text_painter(cursor, parent_offset, inline_context_); text_painter.Paint(paint_info, paint_offset); } @@ -1744,7 +1744,7 @@ if (child_fragment.IsInlineBox()) { DCHECK(inline_context_); - NGInlineBoxFragmentPainter(cursor, item, child_fragment, inline_context_) + InlineBoxFragmentPainter(cursor, item, child_fragment, inline_context_) .Paint(paint_info, paint_offset); return; } @@ -1813,8 +1813,8 @@ DCHECK(inline_box_cursor_); DCHECK(box_item_); DCHECK(inline_context_); - NGInlineBoxFragmentPainter inline_box_painter(*inline_box_cursor_, *box_item_, - inline_context_); + InlineBoxFragmentPainter inline_box_painter(*inline_box_cursor_, *box_item_, + inline_context_); PaintTextClipMask(mask_paint_info, paint_offset - box_item_->OffsetInContainerFragment(), &inline_box_painter); @@ -1823,7 +1823,7 @@ void NGBoxFragmentPainter::PaintTextClipMask( const PaintInfo& paint_info, PhysicalOffset paint_offset, - NGInlineBoxFragmentPainter* inline_box_painter) { + InlineBoxFragmentPainter* inline_box_painter) { const ComputedStyle& style = box_fragment_.Style(); if (style.BoxDecorationBreak() == EBoxDecorationBreak::kSlice) { LayoutUnit offset_on_line;
diff --git a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.h b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.h index 45401d4..966e350 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.h +++ b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.h
@@ -11,7 +11,7 @@ #include "third_party/blink/renderer/core/layout/background_bleed_avoidance.h" #include "third_party/blink/renderer/core/layout/hit_test_phase.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/box_painter_base.h" #include "third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" @@ -24,14 +24,14 @@ class HitTestLocation; class HitTestResult; class InlineBackwardCursor; +class InlineBoxFragmentPainter; class InlineCursor; -class NGInlineBoxFragmentPainter; class PhysicalFragment; class ScopedPaintState; struct PaintInfo; // Painter for LayoutNG box fragments, paints borders and background. Delegates -// to NGTextFragmentPainter to paint line box fragments. +// to TextFragmentPainter to paint line box fragments. class CORE_EXPORT NGBoxFragmentPainter : public BoxPainterBase { STACK_ALLOCATED(); @@ -41,7 +41,7 @@ NGBoxFragmentPainter(const InlineCursor& inline_box_cursor, const FragmentItem& item, const PhysicalBoxFragment& fragment, - NGInlinePaintContext* inline_context); + InlinePaintContext* inline_context); void Paint(const PaintInfo&); // Routes single PaintPhase to actual painters, and traverses children. @@ -88,7 +88,7 @@ bool object_has_multiple_boxes) override; void PaintTextClipMask(const PaintInfo& paint_info, PhysicalOffset paint_offset, - NGInlineBoxFragmentPainter* inline_box_painter); + InlineBoxFragmentPainter* inline_box_painter); PhysicalRect AdjustRectForScrolledContent(GraphicsContext&, const PhysicalBoxStrut& borders, const PhysicalRect&) const override; @@ -98,7 +98,7 @@ const DisplayItemClient& display_item_client, const InlineCursor* inline_box_cursor = nullptr, const FragmentItem* box_item = nullptr, - NGInlinePaintContext* inline_context = nullptr); + InlinePaintContext* inline_context = nullptr); enum MoveTo { kDontSkipChildren, kSkipChildren }; bool ShouldPaint(const ScopedPaintState&) const; @@ -184,7 +184,7 @@ bool PaintOverflowControls(const PaintInfo&, const PhysicalOffset& paint_offset); - NGInlinePaintContext& EnsureInlineContext(); + InlinePaintContext& EnsureInlineContext(); // This should be called in the background paint phase even if there is no // other painted content. @@ -311,8 +311,8 @@ const FragmentItems* items_ = nullptr; const FragmentItem* box_item_ = nullptr; const InlineCursor* inline_box_cursor_ = nullptr; - NGInlinePaintContext* inline_context_ = nullptr; - absl::optional<NGInlinePaintContext> inline_context_storage_; + InlinePaintContext* inline_context_ = nullptr; + absl::optional<InlinePaintContext> inline_context_storage_; }; inline NGBoxFragmentPainter::NGBoxFragmentPainter( @@ -320,7 +320,7 @@ const DisplayItemClient& display_item_client, const InlineCursor* inline_box_cursor, const FragmentItem* box_item, - NGInlinePaintContext* inline_context) + InlinePaintContext* inline_context) : BoxPainterBase(box.GetDocument(), box.Style(), box.GetNode()), box_fragment_(box), display_item_client_(display_item_client), @@ -350,7 +350,7 @@ const InlineCursor& inline_box_cursor, const FragmentItem& item, const PhysicalBoxFragment& fragment, - NGInlinePaintContext* inline_context) + InlinePaintContext* inline_context) : NGBoxFragmentPainter(fragment, *item.GetDisplayItemClient(), &inline_box_cursor,
diff --git a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter_test.cc b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter_test.cc index 5610292..649a054 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter_test.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter_test.cc
@@ -7,9 +7,9 @@ #include "components/paint_preview/common/paint_preview_tracker.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/paint/paint_controller_paint_test.h" #include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h" #include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
diff --git a/third_party/blink/renderer/core/paint/ng/ng_decorating_box.h b/third_party/blink/renderer/core/paint/ng/ng_decorating_box.h index 518fd67..e6b11ce 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_decorating_box.h +++ b/third_party/blink/renderer/core/paint/ng/ng_decorating_box.h
@@ -15,27 +15,27 @@ // Represents a [decorating box]. // [decorating box]: https://drafts.csswg.org/css-text-decor-3/#decorating-box -class CORE_EXPORT NGDecoratingBox { +class CORE_EXPORT DecoratingBox { DISALLOW_NEW(); public: - NGDecoratingBox(const PhysicalOffset& content_offset_in_container, - const ComputedStyle& style, - const Vector<AppliedTextDecoration, 1>* decorations) + DecoratingBox(const PhysicalOffset& content_offset_in_container, + const ComputedStyle& style, + const Vector<AppliedTextDecoration, 1>* decorations) : content_offset_in_container_(content_offset_in_container), style_(&style), decorations_(decorations ? decorations : &style.AppliedTextDecorations()) { DCHECK_EQ(&style.AppliedTextDecorations(), decorations_); } - NGDecoratingBox(const FragmentItem& item, - const ComputedStyle& style, - const Vector<AppliedTextDecoration, 1>* decorations) - : NGDecoratingBox(item.ContentOffsetInContainerFragment(), - style, - decorations) {} - explicit NGDecoratingBox(const FragmentItem& item) - : NGDecoratingBox(item, item.Style(), /* decorations */ nullptr) {} + DecoratingBox(const FragmentItem& item, + const ComputedStyle& style, + const Vector<AppliedTextDecoration, 1>* decorations) + : DecoratingBox(item.ContentOffsetInContainerFragment(), + style, + decorations) {} + explicit DecoratingBox(const FragmentItem& item) + : DecoratingBox(item, item.Style(), /* decorations */ nullptr) {} void Trace(Visitor* visitor) const { visitor->Trace(style_); } @@ -55,6 +55,6 @@ } // namespace blink -WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::NGDecoratingBox) +WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::DecoratingBox) #endif // THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_NG_NG_DECORATING_BOX_H_
diff --git a/third_party/blink/renderer/core/paint/ng/ng_fieldset_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_fieldset_painter.cc index 06d446ca..6a4fa21a 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_fieldset_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_fieldset_painter.cc
@@ -5,8 +5,8 @@ #include "third_party/blink/renderer/core/paint/ng/ng_fieldset_painter.h" #include "third_party/blink/renderer/core/layout/layout_box.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/ng/ng_relative_utils.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/background_image_geometry.h" #include "third_party/blink/renderer/core/paint/box_decoration_data.h" #include "third_party/blink/renderer/core/paint/fieldset_paint_info.h"
diff --git a/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.cc index 0b8efee..b36b7bb 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.cc
@@ -4,7 +4,7 @@ #include "third_party/blink/renderer/core/paint/ng/ng_fragment_painter.h" -#include "third_party/blink/renderer/core/layout/ng/ng_outline_utils.h" +#include "third_party/blink/renderer/core/layout/outline_utils.h" #include "third_party/blink/renderer/core/paint/outline_painter.h" #include "third_party/blink/renderer/core/paint/paint_info.h" #include "third_party/blink/renderer/core/style/computed_style.h"
diff --git a/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.h b/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.h index c781be8..fd1aaaa9 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.h +++ b/third_party/blink/renderer/core/paint/ng/ng_fragment_painter.h
@@ -5,7 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_NG_NG_FRAGMENT_PAINTER_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_NG_NG_FRAGMENT_PAINTER_H_ -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" namespace blink {
diff --git a/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.cc index c0ef9e2..29b03ea 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.cc
@@ -278,7 +278,7 @@ // Paint the selected text only. void NGHighlightPainter::SelectionPaintState::PaintSelectedText( - NGTextPainter& text_painter, + TextPainter& text_painter, const TextFragmentPaintInfo& fragment_paint_info, const TextPaintStyle& text_style, DOMNodeId node_id, @@ -293,7 +293,7 @@ // (painting shadows only) where selected. void NGHighlightPainter::SelectionPaintState:: PaintSuppressingTextProperWhereSelected( - NGTextPainter& text_painter, + TextPainter& text_painter, const TextFragmentPaintInfo& fragment_paint_info, const TextPaintStyle& text_style, DOMNodeId node_id, @@ -301,7 +301,7 @@ // First paint the shadows for the whole range. if (text_style.shadow) { text_painter.Paint(fragment_paint_info, text_style, node_id, auto_dark_mode, - NGTextPainter::kShadowsOnly); + TextPainter::kShadowsOnly); } // Then paint the text proper for any unselected parts in storage order, so @@ -309,19 +309,19 @@ if (fragment_paint_info.from < selection_status_.start) { text_painter.Paint( fragment_paint_info.WithEndOffset(selection_status_.start), text_style, - node_id, auto_dark_mode, NGTextPainter::kTextProperOnly); + node_id, auto_dark_mode, TextPainter::kTextProperOnly); } if (selection_status_.end < fragment_paint_info.to) { text_painter.Paint( fragment_paint_info.WithStartOffset(selection_status_.end), text_style, - node_id, auto_dark_mode, NGTextPainter::kTextProperOnly); + node_id, auto_dark_mode, TextPainter::kTextProperOnly); } } NGHighlightPainter::NGHighlightPainter( const TextFragmentPaintInfo& fragment_paint_info, - NGTextPainter& text_painter, - NGTextDecorationPainter& decoration_painter, + TextPainter& text_painter, + TextDecorationPainter& decoration_painter, const PaintInfo& paint_info, const InlineCursor& cursor, const FragmentItem& fragment_item, @@ -746,8 +746,7 @@ // First paint the shadows for the whole range. if (text_style.shadow) { text_painter_.Paint(fragment_paint_info_, text_style, node_id, - foreground_auto_dark_mode_, - NGTextPainter::kShadowsOnly); + foreground_auto_dark_mode_, TextPainter::kShadowsOnly); } // Then paint the text proper for any unhighlighted parts in storage order, @@ -759,7 +758,7 @@ PaintDecorationsExceptLineThrough(part); text_painter_.Paint( fragment_paint_info_.Slice(part.range.from, part.range.to), text_style, - node_id, foreground_auto_dark_mode_, NGTextPainter::kTextProperOnly); + node_id, foreground_auto_dark_mode_, TextPainter::kTextProperOnly); PaintDecorationsOnlyLineThrough(part); PaintSpellingGrammarDecorations(part); } @@ -934,7 +933,7 @@ continue; // TODO(crbug.com/1434114) expand range to include partial glyphs, then - // paint with clipping (NGTextPainter::PaintSelectedText) + // paint with clipping (TextPainter::PaintSelectedText) PaintDecorationsExceptLineThrough(part); text_painter_.Paint( fragment_paint_info_.Slice(part.range.from, part.range.to), @@ -1302,12 +1301,12 @@ LineRelativeRect decoration_rect = LineRelativeLocalRect( fragment_item_, text, paint_start_offset, paint_end_offset); decoration_rect.Move(LineRelativeOffset::CreateFromBoxOrigin(box_origin_)); - NGTextDecorationPainter decoration_painter( + TextDecorationPainter decoration_painter( text_painter_, fragment_item_, paint_info_, pseudo_style ? *pseudo_style : originating_style_, text_style, decoration_rect, selection_); - decoration_painter.Begin(NGTextDecorationPainter::kOriginating); + decoration_painter.Begin(TextDecorationPainter::kOriginating); decoration_painter.PaintExceptLineThrough( fragment_paint_info_.Slice(paint_start_offset, paint_end_offset));
diff --git a/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.h b/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.h index db8b35e..5f1d59a 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.h +++ b/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.h
@@ -30,16 +30,16 @@ class FrameSelection; class InlineCursor; class LayoutObject; -class NGTextPainter; -class NGTextDecorationPainter; class Node; +class TextDecorationPainter; +class TextPainter; struct LayoutSelectionStatus; struct PaintInfo; struct PhysicalOffset; struct TextFragmentPaintInfo; // Highlight overlay painter for LayoutNG. Operates on a FragmentItem that -// IsText(). Delegates to NGTextPainter to paint the text itself. +// IsText(). Delegates to TextPainter to paint the text itself. class CORE_EXPORT NGHighlightPainter { STACK_ALLOCATED(); @@ -90,14 +90,14 @@ const ComputedStyle& style, const absl::optional<AffineTransform>& rotation); - void PaintSelectedText(NGTextPainter& text_painter, + void PaintSelectedText(TextPainter& text_painter, const TextFragmentPaintInfo&, const TextPaintStyle& text_style, DOMNodeId node_id, const AutoDarkMode& auto_dark_mode); void PaintSuppressingTextProperWhereSelected( - NGTextPainter& text_painter, + TextPainter& text_painter, const TextFragmentPaintInfo&, const TextPaintStyle& text_style, DOMNodeId node_id, @@ -127,8 +127,8 @@ NGHighlightPainter( const TextFragmentPaintInfo& fragment_paint_info, - NGTextPainter& text_painter, - NGTextDecorationPainter& decoration_painter, + TextPainter& text_painter, + TextDecorationPainter& decoration_painter, const PaintInfo& paint_info, const InlineCursor& cursor, const FragmentItem& fragment_item, @@ -290,8 +290,8 @@ // marker's offsets to the fragment space. absl::optional<TextOffsetRange> fragment_dom_offsets_{}; - NGTextPainter& text_painter_; - NGTextDecorationPainter& decoration_painter_; + TextPainter& text_painter_; + TextDecorationPainter& decoration_painter_; const PaintInfo& paint_info_; const InlineCursor& cursor_; const FragmentItem& fragment_item_;
diff --git a/third_party/blink/renderer/core/paint/ng/ng_highlight_painter_test.cc b/third_party/blink/renderer/core/paint/ng/ng_highlight_painter_test.cc index 865816c..f10a24d 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_highlight_painter_test.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_highlight_painter_test.cc
@@ -8,7 +8,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "third_party/blink/renderer/core/editing/markers/document_marker_controller.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.h" #include "third_party/blink/renderer/core/paint/ng/ng_text_decoration_painter.h" #include "third_party/blink/renderer/core/paint/ng/ng_text_painter.h" @@ -40,7 +40,7 @@ auto expect = [&](NGHighlightPainter::Case expected, unsigned line) { LayoutObject& body = *GetDocument().body()->GetLayoutObject(); const auto& block_flow = To<LayoutNGBlockFlow>(body); - NGInlinePaintContext inline_context{}; + InlinePaintContext inline_context{}; InlineCursor cursor{block_flow}; cursor.MoveToFirstLine(); inline_context.SetLineBox(cursor); @@ -71,13 +71,13 @@ } LineRelativeRect rotated_rect = LineRelativeRect::CreateFromLineBox(physical_rect, true); - NGTextPainter text_painter( + TextPainter text_painter( graphics_context, text_item.ScaledFont(), rect, LineRelativeOffset::CreateFromBoxOrigin(physical_offset), &inline_context, true); - NGTextDecorationPainter decoration_painter(text_painter, text_item, - paint_info, style, text_style, - rotated_rect, selection); + TextDecorationPainter decoration_painter(text_painter, text_item, + paint_info, style, text_style, + rotated_rect, selection); NGHighlightPainter highlight_painter( cursor.Current()->TextPaintInfo(cursor.Items()), text_painter, decoration_painter, paint_info, cursor, text_item, {}, physical_offset,
diff --git a/third_party/blink/renderer/core/paint/ng/ng_inline_box_fragment_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_inline_box_fragment_painter.cc index 96b1ec6..18801c22 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_inline_box_fragment_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_inline_box_fragment_painter.cc
@@ -49,12 +49,12 @@ } // namespace -PhysicalBoxSides NGInlineBoxFragmentPainter::SidesToInclude() const { +PhysicalBoxSides InlineBoxFragmentPainter::SidesToInclude() const { return BoxFragment().SidesToInclude(); } -void NGInlineBoxFragmentPainter::Paint(const PaintInfo& paint_info, - const PhysicalOffset& paint_offset) { +void InlineBoxFragmentPainter::Paint(const PaintInfo& paint_info, + const PhysicalOffset& paint_offset) { ScopedDisplayItemFragment display_item_fragment( paint_info.context, inline_box_item_.FragmentId()); const LayoutObject& layout_object = *inline_box_fragment_.GetLayoutObject(); @@ -75,8 +75,8 @@ } const bool suppress_box_decoration_background = true; DCHECK(inline_context_); - NGInlinePaintContext::ScopedInlineItem scoped_item(inline_box_item_, - inline_context_); + InlinePaintContext::ScopedInlineItem scoped_item(inline_box_item_, + inline_context_); DCHECK(inline_box_cursor_); NGBoxFragmentPainter box_painter(*inline_box_cursor_, inline_box_item_, BoxFragment(), inline_context_); @@ -84,8 +84,8 @@ suppress_box_decoration_background); } -void NGInlineBoxFragmentPainter::PaintMask(const PaintInfo& paint_info, - const PhysicalOffset& paint_offset) { +void InlineBoxFragmentPainter::PaintMask(const PaintInfo& paint_info, + const PhysicalOffset& paint_offset) { DCHECK_EQ(PaintPhase::kMask, paint_info.phase); if (!style_.HasMask() || style_.Visibility() != EVisibility::kVisible) { return; @@ -138,7 +138,7 @@ style_.MaskBoxImage(), SidesToInclude()); } -void NGInlineBoxFragmentPainterBase::PaintBackgroundBorderShadow( +void InlineBoxFragmentPainterBase::PaintBackgroundBorderShadow( const PaintInfo& paint_info, const PhysicalOffset& paint_offset) { DCHECK(paint_info.phase == PaintPhase::kForeground); @@ -188,14 +188,14 @@ object_may_have_multiple_boxes, SidesToInclude()); } -gfx::Rect NGInlineBoxFragmentPainterBase::VisualRect( +gfx::Rect InlineBoxFragmentPainterBase::VisualRect( const PhysicalOffset& paint_offset) { PhysicalRect overflow_rect = inline_box_item_.SelfInkOverflowRect(); overflow_rect.Move(paint_offset); return ToEnclosingRect(overflow_rect); } -void NGLineBoxFragmentPainter::PaintBackgroundBorderShadow( +void LineBoxFragmentPainter::PaintBackgroundBorderShadow( const PaintInfo& paint_info, const PhysicalOffset& paint_offset) { DCHECK_EQ(paint_info.phase, PaintPhase::kForeground); @@ -248,7 +248,7 @@ /*object_has_multiple_boxes*/ false, PhysicalBoxSides()); } -void NGInlineBoxFragmentPainterBase::ComputeFragmentOffsetOnLine( +void InlineBoxFragmentPainterBase::ComputeFragmentOffsetOnLine( TextDirection direction, LayoutUnit* offset_on_line, LayoutUnit* total_width) const { @@ -284,7 +284,7 @@ *offset_on_line = direction == TextDirection::kLtr ? before : after; } -PhysicalRect NGInlineBoxFragmentPainterBase::PaintRectForImageStrip( +PhysicalRect InlineBoxFragmentPainterBase::PaintRectForImageStrip( const PhysicalRect& paint_rect, TextDirection direction) const { // We have a fill/border/mask image that spans multiple lines. @@ -306,7 +306,7 @@ paint_rect.Width(), total_width); } -PhysicalRect NGInlineBoxFragmentPainterBase::ClipRectForNinePieceImageStrip( +PhysicalRect InlineBoxFragmentPainterBase::ClipRectForNinePieceImageStrip( const ComputedStyle& style, PhysicalBoxSides sides_to_include, const NinePieceImage& image, @@ -330,8 +330,8 @@ return clip_rect; } -NGInlineBoxFragmentPainterBase::SlicePaintingType -NGInlineBoxFragmentPainterBase::GetBorderPaintType( +InlineBoxFragmentPainterBase::SlicePaintingType +InlineBoxFragmentPainterBase::GetBorderPaintType( const PhysicalRect& adjusted_frame_rect, gfx::Rect& adjusted_clip_rect, bool object_has_multiple_boxes) const { @@ -343,8 +343,8 @@ adjusted_clip_rect, object_has_multiple_boxes); } -NGInlineBoxFragmentPainterBase::SlicePaintingType -NGInlineBoxFragmentPainterBase::GetSlicePaintType( +InlineBoxFragmentPainterBase::SlicePaintingType +InlineBoxFragmentPainterBase::GetSlicePaintType( const NinePieceImage& nine_piece_image, const PhysicalRect& adjusted_frame_rect, gfx::Rect& adjusted_clip_rect, @@ -372,14 +372,14 @@ return kPaintWithClip; } -void NGInlineBoxFragmentPainterBase::PaintNormalBoxShadow( +void InlineBoxFragmentPainterBase::PaintNormalBoxShadow( const PaintInfo& info, const ComputedStyle& s, const PhysicalRect& paint_rect) { BoxPainterBase::PaintNormalBoxShadow(info, paint_rect, s, SidesToInclude()); } -void NGInlineBoxFragmentPainterBase::PaintInsetBoxShadow( +void InlineBoxFragmentPainterBase::PaintInsetBoxShadow( const PaintInfo& info, const ComputedStyle& s, const PhysicalRect& paint_rect) { @@ -387,7 +387,7 @@ SidesToInclude()); } -void NGInlineBoxFragmentPainterBase::PaintBoxDecorationBackground( +void InlineBoxFragmentPainterBase::PaintBoxDecorationBackground( BoxPainterBase& box_painter, const PaintInfo& paint_info, const PhysicalOffset& paint_offset, @@ -432,7 +432,7 @@ } } -void NGInlineBoxFragmentPainterBase::PaintFillLayers( +void InlineBoxFragmentPainterBase::PaintFillLayers( BoxPainterBase& box_painter, const PaintInfo& info, const Color& c, @@ -450,7 +450,7 @@ object_has_multiple_boxes); } -void NGInlineBoxFragmentPainterBase::PaintFillLayer( +void InlineBoxFragmentPainterBase::PaintFillLayer( BoxPainterBase& box_painter, const PaintInfo& paint_info, const Color& c, @@ -483,7 +483,7 @@ // Paint all fragments for the |layout_inline|. This function is used only for // self-painting |LayoutInline|. -void NGInlineBoxFragmentPainter::PaintAllFragments( +void InlineBoxFragmentPainter::PaintAllFragments( const LayoutInline& layout_inline, const FragmentData& fragment_data, wtf_size_t fragment_data_idx, @@ -521,7 +521,7 @@ paint_offset); } - NGInlinePaintContext inline_context; + InlinePaintContext inline_context; InlineCursor first_container_cursor(*block_flow); first_container_cursor.MoveTo(layout_inline); @@ -533,19 +533,19 @@ InlineCursor cursor(*container_fragment); cursor.MoveTo(layout_inline); for (; cursor; cursor.MoveToNextForSameLayoutObject()) { - NGInlinePaintContext::ScopedInlineBoxAncestors scoped_items( - cursor, &inline_context); + InlinePaintContext::ScopedInlineBoxAncestors scoped_items(cursor, + &inline_context); const FragmentItem* item = cursor.CurrentItem(); DCHECK(item); const PhysicalBoxFragment* box_fragment = item->BoxFragment(); DCHECK(box_fragment); - NGInlineBoxFragmentPainter(cursor, *item, *box_fragment, &inline_context) + InlineBoxFragmentPainter(cursor, *item, *box_fragment, &inline_context) .Paint(paint_info, paint_offset); } } #if DCHECK_IS_ON() -void NGInlineBoxFragmentPainter::CheckValid() const { +void InlineBoxFragmentPainter::CheckValid() const { DCHECK(inline_box_cursor_); DCHECK_EQ(inline_box_cursor_->Current().Item(), &inline_box_item_);
diff --git a/third_party/blink/renderer/core/paint/ng/ng_inline_box_fragment_painter.h b/third_party/blink/renderer/core/paint/ng/ng_inline_box_fragment_painter.h index 1866093c..fb3f2571 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_inline_box_fragment_painter.h +++ b/third_party/blink/renderer/core/paint/ng/ng_inline_box_fragment_painter.h
@@ -15,13 +15,13 @@ namespace blink { -class NGInlinePaintContext; +class InlinePaintContext; struct PaintInfo; struct PhysicalRect; -// Common base class for NGInlineBoxFragmentPainter and -// NGLineBoxFragmentPainter. -class NGInlineBoxFragmentPainterBase { +// Common base class for InlineBoxFragmentPainter and +// LineBoxFragmentPainter. +class InlineBoxFragmentPainterBase { STACK_ALLOCATED(); public: @@ -30,13 +30,13 @@ LayoutUnit* total_width) const; protected: - NGInlineBoxFragmentPainterBase(const PhysicalFragment& inline_box_fragment, - const InlineCursor* inline_box_cursor, - const FragmentItem& inline_box_item, - const LayoutObject& layout_object, - const ComputedStyle& style, - const ComputedStyle& line_style, - NGInlinePaintContext* inline_context) + InlineBoxFragmentPainterBase(const PhysicalFragment& inline_box_fragment, + const InlineCursor* inline_box_cursor, + const FragmentItem& inline_box_item, + const LayoutObject& layout_object, + const ComputedStyle& style, + const ComputedStyle& line_style, + InlinePaintContext* inline_context) : image_observer_(layout_object), document_(&layout_object.GetDocument()), node_(layout_object.GeneratingNode()), @@ -57,20 +57,20 @@ } // Constructor for |FragmentItem|. - NGInlineBoxFragmentPainterBase(const InlineCursor& inline_box_cursor, - const FragmentItem& inline_box_item, - const PhysicalBoxFragment& inline_box_fragment, - const LayoutObject& layout_object, - const ComputedStyle& style, - const ComputedStyle& line_style, - NGInlinePaintContext* inline_context) - : NGInlineBoxFragmentPainterBase(inline_box_fragment, - &inline_box_cursor, - inline_box_item, - layout_object, - style, - line_style, - inline_context) {} + InlineBoxFragmentPainterBase(const InlineCursor& inline_box_cursor, + const FragmentItem& inline_box_item, + const PhysicalBoxFragment& inline_box_fragment, + const LayoutObject& layout_object, + const ComputedStyle& style, + const ComputedStyle& line_style, + InlinePaintContext* inline_context) + : InlineBoxFragmentPainterBase(inline_box_fragment, + &inline_box_cursor, + inline_box_item, + layout_object, + style, + line_style, + inline_context) {} const DisplayItemClient& GetDisplayItemClient() const { DCHECK(inline_box_item_.GetDisplayItemClient()); @@ -148,36 +148,36 @@ const PhysicalFragment& inline_box_fragment_; const FragmentItem& inline_box_item_; const InlineCursor* inline_box_cursor_ = nullptr; - NGInlinePaintContext* inline_context_ = nullptr; + InlinePaintContext* inline_context_ = nullptr; }; // Painter for LayoutNG inline box fragments. Delegates to NGBoxFragmentPainter // for all box painting logic that isn't specific to inline boxes. -class NGInlineBoxFragmentPainter : public NGInlineBoxFragmentPainterBase { +class InlineBoxFragmentPainter : public InlineBoxFragmentPainterBase { STACK_ALLOCATED(); public: // Constructor for |FragmentItem|. - NGInlineBoxFragmentPainter(const InlineCursor& inline_box_cursor, - const FragmentItem& inline_box_item, - const PhysicalBoxFragment& inline_box_fragment, - NGInlinePaintContext* inline_context) - : NGInlineBoxFragmentPainterBase(inline_box_cursor, - inline_box_item, - inline_box_fragment, - *inline_box_fragment.GetLayoutObject(), - inline_box_fragment.Style(), - inline_box_fragment.Style(), - inline_context) { + InlineBoxFragmentPainter(const InlineCursor& inline_box_cursor, + const FragmentItem& inline_box_item, + const PhysicalBoxFragment& inline_box_fragment, + InlinePaintContext* inline_context) + : InlineBoxFragmentPainterBase(inline_box_cursor, + inline_box_item, + inline_box_fragment, + *inline_box_fragment.GetLayoutObject(), + inline_box_fragment.Style(), + inline_box_fragment.Style(), + inline_context) { CheckValid(); } - NGInlineBoxFragmentPainter(const InlineCursor& inline_box_cursor, - const FragmentItem& inline_box_item, - NGInlinePaintContext* inline_context) - : NGInlineBoxFragmentPainter(inline_box_cursor, - inline_box_item, - *inline_box_item.BoxFragment(), - inline_context) { + InlineBoxFragmentPainter(const InlineCursor& inline_box_cursor, + const FragmentItem& inline_box_item, + InlinePaintContext* inline_context) + : InlineBoxFragmentPainter(inline_box_cursor, + inline_box_item, + *inline_box_item.BoxFragment(), + inline_context) { DCHECK(inline_box_item.BoxFragment()); } @@ -213,17 +213,17 @@ // Painter for LayoutNG line box fragments. Line boxes don't paint anything, // except when ::first-line style has background properties specified. // https://drafts.csswg.org/css-pseudo-4/#first-line-styling -class NGLineBoxFragmentPainter : public NGInlineBoxFragmentPainterBase { +class LineBoxFragmentPainter : public InlineBoxFragmentPainterBase { STACK_ALLOCATED(); public: - NGLineBoxFragmentPainter(const PhysicalFragment& line_box_fragment, - const FragmentItem& line_box_item, - const PhysicalBoxFragment& block_fragment) - : NGLineBoxFragmentPainter(line_box_fragment, - line_box_item, - block_fragment, - *block_fragment.GetLayoutObject()) {} + LineBoxFragmentPainter(const PhysicalFragment& line_box_fragment, + const FragmentItem& line_box_item, + const PhysicalBoxFragment& block_fragment) + : LineBoxFragmentPainter(line_box_fragment, + line_box_item, + block_fragment, + *block_fragment.GetLayoutObject()) {} static bool NeedsPaint(const PhysicalFragment& line_fragment) { DCHECK(line_fragment.IsLineBox()); @@ -236,11 +236,11 @@ const PhysicalOffset& paint_offset); private: - NGLineBoxFragmentPainter(const PhysicalFragment& line_box_fragment, - const FragmentItem& line_box_item, - const PhysicalBoxFragment& block_fragment, - const LayoutObject& layout_block_flow) - : NGInlineBoxFragmentPainterBase( + LineBoxFragmentPainter(const PhysicalFragment& line_box_fragment, + const FragmentItem& line_box_item, + const PhysicalBoxFragment& block_fragment, + const LayoutObject& layout_block_flow) + : InlineBoxFragmentPainterBase( line_box_fragment, /* inline_box_cursor */ nullptr, line_box_item,
diff --git a/third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.cc b/third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.cc index 556eda8..5783f61 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.cc
@@ -9,7 +9,7 @@ namespace blink { -void NGInlinePaintContext::ClearDecoratingBoxes( +void InlinePaintContext::ClearDecoratingBoxes( DecoratingBoxList* saved_decorating_boxes) { if (saved_decorating_boxes) { DCHECK(saved_decorating_boxes->empty()); @@ -19,9 +19,9 @@ } } -NGInlinePaintContext::ScopedInlineItem::ScopedInlineItem( +InlinePaintContext::ScopedInlineItem::ScopedInlineItem( const FragmentItem& item, - NGInlinePaintContext* inline_context) { + InlinePaintContext* inline_context) { if (!RuntimeEnabledFeatures::TextDecoratingBoxEnabled()) return; DCHECK(inline_context); @@ -38,7 +38,7 @@ // // This function may push multiple decorating boxes, or clear if the propagation // was stopped. See |StopPropagateTextDecorations|. -wtf_size_t NGInlinePaintContext::SyncDecoratingBox( +wtf_size_t InlinePaintContext::SyncDecoratingBox( const FragmentItem& item, DecoratingBoxList* saved_decorating_boxes) { DCHECK(RuntimeEnabledFeatures::TextDecoratingBoxEnabled()); @@ -58,7 +58,7 @@ STACK_ALLOCATED(); public: - DecorationBoxSynchronizer(NGInlinePaintContext* inline_context, + DecorationBoxSynchronizer(InlinePaintContext* inline_context, const FragmentItem& item, const Vector<AppliedTextDecoration, 1>* stop_at, DecoratingBoxList* saved_decorating_boxes) @@ -208,7 +208,7 @@ item->ContentOffsetInContainerFragment(), style, &decorations); } - NGInlinePaintContext* inline_context_; + InlinePaintContext* inline_context_; const Vector<AppliedTextDecoration, 1>* stop_at_; absl::optional<InlineCursor> line_cursor_; DecoratingBoxList* saved_decorating_boxes_; @@ -223,9 +223,9 @@ return push_count; } -NGInlinePaintContext::ScopedInlineBoxAncestors::ScopedInlineBoxAncestors( +InlinePaintContext::ScopedInlineBoxAncestors::ScopedInlineBoxAncestors( const InlineCursor& inline_box, - NGInlinePaintContext* inline_context) { + InlinePaintContext* inline_context) { if (!RuntimeEnabledFeatures::TextDecoratingBoxEnabled()) return; DCHECK(inline_context); @@ -233,7 +233,7 @@ inline_context->PushDecoratingBoxAncestors(inline_box); } -void NGInlinePaintContext::PushDecoratingBoxAncestors( +void InlinePaintContext::PushDecoratingBoxAncestors( const InlineCursor& inline_box) { DCHECK(RuntimeEnabledFeatures::TextDecoratingBoxEnabled()); DCHECK(inline_box.Current()); @@ -259,14 +259,14 @@ } } -void NGInlinePaintContext::PushDecoratingBoxes( - const base::span<NGDecoratingBox>& boxes) { +void InlinePaintContext::PushDecoratingBoxes( + const base::span<DecoratingBox>& boxes) { decorating_boxes_.AppendRange(boxes.begin(), boxes.end()); } -NGInlinePaintContext::ScopedLineBox::ScopedLineBox( +InlinePaintContext::ScopedLineBox::ScopedLineBox( const InlineCursor& line_cursor, - NGInlinePaintContext* inline_context) { + InlinePaintContext* inline_context) { if (!RuntimeEnabledFeatures::TextDecoratingBoxEnabled()) return; DCHECK(inline_context); @@ -274,7 +274,7 @@ inline_context->SetLineBox(line_cursor); } -void NGInlinePaintContext::SetLineBox(const InlineCursor& line_cursor) { +void InlinePaintContext::SetLineBox(const InlineCursor& line_cursor) { DCHECK(RuntimeEnabledFeatures::TextDecoratingBoxEnabled()); DCHECK_EQ(line_cursor.Current()->Type(), FragmentItem::kLine); line_cursor_ = line_cursor; @@ -310,7 +310,7 @@ decorating_boxes_.emplace_back(offset, style, &applied_text_decorations); } -void NGInlinePaintContext::ClearLineBox() { +void InlinePaintContext::ClearLineBox() { last_decorations_ = nullptr; line_decorations_ = nullptr; line_cursor_.reset();
diff --git a/third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.h b/third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.h index 4df9d56b..bf9b9b6 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.h +++ b/third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.h
@@ -15,11 +15,11 @@ // Carries contextual information shared across multiple inline fragments within // an inline formatting context. -class CORE_EXPORT NGInlinePaintContext { +class CORE_EXPORT InlinePaintContext { STACK_ALLOCATED(); public: - using DecoratingBoxList = HeapVector<NGDecoratingBox, 4>; + using DecoratingBoxList = HeapVector<DecoratingBox, 4>; const DecoratingBoxList& DecoratingBoxes() const { return decorating_boxes_; } InlineCursor CursorForDescendantsOfLine() const { @@ -31,7 +31,7 @@ decorating_boxes_.emplace_back(std::forward<Args>(args)...); } void PushDecoratingBoxAncestors(const InlineCursor& inline_box); - void PushDecoratingBoxes(const base::span<NGDecoratingBox>& boxes); + void PushDecoratingBoxes(const base::span<DecoratingBox>& boxes); void PopDecoratingBox(wtf_size_t size); void ClearDecoratingBoxes( DecoratingBoxList* saved_decorating_boxes = nullptr); @@ -50,11 +50,11 @@ public: ScopedInlineItem(const FragmentItem& inline_item, - NGInlinePaintContext* inline_context); + InlinePaintContext* inline_context); ~ScopedInlineItem(); private: - NGInlinePaintContext* inline_context_ = nullptr; + InlinePaintContext* inline_context_ = nullptr; const Vector<AppliedTextDecoration, 1>* last_decorations_ = nullptr; DecoratingBoxList saved_decorating_boxes_; wtf_size_t push_count_ = 0; @@ -66,11 +66,11 @@ public: ScopedInlineBoxAncestors(const InlineCursor& inline_box, - NGInlinePaintContext* inline_context); + InlinePaintContext* inline_context); ~ScopedInlineBoxAncestors(); private: - NGInlinePaintContext* inline_context_ = nullptr; + InlinePaintContext* inline_context_ = nullptr; }; // Pushes all decorating boxes for a line box. @@ -79,11 +79,11 @@ public: ScopedLineBox(const InlineCursor& line_cursor, - NGInlinePaintContext* inline_context); + InlinePaintContext* inline_context); ~ScopedLineBox(); private: - NGInlinePaintContext* inline_context_ = nullptr; + InlinePaintContext* inline_context_ = nullptr; }; // Set |PaintOffset| while the instance of this class is in the scope. @@ -92,7 +92,7 @@ public: ScopedPaintOffset(const PhysicalOffset& paint_offset, - NGInlinePaintContext* inline_context) + InlinePaintContext* inline_context) : paint_offset_(&inline_context->paint_offset_, paint_offset) {} private: @@ -112,12 +112,12 @@ PhysicalOffset paint_offset_; }; -inline void NGInlinePaintContext::PopDecoratingBox(wtf_size_t size) { +inline void InlinePaintContext::PopDecoratingBox(wtf_size_t size) { DCHECK_LE(size, decorating_boxes_.size()); decorating_boxes_.Shrink(decorating_boxes_.size() - size); } -inline NGInlinePaintContext::ScopedInlineItem::~ScopedInlineItem() { +inline InlinePaintContext::ScopedInlineItem::~ScopedInlineItem() { if (!inline_context_) return; inline_context_->last_decorations_ = last_decorations_; @@ -129,13 +129,13 @@ inline_context_->PopDecoratingBox(push_count_); } -inline NGInlinePaintContext::ScopedInlineBoxAncestors:: +inline InlinePaintContext::ScopedInlineBoxAncestors:: ~ScopedInlineBoxAncestors() { if (inline_context_) inline_context_->ClearLineBox(); } -inline NGInlinePaintContext::ScopedLineBox::~ScopedLineBox() { +inline InlinePaintContext::ScopedLineBox::~ScopedLineBox() { if (inline_context_) inline_context_->ClearLineBox(); }
diff --git a/third_party/blink/renderer/core/paint/ng/ng_inline_paint_context_test.cc b/third_party/blink/renderer/core/paint/ng/ng_inline_paint_context_test.cc index cffc70d..4c97ec60 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_inline_paint_context_test.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_inline_paint_context_test.cc
@@ -6,7 +6,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h" namespace blink { @@ -19,21 +19,22 @@ } // namespace -class NGInlinePaintContextTest : public RenderingTest, - private ScopedTextDecoratingBoxForTest { +class InlinePaintContextTest : public RenderingTest, + private ScopedTextDecoratingBoxForTest { public: - NGInlinePaintContextTest() : ScopedTextDecoratingBoxForTest(true) {} + InlinePaintContextTest() : ScopedTextDecoratingBoxForTest(true) {} Vector<float> GetFontSizes( - const NGInlinePaintContext::DecoratingBoxList& boxes) { + const InlinePaintContext::DecoratingBoxList& boxes) { Vector<float> font_sizes; - for (const NGDecoratingBox& box : boxes) + for (const DecoratingBox& box : boxes) { font_sizes.push_back(box.Style().ComputedFontSize()); + } return font_sizes; } }; -TEST_F(NGInlinePaintContextTest, MultiLine) { +TEST_F(InlinePaintContextTest, MultiLine) { LoadAhem(); SetBodyInnerHTML(R"HTML( <style> @@ -97,7 +98,7 @@ EXPECT_EQ(container_fragment.InkOverflowRect(), PhysicalRect(0, 0, 800, 40)); } -TEST_F(NGInlinePaintContextTest, VerticalAlign) { +TEST_F(InlinePaintContextTest, VerticalAlign) { LoadAhem(); SetBodyInnerHTML(R"HTML( <style> @@ -153,7 +154,7 @@ span3_item.OffsetInContainerFragment().top); } -TEST_F(NGInlinePaintContextTest, NestedBlocks) { +TEST_F(InlinePaintContextTest, NestedBlocks) { SetBodyInnerHTML(R"HTML( <style> .ul { @@ -170,7 +171,7 @@ </div> )HTML"); - NGInlinePaintContext context; + InlinePaintContext context; const auto* ifc = To<LayoutBlockFlow>(GetLayoutObjectByElementId("ifc")); InlineCursor cursor(*ifc); cursor.MoveToFirstLine(); @@ -196,13 +197,13 @@ testing::ElementsAre(20.f, 20.f, 10.f, 5.f)); // Push all decorating boxes in the ancestor chain of the `span5`. - NGInlinePaintContext context2; + InlinePaintContext context2; context2.PushDecoratingBoxAncestors(cursor); EXPECT_THAT(GetFontSizes(context2.DecoratingBoxes()), testing::ElementsAre(20.f, 20.f, 10.f)); } -TEST_F(NGInlinePaintContextTest, StopPropagateTextDecorations) { +TEST_F(InlinePaintContextTest, StopPropagateTextDecorations) { // The `<rt>` element produces an inline box that stops propagations. SetBodyInnerHTML(R"HTML( <style>
diff --git a/third_party/blink/renderer/core/paint/ng/ng_table_painters.cc b/third_party/blink/renderer/core/paint/ng/ng_table_painters.cc index e53e551..79c57828 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_table_painters.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_table_painters.cc
@@ -7,8 +7,8 @@ #include "third_party/blink/renderer/core/layout/geometry/writing_mode_converter.h" #include "third_party/blink/renderer/core/layout/layout_box.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_link.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_fragment_link.h" #include "third_party/blink/renderer/core/layout/table/layout_table.h" #include "third_party/blink/renderer/core/layout/table/layout_table_cell.h" #include "third_party/blink/renderer/core/layout/table/layout_table_column.h"
diff --git a/third_party/blink/renderer/core/paint/ng/ng_table_painters.h b/third_party/blink/renderer/core/paint/ng/ng_table_painters.h index 03e8b1f..a0c3078c 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_table_painters.h +++ b/third_party/blink/renderer/core/paint/ng/ng_table_painters.h
@@ -5,7 +5,7 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_NG_NG_TABLE_PAINTERS_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_NG_NG_TABLE_PAINTERS_H_ -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/table/table_fragment_data.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
diff --git a/third_party/blink/renderer/core/paint/ng/ng_text_combine_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_text_combine_painter.cc index 49a99e5..ecf99824 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_text_combine_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_text_combine_painter.cc
@@ -5,7 +5,7 @@ #include "third_party/blink/renderer/core/paint/ng/ng_text_combine_painter.h" #include "third_party/blink/renderer/core/layout/layout_text_combine.h" -#include "third_party/blink/renderer/core/layout/ng/ng_text_decoration_offset.h" +#include "third_party/blink/renderer/core/layout/text_decoration_offset.h" #include "third_party/blink/renderer/core/paint/paint_auto_dark_mode.h" #include "third_party/blink/renderer/core/paint/paint_info.h" #include "third_party/blink/renderer/core/style/computed_style.h" @@ -16,10 +16,9 @@ namespace blink { -NGTextCombinePainter::NGTextCombinePainter( - GraphicsContext& context, - const ComputedStyle& style, - const LineRelativeOffset& text_origin) +TextCombinePainter::TextCombinePainter(GraphicsContext& context, + const ComputedStyle& style, + const LineRelativeOffset& text_origin) : TextPainterBase(context, style.GetFont(), text_origin, @@ -27,11 +26,11 @@ /* horizontal */ false), style_(style) {} -NGTextCombinePainter::~NGTextCombinePainter() = default; +TextCombinePainter::~TextCombinePainter() = default; -void NGTextCombinePainter::Paint(const PaintInfo& paint_info, - const PhysicalOffset& paint_offset, - const LayoutTextCombine& text_combine) { +void TextCombinePainter::Paint(const PaintInfo& paint_info, + const PhysicalOffset& paint_offset, + const LayoutTextCombine& text_combine) { if (paint_info.phase == PaintPhase::kBlockBackground || paint_info.phase == PaintPhase::kForcedColorsModeBackplate || paint_info.phase == PaintPhase::kFloat || @@ -67,8 +66,8 @@ text_frame_rect.ComputeRelativeToPhysicalTransform( style.GetWritingMode())); - NGTextCombinePainter text_painter(paint_info.context, style, - text_frame_rect.offset); + TextCombinePainter text_painter(paint_info.context, style, + text_frame_rect.offset); const TextPaintStyle text_style = TextPainterBase::TextPaintingStyle( text_combine.GetDocument(), style, paint_info); @@ -83,22 +82,22 @@ } // static -bool NGTextCombinePainter::ShouldPaint(const LayoutTextCombine& text_combine) { +bool TextCombinePainter::ShouldPaint(const LayoutTextCombine& text_combine) { const auto& style = text_combine.Parent()->StyleRef(); return style.HasAppliedTextDecorations() || style.GetTextEmphasisMark() != TextEmphasisMark::kNone; } -void NGTextCombinePainter::ClipDecorationsStripe(const TextFragmentPaintInfo&, - float upper, - float stripe_width, - float dilation) { +void TextCombinePainter::ClipDecorationsStripe(const TextFragmentPaintInfo&, + float upper, + float stripe_width, + float dilation) { // Nothing to do. } -void NGTextCombinePainter::PaintDecorations(const PaintInfo& paint_info, - LayoutUnit width, - const TextPaintStyle& text_style) { +void TextCombinePainter::PaintDecorations(const PaintInfo& paint_info, + LayoutUnit width, + const TextPaintStyle& text_style) { // Setup arguments for painting text decorations TextDecorationInfo decoration_info(text_origin_, width, style_, /* inline_context */ nullptr, {}); @@ -113,8 +112,8 @@ PaintDecorationsOnlyLineThrough(decoration_info, paint_info, text_style); } -void NGTextCombinePainter::PaintEmphasisMark(const TextPaintStyle& text_style, - const Font& emphasis_mark_font) { +void TextCombinePainter::PaintEmphasisMark(const TextPaintStyle& text_style, + const Font& emphasis_mark_font) { DCHECK_NE(style_.GetTextEmphasisMark(), TextEmphasisMark::kNone); SetEmphasisMark(style_.TextEmphasisMarkString(), style_.GetTextEmphasisPosition());
diff --git a/third_party/blink/renderer/core/paint/ng/ng_text_combine_painter.h b/third_party/blink/renderer/core/paint/ng/ng_text_combine_painter.h index a8f94cc..549f8f0c 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_text_combine_painter.h +++ b/third_party/blink/renderer/core/paint/ng/ng_text_combine_painter.h
@@ -14,13 +14,13 @@ struct LineRelativeOffset; // The painter for painting text decorations and emphasis marks for -// LayoutNGTextCombine. -class NGTextCombinePainter final : public TextPainterBase { +// LayoutTextCombine. +class TextCombinePainter final : public TextPainterBase { public: - NGTextCombinePainter(GraphicsContext& context, - const ComputedStyle& style, - const LineRelativeOffset& text_origin); - ~NGTextCombinePainter(); + TextCombinePainter(GraphicsContext& context, + const ComputedStyle& style, + const LineRelativeOffset& text_origin); + ~TextCombinePainter(); static void Paint(const PaintInfo& paint_info, const PhysicalOffset& paint_offset,
diff --git a/third_party/blink/renderer/core/paint/ng/ng_text_decoration_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_text_decoration_painter.cc index 813fc9a..541a304 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_text_decoration_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_text_decoration_painter.cc
@@ -13,8 +13,8 @@ namespace blink { -NGTextDecorationPainter::NGTextDecorationPainter( - NGTextPainter& text_painter, +TextDecorationPainter::TextDecorationPainter( + TextPainter& text_painter, const FragmentItem& text_item, const PaintInfo& paint_info, const ComputedStyle& style, @@ -31,11 +31,11 @@ step_(kBegin), phase_(kOriginating) {} -NGTextDecorationPainter::~NGTextDecorationPainter() { +TextDecorationPainter::~TextDecorationPainter() { DCHECK(step_ == kBegin); } -void NGTextDecorationPainter::UpdateDecorationInfo( +void TextDecorationPainter::UpdateDecorationInfo( absl::optional<TextDecorationInfo>& result, const ComputedStyle& style, absl::optional<LineRelativeRect> decoration_rect_override, @@ -64,7 +64,7 @@ *text_item_.GetLayoutObject(), scaling_factor, scaled_font); DCHECK(scaling_factor); // Adjust the origin of the decoration because - // NGTextPainter::PaintDecorationsExceptLineThrough() will change the + // TextPainter::PaintDecorationsExceptLineThrough() will change the // scaling of the GraphicsContext. LayoutUnit top = decoration_rect_.offset.line_over; // In svg/text/text-decorations-in-scaled-pattern.svg, the size of @@ -90,7 +90,7 @@ } } -void NGTextDecorationPainter::Begin(Phase phase) { +void TextDecorationPainter::Begin(Phase phase) { DCHECK(step_ == kBegin); phase_ = phase; @@ -118,7 +118,7 @@ step_ = kExcept; } -void NGTextDecorationPainter::PaintExceptLineThrough( +void TextDecorationPainter::PaintExceptLineThrough( const TextFragmentPaintInfo& fragment_paint_info) { DCHECK(step_ == kExcept); @@ -137,7 +137,7 @@ step_ = kOnly; } -void NGTextDecorationPainter::PaintOnlyLineThrough() { +void TextDecorationPainter::PaintOnlyLineThrough() { DCHECK(step_ == kOnly); // Clipping the canvas unnecessarily is expensive, so avoid doing it if there @@ -154,7 +154,7 @@ step_ = kBegin; } -void NGTextDecorationPainter::ClipIfNeeded( +void TextDecorationPainter::ClipIfNeeded( GraphicsContextStateSaver& state_saver) { DCHECK(step_ != kBegin);
diff --git a/third_party/blink/renderer/core/paint/ng/ng_text_decoration_painter.h b/third_party/blink/renderer/core/paint/ng/ng_text_decoration_painter.h index e801b3e1..41504c1 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_text_decoration_painter.h +++ b/third_party/blink/renderer/core/paint/ng/ng_text_decoration_painter.h
@@ -15,14 +15,14 @@ class ComputedStyle; class FragmentItem; class GraphicsContextStateSaver; -class NGTextPainter; +class TextPainter; struct LineRelativeRect; struct PaintInfo; struct TextPaintStyle; -// NGTextFragmentPainter helper that paints text-decoration. +// TextFragmentPainter helper that paints text-decoration. // -// We expose a friendlier interface over NGTextPainter’s decoration +// We expose a friendlier interface over TextPainter’s decoration // primitives that’s harder to misuse. Callers of Begin must then call // PaintExceptLineThrough and PaintOnlyLineThrough, in exactly that order // (though other painting code may happen in between). @@ -31,19 +31,19 @@ // any ::selection background, but paint all decorations along the full logical // width of |decoration_rect|. This yields better results for wavy lines, since // they stay perfectly continuous and in phase into any highlighted parts. -class CORE_EXPORT NGTextDecorationPainter { +class CORE_EXPORT TextDecorationPainter { STACK_ALLOCATED(); public: - explicit NGTextDecorationPainter( - NGTextPainter& text_painter, + explicit TextDecorationPainter( + TextPainter& text_painter, const FragmentItem& text_item, const PaintInfo& paint_info, const ComputedStyle& style, const TextPaintStyle& text_style, const LineRelativeRect& decoration_rect, NGHighlightPainter::SelectionPaintState* selection); - ~NGTextDecorationPainter(); + ~TextDecorationPainter(); // Sets the given optional to a new TextDecorationInfo with the decorations // that need to be painted, or nullopt if decorations should not be painted. @@ -61,7 +61,7 @@ enum Step { kBegin, kExcept, kOnly }; void ClipIfNeeded(GraphicsContextStateSaver&); - NGTextPainter& text_painter_; + TextPainter& text_painter_; const FragmentItem& text_item_; const PaintInfo& paint_info_; const ComputedStyle& style_;
diff --git a/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter.cc index d3463547..0a94819 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter.cc
@@ -18,9 +18,9 @@ #include "third_party/blink/renderer/core/layout/layout_ruby_text.h" #include "third_party/blink/renderer/core/layout/layout_text_combine.h" #include "third_party/blink/renderer/core/layout/list/list_marker.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_text_decoration_offset.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_inline_text.h" +#include "third_party/blink/renderer/core/layout/text_decoration_offset.h" #include "third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.h" #include "third_party/blink/renderer/core/paint/box_model_object_painter.h" #include "third_party/blink/renderer/core/paint/document_marker_painter.h" @@ -189,11 +189,11 @@ } // namespace -void NGTextFragmentPainter::PaintSymbol(const LayoutObject* layout_object, - const ComputedStyle& style, - const PhysicalSize box_size, - const PaintInfo& paint_info, - const PhysicalOffset& paint_offset) { +void TextFragmentPainter::PaintSymbol(const LayoutObject* layout_object, + const ComputedStyle& style, + const PhysicalSize box_size, + const PaintInfo& paint_info, + const PhysicalOffset& paint_offset) { const AtomicString& type = LayoutCounter::ListStyle(layout_object, style); PhysicalRect marker_rect( ListMarker::RelativeSymbolMarkerRect(style, type, box_size.width)); @@ -241,8 +241,8 @@ } } -void NGTextFragmentPainter::Paint(const PaintInfo& paint_info, - const PhysicalOffset& paint_offset) { +void TextFragmentPainter::Paint(const PaintInfo& paint_info, + const PhysicalOffset& paint_offset) { const auto& text_item = *cursor_.CurrentItem(); // We can skip painting if the fragment (including selection) is invisible. if (!text_item.TextLength()) @@ -413,11 +413,11 @@ ? text_combine->AdjustTextTopForPaint(physical_box.offset.top) : physical_box.offset.top + ascent}; - NGTextPainter text_painter(context, font, visual_rect, text_origin, - inline_context_, is_horizontal); - NGTextDecorationPainter decoration_painter(text_painter, text_item, - paint_info, style, text_style, - rotated_box, selection); + TextPainter text_painter(context, font, visual_rect, text_origin, + inline_context_, is_horizontal); + TextDecorationPainter decoration_painter(text_painter, text_item, paint_info, + style, text_style, rotated_box, + selection); NGHighlightPainter highlight_painter( fragment_paint_info, text_painter, decoration_painter, paint_info, cursor_, *cursor_.CurrentItem(), rotation, physical_box.offset, style, @@ -437,7 +437,7 @@ } if (svg_inline_text) { - NGTextPainter::SvgTextPaintState& svg_state = text_painter.SetSvgState( + TextPainter::SvgTextPaintState& svg_state = text_painter.SetSvgState( *svg_inline_text, style, text_item.GetStyleVariant(), paint_info.GetPaintFlags()); @@ -464,7 +464,7 @@ if (rotation) { state_saver.SaveIfNeeded(); context.ConcatCTM(*rotation); - if (NGTextPainter::SvgTextPaintState* state = text_painter.GetSvgState()) { + if (TextPainter::SvgTextPaintState* state = text_painter.GetSvgState()) { DCHECK(rotation->IsInvertible()); state->EnsureShaderTransform().PostConcat(rotation->Inverse()); } @@ -497,8 +497,8 @@ if (auto* layout_text = DynamicTo<LayoutText>(node->GetLayoutObject())) node_id = layout_text->EnsureNodeId(); } - NGInlinePaintContext::ScopedPaintOffset scoped_paint_offset(paint_offset, - inline_context_); + InlinePaintContext::ScopedPaintOffset scoped_paint_offset(paint_offset, + inline_context_); AutoDarkMode auto_dark_mode( PaintAutoDarkMode(style, DarkModeFilter::ElementRole::kForeground)); @@ -507,14 +507,14 @@ switch (highlight_case) { case NGHighlightPainter::kNoHighlights: // Fast path: just paint the text, including its decorations. - decoration_painter.Begin(NGTextDecorationPainter::kOriginating); + decoration_painter.Begin(TextDecorationPainter::kOriginating); decoration_painter.PaintExceptLineThrough(fragment_paint_info); text_painter.Paint(fragment_paint_info, text_style, node_id, auto_dark_mode); decoration_painter.PaintOnlyLineThrough(); break; case NGHighlightPainter::kFastSpellingGrammar: - decoration_painter.Begin(NGTextDecorationPainter::kOriginating); + decoration_painter.Begin(TextDecorationPainter::kOriginating); decoration_painter.PaintExceptLineThrough(fragment_paint_info); text_painter.Paint(fragment_paint_info, text_style, node_id, auto_dark_mode); @@ -561,7 +561,7 @@ auto_dark_mode); break; case NGHighlightPainter::kSelectionOnly: - decoration_painter.Begin(NGTextDecorationPainter::kSelection); + decoration_painter.Begin(TextDecorationPainter::kSelection); decoration_painter.PaintExceptLineThrough(fragment_paint_info); highlight_painter.Selection()->PaintSelectedText( text_painter, fragment_paint_info, text_style, node_id,
diff --git a/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter.h b/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter.h index eda86d3..95d56e3a 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter.h +++ b/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter.h
@@ -16,8 +16,8 @@ class ComputedStyle; class DisplayItemClient; class InlineCursor; +class InlinePaintContext; class LayoutObject; -class NGInlinePaintContext; struct PaintInfo; struct PhysicalOffset; struct PhysicalRect; @@ -25,17 +25,16 @@ struct TextFragmentPaintInfo; // Text fragment painter for LayoutNG. Operates on FragmentItem that IsText() -// and handles clipping, selection, etc. Delegates to NGTextPainter to paint the +// and handles clipping, selection, etc. Delegates to TextPainter to paint the // text itself. -class NGTextFragmentPainter { +class TextFragmentPainter { STACK_ALLOCATED(); public: - explicit NGTextFragmentPainter(const InlineCursor& cursor) - : cursor_(cursor) {} - NGTextFragmentPainter(const InlineCursor& cursor, - const PhysicalOffset& parent_offset, - NGInlinePaintContext* inline_context) + explicit TextFragmentPainter(const InlineCursor& cursor) : cursor_(cursor) {} + TextFragmentPainter(const InlineCursor& cursor, + const PhysicalOffset& parent_offset, + InlinePaintContext* inline_context) : cursor_(cursor), parent_offset_(parent_offset), inline_context_(inline_context) {} @@ -63,7 +62,7 @@ const InlineCursor& cursor_; PhysicalOffset parent_offset_; absl::optional<InlineCursor> inline_cursor_for_block_flow_; - NGInlinePaintContext* inline_context_ = nullptr; + InlinePaintContext* inline_context_ = nullptr; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter_test.cc b/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter_test.cc index 18aadc3..48820f9 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter_test.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter_test.cc
@@ -6,9 +6,9 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/renderer/core/layout/block_node.h" #include "third_party/blink/renderer/core/layout/inline/inline_cursor.h" -#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" -#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" +#include "third_party/blink/renderer/core/layout/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/paint/paint_controller_paint_test.h" #include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h" @@ -16,16 +16,16 @@ namespace blink { -class NGTextFragmentPainterTest : public PaintControllerPaintTest { +class TextFragmentPainterTest : public PaintControllerPaintTest { public: - explicit NGTextFragmentPainterTest( + explicit TextFragmentPainterTest( LocalFrameClient* local_frame_client = nullptr) : PaintControllerPaintTest(local_frame_client) {} }; -INSTANTIATE_PAINT_TEST_SUITE_P(NGTextFragmentPainterTest); +INSTANTIATE_PAINT_TEST_SUITE_P(TextFragmentPainterTest); -TEST_P(NGTextFragmentPainterTest, TestTextStyle) { +TEST_P(TextFragmentPainterTest, TestTextStyle) { SetBodyInnerHTML(R"HTML( <!DOCTYPE html> <body> @@ -44,7 +44,7 @@ IsSameId(text_fragment.Id(), kForegroundType))); } -TEST_P(NGTextFragmentPainterTest, LineBreak) { +TEST_P(TextFragmentPainterTest, LineBreak) { SetBodyInnerHTML("<span style='font-size: 20px'>A<br>B<br>C</span>"); // 0: view background, 1: A, 2: B, 3: C EXPECT_EQ(4u, ContentDisplayItems().size()); @@ -55,7 +55,7 @@ EXPECT_EQ(6u, ContentDisplayItems().size()); } -TEST_P(NGTextFragmentPainterTest, LineBreaksInLongDocument) { +TEST_P(TextFragmentPainterTest, LineBreaksInLongDocument) { SetBodyInnerHTML( "<div id='div' style='font-size: 100px; width: 300px'><div>"); auto* div = GetDocument().getElementById(AtomicString("div")); @@ -72,7 +72,7 @@ EXPECT_LE(ContentDisplayItems().size(), 100u); } -TEST_P(NGTextFragmentPainterTest, DegenerateUnderlineIntercepts) { +TEST_P(TextFragmentPainterTest, DegenerateUnderlineIntercepts) { SetBodyInnerHTML(R"HTML( <!DOCTYPE html> <style> @@ -89,7 +89,7 @@ // due to letter spacing and this test passes if that does not cause a crash. } -TEST_P(NGTextFragmentPainterTest, SvgTextWithFirstLineTextDecoration) { +TEST_P(TextFragmentPainterTest, SvgTextWithFirstLineTextDecoration) { SetBodyInnerHTML(R"HTML( <!DOCTYPE html> <style> @@ -104,7 +104,7 @@ // Test passes if no crashes. } -TEST_P(NGTextFragmentPainterTest, SvgTextWithTextDecorationNotInFirstLine) { +TEST_P(TextFragmentPainterTest, SvgTextWithTextDecorationNotInFirstLine) { SetBodyInnerHTML(R"HTML( <style>text:first-line { fill: lime; }</style> <svg xmlns="http://www.w3.org/2000/svg"> @@ -114,7 +114,7 @@ // Test passes if no crashes. } -TEST_P(NGTextFragmentPainterTest, WheelEventListenerOnInlineElement) { +TEST_P(TextFragmentPainterTest, WheelEventListenerOnInlineElement) { LoadAhem(); SetBodyInnerHTML(R"HTML( <style>body {margin: 0}</style>
diff --git a/third_party/blink/renderer/core/paint/ng/ng_text_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_text_painter.cc index 3f0b63c..8c8da72 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_text_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_text_painter.cc
@@ -12,11 +12,11 @@ #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/layout/inline/fragment_item.h" #include "third_party/blink/renderer/core/layout/layout_object_inlines.h" -#include "third_party/blink/renderer/core/layout/ng/ng_text_decoration_offset.h" #include "third_party/blink/renderer/core/layout/ng/ng_unpositioned_float.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_inline_text.h" #include "third_party/blink/renderer/core/layout/svg/svg_layout_support.h" #include "third_party/blink/renderer/core/layout/svg/svg_resources.h" +#include "third_party/blink/renderer/core/layout/text_decoration_offset.h" #include "third_party/blink/renderer/core/paint/applied_decoration_painter.h" #include "third_party/blink/renderer/core/paint/box_painter.h" #include "third_party/blink/renderer/core/paint/paint_info.h" @@ -76,7 +76,7 @@ enum class SvgPaintMode { kText, kTextDecoration }; const ComputedStyle& GetSvgStyleToPaint( - const NGTextPainter::SvgTextPaintState& state, + const TextPainter::SvgTextPaintState& state, SvgPaintMode svg_paint_mode, absl::optional<SelectionStyleScope>& selection_style_scope, bool& out_has_fill, @@ -113,7 +113,7 @@ return *style_to_paint; } -bool SetupPaintForSvgText(const NGTextPainter::SvgTextPaintState& state, +bool SetupPaintForSvgText(const TextPainter::SvgTextPaintState& state, const GraphicsContext& context, const ComputedStyle& style, SvgPaintMode svg_paint_mode, @@ -174,11 +174,11 @@ } // namespace -void NGTextPainter::Paint(const TextFragmentPaintInfo& fragment_paint_info, - const TextPaintStyle& text_style, - DOMNodeId node_id, - const AutoDarkMode& auto_dark_mode, - ShadowMode shadow_mode) { +void TextPainter::Paint(const TextFragmentPaintInfo& fragment_paint_info, + const TextPaintStyle& text_style, + DOMNodeId node_id, + const AutoDarkMode& auto_dark_mode, + ShadowMode shadow_mode) { // TODO(layout-dev): We shouldn't be creating text fragments without text. if (!fragment_paint_info.shape_result) { return; @@ -202,7 +202,7 @@ // 1. Paint glyphs inside of |selection_rect| using |selection_style|, and // outside using |text_style|. // 2. Paint parts of a ligature glyph. -void NGTextPainter::PaintSelectedText( +void TextPainter::PaintSelectedText( const TextFragmentPaintInfo& fragment_paint_info, unsigned selection_start, unsigned selection_end, @@ -229,8 +229,9 @@ (selection_start == fragment_paint_info.from && selection_end == fragment_paint_info.to)) { absl::optional<base::AutoReset<bool>> is_painting_selection_reset; - if (NGTextPainter::SvgTextPaintState* state = GetSvgState()) + if (TextPainter::SvgTextPaintState* state = GetSvgState()) { is_painting_selection_reset.emplace(&state->is_painting_selection_, true); + } Paint(fragment_paint_info.Slice(selection_start, selection_end), selection_style, node_id, auto_dark_mode); return; @@ -255,8 +256,9 @@ // Then draw the glyphs inside the selection area, with the selection style. { absl::optional<base::AutoReset<bool>> is_painting_selection_reset; - if (NGTextPainter::SvgTextPaintState* state = GetSvgState()) + if (TextPainter::SvgTextPaintState* state = GetSvgState()) { is_painting_selection_reset.emplace(&state->is_painting_selection_, true); + } GraphicsContextStateSaver state_saver(graphics_context_); graphics_context_.Clip(float_selection_rect); Paint(fragment_paint_info.Slice(selection_start, selection_end), @@ -264,7 +266,7 @@ } } -void NGTextPainter::PaintDecorationsExceptLineThrough( +void TextPainter::PaintDecorationsExceptLineThrough( const TextFragmentPaintInfo& fragment_paint_info, const FragmentItem& text_item, const PaintInfo& paint_info, @@ -296,7 +298,7 @@ } } -void NGTextPainter::PaintDecorationsOnlyLineThrough( +void TextPainter::PaintDecorationsOnlyLineThrough( const FragmentItem& text_item, const PaintInfo& paint_info, const ComputedStyle& style, @@ -320,8 +322,8 @@ } } -template <NGTextPainter::PaintInternalStep step> -void NGTextPainter::PaintInternalFragment( +template <TextPainter::PaintInternalStep step> +void TextPainter::PaintInternalFragment( const TextFragmentPaintInfo& fragment_paint_info, DOMNodeId node_id, const AutoDarkMode& auto_dark_mode) { @@ -359,7 +361,7 @@ } } -void NGTextPainter::ClipDecorationsStripe( +void TextPainter::ClipDecorationsStripe( const TextFragmentPaintInfo& fragment_paint_info, float upper, float stripe_width, @@ -376,11 +378,11 @@ DecorationsStripeIntercepts(upper, stripe_width, dilation, text_intercepts); } -void NGTextPainter::PaintSvgTextFragment( +void TextPainter::PaintSvgTextFragment( const TextFragmentPaintInfo& fragment_paint_info, DOMNodeId node_id, const AutoDarkMode& auto_dark_mode) { - const NGTextPainter::SvgTextPaintState& state = svg_text_paint_state_.value(); + const TextPainter::SvgTextPaintState& state = svg_text_paint_state_.value(); if (state.IsPaintingTextMatch()) { cc::PaintFlags fill_flags; fill_flags.setColor(state.TextMatchColor().Rgb()); @@ -446,14 +448,14 @@ } } -void NGTextPainter::PaintSvgDecorationsExceptLineThrough( +void TextPainter::PaintSvgDecorationsExceptLineThrough( const TextFragmentPaintInfo& fragment_paint_info, const TextDecorationOffset& decoration_offset, TextDecorationInfo& decoration_info, TextDecorationLine lines_to_paint, const PaintInfo& paint_info, const TextPaintStyle& text_style) { - const NGTextPainter::SvgTextPaintState& state = svg_text_paint_state_.value(); + const TextPainter::SvgTextPaintState& state = svg_text_paint_state_.value(); absl::optional<SelectionStyleScope> selection_style_scope; bool has_fill = false; bool has_visible_stroke = false; @@ -495,11 +497,11 @@ } } -void NGTextPainter::PaintSvgDecorationsOnlyLineThrough( +void TextPainter::PaintSvgDecorationsOnlyLineThrough( TextDecorationInfo& decoration_info, const PaintInfo& paint_info, const TextPaintStyle& text_style) { - const NGTextPainter::SvgTextPaintState& state = svg_text_paint_state_.value(); + const TextPainter::SvgTextPaintState& state = svg_text_paint_state_.value(); absl::optional<SelectionStyleScope> selection_style_scope; bool has_fill = false; bool has_visible_stroke = false; @@ -540,7 +542,7 @@ } } -NGTextPainter::SvgTextPaintState& NGTextPainter::SetSvgState( +TextPainter::SvgTextPaintState& TextPainter::SetSvgState( const LayoutSVGInlineText& svg_inline_text, const ComputedStyle& style, StyleVariant style_variant, @@ -549,7 +551,7 @@ paint_flags); } -NGTextPainter::SvgTextPaintState& NGTextPainter::SetSvgState( +TextPainter::SvgTextPaintState& TextPainter::SetSvgState( const LayoutSVGInlineText& svg_inline_text, const ComputedStyle& style, Color text_match_color) { @@ -557,11 +559,11 @@ text_match_color); } -NGTextPainter::SvgTextPaintState* NGTextPainter::GetSvgState() { +TextPainter::SvgTextPaintState* TextPainter::GetSvgState() { return base::OptionalToPtr(svg_text_paint_state_); } -NGTextPainter::SvgTextPaintState::SvgTextPaintState( +TextPainter::SvgTextPaintState::SvgTextPaintState( const LayoutSVGInlineText& layout_svg_inline_text, const ComputedStyle& style, StyleVariant style_variant, @@ -571,7 +573,7 @@ style_variant_(style_variant), paint_flags_(paint_flags) {} -NGTextPainter::SvgTextPaintState::SvgTextPaintState( +TextPainter::SvgTextPaintState::SvgTextPaintState( const LayoutSVGInlineText& layout_svg_inline_text, const ComputedStyle& style, Color text_match_color) @@ -579,12 +581,11 @@ style_(style), text_match_color_(text_match_color) {} -const LayoutSVGInlineText& NGTextPainter::SvgTextPaintState::InlineText() - const { +const LayoutSVGInlineText& TextPainter::SvgTextPaintState::InlineText() const { return layout_svg_inline_text_; } -const LayoutObject& NGTextPainter::SvgTextPaintState::TextDecorationObject() +const LayoutObject& TextPainter::SvgTextPaintState::TextDecorationObject() const { // Lookup the first LayoutObject in parent hierarchy which has text-decoration // set. @@ -608,36 +609,36 @@ return *result; } -const ComputedStyle& NGTextPainter::SvgTextPaintState::Style() const { +const ComputedStyle& TextPainter::SvgTextPaintState::Style() const { return style_; } -bool NGTextPainter::SvgTextPaintState::IsPaintingSelection() const { +bool TextPainter::SvgTextPaintState::IsPaintingSelection() const { return is_painting_selection_; } -PaintFlags NGTextPainter::SvgTextPaintState::GetPaintFlags() const { +PaintFlags TextPainter::SvgTextPaintState::GetPaintFlags() const { return paint_flags_; } -bool NGTextPainter::SvgTextPaintState::IsRenderingClipPathAsMaskImage() const { +bool TextPainter::SvgTextPaintState::IsRenderingClipPathAsMaskImage() const { return paint_flags_ & PaintFlag::kPaintingClipPathAsMask; } -bool NGTextPainter::SvgTextPaintState::IsPaintingTextMatch() const { +bool TextPainter::SvgTextPaintState::IsPaintingTextMatch() const { return text_match_color_.has_value(); } -Color NGTextPainter::SvgTextPaintState::TextMatchColor() const { +Color TextPainter::SvgTextPaintState::TextMatchColor() const { return *text_match_color_; } -AffineTransform& NGTextPainter::SvgTextPaintState::EnsureShaderTransform() { +AffineTransform& TextPainter::SvgTextPaintState::EnsureShaderTransform() { return shader_transform_ ? shader_transform_.value() : shader_transform_.emplace(); } -const AffineTransform* NGTextPainter::SvgTextPaintState::GetShaderTransform() +const AffineTransform* TextPainter::SvgTextPaintState::GetShaderTransform() const { return base::OptionalToPtr(shader_transform_); }
diff --git a/third_party/blink/renderer/core/paint/ng/ng_text_painter.h b/third_party/blink/renderer/core/paint/ng/ng_text_painter.h index 00ad686..0e9b4133 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_text_painter.h +++ b/third_party/blink/renderer/core/paint/ng/ng_text_painter.h
@@ -23,9 +23,9 @@ // Text painter for LayoutNG, logic shared between legacy layout and LayoutNG // is implemented in the TextPainterBase base class. // Operates on NGPhysicalTextFragments and only paints text and decorations. -// Border painting etc is handled by the NGTextFragmentPainter class. +// Border painting etc is handled by the TextFragmentPainter class. // TODO(layout-dev): Does this distinction make sense? -class CORE_EXPORT NGTextPainter : public TextPainterBase { +class CORE_EXPORT TextPainter : public TextPainterBase { STACK_ALLOCATED(); public: @@ -62,24 +62,20 @@ StyleVariant style_variant_ = StyleVariant::kStandard; PaintFlags paint_flags_ = PaintFlag::kNoFlag; bool is_painting_selection_ = false; - friend class NGTextPainter; + friend class TextPainter; }; - NGTextPainter(GraphicsContext& context, - const Font& font, - const gfx::Rect& visual_rect, - const LineRelativeOffset& text_origin, - NGInlinePaintContext* inline_context, - bool horizontal) - : TextPainterBase(context, - font, - text_origin, - inline_context, - horizontal), + TextPainter(GraphicsContext& context, + const Font& font, + const gfx::Rect& visual_rect, + const LineRelativeOffset& text_origin, + InlinePaintContext* inline_context, + bool horizontal) + : TextPainterBase(context, font, text_origin, inline_context, horizontal), visual_rect_(visual_rect) { DCHECK(inline_context_); } - ~NGTextPainter() = default; + ~TextPainter() = default; void Paint(const TextFragmentPaintInfo& fragment_paint_info, const TextPaintStyle&,
diff --git a/third_party/blink/renderer/core/paint/paint_info.h b/third_party/blink/renderer/core/paint/paint_info.h index e36ec539..6ed74490 100644 --- a/third_party/blink/renderer/core/paint/paint_info.h +++ b/third_party/blink/renderer/core/paint/paint_info.h
@@ -30,7 +30,7 @@ #include "base/check_op.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/layout/layout_box.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/paint_flags.h" #include "third_party/blink/renderer/core/paint/paint_phase.h" #include "third_party/blink/renderer/platform/geometry/layout_rect.h"
diff --git a/third_party/blink/renderer/core/paint/paint_invalidator.cc b/third_party/blink/renderer/core/paint/paint_invalidator.cc index 157d55f..44e7eed 100644 --- a/third_party/blink/renderer/core/paint/paint_invalidator.cc +++ b/third_party/blink/renderer/core/paint/paint_invalidator.cc
@@ -16,8 +16,8 @@ #include "third_party/blink/renderer/core/layout/layout_object.h" #include "third_party/blink/renderer/core/layout/layout_shift_tracker.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.h" #include "third_party/blink/renderer/core/page/link_highlight.h" #include "third_party/blink/renderer/core/page/page.h"
diff --git a/third_party/blink/renderer/core/paint/paint_layer_fragment.cc b/third_party/blink/renderer/core/paint/paint_layer_fragment.cc index 0ea938e..85fecbf 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_fragment.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_fragment.cc
@@ -3,7 +3,7 @@ // found in the LICENSE file. #include "third_party/blink/renderer/core/paint/paint_layer_fragment.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/fragment_data.h" namespace blink {
diff --git a/third_party/blink/renderer/core/paint/paint_layer_painter.cc b/third_party/blink/renderer/core/paint/paint_layer_painter.cc index 779529d..35a43d6 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_painter.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_painter.cc
@@ -400,8 +400,8 @@ NGBoxFragmentPainter(*physical_fragment).Paint(paint_info); } else if (const auto* layout_inline = DynamicTo<LayoutInline>(&paint_layer_.GetLayoutObject())) { - NGInlineBoxFragmentPainter::PaintAllFragments( - *layout_inline, fragment_data, fragment_data_idx, paint_info); + InlineBoxFragmentPainter::PaintAllFragments(*layout_inline, fragment_data, + fragment_data_idx, paint_info); } else { // We are about to enter legacy paint code. Set the right FragmentData // object, to use the right paint offset.
diff --git a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc index 3a112bd..18a44a6 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc
@@ -85,8 +85,8 @@ #include "third_party/blink/renderer/core/layout/layout_embedded_content.h" #include "third_party/blink/renderer/core/layout/layout_theme.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/legacy_layout_tree_walking.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/legacy_layout_tree_walking.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/loader/document_loader.h" #include "third_party/blink/renderer/core/page/chrome_client.h" #include "third_party/blink/renderer/core/page/focus_controller.h"
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc index 7338eed..18c26ddd 100644 --- a/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc +++ b/third_party/blink/renderer/core/paint/paint_property_tree_builder.cc
@@ -37,7 +37,7 @@ #include "third_party/blink/renderer/core/layout/layout_view.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_resource_clipper.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_root.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_viewport_container.h"
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc b/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc index 223fc2f6..39e9e10 100644 --- a/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc +++ b/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc
@@ -16,7 +16,7 @@ #include "third_party/blink/renderer/core/layout/layout_image.h" #include "third_party/blink/renderer/core/layout/layout_multi_column_flow_thread.h" #include "third_party/blink/renderer/core/layout/layout_tree_as_text.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/layout/svg/layout_svg_root.h" #include "third_party/blink/renderer/core/paint/fragment_data_iterator.h" #include "third_party/blink/renderer/core/paint/object_paint_properties.h"
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_update_tests.cc b/third_party/blink/renderer/core/paint/paint_property_tree_update_tests.cc index f044557..1a5b9870 100644 --- a/third_party/blink/renderer/core/paint/paint_property_tree_update_tests.cc +++ b/third_party/blink/renderer/core/paint/paint_property_tree_update_tests.cc
@@ -8,7 +8,7 @@ #include "third_party/blink/renderer/core/frame/visual_viewport.h" #include "third_party/blink/renderer/core/html/forms/html_select_element.h" #include "third_party/blink/renderer/core/html/html_iframe_element.h" -#include "third_party/blink/renderer/core/layout/ng/ng_ink_overflow.h" +#include "third_party/blink/renderer/core/layout/ink_overflow.h" #include "third_party/blink/renderer/core/page/focus_controller.h" #include "third_party/blink/renderer/core/page/page_animator.h" #include "third_party/blink/renderer/core/paint/paint_property_tree_builder_test.h" @@ -2131,7 +2131,7 @@ ->setAttribute(html_names::kStyleAttr, AtomicString("background:purple")); GetDocument() .getElementById(AtomicString("locked_display_inner")) - ->getBoundingClientRect(); + ->GetBoundingClientRect(); EXPECT_TRUE(fast_path_div->GetLayoutObject()->NeedsPaintPropertyUpdate()); GetDocument().ElementFromPoint(1, 1); EXPECT_NEAR(0.8, div_properties->Effect()->Opacity(), 0.001);
diff --git a/third_party/blink/renderer/core/paint/pre_paint_tree_walk.cc b/third_party/blink/renderer/core/paint/pre_paint_tree_walk.cc index 403504fe..9b4209c 100644 --- a/third_party/blink/renderer/core/paint/pre_paint_tree_walk.cc +++ b/third_party/blink/renderer/core/paint/pre_paint_tree_walk.cc
@@ -21,7 +21,7 @@ #include "third_party/blink/renderer/core/layout/layout_view.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_break_token.h" #include "third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/page/chrome_client.h" #include "third_party/blink/renderer/core/page/link_highlight.h" #include "third_party/blink/renderer/core/page/page.h" @@ -364,7 +364,7 @@ FragmentData* fragment_data = &fragment_list; // BR elements never fragment. While there are parts of the code that depend - // on the correct paint offset (getBoundingClientRect(), etc.), we don't need + // on the correct paint offset (GetBoundingClientRect(), etc.), we don't need // to set fragmentation info (nor create multiple FragmentData entries). BR // elements aren't necessarily marked for invalidation when laid out (which // means that allow_update won't be set when it should, and the code below
diff --git a/third_party/blink/renderer/core/paint/scoped_paint_state.h b/third_party/blink/renderer/core/paint/scoped_paint_state.h index 0fbb1ba..fa31a6e 100644 --- a/third_party/blink/renderer/core/paint/scoped_paint_state.h +++ b/third_party/blink/renderer/core/paint/scoped_paint_state.h
@@ -7,7 +7,7 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/renderer/core/layout/layout_box.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.h" #include "third_party/blink/renderer/core/paint/paint_info.h" #include "third_party/blink/renderer/platform/graphics/paint/scoped_paint_chunk_properties.h"
diff --git a/third_party/blink/renderer/core/paint/text_decoration_info.cc b/third_party/blink/renderer/core/paint/text_decoration_info.cc index fbcdfbb..91229352 100644 --- a/third_party/blink/renderer/core/paint/text_decoration_info.cc +++ b/third_party/blink/renderer/core/paint/text_decoration_info.cc
@@ -7,7 +7,7 @@ #include <math.h> #include "build/build_config.h" -#include "third_party/blink/renderer/core/layout/ng/ng_text_decoration_offset.h" +#include "third_party/blink/renderer/core/layout/text_decoration_offset.h" #include "third_party/blink/renderer/core/paint/ng/ng_inline_paint_context.h" #include "third_party/blink/renderer/core/paint/text_paint_style.h" #include "third_party/blink/renderer/core/style/computed_style.h" @@ -267,7 +267,7 @@ LineRelativeOffset local_origin, LayoutUnit width, const ComputedStyle& target_style, - const NGInlinePaintContext* inline_context, + const InlinePaintContext* inline_context, const absl::optional<AppliedTextDecoration> selection_text_decoration, const AppliedTextDecoration* decoration_override, const Font* font_override,
diff --git a/third_party/blink/renderer/core/paint/text_decoration_info.h b/third_party/blink/renderer/core/paint/text_decoration_info.h index 2763561f..0f790e4c 100644 --- a/third_party/blink/renderer/core/paint/text_decoration_info.h +++ b/third_party/blink/renderer/core/paint/text_decoration_info.h
@@ -24,9 +24,9 @@ namespace blink { class ComputedStyle; +class DecoratingBox; class Font; -class NGDecoratingBox; -class NGInlinePaintContext; +class InlinePaintContext; class SimpleFontData; class TextDecorationOffset; @@ -50,7 +50,7 @@ LineRelativeOffset local_origin, LayoutUnit width, const ComputedStyle& target_style, - const NGInlinePaintContext* inline_context, + const InlinePaintContext* inline_context, const absl::optional<AppliedTextDecoration> selection_text_decoration, const AppliedTextDecoration* decoration_override = nullptr, const Font* font_override = nullptr, @@ -179,8 +179,8 @@ const ComputedStyle* decorating_box_style_ = nullptr; // Decorating box properties for the current |decoration_index_|. - const NGInlinePaintContext* const inline_context_ = nullptr; - const NGDecoratingBox* decorating_box_ = nullptr; + const InlinePaintContext* const inline_context_ = nullptr; + const DecoratingBox* decorating_box_ = nullptr; const AppliedTextDecoration* applied_text_decoration_ = nullptr; const absl::optional<AppliedTextDecoration> selection_text_decoration_; const Font* font_ = nullptr;
diff --git a/third_party/blink/renderer/core/paint/text_painter_base.cc b/third_party/blink/renderer/core/paint/text_painter_base.cc index 581d0406..2c9794b 100644 --- a/third_party/blink/renderer/core/paint/text_painter_base.cc +++ b/third_party/blink/renderer/core/paint/text_painter_base.cc
@@ -25,7 +25,7 @@ TextPainterBase::TextPainterBase(GraphicsContext& context, const Font& font, const LineRelativeOffset& text_origin, - NGInlinePaintContext* inline_context, + InlinePaintContext* inline_context, bool horizontal) : inline_context_(inline_context), graphics_context_(context),
diff --git a/third_party/blink/renderer/core/paint/text_painter_base.h b/third_party/blink/renderer/core/paint/text_painter_base.h index ac63f24..4694719 100644 --- a/third_party/blink/renderer/core/paint/text_painter_base.h +++ b/third_party/blink/renderer/core/paint/text_painter_base.h
@@ -28,7 +28,7 @@ class ComputedStyle; class Document; class GraphicsContext; -class NGInlinePaintContext; +class InlinePaintContext; class Node; namespace { @@ -51,11 +51,11 @@ TextPainterBase(GraphicsContext&, const Font&, const LineRelativeOffset& text_origin, - NGInlinePaintContext* inline_context, + InlinePaintContext* inline_context, bool horizontal); ~TextPainterBase(); - const NGInlinePaintContext* InlineContext() const { return inline_context_; } + const InlinePaintContext* InlineContext() const { return inline_context_; } void SetEmphasisMark(const AtomicString&, TextEmphasisPosition); @@ -124,7 +124,7 @@ enum PaintInternalStep { kPaintText, kPaintEmphasisMark }; - NGInlinePaintContext* inline_context_ = nullptr; + InlinePaintContext* inline_context_ = nullptr; GraphicsContext& graphics_context_; const Font& font_; const LineRelativeOffset text_origin_;
diff --git a/third_party/blink/renderer/core/paint/transform_utils.cc b/third_party/blink/renderer/core/paint/transform_utils.cc index 6e7654a..8a37d2b0 100644 --- a/third_party/blink/renderer/core/paint/transform_utils.cc +++ b/third_party/blink/renderer/core/paint/transform_utils.cc
@@ -5,7 +5,7 @@ #include "third_party/blink/renderer/core/paint/transform_utils.h" #include "third_party/blink/renderer/core/layout/layout_box.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/style/computed_style.h" namespace blink {
diff --git a/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc b/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc index 49930be..8e77dba 100644 --- a/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc +++ b/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc
@@ -2018,7 +2018,7 @@ // This emulates javascript. div->setAttribute(html_names::kStyleAttr, g_empty_atom); - div->getBoundingClientRect(); + div->GetBoundingClientRect(); // This emulates WebFrameWidgetImpl::UpdateRenderThrottlingStatusForSubFrame. view->UpdateRenderThrottlingStatus(true, false, false, true); // UpdateRenderThrottlingStatus should have cleared out previous paint
diff --git a/third_party/blink/renderer/core/script/script_runner.cc b/third_party/blink/renderer/core/script/script_runner.cc index a16b8cd3..14bfa62 100644 --- a/third_party/blink/renderer/core/script/script_runner.cc +++ b/third_party/blink/renderer/core/script/script_runner.cc
@@ -28,6 +28,8 @@ #include <algorithm> #include "base/feature_list.h" +#include "base/metrics/histogram_functions.h" +#include "base/strings/strcat.h" #include "base/task/single_thread_task_runner.h" #include "base/trace_event/typed_macros.h" #include "third_party/blink/public/common/features.h" @@ -47,6 +49,23 @@ namespace { +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +enum class RaceTaskPriority { + kLowerPriority = 0, + kNormalPriority = 1, + kMaxValue = kNormalPriority, +}; + +const char* RaceTaskPriorityToString(RaceTaskPriority task_priority) { + switch (task_priority) { + case RaceTaskPriority::kLowerPriority: + return "LowerPriority"; + case RaceTaskPriority::kNormalPriority: + return "NormalPriority"; + } +} + void PostTaskWithLowPriorityUntilTimeout( const base::Location& from_here, base::OnceClosure task, @@ -62,17 +81,37 @@ // |task| doesn't run more than once. |task| runs on either of // |lower_priority_task_runner| and |normal_priority_task_runner| whichever // comes first. - auto run_task_once = - [](scoped_refptr<RefCountedOnceClosure> ref_counted_task) { - if (!ref_counted_task->data.is_null()) - std::move(ref_counted_task->data).Run(); - }; + auto run_task_once = [](scoped_refptr<RefCountedOnceClosure> ref_counted_task, + RaceTaskPriority task_priority, + base::TimeTicks post_task_time) { + if (!ref_counted_task->data.is_null()) { + auto duration = base::TimeTicks::Now() - post_task_time; + std::move(ref_counted_task->data).Run(); + base::UmaHistogramEnumeration( + "Blink.Script.PostTaskWithLowPriorityUntilTimeout.RaceTaskPriority", + task_priority); + base::UmaHistogramMediumTimes( + "Blink.Script.PostTaskWithLowPriorityUntilTimeout.Time", duration); + base::UmaHistogramMediumTimes( + base::StrCat( + {"Blink.Script.PostTaskWithLowPriorityUntilTimeout.Time.", + RaceTaskPriorityToString(task_priority)}), + duration); + } + }; + + base::TimeTicks post_task_time = base::TimeTicks::Now(); lower_priority_task_runner->PostTask( - from_here, WTF::BindOnce(run_task_once, ref_counted_task)); + from_here, + WTF::BindOnce(run_task_once, ref_counted_task, + RaceTaskPriority::kLowerPriority, post_task_time)); normal_priority_task_runner->PostDelayedTask( - from_here, WTF::BindOnce(run_task_once, ref_counted_task), timeout); + from_here, + WTF::BindOnce(run_task_once, ref_counted_task, + RaceTaskPriority::kNormalPriority, post_task_time), + timeout); } } // namespace
diff --git a/third_party/blink/renderer/core/scroll/scroll_test.cc b/third_party/blink/renderer/core/scroll/scroll_test.cc index ae699ec5..2bca51df 100644 --- a/third_party/blink/renderer/core/scroll/scroll_test.cc +++ b/third_party/blink/renderer/core/scroll/scroll_test.cc
@@ -81,7 +81,7 @@ Compositor().BeginFrame(); Element* target = GetDocument().getElementById(AtomicString("target")); - DOMRect* rect = target->getBoundingClientRect(); + DOMRect* rect = target->GetBoundingClientRect(); const float kOneLayoutUnit = 1.f / kFixedPointDenominator; EXPECT_NEAR(LayoutUnit(800.f - 700.5f), rect->left(), kOneLayoutUnit); EXPECT_NEAR(LayoutUnit(600.f - 500.6f), rect->top(), kOneLayoutUnit); @@ -181,7 +181,7 @@ ScrollOffset(0.f, kOneLayoutUnitF / 4.f), mojom::blink::ScrollType::kProgrammatic); Compositor().BeginFrame(); - EXPECT_EQ(8, sticky->getBoundingClientRect()->top()); + EXPECT_EQ(8, sticky->GetBoundingClientRect()->top()); } // This offset is specifically chosen since it doesn't land on a LayoutUnit @@ -190,7 +190,7 @@ ScrollOffset(0.f, 98.8675308f), mojom::blink::ScrollType::kProgrammatic, mojom::blink::ScrollBehavior::kInstant); Compositor().BeginFrame(); - EXPECT_EQ(0, sticky->getBoundingClientRect()->top()); + EXPECT_EQ(0, sticky->GetBoundingClientRect()->top()); // Incrementally scroll from here, making sure the sticky position remains // fixed. @@ -199,7 +199,7 @@ ScrollOffset(0.f, kOneLayoutUnitF / 3.f), mojom::blink::ScrollType::kProgrammatic); Compositor().BeginFrame(); - EXPECT_EQ(0, sticky->getBoundingClientRect()->top()); + EXPECT_EQ(0, sticky->GetBoundingClientRect()->top()); } }
diff --git a/third_party/blink/renderer/core/scroll/scrollable_area.cc b/third_party/blink/renderer/core/scroll/scrollable_area.cc index 6c3c38a7..9dace1f7 100644 --- a/third_party/blink/renderer/core/scroll/scrollable_area.cc +++ b/third_party/blink/renderer/core/scroll/scrollable_area.cc
@@ -50,7 +50,7 @@ #include "third_party/blink/renderer/core/layout/layout_object.h" #include "third_party/blink/renderer/core/layout/layout_shift_tracker.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/page/chrome_client.h" #include "third_party/blink/renderer/core/page/page.h" #include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
diff --git a/third_party/blink/renderer/core/style/computed_style.h b/third_party/blink/renderer/core/style/computed_style.h index 48e9d10..76b182ad 100644 --- a/third_party/blink/renderer/core/style/computed_style.h +++ b/third_party/blink/renderer/core/style/computed_style.h
@@ -46,7 +46,7 @@ #include "third_party/blink/renderer/core/layout/geometry/box_strut.h" #include "third_party/blink/renderer/core/layout/geometry/logical_size.h" #include "third_party/blink/renderer/core/layout/geometry/physical_rect.h" -#include "third_party/blink/renderer/core/layout/ng/ng_outline_type.h" +#include "third_party/blink/renderer/core/layout/outline_type.h" #include "third_party/blink/renderer/core/scroll/scroll_types.h" #include "third_party/blink/renderer/core/style/computed_style_base.h" #include "third_party/blink/renderer/core/style/computed_style_constants.h"
diff --git a/third_party/blink/renderer/core/testing/core_unit_test_helper.cc b/third_party/blink/renderer/core/testing/core_unit_test_helper.cc index 21567e998..f288e7b 100644 --- a/third_party/blink/renderer/core/testing/core_unit_test_helper.cc +++ b/third_party/blink/renderer/core/testing/core_unit_test_helper.cc
@@ -11,7 +11,7 @@ #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/html/html_iframe_element.h" #include "third_party/blink/renderer/core/input/event_handler.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/page/page.h" #include "third_party/blink/renderer/core/scroll/scrollbar_theme.h" #include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h"
diff --git a/third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc b/third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc index 5fb72b2..ac219a286 100644 --- a/third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc +++ b/third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc
@@ -122,8 +122,7 @@ // Reset previously seen indicators and task IDs. potential_soft_navigation_task_ids_.clear(); interaction_task_id_to_interaction_data_.clear(); - soft_navigation_interaction_data_ = nullptr; - last_interaction_task_id_ = scheduler::TaskAttributionId(); + last_interaction_task_id_ = 0; last_soft_navigation_ancestor_task_ = absl::nullopt; disposed_soft_navigation_tasks_ = 0; soft_navigation_descendant_cache_.clear(); @@ -155,18 +154,15 @@ return; } - if (!last_interaction_task_id_.value()) { - // Here we have an interaction event that was supposed to be preceded by a - // "new interaction" event, only that such an event didn't have a callback. - // In that case, we still want to assign the timestamp from that previous - // event. We also define the current task as the last interaction task. - PerInteractionData* data = MakeGarbageCollected<PerInteractionData>(); - data->user_interaction_timestamp = pending_interaction_timestamp_; + if (is_new_interaction || !last_interaction_task_id_) { + CHECK(!pending_interaction_timestamp_.is_null()); + PerInteractionData data; + data.user_interaction_timestamp = pending_interaction_timestamp_; interaction_task_id_to_interaction_data_.insert(task->Id().value(), data); - last_interaction_task_id_ = task->Id(); + last_interaction_task_id_ = task->Id().value(); } else { task_id_to_interaction_task_id_.insert(task->Id().value(), - last_interaction_task_id_.value()); + last_interaction_task_id_); } tracker->RegisterObserverIfNeeded(this); @@ -267,7 +263,7 @@ } void SoftNavigationHeuristics::CheckSoftNavigationConditions( - const SoftNavigationHeuristics::PerInteractionData& data) { + SoftNavigationHeuristics::PerInteractionData& data) { if (data.flag_set != FlagTypeSet::All()) { return; } @@ -280,7 +276,7 @@ // Here we consider that we've detected a soft navigation. soft_navigation_conditions_met_ = true; - soft_navigation_interaction_data_ = &data; + soft_navigation_interaction_data_ = data; } void SoftNavigationHeuristics::EmitSoftNavigationEntry(LocalFrame* frame) { @@ -289,34 +285,33 @@ ++soft_navigation_count_; window->GenerateNewNavigationId(); auto* performance = DOMWindowPerformance::performance(*window); - CHECK(soft_navigation_interaction_data_); - CHECK(!soft_navigation_interaction_data_->url.IsNull()); - CHECK( - !soft_navigation_interaction_data_->user_interaction_timestamp.is_null()); + DCHECK(!soft_navigation_interaction_data_.url.IsNull()); performance->AddSoftNavigationEntry( - AtomicString(soft_navigation_interaction_data_->url), - soft_navigation_interaction_data_->user_interaction_timestamp); + AtomicString(soft_navigation_interaction_data_.url), + soft_navigation_interaction_data_.user_interaction_timestamp); CommitPreviousPaints(frame); + ResetHeuristic(); LogAndTraceDetectedSoftNavigation( - frame, window, soft_navigation_interaction_data_->url, - soft_navigation_interaction_data_->user_interaction_timestamp); + frame, window, soft_navigation_interaction_data_.url, + soft_navigation_interaction_data_.user_interaction_timestamp); ReportSoftNavigationToMetrics(frame); - ResetHeuristic(); } SoftNavigationHeuristics::PerInteractionData* SoftNavigationHeuristics::GetCurrentInteractionData( scheduler::TaskAttributionId task_id) { // Get interaction ID from task ID + scheduler::TaskAttributionIdType interaction_task_id = task_id.value(); auto interaction_it = task_id_to_interaction_task_id_.find(task_id.value()); if (interaction_it != task_id_to_interaction_task_id_.end()) { - task_id = scheduler::TaskAttributionId(interaction_it->value); + interaction_task_id = interaction_it->value; } // Get interaction data from interaction id - auto data_it = interaction_task_id_to_interaction_data_.find(task_id.value()); + auto data_it = + interaction_task_id_to_interaction_data_.find(interaction_task_id); if (data_it == interaction_task_id_to_interaction_data_.end()) { // This can happen when events are triggered out of the expected order. e.g. // when we get a keyup event without a keydown event that preceded it. That @@ -324,7 +319,7 @@ return nullptr; } - return data_it->value.Get(); + return &data_it->value; } // This is called from Text/ImagePaintTimingDetector when a paint is recorded @@ -361,6 +356,11 @@ current_event_parameters_ = &top_event_parameters_; nested_event_parameters_.clear(); } + + pending_interaction_timestamp_ = + (is_new_interaction || !last_interaction_task_id_) + ? base::TimeTicks::Now() + : base::TimeTicks(); } bool SoftNavigationHeuristics::PopNestedEventParametersIfNeeded() { @@ -376,23 +376,6 @@ return true; } -void SoftNavigationHeuristics::SetCurrentTimeAsStartTime() { - CHECK(current_event_parameters_); - if (!last_interaction_task_id_.value() || - !current_event_parameters_->is_new_interaction) { - pending_interaction_timestamp_ = base::TimeTicks::Now(); - return; - } - PerInteractionData* data = - GetCurrentInteractionData(last_interaction_task_id_); - CHECK(data); - if (data->user_interaction_timestamp.is_null()) { - // Don't set the timestamp if it was already set (e.g. in the case of a - // nested event scope). - data->user_interaction_timestamp = base::TimeTicks::Now(); - } -} - void SoftNavigationHeuristics::ReportSoftNavigationToMetrics( LocalFrame* frame) const { auto* loader = frame->Loader().GetDocumentLoader(); @@ -401,16 +384,14 @@ return; } - CHECK( - !soft_navigation_interaction_data_->user_interaction_timestamp.is_null()); auto soft_navigation_start_time = loader->GetTiming().MonotonicTimeToPseudoWallTime( - soft_navigation_interaction_data_->user_interaction_timestamp); + soft_navigation_interaction_data_.user_interaction_timestamp); if (soft_navigation_start_time.is_zero()) { internal:: RecordUmaForPageLoadInternalSoftNavigationFromReferenceInvalidTiming( - soft_navigation_interaction_data_->user_interaction_timestamp, + soft_navigation_interaction_data_.user_interaction_timestamp, loader->GetTiming().ReferenceMonotonicTime()); } @@ -483,8 +464,6 @@ void SoftNavigationHeuristics::Trace(Visitor* visitor) const { Supplement<LocalDOMWindow>::Trace(visitor); - visitor->Trace(soft_navigation_interaction_data_); - visitor->Trace(interaction_task_id_to_interaction_data_); } void SoftNavigationHeuristics::OnCreateTaskScope( @@ -503,11 +482,11 @@ TRACE_EVENT1("scheduler", "SoftNavigationHeuristics::OnCreateTaskScope", "task_id", task.Id().value()); potential_soft_navigation_task_ids_.insert(task.Id().value()); - CHECK(current_event_parameters_); - if (current_event_parameters_->is_new_interaction) { - PerInteractionData* data = MakeGarbageCollected<PerInteractionData>(); + if (!pending_interaction_timestamp_.is_null()) { + PerInteractionData data; + data.user_interaction_timestamp = pending_interaction_timestamp_; interaction_task_id_to_interaction_data_.insert(task.Id().value(), data); - last_interaction_task_id_ = task.Id(); + last_interaction_task_id_ = task.Id().value(); } soft_navigation_descendant_cache_.clear(); @@ -569,10 +548,6 @@ SoftNavigationEventScope::~SoftNavigationEventScope() { bool nested = heuristics_->PopNestedEventParametersIfNeeded(); - // Set the start time to the end of event processing. In case of nested event - // scopes, we want this to be the end of the nested `navigate()` event - // handler. - heuristics_->SetCurrentTimeAsStartTime(); // Only the top level EventScope should unregister the observer. if (!nested) {
diff --git a/third_party/blink/renderer/core/timing/soft_navigation_heuristics.h b/third_party/blink/renderer/core/timing/soft_navigation_heuristics.h index 2b9ad46..5087c66 100644 --- a/third_party/blink/renderer/core/timing/soft_navigation_heuristics.h +++ b/third_party/blink/renderer/core/timing/soft_navigation_heuristics.h
@@ -86,7 +86,6 @@ // If there are nested EventParameters, pop one, restore it to the // current_event_parameters_ and return true. Otherwise, return false. bool PopNestedEventParametersIfNeeded(); - void SetCurrentTimeAsStartTime(); private: enum FlagType : uint8_t { @@ -94,7 +93,7 @@ kMainModification, }; using FlagTypeSet = base::EnumSet<FlagType, kURLChange, kMainModification>; - struct PerInteractionData : public GarbageCollected<PerInteractionData> { + struct PerInteractionData { // The timestamp just before the event responding to the user's interaction // started processing. In case of multiple events for a single interaction // (e.g. a keyboard key press resulting in keydown, keypress, and keyup), @@ -103,11 +102,10 @@ base::TimeTicks user_interaction_timestamp; FlagTypeSet flag_set; String url; - void Trace(Visitor*) const {} }; void ReportSoftNavigationToMetrics(LocalFrame* frame) const; - void CheckSoftNavigationConditions(const PerInteractionData& data); + void CheckSoftNavigationConditions(PerInteractionData& data); void SetIsTrackingSoftNavigationHeuristicsOnDocument(bool value) const; absl::optional<scheduler::TaskAttributionId> @@ -130,12 +128,12 @@ soft_navigation_descendant_cache_; bool did_reset_paints_ = false; bool did_commit_previous_paints_ = false; - HeapHashMap<scheduler::TaskAttributionIdType, Member<PerInteractionData>> + WTF::HashMap<scheduler::TaskAttributionIdType, PerInteractionData> interaction_task_id_to_interaction_data_; base::TimeTicks pending_interaction_timestamp_; absl::optional<scheduler::TaskAttributionId> last_soft_navigation_ancestor_task_; - Member<const PerInteractionData> soft_navigation_interaction_data_; + PerInteractionData soft_navigation_interaction_data_; WTF::HashMap<scheduler::TaskAttributionIdType, scheduler::TaskAttributionIdType> task_id_to_interaction_task_id_; @@ -143,7 +141,7 @@ uint64_t softnav_painted_area_ = 0; uint64_t initial_painted_area_ = 0; uint64_t viewport_area_ = 0; - scheduler::TaskAttributionId last_interaction_task_id_; + scheduler::TaskAttributionIdType last_interaction_task_id_ = 0; bool soft_navigation_conditions_met_ = false; bool initial_interaction_encountered_ = false; struct EventParameters {
diff --git a/third_party/blink/renderer/core/view_transition/view_transition_test.cc b/third_party/blink/renderer/core/view_transition/view_transition_test.cc index f85e87d..ebe48c0 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition_test.cc +++ b/third_party/blink/renderer/core/view_transition/view_transition_test.cc
@@ -28,7 +28,7 @@ #include "third_party/blink/renderer/core/inspector/inspector_style_resolver.h" #include "third_party/blink/renderer/core/layout/layout_shift_tracker.h" #include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" #include "third_party/blink/renderer/core/style/computed_style_constants.h" #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
diff --git a/third_party/blink/renderer/modules/credentialmanagement/credentials_container.cc b/third_party/blink/renderer/modules/credentialmanagement/credentials_container.cc index 41c3e388..aab527af 100644 --- a/third_party/blink/renderer/modules/credentialmanagement/credentials_container.cc +++ b/third_party/blink/renderer/modules/credentialmanagement/credentials_container.cc
@@ -515,15 +515,6 @@ "successful, but no listed origin matched the caller. Note that a " "match may have been found but the limit on the number of eTLD+1 " "labels was reached, causing some entries to be ignored."); - case AuthenticatorStatus::BAD_RELYING_PARTY_ID_NO_JSON_MATCH_EXTENSION: - return MakeGarbageCollected<DOMException>( - DOMExceptionCode::kSecurityError, - "The relying party ID is not a registrable domain suffix of, nor " - "equal to the current domain. Subsequently, fetching the " - ".well-known/passkey-origins resource of the claimed RP ID was " - "successful, but no listed origin matched the caller. Note that " - "since the caller is an extension, it must be listed in an " - "'extensions' list, not 'origins'."); case AuthenticatorStatus::CANNOT_READ_AND_WRITE_LARGE_BLOB: return MakeGarbageCollected<DOMException>( DOMExceptionCode::kNotSupportedError,
diff --git a/third_party/blink/renderer/modules/exported/web_dom_file_system.cc b/third_party/blink/renderer/modules/exported/web_dom_file_system.cc index 9a5fde2..476686b 100644 --- a/third_party/blink/renderer/modules/exported/web_dom_file_system.cc +++ b/third_party/blink/renderer/modules/exported/web_dom_file_system.cc
@@ -114,13 +114,7 @@ return private_->RootURL(); } -v8::Local<v8::Value> WebDOMFileSystem::ToV8Value( - v8::Local<v8::Object> creation_context, - v8::Isolate* isolate) { - // We no longer use |creationContext| because it's often misused and points - // to a context faked by user script. - DCHECK(creation_context->GetCreationContextChecked() == - isolate->GetCurrentContext()); +v8::Local<v8::Value> WebDOMFileSystem::ToV8Value(v8::Isolate* isolate) { if (!private_.Get()) return v8::Local<v8::Value>(); return ToV8(private_.Get(), isolate->GetCurrentContext()->Global(), isolate); @@ -129,12 +123,7 @@ v8::Local<v8::Value> WebDOMFileSystem::CreateV8Entry( const WebString& path, EntryType entry_type, - v8::Local<v8::Object> creation_context, v8::Isolate* isolate) { - // We no longer use |creationContext| because it's often misused and points - // to a context faked by user script. - DCHECK(creation_context->GetCreationContextChecked() == - isolate->GetCurrentContext()); if (!private_.Get()) return v8::Local<v8::Value>(); if (entry_type == kEntryTypeDirectory) {
diff --git a/third_party/blink/renderer/modules/formatted_text/formatted_text.cc b/third_party/blink/renderer/modules/formatted_text/formatted_text.cc index 979eec1b..d3806c7 100644 --- a/third_party/blink/renderer/modules/formatted_text/formatted_text.cc +++ b/third_party/blink/renderer/modules/formatted_text/formatted_text.cc
@@ -10,12 +10,12 @@ #include "third_party/blink/renderer/core/css/parser/css_parser_context.h" #include "third_party/blink/renderer/core/css/resolver/style_resolver.h" #include "third_party/blink/renderer/core/inspector/inspector_trace_events.h" +#include "third_party/blink/renderer/core/layout/constraint_space_builder.h" #include "third_party/blink/renderer/core/layout/inline/inline_child_layout_context.h" #include "third_party/blink/renderer/core/layout/inline/inline_node.h" #include "third_party/blink/renderer/core/layout/layout_block_flow.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_constraint_space_builder.h" -#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/core/layout/physical_box_fragment.h" #include "third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.h" #include "third_party/blink/renderer/core/paint/paint_info.h" #include "third_party/blink/renderer/core/style/computed_style.h"
diff --git a/third_party/blink/renderer/modules/media_controls/elements/media_control_cast_button_element.cc b/third_party/blink/renderer/modules/media_controls/elements/media_control_cast_button_element.cc index eae86f3..dc793b43 100644 --- a/third_party/blink/renderer/modules/media_controls/elements/media_control_cast_button_element.cc +++ b/third_party/blink/renderer/modules/media_controls/elements/media_control_cast_button_element.cc
@@ -24,7 +24,7 @@ namespace { Element* ElementFromCenter(Element& element) { - DOMRect* client_rect = element.getBoundingClientRect(); + DOMRect* client_rect = element.GetBoundingClientRect(); int center_x = static_cast<int>((client_rect->left() + client_rect->right()) / 2); int center_y =
diff --git a/third_party/blink/renderer/modules/media_controls/elements/media_control_popup_menu_element.cc b/third_party/blink/renderer/modules/media_controls/elements/media_control_popup_menu_element.cc index 3e776964..c2ac510 100644 --- a/third_party/blink/renderer/modules/media_controls/elements/media_control_popup_menu_element.cc +++ b/third_party/blink/renderer/modules/media_controls/elements/media_control_popup_menu_element.cc
@@ -228,7 +228,7 @@ static const char kImportant[] = "important"; static const char kPx[] = "px"; - DOMRect* bounding_client_rect = PopupAnchor()->getBoundingClientRect(); + DOMRect* bounding_client_rect = PopupAnchor()->GetBoundingClientRect(); LocalDOMWindow* dom_window = GetDocument().domWindow(); DCHECK(bounding_client_rect);
diff --git a/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc b/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc index b82af5c..69d4448 100644 --- a/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc +++ b/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc
@@ -1670,7 +1670,7 @@ float tap_x = gesture_event->NativeEvent().PositionInWidget().x(); - DOMRect* rect = getBoundingClientRect(); + DOMRect* rect = GetBoundingClientRect(); double middle = rect->x() + (rect->width() / 2); if (GetDocument().GetFrame()) middle *= GetDocument().GetFrame()->PageZoomFactor();
diff --git a/third_party/blink/renderer/modules/media_controls/media_controls_impl_test.cc b/third_party/blink/renderer/modules/media_controls/media_controls_impl_test.cc index 89e1186..ed5c644 100644 --- a/third_party/blink/renderer/modules/media_controls/media_controls_impl_test.cc +++ b/third_party/blink/renderer/modules/media_controls/media_controls_impl_test.cc
@@ -191,7 +191,7 @@ // Fire the size-change callback to ensure that the controls have // been properly notified of the video size. media_controls_->NotifyElementSizeChanged( - media_controls_->MediaElement().getBoundingClientRect()); + media_controls_->MediaElement().GetBoundingClientRect()); } void SimulateHideMediaControlsTimerFired() { @@ -1205,7 +1205,7 @@ EXPECT_TRUE(IsElementVisible(*mute_btn)); EXPECT_TRUE(volume_slider->classList().contains(AtomicString("closed"))); - DOMRect* mute_btn_rect = mute_btn->getBoundingClientRect(); + DOMRect* mute_btn_rect = mute_btn->GetBoundingClientRect(); gfx::PointF mute_btn_center( mute_btn_rect->left() + mute_btn_rect->width() / 2, mute_btn_rect->top() + mute_btn_rect->height() / 2); @@ -1420,7 +1420,7 @@ // We've set the video to the halfway mark. EXPECT_EQ(30, MediaControls().MediaElement().currentTime()); - DOMRect* videoRect = MediaControls().MediaElement().getBoundingClientRect(); + DOMRect* videoRect = MediaControls().MediaElement().GetBoundingClientRect(); ASSERT_LT(0, videoRect->width()); gfx::PointF leftOfCenter(videoRect->left() + (videoRect->width() / 2) - 5, videoRect->top() + 5); @@ -1450,7 +1450,7 @@ // We've set the video to the halfway mark. EXPECT_EQ(30, MediaControls().MediaElement().currentTime()); - DOMRect* videoRect = MediaControls().MediaElement().getBoundingClientRect(); + DOMRect* videoRect = MediaControls().MediaElement().GetBoundingClientRect(); ASSERT_LT(0, videoRect->width()); gfx::PointF leftOfCenter(videoRect->left() + (videoRect->width() / 2) - 5, videoRect->top() + 10);
diff --git a/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms_compositor.cc b/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms_compositor.cc index 745f009..6b90375 100644 --- a/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms_compositor.cc +++ b/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms_compositor.cc
@@ -897,9 +897,6 @@ frame_metadata->rendering_interval = last_render_length_; } - if (base::FeatureList::IsEnabled(media::kKeepRvfcFrameAlive)) - frame_metadata->frame = last_frame; - frame_metadata->width = last_frame->visible_rect().width(); frame_metadata->height = last_frame->visible_rect().height();
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_test_mojo.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_test_mojo.cc index 977f547..2e7d43f 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_test_mojo.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_test_mojo.cc
@@ -517,6 +517,528 @@ absl::optional<float> leaky_relu_alpha; }; +MLActivation* CreateActivation(V8TestingScope& scope, + MLGraphBuilder* builder, + const Activation& activation) { + switch (activation.kind) { + case MLOperator::OperatorKind::kClamp: { + auto* clamp_options = MLClampOptions::Create(); + CHECK(clamp_options); + clamp_options->setMinValue(activation.clamp_options->min_value.value()); + clamp_options->setMaxValue(activation.clamp_options->max_value.value()); + return builder->clamp(clamp_options, scope.GetExceptionState()); + } + case MLOperator::OperatorKind::kElu: { + auto* elu_options = MLEluOptions::Create(); + CHECK(elu_options); + if (activation.elu_alpha.has_value()) { + elu_options->setAlpha(activation.elu_alpha.value()); + } + return builder->elu(elu_options, scope.GetExceptionState()); + } + case MLOperator::OperatorKind::kLeakyRelu: { + auto* leaky_relu_options = MLLeakyReluOptions::Create(); + CHECK(leaky_relu_options); + if (activation.leaky_relu_alpha.has_value()) { + leaky_relu_options->setAlpha(activation.leaky_relu_alpha.value()); + } + return builder->leakyRelu(leaky_relu_options, scope.GetExceptionState()); + } + case MLOperator::OperatorKind::kRelu: + return builder->relu(scope.GetExceptionState()); + case MLOperator::OperatorKind::kSigmoid: + return builder->sigmoid(scope.GetExceptionState()); + case MLOperator::OperatorKind::kSoftmax: + return builder->softmax(scope.GetExceptionState()); + case MLOperator::OperatorKind::kTanh: + return builder->tanh(scope.GetExceptionState()); + default: + NOTREACHED_NORETURN(); + } +} + +void CheckActivation(const webnn::mojom::blink::ActivationPtr& mojom_activation, + const Activation& expected_activation) { + switch (expected_activation.kind) { + case MLOperator::OperatorKind::kClamp: { + ASSERT_TRUE(mojom_activation->is_clamp()); + auto& clamp = mojom_activation->get_clamp(); + CHECK(clamp); + auto& clamp_options = expected_activation.clamp_options; + CHECK(clamp_options); + EXPECT_EQ(clamp->min_value, clamp_options->min_value); + EXPECT_EQ(clamp->max_value, clamp_options->max_value); + break; + } + case MLOperator::OperatorKind::kElu: { + ASSERT_TRUE(mojom_activation->is_elu()); + auto& elu = mojom_activation->get_elu(); + CHECK(elu); + CHECK(expected_activation.elu_alpha.has_value()); + EXPECT_EQ(elu->alpha, expected_activation.elu_alpha.value()); + break; + } + case MLOperator::OperatorKind::kLeakyRelu: { + ASSERT_TRUE(mojom_activation->is_leaky_relu()); + auto& leaky_relu = mojom_activation->get_leaky_relu(); + CHECK(leaky_relu); + CHECK(expected_activation.leaky_relu_alpha.has_value()); + EXPECT_EQ(leaky_relu->alpha, + expected_activation.leaky_relu_alpha.value()); + break; + } + case MLOperator::OperatorKind::kRelu: + EXPECT_TRUE(mojom_activation->is_relu()); + break; + case MLOperator::OperatorKind::kSigmoid: + EXPECT_TRUE(mojom_activation->is_sigmoid()); + break; + case MLOperator::OperatorKind::kSoftmax: + EXPECT_TRUE(mojom_activation->is_softmax()); + break; + case MLOperator::OperatorKind::kTanh: + EXPECT_TRUE(mojom_activation->is_tanh()); + break; + default: + NOTREACHED_NORETURN(); + } +} + +struct BatchNormalizationTester { + OperandInfoBlink input; + OperandInfoBlink mean; + OperandInfoBlink variance; + struct BatchNormalizationOptions { + absl::optional<OperandInfoBlink> scale; + absl::optional<OperandInfoBlink> bias; + absl::optional<uint32_t> axis; + absl::optional<float> epsilon; + absl::optional<Activation> activation; + }; + struct BatchNormalizationAttributes { + absl::optional<OperandInfoMojo> scale; + absl::optional<OperandInfoMojo> bias; + uint32_t axis = 1; + float epsilon = 1e-5; + absl::optional<Activation> activation; + }; + BatchNormalizationOptions options; + OperandInfoMojo expected_operand; + BatchNormalizationAttributes expected_attributes; + + void Test(MLGraphTestMojo& helper, + V8TestingScope& scope, + MLGraphBuilder* builder) { + // Build the graph. + auto* input_operand = + BuildInput(builder, "input", input.dimensions, input.data_type, + scope.GetExceptionState()); + auto* mean_operand = BuildInput(builder, "mean", mean.dimensions, + mean.data_type, scope.GetExceptionState()); + auto* variance_operand = + BuildInput(builder, "variance", variance.dimensions, variance.data_type, + scope.GetExceptionState()); + MLBatchNormalizationOptions* batch_normalization_options = + MLBatchNormalizationOptions::Create(); + if (options.scale) { + batch_normalization_options->setScale( + BuildInput(builder, "scale", options.scale->dimensions, + options.scale->data_type, scope.GetExceptionState())); + } + if (options.bias) { + batch_normalization_options->setBias( + BuildInput(builder, "bias", options.bias->dimensions, + options.bias->data_type, scope.GetExceptionState())); + } + if (options.axis) { + batch_normalization_options->setAxis(options.axis.value()); + } + if (options.epsilon) { + batch_normalization_options->setEpsilon(options.epsilon.value()); + } + if (options.activation) { + auto* activation = + CreateActivation(scope, builder, options.activation.value()); + CHECK(activation); + batch_normalization_options->setActivation(activation); + } + + auto* output_operand = builder->batchNormalization( + input_operand, mean_operand, variance_operand, + batch_normalization_options, scope.GetExceptionState()); + auto [graph, build_exception] = + helper.BuildGraph(scope, builder, {{"output", output_operand}}); + ASSERT_NE(graph, nullptr); + + auto graph_info = helper.GetGraphInfo(); + // Verify the graph information of mojo are as expected. + ASSERT_EQ(graph_info->operations.size(), 1u); + auto& operation = graph_info->operations[0]; + EXPECT_EQ(operation->is_batch_normalization(), true); + auto& batch_normalization = operation->get_batch_normalization(); + EXPECT_EQ(batch_normalization->axis, expected_attributes.axis); + EXPECT_FLOAT_EQ(batch_normalization->epsilon, expected_attributes.epsilon); + if (options.scale) { + auto scale_operand_iter = graph_info->id_to_operand_map.find( + batch_normalization->scale_operand_id.value()); + ASSERT_TRUE(scale_operand_iter != graph_info->id_to_operand_map.end()); + EXPECT_EQ(scale_operand_iter->value->data_type, + expected_attributes.scale->data_type); + EXPECT_EQ(scale_operand_iter->value->dimensions, + expected_attributes.scale->dimensions); + } + if (options.bias) { + auto bias_operand_iter = graph_info->id_to_operand_map.find( + batch_normalization->bias_operand_id.value()); + ASSERT_TRUE(bias_operand_iter != graph_info->id_to_operand_map.end()); + EXPECT_EQ(bias_operand_iter->value->data_type, + expected_attributes.bias->data_type); + EXPECT_EQ(bias_operand_iter->value->dimensions, + expected_attributes.bias->dimensions); + } + if (options.activation) { + CHECK(expected_attributes.activation); + CheckActivation(batch_normalization->activation, + expected_attributes.activation.value()); + } + EXPECT_EQ(graph_info->output_operands.size(), 1u); + auto output_operand_id = graph_info->output_operands[0]; + auto output_operand_iter = + graph_info->id_to_operand_map.find(output_operand_id); + ASSERT_TRUE(output_operand_iter != graph_info->id_to_operand_map.end()); + EXPECT_EQ(output_operand_iter->value->data_type, + expected_operand.data_type); + EXPECT_EQ(output_operand_iter->value->dimensions, + expected_operand.dimensions); + } +}; + +TEST_P(MLGraphTestMojo, BatchNormalizationTest) { + V8TestingScope scope; + // Bind fake WebNN Context in the service for testing. + ScopedWebNNServiceBinder scoped_setup_binder(*this, scope); + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitAndEnableFeature( + webnn::features::kEnableMachineLearningNeuralNetworkService); + auto* options = MLContextOptions::Create(); + // Create WebNN Context with GPU device type. + options->setDeviceType(V8MLDeviceType::Enum::kGpu); + auto* builder = CreateGraphBuilder(scope, options); + ASSERT_NE(builder, nullptr); + { + // Test batchNormalization with default options. + BatchNormalizationTester{ + .input = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .mean = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .variance = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .expected_operand = {.data_type = + blink_mojom::Operand::DataType::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .expected_attributes = {.scale = absl::nullopt, + .bias = absl::nullopt, + .axis = 1, + .epsilon = 1e-5, + .activation = absl::nullopt}} + .Test(*this, scope, builder); + } + { + // Test batchnormalization with axis = 3. + BatchNormalizationTester{ + .input = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {1, 3, 4, 5}}, + .mean = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {5}}, + .variance = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {5}}, + .options = {.axis = 3}, + .expected_operand = {.data_type = + blink_mojom::Operand::DataType::kFloat32, + .dimensions = {1, 3, 4, 5}}, + .expected_attributes = {.scale = absl::nullopt, + .bias = absl::nullopt, + .axis = 3, + .epsilon = 1e-5, + .activation = absl::nullopt}} + .Test(*this, scope, builder); + } + { + // Test batchnormalization with epsilon = 0.01. + BatchNormalizationTester{ + .input = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {1, 3, 4, 5}}, + .mean = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .variance = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .options = {.epsilon = 0.01}, + .expected_operand = {.data_type = + blink_mojom::Operand::DataType::kFloat32, + .dimensions = {1, 3, 4, 5}}, + .expected_attributes = {.scale = absl::nullopt, + .bias = absl::nullopt, + .axis = 1, + .epsilon = 0.01, + .activation = absl::nullopt}} + .Test(*this, scope, builder); + } + { + // Test batchnormalization with scale and bias. + BatchNormalizationTester{ + .input = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .mean = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .variance = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .options = {.scale = + OperandInfoBlink{ + .data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .bias = + OperandInfoBlink{ + .data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}}, + .expected_operand = {.data_type = + blink_mojom::Operand::DataType::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .expected_attributes = + {.scale = + OperandInfoMojo{ + .data_type = blink_mojom::Operand::DataType::kFloat32, + .dimensions = {3}}, + .bias = + OperandInfoMojo{ + .data_type = blink_mojom::Operand::DataType::kFloat32, + .dimensions = {3}}, + .axis = 1, + .epsilon = 1e-5, + .activation = absl::nullopt}} + .Test(*this, scope, builder); + } + { + // Test batchNormalization with clamp activation. + BatchNormalizationTester{ + .input = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .mean = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .variance = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .options = {.activation = + Activation{ + .kind = MLOperator::OperatorKind::kClamp, + .clamp_options = + ClampTester::ClampOptions{.min_value = 1.0, + .max_value = 6.0}}}, + .expected_operand = {.data_type = + blink_mojom::Operand::DataType::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .expected_attributes = + {.scale = absl::nullopt, + .bias = absl::nullopt, + .axis = 1, + .epsilon = 1e-5, + .activation = + Activation{.kind = MLOperator::OperatorKind::kClamp, + .clamp_options = + ClampTester::ClampOptions{.min_value = 1.0, + .max_value = 6.0}}}} + .Test(*this, scope, builder); + } + { + // Test batchNormalization with elu activation with default options. + BatchNormalizationTester{ + .input = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .mean = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .variance = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .options = {.activation = + Activation{.kind = MLOperator::OperatorKind::kElu}}, + .expected_operand = {.data_type = + blink_mojom::Operand::DataType::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .expected_attributes = {.scale = absl::nullopt, + .bias = absl::nullopt, + .axis = 1, + .epsilon = 1e-5, + .activation = + Activation{ + .kind = MLOperator::OperatorKind::kElu, + .elu_alpha = 1.0}}} + .Test(*this, scope, builder); + } + { + // Test batchNormalization with elu activation with given options. + BatchNormalizationTester{ + .input = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .mean = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .variance = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .options = {.activation = + Activation{.kind = MLOperator::OperatorKind::kElu, + .elu_alpha = 0.5}}, + .expected_operand = {.data_type = + blink_mojom::Operand::DataType::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .expected_attributes = {.scale = absl::nullopt, + .bias = absl::nullopt, + .axis = 1, + .epsilon = 1e-5, + .activation = + Activation{ + .kind = MLOperator::OperatorKind::kElu, + .elu_alpha = 0.5}}} + .Test(*this, scope, builder); + } + { + // Test batchNormalization with leaky relu activation with default options. + BatchNormalizationTester{ + .input = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .mean = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .variance = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .options = {.activation = + Activation{.kind = + MLOperator::OperatorKind::kLeakyRelu}}, + .expected_operand = {.data_type = + blink_mojom::Operand::DataType::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .expected_attributes = + {.scale = absl::nullopt, + .bias = absl::nullopt, + .axis = 1, + .epsilon = 1e-5, + .activation = + Activation{.kind = MLOperator::OperatorKind::kLeakyRelu, + .leaky_relu_alpha = 0.01}}} + .Test(*this, scope, builder); + } + { + // Test batchNormalization with leaky relu activation with given options. + BatchNormalizationTester{ + .input = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .mean = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .variance = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .options = {.activation = + Activation{.kind = MLOperator::OperatorKind::kLeakyRelu, + .leaky_relu_alpha = 0.02}}, + .expected_operand = {.data_type = + blink_mojom::Operand::DataType::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .expected_attributes = + {.scale = absl::nullopt, + .bias = absl::nullopt, + .axis = 1, + .epsilon = 1e-5, + .activation = + Activation{.kind = MLOperator::OperatorKind::kLeakyRelu, + .leaky_relu_alpha = 0.02}}} + .Test(*this, scope, builder); + } + { + // Test batchNormalization with relu activation. + BatchNormalizationTester{ + .input = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .mean = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .variance = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .options = {.activation = + Activation{.kind = MLOperator::OperatorKind::kRelu}}, + .expected_operand = {.data_type = + blink_mojom::Operand::DataType::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .expected_attributes = + {.scale = absl::nullopt, + .bias = absl::nullopt, + .axis = 1, + .epsilon = 1e-5, + .activation = Activation{.kind = MLOperator::OperatorKind::kRelu}}} + .Test(*this, scope, builder); + } + { + // Test batchNormalization with sigmoid activation. + BatchNormalizationTester{ + .input = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .mean = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .variance = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .options = {.activation = + Activation{.kind = MLOperator::OperatorKind::kSigmoid}}, + .expected_operand = {.data_type = + blink_mojom::Operand::DataType::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .expected_attributes = + {.scale = absl::nullopt, + .bias = absl::nullopt, + .axis = 1, + .epsilon = 1e-5, + .activation = + Activation{.kind = MLOperator::OperatorKind::kSigmoid}}} + .Test(*this, scope, builder); + } + { + // Test batchNormalization with softmax activation. + BatchNormalizationTester{ + .input = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .mean = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .variance = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .options = {.activation = + Activation{.kind = MLOperator::OperatorKind::kSoftmax}}, + .expected_operand = {.data_type = + blink_mojom::Operand::DataType::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .expected_attributes = + {.scale = absl::nullopt, + .bias = absl::nullopt, + .axis = 1, + .epsilon = 1e-5, + .activation = + Activation{.kind = MLOperator::OperatorKind::kSoftmax}}} + .Test(*this, scope, builder); + } + { + // Test batchNormalization with tanh activation. + BatchNormalizationTester{ + .input = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .mean = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .variance = {.data_type = V8MLOperandDataType::Enum::kFloat32, + .dimensions = {3}}, + .options = {.activation = + Activation{.kind = MLOperator::OperatorKind::kTanh}}, + .expected_operand = {.data_type = + blink_mojom::Operand::DataType::kFloat32, + .dimensions = {1, 3, 5, 5}}, + .expected_attributes = + {.scale = absl::nullopt, + .bias = absl::nullopt, + .axis = 1, + .epsilon = 1e-5, + .activation = Activation{.kind = MLOperator::OperatorKind::kTanh}}} + .Test(*this, scope, builder); + } +} + struct Conv2dTester { OperandInfoBlink input; OperandInfoBlink filter; @@ -539,8 +1061,7 @@ blink_mojom::InputOperandLayout input_layout = blink_mojom::InputOperandLayout::kChannelsFirst; absl::optional<OperandInfoMojo> bias; - absl::optional<float> elu_alpha; - absl::optional<float> leaky_relu_alpha; + absl::optional<Activation> activation; }; Conv2dOptions options; OperandInfoMojo expected_operand; @@ -584,55 +1105,10 @@ options.bias->data_type, scope.GetExceptionState())); } if (options.activation) { - switch (options.activation->kind) { - case MLOperator::OperatorKind::kClamp: { - auto* clamp_options = MLClampOptions::Create(); - clamp_options->setMinValue( - options.activation->clamp_options->min_value.value()); - clamp_options->setMaxValue( - options.activation->clamp_options->max_value.value()); - ml_conv2d_options->setActivation( - builder->clamp(clamp_options, scope.GetExceptionState())); - break; - } - case MLOperator::OperatorKind::kElu: { - auto* elu_options = MLEluOptions::Create(); - if (options.activation->elu_alpha.has_value()) { - elu_options->setAlpha(options.activation->elu_alpha.value()); - } - ml_conv2d_options->setActivation( - builder->elu(elu_options, scope.GetExceptionState())); - break; - } - case MLOperator::OperatorKind::kLeakyRelu: { - auto* leaky_relu_options = MLLeakyReluOptions::Create(); - if (options.activation->leaky_relu_alpha.has_value()) { - leaky_relu_options->setAlpha( - options.activation->leaky_relu_alpha.value()); - } - ml_conv2d_options->setActivation(builder->leakyRelu( - leaky_relu_options, scope.GetExceptionState())); - break; - } - case MLOperator::OperatorKind::kRelu: - ml_conv2d_options->setActivation( - builder->relu(scope.GetExceptionState())); - break; - case MLOperator::OperatorKind::kSigmoid: - ml_conv2d_options->setActivation( - builder->sigmoid(scope.GetExceptionState())); - break; - case MLOperator::OperatorKind::kSoftmax: - ml_conv2d_options->setActivation( - builder->softmax(scope.GetExceptionState())); - break; - case MLOperator::OperatorKind::kTanh: - ml_conv2d_options->setActivation( - builder->tanh(scope.GetExceptionState())); - break; - default: - NOTREACHED_NORETURN(); - } + auto* activation = + CreateActivation(scope, builder, options.activation.value()); + CHECK(activation); + ml_conv2d_options->setActivation(activation); } auto* output_operand = builder->conv2d(input_operand, filter_operand, ml_conv2d_options, @@ -671,49 +1147,9 @@ expected_attributes.bias->dimensions); } if (options.activation) { - switch (options.activation->kind) { - case MLOperator::OperatorKind::kClamp: { - ASSERT_TRUE(conv2d->activation->is_clamp()); - auto& clamp = conv2d->activation->get_clamp(); - CHECK(clamp); - auto& clamp_options = options.activation->clamp_options; - CHECK(clamp_options); - EXPECT_EQ(clamp->min_value, clamp_options->min_value); - EXPECT_EQ(clamp->max_value, clamp_options->max_value); - break; - } - case MLOperator::OperatorKind::kElu: { - ASSERT_TRUE(conv2d->activation->is_elu()); - auto& elu = conv2d->activation->get_elu(); - CHECK(elu); - CHECK(expected_attributes.elu_alpha.has_value()); - EXPECT_EQ(elu->alpha, expected_attributes.elu_alpha.value()); - break; - } - case MLOperator::OperatorKind::kLeakyRelu: { - ASSERT_TRUE(conv2d->activation->is_leaky_relu()); - auto& leaky_relu = conv2d->activation->get_leaky_relu(); - CHECK(leaky_relu); - CHECK(expected_attributes.leaky_relu_alpha.has_value()); - EXPECT_EQ(leaky_relu->alpha, - expected_attributes.leaky_relu_alpha.value()); - break; - } - case MLOperator::OperatorKind::kRelu: - EXPECT_TRUE(conv2d->activation->is_relu()); - break; - case MLOperator::OperatorKind::kSigmoid: - EXPECT_TRUE(conv2d->activation->is_sigmoid()); - break; - case MLOperator::OperatorKind::kSoftmax: - EXPECT_TRUE(conv2d->activation->is_softmax()); - break; - case MLOperator::OperatorKind::kTanh: - EXPECT_TRUE(conv2d->activation->is_tanh()); - break; - default: - NOTREACHED_NORETURN(); - } + CHECK(expected_attributes.activation); + CheckActivation(conv2d->activation, + expected_attributes.activation.value()); } EXPECT_EQ(graph_info->output_operands.size(), 1u); auto output_operand_id = graph_info->output_operands[0]; @@ -840,10 +1276,16 @@ .expected_operand = {.data_type = blink_mojom::Operand::DataType::kFloat32, .dimensions = {1, 1, 3, 3}}, - .expected_attributes = {.padding = Vector<uint32_t>({0, 0, 0, 0}), - .strides = Vector<uint32_t>({1, 1}), - .dilations = Vector<uint32_t>({1, 1}), - .groups = 1}} + .expected_attributes = + {.padding = Vector<uint32_t>({0, 0, 0, 0}), + .strides = Vector<uint32_t>({1, 1}), + .dilations = Vector<uint32_t>({1, 1}), + .groups = 1, + .activation = + Activation{.kind = MLOperator::OperatorKind::kClamp, + .clamp_options = + ClampTester::ClampOptions{.min_value = 1.0, + .max_value = 6.0}}}} .Test(*this, scope, builder); } { @@ -862,7 +1304,10 @@ .strides = Vector<uint32_t>({1, 1}), .dilations = Vector<uint32_t>({1, 1}), .groups = 1, - .elu_alpha = 1.0}} + .activation = + Activation{ + .kind = MLOperator::OperatorKind::kElu, + .elu_alpha = 1.0}}} .Test(*this, scope, builder); } { @@ -882,7 +1327,10 @@ .strides = Vector<uint32_t>({1, 1}), .dilations = Vector<uint32_t>({1, 1}), .groups = 1, - .elu_alpha = 0.5}} + .activation = + Activation{ + .kind = MLOperator::OperatorKind::kElu, + .elu_alpha = 0.5}}} .Test(*this, scope, builder); } { @@ -898,11 +1346,14 @@ .expected_operand = {.data_type = blink_mojom::Operand::DataType::kFloat32, .dimensions = {1, 1, 3, 3}}, - .expected_attributes = {.padding = Vector<uint32_t>({0, 0, 0, 0}), - .strides = Vector<uint32_t>({1, 1}), - .dilations = Vector<uint32_t>({1, 1}), - .groups = 1, - .leaky_relu_alpha = 0.01}} + .expected_attributes = + {.padding = Vector<uint32_t>({0, 0, 0, 0}), + .strides = Vector<uint32_t>({1, 1}), + .dilations = Vector<uint32_t>({1, 1}), + .groups = 1, + .activation = + Activation{.kind = MLOperator::OperatorKind::kLeakyRelu, + .leaky_relu_alpha = 0.01}}} .Test(*this, scope, builder); } { @@ -918,11 +1369,14 @@ .expected_operand = {.data_type = blink_mojom::Operand::DataType::kFloat32, .dimensions = {1, 1, 3, 3}}, - .expected_attributes = {.padding = Vector<uint32_t>({0, 0, 0, 0}), - .strides = Vector<uint32_t>({1, 1}), - .dilations = Vector<uint32_t>({1, 1}), - .groups = 1, - .leaky_relu_alpha = 0.02}} + .expected_attributes = + {.padding = Vector<uint32_t>({0, 0, 0, 0}), + .strides = Vector<uint32_t>({1, 1}), + .dilations = Vector<uint32_t>({1, 1}), + .groups = 1, + .activation = + Activation{.kind = MLOperator::OperatorKind::kLeakyRelu, + .leaky_relu_alpha = 0.02}}} .Test(*this, scope, builder); } { @@ -937,10 +1391,12 @@ .expected_operand = {.data_type = blink_mojom::Operand::DataType::kFloat32, .dimensions = {1, 1, 3, 3}}, - .expected_attributes = {.padding = Vector<uint32_t>({0, 0, 0, 0}), - .strides = Vector<uint32_t>({1, 1}), - .dilations = Vector<uint32_t>({1, 1}), - .groups = 1}} + .expected_attributes = + {.padding = Vector<uint32_t>({0, 0, 0, 0}), + .strides = Vector<uint32_t>({1, 1}), + .dilations = Vector<uint32_t>({1, 1}), + .groups = 1, + .activation = Activation{.kind = MLOperator::OperatorKind::kRelu}}} .Test(*this, scope, builder); } { @@ -955,10 +1411,13 @@ .expected_operand = {.data_type = blink_mojom::Operand::DataType::kFloat32, .dimensions = {1, 1, 3, 3}}, - .expected_attributes = {.padding = Vector<uint32_t>({0, 0, 0, 0}), - .strides = Vector<uint32_t>({1, 1}), - .dilations = Vector<uint32_t>({1, 1}), - .groups = 1}} + .expected_attributes = + {.padding = Vector<uint32_t>({0, 0, 0, 0}), + .strides = Vector<uint32_t>({1, 1}), + .dilations = Vector<uint32_t>({1, 1}), + .groups = 1, + .activation = + Activation{.kind = MLOperator::OperatorKind::kSigmoid}}} .Test(*this, scope, builder); } { @@ -973,10 +1432,13 @@ .expected_operand = {.data_type = blink_mojom::Operand::DataType::kFloat16, .dimensions = {1, 1, 3, 3}}, - .expected_attributes = {.padding = Vector<uint32_t>({0, 0, 0, 0}), - .strides = Vector<uint32_t>({1, 1}), - .dilations = Vector<uint32_t>({1, 1}), - .groups = 1}} + .expected_attributes = + {.padding = Vector<uint32_t>({0, 0, 0, 0}), + .strides = Vector<uint32_t>({1, 1}), + .dilations = Vector<uint32_t>({1, 1}), + .groups = 1, + .activation = + Activation{.kind = MLOperator::OperatorKind::kSoftmax}}} .Test(*this, scope, builder); } { @@ -991,10 +1453,12 @@ .expected_operand = {.data_type = blink_mojom::Operand::DataType::kFloat32, .dimensions = {1, 1, 3, 3}}, - .expected_attributes = {.padding = Vector<uint32_t>({0, 0, 0, 0}), - .strides = Vector<uint32_t>({1, 1}), - .dilations = Vector<uint32_t>({1, 1}), - .groups = 1}} + .expected_attributes = + {.padding = Vector<uint32_t>({0, 0, 0, 0}), + .strides = Vector<uint32_t>({1, 1}), + .dilations = Vector<uint32_t>({1, 1}), + .groups = 1, + .activation = Activation{.kind = MLOperator::OperatorKind::kTanh}}} .Test(*this, scope, builder); } }
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc index fa9a525..018a8aa8 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
@@ -5,6 +5,7 @@ #include "third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.h" #include "base/ranges/algorithm.h" +#include "third_party/blink/renderer/bindings/modules/v8/v8_ml_batch_normalization_options.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_ml_clamp_options.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_ml_conv_2d_options.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_ml_conv_transpose_2d_options.h" @@ -204,6 +205,74 @@ NOTREACHED_NORETURN(); } +base::expected<ActivationPtr, String> CreateActivation( + const OperandToIdMap& operand_to_id_map, + const MLOperator* ml_operator) { + const auto operator_kind = ml_operator->Kind(); + switch (operator_kind) { + case blink::MLOperator::OperatorKind::kClamp: + return blink_mojom::Activation::NewClamp( + CreateClamp(operand_to_id_map, ml_operator, true)); + case blink::MLOperator::OperatorKind::kElu: + return blink_mojom::Activation::NewElu( + CreateElu(operand_to_id_map, ml_operator, true)); + case blink::MLOperator::OperatorKind::kLeakyRelu: + return blink_mojom::Activation::NewLeakyRelu( + CreateLeakyRelu(operand_to_id_map, ml_operator, true)); + case blink::MLOperator::OperatorKind::kRelu: + return blink_mojom::Activation::NewRelu(blink_mojom::Relu::New()); + case blink::MLOperator::OperatorKind::kSigmoid: + return blink_mojom::Activation::NewSigmoid(blink_mojom::Sigmoid::New()); + case blink::MLOperator::OperatorKind::kSoftmax: + return blink_mojom::Activation::NewSoftmax(blink_mojom::Softmax::New()); + case blink::MLOperator::OperatorKind::kTanh: + return blink_mojom::Activation::NewTanh(blink_mojom::Tanh::New()); + default: + return base::unexpected(MLOperator::OperatorKindToString(operator_kind) + + " is not converted to mojo as activation."); + } +} + +base::expected<OperationPtr, String> CreateBatchNormalizationOperation( + const OperandToIdMap& operand_to_id_map, + const MLOperator* batch_normalization) { + auto batch_normalization_mojo = + webnn::mojom::blink::BatchNormalization::New(); + batch_normalization_mojo->input_operand_id = + GetOperatorInputId(batch_normalization, operand_to_id_map, 0); + batch_normalization_mojo->mean_operand_id = + GetOperatorInputId(batch_normalization, operand_to_id_map, 1); + batch_normalization_mojo->variance_operand_id = + GetOperatorInputId(batch_normalization, operand_to_id_map, 2); + batch_normalization_mojo->output_operand_id = + GetOperatorOutputId(batch_normalization, operand_to_id_map); + + const auto* options = static_cast<const MLBatchNormalizationOptions*>( + batch_normalization->Options()); + CHECK(options); + if (options->hasScale()) { + batch_normalization_mojo->scale_operand_id = + operand_to_id_map.at(options->scale()); + } + if (options->hasBias()) { + batch_normalization_mojo->bias_operand_id = + operand_to_id_map.at(options->bias()); + } + batch_normalization_mojo->axis = options->axis(); + batch_normalization_mojo->epsilon = options->epsilon(); + if (options->hasActivation()) { + auto activation = + CreateActivation(operand_to_id_map, options->activation()->Operator()); + if (activation.has_value()) { + batch_normalization_mojo->activation = std::move(activation.value()); + } else { + return base::unexpected(activation.error()); + } + } + return webnn::mojom::blink::Operation::NewBatchNormalization( + std::move(batch_normalization_mojo)); +} + OperationPtr CreateConcatOperation(const OperandToIdMap& operand_to_id_map, const MLOperator* concat) { const auto& inputs = concat->Inputs(); @@ -369,44 +438,12 @@ // Convert `MLActivition` to `mojo::Operator` if it's configured. if (options->hasActivation()) { - auto operator_kind = options->activation()->Operator()->Kind(); - switch (operator_kind) { - case blink::MLOperator::OperatorKind::kClamp: { - conv2d_mojo->activation = blink_mojom::Activation::NewClamp(CreateClamp( - operand_to_id_map, options->activation()->Operator(), true)); - break; - } - case blink::MLOperator::OperatorKind::kElu: { - conv2d_mojo->activation = blink_mojom::Activation::NewElu(CreateElu( - operand_to_id_map, options->activation()->Operator(), true)); - break; - } - case blink::MLOperator::OperatorKind::kLeakyRelu: { - conv2d_mojo->activation = - blink_mojom::Activation::NewLeakyRelu(CreateLeakyRelu( - operand_to_id_map, options->activation()->Operator(), true)); - break; - } - case blink::MLOperator::OperatorKind::kRelu: - conv2d_mojo->activation = - blink_mojom::Activation::NewRelu(blink_mojom::Relu::New()); - break; - case blink::MLOperator::OperatorKind::kSigmoid: - conv2d_mojo->activation = - blink_mojom::Activation::NewSigmoid(blink_mojom::Sigmoid::New()); - break; - case blink::MLOperator::OperatorKind::kSoftmax: - conv2d_mojo->activation = - blink_mojom::Activation::NewSoftmax(blink_mojom::Softmax::New()); - break; - case blink::MLOperator::OperatorKind::kTanh: - conv2d_mojo->activation = - blink_mojom::Activation::NewTanh(blink_mojom::Tanh::New()); - break; - default: - return base::unexpected( - MLOperator::OperatorKindToString(operator_kind) + - " is not converted to mojo as activation."); + auto activation = + CreateActivation(operand_to_id_map, options->activation()->Operator()); + if (activation.has_value()) { + conv2d_mojo->activation = std::move(activation.value()); + } else { + return base::unexpected(activation.error()); } } return blink_mojom::Operation::NewConv2d(std::move(conv2d_mojo)); @@ -863,6 +900,8 @@ const OperandToIdMap& operand_to_id_map, const MLOperator* op) { switch (op->Kind()) { + case MLOperator::OperatorKind::kBatchNormalization: + return CreateBatchNormalizationOperation(operand_to_id_map, op); case MLOperator::OperatorKind::kClamp: return blink_mojom::Operation::NewClamp( CreateClamp(operand_to_id_map, op, false));
diff --git a/third_party/blink/renderer/platform/audio/cpu/arm/delay_neon.cc b/third_party/blink/renderer/platform/audio/cpu/arm/delay_neon.cc index 02aff4d8..a11b175 100644 --- a/third_party/blink/renderer/platform/audio/cpu/arm/delay_neon.cc +++ b/third_party/blink/renderer/platform/audio/cpu/arm/delay_neon.cc
@@ -61,6 +61,7 @@ int w_index = write_index_; const float32x4_t v_sample_rate = vdupq_n_f32(sample_rate); + const float32x4_t v_all_zeros = vdupq_n_f32(0); // The buffer length as a float and as an int so we don't need to constant // convert from one to the other. @@ -88,7 +89,8 @@ int k = 0; for (int n = 0; n < number_of_loops; ++n, k += 4) { - const float32x4_t v_delay_time = vld1q_f32(delay_times + k); + const float32x4_t v_delay_time = vmaxq_f32(vld1q_f32(delay_times + k), + v_all_zeros); const float32x4_t v_desired_delay_frames = vmulq_f32(v_delay_time, v_sample_rate); @@ -101,7 +103,8 @@ WrapPositionVector(v_read_position, v_buffer_length_float); // Get indices into the buffer for the samples we need for interpolation. - const int32x4_t v_read_index1 = vcvtq_s32_f32(v_read_position); + const int32x4_t v_read_index1 = WrapIndexVector( + vcvtq_s32_f32(v_read_position), v_buffer_length_int); const int32x4_t v_read_index2 = WrapIndexVector( vaddq_s32(v_read_index1, vdupq_n_s32(1)), v_buffer_length_int);
diff --git a/third_party/blink/renderer/platform/audio/cpu/x86/delay_sse2.cc b/third_party/blink/renderer/platform/audio/cpu/x86/delay_sse2.cc index 67f18cb7..dfbf83f 100644 --- a/third_party/blink/renderer/platform/audio/cpu/x86/delay_sse2.cc +++ b/third_party/blink/renderer/platform/audio/cpu/x86/delay_sse2.cc
@@ -56,10 +56,10 @@ const float sample_rate = sample_rate_; const float* delay_times = delay_times_.Data(); - int w_index = write_index_; const __m128 v_sample_rate = _mm_set1_ps(sample_rate); + const __m128 v_all_zeros = _mm_setzero_ps(); // The buffer length as a float and as an int so we don't need to constant // convert from one to the other. @@ -82,7 +82,10 @@ int k = 0; for (int n = 0; n < number_of_loops; ++n, k += 4) { - const __m128 v_delay_time = _mm_loadu_ps(delay_times + k); + // It's possible that `delay_time` contains negative values. Make sure + // they are greater than zero. + const __m128 v_delay_time = _mm_max_ps(_mm_loadu_ps(delay_times + k), + v_all_zeros); const __m128 v_desired_delay_frames = _mm_mul_ps(v_delay_time, v_sample_rate); @@ -95,7 +98,8 @@ WrapPositionVector(v_read_position, v_buffer_length_float); // Get indices into the buffer for the samples we need for interpolation. - const __m128i v_read_index1 = _mm_cvttps_epi32(v_read_position); + const __m128i v_read_index1 = WrapIndexVector( + _mm_cvttps_epi32(v_read_position), v_buffer_length_int); const __m128i v_read_index2 = WrapIndexVector( _mm_add_epi32(v_read_index1, _mm_set1_epi32(1)), v_buffer_length_int);
diff --git a/third_party/blink/renderer/platform/audio/delay.cc b/third_party/blink/renderer/platform/audio/delay.cc index e432110..be98e08 100644 --- a/third_party/blink/renderer/platform/audio/delay.cc +++ b/third_party/blink/renderer/platform/audio/delay.cc
@@ -135,7 +135,7 @@ const float* delay_times = delay_times_.Data(); for (unsigned i = start; i < frames_to_process; ++i) { - double delay_time = delay_times[i]; + double delay_time = std::fmax(delay_times[i], 0); double desired_delay_frames = delay_time * sample_rate; double read_position = w_index + buffer_length - desired_delay_frames;
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource.cc b/third_party/blink/renderer/platform/graphics/canvas_resource.cc index 06283a8..19bfa61 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource.cc
@@ -702,7 +702,7 @@ SkImageInfo image_info = CreateSkImageInfo(); if (!is_accelerated_) { - std::unique_ptr<gpu::SharedImageInterface::ScopedMapping> mapping; + std::unique_ptr<gpu::ClientSharedImage::ScopedMapping> mapping; void* memory = nullptr; size_t stride = 0; if (base::FeatureList::IsEnabled(kAlwaysUseMappableSIForSoftwareCanvas)) { @@ -790,7 +790,7 @@ } auto* sii = ContextProviderWrapper()->ContextProvider()->SharedImageInterface(); - std::unique_ptr<gpu::SharedImageInterface::ScopedMapping> mapping; + std::unique_ptr<gpu::ClientSharedImage::ScopedMapping> mapping; void* memory = nullptr; size_t stride = 0; if (base::FeatureList::IsEnabled(kAlwaysUseMappableSIForSoftwareCanvas)) {
diff --git a/third_party/blink/renderer/platform/media/video_frame_compositor.cc b/third_party/blink/renderer/platform/media/video_frame_compositor.cc index 08d35e9a..ade7adf4 100644 --- a/third_party/blink/renderer/platform/media/video_frame_compositor.cc +++ b/third_party/blink/renderer/platform/media/video_frame_compositor.cc
@@ -332,9 +332,6 @@ frame_metadata->presented_frames = presentation_counter_; } - if (base::FeatureList::IsEnabled(media::kKeepRvfcFrameAlive)) - frame_metadata->frame = last_frame; - frame_metadata->width = last_frame->visible_rect().width(); frame_metadata->height = last_frame->visible_rect().height();
diff --git a/third_party/blink/renderer/platform/media/watch_time_reporter_unittest.cc b/third_party/blink/renderer/platform/media/watch_time_reporter_unittest.cc index 400f772..3a6ef69 100644 --- a/third_party/blink/renderer/platform/media/watch_time_reporter_unittest.cc +++ b/third_party/blink/renderer/platform/media/watch_time_reporter_unittest.cc
@@ -247,10 +247,6 @@ video_frames_dropped); } - void OnCurrentTimestampChanged(base::TimeDelta duration) override { - parent_->OnCurrentTimestampChanged(duration); - } - private: raw_ptr<WatchTimeReporterTest, ExperimentalRenderer> parent_; }; @@ -651,7 +647,6 @@ MOCK_METHOD1(OnSetAutoplayInitiated, void(bool)); MOCK_METHOD1(OnDurationChanged, void(base::TimeDelta)); MOCK_METHOD2(OnUpdateVideoDecodeStats, void(uint32_t, uint32_t)); - MOCK_METHOD1(OnCurrentTimestampChanged, void(base::TimeDelta)); base::test::SingleThreadTaskEnvironment task_environment_{ base::test::TaskEnvironment::TimeSource::MOCK_TIME};
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index f590512..e9cbb76c 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -2177,7 +2177,7 @@ { name: "LayoutNewMeasureCache", depends_on: ["LayoutNewMinMaxCache"], - status: "test", + status: "stable", }, { name: "LayoutNewMinMaxCache", @@ -2472,6 +2472,10 @@ base_feature: "none", }, { + name: "NextSiblingPositionUseNextCandidate", + status: "stable", + }, + { name: "NoIdleEncodingForWebTests", status: "test", base_feature: "none", @@ -2966,6 +2970,11 @@ base_feature: "none", }, { + name: "PrivateNetworkAccessNullIpAddress", + status: "experimental", + base_feature: "none", + }, + { name: "PrivateNetworkAccessPermissionPrompt", origin_trial_feature_name: "PrivateNetworkAccessPermissionPrompt", origin_trial_os: ["win", "mac", "linux", "fuchsia", "chromeos"],
diff --git a/third_party/blink/tools/OWNERS b/third_party/blink/tools/OWNERS index 96c6224..fc8e896 100644 --- a/third_party/blink/tools/OWNERS +++ b/third_party/blink/tools/OWNERS
@@ -1,4 +1,3 @@ -rmhasan@google.com smcgruer@chromium.org tkent@chromium.org wangxianzhu@chromium.org
diff --git a/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py b/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py index d3c42ec..47dc38c0 100644 --- a/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py +++ b/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py
@@ -780,7 +780,8 @@ actual_driver_output, reference_driver_output, reference_filename)) elif err_str: - # TODO(rmhasan) Should we include this error message in the artifacts ? + # TODO(weizhong) Should we include this error message in the + # artifacts ? _log.error(' %s : %s', self._test_name, err_str) elif not max_pixels_diff: _log.warning(
diff --git a/third_party/blink/tools/blinkpy/web_tests/models/test_failures.py b/third_party/blink/tools/blinkpy/web_tests/models/test_failures.py index 5dc2cce..83dd4181 100644 --- a/third_party/blink/tools/blinkpy/web_tests/models/test_failures.py +++ b/third_party/blink/tools/blinkpy/web_tests/models/test_failures.py
@@ -36,7 +36,7 @@ from blinkpy.common.html_diff import html_diff from blinkpy.common.unified_diff import unified_diff -# TODO(rmhasan) Create a unit test for each Failure type and make +# TODO(weizhong) Create a unit test for each Failure type and make # sure each artifact is written to the correct path # Filename pieces when writing failures to the test results directory. @@ -201,7 +201,7 @@ class PassWithStderr(AbstractTestResultType): def __init__(self, driver_output): - # TODO (rmhasan): Should we write out the reference driver standard + # TODO (weizhong): Should we write out the reference driver standard # error super(PassWithStderr, self).__init__(driver_output, None) @@ -364,7 +364,7 @@ return '' def create_artifacts(self, typ_artifacts, force_overwrite=False): - # TODO (rmhasan): See if you can can only output diff files for + # TODO (weizhong): See if you can can only output diff files for # non empty text. super(FailureText, self).create_artifacts(typ_artifacts, force_overwrite)
diff --git a/third_party/blink/tools/blinkpy/web_tests/port/android.py b/third_party/blink/tools/blinkpy/web_tests/port/android.py index d7aa02b9..c925b831 100644 --- a/third_party/blink/tools/blinkpy/web_tests/port/android.py +++ b/third_party/blink/tools/blinkpy/web_tests/port/android.py
@@ -357,7 +357,7 @@ self._devices.set_device_prepared(serial) def bot_expectations(self): - # TODO(rmhasan) Add bot expectations to WPT metadata. + # TODO(weizhong) Add bot expectations to WPT metadata. return {} def expected_test(self, _):
diff --git a/third_party/blink/tools/blinkpy/web_tests/port/base.py b/third_party/blink/tools/blinkpy/web_tests/port/base.py index d7ddf42..053a053 100644 --- a/third_party/blink/tools/blinkpy/web_tests/port/base.py +++ b/third_party/blink/tools/blinkpy/web_tests/port/base.py
@@ -2090,7 +2090,7 @@ "reading additional_expectations from path '%s'", path) expectations[path] = self._filesystem.read_text_file(path) else: - # TODO(rmhasan): Fix additional expectation paths for + # TODO(weizhong): Fix additional expectation paths for # not_site_per_process_blink_web_tests, then change this # back to raising exceptions for incorrect expectation # paths.
diff --git a/third_party/blink/tools/blinkpy/web_tests/run_web_tests_unittest.py b/third_party/blink/tools/blinkpy/web_tests/run_web_tests_unittest.py index e506ca4..b2edc96 100644 --- a/third_party/blink/tools/blinkpy/web_tests/run_web_tests_unittest.py +++ b/third_party/blink/tools/blinkpy/web_tests/run_web_tests_unittest.py
@@ -896,7 +896,7 @@ @unittest.skip('Need to make subprocesses use mock filesystem') def test_crash_log_is_saved_after_delay_using_multiple_jobs(self): - # TODO(rmhasan): When web_test_runner.run() spawns multiple jobs it uses + # TODO(weizhong): When web_test_runner.run() spawns multiple jobs it uses # the non mock file system. We should figure out how to make all subprocesses # use the mock file system. host = MockHost()
diff --git a/third_party/blink/web_tests/ChromeTestExpectations b/third_party/blink/web_tests/ChromeTestExpectations index 65df6b4b..f2afdbe 100644 --- a/third_party/blink/web_tests/ChromeTestExpectations +++ b/third_party/blink/web_tests/ChromeTestExpectations
@@ -541,6 +541,9 @@ crbug.com/1499775 external/wpt/webusb/usbDevice-iframe.https.html [ Pass Timeout ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-about-blank.tentative.html [ Failure ] +crbug.com/626703 external/wpt/css/css-transforms/transform-box/svgbox-stroke-box-003.html [ Failure ] +crbug.com/626703 external/wpt/css/css-transforms/transform-box/svgbox-stroke-box-004.html [ Failure ] crbug.com/626703 external/wpt/credential-management/fedcm-disconnect-errors.https.html [ Timeout ] crbug.com/626703 external/wpt/css/selectors/selectors-4/lang-023.html [ Failure ] crbug.com/626703 external/wpt/css/selectors/selectors-4/lang-024.html [ Failure ]
diff --git a/third_party/blink/web_tests/SlowTests b/third_party/blink/web_tests/SlowTests index 5a8f916..a7e8edc 100644 --- a/third_party/blink/web_tests/SlowTests +++ b/third_party/blink/web_tests/SlowTests
@@ -761,16 +761,6 @@ crbug.com/874695 [ Mac11 Release ] virtual/threaded/http/tests/devtools/tracing/timeline-layout/timeline-layout-with-invalidations.js [ Slow ] crbug.com/874695 [ Mac12 ] virtual/threaded/http/tests/devtools/tracing/timeline-layout/timeline-layout-with-invalidations.js [ Slow ] crbug.com/874695 [ Release Win ] virtual/threaded/http/tests/devtools/tracing/timeline-layout/timeline-layout-with-invalidations.js [ Slow ] -crbug.com/874695 [ Linux ] virtual/threaded/http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Slow ] -crbug.com/874695 [ Mac10.15 Release ] virtual/threaded/http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Slow ] -crbug.com/874695 [ Mac11 Release ] virtual/threaded/http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Slow ] -crbug.com/874695 [ Mac11-arm64 Release ] virtual/threaded/http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Slow ] -crbug.com/874695 [ Mac12 Release ] virtual/threaded/http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Slow ] -crbug.com/874695 [ Mac12-arm64 Release ] virtual/threaded/http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Slow ] -crbug.com/874695 [ Mac13 ] virtual/threaded/http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Slow ] -crbug.com/874695 [ Mac13-arm64 ] virtual/threaded/http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Slow ] -crbug.com/874695 [ Release Win ] virtual/threaded/http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Slow ] - crbug.com/1494075 virtual/threaded/synthetic_gestures/synthetic-pinch-zoom-gesture-touchpad-zoom-in-slow-desktop.html [ Slow ] crbug.com/1494075 virtual/threaded/synthetic_gestures/synthetic-pinch-zoom-gesture-touchpad-zoom-in-slow.html [ Slow ] crbug.com/1494075 virtual/threaded/synthetic_gestures/synthetic-pinch-zoom-gesture-touchpad-zoom-out-slow.html [ Slow ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 365063d..773f896 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -1550,10 +1550,6 @@ crbug.com/1488371 virtual/deprecate-unload/external/wpt/html/browsers/the-window-object/BarProp.window.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/external/wpt/html/browsers/the-window-object/open-close/close_unload.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/external/wpt/html/browsers/the-window-object/self-et-al.window.html [ Failure Skip Timeout ] -crbug.com/1488371 virtual/deprecate-unload/external/wpt/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-exception-vs-return-origin.sub.window.html [ Failure Skip Timeout ] -crbug.com/1488371 virtual/deprecate-unload/external/wpt/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-exception-vs-return-xml.window.html [ Failure Skip Timeout ] -crbug.com/1488371 virtual/deprecate-unload/external/wpt/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-ignore-opens-during-unload.window.html [ Failure Skip Timeout ] -crbug.com/1488371 virtual/deprecate-unload/external/wpt/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/ignore-opens-during-unload.window.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/external/wpt/html/webappapis/scripting/events/event-handler-attributes-body-window.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/external/wpt/html/webappapis/scripting/events/event-handler-attributes-frameset-window.html [ Failure Skip Timeout ] crbug.com/1488371 virtual/deprecate-unload/external/wpt/html/webappapis/scripting/events/event-handler-attributes-windowless-body.html [ Failure Skip Timeout ] @@ -1575,6 +1571,10 @@ crbug.com/1488371 virtual/deprecate-unload/external/wpt/navigation-timing/nested-unload-timing.html [ Failure ] crbug.com/1488371 virtual/deprecate-unload/http/tests/navigation/targeted-navigation-in-unload-handler.html [ Timeout ] crbug.com/1488371 virtual/deprecate-unload/http/tests/devtools/sources/debugger/skip-pause-during-navigation.js [ Skip Timeout ] +crbug.com/1488371 virtual/deprecate-unload/external/wpt/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-exception-vs-return-origin.sub.window.html [ Timeout ] +crbug.com/1488371 virtual/deprecate-unload/external/wpt/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-exception-vs-return-xml.window.html [ Timeout ] +crbug.com/1488371 virtual/deprecate-unload/external/wpt/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-ignore-opens-during-unload.window.html [ Timeout ] +crbug.com/1488371 virtual/deprecate-unload/external/wpt/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/ignore-opens-during-unload.window.html [ Timeout ] # Pagehide is not appropriate as the test checks if PiP window is functional until the very end of the page's lifecycle: crbug.com/1488371 virtual/deprecate-unload/external/wpt/document-picture-in-picture/clears-session-on-close.https.html [ Timeout ] @@ -2021,8 +2021,6 @@ crbug.com/619978 fast/css/giant-stylesheet-crash.html [ Crash Failure Pass Timeout ] -crbug.com/399507 virtual/threaded/http/tests/devtools/tracing/timeline-paint/layer-tree.js [ Failure Pass Timeout ] - # Working on getting the CSP tests going: # These tests will be added back soon: @@ -2681,6 +2679,13 @@ crbug.com/626703 [ Mac ] virtual/webcodecs-without-task-runner-with-custom-deleter/external/wpt/webcodecs/videoDecoder-codec-specific.https.any.worker.html?h265_hevc [ Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-about-blank.tentative.html [ Failure ] +crbug.com/626703 external/wpt/css/css-transforms/transform-box/svgbox-stroke-box-003.html [ Failure ] +crbug.com/626703 external/wpt/css/css-transforms/transform-box/svgbox-stroke-box-004.html [ Failure ] +crbug.com/626703 virtual/backface-visibility-interop/external/wpt/css/css-transforms/transform-box/svgbox-stroke-box-003.html [ Failure ] +crbug.com/626703 virtual/backface-visibility-interop/external/wpt/css/css-transforms/transform-box/svgbox-stroke-box-004.html [ Failure ] +crbug.com/626703 virtual/dark-color-scheme/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-about-blank.tentative.html [ Failure ] +crbug.com/626703 [ Mac11 ] external/wpt/infrastructure/expected-fail/window-onload-test.html [ Failure Timeout ] crbug.com/626703 external/wpt/webnn/elementwise_logical.https.any.worker.html [ Skip Timeout ] crbug.com/626703 virtual/webnn-service-enabled/external/wpt/webnn/gpu/elementwise_logical.https.any.worker.html [ Skip Timeout ] crbug.com/626703 [ Win10.20h2 ] external/wpt/pointerevents/pointerevent_after_target_appended.html?mouse [ Timeout ] @@ -3633,7 +3638,6 @@ crbug.com/1335889 external/wpt/css/css-grid/grid-model/grid-areas-overflowing-grid-container-009.html [ Failure ] # Simple to fix - but blocked on performance regression requiring cache logic change. -crbug.com/1272533 external/wpt/css/css-grid/layout-algorithm/grid-intrinsic-size-dynamic-block-size.html [ Failure ] crbug.com/1272533 external/wpt/css/css-flexbox/intrinsic-size/col-wrap-009.html [ Failure ] # Baseline Content-Alignment is not implemented yet for CSS Grid Layout @@ -3856,9 +3860,6 @@ # Antialiasing error crbug.com/845973 virtual/display-compositor-pixel-dump/fast/canvas/display-compositor-pixel-dump/OffscreenCanvas-opaque-background-compositing.html [ Failure Pass ] -# Tests occasionaly timing out (flaky) on WebKit Win7 dbg builder -crbug.com/757955 http/tests/devtools/tracing/timeline-paint/layer-tree.js [ Failure Pass Timeout ] - # This test has a fixed number of time which can depend on performance. crbug.com/669329 http/tests/devtools/tracing/timeline-js/timeline-runtime-stats.js [ Crash Failure Pass Timeout ] @@ -4093,7 +4094,6 @@ crbug.com/922951 http/tests/history/back-to-post.html [ Crash Failure Pass Timeout ] crbug.com/922951 http/tests/webaudio/autoplay-crossorigin.html [ Crash Failure Pass Timeout ] crbug.com/922951 [ Release Win ] media/controls/overflow-menu-hide-on-click-outside-stoppropagation.html [ Crash Failure Pass Timeout ] -crbug.com/922951 virtual/threaded/http/tests/devtools/tracing/frame-model-instrumentation.js [ Crash Failure Pass Timeout ] crbug.com/922951 virtual/threaded/http/tests/devtools/tracing/timeline-layout/timeline-layout-with-invalidations.js [ Crash Failure Pass Timeout ] crbug.com/910979 http/tests/html/validation-bubble-oopif-clip.html [ Crash Failure Pass Timeout ] @@ -5131,9 +5131,6 @@ crbug.com/1345752 [ Win ] media/controls/overflow-menu-focus.html [ Failure Pass ] -# Following tests timeout on mac11-arm64 -crbug.com/1249176 [ Mac11-arm64 ] http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Failure Timeout ] - # http/tests/intersection-observer/cross-origin-iframe-with-nesting.html tests crbug.com/1450030 [ Mac11-arm64 ] http/tests/intersection-observer/cross-origin-iframe-with-nesting.html [ Failure Pass Timeout ] crbug.com/1450030 [ Mac12-arm64 ] http/tests/intersection-observer/cross-origin-iframe-with-nesting.html [ Failure Pass Timeout ] @@ -5150,8 +5147,6 @@ crbug.com/1249176 [ Mac12-arm64 ] paint/markers/document-markers-font-8px.html [ Failure Pass ] crbug.com/1249176 [ Mac11-arm64 ] paint/markers/document-markers-zoom-2000.html [ Failure Pass ] crbug.com/1249176 [ Mac12-arm64 ] paint/markers/document-markers-zoom-2000.html [ Failure Pass ] -crbug.com/1249176 [ Mac11-arm64 ] http/tests/devtools/tracing/frame-model-instrumentation.js [ Failure Pass ] -crbug.com/1249176 [ Mac12-arm64 ] http/tests/devtools/tracing/frame-model-instrumentation.js [ Failure Pass ] crbug.com/1249176 [ Mac11-arm64 ] inspector-protocol/layout-fonts/lang-fallback.js [ Failure Pass ] crbug.com/1249176 [ Mac11-arm64 ] external/wpt/layout-instability/recent-input.html [ Failure Pass ] crbug.com/1249176 [ Mac12-arm64 ] external/wpt/layout-instability/recent-input.html [ Failure Pass ] @@ -5165,9 +5160,6 @@ crbug.com/1249176 [ Mac11-arm64 ] external/wpt/largest-contentful-paint/multiple-redirects-TAO.html [ Failure Pass ] crbug.com/1249176 [ Mac12-arm64 ] external/wpt/largest-contentful-paint/multiple-redirects-TAO.html [ Failure Pass ] crbug.com/1249176 [ Mac11-arm64 ] http/tests/devtools/elements/styles-2/nested-pseudo-elements.js [ Failure Pass ] -crbug.com/1463944 [ Mac11-arm64 ] virtual/threaded/http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Failure ] -crbug.com/1463944 [ Mac12-arm64 ] virtual/threaded/http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Failure Pass ] -crbug.com/1463944 [ Mac13-arm64 ] virtual/threaded/http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Failure Pass ] # mac-arm CI 10-05-2021 crbug.com/1249176 [ Mac11-arm64 ] virtual/gpu-rasterization/images/directly-composited-image-orientation.html [ Failure Pass ] @@ -5504,9 +5496,6 @@ crbug.com/1282966 http/tests/security/mixedContent/insecure-plugin-in-iframe.html [ Failure Pass ] crbug.com/1318952 http/tests/inspector-protocol/fetch/fetch-samesite-cookies.js [ Failure Pass ] -# Temporarily disabled to unblock https://crrev.com/c/5063940 -crbug.com/1505512 http/tests/devtools/oopif/oopif-storage.js [ Failure Pass ] - # Sheriff 2022-04-25 crbug.com/1319320 rootscroller/root-scroller-apply-filter-to-parent.html [ Failure Pass ] @@ -6692,6 +6681,9 @@ # Since HTTPS upgrades run in the //chrome layer, these will fail when ran in content shell. external/wpt/https-upgrades/tentative/upgrade.https.sub.html [ Timeout ] +external/wpt/https-upgrades/tentative/http-redirecting-to-http.https.sub.html [ Timeout ] +external/wpt/https-upgrades/tentative/http-redirecting-to-http-redirecting-to-http.https.sub.html [ Timeout ] +external/wpt/https-upgrades/tentative/http-redirecting-to-https.https.sub.html [ Timeout ] # Sherrif 2023-06-09 crbug.com/1358175 [ Mac12 ] media/controls/closed-captions-single-track.html [ Failure Pass ] @@ -6914,7 +6906,6 @@ # Gardener 2023-08-31 crbug.com/1477701 [ Mac ] http/tests/devtools/tracing/timeline-layout/timeline-layout-with-invalidations.js [ Failure Pass ] crbug.com/1477701 [ Mac ] http/tests/inspector-protocol/timeline/auction-worklet-network.js [ Failure Pass ] -crbug.com/1477701 [ Mac13-arm64 Release ] http/tests/devtools/tracing/frame-model-instrumentation.js [ Failure Pass ] # Gardener 2023-09-05 # Flaky on Webkit Linux Leak @@ -7067,9 +7058,6 @@ # Gardener 2023-11-10 crbug.com/1486131 [ Debug Linux ] external/wpt/html/browsers/history/the-history-interface/001.html [ Failure Pass ] -# Gardener 2023-11-10 -crbug.com/1501324 [ Mac ] virtual/compute-pressure/external/wpt/compute-pressure/compute_pressure_rate_obfuscation_mitigation_triggered.tentative.https.window.html [ Failure Pass Timeout ] - # Tentatively allowed to fail to roll changes in the DevTools frontend. crbug.com/1474670 http/tests/devtools/application-panel/resources-panel-on-navigation.js [ Failure Pass ] crbug.com/1474670 http/tests/devtools/application-panel/resources-panel-resource-preview.js [ Failure Pass ]
diff --git a/third_party/blink/web_tests/css3/supports-cssom-expected.txt b/third_party/blink/web_tests/css3/supports-cssom-expected.txt index 0f17aca..1bae5247 100644 --- a/third_party/blink/web_tests/css3/supports-cssom-expected.txt +++ b/third_party/blink/web_tests/css3/supports-cssom-expected.txt
@@ -17,11 +17,15 @@ PASS rules[0].cssText is "@supports (width: 0) {\n s { width: 0px; }\n @supports (width: 1) {\n s { color: rgb(0, 0, 0); }\n}\n}" Missing argument exceptions. -PASS rules[0].insertRule() threw exception TypeError: Failed to execute 'insertRule' on 'CSSGroupingRule': 2 arguments required, but only 0 present.. -PASS rules[0].insertRule('@media all {}') threw exception TypeError: Failed to execute 'insertRule' on 'CSSGroupingRule': 2 arguments required, but only 1 present.. +PASS rules[0].insertRule() threw exception TypeError: Failed to execute 'insertRule' on 'CSSGroupingRule': 1 argument required, but only 0 present.. PASS rules[0].deleteRule() threw exception TypeError: Failed to execute 'deleteRule' on 'CSSGroupingRule': 1 argument required, but only 0 present.. Inserting and deleting rules. +rules[0].insertRule('@media all { #s { width: 0px; } }') +PASS rules[0].cssRules.length is 3 +PASS rules[0].cssRules[0].type is CSSRule.MEDIA_RULE +rules[0].deleteRule(0) +PASS rules[0].cssRules.length is 2 rules[0].insertRule('@media all { #s { width: 0px; } }', 2) PASS rules[0].cssRules.length is 3 PASS rules[0].cssRules[2].type is CSSRule.MEDIA_RULE
diff --git a/third_party/blink/web_tests/css3/supports-cssom.html b/third_party/blink/web_tests/css3/supports-cssom.html index d11c7d6..aa009d4 100644 --- a/third_party/blink/web_tests/css3/supports-cssom.html +++ b/third_party/blink/web_tests/css3/supports-cssom.html
@@ -77,10 +77,15 @@ debug("\nMissing argument exceptions."); shouldThrow("rules[0].insertRule()"); - shouldThrow("rules[0].insertRule('@media all {}')"); shouldThrow("rules[0].deleteRule()"); debug("\nInserting and deleting rules."); + evalAndLog("rules[0].insertRule('@media all { #s { width: 0px; } }')"); + shouldEvaluateTo("rules[0].cssRules.length", 3); + shouldBe("rules[0].cssRules[0].type", "CSSRule.MEDIA_RULE"); + evalAndLog("rules[0].deleteRule(0)"); + shouldEvaluateTo("rules[0].cssRules.length", 2); + evalAndLog("rules[0].insertRule('@media all { #s { width: 0px; } }', 2)"); shouldEvaluateTo("rules[0].cssRules.length", 3); shouldBe("rules[0].cssRules[2].type", "CSSRule.MEDIA_RULE");
diff --git a/third_party/blink/web_tests/editing/selection/skip-over-uneditable-in-contenteditable.html b/third_party/blink/web_tests/editing/selection/skip-over-uneditable-in-contenteditable.html index 70458436..ad4a174 100644 --- a/third_party/blink/web_tests/editing/selection/skip-over-uneditable-in-contenteditable.html +++ b/third_party/blink/web_tests/editing/selection/skip-over-uneditable-in-contenteditable.html
@@ -28,6 +28,20 @@ selection_test( [ '<div contenteditable>', + '<span>^Before|<span contenteditable="false">Middle</span></span>After', + '</div>' + ], + selection => selection.modify('extend', 'forward', 'character'), + [ + '<div contenteditable>', + '<span>^Before<span contenteditable="false">Middle</span></span>|After', + '</div>' + ], + 'Extend by character before uneditable in one line'); + +selection_test( + [ + '<div contenteditable>', '<p>^Before|</p>', '<p contenteditable="false">Middle</p>', '<p>After</p>',
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index 4ee25daeb..bc97da1 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -87508,7 +87508,7 @@ ] ], "color-mix-currentcolor-background-repaint-parent.html": [ - "44399c198862837fcf5f25e9af0cb83c8e62f9cf", + "eb0b979800baabe1895b1e6c0e09bbfd317ceb63", [ null, [ @@ -87521,7 +87521,7 @@ ] ], "color-mix-currentcolor-background-repaint.html": [ - "a8f742b6c53effac1e23491fc5a3843c90a82129", + "04578125cd55045dd525a7fca5fb6524f22e53ee", [ null, [ @@ -87534,7 +87534,7 @@ ] ], "color-mix-currentcolor-border-repaint-parent.html": [ - "5182dd8d0fbd968bff3931a0a32884d7aa4cf6f2", + "0e2c627532a02cd91c59c0b68be937c895c4a20b", [ null, [ @@ -87547,7 +87547,7 @@ ] ], "color-mix-currentcolor-border-repaint.html": [ - "5496be32a69efde070c5767b3c84c09dbd44de8a", + "f8ac80f5152eba5738b9f25b9bbdc6f0694b63ed", [ null, [ @@ -87560,7 +87560,7 @@ ] ], "color-mix-currentcolor-outline-repaint-parent.html": [ - "0d434b1d351e9853426fe99d7f889649eaceda10", + "69d42c1808cd0435e8cceec5a848d0c348b75be5", [ null, [ @@ -87573,7 +87573,7 @@ ] ], "color-mix-currentcolor-outline-repaint.html": [ - "8892d818f9bbda92b02404347586d5c953d4793c", + "764a1af93223b64f93c0e639366babec42ce818c", [ null, [ @@ -87842,7 +87842,7 @@ ] ], "currentcolor-border-repaint-parent.html": [ - "7058e9969b311619969d5f87d859084edee36545", + "c84d26c434db7e58b607fd3a0299e4317e1b180b", [ null, [ @@ -103837,6 +103837,19 @@ {} ] ], + "color-scheme-iframe-background-about-blank.tentative.html": [ + "a5a9843ac80d97d529d04f65c9f2250d3ba0dc25", + [ + null, + [ + [ + "/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-about-blank-ref.html", + "==" + ] + ], + {} + ] + ], "color-scheme-iframe-background-mismatch-alpha.html": [ "bab634cfda765536a4b428146ff64a63cac851a9", [ @@ -213038,6 +213051,32 @@ {} ] ], + "svgbox-stroke-box-003.html": [ + "f132eb41013d8bbf6d236afef145c4c2fcedbc1c", + [ + null, + [ + [ + "/css/css-transforms/transform-box/reference/svgbox-rect-ref.html", + "==" + ] + ], + {} + ] + ], + "svgbox-stroke-box-004.html": [ + "0046295cf9a81910c69f5b3a7df613099c9e5784", + [ + null, + [ + [ + "/css/css-transforms/transform-box/reference/svgbox-rect-ref.html", + "==" + ] + ], + {} + ] + ], "svgbox-view-box.html": [ "dbce635d6e78652c5f96904fa095f3d3f23ac134", [ @@ -282019,6 +282058,19 @@ {} ] ], + "use-template.html": [ + "1c07415442d690485ba706f613fbd2ccafd72909", + [ + null, + [ + [ + "/svg/linking/reftests/use-template-ref.html", + "==" + ] + ], + {} + ] + ], "view-viewbox-override.html": [ "83976f4d1363177a789eb6d80a86a18c015914d3", [ @@ -282049,7 +282101,7 @@ ] ], "color-mix-currentcolor-fill-stroke-repaint.html": [ - "216948038ca866c615409c73bb7bb4b4bc7fef1f", + "70e9013ac456dc8e7f06669d32e38b24a0219942", [ null, [ @@ -282101,7 +282153,7 @@ ] ], "currentcolor-fill-stroke-repaint.html": [ - "4e4fa20450c2dc2f86963ece4fba1ac18dbf740a", + "4b08e1b857442adab324da93c7259f16e30cde79", [ null, [ @@ -283671,32 +283723,6 @@ {} ] ], - "use-data-url-set-attributeName.tentative.svg": [ - "248f218bd792e1ffd07711095b3612c45ecb7a6c", - [ - null, - [ - [ - "/svg/struct/reftests/reference/green-100x100.svg", - "==" - ] - ], - {} - ] - ], - "use-data-url-setAttribute.tentative.html": [ - "b28dd0ecf5b9e798ad8af8c5d6e2c01aea07b7e6", - [ - null, - [ - [ - "/svg/struct/reftests/reference/green-100x100.html", - "==" - ] - ], - {} - ] - ], "use-data-url.tentative.svg": [ "04414030a3e65ee05314386e90e75184e8c80042", [ @@ -283775,19 +283801,6 @@ {} ] ], - "use-ref-inside-data-url.tentative.html": [ - "d6ac2e3654a6f1ae2591c47415b38f8c279b3b37", - [ - null, - [ - [ - "/svg/struct/reftests/reference/green-100x100.html", - "==" - ] - ], - {} - ] - ], "use-same-origin.svg": [ "0aa1ec83afd68b3ea6022d33f6ec6f8103d99661", [ @@ -305943,6 +305956,10 @@ "921482afcdf10cc38d113d0d428e1df43d09dd66", [] ], + "color-scheme-iframe-background-about-blank-ref.html": [ + "79c882fbda82906c1446a14f6eef2ac54cdb2912", + [] + ], "color-scheme-iframe-background-mismatch-used-preferred-ref.html": [ "4eb06f35fd269617d9789f85be8e6420dcbfce53", [] @@ -305968,6 +305985,10 @@ "cb5e6d66917e4ca061e14a6539e333fb44b2e51a", [] ], + "dark-frame-blank.html": [ + "dd540f41a3c7a3f095e4701eded73e04edc36a23", + [] + ], "dark-frame-opaque.html": [ "ca845ea13ce1f3835c5629295adbc1fec35bfb56", [] @@ -319766,10 +319787,6 @@ "fcd6851e2f84c2ec33a76b86ba4b15a70d36f7e8", [] ], - "grid-template-invalid-expected.txt": [ - "b0625d0adef85b427d3225bb443ffd367b7f1c00", - [] - ], "independent-formatting-context-ref.html": [ "fe842b2823832e9feaae3534eab8220dd65cf129", [] @@ -329183,6 +329200,10 @@ "d00b9c3fecc62cd8fe8db0b237159a6c36b9bd08", [] ], + "html5-table-formatting-3-expected.txt": [ + "542f2b7d5249f8e61a9fd347f13574b36ee6a367", + [] + ], "max-height-table-ref.html": [ "ab1036ebb8dffa550b499f8a334c5b6455ba072b", [] @@ -341423,10 +341444,6 @@ ] }, "cssom": { - "CSSGroupingRule-insertRule-expected.txt": [ - "740b569b2c470cdd97bf6ff45c3fefa4d8eaa88c", - [] - ], "CSSKeyframesRule-expected.txt": [ "6b30c4b2419c81c3244dbc65ef8ed57dd9996502", [] @@ -341504,7 +341521,7 @@ [] ], "idlharness-expected.txt": [ - "924ce4f2ba1d0e2bd7fed9c6ac931854bfeca13b", + "d532d14811a9dfea08b1551cfa018ae36e25bd4d", [] ], "insertRule-from-script-ref.html": [ @@ -348334,6 +348351,10 @@ [] ] }, + "idlharness.https-expected.txt": [ + "25f7c78dbefe18a71b77afa2a2a8f355387c764d", + [] + ], "polyfill": { "cast-polyfill.js": [ "576e0ad04066d37670634b39fc128dc2ea905dae", @@ -354739,10 +354760,6 @@ "464a7c9cbe7db57ecac03fb3172adab709ba9346", [] ], - "002-expected.txt": [ - "4c48f024807f138c1008c78ef4660e48f13b5980", - [] - ], "004-expected.txt": [ "87334f66b3cbc94e2f16a6e44fc400e92092b965", [] @@ -354851,11 +354868,11 @@ [] ], "002-1.html": [ - "0e6f7d967bef008dd3fb5dad0f05d01749cf5dcf", + "017fbb964c720226fad4a998150d4c8c37513b43", [] ], "002a.html": [ - "d11f670869c2dd223d82c947d1920db5956d2e27", + "51ff3e37b64398210e466f02afb63ad950dfbc6e", [] ], "002b.html": [ @@ -363677,7 +363694,7 @@ ] }, "structured-cloning-error-stack-optional.sub.window-expected.txt": [ - "be14124cf2c159951baaea47b0a412437b7f4a49", + "3be195d7f1c1ebb2feabdadfae076634ace02982", [] ] }, @@ -367303,6 +367320,10 @@ "d973c0876de05535aa8196b3239fadd007d18ba6", [] ], + "focus-previous-iframe.tentative-expected.txt": [ + "4611bd86648da5c124e797671452fa86a0d615c3", + [] + ], "green-dialog-and-backdrop.html": [ "cd23c32a069f2bbeba65de018f3beda32a012374", [] @@ -371758,6 +371779,10 @@ [] ] }, + "names-expected.txt": [ + "086bb96e34a6e01452957f8ded5b19e41bb237c8", + [] + ], "roles-contextual-expected.txt": [ "086bb96e34a6e01452957f8ded5b19e41bb237c8", [] @@ -371812,6 +371837,10 @@ } }, "https-upgrades": { + "README": [ + "e213900f3a438fd7accfbfbbbdea76988e6e091b", + [] + ], "resources": { "pass.html": [ "5c7ca343e9b2bbe4774ed127d905c8c77b09e47f", @@ -372375,7 +372404,7 @@ [] ], "README.md": [ - "7d0ec556aa45e60fdf03f21d24087d0dbd836005", + "9e25c40d83ed7fe354a7fe4b9f46650116af5dd5", [] ], "assumptions": { @@ -372474,6 +372503,10 @@ "unhandled-rejection-single-test-expected.txt": [ "11fb15ba55315cc044b3f6f18caf0ea4ccec8007", [] + ], + "window-onload-test-expected.txt": [ + "fe86bacd53afd62b0b3db469c6b69f133fd7eba2", + [] ] }, "metadata": { @@ -372969,7 +373002,7 @@ [] ], "clipboard-apis.idl": [ - "51d5af18dc208b3953eb0db531343207be8e2c90", + "594484ced62676cdf50fd8b213e8b7c020941c3d", [] ], "compat.idl": [ @@ -373189,7 +373222,7 @@ [] ], "encrypted-media.idl": [ - "24db48ecf9c3ca2dcade5113edf117fa36ce83d5", + "f5d5aa8d6c0c649fa64fd804ac9bac50a981610d", [] ], "entries-api.idl": [ @@ -373277,7 +373310,7 @@ [] ], "html.idl": [ - "bfda8a96084afb2f6418a0e5f852a09000c5c7b7", + "b7501feea91d5d428061ec7a8acfc33402d2eb23", [] ], "idle-detection.idl": [ @@ -373345,7 +373378,7 @@ [] ], "longtasks.idl": [ - "c0aaa7a29797c0a829d58b3a4186323aa6effe07", + "064d1072d2d76bd3a80333788102d8f835b48a4e", [] ], "magnetometer.idl": [ @@ -373433,7 +373466,7 @@ [] ], "orientation-event.idl": [ - "a93d4658830c6164b00efd2abaac13bb3273fb33", + "965e833fd21966b587c253521c3188f9db611186", [] ], "orientation-sensor.idl": [ @@ -373521,7 +373554,7 @@ [] ], "private-network-access.idl": [ - "19423bad383cdfff24c661b65afdff3b295f4fc2", + "65b58760228921514e48decd39ae49047adb84c5", [] ], "proximity.idl": [ @@ -373641,7 +373674,7 @@ [] ], "storage-buckets.idl": [ - "1a83988d00def23afd4a40758fd3dd8902f34a03", + "79f6c947d16a60d58c5b438476b6ba1c144ed6a9", [] ], "storage.idl": [ @@ -373649,7 +373682,7 @@ [] ], "streams.idl": [ - "6f0f3a6fa76990e895849c660dadc99eb08e1081", + "ab9be033e43ba07af8d7088f22b0e65d6ce9a95b", [] ], "svg-animations.idl": [ @@ -373769,7 +373802,7 @@ [] ], "webauthn.idl": [ - "f210c6c9a175ebfac87b432fd01a4691c82639e6", + "e28355eb78d3829207848a76facfea170eb66998", [] ], "webcodecs-aac-codec-registration.idl": [ @@ -373821,7 +373854,7 @@ [] ], "webgpu.idl": [ - "98fb84c897925b64b7eb332e9c7a9f94ca0f8c95", + "373d51dff13ee61b22cd36dd6dba132810ef621b", [] ], "webhid.idl": [ @@ -373873,7 +373906,7 @@ [] ], "webtransport.idl": [ - "b9deae287087db68c5a29a7bfd9bf90403ee4e02", + "86178a4906b7a7951b34529d2d64648580af87c1", [] ], "webusb.idl": [ @@ -374342,7 +374375,7 @@ ] }, "lint.ignore": [ - "50a31e69784468ef68e4264c967939ee02a14500", + "c82f8027f690cb7184fd41053d3e02f972dcc80e", [] ], "loading": { @@ -381881,7 +381914,7 @@ [] ], "testharness.js": [ - "497ae23f0e83ee2790291588ebe33c47b7bb6726", + "bc7fb8961b9f46ae77033ddfa6b88c9fb465ac5a", [] ], "testharness.js.headers": [ @@ -382305,23 +382338,11 @@ [] ], "resources": { - "non-html.css": [ - "07f029442a7b3717923520ebedf016f51750a35c", - [] - ], - "non-html.js": [ - "b75d40dcdea74cda7450b1f71c148515cd6a2f33", - [] - ], - "non-html.json": [ + "application-json.json": [ "46fedf80eb61377e6fc4cd5d1c217fb409f95fdc", [] ], - "non-html.txt": [ - "785a4d56d6e11cde5f779889297f40e20395f1de", - [] - ], - "non-html.xml": [ + "application-xml.xml": [ "e938de2a824a782b2c6c84cfdae0157aec5de6f0", [] ], @@ -382329,6 +382350,22 @@ "43573692ea8e186278f51dc7a4f8204f549c997e", [] ], + "text-css.css": [ + "07f029442a7b3717923520ebedf016f51750a35c", + [] + ], + "text-html.html": [ + "c3d2d3a2f8b755a3365b7ebcc6b2a7a47055169f", + [] + ], + "text-javascript.js": [ + "b75d40dcdea74cda7450b1f71c148515cd6a2f33", + [] + ], + "text-plain.txt": [ + "b114445bac0d3dfba2fab732c39d768c4c9ba575", + [] + ], "util.js": [ "00e12929880c349ce3d8d52cb52e21b471465639", [] @@ -386346,7 +386383,7 @@ [] ], "soft-navigation-helper.js": [ - "685bc21f43c03482e9c0f8ac9a83137cc20df620", + "58ca9c22657b68c495f6c4662a1073352db6be32", [] ] } @@ -388007,6 +388044,10 @@ "use-keyframes-ref.html": [ "7d96781805f0d811fa82d43d3ae6393c7158dc76", [] + ], + "use-template-ref.html": [ + "1423c542b14fc05b950c4c6258cd5b05dc29c97b", + [] ] }, "scripted": { @@ -430849,7 +430890,7 @@ ] ], "inline-style-allowed-while-cloning-objects.sub.html": [ - "e99699410e00b5756a08dc7148e75388b40a3410", + "f702e6eb9d65fadfcb3ea9199146d835df036e04", [ null, {} @@ -436437,6 +436478,20 @@ {} ] ], + "inset-area-basic.html": [ + "dcb2c153308d80a35c5ac01345665b636297262f", + [ + null, + {} + ] + ], + "inset-area-computed-insets.tentative.html": [ + "4e35dd883a4d5453295196703360d780a2c8a340", + [ + null, + {} + ] + ], "inset-area-computed.html": [ "46e29fda3909888d91459b16030082873bc5fd6a", [ @@ -436458,6 +436513,13 @@ {} ] ], + "inset-area-wm-dir.html": [ + "3acec2b10d6c0f36b275279d83233344dd7ada9d", + [ + null, + {} + ] + ], "position-fallback-001.html": [ "d28c71ec6813000296012a4fcab8787dbb3e8f5d", [ @@ -441221,7 +441283,7 @@ ] ], "content-visibility-vs-scrollIntoView-003.html": [ - "685dba0b7b4387a797480e34a47a00a5279f116b", + "65e48663a917d029238feb767395c132ecf8a43d", [ null, {} @@ -451291,7 +451353,7 @@ }, "css-outline": { "outline-width-rounding.tentative.html": [ - "162d938cf9c488f3a2ddf1d0baafd0b5a20803b9", + "8a4a724bbe5b95989de2398385c6d3139043fe7f", [ null, {} @@ -469073,7 +469135,7 @@ ] ], "negativeMargins.html": [ - "0616e8b4999e73b5a43d46d7364a079607515f5b", + "0deb7ca623e9ba7ca06f46f8333bb3fc51fa912e", [ null, {} @@ -473503,6 +473565,15 @@ } ] ], + "resize-requires-user-gesture.https.html": [ + "f6c4aa4989cd783da3fadf1b11d29ad065c24fbc", + [ + null, + { + "testdriver": true + } + ] + ], "returns-window-with-document.https.html": [ "a1d7363e54bdc5fbc04a6ad6e0aad30b552ea8d7", [ @@ -514753,7 +514824,7 @@ ] ], "reporting-arguments.https.window.js": [ - "d652bf2835c973f867601fed7c1e0292a110e009", + "f26a969328ff0ccbd5a8b867147c36ea93e53c96", [ "fledge/tentative/reporting-arguments.https.window.html?1-5", { @@ -526376,7 +526447,7 @@ ] }, "close-method.window.js": [ - "0288f9cab8e1cc54eec5f51d295be771d566ff78", + "048c5f7236e9e9a29d2d0ff5e2fa9fa665a78d14", [ "html/browsers/the-window-object/close-method.window.html", {} @@ -526965,7 +527036,7 @@ ] ], "windowproxy-prototype-setting-goes-cross-origin-domain.sub.html": [ - "239fa6ddf2fc3a1c1dc2128f79de662da7c30257", + "c2a6def6c240b42a90a3fc35c4729dfd61ea9ffc", [ null, {} @@ -565530,7 +565601,7 @@ ] ], "invoketarget-on-audio-behavior.tentative.html": [ - "02f3ff6d0693614a2accabaa3fe39ca038f332e8", + "f3abeae165aa267114e1acb523ddc5bb0a2bd1a1", [ null, { @@ -565557,7 +565628,7 @@ ] ], "invoketarget-on-video-behavior.tentative.html": [ - "03312e3fc52cd2e45ad1286d54e849f4f4e43640", + "5bbcd83e72ef31a967f43833715906ef07c948c8", [ null, { @@ -574697,6 +574768,13 @@ {} ] ], + "setHTMLUnsafe-CEReactions.html": [ + "3aa14516f21fbce9b8135dd8519f8a5aa00c77fa", + [ + null, + {} + ] + ], "setHTMLUnsafe-xml.html": [ "d7211e97f1e2eaa25005cb3d7185fd459b5247a5", [ @@ -576423,6 +576501,15 @@ ] ] }, + "names.html": [ + "cd32fde5c70219216829b6c498599b173617d005", + [ + null, + { + "testdriver": true + } + ] + ], "roles-contextual.html": [ "98ad07cd95f2566963c55e1fa7360f30c48ca0be", [ @@ -576532,6 +576619,27 @@ {} ] ], + "http-redirecting-to-http-redirecting-to-http.https.sub.html": [ + "96892c95a90baedd7e46849774536effc2079783", + [ + null, + {} + ] + ], + "http-redirecting-to-http.https.sub.html": [ + "24d50a71bcd8a58d84383a1e5ce3f31d69f0d7f7", + [ + null, + {} + ] + ], + "http-redirecting-to-https.https.sub.html": [ + "13a7f1698f183d430c74c6ee309854d02ffeca8c", + [ + null, + {} + ] + ], "upgrade.https.sub.html": [ "71a1fe1dde618163c259d13eb14797c22785c247", [ @@ -577294,6 +577402,13 @@ null, {} ] + ], + "window-onload-test.html": [ + "b0514bce045aa8c864209ec8cc929646bb4e30b9", + [ + null, + {} + ] ] }, "server": { @@ -613741,7 +613856,7 @@ ] ], "non-html-documents.html": [ - "d86cf482ddc97b5d673679c6db5a0e8c26563597", + "5cec6aee3a2bd62723e2c345b8282b1e31cf6c86", [ null, { @@ -621462,7 +621577,7 @@ ] ], "multiple_nested_events.tentative.html": [ - "e51841865d654a65e44fefc505e8102196a4093c", + "196cfa06868ca9fd321db59755e1908a52c26c1e", [ null, { @@ -621480,7 +621595,7 @@ ] ], "navigation-api-after-transition-commit.tentative.html": [ - "ae17db7d59f4c5cf2bf01af2b7224fa6aa8232df", + "5c7d8f4f7a4fa4669ab42a18562bd1dceecc4c56", [ null, { @@ -621507,7 +621622,7 @@ ] ], "navigation-api-hash.tentative.html": [ - "e20578ea79ed7a6564a2d960cc1148b520c55ef2", + "a63b177a63f4974423954a720b77b3874139057d", [ null, { @@ -621516,7 +621631,7 @@ ] ], "navigation-api-preventDefault.tentative.html": [ - "b7b2a24c94203080d052411f080a0dd3c0d11cbe", + "d6c61efb3cbc3da1412748b9b2c8a50ab537be63", [ null, { @@ -621525,7 +621640,7 @@ ] ], "navigation-api-rejected.tentative.html": [ - "693f876b6e188b4c8ec8531aa7723c6afada70af", + "bcc0451d5bd80203092b6ed769d4ab2c9ccfff19", [ null, { @@ -621543,7 +621658,7 @@ ] ], "navigation-api-view-transition.tentative.html": [ - "4d88f3d0b7d9bee962f7b7e71c7695c421e7b560", + "2755f9f9ac75b980018f0ef78055c3f7874621b8", [ null, { @@ -621552,7 +621667,7 @@ ] ], "navigation-api.tentative.html": [ - "2d61736a486127cdfb37210906856cb4404a48d6", + "ca11f684f49908855323e8a337092f9dc971823b", [ null, { @@ -621561,7 +621676,7 @@ ] ], "popstate-multiple-backs.tentative.html": [ - "fd87f5f03e753b3ac5a8d8268a76496d93c15969", + "2a12a352bffc3fed4f207daaf877c781b0799ff3", [ null, { @@ -621570,7 +621685,7 @@ ] ], "popstate.tentative.html": [ - "f89991d76b044c5165c53b3b90b4620eb1e2d047", + "60a5ff72292c15abd281b1264e747a8f3c0d0d2b", [ null, { @@ -696681,7 +696796,7 @@ ] ], "pointer_mouse_multiclick.py": [ - "4f67f8fda9434a09ae05e0c28e015cd17b9c8236", + "87c29027b3aedc512cceb1897a3c1dcc11643b07", [ null, {} @@ -696746,7 +696861,7 @@ ] ], "sequence.py": [ - "55bc038a611b96b6db885ac811a8bb7db3661a09", + "603b29414153ff65aad67391c018439452c3a2e7", [ null, {} @@ -696897,7 +697012,7 @@ ] ], "remove_intercept.py": [ - "3f205c3821009aaa74d8ba8a3a958f2dc030bd8c", + "31b11153578b39c62e3735cb270373763009125b", [ null, { @@ -698698,7 +698813,7 @@ ] ], "pointer_tripleclick.py": [ - "eccfa672408ccb0c7c766ec3a63088ce6cde63a2", + "301b503ef9b6fa9b2571d614d3c94258bcedf05e", [ null, {} @@ -698800,7 +698915,7 @@ ] ], "sequence.py": [ - "78912d8b38904ba61a8450995b64358f8105e151", + "65ad39fcbf788f4d1f0a9a032f161f8dc74875d8", [ null, {
diff --git a/third_party/blink/web_tests/external/wpt/compute-pressure/compute_pressure_rate_obfuscation_mitigation_triggered.tentative.https.window.js b/third_party/blink/web_tests/external/wpt/compute-pressure/compute_pressure_rate_obfuscation_mitigation_triggered.tentative.https.window.js index f8ed3f2..c2c5cc9f 100644 --- a/third_party/blink/web_tests/external/wpt/compute-pressure/compute_pressure_rate_obfuscation_mitigation_triggered.tentative.https.window.js +++ b/third_party/blink/web_tests/external/wpt/compute-pressure/compute_pressure_rate_obfuscation_mitigation_triggered.tentative.https.window.js
@@ -6,15 +6,31 @@ 'use strict'; pressure_test(async (t, mockPressureService) => { - const sampleRateInHz = 10; + const sampleRateInHz = 25; const readings = ['nominal', 'fair', 'serious', 'critical']; // Normative values for rate obfuscation parameters. // https://w3c.github.io/compute-pressure/#rate-obfuscation-normative-parameters. const minPenaltyTimeInMs = 5000; const maxChangesThreshold = 100; - const changes = await new Promise(async resolve => { + const minChangesThreshold = 50; + await new Promise(async resolve => { const observerChanges = []; const observer = new PressureObserver(changes => { + if (observerChanges.length >= minChangesThreshold) { + // Add an assert to the maximum threshold possible. + t.step(() => { + assert_less_than_equal(observerChanges.length, maxChangesThreshold, + "Sample count reaching maxChangesThreshold."); + }); + + if (observerChanges.length > 0) { + const lastSample = observerChanges.at(-1); + if ((changes[0].time - lastSample[0].time) >= minPenaltyTimeInMs) { + observer.disconnect(); + resolve(); + } + } + } observerChanges.push(changes); }, {sampleRate: sampleRateInHz}); @@ -25,27 +41,12 @@ // pressureChanges.length, as system load and browser optimizations can // cause the actual timer used by mockPressureService to deliver readings // to be a bit slower or faster than requested. - while (observerChanges.length <= maxChangesThreshold) { + while (true) { mockPressureService.setPressureUpdate( 'cpu', readings[i++ % readings.length]); await t.step_wait( () => mockPressureService.updatesDelivered() >= i, `At least ${i} readings have been delivered`); } - observer.disconnect(); - resolve(observerChanges); }); - - assert_equals(changes.length, (maxChangesThreshold + 1)); - - let gotPenalty = false; - for (let i = 0; i < changes.length; i++) { - // Because penalty should be triggered once, one timestamp difference must - // at least bigger or equal to the minimum penalty time specified. - if ((changes[i + 1][0].time - changes[i][0].time) >= minPenaltyTimeInMs) { - gotPenalty = true; - break; - } - } - assert_true(gotPenalty); }, 'Rate obfuscation mitigation should have been triggered, when changes is higher than minimum changes before penalty');
diff --git a/third_party/blink/web_tests/external/wpt/content-security-policy/style-src/inline-style-allowed-while-cloning-objects.sub.html b/third_party/blink/web_tests/external/wpt/content-security-policy/style-src/inline-style-allowed-while-cloning-objects.sub.html index e996994..f702e6eb 100644 --- a/third_party/blink/web_tests/external/wpt/content-security-policy/style-src/inline-style-allowed-while-cloning-objects.sub.html +++ b/third_party/blink/web_tests/external/wpt/content-security-policy/style-src/inline-style-allowed-while-cloning-objects.sub.html
@@ -8,119 +8,108 @@ <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script> - setup({ explicit_done: true }); - var t = async_test("Test that violation report event was fired"); window.addEventListener("securitypolicyviolation", t.step_func_done(function(e) { assert_equals(e.violatedDirective, "style-src-attr"); })); window.onload = function() { - try { - runTests(); - } finally { - done(); - } + window.nodes = document.getElementById('nodes'); + window.node1 = document.getElementById('node1'); + window.node1.style.background = "yellow"; + window.node1.style.color = "red"; + window.node2 = document.getElementById('node1').cloneNode(true); + window.node2.id = "node2"; + window.node3 = document.getElementById('node3'); + window.node3.style.background = "blue"; + window.node3.style.color = "green"; + window.node4 = document.getElementById('node3').cloneNode(false); + window.node4.id = "node4"; + window.node4.innerHTML = "Node #4"; + nodes.appendChild(node1); + nodes.appendChild(node2); + nodes.appendChild(node3); + nodes.appendChild(node4); + test(function() { + assert_equals(node1.style.background.match(/yellow/)[0], "yellow") + }); + test(function() { + assert_equals(node2.style.background.match(/yellow/)[0], "yellow") + }); + test(function() { + assert_equals(node3.style.background.match(/blue/)[0], "blue") + }); + test(function() { + assert_equals(node4.style.background.match(/blue/)[0], "blue") + }); + test(function() { + assert_equals(node1.style.color, "red") + }); + test(function() { + assert_equals(node2.style.color, "red") + }); + test(function() { + assert_equals(node3.style.color, "green") + }); + test(function() { + assert_equals(node4.style.color, "green") + }); + test(function() { + assert_equals(window.getComputedStyle(node1).background, window.getComputedStyle(node2).background) + }); + test(function() { + assert_equals(window.getComputedStyle(node3).background, window.getComputedStyle(node4).background) + }); + test(function() { + assert_equals(window.getComputedStyle(node1).color, window.getComputedStyle(node2).color) + }); + test(function() { + assert_equals(window.getComputedStyle(node3).color, window.getComputedStyle(node4).color) + }); + window.ops = document.getElementById('ops'); + ops.style.color = 'red'; + window.clonedOps = ops.cloneNode(true); + window.violetOps = document.getElementById('violetOps'); + violetOps.style.background = 'rgb(238, 130, 238)'; + document.getElementsByTagName('body')[0].appendChild(clonedOps); + test(function() { + assert_equals(ops.style.background, "") + }); + test(function() { + assert_equals(ops.style.color, "red") + }); + test(function() { + assert_equals(clonedOps.style.background, "") + }); + test(function() { + assert_equals(violetOps.style.background.match(/rgb\(238, 130, 238\)/)[0], "rgb(238, 130, 238)") + }); + test(function() { + assert_equals(window.getComputedStyle(clonedOps).background, window.getComputedStyle(ops).background) + }); + test(function() { + assert_equals(window.getComputedStyle(clonedOps).color, window.getComputedStyle(ops).color) + }); + test(function() { + assert_equals(window.getComputedStyle(ops).background, window.getComputedStyle(violetOps).background) + }); + test(function() { + assert_equals(window.getComputedStyle(clonedOps).background, window.getComputedStyle(violetOps).background) + }); + test(function() { + assert_equals(ops.id, "ops") + }); + test(function() { + assert_equals(ops.id, clonedOps.id) + }); + test(function() { + let el = document.getElementById("svg"); + assert_equals(el.getAttribute("style"), ""); + el.style.background = violetOps.style.background; + assert_not_equals(el.style.background, ""); + let clone = el.cloneNode(true); + assert_equals(el.style.background, clone.style.background) + }, "non-HTML namespace"); }; - - function runTests() { - window.nodes = document.getElementById('nodes'); - window.node1 = document.getElementById('node1'); - window.node1.style.background = "yellow"; - window.node1.style.color = "red"; - window.node2 = document.getElementById('node1').cloneNode(true); - window.node2.id = "node2"; - window.node3 = document.getElementById('node3'); - window.node3.style.background = "blue"; - window.node3.style.color = "green"; - window.node4 = document.getElementById('node3').cloneNode(false); - window.node4.id = "node4"; - window.node4.innerHTML = "Node #4"; - nodes.appendChild(node1); - nodes.appendChild(node2); - nodes.appendChild(node3); - nodes.appendChild(node4); - test(function() { - assert_equals(node1.style.background.match(/yellow/)[0], "yellow") - }); - test(function() { - assert_equals(node2.style.background.match(/yellow/)[0], "yellow") - }); - test(function() { - assert_equals(node3.style.background.match(/blue/)[0], "blue") - }); - test(function() { - assert_equals(node4.style.background.match(/blue/)[0], "blue") - }); - test(function() { - assert_equals(node1.style.color, "red") - }); - test(function() { - assert_equals(node2.style.color, "red") - }); - test(function() { - assert_equals(node3.style.color, "green") - }); - test(function() { - assert_equals(node4.style.color, "green") - }); - test(function() { - assert_equals(window.getComputedStyle(node1).background, window.getComputedStyle(node2).background) - }); - test(function() { - assert_equals(window.getComputedStyle(node3).background, window.getComputedStyle(node4).background) - }); - test(function() { - assert_equals(window.getComputedStyle(node1).color, window.getComputedStyle(node2).color) - }); - test(function() { - assert_equals(window.getComputedStyle(node3).color, window.getComputedStyle(node4).color) - }); - window.ops = document.getElementById('ops'); - ops.style.color = 'red'; - window.clonedOps = ops.cloneNode(true); - window.violetOps = document.getElementById('violetOps'); - violetOps.style.background = 'rgb(238, 130, 238)'; - document.getElementsByTagName('body')[0].appendChild(clonedOps); - test(function() { - assert_equals(ops.style.background, "") - }); - test(function() { - assert_equals(ops.style.color, "red") - }); - test(function() { - assert_equals(clonedOps.style.background, "") - }); - test(function() { - assert_equals(violetOps.style.background.match(/rgb\(238, 130, 238\)/)[0], "rgb(238, 130, 238)") - }); - test(function() { - assert_equals(window.getComputedStyle(clonedOps).background, window.getComputedStyle(ops).background) - }); - test(function() { - assert_equals(window.getComputedStyle(clonedOps).color, window.getComputedStyle(ops).color) - }); - test(function() { - assert_equals(window.getComputedStyle(ops).background, window.getComputedStyle(violetOps).background) - }); - test(function() { - assert_equals(window.getComputedStyle(clonedOps).background, window.getComputedStyle(violetOps).background) - }); - test(function() { - assert_equals(ops.id, "ops") - }); - test(function() { - assert_equals(ops.id, clonedOps.id) - }); - test(function() { - let el = document.getElementById("svg"); - assert_equals(el.getAttribute("style"), ""); - el.style.background = violetOps.style.background; - assert_not_equals(el.style.background, ""); - let clone = el.cloneNode(true); - assert_equals(el.style.background, clone.style.background) - }, "non-HTML namespace"); - } - </script> </head>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-about-blank-ref.html b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-about-blank-ref.html new file mode 100644 index 0000000..79c882f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-about-blank-ref.html
@@ -0,0 +1,5 @@ +<!doctype html> +<title>CSS Test Reference</title> +<style>:root { color-scheme: dark }</style> +<p>Should not see a white frame below</p> +<iframe width="600" height="400" src="support/dark-frame-blank.html"></iframe>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-about-blank.tentative.html b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-about-blank.tentative.html new file mode 100644 index 0000000..a5a9843 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-about-blank.tentative.html
@@ -0,0 +1,13 @@ +<!doctype html> +<title>CSS Color Adjustment Test: about:blank doesn't cause a white backdrop in dark mode even though technically its color-scheme is mismatched</title> +<link rel="help" href="https://drafts.csswg.org/css-color-adjust/#color-scheme-effect"> +<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/9624"> +<link rel="match" href="color-scheme-iframe-background-about-blank-ref.html"> +<style> +:root { color-scheme: dark } +</style> +<p>Should not see a white frame below</p> +<iframe width="600" height="400"></iframe> +<script> + document.querySelector("iframe").contentWindow.stop(); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/support/dark-frame-blank.html b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/support/dark-frame-blank.html new file mode 100644 index 0000000..dd540f4 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color-adjust/rendering/dark-color-scheme/support/dark-frame-blank.html
@@ -0,0 +1,4 @@ +<!doctype html> +<style> + :root { color-scheme: dark } +</style>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-vs-scrollIntoView-003.html b/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-vs-scrollIntoView-003.html index 685dba0b..65e48663 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-vs-scrollIntoView-003.html +++ b/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-vs-scrollIntoView-003.html
@@ -50,10 +50,14 @@ </div> <script> -promise_test(t => new Promise(async (resolve, reject) => { - await new Promise((waited, _) => { - requestAnimationFrame(() => requestAnimationFrame(waited)); - }); +function tick() { + return new Promise(resolve => { + requestAnimationFrame(() => requestAnimationFrame(resolve)); + }); +} + +promise_test(async () => { + await tick(); function waitForEvent() { return new Promise(resolve => e3.addEventListener('contentvisibilityautostatechange', resolve)); @@ -73,9 +77,7 @@ target.scrollIntoView(); await waitForEvent(); await waitForEvent(); - requestAnimationFrame(() => requestAnimationFrame(() => { - assert_equals(eventCounter, 2, "There should be two contentvisibilityautostatechange events."); - resolve(); - })); -}), "ContentVisibilityAutoStateChange fires twice when `scrollIntoView` a descendant of `content-visibility:auto` which is hidden after scrolling"); + await tick(); + assert_equals(eventCounter, 2, "There should be two contentvisibilityautostatechange events."); +}, "ContentVisibilityAutoStateChange fires twice when `scrollIntoView` a descendant of `content-visibility:auto` which is hidden after scrolling"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/subgrid/grid-template-invalid-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-grid/subgrid/grid-template-invalid-expected.txt deleted file mode 100644 index b0625d0a..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-grid/subgrid/grid-template-invalid-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -This is a testharness.js-based test. -[FAIL] e.style['grid-template-rows'] = "subgrid repeat(auto-fit, [a])" should not set the property value - assert_equals: expected "" but got "subgrid repeat(auto-fit, [a])" -[FAIL] e.style['grid-template-columns'] = "subgrid repeat(auto-fit, [a])" should not set the property value - assert_equals: expected "" but got "subgrid repeat(auto-fit, [a])" -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/css/css-outline/outline-width-rounding.tentative.html b/third_party/blink/web_tests/external/wpt/css/css-outline/outline-width-rounding.tentative.html index 162d938..8a4a724b 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-outline/outline-width-rounding.tentative.html +++ b/third_party/blink/web_tests/external/wpt/css/css-outline/outline-width-rounding.tentative.html
@@ -16,8 +16,8 @@ <body> <h1> Test passes if outline widths are rounded up - when they are greater than 0 and less than 1, - and rounded down when they are greater than 1. + when they are greater than 0px and less than 1px, + and rounded down when they are greater than 1px. </h1> <script> @@ -32,7 +32,8 @@ { input: "1.5px", expected: "1px" }, { input: "2px", expected: "2px" }, { input: "2.75px", expected: "2px" }, - { input: "2.999px", expected: "2px" }, + { input: "2.99px", expected: "2px" }, + { input: "3px", expected: "3px" }, ]; for (const value of values) { @@ -41,13 +42,13 @@ document.body.appendChild(div); } - test(function() { - var targets = document.querySelectorAll("div"); + var targets = document.querySelectorAll("div"); - for (var i=0; i < targets.length; ++i) { + for (var i=0; i < targets.length; ++i) { + test(() => { assert_equals(getComputedStyle(targets[i]).outlineWidth, values[i].expected); - } - }, "Test that outline widths are rounded up when they are greater than 0px but less than 1px, and rounded down when they are greater than 1px."); + }, values[i].input); + } </script> </body> </html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-tables/html5-table-formatting-3-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-tables/html5-table-formatting-3-expected.txt new file mode 100644 index 0000000..542f2b7 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-tables/html5-table-formatting-3-expected.txt
@@ -0,0 +1,9 @@ +This is a testharness.js-based test. +[FAIL] Explicitely-defined consecutive columns spanned by the same set of cells are not merged + assert_equals: expected 75 but got 50 +[FAIL] Explicitely-defined consecutive columns spanned by the same set of cells are not merged, and cells span across border-spacing + assert_equals: expected 12.5 but got 50 +[FAIL] Explicitely-defined consecutive rows spanned by the same set of cells are not merged, and cells span across border-spacing + assert_equals: expected 12.5 but got 0 +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/transform-box/svgbox-stroke-box-003.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/transform-box/svgbox-stroke-box-003.html new file mode 100644 index 0000000..f132eb41 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/transform-box/svgbox-stroke-box-003.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<title>transform-box: stroke-box, stroke with vector-effect: non-scaling-stroke</title> +<link rel="author" title="Jonathan Watt" href="mailto:jwatt@jwatt.org"> +<link rel="match" href="reference/svgbox-rect-ref.html"> +<link rel="help" href="https://drafts.csswg.org/css-transforms-1/#transform-box"> +<link rel="help" href="https://svgwg.org/svg2-draft/coords.html#VectorEffects"> +<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/9640"> +<meta name="assert" content="The used value of transform-box is fill-box on SVG with non-scaling-stroke"/> +<style> +#target { + fill: green; + stroke: black; + stroke-width: 20; + vector-effect: non-scaling-stroke; + transform-box: stroke-box; + transform: scale(0.5) translateY(-100%); +} +</style> +<svg width="400" height="300"> + <rect id="target" width="100" height="200" x="50" y="180"/> +</svg>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/transform-box/svgbox-stroke-box-004.html b/third_party/blink/web_tests/external/wpt/css/css-transforms/transform-box/svgbox-stroke-box-004.html new file mode 100644 index 0000000..0046295c --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/transform-box/svgbox-stroke-box-004.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<title>transform-box: border-box, stroke with vector-effect: non-scaling-stroke</title> +<link rel="author" title="Jonathan Watt" href="mailto:jwatt@jwatt.org"> +<link rel="match" href="reference/svgbox-rect-ref.html"> +<link rel="help" href="https://drafts.csswg.org/css-transforms-1/#transform-box"> +<link rel="help" href="https://svgwg.org/svg2-draft/coords.html#VectorEffects"> +<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/9640"> +<meta name="assert" content="The used value of transform-box is fill-box on SVG with non-scaling-stroke"/> +<style> +#target { + fill: green; + stroke: black; + stroke-width: 20; + vector-effect: non-scaling-stroke; + transform-box: border-box; + transform: scale(0.5) translateY(-100%); +} +</style> +<svg width="400" height="300"> + <rect id="target" width="100" height="200" x="50" y="180"/> +</svg>
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom-view/negativeMargins.html b/third_party/blink/web_tests/external/wpt/css/cssom-view/negativeMargins.html index 0616e8b49..0deb7ca 100644 --- a/third_party/blink/web_tests/external/wpt/css/cssom-view/negativeMargins.html +++ b/third_party/blink/web_tests/external/wpt/css/cssom-view/negativeMargins.html
@@ -9,7 +9,6 @@ Hello </div> <script> - setup({explicit_done:true}); window.onload = function () { var outer = document.getElementById('outer'); var inner = document.getElementById('inner'); @@ -26,7 +25,6 @@ [inner, outer, document.body, document.querySelector('html')], "elementsFromPoint should get sequence [inner, outer, body, html]"); }); - done(); }; </script> </body>
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom/CSSGroupingRule-insertRule-expected.txt b/third_party/blink/web_tests/external/wpt/css/cssom/CSSGroupingRule-insertRule-expected.txt deleted file mode 100644 index 740b569..0000000 --- a/third_party/blink/web_tests/external/wpt/css/cssom/CSSGroupingRule-insertRule-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -This is a testharness.js-based test. -[FAIL] index not specified - Failed to execute 'insertRule' on 'CSSGroupingRule': 2 arguments required, but only 1 present. -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/css/cssom/idlharness-expected.txt b/third_party/blink/web_tests/external/wpt/css/cssom/idlharness-expected.txt index 924ce4f2..d532d148 100644 --- a/third_party/blink/web_tests/external/wpt/css/cssom/idlharness-expected.txt +++ b/third_party/blink/web_tests/external/wpt/css/cssom/idlharness-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 58 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 57 FAIL, 0 TIMEOUT, 0 NOTRUN. [FAIL] CSSRule interface: constant MARGIN_RULE on interface object assert_own_property: expected property "MARGIN_RULE" missing [FAIL] CSSRule interface: constant MARGIN_RULE on interface prototype object @@ -16,8 +16,6 @@ assert_equals: expected "string" but got "object" [FAIL] CSSRule interface: sheet.cssRules[0] must inherit property "MARGIN_RULE" with the proper type assert_inherits: property "MARGIN_RULE" not found in prototype chain -[FAIL] CSSGroupingRule interface: operation insertRule(CSSOMString, optional unsigned long) - assert_equals: property has wrong .length expected 1 but got 2 [FAIL] CSSPageRule interface: existence and properties of interface object assert_equals: prototype of CSSPageRule is not CSSGroupingRule expected function "function CSSGroupingRule() { [native code] }" but got function "function CSSRule() { [native code] }" [FAIL] CSSPageRule interface: existence and properties of interface prototype object
diff --git a/third_party/blink/web_tests/external/wpt/editing/run/forwarddelete_6001-7000-expected.txt b/third_party/blink/web_tests/external/wpt/editing/run/forwarddelete_6001-7000-expected.txt index bb8ed71..34a56ec 100644 --- a/third_party/blink/web_tests/external/wpt/editing/run/forwarddelete_6001-7000-expected.txt +++ b/third_party/blink/web_tests/external/wpt/editing/run/forwarddelete_6001-7000-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 37 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 36 FAIL, 0 TIMEOUT, 0 NOTRUN. [FAIL] [["forwarddelete",""]] "<ol><li>foo[<li>]bar</ol>" compare innerHTML assert_equals: Unexpected innerHTML (after normalizing inline style) expected "<ol><li>foobar</li></ol>" but got "<ol><li>foo</li><li>bar</li></ol>" [FAIL] [["forwarddelete",""]] "<ol><li>foo</ol>{}<br><ol><li>bar</ol>" compare innerHTML @@ -60,8 +60,6 @@ assert_equals: Unexpected innerHTML (after normalizing inline style) expected "<div><br></div>" but got "<br>" [FAIL] [["forwarddelete",""]] "foo[]<img contenteditable=false src=/img/lion.svg>bar" compare innerHTML assert_equals: Unexpected innerHTML (after normalizing inline style) expected "foobar" but got "foo<img contenteditable=\\"false\\" src=\\"/img/lion.svg\\">bar" -[FAIL] [["forwarddelete",""]] "foo<span>bar[]<span contenteditable=false>baz</span></span>qux" compare innerHTML - assert_equals: Unexpected innerHTML (after normalizing inline style) expected "foo<span>bar</span>qux" but got "foo<span>bar</span>ux" [FAIL] [["forwarddelete",""]] "<div><div>{}<br></div></div>" compare innerHTML assert_in_array: Unexpected innerHTML (after normalizing inline style) value "<div><div><br></div></div>" not in array ["", "<br>"] [FAIL] [["forwarddelete",""]] "<div><div contenteditable=false><div contenteditable><div>{}<br></div></div></div></div>" compare innerHTML
diff --git a/third_party/blink/web_tests/external/wpt/encrypted-media/idlharness.https-expected.txt b/third_party/blink/web_tests/external/wpt/encrypted-media/idlharness.https-expected.txt new file mode 100644 index 0000000..25f7c78 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/encrypted-media/idlharness.https-expected.txt
@@ -0,0 +1,6 @@ +This is a testharness.js-based test. +Found 1 FAIL, 0 TIMEOUT, 0 NOTRUN. +[FAIL] MediaKeys interface: operation getStatusForPolicy(optional MediaKeysPolicy) + assert_equals: property has wrong .length expected 0 but got 1 +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/fledge/tentative/reporting-arguments.https.window.js b/third_party/blink/web_tests/external/wpt/fledge/tentative/reporting-arguments.https.window.js index d652bf2..f26a969 100644 --- a/third_party/blink/web_tests/external/wpt/fledge/tentative/reporting-arguments.https.window.js +++ b/third_party/blink/web_tests/external/wpt/fledge/tentative/reporting-arguments.https.window.js
@@ -259,7 +259,7 @@ // reportResultSuccessCondition: `browserSignals.interestGroupName === undefined`, // reportWinSuccessCondition: - `browserSignals.interestGroupName === "default name"` + `browserSignals.interestGroupName === ''` ); }, 'browserSignals.interestGroupName test.');
diff --git a/third_party/blink/web_tests/external/wpt/html-aam/names-expected.txt b/third_party/blink/web_tests/external/wpt/html-aam/names-expected.txt new file mode 100644 index 0000000..086bb96 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html-aam/names-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +Harness Error. harness_status.status = 1 , harness_status.message = Uncaught ReferenceError: AriaUtils is not defined +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html-aam/names.html b/third_party/blink/web_tests/external/wpt/html-aam/names.html new file mode 100644 index 0000000..cd32fde5 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html-aam/names.html
@@ -0,0 +1,260 @@ +<!doctype html> +<html> +<head> + <title>HTML-AAM Element Accessible Name From Author Tests</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/resources/testdriver.js"></script> + <script src="/resources/testdriver-vendor.js"></script> + <script src="/resources/testdriver-actions.js"></script> + <script src="/wai-aria/scripts/aria-utils.js"></script> +</head> +<body> + + +<p>Tests the accName for elements defined in <a href="https://w3c.github.io/html-aam/#accessible-name-and-description-computation">HTML-AAM: Accessible Name Computations By HTML Element</a>. + These tests are meant to show whether an element returns a name per the naming mechanism used. See <a href="https://wpt.fyi/results/accname">wpt: accname</a> for expanded accName testing.</p> + + +<!-- +The following elements are those which can be named by authors. They do not receive their name from elements for which they are an accessibility ancestor. + +There are other elements which can be named by author, but have additional ways in which they can be named. These elements will be tested separately. +--> + + +<h2>address element</h2> +<address data-testname="address no name" data-expectedlabel="" class="ex">x</address> + +<address data-testname="address aria-label" aria-label="label" data-expectedlabel="label" class="ex">x</address> +<address data-testname="address aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex">x</address> +<address data-testname="address title" title="title" data-expectedlabel="title" class="ex">x</address> + +<address data-testname="address aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex">x</address> +<address data-testname="address aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex">x</address> + +<address data-testname="address aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex">x</address> +<address data-testname="address aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex">x</address> + + + +<h2>aside element</h2> +<aside data-testname="aside no name" data-expectedlabel="" class="ex">x</aside> + +<aside data-testname="aside aria-label" aria-label="label" data-expectedlabel="label" class="ex">x</aside> +<aside data-testname="aside aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex">x</aside> +<aside data-testname="aside title" title="title" data-expectedlabel="title" class="ex">x</aside> + +<aside data-testname="aside aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex">x</aside> +<aside data-testname="aside aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex">x</aside> + +<aside data-testname="aside aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex">x</aside> +<aside data-testname="aside aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex">x</aside> + + +<h2>blockquote element</h2> +<blockquote data-testname="blockquote no name" data-expectedlabel="" class="ex">x</blockquote> + +<blockquote data-testname="blockquote aria-label" aria-label="label" data-expectedlabel="label" class="ex">x</blockquote> +<blockquote data-testname="blockquote aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex">x</blockquote> +<blockquote data-testname="blockquote title" title="title" data-expectedlabel="title" class="ex">x</blockquote> + +<blockquote data-testname="blockquote aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex">x</blockquote> +<blockquote data-testname="blockquote aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex">x</blockquote> + +<blockquote data-testname="blockquote aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex">x</blockquote> +<blockquote data-testname="blockquote aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex">x</blockquote> + + + +<h2>details element</h2> +<details data-testname="details no name" data-expectedlabel="" class="ex"><summary>x</summary></details> + +<details data-testname="details aria-label" aria-label="label" data-expectedlabel="label" class="ex"><summary>x</summary></details> +<details data-testname="details aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex"><summary>x</summary></details> +<details data-testname="details title" title="title" data-expectedlabel="title" class="ex"><summary>x</summary></details> + +<details data-testname="details aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex"><summary>x</summary></details> +<details data-testname="details aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex"><summary>x</summary></details> + +<details data-testname="details aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex"><summary>x</summary></details> +<details data-testname="details aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex"><summary>x</summary></details> + + +<h2>figure element</h2> +<figure data-testname="figure no name" data-expectedlabel="" class="ex">x</figure> + +<figure data-testname="figure aria-label" aria-label="label" data-expectedlabel="label" class="ex">x</figure> +<figure data-testname="figure aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex">x</figure> +<figure data-testname="figure title" title="title" data-expectedlabel="title" class="ex">x</figure> + +<figure data-testname="figure aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex">x</figure> +<figure data-testname="figure aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex">x</figure> + +<figure data-testname="figure aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex">x</figure> +<figure data-testname="figure aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex">x</figure> + + +<h2>footer element</h2> +<footer data-testname="footer no name" data-expectedlabel="" class="ex">x</footer> + +<footer data-testname="footer aria-label" aria-label="label" data-expectedlabel="label" class="ex">x</footer> +<footer data-testname="footer aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex">x</footer> +<footer data-testname="footer title" title="title" data-expectedlabel="title" class="ex">x</footer> + +<footer data-testname="footer aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex">x</footer> +<footer data-testname="footer aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex">x</footer> + +<footer data-testname="footer aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex">x</footer> +<footer data-testname="footer aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex">x</footer> + + +<h2>form element</h2> +<form data-testname="form no name" data-expectedlabel="" class="ex">x</form> + +<form data-testname="form aria-label" aria-label="label" data-expectedlabel="label" class="ex">x</form> +<form data-testname="form aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex">x</form> +<form data-testname="form title" title="title" data-expectedlabel="title" class="ex">x</form> + +<form data-testname="form aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex">x</form> +<form data-testname="form aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex">x</form> + +<form data-testname="form aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex">x</form> +<form data-testname="form aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex">x</form> + + +<h2>hgroup element</h2> +<hgroup data-testname="hgroup no name" data-expectedlabel="" class="ex"><h3>x</h3><p>y</p></hgroup> + +<hgroup data-testname="hgroup aria-label" aria-label="label" data-expectedlabel="label" class="ex"><h3>x</h3><p>y</p></hgroup> +<hgroup data-testname="hgroup aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex"><h3>x</h3><p>y</p></hgroup> +<hgroup data-testname="hgroup title" title="title" data-expectedlabel="title" class="ex"><h3>x</h3><p>y</p></hgroup> + +<hgroup data-testname="hgroup aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex"><h3>x</h3><p>y</p></hgroup> +<hgroup data-testname="hgroup aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex"><h3>x</h3><p>y</p></hgroup> + +<hgroup data-testname="hgroup aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex"><h3>x</h3><p>y</p></hgroup> +<hgroup data-testname="hgroup aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex"><h3>x</h3><p>y</p></hgroup> + + +<h2>hr element</h2> +<hr data-testname="hr no name" data-expectedlabel="" class="ex"> + +<hr data-testname="hr aria-label" aria-label="label" data-expectedlabel="label" class="ex"> +<hr data-testname="hr aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex"> +<hr data-testname="hr title" title="title" data-expectedlabel="title" class="ex"> + +<hr data-testname="hr aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex"> +<hr data-testname="hr aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex"> + +<hr data-testname="hr aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex"> +<hr data-testname="hr aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex"> + + +<h2>ol element</h2> +<ol data-testname="ol no name" data-expectedlabel="" class="ex"><li>x</li></ol> + +<ol data-testname="ol aria-label" aria-label="label" data-expectedlabel="label" class="ex"><li>x</li></ol> +<ol data-testname="ol aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex"><li>x</li></ol> +<ol data-testname="ol title" title="title" data-expectedlabel="title" class="ex"><li>x</li></ol> + +<ol data-testname="ol aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex"><li>x</li></ol> +<ol data-testname="ol aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex"><li>x</li></ol> + +<ol data-testname="ol aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex"><li>x</li></ol> +<ol data-testname="ol aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex"><li>x</li></ol> + + +<h2>main element</h2> +<main data-testname="main no name" data-expectedlabel="" class="ex">x</main> + +<main data-testname="main aria-label" aria-label="label" data-expectedlabel="label" class="ex">x</main> +<main data-testname="main aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex">x</main> +<main data-testname="main title" title="title" data-expectedlabel="title" class="ex">x</main> + +<main data-testname="main aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex">x</main> +<main data-testname="main aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex">x</main> + +<main data-testname="main aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex">x</main> +<main data-testname="main aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex">x</main> + + +<h2>menu element</h2> +<menu data-testname="menu no name" data-expectedlabel="" class="ex"><li>x</li></menu> + +<menu data-testname="menu aria-label" aria-label="label" data-expectedlabel="label" class="ex"><li>x</li></menu> +<menu data-testname="menu aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex"><li>x</li></menu> +<menu data-testname="menu title" title="title" data-expectedlabel="title" class="ex"><li>x</li></menu> + +<menu data-testname="menu aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex"><li>x</li></menu> +<menu data-testname="menu aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex"><li>x</li></menu> + +<menu data-testname="menu aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex"><li>x</li></menu> +<menu data-testname="menu aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex"><li>x</li></menu> + + +<h2>nav element</h2> +<nav data-testname="nav no name" data-expectedlabel="" class="ex">x</nav> + +<nav data-testname="nav aria-label" aria-label="label" data-expectedlabel="label" class="ex">x</nav> +<nav data-testname="nav aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex">x</nav> +<nav data-testname="nav title" title="title" data-expectedlabel="title" class="ex">x</nav> + +<nav data-testname="nav aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex">x</nav> +<nav data-testname="nav aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex">x</nav> + +<nav data-testname="nav aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex">x</nav> +<nav data-testname="nav aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex">x</nav> + + +<h2>search element</h2> +<search data-testname="search no name" data-expectedlabel="" class="ex">x</search> + +<search data-testname="search aria-label" aria-label="label" data-expectedlabel="label" class="ex">x</search> +<search data-testname="search aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex">x</search> +<search data-testname="search title" title="title" data-expectedlabel="title" class="ex">x</search> + +<search data-testname="search aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex">x</search> +<search data-testname="search aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex">x</search> + +<search data-testname="search aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex">x</search> +<search data-testname="search aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex">x</search> + + +<h2>section element</h2> +<section data-testname="section no name" data-expectedlabel="" class="ex">x</section> + +<section data-testname="section aria-label" aria-label="label" data-expectedlabel="label" class="ex">x</section> +<section data-testname="section aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex">x</section> +<section data-testname="section title" title="title" data-expectedlabel="title" class="ex">x</section> + +<section data-testname="section aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex">x</section> +<section data-testname="section aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex">x</section> + +<section data-testname="section aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex">x</section> +<section data-testname="section aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex">x</section> + + +<h2>ul element</h2> +<ul data-testname="ul no name" data-expectedlabel="" class="ex"><li>x</li></ul> + +<ul data-testname="ul aria-label" aria-label="label" data-expectedlabel="label" class="ex"><li>x</li></ul> +<ul data-testname="ul aria-labelledby" aria-labelledby="labelledby" data-expectedlabel="labelledby" class="ex"><li>x</li></ul> +<ul data-testname="ul title" title="title" data-expectedlabel="title" class="ex"><li>x</li></ul> + +<ul data-testname="ul aria-labelledby vs aria-label vs title" aria-labelledby="labelledby" aria-label="label" title="title" data-expectedlabel="labelledby" class="ex"><li>x</li></ul> +<ul data-testname="ul aria-labelledby vs aria-label" aria-labelledby="labelledby" aria-label="label" data-expectedlabel="labelledby" class="ex"><li>x</li></ul> + +<ul data-testname="ul aria-labelledby vs title" aria-labelledby="labelledby" title="title" data-expectedlabel="labelledby" class="ex"><li>x</li></ul> +<ul data-testname="ul aria-label vs title" aria-label="label" title="title" data-expectedlabel="label" class="ex"><li>x</li></ul> + + +<!-- element to reference for aria-labelledby tests --> +<div id="labelledby">labelledby</div> + +<script> +AriaUtils.verifyLabelsBySelector(".ex"); +</script> + +</body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/unloading-documents/002-expected.txt b/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/unloading-documents/002-expected.txt deleted file mode 100644 index 4c48f02..0000000 --- a/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/unloading-documents/002-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -This is a testharness.js-based test. -[FAIL] document.open in unload - assert_equals: expected "0123456789Z" but got "016789Z" -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/unloading-documents/support/002-1.html b/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/unloading-documents/support/002-1.html index 0e6f7d96..017fbb96 100644 --- a/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/unloading-documents/support/002-1.html +++ b/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/unloading-documents/support/002-1.html
@@ -5,7 +5,11 @@ var do_test = t.step_func(function() { localStorage.test6564729 += '1'; var d = document; - var e = document.open(); // unload triggered here - beforeunload 2, 3 in 002b; pagehide 4, unload 5, pagehide 6 in 002b, unload 7 in 002b + // This document's unload not triggered here because `document.open` erases + // all of the document's handlers. However the iframe's event handlers (002b) + // will fire. The `beforeunload` event handler will not fire because this is + // not a navigation resulting from a user interaction. + var e = document.open(); localStorage.test6564729 += (e == d) ? '8' : 'X'; var s = 'FAIL if you see this | ' + localStorage.test6564729; document.write(s);
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/unloading-documents/support/002a.html b/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/unloading-documents/support/002a.html index d11f670..51ff3e37 100644 --- a/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/unloading-documents/support/002a.html +++ b/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/unloading-documents/support/002a.html
@@ -1,7 +1,7 @@ <!DOCTYPE HTML> <script> opener.t.step(function() { - opener.assert_equals(localStorage.test6564729, '0123456789Z'); + opener.assert_equals(localStorage.test6564729, '016789Z'); opener.t.done(); }); </script>
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html b/third_party/blink/web_tests/external/wpt/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html index 239fa6d..c2a6def 100644 --- a/third_party/blink/web_tests/external/wpt/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html +++ b/third_party/blink/web_tests/external/wpt/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html
@@ -12,8 +12,6 @@ <script> "use strict"; -setup({ explicit_done: true }); - window.onload = () => { const target = frames[0]; const origProto = Object.getPrototypeOf(target); @@ -33,7 +31,5 @@ testSettingImmutablePrototypeToNewValueOnly( "Became cross-origin via document.domain", target, origProto, "the original value from before going cross-origin", { isSameOriginDomain: false }); - - done(); }; </script>
diff --git a/third_party/blink/web_tests/external/wpt/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window-expected.txt b/third_party/blink/web_tests/external/wpt/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window-expected.txt index be14124..3be195d 100644 --- a/third_party/blink/web_tests/external/wpt/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window-expected.txt +++ b/third_party/blink/web_tests/external/wpt/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window-expected.txt
@@ -1,11 +1,11 @@ This is a testharness.js-based test. [FAIL] web API-created DOMException (structuredClone()) - assert_equals: expected (string) "Error: Failed to execute 'createElement' on 'Document': The tag name provided ('') is not a valid name.\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:33:14\\n at Test.<anonymous> (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:41:19)\\n at Test.step (http://web-platform.test:8001/resources/testharness.js:2599:25)\\n at test (http://web-platform.test:8001/resources/testharness.js:628:30)\\n at stackTests (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:40:3)\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:31:1" but got (undefined) undefined + assert_equals: expected (string) "Error: Failed to execute 'createElement' on 'Document': The tag name provided ('') is not a valid name.\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:33:14\\n at Test.<anonymous> (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:41:19)\\n at Test.step (http://web-platform.test:8001/resources/testharness.js:2604:25)\\n at test (http://web-platform.test:8001/resources/testharness.js:633:30)\\n at stackTests (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:40:3)\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:31:1" but got (undefined) undefined [FAIL] web API-created DOMException (worker) - assert_equals: expected (string) "Error: Failed to execute 'createElement' on 'Document': The tag name provided ('') is not a valid name.\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:33:14\\n at Test.<anonymous> (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:53:19)\\n at Test.step (http://web-platform.test:8001/resources/testharness.js:2599:25)\\n at async_test (http://web-platform.test:8001/resources/testharness.js:676:34)\\n at stackTests (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:52:3)\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:31:1" but got (undefined) undefined + assert_equals: expected (string) "Error: Failed to execute 'createElement' on 'Document': The tag name provided ('') is not a valid name.\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:33:14\\n at Test.<anonymous> (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:53:19)\\n at Test.step (http://web-platform.test:8001/resources/testharness.js:2604:25)\\n at async_test (http://web-platform.test:8001/resources/testharness.js:681:34)\\n at stackTests (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:52:3)\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:31:1" but got (undefined) undefined [FAIL] web API-created DOMException (cross-site iframe) - assert_equals: expected (string) "Error: Failed to execute 'createElement' on 'Document': The tag name provided ('') is not a valid name.\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:33:14\\n at iframeTest (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:72:19)\\n at Test.<anonymous> (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:99:5)\\n at Test.step (http://web-platform.test:8001/resources/testharness.js:2599:25)\\n at async_test (http://web-platform.test:8001/resources/testharness.js:676:34)\\n at stackTests (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:96:3)\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:31:1" but got (undefined) undefined + assert_equals: expected (string) "Error: Failed to execute 'createElement' on 'Document': The tag name provided ('') is not a valid name.\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:33:14\\n at iframeTest (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:72:19)\\n at Test.<anonymous> (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:99:5)\\n at Test.step (http://web-platform.test:8001/resources/testharness.js:2604:25)\\n at async_test (http://web-platform.test:8001/resources/testharness.js:681:34)\\n at stackTests (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:96:3)\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:31:1" but got (undefined) undefined [FAIL] web API-created DOMException (same-origin iframe) - assert_equals: expected (string) "Error: Failed to execute 'createElement' on 'Document': The tag name provided ('') is not a valid name.\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:33:14\\n at iframeTest (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:72:19)\\n at Test.<anonymous> (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:104:5)\\n at Test.step (http://web-platform.test:8001/resources/testharness.js:2599:25)\\n at async_test (http://web-platform.test:8001/resources/testharness.js:676:34)\\n at stackTests (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:102:3)\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:31:1" but got (undefined) undefined + assert_equals: expected (string) "Error: Failed to execute 'createElement' on 'Document': The tag name provided ('') is not a valid name.\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:33:14\\n at iframeTest (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:72:19)\\n at Test.<anonymous> (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:104:5)\\n at Test.step (http://web-platform.test:8001/resources/testharness.js:2604:25)\\n at async_test (http://web-platform.test:8001/resources/testharness.js:681:34)\\n at stackTests (http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:102:3)\\n at http://web-platform.test:8001/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js:31:1" but got (undefined) undefined Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/linux-chrome/external/wpt/html/semantics/interactive-elements/the-dialog-element/focus-previous-iframe.tentative-expected.txt b/third_party/blink/web_tests/external/wpt/html/semantics/interactive-elements/the-dialog-element/focus-previous-iframe.tentative-expected.txt similarity index 99% rename from third_party/blink/web_tests/platform/linux-chrome/external/wpt/html/semantics/interactive-elements/the-dialog-element/focus-previous-iframe.tentative-expected.txt rename to third_party/blink/web_tests/external/wpt/html/semantics/interactive-elements/the-dialog-element/focus-previous-iframe.tentative-expected.txt index 0750f72..4611bd8 100644 --- a/third_party/blink/web_tests/platform/linux-chrome/external/wpt/html/semantics/interactive-elements/the-dialog-element/focus-previous-iframe.tentative-expected.txt +++ b/third_party/blink/web_tests/external/wpt/html/semantics/interactive-elements/the-dialog-element/focus-previous-iframe.tentative-expected.txt
@@ -1,3 +1,4 @@ This is a testharness.js-based test. Harness Error. harness_status.status = 1 , harness_status.message = Uncaught Error: assert_equals: expected Element node <input></input> but got Element node <iframe srcdoc="<input><dialog> Dialog in child </dialog>... Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/invokers/invoketarget-on-audio-behavior.tentative.html b/third_party/blink/web_tests/external/wpt/html/semantics/invokers/invoketarget-on-audio-behavior.tentative.html index 02f3ff6d0..f3abeae1 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/invokers/invoketarget-on-audio-behavior.tentative.html +++ b/third_party/blink/web_tests/external/wpt/html/semantics/invokers/invoketarget-on-audio-behavior.tentative.html
@@ -238,13 +238,13 @@ invokee.muted = false; }); assert_false(invokee.muted); - invokerbutton.setAttribute("invokeaction", "mute"); + invokerbutton.setAttribute("invokeaction", "toggleMuted"); await clickOn(invokerbutton); await new Promise(resolve => { requestAnimationFrame(resolve); }); assert_true(invokee.muted); - }, "invoking audio with mute action mutes it"); + }, "invoking audio with toggleMuted action mutes it"); promise_test(async function (t) { t.add_cleanup(async () => { @@ -257,13 +257,13 @@ once: true, }); assert_false(invokee.muted); - invokerbutton.setAttribute("invokeaction", "mute"); + invokerbutton.setAttribute("invokeaction", "toggleMuted"); await clickOn(invokerbutton); await new Promise(resolve => { requestAnimationFrame(resolve); }); assert_false(invokee.muted); - }, "invoking audio with mute action and preventDefault is a no-op"); + }, "invoking audio with toggleMuted action and preventDefault is a no-op"); promise_test(async function (t) { t.add_cleanup(async () => { @@ -274,12 +274,12 @@ }); invokee.muted = true; assert_true(invokee.muted); - invokerbutton.setAttribute("invokeaction", "mute"); + invokerbutton.setAttribute("invokeaction", "toggleMuted"); await clickOn(invokerbutton); await new Promise(resolve => { requestAnimationFrame(resolve); }); assert_false(invokee.muted); - }, "invoking muted audio with mute action unmutes it"); + }, "invoking muted audio with toggleMuted action unmutes it"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/invokers/invoketarget-on-video-behavior.tentative.html b/third_party/blink/web_tests/external/wpt/html/semantics/invokers/invoketarget-on-video-behavior.tentative.html index 03312e3..5bbcd83e 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/invokers/invoketarget-on-video-behavior.tentative.html +++ b/third_party/blink/web_tests/external/wpt/html/semantics/invokers/invoketarget-on-video-behavior.tentative.html
@@ -206,13 +206,13 @@ invokee.muted = false; }); assert_false(invokee.muted); - invokerbutton.setAttribute("invokeaction", "mute"); + invokerbutton.setAttribute("invokeaction", "toggleMuted"); await clickOn(invokerbutton); await new Promise(resolve => { requestAnimationFrame(resolve); }); assert_true(invokee.muted); - }, "invoking video with mute action mutes it"); + }, "invoking video with toggleMuted action mutes it"); promise_test(async function (t) { t.add_cleanup(async () => { @@ -225,13 +225,13 @@ once: true, }); assert_false(invokee.muted); - invokerbutton.setAttribute("invokeaction", "mute"); + invokerbutton.setAttribute("invokeaction", "toggleMuted"); await clickOn(invokerbutton); await new Promise(resolve => { requestAnimationFrame(resolve); }); assert_false(invokee.muted); - }, "invoking video with mute action and preventDefault is a no-op"); + }, "invoking video with toggleMuted action and preventDefault is a no-op"); promise_test(async function (t) { t.add_cleanup(async () => { @@ -242,12 +242,12 @@ }); invokee.muted = true; assert_true(invokee.muted); - invokerbutton.setAttribute("invokeaction", "mute"); + invokerbutton.setAttribute("invokeaction", "toggleMuted"); await clickOn(invokerbutton); await new Promise(resolve => { requestAnimationFrame(resolve); }); assert_false(invokee.muted); - }, "invoking muted video with mute action unmutes it"); + }, "invoking muted video with toggleMuted action unmutes it"); </script>
diff --git a/third_party/blink/web_tests/external/wpt/html/webappapis/dynamic-markup-insertion/html-unsafe-methods/setHTMLUnsafe-CEReactions.html b/third_party/blink/web_tests/external/wpt/html/webappapis/dynamic-markup-insertion/html-unsafe-methods/setHTMLUnsafe-CEReactions.html new file mode 100644 index 0000000..3aa1451 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/webappapis/dynamic-markup-insertion/html-unsafe-methods/setHTMLUnsafe-CEReactions.html
@@ -0,0 +1,71 @@ +<!DOCTYPE html> +<link rel=author href="mailto:jarhar@chromium.org"> +<link rel=help href="https://github.com/whatwg/html/issues/9957"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<body> +<script> +class MyElement extends HTMLElement { + constructor() { + super(); + this.numConnectedCallback = 0; + this.numDisconnectedCallback = 0; + this.attributeChangedCalls = []; + } + + connectedCallback() { + this.numConnectedCallback++; + } + + disconnectedCallback() { + this.numDisconnectedCallback++; + } + + static observedAttributes = ['foo']; + attributeChangedCallback(name, oldValue, newValue) { + this.attributeChangedCalls.push({name, oldValue, newValue}); + } +} +customElements.define('my-element', MyElement); + +['Element', 'ShadowRoot'].forEach(containerType => { + test(() => { + let container = null; + if (containerType === 'Element') { + container = document.createElement('div'); + document.body.appendChild(container); + } else if (containerType === 'ShadowRoot') { + const host = document.createElement('div'); + document.body.appendChild(host); + container = host.attachShadow({mode: 'closed'}); + } + + container.setHTMLUnsafe('<my-element>'); + const myElement1 = container.querySelector('my-element'); + assert_equals(myElement1.numConnectedCallback, 1, + 'myElement1.numConnectedCallback after first setHTMLUnsafe.'); + assert_equals(myElement1.numDisconnectedCallback, 0, + 'myElement1.numDisconnectedCallback after first setHTMLUnsafe.'); + assert_equals(JSON.stringify(myElement1.attributeChangedCalls), + JSON.stringify([]), + 'myElement1.attributeChangedCalls after first setHTMLUnsafe.'); + + container.setHTMLUnsafe('<my-element foo=bar>'); + const myElement2 = container.querySelector('my-element'); + assert_equals(myElement1.numConnectedCallback, 1, + 'myElement1.numConnectedCallback after second setHTMLUnsafe.'); + assert_equals(myElement1.numDisconnectedCallback, 1, + 'myElement1.numDisconnectedCallback after second setHTMLUnsafe.'); + assert_array_equals(myElement1.attributeChangedCalls, [], + 'myElement1.attributeChangedCalls after second setHTMLUnsafe.'); + assert_equals(myElement2.numConnectedCallback, 1, + 'myElement2.numConnectedCallback after second setHTMLUnsafe.'); + assert_equals(myElement2.numDisconnectedCallback, 0, + 'myElement2.numDisconnectedCallback after second setHTMLUnsafe.'); + assert_equals(JSON.stringify(myElement2.attributeChangedCalls), + JSON.stringify([{name: 'foo', oldValue: null, newValue: 'bar'}]), + 'myElement2.attributeChangedCalls after second setHTMLUnsafe.'); + }, `${containerType}.setHTMLUnsafe should trigger custom element reactions.`); +}); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/https-upgrades/README b/third_party/blink/web_tests/external/wpt/https-upgrades/README new file mode 100644 index 0000000..e213900f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/https-upgrades/README
@@ -0,0 +1,19 @@ +This directory tests conformance to HTTPS Upgrading feature of Fetch spec. +HTTPS Upgrading automatically upgrades main frame HTTP navigations to HTTPS and +falls back to the original HTTP URL if the upgraded HTTPS URL isn't available. + +In practice, HTTPS Upgrading won't work properly with URLs with non-default +ports. This is because the upgrade logic can't guess the HTTPS port and has to +use the same non-default port number for the upgraded HTTPS URL as the HTTP URL. +In other words, upgrading http://example.com:8123 to https://example.com:8123 +won't work because the server can't serve both http and https on the same port. + +The tests in this directory rely on this fact: +- If HTTPS Upgrading is enabled, http://{{host}}:{{https-port}} will be upgraded + to https://{{host}}:{{https-port}} and load properly. +- Otherwise, http://{{host}}:{{https-port}} will remain unchanged and won't + load, since the server serves http URLs on {{http-port}} instead. + +Therefore, the simplest way to run these tests is through +[wpt.live](http://wpt.live/https-upgrades) which serves the files over default +ports.
diff --git a/third_party/blink/web_tests/external/wpt/https-upgrades/tentative/http-redirecting-to-http-redirecting-to-http.https.sub.html b/third_party/blink/web_tests/external/wpt/https-upgrades/tentative/http-redirecting-to-http-redirecting-to-http.https.sub.html new file mode 100644 index 0000000..96892c9 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/https-upgrades/tentative/http-redirecting-to-http-redirecting-to-http.https.sub.html
@@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html> + <head> + <title>HTTPS Upgrades: HTTP URL redirecting to HTTP URL redirecting to HTTP URL</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/common/get-host-info.sub.js"></script> + + </head> + <body> + <script> + setup({ single_test: true }); + // Loads an HTTP URL that redirects to an HTTP URL that redirects to + // another HTTP URL. HTTPS upgrading should upgrade all URLs to HTTPS. + // + // HTTPS upgrading doesn't change custom ports, so this will load + // correctly if an HTTPS upgrade is performed, and will fail to load + // otherwise (since the port will be wrong for http). + var final_url = "http://{{host}}:{{ports[https][0]}}/https-upgrades/resources/pass.html"; + var middle_url = "http://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=" + final_url; + var url = new URL("http://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=" + middle_url); + window.onmessage = function(event) { + if (event.data === "pass") { + done(); + } + } + win = window.open(url) + </script> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/https-upgrades/tentative/http-redirecting-to-http.https.sub.html b/third_party/blink/web_tests/external/wpt/https-upgrades/tentative/http-redirecting-to-http.https.sub.html new file mode 100644 index 0000000..24d50a7 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/https-upgrades/tentative/http-redirecting-to-http.https.sub.html
@@ -0,0 +1,29 @@ +<!DOCTYPE html> +<html> + <head> + <title>HTTPS Upgrades: HTTP URL redirecting to HTTP</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/common/get-host-info.sub.js"></script> + + </head> + <body> + <script> + setup({ single_test: true }); + // Loads an HTTP URL that redirects to another HTTP URL. HTTPS upgrading + // should upgrade both the initial URL and the redirected URL to HTTPS. + // + // HTTPS upgrading doesn't change custom ports, so this will load + // correctly if an HTTPS upgrade is performed, and will fail to load + // otherwise (since the port will be wrong for http). + var final_url = "http://{{host}}:{{ports[https][0]}}/https-upgrades/resources/pass.html"; + var url = new URL("http://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=" + final_url); + window.onmessage = function(event) { + if (event.data === "pass") { + done(); + } + } + win = window.open(url) + </script> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/https-upgrades/tentative/http-redirecting-to-https.https.sub.html b/third_party/blink/web_tests/external/wpt/https-upgrades/tentative/http-redirecting-to-https.https.sub.html new file mode 100644 index 0000000..13a7f16 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/https-upgrades/tentative/http-redirecting-to-https.https.sub.html
@@ -0,0 +1,29 @@ +<!DOCTYPE html> +<html> + <head> + <title>HTTPS Upgrades: HTTP URL redirecting to HTTPS</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/common/get-host-info.sub.js"></script> + + </head> + <body> + <script> + setup({ single_test: true }); + // Loads an HTTP URL that redirects to an HTTPS URL. HTTPS upgrading + // should upgrade the initial URL. + // + // HTTPS upgrading doesn't change custom ports, so this will load + // correctly if an HTTPS upgrade is performed, and will fail to load + // otherwise (since the port will be wrong for http). + var final_url = "https://{{host}}:{{ports[https][0]}}/https-upgrades/resources/pass.html"; + var url = new URL("http://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=" + final_url); + window.onmessage = function(event) { + if (event.data === "pass") { + done(); + } + } + win = window.open(url) + </script> + </body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/infrastructure/README.md b/third_party/blink/web_tests/external/wpt/infrastructure/README.md index 7d0ec55..9e25c40d 100644 --- a/third_party/blink/web_tests/external/wpt/infrastructure/README.md +++ b/third_party/blink/web_tests/external/wpt/infrastructure/README.md
@@ -2,7 +2,7 @@ infrastructure is operating correctly: * The tests in assumptions/ are designed to test UA assumptions - documented in [assumptions.md](/docs/_writing-tests/assumptions.md). + documented in [assumptions.md](/docs/writing-tests/assumptions.md). * The tests in server/ are designed to test the WPT server configuration
diff --git a/third_party/blink/web_tests/external/wpt/infrastructure/expected-fail/window-onload-test-expected.txt b/third_party/blink/web_tests/external/wpt/infrastructure/expected-fail/window-onload-test-expected.txt new file mode 100644 index 0000000..fe86bacd --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/infrastructure/expected-fail/window-onload-test-expected.txt
@@ -0,0 +1,13 @@ +This is a testharness.js-based test. +[FAIL] test 2 + assert_true: This should FAIL expected true got false +[FAIL] test 3 + assert_true: This should FAIL expected true got false +[FAIL] promise 1 + assert_true: This should FAIL expected true got false +[FAIL] promise 2 + assert_true: This should FAIL expected true got false +[FAIL] promise 3 + assert_true: This should FAIL expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/infrastructure/expected-fail/window-onload-test.html b/third_party/blink/web_tests/external/wpt/infrastructure/expected-fail/window-onload-test.html new file mode 100644 index 0000000..b0514bce --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/infrastructure/expected-fail/window-onload-test.html
@@ -0,0 +1,28 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<script> +window.onload = () => { + test((t) => { + assert_true(true,'This should pass'); + }, 'test 1'); + test((t) => { + assert_true(false,'This should FAIL'); + }, 'test 2'); + test((t) => { + assert_true(false,'This should FAIL'); + }, 'test 3'); + + promise_test(async t => { + assert_true(false,'This should FAIL'); + },'promise 1'); + promise_test(async t => { + assert_true(false,'This should FAIL'); + },'promise 2'); + promise_test(async t => { + assert_true(false,'This should FAIL'); + },'promise 3'); +}; +</script>
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/clipboard-apis.idl b/third_party/blink/web_tests/external/wpt/interfaces/clipboard-apis.idl index 51d5af1..594484ce 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/clipboard-apis.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/clipboard-apis.idl
@@ -42,12 +42,16 @@ [SecureContext, Exposed=Window] interface Clipboard : EventTarget { - Promise<ClipboardItems> read(); + Promise<ClipboardItems> read(optional ClipboardUnsanitizedFormats formats = {}); Promise<DOMString> readText(); Promise<undefined> write(ClipboardItems data); Promise<undefined> writeText(DOMString data); }; +dictionary ClipboardUnsanitizedFormats { + sequence<DOMString> unsanitized; +}; + dictionary ClipboardPermissionDescriptor : PermissionDescriptor { boolean allowWithoutGesture = false; };
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/encrypted-media.idl b/third_party/blink/web_tests/external/wpt/interfaces/encrypted-media.idl index 24db48e..f5d5aa8d 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/encrypted-media.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/encrypted-media.idl
@@ -43,9 +43,26 @@ [Exposed=Window, SecureContext] interface MediaKeys { MediaKeySession createSession (optional MediaKeySessionType sessionType = "temporary"); + Promise<MediaKeyStatus> getStatusForPolicy (optional MediaKeysPolicy policy = {}); Promise<boolean> setServerCertificate (BufferSource serverCertificate); }; +dictionary MediaKeysPolicy { + HDCPVersion minHdcpVersion; +}; + +enum HDCPVersion { + "1.0", + "1.1", + "1.2", + "1.3", + "1.4", + "2.0", + "2.1", + "2.2", + "2.3", +}; + enum MediaKeySessionClosedReason { "internal-error", "closed-by-application",
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/html.idl b/third_party/blink/web_tests/external/wpt/interfaces/html.idl index bfda8a9..b7501feea 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/html.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/html.idl
@@ -1001,6 +1001,8 @@ boolean reportValidity(); undefined setCustomValidity(DOMString error); + undefined showPicker(); + readonly attribute NodeList labels; };
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/longtasks.idl b/third_party/blink/web_tests/external/wpt/interfaces/longtasks.idl index c0aaa7a..064d107 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/longtasks.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/longtasks.idl
@@ -17,3 +17,12 @@ readonly attribute DOMString containerName; [Default] object toJSON(); }; + +[Exposed=Window] +interface PerformanceLongAnimationFrameTiming : PerformanceEntry { + readonly attribute DOMHighResTimeStamp renderStart; + readonly attribute DOMHighResTimeStamp styleAndLayoutStart; + readonly attribute DOMHighResTimeStamp blockingDuration; + + [Default] object toJSON(); +};
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/orientation-event.idl b/third_party/blink/web_tests/external/wpt/interfaces/orientation-event.idl index a93d4658..965e833 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/orientation-event.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/orientation-event.idl
@@ -29,10 +29,6 @@ [SecureContext] attribute EventHandler ondeviceorientationabsolute; }; -partial interface Window { - [SecureContext] attribute EventHandler ondevicemotion; -}; - [Exposed=Window, SecureContext] interface DeviceMotionEventAcceleration { readonly attribute double? x; @@ -47,6 +43,10 @@ readonly attribute double? gamma; }; +partial interface Window { + [SecureContext] attribute EventHandler ondevicemotion; +}; + [Exposed=Window, SecureContext] interface DeviceMotionEvent : Event { constructor(DOMString type, optional DeviceMotionEventInit eventInitDict = {});
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/private-network-access.idl b/third_party/blink/web_tests/external/wpt/interfaces/private-network-access.idl index 19423ba..65b5876 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/private-network-access.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/private-network-access.idl
@@ -3,13 +3,17 @@ // (https://github.com/w3c/webref) // Source: Private Network Access (https://wicg.github.io/private-network-access/) +enum IPAddressSpace { "public", "private", "local" }; + dictionary PrivateNetworkAccessPermissionDescriptor : PermissionDescriptor { DOMString id; }; partial dictionary RequestInit { - RequestTargetAddressSpace targetAddressSpace; + IPAddressSpace targetAddressSpace; }; -enum RequestTargetAddressSpace { "private", "local" }; +partial interface Request { + readonly attribute IPAddressSpace targetAddressSpace; +};
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/storage-buckets.idl b/third_party/blink/web_tests/external/wpt/interfaces/storage-buckets.idl index 1a83988..79f6c94 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/storage-buckets.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/storage-buckets.idl
@@ -20,8 +20,8 @@ dictionary StorageBucketOptions { boolean persisted = false; - unsigned long long? quota = null; - DOMHighResTimeStamp? expires = null; + unsigned long long? quota; + DOMHighResTimeStamp? expires; }; [Exposed=(Window,Worker),
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/streams.idl b/third_party/blink/web_tests/external/wpt/interfaces/streams.idl index 6f0f3a6..ab9be03 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/streams.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/streams.idl
@@ -84,11 +84,15 @@ interface ReadableStreamBYOBReader { constructor(ReadableStream stream); - Promise<ReadableStreamReadResult> read(ArrayBufferView view); + Promise<ReadableStreamReadResult> read(ArrayBufferView view, optional ReadableStreamBYOBReaderReadOptions options = {}); undefined releaseLock(); }; ReadableStreamBYOBReader includes ReadableStreamGenericReader; +dictionary ReadableStreamBYOBReaderReadOptions { + [EnforceRange] unsigned long long min = 1; +}; + [Exposed=*] interface ReadableStreamDefaultController { readonly attribute unrestricted double? desiredSize;
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/webauthn.idl b/third_party/blink/web_tests/external/wpt/interfaces/webauthn.idl index f210c6c..e28355e 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/webauthn.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/webauthn.idl
@@ -1,7 +1,7 @@ // GENERATED CONTENT - DO NOT EDIT // Content was automatically extracted by Reffy into webref // (https://github.com/w3c/webref) -// Source: Web Authentication: An API for accessing Public Key Credentials - Level (https://w3c.github.io/webauthn/) +// Source: Web Authentication: An API for accessing Public Key Credentials - Level 3 (https://w3c.github.io/webauthn/) [SecureContext, Exposed=Window] interface PublicKeyCredential : Credential { @@ -364,19 +364,20 @@ UvmEntries uvm; }; -dictionary AuthenticationExtensionsDevicePublicKeyInputs { - DOMString attestation = "none"; +dictionary AuthenticationExtensionsSupplementalPubKeysInputs { + required sequence<DOMString> scopes; + DOMString attestation = "indirect"; sequence<DOMString> attestationFormats = []; }; partial dictionary AuthenticationExtensionsClientInputs { - AuthenticationExtensionsDevicePublicKeyInputs devicePubKey; + AuthenticationExtensionsSupplementalPubKeysInputs supplementalPubKeys; }; -dictionary AuthenticationExtensionsDevicePublicKeyOutputs { - ArrayBuffer signature; +dictionary AuthenticationExtensionsSupplementalPubKeysOutputs { + sequence<ArrayBuffer> signatures; }; partial dictionary AuthenticationExtensionsClientOutputs { - AuthenticationExtensionsDevicePublicKeyOutputs devicePubKey; + AuthenticationExtensionsSupplementalPubKeysOutputs supplementalPubKeys; };
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/webgpu.idl b/third_party/blink/web_tests/external/wpt/interfaces/webgpu.idl index 98fb84c..373d51d 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/webgpu.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/webgpu.idl
@@ -636,7 +636,7 @@ dictionary GPUProgrammableStage { required GPUShaderModule module; - required USVString entryPoint; + USVString entryPoint; record<USVString, GPUPipelineConstantValue> constants; }; @@ -939,8 +939,6 @@ optional GPUSize64 offset = 0, optional GPUSize64 size); - undefined writeTimestamp(GPUQuerySet querySet, GPUSize32 queryIndex); - undefined resolveQuerySet( GPUQuerySet querySet, GPUSize32 firstQuery,
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/webtransport.idl b/third_party/blink/web_tests/external/wpt/interfaces/webtransport.idl index b9deae2..86178a4 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/webtransport.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/webtransport.idl
@@ -73,6 +73,7 @@ dictionary WebTransportSendStreamOptions { WebTransportSendGroup? sendGroup = null; long long sendOrder = 0; + boolean waitUntilAvailable = false; }; dictionary WebTransportConnectionStats {
diff --git a/third_party/blink/web_tests/external/wpt/resources/testharness.js b/third_party/blink/web_tests/external/wpt/resources/testharness.js index 497ae23..bc7fb896 100644 --- a/third_party/blink/web_tests/external/wpt/resources/testharness.js +++ b/third_party/blink/web_tests/external/wpt/resources/testharness.js
@@ -91,7 +91,12 @@ } on_event(window, 'load', function() { + setTimeout(() => { this_obj.all_loaded = true; + if (tests.all_done()) { + tests.complete(); + } + },0); }); on_event(window, 'message', function(event) {
diff --git a/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/non-html-documents.html b/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/non-html-documents.html index d86cf48..5cec6aee3 100644 --- a/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/non-html-documents.html +++ b/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/non-html-documents.html
@@ -26,24 +26,54 @@ } const test_cases = [ - 'non-html.css', - 'non-html.js', - 'non-html.json', - 'non-html.txt', - 'non-html.xml' + { + filename: 'text-html.html', + expected: 'allowed', + }, + { + filename: 'text-css.css', + expected: 'blocked', + }, + { + filename: 'text-javascript.js', + expected: 'blocked', + }, + { + filename: 'application-json.json', + expected: 'blocked', + }, + { + filename: 'text-plain.txt', + expected: 'allowed', + }, + { + filename: 'application-xml.xml', + expected: 'blocked', + }, ]; for (let test_case of test_cases) { + const filename = test_case.filename; + const expected = test_case.expected; + const mediaType = filename.split('.')[0].replace('-', '/'); + promise_test(async function (t) { - const popup = await openPopup(`resources/${test_case}#:~:text=target`); + const popup = await openPopup(`resources/${filename}#:~:text=target`); + + // The WPT server should provide the correct content-type header from the + // file extension. + assert_equals(popup.document.contentType, mediaType); // rAF twice in case there is any asynchronicity in scrolling to the target. await rAF(popup); await rAF(popup); - assert_equals(popup.scrollY, 0); + const did_scroll = popup.scrollY > 0; + const expected_scroll = expected == 'allowed'; + assert_equals(did_scroll, expected_scroll, 'scrolled to fragment'); + popup.close(); - }, `Text directive blocked in ${test_case}`); + }, `Text directive ${expected} in ${mediaType}`); } </script>
diff --git a/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/non-html.json b/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/application-json.json similarity index 100% rename from third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/non-html.json rename to third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/application-json.json
diff --git a/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/non-html.xml b/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/application-xml.xml similarity index 100% rename from third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/non-html.xml rename to third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/application-xml.xml
diff --git a/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/non-html.css b/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/text-css.css similarity index 100% rename from third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/non-html.css rename to third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/text-css.css
diff --git a/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/text-html.html b/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/text-html.html new file mode 100644 index 0000000..c3d2d3a --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/text-html.html
@@ -0,0 +1,10 @@ +<!DOCTYPE html> +<style> + p { + position: absolute; + top: 200vh; + } +</style> +<p> + target +</p>
diff --git a/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/non-html.js b/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/text-javascript.js similarity index 100% rename from third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/non-html.js rename to third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/text-javascript.js
diff --git a/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/non-html.txt b/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/text-plain.txt similarity index 99% rename from third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/non-html.txt rename to third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/text-plain.txt index 785a4d56..b114445 100644 --- a/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/non-html.txt +++ b/third_party/blink/web_tests/external/wpt/scroll-to-text-fragment/resources/text-plain.txt
@@ -23,3 +23,5 @@ For a number of years, both groups then worked together. In 2011, however, the groups came to the conclusion that they had different goals: the W3C wanted to publish a "finished" version of "HTML5", while the WHATWG wanted to continue working on a Living Standard for HTML, continuously maintaining the specification rather than freezing it in a state with known problems, and adding new features as needed to evolve the platform. In 2019, the WHATWG and W3C signed an agreement to collaborate on a single version of HTML going forward: this document. + +target
diff --git a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/multiple_nested_events.tentative.html b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/multiple_nested_events.tentative.html index e518418..196cfa06 100644 --- a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/multiple_nested_events.tentative.html +++ b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/multiple_nested_events.tentative.html
@@ -24,6 +24,7 @@ }); testSoftNavigation({ eventPrepWork: url => { + timestamps[counter]["eventStart"] = performance.now(); addTextToDivOnMain(); history.pushState({}, '', 'foobar1.html'); // Here we're bypassing the regular test's event logic, as this test is
diff --git a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-after-transition-commit.tentative.html b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-after-transition-commit.tentative.html index ae17db7..5c7d8f4 100644 --- a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-after-transition-commit.tentative.html +++ b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-after-transition-commit.tentative.html
@@ -16,11 +16,11 @@ <script> const link = document.getElementById("link"); testNavigationApi("Test soft navigation when navigate event intecepts with { commit: 'after-transition' }", e => { + timestamps[counter]["eventStart"] = performance.now(); e.intercept({commit: "after-transition", handler: async () => { await addImageToMain(); e.commit(); }}); - timestamps[counter]["eventEnd"] = performance.now(); }, link); </script> </body>
diff --git a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-hash.tentative.html b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-hash.tentative.html index e20578e..a63b177a 100644 --- a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-hash.tentative.html +++ b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-hash.tentative.html
@@ -16,11 +16,11 @@ <script> const link = document.getElementById("link"); testNavigationApi("Test soft navigation with the Navigation API", e => { + timestamps[counter]["eventStart"] = performance.now(); e.intercept({handler: async () => { await addImageToMain(); main.appendChild(img); }}); - timestamps[counter]["eventEnd"] = performance.now(); }, link); </script> </body>
diff --git a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-preventDefault.tentative.html b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-preventDefault.tentative.html index b7b2a24..d6c61ef 100644 --- a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-preventDefault.tentative.html +++ b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-preventDefault.tentative.html
@@ -19,12 +19,12 @@ testSoftNavigationNotDetected({ testName: "Aborted navigate event is not a soft navigation", eventHandler: e => { + timestamps[counter]["eventStart"] = performance.now(); e.intercept({handler: async () => { await addImageToMain(); main.appendChild(img); }}); e.preventDefault(); - timestamps[counter]["eventEnd"] = performance.now(); }, eventTarget: navigation, eventName: "navigate",
diff --git a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-rejected.tentative.html b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-rejected.tentative.html index 693f876..bcc0451d 100644 --- a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-rejected.tentative.html +++ b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-rejected.tentative.html
@@ -16,11 +16,11 @@ <script> const link = document.getElementById("link"); testNavigationApi("Test intercepted and rejected navigate event", e => { + timestamps[counter]["eventStart"] = performance.now(); e.intercept({handler: async () => { await addImageToMain(); throw new Error("This navigation handler rejected"); }}); - timestamps[counter]["eventEnd"] = performance.now(); }, link); </script> </body>
diff --git a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-view-transition.tentative.html b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-view-transition.tentative.html index 4d88f3d..2755f9f 100644 --- a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-view-transition.tentative.html +++ b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api-view-transition.tentative.html
@@ -23,6 +23,7 @@ await new Promise(r => step_timeout(r, 0)); const navigate_callback = e => { + timestamps[counter]["eventStart"] = performance.now(); e.intercept({ async handler() { const lcp_promise = new Promise(resolve => { @@ -40,7 +41,6 @@ await lcp_promise; } }); - timestamps[counter]["eventEnd"] = performance.now(); }; const link = document.getElementById("link");
diff --git a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api.tentative.html b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api.tentative.html index 2d61736..ca11f684 100644 --- a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api.tentative.html +++ b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/navigation-api.tentative.html
@@ -16,10 +16,10 @@ <script> const link = document.getElementById("link"); testNavigationApi("Test soft navigation with the Navigation API", e => { + timestamps[counter]["eventStart"] = performance.now(); e.intercept({handler: async () => { await addImageToMain(); }}); - timestamps[counter]["eventEnd"] = performance.now(); }, link); </script> </body>
diff --git a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/popstate-multiple-backs.tentative.html b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/popstate-multiple-backs.tentative.html index fd87f5f..2a12a35 100644 --- a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/popstate-multiple-backs.tentative.html +++ b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/popstate-multiple-backs.tentative.html
@@ -39,10 +39,7 @@ return t.popped == 2; } const link = document.getElementById("link"); - link.addEventListener("click", () => { - history.back(); - timestamps[counter]["eventEnd"] = performance.now(); - }); + link.addEventListener("click", () => history.back()); testSoftNavigation({ addContent: () => { // Add the content to the main element
diff --git a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/popstate.tentative.html b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/popstate.tentative.html index f89991d..60a5ff72 100644 --- a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/popstate.tentative.html +++ b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/popstate.tentative.html
@@ -22,10 +22,7 @@ history.pushState({}, "", "another_one.html"); const link = document.getElementById("link"); - link.addEventListener("click", () => { - history.back(); - timestamps[counter]["eventEnd"] = performance.now(); - }); + link.addEventListener("click", () => history.back()); testSoftNavigation({ addContent: () => { // Add the content to the main element
diff --git a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/resources/soft-navigation-helper.js b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/resources/soft-navigation-helper.js index 685bc21f..58ca9c2 100644 --- a/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/resources/soft-navigation-helper.js +++ b/third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/resources/soft-navigation-helper.js
@@ -144,17 +144,10 @@ const eventObject = (eventType == 'click' || eventType.startsWith("key")) ? button : window; eventObject.addEventListener(eventType, async e => { - let prepWorkFailed = false; if (prepWork &&!prepWork(t)) { - prepWorkFailed = true; - } - // This is the end of the event's sync processing. - if (!timestamps[counter]["eventEnd"]) { - timestamps[counter]["eventEnd"] = performance.now(); - } - if (prepWorkFailed) { return; } + timestamps[counter]["eventStart"] = performance.now(); // Jump through a task, to ensure task tracking is working properly. await new Promise(r => t.step_timeout(r, 0)); @@ -172,9 +165,9 @@ await new Promise(r => t.step_timeout(r, 10)); await addContent(url); + ++counter; interacted = true; - ++counter; }); }; @@ -197,7 +190,7 @@ assert_less_than_equal(timestamps[i]["syncPostInteraction"], entryTimestamp, "Entry timestamp is lower than the post interaction one"); assert_greater_than_equal( - entryTimestamp, timestamps[i]['eventEnd'], + timestamps[i]['eventStart'], entryTimestamp, 'Event start timestamp matches'); assert_not_equals(entry.navigationId, performance.getEntriesByType("navigation")[0].navigationId,
diff --git a/third_party/blink/web_tests/external/wpt/speculation-rules/prerender/fetch-blob.html b/third_party/blink/web_tests/external/wpt/speculation-rules/prerender/fetch-blob.html index 4124d95..3158b0f1 100644 --- a/third_party/blink/web_tests/external/wpt/speculation-rules/prerender/fetch-blob.html +++ b/third_party/blink/web_tests/external/wpt/speculation-rules/prerender/fetch-blob.html
@@ -1,5 +1,7 @@ <!DOCTYPE html> <title>Same-origin prerendering can access blobs</title> +<meta name="variant" content="?target_hint=_self"> +<meta name="variant" content="?target_hint=_blank"> <meta name="timeout" content="long"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> @@ -13,7 +15,10 @@ setup(() => assertSpeculationRulesIsSupported()); promise_test(async t => { - const {exec} = await create_prerendered_page(t); + const opt = {}; + const init_opt = {}; + const rule_extras = {'target_hint': getTargetHint()}; + const {exec} = await create_prerendered_page(t, opt, init_opt, rule_extras); const result = await exec(async () => { const blob = await (await fetch('cache.txt')).blob(); const reader = new FileReader();
diff --git a/third_party/blink/web_tests/external/wpt/svg/linking/reftests/use-template-ref.html b/third_party/blink/web_tests/external/wpt/svg/linking/reftests/use-template-ref.html new file mode 100644 index 0000000..1423c542 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/svg/linking/reftests/use-template-ref.html
@@ -0,0 +1,5 @@ +<!doctype html> +<meta charset=utf-8> +<svg width="100" height="100"> + <rect width="100" height="100" fill="green" x="0" y="0"></rect> +</svg>
diff --git a/third_party/blink/web_tests/external/wpt/svg/linking/reftests/use-template.html b/third_party/blink/web_tests/external/wpt/svg/linking/reftests/use-template.html new file mode 100644 index 0000000..1c07415 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/svg/linking/reftests/use-template.html
@@ -0,0 +1,20 @@ +<!doctype html> +<meta charset=utf-8> +<title>CSS Test: Use element after cloning</title> +<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> +<link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseElement"> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1866911"> +<link rel="match" href="/svg/linking/reftests/use-template-ref.html"> +<template> + <svg width="100" height="100"> + <use href="#rect"></use> + </svg> +</template> +<svg width="0" height="0" style="position: absolute"> + <symbol id="rect"> + <rect width="100" height="100" fill="green" x="0" y="0"></rect> + </symbol> +</svg> +<script> + document.body.appendChild(document.querySelector("template").content.cloneNode(true)); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/svg/struct/reftests/use-data-url-set-attributeName.tentative.svg b/third_party/blink/web_tests/external/wpt/svg/struct/reftests/use-data-url-set-attributeName.tentative.svg deleted file mode 100644 index 248f218..0000000 --- a/third_party/blink/web_tests/external/wpt/svg/struct/reftests/use-data-url-set-attributeName.tentative.svg +++ /dev/null
@@ -1,9 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink"> - <title><use> with a data: URL resource loaded by <set attributeName></title> - <h:link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseElementHrefAttribute"/> - <h:link rel="match" href="reference/green-100x100.svg"/> - <rect width="100" height="100" fill="green"/> - <use> - <set attributeName="href" to="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IGlkPSJyZWQtcmVjdCIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIGZpbGw9InJlZCIvPgo8L3N2Zz4=#red-rect"/> - </use> -</svg>
diff --git a/third_party/blink/web_tests/external/wpt/svg/struct/reftests/use-data-url-setAttribute.tentative.html b/third_party/blink/web_tests/external/wpt/svg/struct/reftests/use-data-url-setAttribute.tentative.html deleted file mode 100644 index b28dd0e..0000000 --- a/third_party/blink/web_tests/external/wpt/svg/struct/reftests/use-data-url-setAttribute.tentative.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!doctype HTML> -<meta charset="utf-8"> -<title>Testcase for changing a valid <use> to a data URL:</title> -<link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseElementHrefAttribute"> -<link rel="match" href="reference/green-100x100.html"> -<script> - function go() { - const use = document.querySelector("use"); - use.setAttribute("href", "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IGlkPSJvcmFuZ2UtcmVjdCIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIGZpbGw9Im9yYW5nZSIvPgo8L3N2Zz4=#orange-rect"); - } -</script> -<body onload="go()"> - <svg id="mySVG"> - <rect id="red" width="100" height="100" fill="red"></rect> - <rect id="green" width="100" height="100" fill="green"></rect> - <use x="100" y="0" href="#red"></use> - </svg> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/svg/struct/reftests/use-ref-inside-data-url.tentative.html b/third_party/blink/web_tests/external/wpt/svg/struct/reftests/use-ref-inside-data-url.tentative.html deleted file mode 100644 index d6ac2e3..0000000 --- a/third_party/blink/web_tests/external/wpt/svg/struct/reftests/use-ref-inside-data-url.tentative.html +++ /dev/null
@@ -1,15 +0,0 @@ -<!doctype HTML> -<meta charset="utf-8"> -<title>Testcase for where SVG loaded via data: uses #ref</title> -<link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseElementHrefAttribute"> -<link rel="match" href="reference/green-100x100.html"> -<body> -<!-- base64 SVG source: -<svg xmlns="http://www.w3.org/2000/svg"> - <rect id="green-rect" width="100" height="100" fill="green"/> - <rect width="100" height="100" fill="red"/> - <use href="#green-rect"/> -</svg> ---> -<img src="data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KICA8cmVjdCBpZD0iZ3JlZW4tcmVjdCIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIGZpbGw9ImdyZWVuIi8+DQogIDxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSJyZWQiLz4NCiAgPHVzZSBocmVmPSIjZ3JlZW4tcmVjdCIvPg0KPC9zdmc+"> -</body>
diff --git a/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/input/perform_actions/pointer_mouse_multiclick.py b/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/input/perform_actions/pointer_mouse_multiclick.py index 4f67f8f..87c2902 100644 --- a/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/input/perform_actions/pointer_mouse_multiclick.py +++ b/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/input/perform_actions/pointer_mouse_multiclick.py
@@ -85,9 +85,7 @@ desired outcome as taps are handled differently on mobile. """ url = inline( - f"""<div> - {lots_of_text} - </div>""" + f"""<div>{lots_of_text}</div>""" ) await bidi_session.browsing_context.navigate(
diff --git a/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/input/release_actions/sequence.py b/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/input/release_actions/sequence.py index 55bc038a..603b294 100644 --- a/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/input/release_actions/sequence.py +++ b/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/input/release_actions/sequence.py
@@ -66,6 +66,9 @@ ) events = await get_events(bidi_session, top_context["context"]) + # The expeced data here might vary between the vendors since the spec at the moment + # is not clear on how the double/triple click should be tracked. It should be + # clarified in the scope of https://github.com/w3c/webdriver/issues/1772. expected = [ {"type": "mousedown", "button": 0}, {"type": "mouseup", "button": 0}, @@ -75,8 +78,5 @@ {"type": "click", "button": 0}, ] - if not release_actions: - expected.append({"type": "dblclick", "button": 0}) - filtered_events = [filter_dict(e, expected[0]) for e in events] assert expected == filtered_events[1:]
diff --git a/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/network/remove_intercept/remove_intercept.py b/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/network/remove_intercept/remove_intercept.py index 3f205c3..31b1115 100644 --- a/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/network/remove_intercept/remove_intercept.py +++ b/third_party/blink/web_tests/external/wpt/webdriver/tests/bidi/network/remove_intercept/remove_intercept.py
@@ -1,5 +1,6 @@ # META: timeout=long +import asyncio import pytest from .. import ( @@ -18,7 +19,7 @@ "responseStarted", ]) async def test_remove_intercept( - bidi_session, wait_for_event, url, setup_network_test, add_intercept, subscribe_events, top_context, wait_for_future_safe, phase + bidi_session, wait_for_event, url, setup_network_test, add_intercept, top_context, wait_for_future_safe, phase ): network_events = await setup_network_test( events=[ @@ -39,18 +40,14 @@ on_network_event = wait_for_event(f"network.{phase}") - await subscribe_events(events=["browsingContext.load"], contexts=[top_context["context"]]) - - browsing_context_load_events = [] - - async def on_browsing_context_load_event(method, data): - browsing_context_load_events.append(data) - - remove_listener = bidi_session.add_event_listener("browsingContext.load", on_browsing_context_load_event) - - # Request to top_context should be blocked. + # Request to top_context should be blocked and run into a timeout. # TODO(https://github.com/w3c/webdriver-bidi/issues/188): Use a timeout argument when available. - await bidi_session.browsing_context.navigate(context=top_context["context"], url=text_url, wait="complete") + with pytest.raises(asyncio.TimeoutError): + await asyncio.wait_for( + asyncio.shield(bidi_session.browsing_context.navigate( + context=top_context["context"], url=text_url, wait="complete")), + timeout=2.0, + ) await wait_for_future_safe(on_network_event) @@ -95,9 +92,6 @@ assert len(response_completed_events) == 1 assert_response_event(response_completed_events[0], is_blocked=False) - assert len(browsing_context_load_events) == 0 - remove_listener() - @pytest.mark.asyncio async def test_return_value(bidi_session, add_intercept):
diff --git a/third_party/blink/web_tests/external/wpt/webdriver/tests/classic/perform_actions/pointer_tripleclick.py b/third_party/blink/web_tests/external/wpt/webdriver/tests/classic/perform_actions/pointer_tripleclick.py index eccfa672..301b503 100644 --- a/third_party/blink/web_tests/external/wpt/webdriver/tests/classic/perform_actions/pointer_tripleclick.py +++ b/third_party/blink/web_tests/external/wpt/webdriver/tests/classic/perform_actions/pointer_tripleclick.py
@@ -11,9 +11,7 @@ this will select a paragraph. On mobile this will not have the same desired outcome as taps are handled differently on mobile. """ - session.url = inline("""<div> - {} - </div>""".format(lots_of_text)) + session.url = inline("""<div>{}</div>""".format(lots_of_text)) div = session.find.css("div", all=False) div_rect = div.rect div_centre = {
diff --git a/third_party/blink/web_tests/external/wpt/webdriver/tests/classic/release_actions/sequence.py b/third_party/blink/web_tests/external/wpt/webdriver/tests/classic/release_actions/sequence.py index 78912d8b..65ad39f 100644 --- a/third_party/blink/web_tests/external/wpt/webdriver/tests/classic/release_actions/sequence.py +++ b/third_party/blink/web_tests/external/wpt/webdriver/tests/classic/release_actions/sequence.py
@@ -1,4 +1,5 @@ # META: timeout=long +import pytest from tests.classic.release_actions.support.refine import get_events, get_keys from tests.support.helpers import filter_dict, filter_supported_key_events @@ -29,19 +30,31 @@ assert events == expected +@pytest.mark.parametrize( + "release_actions", + [True, False], + ids=["with release actions", "without release actions"], +) def test_release_mouse_sequence_resets_dblclick_state(session, test_actions_page, - mouse_chain): + mouse_chain, + release_actions): reporter = session.find.css("#outer", all=False) mouse_chain \ .click(element=reporter) \ .perform() - session.actions.release() + + if release_actions: + session.actions.release() + mouse_chain \ .perform() events = get_events(session) + # The expeced data here might vary between the vendors since the spec at the moment + # is not clear on how the double/triple click should be tracked. It should be + # clarified in the scope of https://github.com/w3c/webdriver/issues/1772. expected = [ {"type": "mousedown", "button": 0}, {"type": "mouseup", "button": 0}, @@ -52,28 +65,3 @@ ] filtered_events = [filter_dict(e, expected[0]) for e in events] assert expected == filtered_events[1:] - - -def test_no_release_mouse_sequence_keeps_dblclick_state(session, - test_actions_page, - mouse_chain): - reporter = session.find.css("#outer", all=False) - - mouse_chain \ - .click(element=reporter) \ - .perform() - mouse_chain \ - .perform() - events = get_events(session) - - expected = [ - {"type": "mousedown", "button": 0}, - {"type": "mouseup", "button": 0}, - {"type": "click", "button": 0}, - {"type": "mousedown", "button": 0}, - {"type": "mouseup", "button": 0}, - {"type": "click", "button": 0}, - {"type": "dblclick", "button": 0}, - ] - filtered_events = [filter_dict(e, expected[0]) for e in events] - assert expected == filtered_events[1:]
diff --git a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt index 1ce3e90..c8d1e9d 100644 --- a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt +++ b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt
@@ -30,7 +30,7 @@ PASS window.cached_navigator.appName is window.navigator.appName PASS window.cached_navigator.appVersion is '' PASS window.cached_navigator.cookieEnabled is false -PASS window.cached_navigator.deprecatedRunAdAuctionEnforcesKAnonymity is false +FAIL window.cached_navigator.deprecatedRunAdAuctionEnforcesKAnonymity should be false. Was true. PASS window.cached_navigator.deviceMemory is window.navigator.deviceMemory PASS window.cached_navigator.doNotTrack is null PASS window.cached_navigator.hardwareConcurrency is window.navigator.hardwareConcurrency
diff --git a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt index 05967b6..393106a 100644 --- a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt +++ b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt
@@ -30,7 +30,7 @@ PASS window.cached_navigator.appName is window.navigator.appName PASS window.cached_navigator.appVersion is '' PASS window.cached_navigator.cookieEnabled is false -PASS window.cached_navigator.deprecatedRunAdAuctionEnforcesKAnonymity is false +FAIL window.cached_navigator.deprecatedRunAdAuctionEnforcesKAnonymity should be false. Was true. PASS window.cached_navigator.deviceMemory is window.navigator.deviceMemory PASS window.cached_navigator.doNotTrack is null PASS window.cached_navigator.hardwareConcurrency is window.navigator.hardwareConcurrency
diff --git a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt index e13ba4c..3e479e0 100644 --- a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt +++ b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt
@@ -30,7 +30,7 @@ PASS window.cached_navigator.appName is window.navigator.appName PASS window.cached_navigator.appVersion is '' PASS window.cached_navigator.cookieEnabled is false -PASS window.cached_navigator.deprecatedRunAdAuctionEnforcesKAnonymity is false +FAIL window.cached_navigator.deprecatedRunAdAuctionEnforcesKAnonymity should be false. Was true. PASS window.cached_navigator.deviceMemory is window.navigator.deviceMemory PASS window.cached_navigator.doNotTrack is null PASS window.cached_navigator.hardwareConcurrency is window.navigator.hardwareConcurrency
diff --git a/third_party/blink/web_tests/fast/dom/non-numeric-values-numeric-parameters-expected.txt b/third_party/blink/web_tests/fast/dom/non-numeric-values-numeric-parameters-expected.txt index 346e7ff..41c1e6ad 100644 --- a/third_party/blink/web_tests/fast/dom/non-numeric-values-numeric-parameters-expected.txt +++ b/third_party/blink/web_tests/fast/dom/non-numeric-values-numeric-parameters-expected.txt
@@ -9,7 +9,7 @@ PASS nonNumericPolicy('document.createTextNode("a").deleteData(0, x)') is 'any type allowed (but not omitted)' PASS nonNumericPolicy('document.createTextNode("a").replaceData(x, 0, "b")') is 'any type allowed' PASS nonNumericPolicy('document.createTextNode("a").replaceData(0, x, "b")') is 'any type allowed' -PASS nonNumericPolicy('createCSSMediaRule().insertRule(ruleText, x)') is 'any type allowed (but not omitted)' +PASS nonNumericPolicy('createCSSMediaRule().insertRule(ruleText, x)') is 'any type allowed' PASS nonNumericPolicy('createCSSMediaRule().deleteRule(x)') is 'any type allowed (but not omitted)' PASS nonNumericPolicy('createCSSRuleList().item(x)') is 'any type allowed (but not omitted)' PASS nonNumericPolicy('createCSSStyleDeclaration().item(x)') is 'any type allowed (but not omitted)'
diff --git a/third_party/blink/web_tests/fast/dom/non-numeric-values-numeric-parameters.html b/third_party/blink/web_tests/fast/dom/non-numeric-values-numeric-parameters.html index 3831f99b..672f5415 100644 --- a/third_party/blink/web_tests/fast/dom/non-numeric-values-numeric-parameters.html +++ b/third_party/blink/web_tests/fast/dom/non-numeric-values-numeric-parameters.html
@@ -196,7 +196,7 @@ // CSSMediaRule -shouldBe("nonNumericPolicy('createCSSMediaRule().insertRule(ruleText, x)')", "'any type allowed (but not omitted)'"); +shouldBe("nonNumericPolicy('createCSSMediaRule().insertRule(ruleText, x)')", "'any type allowed'"); shouldBe("nonNumericPolicy('createCSSMediaRule().deleteRule(x)')", "'any type allowed (but not omitted)'"); // CSSRuleList
diff --git a/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-storage-expected.txt b/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-storage-expected.txt index a48834ec..20cefc9 100644 --- a/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-storage-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-storage-expected.txt
@@ -1,6 +1,6 @@ Verify DOM storage with OOPIFs Local Storage: -http://127.0.0.1:8000http://devtools.oopif.test:8000http://devtools.oopif.test:8000http://127.0.0.1:8000 +http://127.0.0.1:8000http://127.0.0.1:8000http://devtools.oopif.test:8000http://devtools.oopif.test:8000 Session Storage: -http://127.0.0.1:8000http://devtools.oopif.test:8000http://devtools.oopif.test:8000http://127.0.0.1:8000 +http://127.0.0.1:8000http://127.0.0.1:8000http://devtools.oopif.test:8000http://devtools.oopif.test:8000
diff --git a/third_party/blink/web_tests/http/tests/devtools/tracing/frame-model-instrumentation-expected.txt b/third_party/blink/web_tests/http/tests/devtools/tracing/frame-model-instrumentation-expected.txt deleted file mode 100644 index eea5ff95..0000000 --- a/third_party/blink/web_tests/http/tests/devtools/tracing/frame-model-instrumentation-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -layerTree: object -mainFrameId: number -paints: present -
diff --git a/third_party/blink/web_tests/http/tests/devtools/tracing/frame-model-instrumentation.js b/third_party/blink/web_tests/http/tests/devtools/tracing/frame-model-instrumentation.js deleted file mode 100644 index dbf89fc..0000000 --- a/third_party/blink/web_tests/http/tests/devtools/tracing/frame-model-instrumentation.js +++ /dev/null
@@ -1,31 +0,0 @@ -// Copyright 2017 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import {TestRunner} from 'test_runner'; -import {PerformanceTestRunner} from 'performance_test_runner'; - -import * as Timeline from 'devtools/panels/timeline/timeline.js'; - -(async function() { - await TestRunner.loadHTML('ABC'); - await TestRunner.showPanel('timeline'); - await TestRunner.evaluateInPagePromise(` - function doActions() { - return generateFrames(3); - }`); - - Timeline.TimelinePanel.TimelinePanel.instance().captureLayersAndPicturesSetting.set(true); - await PerformanceTestRunner.invokeAsyncWithTimeline('doActions'); - const frames = PerformanceTestRunner.timelineFrameModel().getFrames(); - const lastFrame = frames[frames.length - 1]; - if (lastFrame) { - TestRunner.addResult('layerTree: ' + typeof lastFrame.layerTree); - TestRunner.addResult('mainFrameId: ' + typeof lastFrame.mainFrameId); - const paints = lastFrame.layerTree.paints(); - TestRunner.addResult('paints: ' + (paints && paints.length ? 'present' : 'absent')); - } else { - TestRunner.addResult('FAIL: there was no frame'); - } - TestRunner.completeTest(); -})();
diff --git a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-paint/layer-tree-expected.txt b/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-paint/layer-tree-expected.txt deleted file mode 100644 index 79b72a38..0000000 --- a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-paint/layer-tree-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -Tests that LayerTreeModel successfully imports layers from a trace. - -#document - #document 0x0 - #document - #document 0x0 - #document 0x0 - #document - #document - #document - #document - #document - div#a 200x200 - div#b1 100x150 - div#b2 110x140 - div#c 90x100 - div#b3 110x140 -
diff --git a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-paint/layer-tree.js b/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-paint/layer-tree.js deleted file mode 100644 index 74c2e40..0000000 --- a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-paint/layer-tree.js +++ /dev/null
@@ -1,47 +0,0 @@ -// Copyright 2017 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import {TestRunner} from 'test_runner'; -import {PerformanceTestRunner} from 'performance_test_runner'; -import {LayersTestRunner} from 'layers_test_runner'; - -import * as Timeline from 'devtools/panels/timeline/timeline.js'; - -(async function() { - TestRunner.addResult(`Tests that LayerTreeModel successfully imports layers from a trace.\n`); - await TestRunner.showPanel('timeline'); - await TestRunner.loadHTML(` - <div id="a" style="width: 200px; height: 200px" class="layer"> - <div class="layer" id="b1" style="width: 150px; height: 100px"></div> - <div id="b2" class="layer" style="width: 140px; height: 110px"> - <div id="c" class="layer" style="width: 100px; height: 90px"></div> - </div> - <div id="b3" class="layer" style="width: 140px; height: 110px"></div> - </div> - `); - await TestRunner.evaluateInPagePromise(` - function doActions() - { - var div = document.createElement("div"); - div.id = "b4"; - document.getElementById("a").appendChild(div); - - // Make sure to force commit, otherwise some owner nodes will be missing. - var style = document.createElement("style"); - style.textContent = ".layer { transform: translateZ(10px); opacity: 0.8; }"; - document.head.appendChild(style); - return generateFrames(3); - } - `); - - Timeline.TimelinePanel.TimelinePanel.instance()._captureLayersAndPicturesSetting.set(true); - - await PerformanceTestRunner.invokeAsyncWithTimeline('doActions'); - const frames = PerformanceTestRunner.timelineFrameModel().frames(); - const lastFrame = frames[frames.length - 1]; - const layerTreeModel = await lastFrame.layerTree.layerTreePromise(); - LayersTestRunner.dumpLayerTree(undefined, layerTreeModel.contentRoot()); - - TestRunner.completeTest(); -})();
diff --git a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-paint/paint-profiler-update-expected.txt b/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-paint/paint-profiler-update-expected.txt deleted file mode 100644 index e47342f..0000000 --- a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-paint/paint-profiler-update-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -Tests that paint profiler is properly update when an event is selected in Flame Chart - -Paint 0 log size: >0 -Paint 1 log size: >0 -
diff --git a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js b/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js deleted file mode 100644 index 746eeb13..0000000 --- a/third_party/blink/web_tests/http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js +++ /dev/null
@@ -1,86 +0,0 @@ -// Copyright 2017 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import {TestRunner} from 'test_runner'; -import {PerformanceTestRunner} from 'performance_test_runner'; - -import * as Timeline from 'devtools/panels/timeline/timeline.js'; -import * as TimelineModel from 'devtools/models/timeline_model/timeline_model.js'; - -(async function() { - TestRunner.addResult(`Tests that paint profiler is properly update when an event is selected in Flame Chart\n`); - await TestRunner.showPanel('timeline'); - await TestRunner.loadHTML(` - <div id="square" style="width: 40px; height: 40px"></div> - `); - await TestRunner.addScriptTag('../../../resources/run-after-layout-and-paint.js'); - await TestRunner.evaluateInPagePromise(` - function performActions() - { - var callback; - var promise = new Promise((fulfill) => callback = fulfill); - var square = document.getElementById("square"); - step1(); - - function step1() - { - square.style.backgroundColor = "red"; - runAfterLayoutAndPaint(step2); - } - - function step2() - { - square.style.backgroundColor = "black"; - runAfterLayoutAndPaint(callback); - } - return promise; - } - `); - - const panel = Timeline.TimelinePanel.TimelinePanel.instance(); - panel.captureLayersAndPicturesSetting.set(true); - panel.onModeChanged(); - - var paintEvents = []; - await PerformanceTestRunner.invokeAsyncWithTimeline('performActions'); - var events = PerformanceTestRunner.mainTrackEvents(); - for (var event of events) { - // When CompositeAfterPaint is enabled, a Paint trace event will be - // generated which encompasses the entire paint cycle for the page. That - // event will not correspond to any captured picture, and we just ignore it - // for the purpose of this test. - if (event.name === TimelineModel.TimelineModel.RecordType.Paint && - TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event).picture) { - paintEvents.push(event); - } - } - - if (paintEvents.length < 2) - throw new Error('FAIL: Expect at least two paint events'); - - TestRunner.addSniffer( - panel.flameChart.detailsView, 'appendDetailsTabsForTraceEventAndShowDetails', onRecordDetailsReady, false); - panel.select(Timeline.TimelineSelection.TimelineSelection.fromTraceEvent(paintEvents[0])); - - function onRecordDetailsReady() { - var updateCount = 0; - - panel.flameChart.detailsView.tabbedPane.selectTab(Timeline.TimelineDetailsView.Tab.PaintProfiler, true); - var paintProfilerView = panel.flameChart.detailsView.lazyPaintProfilerView.paintProfilerView; - TestRunner.addSniffer(paintProfilerView, 'update', onPaintProfilerUpdate, true); - - function onPaintProfilerUpdate() { - // No snapshot, not a real update yet -- wait for another update! - if (!paintProfilerView.snapshot) - return; - var logSize = paintProfilerView.log && paintProfilerView.log.length ? '>0' : '0'; - TestRunner.addResult('Paint ' + updateCount + ' log size: ' + logSize); - if (updateCount++) - TestRunner.completeTest(); - else - panel.select( - Timeline.TimelineSelection.TimelineSelection.fromTraceEvent(paintEvents[1]), Timeline.TimelineDetailsView.Tab.PaintProfiler); - } - } -})();
diff --git a/third_party/blink/web_tests/platform/linux-chrome/external/wpt/html/semantics/embedded-content/the-img-element/invisible-image-expected.txt b/third_party/blink/web_tests/platform/linux-chrome/external/wpt/html/semantics/embedded-content/the-img-element/invisible-image-expected.txt new file mode 100644 index 0000000..2f98fc9 --- /dev/null +++ b/third_party/blink/web_tests/platform/linux-chrome/external/wpt/html/semantics/embedded-content/the-img-element/invisible-image-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +[FAIL] Test that below-viewport invisible images that are not marked loading=lazy still load, and block the window load event + assert_true: The images should block the window load event. expected true got false +Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/win/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any-expected.txt b/third_party/blink/web_tests/platform/win/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any-expected.txt deleted file mode 100644 index 2f89b09..0000000 --- a/third_party/blink/web_tests/platform/win/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any-expected.txt +++ /dev/null
@@ -1,27 +0,0 @@ -This is a testharness.js-based test. -[FAIL] batchNormalization float32 2D tensor (mean and variance are non-constant) default options / async - promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." -[FAIL] batchNormalization float32 2D tensor default options / async - promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." -[FAIL] batchNormalization float32 3D tensor default options / async - promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." -[FAIL] batchNormalization float32 4D tensor default options / async - promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." -[FAIL] batchNormalization float32 5D tensor default options / async - promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." -[FAIL] batchNormalization float32 4D NCHW tensor options.axis=1 / async - promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." -[FAIL] batchNormalization float32 4D NHWC tensor options.axis=3 / async - promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." -[FAIL] batchNormalization float32 4D NCHW tensor options.scale / async - promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." -[FAIL] batchNormalization float32 4D NCHW tensor options.bias / async - promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." -[FAIL] batchNormalization float32 4D NCHW tensor options.epsilon / async - promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." -[FAIL] batchNormalization float32 4D NCHW tensor options.activation relu / async - promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." -[FAIL] batchNormalization float32 4D NHWC tensor all options / async - promise_test: Unhandled rejection with value: object "DataError: Failed to build graph: batchNormalization is not implemented." -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any-expected.txt new file mode 100644 index 0000000..d2819c2 --- /dev/null +++ b/third_party/blink/web_tests/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any-expected.txt
@@ -0,0 +1,27 @@ +This is a testharness.js-based test. +[FAIL] batchNormalization float32 2D tensor (mean and variance are non-constant) default options / async + promise_test: Unhandled rejection with value: object "NotSupportedError: DirectML: This operator (batchNormalization) is not supported." +[FAIL] batchNormalization float32 2D tensor default options / async + promise_test: Unhandled rejection with value: object "NotSupportedError: DirectML: This operator (batchNormalization) is not supported." +[FAIL] batchNormalization float32 3D tensor default options / async + promise_test: Unhandled rejection with value: object "NotSupportedError: DirectML: This operator (batchNormalization) is not supported." +[FAIL] batchNormalization float32 4D tensor default options / async + promise_test: Unhandled rejection with value: object "NotSupportedError: DirectML: This operator (batchNormalization) is not supported." +[FAIL] batchNormalization float32 5D tensor default options / async + promise_test: Unhandled rejection with value: object "NotSupportedError: DirectML: This operator (batchNormalization) is not supported." +[FAIL] batchNormalization float32 4D NCHW tensor options.axis=1 / async + promise_test: Unhandled rejection with value: object "NotSupportedError: DirectML: This operator (batchNormalization) is not supported." +[FAIL] batchNormalization float32 4D NHWC tensor options.axis=3 / async + promise_test: Unhandled rejection with value: object "NotSupportedError: DirectML: This operator (batchNormalization) is not supported." +[FAIL] batchNormalization float32 4D NCHW tensor options.scale / async + promise_test: Unhandled rejection with value: object "NotSupportedError: DirectML: This operator (batchNormalization) is not supported." +[FAIL] batchNormalization float32 4D NCHW tensor options.bias / async + promise_test: Unhandled rejection with value: object "NotSupportedError: DirectML: This operator (batchNormalization) is not supported." +[FAIL] batchNormalization float32 4D NCHW tensor options.epsilon / async + promise_test: Unhandled rejection with value: object "NotSupportedError: DirectML: This operator (batchNormalization) is not supported." +[FAIL] batchNormalization float32 4D NCHW tensor options.activation relu / async + promise_test: Unhandled rejection with value: object "NotSupportedError: DirectML: This operator (batchNormalization) is not supported." +[FAIL] batchNormalization float32 4D NHWC tensor all options / async + promise_test: Unhandled rejection with value: object "NotSupportedError: DirectML: This operator (batchNormalization) is not supported." +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/win/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any.worker-expected.txt b/third_party/blink/web_tests/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any.worker-expected.txt similarity index 68% rename from third_party/blink/web_tests/platform/win/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any.worker-expected.txt rename to third_party/blink/web_tests/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any.worker-expected.txt index e742b3f..dd7943e 100644 --- a/third_party/blink/web_tests/platform/win/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/virtual/webnn-service-enabled/external/wpt/webnn/gpu/batch_normalization.https.any.worker-expected.txt
@@ -1,28 +1,28 @@ This is a testharness.js-based test. [FAIL] batchNormalization float32 2D tensor (mean and variance are non-constant) default options / sync - Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. + Failed to execute 'buildSync' on 'MLGraphBuilder': DirectML: This operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 2D tensor default options / sync - Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. + Failed to execute 'buildSync' on 'MLGraphBuilder': DirectML: This operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 3D tensor default options / sync - Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. + Failed to execute 'buildSync' on 'MLGraphBuilder': DirectML: This operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D tensor default options / sync - Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. + Failed to execute 'buildSync' on 'MLGraphBuilder': DirectML: This operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 5D tensor default options / sync - Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. + Failed to execute 'buildSync' on 'MLGraphBuilder': DirectML: This operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D NCHW tensor options.axis=1 / sync - Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. + Failed to execute 'buildSync' on 'MLGraphBuilder': DirectML: This operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D NHWC tensor options.axis=3 / sync - Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. + Failed to execute 'buildSync' on 'MLGraphBuilder': DirectML: This operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D NCHW tensor options.scale / sync - Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. + Failed to execute 'buildSync' on 'MLGraphBuilder': DirectML: This operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D NCHW tensor options.bias / sync - Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. + Failed to execute 'buildSync' on 'MLGraphBuilder': DirectML: This operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D NCHW tensor options.epsilon / sync - Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. + Failed to execute 'buildSync' on 'MLGraphBuilder': DirectML: This operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D NCHW tensor options.activation relu / sync - Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. + Failed to execute 'buildSync' on 'MLGraphBuilder': DirectML: This operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 4D NHWC tensor all options / sync - Failed to execute 'buildSync' on 'MLGraphBuilder': Failed to build graph: batchNormalization is not implemented. + Failed to execute 'buildSync' on 'MLGraphBuilder': DirectML: This operator (batchNormalization) is not supported. [FAIL] batchNormalization float32 2D tensor (mean and variance are non-constant) default options / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" [FAIL] batchNormalization float32 2D tensor default options / async
diff --git a/third_party/blink/web_tests/wpt_internal/soft-navigation-heuristics/keypress.html b/third_party/blink/web_tests/wpt_internal/soft-navigation-heuristics/keypress.html index 057d2d2..8f204b3b 100644 --- a/third_party/blink/web_tests/wpt_internal/soft-navigation-heuristics/keypress.html +++ b/third_party/blink/web_tests/wpt_internal/soft-navigation-heuristics/keypress.html
@@ -17,9 +17,6 @@ </div> </main> <script> - window.addEventListener("keydown", () => { - timestamps[counter]["eventEnd"] = performance.now(); - }); testSoftNavigation({ addContent: () => { addTextToDivOnMain();
diff --git a/third_party/blink/web_tests/wpt_internal/soft-navigation-heuristics/keyup.html b/third_party/blink/web_tests/wpt_internal/soft-navigation-heuristics/keyup.html index 1ce01d4..fe17f09 100644 --- a/third_party/blink/web_tests/wpt_internal/soft-navigation-heuristics/keyup.html +++ b/third_party/blink/web_tests/wpt_internal/soft-navigation-heuristics/keyup.html
@@ -17,9 +17,6 @@ </div> </main> <script> - window.addEventListener("keydown", () => { - timestamps[counter]["eventEnd"] = performance.now(); - }); testSoftNavigation({ addContent: () => { addTextToDivOnMain();
diff --git a/third_party/blink/web_tests/wpt_internal/web-share/share-arity.https-expected.txt b/third_party/blink/web_tests/wpt_internal/web-share/share-arity.https-expected.txt new file mode 100644 index 0000000..be20f7d --- /dev/null +++ b/third_party/blink/web_tests/wpt_internal/web-share/share-arity.https-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +Harness Error. harness_status.status = 1 , harness_status.message = Unhandled rejection: Failed to execute 'share' on 'Navigator': Invalid URL +Harness: the test ran to completion. +
diff --git a/third_party/byte_buddy/BUILD.gn b/third_party/byte_buddy/BUILD.gn index 84d3803c..569a604 100644 --- a/third_party/byte_buddy/BUILD.gn +++ b/third_party/byte_buddy/BUILD.gn
@@ -4,34 +4,14 @@ import("//build/config/android/rules.gni") -java_prebuilt("byte_buddy_java") { +android_library("byte_buddy_android_java") { testonly = true - supports_android = true - enable_bytecode_checks = false - jar_path = "lib/byte-buddy.jar" -} - -java_prebuilt("byte_buddy_agent_java") { - testonly = true - supports_android = true - enable_bytecode_checks = false - jar_path = "lib/byte-buddy-agent.jar" -} - -# The current version of //third_party/byte_buddy relies on an older -# version of dx. -java_prebuilt("dx_25_0_2_java") { - testonly = true - supports_android = true - requires_android = true - no_build_hooks = true - jar_path = "android_sdk_build_tools_25_0_2/build-tools/25.0.2/lib/dx.jar" -} - -android_java_prebuilt("byte_buddy_android_java") { - testonly = true - enable_bytecode_checks = false - deps = [ ":dx_25_0_2_java" ] + sources = [ "java/net/bytebuddy/android/AndroidClassLoadingStrategy.java" ] + deps = [ + "//third_party/android_deps:com_google_code_findbugs_jsr305_java", + "//third_party/android_deps:net_bytebuddy_byte_buddy_java", + "//third_party/androidx:androidx_annotation_annotation_java", + "//third_party/aosp_dalvik:aosp_dalvik_dx_java", + ] proguard_configs = [ "//third_party/byte_buddy/proguard.flags" ] - jar_path = "lib/byte-buddy-android.jar" }
diff --git a/third_party/byte_buddy/OWNERS b/third_party/byte_buddy/OWNERS index d107d25c..04c1837 100644 --- a/third_party/byte_buddy/OWNERS +++ b/third_party/byte_buddy/OWNERS
@@ -1,3 +1,4 @@ bjoyce@chromium.org hypan@google.com yzjr@google.com +mheikal@chromium.org
diff --git a/third_party/byte_buddy/README.chromium b/third_party/byte_buddy/README.chromium index a302572..7f096c7b 100644 --- a/third_party/byte_buddy/README.chromium +++ b/third_party/byte_buddy/README.chromium
@@ -1,11 +1,14 @@ -Name: Byte Buddy -URL: http://bytebuddy.net/ -Version: 1.8.8 +Name: Byte Buddy Android +URL: https://github.com/raphw/byte-buddy/tree/master/byte-buddy-android +Version: 7ed7903954b6cb3f85754eb14fb792ce4dc52b54 License: Apache 2.0 License File: LICENSE Security Critical: no Shipped: no Description: -Byte Buddy is a code generation library for creating Java classes at runtime. +Byte Buddy Android is used by the main ByteBuddy package, to wrap Android APIs to load generated classes (i.e. mocks) at runtime. -Local Modifications: None +Local Modifications: + - Calls BaseDexClassLoader#addDexPath with isTrusted = false (so mockito can be used when debuggable_apks = false on bots). + - Delete import + references to edu.umd.cs.findbugs.annotations.SuppressFBWarnings + - TargetApi -> RequiresApi from androidx (chromium presubmits require it).
diff --git a/third_party/byte_buddy/cipd.yaml b/third_party/byte_buddy/cipd.yaml deleted file mode 100644 index e3d401cd..0000000 --- a/third_party/byte_buddy/cipd.yaml +++ /dev/null
@@ -1,12 +0,0 @@ -# Copyright 2017 The Chromium Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# To create CIPD package run the following command. -# cipd create --pkg-def cipd.yaml -tag version:$(cat version.txt) -package: chromium/third_party/byte_buddy -description: byte_buddy Java library -data: - - file: lib/byte-buddy-agent.jar - - file: lib/byte-buddy-android.jar - - file: lib/byte-buddy.jar
diff --git a/third_party/byte_buddy/java/net/bytebuddy/android/AndroidClassLoadingStrategy.java b/third_party/byte_buddy/java/net/bytebuddy/android/AndroidClassLoadingStrategy.java new file mode 100644 index 0000000..476c455 --- /dev/null +++ b/third_party/byte_buddy/java/net/bytebuddy/android/AndroidClassLoadingStrategy.java
@@ -0,0 +1,920 @@ +/* + * Copyright 2014 - Present Rafael Winterhalter + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package net.bytebuddy.android; + +import androidx.annotation.RequiresApi; +import android.os.Build; +import com.android.dx.cf.direct.DirectClassFile; +import com.android.dx.cf.direct.StdAttributeFactory; +import com.android.dx.dex.DexOptions; +import com.android.dx.dex.cf.CfOptions; +import com.android.dx.dex.cf.CfTranslator; +import com.android.dx.dex.file.ClassDefItem; +import com.android.dx.dex.file.DexFile; +import dalvik.system.BaseDexClassLoader; +import dalvik.system.DexClassLoader; +import net.bytebuddy.description.type.TypeDescription; +import net.bytebuddy.dynamic.loading.ClassLoadingStrategy; +import net.bytebuddy.utility.RandomString; +import net.bytebuddy.utility.nullability.AlwaysNull; +import net.bytebuddy.utility.nullability.MaybeNull; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.Writer; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.jar.JarEntry; +import java.util.jar.JarOutputStream; +import java.util.logging.Logger; + +/** + * <p> + * A class loading strategy that allows to load a dynamically created class at the runtime of an Android + * application. For this, a {@link dalvik.system.DexClassLoader} is used under the covers. + * </p> + * <p> + * This class loader requires to write files to the file system which are then processed by the Android VM. It is + * <b>not</b> permitted by Android's security checks to store these files in a shared folder where they could be + * manipulated by a third application what would break Android's sandbox model. An example for a forbidden storage + * would therefore be the external storage. Instead, the class loading application must either supply a designated + * directory, such as by creating a directory using {@code android.content.Context#getDir(String, int)} with specifying + * {@code android.content.Context#MODE_PRIVATE} visibility for the created folder or by using the + * {@code getCodeCacheDir} directory which is exposed for Android API versions 21 or higher. + * </p> + * <p> + * By default, this Android {@link net.bytebuddy.dynamic.loading.ClassLoadingStrategy} uses the Android SDK's dex compiler in + * <i>version 1.7</i> which requires the Java class files in version {@link net.bytebuddy.ClassFileVersion#JAVA_V6} as + * its input. This version is slightly outdated but newer versions are not available in Maven Central which is why this + * outdated version is included with this class loading strategy. Newer version can however be easily adapted by + * implementing the methods of a {@link net.bytebuddy.android.AndroidClassLoadingStrategy.DexProcessor} to + * appropriately delegate to the newer dex compiler. In case that the dex compiler's API was not altered, it would + * even be sufficient to include the newer dex compiler to the Android application's build path while also excluding + * the version that ships with this class loading strategy. While most parts of the Android SDK's components are + * licensed under the <i>Apache 2.0 license</i>, please also note + * <a href="https://developer.android.com/sdk/terms.html">their terms and conditions</a>. + * </p> + */ +public abstract class AndroidClassLoadingStrategy implements ClassLoadingStrategy<ClassLoader> { + + /** + * The name of the dex file that the {@link dalvik.system.DexClassLoader} expects to find inside of a jar file + * that is handed to it as its argument. + */ + private static final String DEX_CLASS_FILE = "classes.dex"; + + /** + * The file name extension of a jar file. + */ + private static final String JAR_FILE_EXTENSION = ".jar"; + + /** + * A value for a {@link dalvik.system.DexClassLoader} to indicate that the library path is empty. + */ + @AlwaysNull + private static final String EMPTY_LIBRARY_PATH = null; + + /** + * A processor for files before adding them to a dex file. + */ + private static final FileProcessor FILE_PROCESSOR; + + /* + * Resolves the file processor. + */ + static { + FileProcessor fileProcessor; + try { + fileProcessor = new FileProcessor.ForReadOnlyClassFile( + Class.forName("java.nio.file.Files").getMethod("setPosixFilePermissions", + Class.forName("java.nio.file.Path"), + Set.class), + File.class.getMethod("toPath"), + Collections.singleton(Class.forName("java.nio.file.attribute.PosixFilePermission") + .getMethod("valueOf", String.class) + .invoke(null, "OWNER_READ"))); + } catch (Throwable ignored) { + fileProcessor = FileProcessor.Disabled.INSTANCE; + } + FILE_PROCESSOR = fileProcessor; + } + + /** + * The dex creator to be used by this Android class loading strategy. + */ + private final DexProcessor dexProcessor; + + /** + * A directory that is <b>not shared with other applications</b> to be used for storing generated classes and + * their processed forms. + */ + protected final File privateDirectory; + + /** + * A generator for random string values. + */ + protected final RandomString randomString; + + /** + * Creates a new Android class loading strategy that uses the given folder for storing classes. The directory is not cleared + * by Byte Buddy after the application terminates. This remains the responsibility of the user. + * + * @param privateDirectory A directory that is <b>not shared with other applications</b> to be used for storing + * generated classes and their processed forms. + * @param dexProcessor The dex processor to be used for creating a dex file out of Java files. + */ + protected AndroidClassLoadingStrategy(File privateDirectory, DexProcessor dexProcessor) { + if (!privateDirectory.isDirectory()) { + throw new IllegalArgumentException("Not a directory " + privateDirectory); + } + this.privateDirectory = privateDirectory; + this.dexProcessor = dexProcessor; + randomString = new RandomString(); + } + + /** + * {@inheritDoc} + */ + public Map<TypeDescription, Class<?>> load(@MaybeNull ClassLoader classLoader, Map<TypeDescription, byte[]> types) { + DexProcessor.Conversion conversion = dexProcessor.create(); + for (Map.Entry<TypeDescription, byte[]> entry : types.entrySet()) { + conversion.register(entry.getKey().getName(), entry.getValue()); + } + File jar = new File(privateDirectory, randomString.nextString() + JAR_FILE_EXTENSION); + try { + if (!jar.createNewFile()) { + throw new IllegalStateException("Cannot create " + jar); + } + JarOutputStream outputStream = new JarOutputStream(new FileOutputStream(jar)); + try { + outputStream.putNextEntry(new JarEntry(DEX_CLASS_FILE)); + conversion.drainTo(outputStream); + outputStream.closeEntry(); + } finally { + outputStream.close(); + } + FILE_PROCESSOR.accept(jar); + return doLoad(classLoader, types.keySet(), jar); + } catch (IOException exception) { + throw new IllegalStateException("Cannot write to zip file " + jar, exception); + } finally { + if (!jar.delete()) { + Logger.getLogger("net.bytebuddy").warning("Could not delete " + jar); + } + } + } + + /** + * Applies the actual class loading. + * + * @param classLoader The target class loader. + * @param typeDescriptions Descriptions of the loaded types. + * @param jar A jar file containing the supplied types as dex files. + * @return A mapping of all type descriptions to their loaded types. + * @throws IOException If an I/O exception occurs. + */ + protected abstract Map<TypeDescription, Class<?>> doLoad(@MaybeNull ClassLoader classLoader, Set<TypeDescription> typeDescriptions, File jar) throws IOException; + + /** + * A processor for files that are added to a dex file. + */ + protected interface FileProcessor { + + /** + * Accepts a file for processing. + * + * @param file The file to process. + */ + void accept(File file); + + /** + * A non-operational file processor. + */ + enum Disabled implements FileProcessor { + + /** + * The singleton instance. + */ + INSTANCE; + + /** + * {@inheritDoc} + */ + public void accept(File file) { + /* do nothing */ + } + } + + /** + * A file processor that marks a file as read-only. + */ + class ForReadOnlyClassFile implements FileProcessor { + + /** + * The {@code java.nio.file.Files#setPosixFilePermissions} method. + */ + private final Method setPosixFilePermissions; + + /** + * The {@code java.io.File#toPath} method. + */ + private final Method toPath; + + /** + * The set of permissions to set. + */ + private final Set<?> permissions; + + /** + * Creates a new file processor for a read only file. + * + * @param setPosixFilePermissions The {@code java.nio.file.Files#setPosixFilePermissions} method. + * @param toPath The {@code java.io.File#toPath} method. + * @param permissions The set of {java.nio.file.attribute.FilePermission} to set. + */ + protected ForReadOnlyClassFile(Method setPosixFilePermissions, Method toPath, Set<?> permissions) { + this.setPosixFilePermissions = setPosixFilePermissions; + this.toPath = toPath; + this.permissions = permissions; + } + + /** + * {@inheritDoc} + */ + public void accept(File file) { + try { + setPosixFilePermissions.invoke(null, toPath.invoke(file), permissions); + } catch (IllegalAccessException exception) { + throw new IllegalStateException("Cannot access file system permissions", exception); + } catch (InvocationTargetException exception) { + if (!(exception.getTargetException() instanceof UnsupportedOperationException)) { + throw new IllegalStateException("Cannot invoke file system permissions method", exception.getTargetException()); + } + } + } + } + } + + /** + * A dex processor is responsible for converting a collection of Java class files into a Android dex file. + */ + public interface DexProcessor { + + /** + * Creates a new conversion process which allows to store several Java class files in the created dex + * file before writing this dex file to a specified {@link java.io.OutputStream}. + * + * @return A mutable conversion process. + */ + Conversion create(); + + /** + * Represents an ongoing conversion of several Java class files into an Android dex file. + */ + interface Conversion { + + /** + * Adds a Java class to the generated dex file. + * + * @param name The binary name of the Java class. + * @param binaryRepresentation The binary representation of this class. + */ + void register(String name, byte[] binaryRepresentation); + + /** + * Writes an Android dex file containing all registered Java classes to the provided output stream. + * + * @param outputStream The output stream to write the generated dex file to. + * @throws IOException If an error occurs while writing the file. + */ + void drainTo(OutputStream outputStream) throws IOException; + } + + /** + * An implementation of a dex processor based on the Android SDK's <i>dx.jar</i> with an API that is + * compatible to version 1.7. + */ + class ForSdkCompiler implements DexProcessor { + + /** + * An API version for a DEX file that ensures compatibility to the underlying compiler. + */ + private static final int DEX_COMPATIBLE_API_VERSION = 13; + + /** + * The dispatcher for translating a dex file. + */ + private static final Dispatcher DISPATCHER; + + /* + * Resolves the dispatcher for class file translations. + */ + static { + Dispatcher dispatcher; + try { + Class<?> dxContextType = Class.forName("com.android.dx.command.dexer.DxContext"); + dispatcher = new Dispatcher.ForApi26LevelCompatibleVm(CfTranslator.class.getMethod("translate", + dxContextType, + DirectClassFile.class, + byte[].class, + CfOptions.class, + DexOptions.class, + DexFile.class), dxContextType.getConstructor()); + } catch (Throwable ignored) { + try { + dispatcher = new Dispatcher.ForLegacyVm(CfTranslator.class.getMethod("translate", + DirectClassFile.class, + byte[].class, + CfOptions.class, + DexOptions.class, + DexFile.class), DexOptions.class.getField("minSdkVersion")); + } catch (Throwable suppressed) { + try { + dispatcher = new Dispatcher.ForLegacyVm(CfTranslator.class.getMethod("translate", + DirectClassFile.class, + byte[].class, + CfOptions.class, + DexOptions.class, + DexFile.class), DexOptions.class.getField("targetApiLevel")); + } catch (Throwable throwable) { + dispatcher = new Dispatcher.Unavailable(throwable.getMessage()); + } + } + } + DISPATCHER = dispatcher; + } + + /** + * Creates a default dex processor that ensures API version compatibility. + * + * @return A dex processor using an SDK compiler that ensures compatibility. + */ + protected static DexProcessor makeDefault() { + DexOptions dexOptions = new DexOptions(); + DISPATCHER.setTargetApi(dexOptions, DEX_COMPATIBLE_API_VERSION); + return new ForSdkCompiler(dexOptions, new CfOptions()); + } + + /** + * The file name extension of a Java class file. + */ + private static final String CLASS_FILE_EXTENSION = ".class"; + + /** + * Indicates that a dex file should be written without providing a human readable output. + */ + @AlwaysNull + private static final Writer NO_PRINT_OUTPUT = null; + + /** + * Indicates that the dex file creation should not be verbose. + */ + private static final boolean NOT_VERBOSE = false; + + /** + * The dex file options to be applied when converting a Java class file. + */ + private final DexOptions dexFileOptions; + + /** + * The dex compiler options to be applied when converting a Java class file. + */ + private final CfOptions dexCompilerOptions; + + /** + * Creates a new Android SDK dex compiler-based dex processor. + * + * @param dexFileOptions The dex file options to apply. + * @param dexCompilerOptions The dex compiler options to apply. + */ + public ForSdkCompiler(DexOptions dexFileOptions, CfOptions dexCompilerOptions) { + this.dexFileOptions = dexFileOptions; + this.dexCompilerOptions = dexCompilerOptions; + } + + /** + * {@inheritDoc} + */ + public DexProcessor.Conversion create() { + return new Conversion(new DexFile(dexFileOptions)); + } + + /** + * Represents a to-dex-file-conversion of a + * {@link net.bytebuddy.android.AndroidClassLoadingStrategy.DexProcessor.ForSdkCompiler}. + */ + protected class Conversion implements DexProcessor.Conversion { + + /** + * Indicates non-strict parsing of a class file. + */ + private static final boolean NON_STRICT = false; + + /** + * The dex file that is created by this conversion. + */ + private final DexFile dexFile; + + /** + * Creates a new ongoing to-dex-file conversion. + * + * @param dexFile The dex file that is created by this conversion. + */ + protected Conversion(DexFile dexFile) { + this.dexFile = dexFile; + } + + /** + * {@inheritDoc} + */ + public void register(String name, byte[] binaryRepresentation) { + DirectClassFile directClassFile = new DirectClassFile(binaryRepresentation, + name.replace('.', '/') + CLASS_FILE_EXTENSION, + NON_STRICT); + directClassFile.setAttributeFactory(new StdAttributeFactory()); + dexFile.add(DISPATCHER.translate(directClassFile, + binaryRepresentation, + dexCompilerOptions, + dexFileOptions, + new DexFile(dexFileOptions))); + } + + /** + * {@inheritDoc} + */ + public void drainTo(OutputStream outputStream) throws IOException { + dexFile.writeTo(outputStream, NO_PRINT_OUTPUT, NOT_VERBOSE); + } + } + + /** + * A dispatcher for translating a direct class file. + */ + protected interface Dispatcher { + + /** + * Creates a new class file definition. + * + * @param directClassFile The direct class file to translate. + * @param binaryRepresentation The file's binary representation. + * @param dexCompilerOptions The dex compiler options. + * @param dexFileOptions The dex file options. + * @param dexFile The dex file. + * @return The translated class file definition. + */ + ClassDefItem translate(DirectClassFile directClassFile, + byte[] binaryRepresentation, + CfOptions dexCompilerOptions, + DexOptions dexFileOptions, + DexFile dexFile); + + /** + * Sets the target API level if available. + * + * @param dexOptions The dex options to set the api version for + * @param targetApiLevel The target API level. + */ + void setTargetApi(DexOptions dexOptions, int targetApiLevel); + + /** + * An unavailable dispatcher. + */ + class Unavailable implements Dispatcher { + + /** + * A message explaining why the dispatcher is unavailable. + */ + private final String message; + + /** + * Creates a new unavailable dispatcher. + * + * @param message A message explaining why the dispatcher is unavailable. + */ + protected Unavailable(String message) { + this.message = message; + } + + /** + * {@inheritDoc} + */ + public ClassDefItem translate(DirectClassFile directClassFile, + byte[] binaryRepresentation, + CfOptions dexCompilerOptions, + DexOptions dexFileOptions, + DexFile dexFile) { + throw new IllegalStateException("Could not resolve dispatcher: " + message); + } + + /** + * {@inheritDoc} + */ + public void setTargetApi(DexOptions dexOptions, int targetApiLevel) { + throw new IllegalStateException("Could not resolve dispatcher: " + message); + } + } + + /** + * A dispatcher for a lagacy Android VM. + */ + class ForLegacyVm implements Dispatcher { + + /** + * The {@code CfTranslator#translate(DirectClassFile, byte[], CfOptions, DexOptions, DexFile)} method. + */ + private final Method translate; + + /** + * The {@code DexOptions#targetApiLevel} field. + */ + private final Field targetApi; + + /** + * Creates a new dispatcher. + * + * @param translate The {@code CfTranslator#translate(DirectClassFile, byte[], CfOptions, DexOptions, DexFile)} method. + * @param targetApi The {@code DexOptions#targetApiLevel} field. + */ + protected ForLegacyVm(Method translate, Field targetApi) { + this.translate = translate; + this.targetApi = targetApi; + } + + /** + * {@inheritDoc} + */ + public ClassDefItem translate(DirectClassFile directClassFile, + byte[] binaryRepresentation, + CfOptions dexCompilerOptions, + DexOptions dexFileOptions, + DexFile dexFile) { + try { + return (ClassDefItem) translate.invoke(null, + directClassFile, + binaryRepresentation, + dexCompilerOptions, + dexFileOptions, + dexFile); + } catch (IllegalAccessException exception) { + throw new IllegalStateException("Cannot access an Android dex file translation method", exception); + } catch (InvocationTargetException exception) { + throw new IllegalStateException("Cannot invoke Android dex file translation method", exception.getTargetException()); + } + } + + /** + * {@inheritDoc} + */ + public void setTargetApi(DexOptions dexOptions, int targetApiLevel) { + try { + targetApi.set(dexOptions, targetApiLevel); + } catch (IllegalAccessException exception) { + throw new IllegalStateException("Cannot access an Android dex file translation method", exception); + } + } + } + + /** + * A dispatcher for an Android VM with API level 26 or higher. + */ + class ForApi26LevelCompatibleVm implements Dispatcher { + + /** + * The {@code CfTranslator#translate(DxContext, DirectClassFile, byte[], CfOptions, DexOptions, DexFile)} method. + */ + private final Method translate; + + /** + * The {@code com.android.dx.command.dexer.DxContext#DxContext()} constructor. + */ + private final Constructor<?> dxContext; + + /** + * Creates a new dispatcher. + * + * @param translate The {@code CfTranslator#translate(DxContext, DirectClassFile, byte[], CfOptions, DexOptions, DexFile)} method. + * @param dxContext The {@code com.android.dx.command.dexer.DxContext#DxContext()} constructor. + */ + protected ForApi26LevelCompatibleVm(Method translate, Constructor<?> dxContext) { + this.translate = translate; + this.dxContext = dxContext; + } + + /** + * {@inheritDoc} + */ + public ClassDefItem translate(DirectClassFile directClassFile, + byte[] binaryRepresentation, + CfOptions dexCompilerOptions, + DexOptions dexFileOptions, + DexFile dexFile) { + try { + return (ClassDefItem) translate.invoke(null, + dxContext.newInstance(), + directClassFile, + binaryRepresentation, + dexCompilerOptions, + dexFileOptions, + dexFile); + } catch (IllegalAccessException exception) { + throw new IllegalStateException("Cannot access an Android dex file translation method", exception); + } catch (InstantiationException exception) { + throw new IllegalStateException("Cannot instantiate dex context", exception); + } catch (InvocationTargetException exception) { + throw new IllegalStateException("Cannot invoke Android dex file translation method", exception.getTargetException()); + } + } + + /** + * {@inheritDoc} + */ + public void setTargetApi(DexOptions dexOptions, int targetApiLevel) { + /* do nothing */ + } + } + } + } + } + + /** + * An Android class loading strategy that creates a wrapper class loader that loads any type. + */ + @RequiresApi(Build.VERSION_CODES.CUPCAKE) + public static class Wrapping extends AndroidClassLoadingStrategy { + + /** + * Creates a new wrapping class loading strategy for Android that uses the default SDK-compiler based dex processor. + * + * @param privateDirectory A directory that is <b>not shared with other applications</b> to be used for storing + * generated classes and their processed forms. + */ + public Wrapping(File privateDirectory) { + this(privateDirectory, DexProcessor.ForSdkCompiler.makeDefault()); + } + + /** + * Creates a new wrapping class loading strategy for Android. + * + * @param privateDirectory A directory that is <b>not shared with other applications</b> to be used for storing + * generated classes and their processed forms. + * @param dexProcessor The dex processor to be used for creating a dex file out of Java files. + */ + public Wrapping(File privateDirectory, DexProcessor dexProcessor) { + super(privateDirectory, dexProcessor); + } + + /** + * {@inheritDoc} + */ + protected Map<TypeDescription, Class<?>> doLoad(@MaybeNull ClassLoader classLoader, Set<TypeDescription> typeDescriptions, File jar) { + ClassLoader dexClassLoader = new DexClassLoader(jar.getAbsolutePath(), privateDirectory.getAbsolutePath(), EMPTY_LIBRARY_PATH, classLoader); + Map<TypeDescription, Class<?>> loadedTypes = new HashMap<TypeDescription, Class<?>>(); + for (TypeDescription typeDescription : typeDescriptions) { + try { + loadedTypes.put(typeDescription, Class.forName(typeDescription.getName(), false, dexClassLoader)); + } catch (ClassNotFoundException exception) { + throw new IllegalStateException("Cannot load " + typeDescription, exception); + } + } + return loadedTypes; + } + } + + /** + * An Android class loading strategy that injects types into the target class loader. + */ + @RequiresApi(Build.VERSION_CODES.CUPCAKE) + public static class Injecting extends AndroidClassLoadingStrategy { + + /** + * The dispatcher to use for loading a dex file. + */ + private static final Dispatcher DISPATCHER; + + /* + * Creates a dispatcher to use for loading a dex file. + */ + static { + Dispatcher dispatcher; + try { + dispatcher = new Dispatcher.ForAndroidPVm(BaseDexClassLoader.class.getMethod("addDexPath", String.class, boolean.class)); + } catch (Throwable ignored) { + dispatcher = Dispatcher.ForLegacyVm.INSTANCE; + } + DISPATCHER = dispatcher; + } + + /** + * Creates a new injecting class loading strategy for Android that uses the default SDK-compiler based dex processor. + * + * @param privateDirectory A directory that is <b>not shared with other applications</b> to be used for storing + * generated classes and their processed forms. + */ + public Injecting(File privateDirectory) { + this(privateDirectory, DexProcessor.ForSdkCompiler.makeDefault()); + } + + /** + * Creates a new injecting class loading strategy for Android. + * + * @param privateDirectory A directory that is <b>not shared with other applications</b> to be used for storing + * generated classes and their processed forms. + * @param dexProcessor The dex processor to be used for creating a dex file out of Java files. + */ + public Injecting(File privateDirectory, DexProcessor dexProcessor) { + super(privateDirectory, dexProcessor); + } + + /** + * {@inheritDoc} + */ + public Map<TypeDescription, Class<?>> load(@MaybeNull ClassLoader classLoader, Map<TypeDescription, byte[]> types) { + if (classLoader == null) { + throw new IllegalArgumentException("Cannot inject classes into the bootstrap class loader on Android"); + } + return super.load(classLoader, types); + } + + /** + * {@inheritDoc} + */ + protected Map<TypeDescription, Class<?>> doLoad(@MaybeNull ClassLoader classLoader, Set<TypeDescription> typeDescriptions, File jar) throws IOException { + dalvik.system.DexFile dexFile = DISPATCHER.loadDex(privateDirectory, jar, classLoader, randomString); + try { + Map<TypeDescription, Class<?>> loadedTypes = new HashMap<TypeDescription, Class<?>>(); + for (TypeDescription typeDescription : typeDescriptions) { + synchronized (classLoader) { // Guaranteed to be non-null by check in 'load' method. + Class<?> type = DISPATCHER.loadClass(dexFile, classLoader, typeDescription); + if (type == null) { + throw new IllegalStateException("Could not load " + typeDescription); + } + loadedTypes.put(typeDescription, type); + } + } + return loadedTypes; + } finally { + if (dexFile != null) { + dexFile.close(); + } + } + } + + /** + * A dispatcher for loading a dex file. + */ + protected interface Dispatcher { + + /** + * Loads a dex file. + * + * @param privateDirectory The private directory to use if required. + * @param jar The jar to load. + * @param classLoader The class loader to inject into. + * @param randomString The random string to use. + * @return The created {@link dalvik.system.DexFile} or {@code null} if no such file is created. + * @throws IOException If an I/O exception is thrown. + */ + @MaybeNull + dalvik.system.DexFile loadDex(File privateDirectory, File jar, @MaybeNull ClassLoader classLoader, RandomString randomString) throws IOException; + + /** + * Loads a class. + * + * @param dexFile The dex file to process if any was created. + * @param classLoader The class loader to load the class from. + * @param typeDescription The type to load. + * @return The loaded class. + */ + @MaybeNull + Class<?> loadClass(dalvik.system.DexFile dexFile, @MaybeNull ClassLoader classLoader, TypeDescription typeDescription); + + /** + * A dispatcher for legacy VMs that allow {@link dalvik.system.DexFile#loadDex(String, String, int)}. + */ + enum ForLegacyVm implements Dispatcher { + + /** + * The singleton instance. + */ + INSTANCE; + + /** + * A constant indicating the use of no flags. + */ + private static final int NO_FLAGS = 0; + + /** + * A file extension used for holding Android's optimized data. + */ + private static final String EXTENSION = ".data"; + + /** + * {@inheritDoc} + */ + @MaybeNull + public dalvik.system.DexFile loadDex(File privateDirectory, + File jar, + @MaybeNull ClassLoader classLoader, + RandomString randomString) throws IOException { + return dalvik.system.DexFile.loadDex(jar.getAbsolutePath(), + new File(privateDirectory.getAbsolutePath(), randomString.nextString() + EXTENSION).getAbsolutePath(), + NO_FLAGS); + } + + /** + * {@inheritDoc} + */ + @MaybeNull + public Class<?> loadClass(dalvik.system.DexFile dexFile, @MaybeNull ClassLoader classLoader, TypeDescription typeDescription) { + return dexFile.loadClass(typeDescription.getName(), classLoader); + } + } + + /** + * A dispatcher for an Android P VM that uses the reflection-only method {@code addDexPath} of {@link DexClassLoader}. + */ + class ForAndroidPVm implements Dispatcher { + + /** + * Indicates that this dispatcher does not return a {@link dalvik.system.DexFile} instance. + */ + @AlwaysNull + private static final dalvik.system.DexFile NO_RETURN_VALUE = null; + + /** + * The {@code BaseDexClassLoader#addDexPath(String, boolean)} method. + */ + private final Method addDexPath; + + /** + * Creates a new Android P-compatible dispatcher for loading a dex file. + * + * @param addDexPath The {@code BaseDexClassLoader#addDexPath(String, boolean)} method. + */ + protected ForAndroidPVm(Method addDexPath) { + this.addDexPath = addDexPath; + } + + /** + * {@inheritDoc} + */ + @MaybeNull + public dalvik.system.DexFile loadDex(File privateDirectory, + File jar, + @MaybeNull ClassLoader classLoader, + RandomString randomString) throws IOException { + if (!(classLoader instanceof BaseDexClassLoader)) { + throw new IllegalArgumentException("On Android P, a class injection can only be applied to BaseDexClassLoader: " + classLoader); + } + try { + // START CHROMIUM LOCAL MODIFICATION + addDexPath.invoke(classLoader, jar.getAbsolutePath(), false); + // END CHROMIUM LOCAL MODIFICATION + return NO_RETURN_VALUE; + } catch (IllegalAccessException exception) { + throw new IllegalStateException("Cannot access BaseDexClassLoader#addDexPath(String, boolean)", exception); + } catch (InvocationTargetException exception) { + Throwable cause = exception.getTargetException(); + if (cause instanceof IOException) { + throw (IOException) cause; + } else { + throw new IllegalStateException("Cannot invoke BaseDexClassLoader#addDexPath(String, boolean)", cause); + } + } + } + + /** + * {@inheritDoc} + */ + public Class<?> loadClass(@MaybeNull dalvik.system.DexFile dexFile, @MaybeNull ClassLoader classLoader, TypeDescription typeDescription) { + try { + return Class.forName(typeDescription.getName(), false, classLoader); + } catch (ClassNotFoundException exception) { + throw new IllegalStateException("Could not locate " + typeDescription, exception); + } + } + } + } + } +} \ No newline at end of file
diff --git a/third_party/byte_buddy/proguard.flags b/third_party/byte_buddy/proguard.flags index 6d13add4..8a2cf2f8 100644 --- a/third_party/byte_buddy/proguard.flags +++ b/third_party/byte_buddy/proguard.flags
@@ -3,7 +3,10 @@ # found in the LICENSE file. -dontwarn net.bytebuddy.** +-dontwarn com.sun.jna.** +-dontwarn edu.umd.cs.findbugs.annotations.SuppressFBWarnings +-dontwarn java.lang.instrument.** --keep class net.bytebuddy.** { +-keep class com.android.dx.**, net.bytebuddy.** { *; }
diff --git a/third_party/catapult b/third_party/catapult index d9aa189..ee96754 160000 --- a/third_party/catapult +++ b/third_party/catapult
@@ -1 +1 @@ -Subproject commit d9aa189385c2a4ec17be2f88291a6cd826ca62fd +Subproject commit ee967548fe6a699fc295d81bd05c8116bcaf5e7e
diff --git a/third_party/chromite b/third_party/chromite index 24d536b..0592ecc 160000 --- a/third_party/chromite +++ b/third_party/chromite
@@ -1 +1 @@ -Subproject commit 24d536be3fb5c0952c1fce422827d1077b2ee558 +Subproject commit 0592ecc29eed261523605aca05147096225eb883
diff --git a/third_party/chromium-variations b/third_party/chromium-variations index 9d9709a..61a1f74 160000 --- a/third_party/chromium-variations +++ b/third_party/chromium-variations
@@ -1 +1 @@ -Subproject commit 9d9709a512f866a5d5f129157b8545c46b2c44c6 +Subproject commit 61a1f74eb3fecaecda6e1ecfcbaae52fcbe2ea02
diff --git a/third_party/closure_compiler/externs/tabs.js b/third_party/closure_compiler/externs/tabs.js index 8e01dcae..fe11441 100644 --- a/third_party/closure_compiler/externs/tabs.js +++ b/third_party/closure_compiler/externs/tabs.js
@@ -62,6 +62,7 @@ * windowId: number, * openerTabId: (number|undefined), * selected: boolean, + * lastAccessed: number, * highlighted: boolean, * active: boolean, * pinned: boolean,
diff --git a/third_party/cros-components/src b/third_party/cros-components/src index ca55e0d..b4f7f5b 160000 --- a/third_party/cros-components/src +++ b/third_party/cros-components/src
@@ -1 +1 @@ -Subproject commit ca55e0d202b250efb4b91464090b31d79bf4b38e +Subproject commit b4f7f5b1b91f7c174be87a85b056c6b52f7fdf11
diff --git a/third_party/dawn b/third_party/dawn index 5b84675..58f8ed2 160000 --- a/third_party/dawn +++ b/third_party/dawn
@@ -1 +1 @@ -Subproject commit 5b846751ebc47dfdd36a185ae3ce177dc7ab0133 +Subproject commit 58f8ed20eee52baa84b9ce9c336e7b51278fe413
diff --git a/third_party/depot_tools b/third_party/depot_tools index 9e5fc28b..b5393e57 160000 --- a/third_party/depot_tools +++ b/third_party/depot_tools
@@ -1 +1 @@ -Subproject commit 9e5fc28b6b27ad4ffb4c3ddc66388e53e4f0f5b0 +Subproject commit b5393e57bb81eb1b6fbecbd7f466abcb61d278b4
diff --git a/third_party/devtools-frontend-internal b/third_party/devtools-frontend-internal index d567cf2..7268173 160000 --- a/third_party/devtools-frontend-internal +++ b/third_party/devtools-frontend-internal
@@ -1 +1 @@ -Subproject commit d567cf29ad32e9aaeac80a6f7f69a978c28c2aa0 +Subproject commit 7268173c709ac8cb6c9a61b79a22faf2b819cd1e
diff --git a/third_party/devtools-frontend/src b/third_party/devtools-frontend/src index 2c58d1b..3244a16 160000 --- a/third_party/devtools-frontend/src +++ b/third_party/devtools-frontend/src
@@ -1 +1 @@ -Subproject commit 2c58d1b91203d9e638f50506b6d9532189d3a671 +Subproject commit 3244a16141e7321b545e26eacd86748560134607
diff --git a/third_party/libc++/src b/third_party/libc++/src index 6cd38f6..0ad014c 160000 --- a/third_party/libc++/src +++ b/third_party/libc++/src
@@ -1 +1 @@ -Subproject commit 6cd38f6d30dda7bed3df08427db0b2a4e3fa9e47 +Subproject commit 0ad014cff4509d293e62d1d8c7ffd080bcb2f2d6
diff --git a/third_party/libc++abi/src b/third_party/libc++abi/src index c21fd38..4cb5c2c 160000 --- a/third_party/libc++abi/src +++ b/third_party/libc++abi/src
@@ -1 +1 @@ -Subproject commit c21fd3819a09fb151561b738ce1e4fdb6dbf3627 +Subproject commit 4cb5c2cefedc025433f81735bacbc0f773fdcd8f
diff --git a/third_party/libvpx/README.chromium b/third_party/libvpx/README.chromium index 789b718..7bf99c2 100644 --- a/third_party/libvpx/README.chromium +++ b/third_party/libvpx/README.chromium
@@ -1,7 +1,7 @@ Name: libvpx URL: https://chromium.googlesource.com/webm/libvpx Version: N/A -Revision: 9142314c2cec2be364e6844d1630a056e7b0a3c8 +Revision: 741b8f6228984e888c99849d7675ea4132eaf268 CPEPrefix: cpe:/a:webmproject:libvpx:1.13.1 License: BSD License File: source/libvpx/LICENSE
diff --git a/third_party/libvpx/source/config/vpx_version.h b/third_party/libvpx/source/config/vpx_version.h index f33dbee6..a7f891b6 100644 --- a/third_party/libvpx/source/config/vpx_version.h +++ b/third_party/libvpx/source/config/vpx_version.h
@@ -2,8 +2,8 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 13 #define VERSION_PATCH 1 -#define VERSION_EXTRA "530-g9142314c2" +#define VERSION_EXTRA "534-g741b8f622" #define VERSION_PACKED \ ((VERSION_MAJOR << 16) | (VERSION_MINOR << 8) | (VERSION_PATCH)) -#define VERSION_STRING_NOSP "v1.13.1-530-g9142314c2" -#define VERSION_STRING " v1.13.1-530-g9142314c2" +#define VERSION_STRING_NOSP "v1.13.1-534-g741b8f622" +#define VERSION_STRING " v1.13.1-534-g741b8f622"
diff --git a/third_party/libvpx/source/libvpx b/third_party/libvpx/source/libvpx index 9142314..741b8f6 160000 --- a/third_party/libvpx/source/libvpx +++ b/third_party/libvpx/source/libvpx
@@ -1 +1 @@ -Subproject commit 9142314c2cec2be364e6844d1630a056e7b0a3c8 +Subproject commit 741b8f6228984e888c99849d7675ea4132eaf268
diff --git a/third_party/mockito/proguard.flags b/third_party/mockito/proguard.flags index 86265d6..c2808bd6 100644 --- a/third_party/mockito/proguard.flags +++ b/third_party/mockito/proguard.flags
@@ -9,8 +9,3 @@ -keep class org.mockito.** { *; } - -# Packages that Mockito depends on: --keep class com.android.dx.**, net.bytebuddy.** { - *; -}
diff --git a/third_party/pdfium b/third_party/pdfium index 40d92c4..d06523d 160000 --- a/third_party/pdfium +++ b/third_party/pdfium
@@ -1 +1 @@ -Subproject commit 40d92c45b3aaf51cf033360e06ab497a2d6afdc8 +Subproject commit d06523d84bb3152be44a07e8cf0ca7fe30c8bc8e
diff --git a/third_party/skia b/third_party/skia index 38e60fd..2f01d50 160000 --- a/third_party/skia +++ b/third_party/skia
@@ -1 +1 @@ -Subproject commit 38e60fd69349502a6cd44962133cae1936167352 +Subproject commit 2f01d500a3527e3bbe031b5d8030537cc6c19c30
diff --git a/third_party/swiftshader b/third_party/swiftshader index 35b1a50..4befa3a 160000 --- a/third_party/swiftshader +++ b/third_party/swiftshader
@@ -1 +1 @@ -Subproject commit 35b1a501141a4c77353376fc47121e95d2559e9a +Subproject commit 4befa3ada54ce2fbdadb2383712da70811efe85e
diff --git a/third_party/webgpu-cts/src b/third_party/webgpu-cts/src index 2979ce0..2480dfa 160000 --- a/third_party/webgpu-cts/src +++ b/third_party/webgpu-cts/src
@@ -1 +1 @@ -Subproject commit 2979ce07231ba66e06675c83e1cdd3c483165820 +Subproject commit 2480dfa32642f7baeb3cd02a13833bc353d1adec
diff --git a/third_party/webgpu-cts/ts_sources.txt b/third_party/webgpu-cts/ts_sources.txt index a919854..dfc621f 100644 --- a/third_party/webgpu-cts/ts_sources.txt +++ b/third_party/webgpu-cts/ts_sources.txt
@@ -122,7 +122,9 @@ src/unittests/crc32.spec.ts src/webgpu/shader/execution/expression/case_cache.ts src/webgpu/util/compare.ts -src/webgpu/shader/execution/expression/expression.ts +src/webgpu/shader/execution/expression/expectation.ts +src/webgpu/shader/execution/expression/case.ts +src/webgpu/shader/execution/expression/interval_filter.ts src/webgpu/util/floating_point.ts src/unittests/floating_point.spec.ts src/unittests/getStackTrace.spec.ts @@ -357,68 +359,121 @@ src/webgpu/shader/execution/robust_access_vertex.spec.ts src/webgpu/shader/execution/shadow.spec.ts src/webgpu/shader/execution/zero_init.spec.ts +src/webgpu/shader/execution/expression/expression.ts +src/webgpu/shader/execution/expression/binary/af_addition.cache.ts src/webgpu/shader/execution/expression/binary/binary.ts src/webgpu/shader/execution/expression/binary/af_addition.spec.ts +src/webgpu/shader/execution/expression/binary/af_comparison.cache.ts src/webgpu/shader/execution/expression/binary/af_comparison.spec.ts +src/webgpu/shader/execution/expression/binary/af_division.cache.ts src/webgpu/shader/execution/expression/binary/af_division.spec.ts +src/webgpu/shader/execution/expression/binary/af_matrix_addition.cache.ts src/webgpu/shader/execution/expression/binary/af_matrix_addition.spec.ts +src/webgpu/shader/execution/expression/binary/af_matrix_subtraction.cache.ts src/webgpu/shader/execution/expression/binary/af_matrix_subtraction.spec.ts +src/webgpu/shader/execution/expression/binary/af_multiplication.cache.ts src/webgpu/shader/execution/expression/binary/af_multiplication.spec.ts +src/webgpu/shader/execution/expression/binary/af_remainder.cache.ts src/webgpu/shader/execution/expression/binary/af_remainder.spec.ts +src/webgpu/shader/execution/expression/binary/af_subtraction.cache.ts src/webgpu/shader/execution/expression/binary/af_subtraction.spec.ts src/webgpu/shader/execution/expression/binary/bitwise.spec.ts src/webgpu/shader/execution/expression/binary/bitwise_shift.spec.ts src/webgpu/shader/execution/expression/binary/bool_logical.spec.ts +src/webgpu/shader/execution/expression/binary/f16_addition.cache.ts src/webgpu/shader/execution/expression/binary/f16_addition.spec.ts +src/webgpu/shader/execution/expression/binary/f16_comparison.cache.ts src/webgpu/shader/execution/expression/binary/f16_comparison.spec.ts +src/webgpu/shader/execution/expression/binary/f16_division.cache.ts src/webgpu/shader/execution/expression/binary/f16_division.spec.ts +src/webgpu/shader/execution/expression/binary/f16_matrix_addition.cache.ts src/webgpu/shader/execution/expression/binary/f16_matrix_addition.spec.ts +src/webgpu/shader/execution/expression/binary/f16_matrix_matrix_multiplication.cache.ts src/webgpu/shader/execution/expression/binary/f16_matrix_matrix_multiplication.spec.ts +src/webgpu/shader/execution/expression/binary/f16_matrix_scalar_multiplication.cache.ts src/webgpu/shader/execution/expression/binary/f16_matrix_scalar_multiplication.spec.ts +src/webgpu/shader/execution/expression/binary/f16_matrix_subtraction.cache.ts src/webgpu/shader/execution/expression/binary/f16_matrix_subtraction.spec.ts +src/webgpu/shader/execution/expression/binary/f16_matrix_vector_multiplication.cache.ts src/webgpu/shader/execution/expression/binary/f16_matrix_vector_multiplication.spec.ts +src/webgpu/shader/execution/expression/binary/f16_multiplication.cache.ts src/webgpu/shader/execution/expression/binary/f16_multiplication.spec.ts +src/webgpu/shader/execution/expression/binary/f16_remainder.cache.ts src/webgpu/shader/execution/expression/binary/f16_remainder.spec.ts +src/webgpu/shader/execution/expression/binary/f16_subtraction.cache.ts src/webgpu/shader/execution/expression/binary/f16_subtraction.spec.ts +src/webgpu/shader/execution/expression/binary/f32_addition.cache.ts src/webgpu/shader/execution/expression/binary/f32_addition.spec.ts +src/webgpu/shader/execution/expression/binary/f32_comparison.cache.ts src/webgpu/shader/execution/expression/binary/f32_comparison.spec.ts +src/webgpu/shader/execution/expression/binary/f32_division.cache.ts src/webgpu/shader/execution/expression/binary/f32_division.spec.ts +src/webgpu/shader/execution/expression/binary/f32_matrix_addition.cache.ts src/webgpu/shader/execution/expression/binary/f32_matrix_addition.spec.ts +src/webgpu/shader/execution/expression/binary/f32_matrix_matrix_multiplication.cache.ts src/webgpu/shader/execution/expression/binary/f32_matrix_matrix_multiplication.spec.ts +src/webgpu/shader/execution/expression/binary/f32_matrix_scalar_multiplication.cache.ts src/webgpu/shader/execution/expression/binary/f32_matrix_scalar_multiplication.spec.ts +src/webgpu/shader/execution/expression/binary/f32_matrix_subtraction.cache.ts src/webgpu/shader/execution/expression/binary/f32_matrix_subtraction.spec.ts +src/webgpu/shader/execution/expression/binary/f32_matrix_vector_multiplication.cache.ts src/webgpu/shader/execution/expression/binary/f32_matrix_vector_multiplication.spec.ts +src/webgpu/shader/execution/expression/binary/f32_multiplication.cache.ts src/webgpu/shader/execution/expression/binary/f32_multiplication.spec.ts +src/webgpu/shader/execution/expression/binary/f32_remainder.cache.ts src/webgpu/shader/execution/expression/binary/f32_remainder.spec.ts +src/webgpu/shader/execution/expression/binary/f32_subtraction.cache.ts src/webgpu/shader/execution/expression/binary/f32_subtraction.spec.ts +src/webgpu/shader/execution/expression/binary/i32_arithmetic.cache.ts src/webgpu/shader/execution/expression/binary/i32_arithmetic.spec.ts +src/webgpu/shader/execution/expression/binary/i32_comparison.cache.ts src/webgpu/shader/execution/expression/binary/i32_comparison.spec.ts +src/webgpu/shader/execution/expression/binary/u32_arithmetic.cache.ts src/webgpu/shader/execution/expression/binary/u32_arithmetic.spec.ts +src/webgpu/shader/execution/expression/binary/u32_comparison.cache.ts src/webgpu/shader/execution/expression/binary/u32_comparison.spec.ts +src/webgpu/shader/execution/expression/call/builtin/abs.cache.ts src/webgpu/shader/execution/expression/call/builtin/builtin.ts src/webgpu/shader/execution/expression/call/builtin/abs.spec.ts +src/webgpu/shader/execution/expression/call/builtin/acos.cache.ts src/webgpu/shader/execution/expression/call/builtin/acos.spec.ts +src/webgpu/shader/execution/expression/call/builtin/acosh.cache.ts src/webgpu/shader/execution/expression/call/builtin/acosh.spec.ts src/webgpu/shader/execution/expression/call/builtin/all.spec.ts src/webgpu/shader/execution/expression/call/builtin/any.spec.ts src/webgpu/shader/execution/expression/call/builtin/arrayLength.spec.ts +src/webgpu/shader/execution/expression/call/builtin/asin.cache.ts src/webgpu/shader/execution/expression/call/builtin/asin.spec.ts +src/webgpu/shader/execution/expression/call/builtin/asinh.cache.ts src/webgpu/shader/execution/expression/call/builtin/asinh.spec.ts +src/webgpu/shader/execution/expression/call/builtin/atan.cache.ts src/webgpu/shader/execution/expression/call/builtin/atan.spec.ts +src/webgpu/shader/execution/expression/call/builtin/atan2.cache.ts src/webgpu/shader/execution/expression/call/builtin/atan2.spec.ts +src/webgpu/shader/execution/expression/call/builtin/atanh.cache.ts src/webgpu/shader/execution/expression/call/builtin/atanh.spec.ts +src/webgpu/shader/execution/expression/call/builtin/bitcast.cache.ts src/webgpu/shader/execution/expression/call/builtin/bitcast.spec.ts +src/webgpu/shader/execution/expression/call/builtin/ceil.cache.ts src/webgpu/shader/execution/expression/call/builtin/ceil.spec.ts +src/webgpu/shader/execution/expression/call/builtin/clamp.cache.ts src/webgpu/shader/execution/expression/call/builtin/clamp.spec.ts +src/webgpu/shader/execution/expression/call/builtin/cos.cache.ts src/webgpu/shader/execution/expression/call/builtin/cos.spec.ts +src/webgpu/shader/execution/expression/call/builtin/cosh.cache.ts src/webgpu/shader/execution/expression/call/builtin/cosh.spec.ts src/webgpu/shader/execution/expression/call/builtin/countLeadingZeros.spec.ts src/webgpu/shader/execution/expression/call/builtin/countOneBits.spec.ts src/webgpu/shader/execution/expression/call/builtin/countTrailingZeros.spec.ts +src/webgpu/shader/execution/expression/call/builtin/cross.cache.ts src/webgpu/shader/execution/expression/call/builtin/cross.spec.ts +src/webgpu/shader/execution/expression/call/builtin/degrees.cache.ts src/webgpu/shader/execution/expression/call/builtin/degrees.spec.ts +src/webgpu/shader/execution/expression/call/builtin/determinant.cache.ts src/webgpu/shader/execution/expression/call/builtin/determinant.spec.ts +src/webgpu/shader/execution/expression/call/builtin/distance.cache.ts src/webgpu/shader/execution/expression/call/builtin/distance.spec.ts +src/webgpu/shader/execution/expression/call/builtin/dot.cache.ts src/webgpu/shader/execution/expression/call/builtin/dot.spec.ts src/webgpu/shader/execution/expression/call/builtin/dpdx.spec.ts src/webgpu/shader/execution/expression/call/builtin/dpdxCoarse.spec.ts @@ -426,52 +481,85 @@ src/webgpu/shader/execution/expression/call/builtin/dpdy.spec.ts src/webgpu/shader/execution/expression/call/builtin/dpdyCoarse.spec.ts src/webgpu/shader/execution/expression/call/builtin/dpdyFine.spec.ts +src/webgpu/shader/execution/expression/call/builtin/exp.cache.ts src/webgpu/shader/execution/expression/call/builtin/exp.spec.ts +src/webgpu/shader/execution/expression/call/builtin/exp2.cache.ts src/webgpu/shader/execution/expression/call/builtin/exp2.spec.ts src/webgpu/shader/execution/expression/call/builtin/extractBits.spec.ts +src/webgpu/shader/execution/expression/call/builtin/faceForward.cache.ts src/webgpu/shader/execution/expression/call/builtin/faceForward.spec.ts src/webgpu/shader/execution/expression/call/builtin/firstLeadingBit.spec.ts src/webgpu/shader/execution/expression/call/builtin/firstTrailingBit.spec.ts +src/webgpu/shader/execution/expression/call/builtin/floor.cache.ts src/webgpu/shader/execution/expression/call/builtin/floor.spec.ts +src/webgpu/shader/execution/expression/call/builtin/fma.cache.ts src/webgpu/shader/execution/expression/call/builtin/fma.spec.ts +src/webgpu/shader/execution/expression/call/builtin/fract.cache.ts src/webgpu/shader/execution/expression/call/builtin/fract.spec.ts +src/webgpu/shader/execution/expression/call/builtin/frexp.cache.ts src/webgpu/shader/execution/expression/call/builtin/frexp.spec.ts src/webgpu/shader/execution/expression/call/builtin/fwidth.spec.ts src/webgpu/shader/execution/expression/call/builtin/fwidthCoarse.spec.ts src/webgpu/shader/execution/expression/call/builtin/fwidthFine.spec.ts src/webgpu/shader/execution/expression/call/builtin/insertBits.spec.ts +src/webgpu/shader/execution/expression/call/builtin/inversesqrt.cache.ts src/webgpu/shader/execution/expression/call/builtin/inversesqrt.spec.ts +src/webgpu/shader/execution/expression/call/builtin/ldexp.cache.ts src/webgpu/shader/execution/expression/call/builtin/ldexp.spec.ts +src/webgpu/shader/execution/expression/call/builtin/length.cache.ts src/webgpu/shader/execution/expression/call/builtin/length.spec.ts +src/webgpu/shader/execution/expression/call/builtin/log.cache.ts src/webgpu/shader/execution/expression/call/builtin/log.spec.ts +src/webgpu/shader/execution/expression/call/builtin/log2.cache.ts src/webgpu/shader/execution/expression/call/builtin/log2.spec.ts +src/webgpu/shader/execution/expression/call/builtin/max.cache.ts src/webgpu/shader/execution/expression/call/builtin/max.spec.ts +src/webgpu/shader/execution/expression/call/builtin/min.cache.ts src/webgpu/shader/execution/expression/call/builtin/min.spec.ts +src/webgpu/shader/execution/expression/call/builtin/mix.cache.ts src/webgpu/shader/execution/expression/call/builtin/mix.spec.ts +src/webgpu/shader/execution/expression/call/builtin/modf.cache.ts src/webgpu/shader/execution/expression/call/builtin/modf.spec.ts +src/webgpu/shader/execution/expression/call/builtin/normalize.cache.ts src/webgpu/shader/execution/expression/call/builtin/normalize.spec.ts +src/webgpu/shader/execution/expression/call/builtin/pack2x16float.cache.ts src/webgpu/shader/execution/expression/call/builtin/pack2x16float.spec.ts src/webgpu/shader/execution/expression/call/builtin/pack2x16snorm.spec.ts src/webgpu/shader/execution/expression/call/builtin/pack2x16unorm.spec.ts src/webgpu/shader/execution/expression/call/builtin/pack4x8snorm.spec.ts src/webgpu/shader/execution/expression/call/builtin/pack4x8unorm.spec.ts +src/webgpu/shader/execution/expression/call/builtin/pow.cache.ts src/webgpu/shader/execution/expression/call/builtin/pow.spec.ts +src/webgpu/shader/execution/expression/call/builtin/quantizeToF16.cache.ts src/webgpu/shader/execution/expression/call/builtin/quantizeToF16.spec.ts +src/webgpu/shader/execution/expression/call/builtin/radians.cache.ts src/webgpu/shader/execution/expression/call/builtin/radians.spec.ts +src/webgpu/shader/execution/expression/call/builtin/reflect.cache.ts src/webgpu/shader/execution/expression/call/builtin/reflect.spec.ts +src/webgpu/shader/execution/expression/call/builtin/refract.cache.ts src/webgpu/shader/execution/expression/call/builtin/refract.spec.ts src/webgpu/shader/execution/expression/call/builtin/reverseBits.spec.ts +src/webgpu/shader/execution/expression/call/builtin/round.cache.ts src/webgpu/shader/execution/expression/call/builtin/round.spec.ts +src/webgpu/shader/execution/expression/call/builtin/saturate.cache.ts src/webgpu/shader/execution/expression/call/builtin/saturate.spec.ts src/webgpu/shader/execution/expression/call/builtin/select.spec.ts +src/webgpu/shader/execution/expression/call/builtin/sign.cache.ts src/webgpu/shader/execution/expression/call/builtin/sign.spec.ts +src/webgpu/shader/execution/expression/call/builtin/sin.cache.ts src/webgpu/shader/execution/expression/call/builtin/sin.spec.ts +src/webgpu/shader/execution/expression/call/builtin/sinh.cache.ts src/webgpu/shader/execution/expression/call/builtin/sinh.spec.ts +src/webgpu/shader/execution/expression/call/builtin/smoothstep.cache.ts src/webgpu/shader/execution/expression/call/builtin/smoothstep.spec.ts +src/webgpu/shader/execution/expression/call/builtin/sqrt.cache.ts src/webgpu/shader/execution/expression/call/builtin/sqrt.spec.ts +src/webgpu/shader/execution/expression/call/builtin/step.cache.ts src/webgpu/shader/execution/expression/call/builtin/step.spec.ts src/webgpu/shader/execution/expression/call/builtin/storageBarrier.spec.ts +src/webgpu/shader/execution/expression/call/builtin/tan.cache.ts src/webgpu/shader/execution/expression/call/builtin/tan.spec.ts +src/webgpu/shader/execution/expression/call/builtin/tanh.cache.ts src/webgpu/shader/execution/expression/call/builtin/tanh.spec.ts src/webgpu/shader/execution/expression/call/builtin/textureDimension.spec.ts src/webgpu/shader/execution/expression/call/builtin/utils.ts @@ -488,12 +576,19 @@ src/webgpu/shader/execution/expression/call/builtin/textureSampleGrad.spec.ts src/webgpu/shader/execution/expression/call/builtin/textureSampleLevel.spec.ts src/webgpu/shader/execution/expression/call/builtin/textureStore.spec.ts +src/webgpu/shader/execution/expression/call/builtin/transpose.cache.ts src/webgpu/shader/execution/expression/call/builtin/transpose.spec.ts +src/webgpu/shader/execution/expression/call/builtin/trunc.cache.ts src/webgpu/shader/execution/expression/call/builtin/trunc.spec.ts +src/webgpu/shader/execution/expression/call/builtin/unpack2x16float.cache.ts src/webgpu/shader/execution/expression/call/builtin/unpack2x16float.spec.ts +src/webgpu/shader/execution/expression/call/builtin/unpack2x16snorm.cache.ts src/webgpu/shader/execution/expression/call/builtin/unpack2x16snorm.spec.ts +src/webgpu/shader/execution/expression/call/builtin/unpack2x16unorm.cache.ts src/webgpu/shader/execution/expression/call/builtin/unpack2x16unorm.spec.ts +src/webgpu/shader/execution/expression/call/builtin/unpack4x8snorm.cache.ts src/webgpu/shader/execution/expression/call/builtin/unpack4x8snorm.spec.ts +src/webgpu/shader/execution/expression/call/builtin/unpack4x8unorm.cache.ts src/webgpu/shader/execution/expression/call/builtin/unpack4x8unorm.spec.ts src/webgpu/shader/execution/expression/call/builtin/workgroupBarrier.spec.ts src/webgpu/shader/execution/expression/call/builtin/atomics/harness.ts @@ -508,19 +603,31 @@ src/webgpu/shader/execution/expression/call/builtin/atomics/atomicStore.spec.ts src/webgpu/shader/execution/expression/call/builtin/atomics/atomicSub.spec.ts src/webgpu/shader/execution/expression/call/builtin/atomics/atomicXor.spec.ts +src/webgpu/shader/execution/expression/unary/af_arithmetic.cache.ts src/webgpu/shader/execution/expression/unary/unary.ts src/webgpu/shader/execution/expression/unary/af_arithmetic.spec.ts +src/webgpu/shader/execution/expression/unary/af_assignment.cache.ts src/webgpu/shader/execution/expression/unary/af_assignment.spec.ts +src/webgpu/shader/execution/expression/unary/bool_conversion.cache.ts src/webgpu/shader/execution/expression/unary/bool_conversion.spec.ts src/webgpu/shader/execution/expression/unary/bool_logical.spec.ts +src/webgpu/shader/execution/expression/unary/f16_arithmetic.cache.ts src/webgpu/shader/execution/expression/unary/f16_arithmetic.spec.ts +src/webgpu/shader/execution/expression/unary/f16_conversion.cache.ts src/webgpu/shader/execution/expression/unary/f16_conversion.spec.ts +src/webgpu/shader/execution/expression/unary/f32_arithmetic.cache.ts src/webgpu/shader/execution/expression/unary/f32_arithmetic.spec.ts +src/webgpu/shader/execution/expression/unary/f32_conversion.cache.ts src/webgpu/shader/execution/expression/unary/f32_conversion.spec.ts +src/webgpu/shader/execution/expression/unary/i32_arithmetic.cache.ts src/webgpu/shader/execution/expression/unary/i32_arithmetic.spec.ts +src/webgpu/shader/execution/expression/unary/i32_complement.cache.ts src/webgpu/shader/execution/expression/unary/i32_complement.spec.ts +src/webgpu/shader/execution/expression/unary/i32_conversion.cache.ts src/webgpu/shader/execution/expression/unary/i32_conversion.spec.ts +src/webgpu/shader/execution/expression/unary/u32_complement.cache.ts src/webgpu/shader/execution/expression/unary/u32_complement.spec.ts +src/webgpu/shader/execution/expression/unary/u32_conversion.cache.ts src/webgpu/shader/execution/expression/unary/u32_conversion.spec.ts src/webgpu/shader/execution/flow_control/harness.ts src/webgpu/shader/execution/flow_control/call.spec.ts
diff --git a/third_party/webrtc b/third_party/webrtc index ee46340..59d0b8d 160000 --- a/third_party/webrtc +++ b/third_party/webrtc
@@ -1 +1 @@ -Subproject commit ee46340054fac6072259be0d7f43263299d9b88b +Subproject commit 59d0b8de33f2195895dc7765e0f9919352e0c45c
diff --git a/third_party/zlib/contrib/optimizations/inflate.c b/third_party/zlib/contrib/optimizations/inflate.c index 2a8e0ef7..c535c5af 100644 --- a/third_party/zlib/contrib/optimizations/inflate.c +++ b/third_party/zlib/contrib/optimizations/inflate.c
@@ -1422,7 +1422,7 @@ /* if first time, start search in bit buffer */ if (state->mode != SYNC) { state->mode = SYNC; - state->hold <<= state->bits & 7; + state->hold >>= state->bits & 7; state->bits -= state->bits & 7; len = 0; while (state->bits >= 8) {
diff --git a/third_party/zlib/inflate.c b/third_party/zlib/inflate.c index 5abbd07..0990ae7 100644 --- a/third_party/zlib/inflate.c +++ b/third_party/zlib/inflate.c
@@ -1389,7 +1389,7 @@ /* if first time, start search in bit buffer */ if (state->mode != SYNC) { state->mode = SYNC; - state->hold <<= state->bits & 7; + state->hold >>= state->bits & 7; state->bits -= state->bits & 7; len = 0; while (state->bits >= 8) {
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py index 1ac8dfd..fbcaf3b 100755 --- a/tools/clang/scripts/update.py +++ b/tools/clang/scripts/update.py
@@ -35,7 +35,7 @@ # https://chromium.googlesource.com/chromium/src/+/main/docs/updating_clang.md # Reverting problematic clang rolls is safe, though. # This is the output of `git describe` and is usable as a commit-ish. -CLANG_REVISION = 'llvmorg-18-init-12422-g74cdb8e6' +CLANG_REVISION = 'llvmorg-18-init-12938-geb1d5065' CLANG_SUB_REVISION = 1 PACKAGE_VERSION = '%s-%s' % (CLANG_REVISION, CLANG_SUB_REVISION)
diff --git a/tools/mb/PRESUBMIT.py b/tools/mb/PRESUBMIT.py index fef2264..81e07339 100644 --- a/tools/mb/PRESUBMIT.py +++ b/tools/mb/PRESUBMIT.py
@@ -8,8 +8,8 @@ # The time module's handling of timezones is abysmal, so the boundaries are # precomputed in UNIX time -_FREEZE_START = 1671177600 # 2022/12/16 00:00 -0800 -_FREEZE_END = 1672646400 # 2023/01/02 00:00 -0800 +_FREEZE_START = 1702627200 # 2023/12/15 00:00 -0800 +_FREEZE_END = 1704182400 # 2024/01/02 00:00 -0800 def CheckFreeze(input_api, output_api):
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 4a4afa2..a021273 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -221,7 +221,7 @@ 'linux-perfetto-rel': 'perfetto_release_bot_reclient', 'linux-rel-no-external-ip': 'gpu_tests_release_bot_do_typecheck_reclient', 'linux-upload-perfetto': 'release_bot_perfetto_zlib_reclient', - 'linux-wpt-chromium-rel': 'release_bot_blink_minimal_symbols_reclient', + 'linux-wpt-chromium-rel': 'release_bot_blink_minimal_symbols_reclient_dcheck_always_on', 'linux-wpt-content-shell-asan-fyi-rel': 'asan_lsan_release_trybot_reclient', 'linux-wpt-content-shell-fyi-rel': 'release_bot_blink_minimal_symbols_reclient', 'linux-wpt-content-shell-leak-detection': 'release_bot_blink_minimal_symbols_reclient', @@ -329,32 +329,6 @@ 'codesearch-gen-chromium-win': 'codesearch_gen_chromium_bot_reclient', }, - 'chromium.memory': { - 'Linux ASan LSan Builder': 'asan_lsan_failsan_release_trybot_reclient', - 'Linux CFI': 'cfi_full_cfi_icall_cfi_diag_thin_lto_release_static_dcheck_always_on_reclient', - 'Linux Chromium OS ASan LSan Builder': 'asan_lsan_chromeos_release_bot_dcheck_always_on_reclient', - 'Linux ChromiumOS MSan Builder': 'chromeos_msan_release_bot_reclient', - 'Linux MSan Builder': 'msan_release_bot_reclient', - 'Linux TSan Builder': 'tsan_disable_nacl_release_bot_reclient', - 'Mac ASan 64 Builder': 'asan_minimal_symbols_disable_nacl_release_bot_dcheck_always_on_reclient', - 'WebKit Linux ASAN': 'asan_lsan_release_bot_blink', - 'WebKit Linux Leak': 'release_bot_blink', - 'WebKit Linux MSAN': 'msan_release_bot_blink', - 'android-asan': 'android_clang_asan_release_bot_reclient', - 'ios-asan': 'ios_simulator_release_static_asan_bot_xctest_reclient', - 'linux-lacros-asan-lsan-rel': 'asan_lsan_lacros_release_bot_dcheck_always_on_reclient', - 'linux-ubsan-vptr': 'ubsan_vptr_release_bot_reclient', - 'win-asan': 'asan_clang_fuzzer_static_v8_heap_minimal_symbols_release_reclient', - }, - - 'chromium.memory.fyi': { - 'linux-exp-asan-lsan-fyi-rel': 'asan_lsan_failsan_release_trybot_reclient', - 'linux-exp-msan-fyi-rel': 'msan_failsan_release_bot_reclient', - 'linux-exp-tsan-fyi-rel': 'tsan_disable_nacl_failsan_release_bot_reclient', - 'linux-ubsan-fyi-rel': 'ubsan_no_recover_release_bot_reclient', - 'mac-lsan-fyi-rel': 'asan_lsan_dcheck_disable_nacl_release_bot_reclient', - }, - 'chromium.perf': { 'Android Builder Perf': 'official_reclient_minimal_symbols_android', 'Android arm64 Builder Perf': 'official_minimal_symbols_android_arm64', @@ -415,17 +389,6 @@ 'win64-builder-perf-pgo': 'official_reclient_perf_pgo', }, - 'chromium.rust': { - 'android-rust-arm32-rel': 'release_rust_android_arm32_reclient', - 'android-rust-arm64-dbg': 'debug_bot_rust_android_arm64_reclient', - 'android-rust-arm64-rel': 'release_rust_android_arm64_reclient', - 'linux-rust-x64-dbg': 'debug_bot_rust_desktop_x64_reclient', - 'linux-rust-x64-rel': 'release_rust_desktop_x64_reclient', - 'mac-rust-x64-dbg': 'debug_bot_rust_desktop_x64_reclient', - 'win-rust-x64-dbg': 'debug_bot_rust_desktop_x64_reclient', - 'win-rust-x64-rel': 'release_rust_desktop_x64_reclient', - }, - # TODO(crbug.com/818301): This group is going away. 'chromium.webkit': { 'WebKit Linux Trusty ASAN': 'asan_lsan_release_bot', @@ -552,7 +515,7 @@ # cause them to produce different baselines than the release # waterfall bots, and run_web_tests.py can't handle that (by design). 'linux-blink-rel': 'release_bot_blink_minimal_symbols_reclient', - 'linux-wpt-chromium-rel': 'release_bot_blink_minimal_symbols_reclient', + 'linux-wpt-chromium-rel': 'release_bot_blink_minimal_symbols_reclient_dcheck_always_on', 'mac10.15-blink-rel': 'release_bot_blink_minimal_symbols_no_nacl_reclient', 'mac11.0-blink-rel': 'release_bot_blink_minimal_symbols_no_nacl_reclient', 'mac11.0.arm64-blink-rel': 'release_bot_blink_arm64_minimal_symbols_reclient', @@ -629,7 +592,6 @@ }, 'tryserver.chromium.android': { - 'android-asan': 'android_clang_asan_release_trybot_reclient', 'android-clobber-rel': 'android_release_trybot_reclient', 'android-cronet-lollipop-arm-rel': 'android_cronet_release_bot_minimal_symbols_arm_no_neon', 'android-cronet-marshmallow-arm64-rel': 'android_cronet_release_trybot_arm64', @@ -699,7 +661,6 @@ 'gpu-fyi-try-linux-nvidia-tsn': 'gpu_fyi_tests_release_trybot_tsan_reclient', 'gpu-try-linux-nvidia-dbg': 'gpu_tests_debug_bot_reclient', 'gpu-try-linux-nvidia-rel': 'gpu_tests_release_trybot_reclient', - 'layout_test_leak_detection': 'release_trybot_reclient', 'linux-afl-asan-rel': 'afl_asan_release_trybot_reclient', 'linux-annotator-rel': 'release_trybot_reclient', 'linux-blink-heap-concurrent-marking-tsan-rel': 'release_trybot_tsan', @@ -708,12 +669,8 @@ 'linux-clobber-rel': 'release_trybot_reclient', 'linux-cr23-rel': 'release_trybot_reclient', 'linux-dcheck-off-rel': 'release_trybot_dcheck_off_reclient', - 'linux-exp-asan-lsan-fyi-rel': 'asan_lsan_failsan_release_trybot_reclient', - 'linux-exp-msan-fyi-rel': 'msan_failsan_release_bot_reclient', - 'linux-exp-tsan-fyi-rel': 'tsan_disable_nacl_failsan_release_bot_reclient', 'linux-fieldtrial-rel': 'release_bot_minimal_symbols_reclient', 'linux-headless-shell-rel': 'headless_shell_release_bot_reclient_use_dummy_lastchange', - 'linux-lacros-asan-lsan-rel': 'asan_lsan_lacros_release_bot_dcheck_always_on_reclient', 'linux-lacros-fyi-rel': 'lacros_on_linux_release_trybot_reclient', 'linux-lacros-version-skew-fyi': 'lacros_on_linux_release_not_build_ash_bot_reclient', 'linux-layout-tests-edit-ng': 'release_trybot_reclient', @@ -721,30 +678,14 @@ 'linux-mbi-mode-per-render-process-host-rel': 'gpu_tests_release_trybot_mbi_mode_per_render_process_host_reclient', 'linux-perfetto-rel': 'perfetto_release_trybot_reclient', 'linux-rel-warmed': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange_code_coverage', - 'linux-ubsan-fyi-rel': 'ubsan_no_recover_release_bot_reclient', - # This is intentionally a release_bot and not a release_trybot to match - # the CI configuration, where no debug builder exists. - 'linux-ubsan-vptr': 'ubsan_vptr_release_bot_reclient', 'linux-viz-rel': 'release_trybot_reclient', - 'linux-webkit-asan-rel': 'asan_lsan_release_bot_blink', - 'linux-webkit-msan-rel': 'msan_release_bot_reclient', 'linux-wpt-content-shell-fyi-rel': 'release_bot_blink_minimal_symbols_reclient', 'linux-wpt-content-shell-leak-detection': 'release_bot_blink_minimal_symbols_reclient', 'linux_chromium_archive_rel_ng': 'release_bot_reclient', - 'linux_chromium_asan_rel_ng': 'asan_lsan_failsan_release_trybot_reclient', 'linux_chromium_asan_siso_rel_ng': 'asan_lsan_failsan_release_trybot_reclient', - 'linux_chromium_cfi_rel_ng': 'cfi_full_cfi_icall_cfi_diag_thin_lto_release_static_dcheck_always_on_reclient_use_dummy_last_change', - 'linux_chromium_chromeos_asan_rel_ng': 'asan_lsan_chromeos_release_bot_dcheck_always_on_reclient', - 'linux_chromium_chromeos_msan_rel_ng': 'chromeos_msan_release_bot_reclient', 'linux_chromium_clobber_deterministic': 'release_trybot_reclient', 'linux_chromium_compile_rel_ng': 'release_trybot_reclient', - # This is intentionally a release_bot and not a release_trybot; - # enabling DCHECKs seems to cause flaky failures that don't show up - # on the continuous builder. - 'linux_chromium_msan_rel_ng': 'msan_release_bot_reclient', - - 'linux_chromium_tsan_rel_ng': 'tsan_disable_nacl_release_trybot_reclient', 'linux_chromium_tsan_siso_rel_ng': 'tsan_disable_nacl_release_trybot_reclient', 'linux_optional_gpu_tests_rel': 'gpu_fyi_tests_release_trybot_reclient', @@ -768,7 +709,6 @@ 'gpu-fyi-try-mac-nvidia-retina-rel': 'gpu_fyi_tests_release_trybot_reclient', 'gpu-try-mac-amd-retina-dbg': 'gpu_tests_debug_bot_reclient', 'gpu-try-mac-intel-dbg': 'gpu_tests_debug_bot_reclient', - 'ios-asan': 'ios_simulator_release_static_asan_bot_xctest_reclient', 'ios-blink-dbg-fyi': 'ios_simulator_blink_xctest', 'ios-fieldtrial-rel': 'ios_simulator_debug_static_bot_xctest_arm64_reclient', 'ios-m1-simulator': 'ios_simulator_debug_static_bot_xctest_arm64_reclient', @@ -794,7 +734,6 @@ 'mac13-arm64-siso-rel': 'mac_arm64_gpu_tests_release_trybot_no_symbols_reclient', 'mac13-arm64-wpt-content-shell-fyi-rel': 'release_bot_blink_arm64_minimal_symbols_reclient', 'mac13-wpt-content-shell-fyi-rel': 'release_bot_blink_minimal_symbols_reclient', - 'mac_chromium_asan_rel_ng': 'asan_dcheck_disable_nacl_release_bot_reclient', 'mac_optional_gpu_tests_rel': 'gpu_fyi_tests_release_trybot_x64_reclient', 'mac_upload_clang': 'release_bot', 'mac_upload_clang_arm': 'release_bot', @@ -820,17 +759,6 @@ 'Win x64 Builder Perf PGO': 'official_goma_perf_pgo', }, - 'tryserver.chromium.rust': { - 'android-rust-arm32-rel': 'release_rust_android_arm32_reclient', - 'android-rust-arm64-dbg': 'debug_bot_rust_android_arm64_reclient', - 'android-rust-arm64-rel': 'release_rust_android_arm64_reclient', - 'linux-rust-x64-dbg': 'debug_bot_rust_desktop_x64_reclient', - 'linux-rust-x64-rel': 'release_rust_desktop_x64_reclient', - 'mac-rust-x64-dbg': 'debug_bot_rust_desktop_x64_reclient', - 'win-rust-x64-dbg': 'debug_bot_rust_desktop_x64_reclient', - 'win-rust-x64-rel': 'release_rust_desktop_x64_reclient', - }, - 'tryserver.chromium.tricium': { 'android-clang-tidy-rel': 'android_release_trybot_reclient', 'fuchsia-clang-tidy-rel': 'release_trybot_fuchsia_reclient', @@ -853,7 +781,6 @@ 'gpu-fyi-try-win10-nvidia-rel-64': 'gpu_fyi_tests_release_trybot_reclient', 'gpu-try-win-nvidia-dbg': 'gpu_tests_debug_bot_reclient', 'win-annotator-rel': 'release_trybot_reclient', - 'win-asan': 'asan_clang_fuzzer_static_v8_heap_minimal_symbols_release_reclient', 'win-celab-try-rel': 'release_bot_minimal_symbols_reclient', 'win-clobber-rel': 'release_trybot_reclient', 'win-cr23-rel': 'release_trybot_reclient', @@ -920,14 +847,6 @@ 'afl', 'asan', 'shared_release_trybot_reclient', 'chromeos_codecs', 'pdf_xfa', 'disable_nacl', 'optimize_for_fuzzing', 'mojo_fuzzer', 'skip_generate_fuzzer_owners', ], - 'android_clang_asan_release_bot_reclient': [ - 'android', 'clang', 'asan', 'release_bot_reclient', 'strip_debug_info', 'minimal_symbols', - ], - - 'android_clang_asan_release_trybot_reclient': [ - 'android', 'clang', 'asan', 'release_trybot_reclient', 'strip_debug_info', 'minimal_symbols', - ], - 'android_cronet_release_bot_minimal_symbols_arm_no_neon': [ 'android', 'cronet_android', 'official_optimize', 'release_bot', 'minimal_symbols', 'arm_no_neon', 'strip_debug_info', @@ -1039,46 +958,18 @@ 'android_without_codecs', 'release_trybot_reclient', 'strip_debug_info', ], - 'asan_clang_fuzzer_static_v8_heap_minimal_symbols_release_reclient': [ - 'asan', 'fuzzer', 'static', 'v8_heap', 'minimal_symbols', 'release_bot_reclient', - ], - - 'asan_dcheck_disable_nacl_release_bot_reclient': [ - 'asan', 'dcheck_always_on', 'disable_nacl', 'release_bot_reclient', - ], - - 'asan_lsan_chromeos_release_bot_dcheck_always_on_reclient': [ - 'asan', 'lsan', 'chromeos', 'release_trybot_minimal_symbols_reclient', - ], - - 'asan_lsan_dcheck_disable_nacl_release_bot_reclient': [ - 'asan', 'lsan', 'dcheck_always_on', 'disable_nacl', 'release_bot_reclient', - ], - 'asan_lsan_failsan_release_trybot_reclient': [ 'asan', 'lsan', 'fail_on_san_warnings', 'release_trybot_minimal_symbols_reclient', ], - 'asan_lsan_lacros_release_bot_dcheck_always_on_reclient': [ - 'asan', 'lsan', 'release_trybot_minimal_symbols_reclient', 'lacros_on_linux', 'also_build_ash_chrome' - ], - 'asan_lsan_release_bot': [ 'asan', 'lsan', 'release_bot', ], - 'asan_lsan_release_bot_blink': [ - 'asan', 'lsan', 'release_bot_blink', - ], - 'asan_lsan_release_trybot_reclient': [ 'asan', 'lsan', 'release_trybot_minimal_symbols_reclient', ], - 'asan_minimal_symbols_disable_nacl_release_bot_dcheck_always_on_reclient': [ - 'asan', 'minimal_symbols', 'disable_nacl', 'release_bot_reclient', 'dcheck_always_on', - ], - 'cast_binary_size': [ 'cast_receiver', 'cast_os', 'minimal_symbols', 'release_bot', ], @@ -1090,14 +981,6 @@ 'centipede', 'asan', 'shared_release_trybot_reclient', 'chromeos_codecs', 'pdf_xfa', 'disable_nacl', 'optimize_for_fuzzing', 'mojo_fuzzer', 'skip_generate_fuzzer_owners', ], - 'cfi_full_cfi_icall_cfi_diag_thin_lto_release_static_dcheck_always_on_reclient': [ - 'cfi_full', 'cfi_icall', 'cfi_diag', 'thin_lto', 'release', 'static', 'dcheck_always_on', 'reclient', - ], - - 'cfi_full_cfi_icall_cfi_diag_thin_lto_release_static_dcheck_always_on_reclient_use_dummy_last_change': [ - 'cfi_full', 'cfi_icall', 'cfi_diag', 'thin_lto', 'release', 'static', 'dcheck_always_on', 'reclient', 'use_dummy_lastchange', - ], - 'chrome_branded_reclient_minimal_symbols': [ 'chrome_branded', 'minimal_symbols', 'release_bot_reclient', ], @@ -1300,10 +1183,6 @@ 'chromeos_kevin_reclient', 'include_unwind_tables', 'official', ], - 'chromeos_msan_release_bot_reclient': [ - 'chromeos', 'msan', 'release_bot_reclient', - ], - 'chromeos_octopus_include_unwind_tables_official_dchecks': [ 'chromeos_device', 'octopus', 'include_unwind_tables', 'official', 'dcheck_always_on', 'also_build_lacros_chrome_for_architecture_amd64', @@ -1436,14 +1315,6 @@ 'debug_bot_reclient', ], - 'debug_bot_rust_android_arm64_reclient': [ - 'debug_bot_reclient', 'enable_all_rust_features', 'android', 'arm64', - ], - - 'debug_bot_rust_desktop_x64_reclient': [ - 'debug_bot_reclient', 'enable_all_rust_features', 'x64', - ], - 'fuchsia_clang_code_coverage_reclient': [ 'clang', 'fuchsia', 'fuchsia_code_coverage', 'no_symbols', 'release_bot_reclient', 'use_clang_coverage', @@ -1686,10 +1557,6 @@ 'debug_static_bot_reclient', 'ios', 'ios_simulator', 'ios_cpu_x64', 'xctest', 'no_lld', ], - 'ios_simulator_release_static_asan_bot_xctest_reclient': [ - 'ios', 'ios_simulator', 'ios_cpu_x64', 'release_bot_reclient', 'asan', 'xctest', - ], - 'ios_simulator_release_static_bot_xctest_reclient': [ 'minimal_symbols', 'ios', 'ios_simulator', 'ios_cpu_x64', 'release_bot_reclient', 'xctest', 'dcheck_always_on', ], @@ -1739,18 +1606,6 @@ 'clang_tot', 'official', 'no_widevine_cdm_host_verification', ], - 'msan_failsan_release_bot_reclient': [ - 'msan', 'fail_on_san_warnings', 'release_bot_reclient', - ], - - 'msan_release_bot_blink': [ - 'msan', 'release_bot_blink', - ], - - 'msan_release_bot_reclient': [ - 'msan', 'release_bot_reclient', - ], - 'official_android_arm32_pgo': [ 'official', 'reclient', 'android', 'arm', 'minimal_symbols', 'no_default_afdo', 'pgo_phase_1', 'stable_version_code', ], @@ -2027,6 +1882,10 @@ 'release_bot_blink', 'minimal_symbols', ], + 'release_bot_blink_minimal_symbols_reclient_dcheck_always_on': [ + 'release_bot_blink', 'minimal_symbols', 'dcheck_always_on', + ], + 'release_bot_blink_v8_debug_reclient': [ 'release_bot_blink', 'v8_enable_debugging_features', ], @@ -2087,18 +1946,6 @@ 'release_bot_reclient', 'x86', 'minimal_symbols', ], - 'release_rust_android_arm32_reclient': [ - 'release_trybot_minimal_symbols_reclient', 'enable_all_rust_features', 'android', 'arm', - ], - - 'release_rust_android_arm64_reclient': [ - 'release_trybot_minimal_symbols_reclient', 'enable_all_rust_features', 'android', 'arm64', - ], - - 'release_rust_desktop_x64_reclient': [ - 'release_trybot_minimal_symbols_reclient', 'enable_all_rust_features', 'x64', - ], - 'release_trybot': [ 'release_trybot', ], @@ -2163,26 +2010,10 @@ 'release_trybot_reclient', 'x86', ], - 'tsan_disable_nacl_failsan_release_bot_reclient': [ - 'tsan', 'disable_nacl', 'fail_on_san_warnings', 'release_bot_reclient', - ], - - 'tsan_disable_nacl_release_bot_reclient': [ - 'tsan', 'disable_nacl', 'release_bot_reclient', - ], - 'tsan_disable_nacl_release_trybot_reclient': [ 'tsan', 'disable_nacl', 'release_trybot_minimal_symbols_reclient', ], - 'ubsan_no_recover_release_bot_reclient': [ - 'ubsan_no_recover', 'release_bot_reclient', - ], - - 'ubsan_vptr_release_bot_reclient': [ - 'ubsan_vptr', 'ubsan_vptr_no_recover_hack', 'release_bot_reclient', - ], - 'v8_future_debug_bot_reclient': [ 'v8_future', 'debug_bot_reclient', ], @@ -2334,19 +2165,11 @@ 'gn_args': 'is_cfi=true', }, - 'cfi_diag': { - 'gn_args': 'use_cfi_diag=true', - }, - 'cfi_full': { 'mixins': ['cfi'], 'gn_args': 'use_cfi_cast=true', }, - 'cfi_icall': { - 'gn_args': 'use_cfi_icall=true', - }, - 'chrome_branded': { 'gn_args': 'is_chrome_branded=true' }, @@ -2534,10 +2357,6 @@ 'mixins': ['enable_vulkan'], }, - 'enable_all_rust_features': { - 'gn_args': 'enable_all_rust_features=true', - }, - # Enables backup ref ptr by changing the default value of the feature flag. # This sets the default value of PartitionAllocBackupRefPtr to enabled, with # enabled-processes = non-renderer: @@ -2620,10 +2439,6 @@ 'gn_args': 'symbol_level=2', }, - 'fuzzer': { - 'gn_args': 'enable_ipc_fuzzer=true', - }, - 'goma': { 'gn_args': 'use_goma=true', }, @@ -2739,10 +2554,6 @@ 'gn_args': 'enable_mojom_fuzzer=true', }, - 'msan': { - 'gn_args': 'is_msan=true msan_track_origins=2', - }, - 'no_codecs': { 'gn_args': ('media_use_libvpx=false ' 'media_use_ffmpeg=false ' @@ -3003,27 +2814,6 @@ 'gn_args': 'is_tsan=true', }, - 'ubsan': { - 'gn_args': 'is_ubsan=true', - }, - - 'ubsan_no_recover': { - 'mixins': ['ubsan'], - 'gn_args': 'is_ubsan_no_recover=true', - }, - - 'ubsan_vptr': { - 'gn_args': 'is_ubsan_vptr=true', - }, - - 'ubsan_vptr_no_recover_hack': { - # TODO(krasin): Remove when https://llvm.org/bugs/show_bug.cgi?id=25569 - # is fixed and just use ubsan_vptr instead. - 'mixins': ['ubsan_vptr'], - 'gn_args': 'is_ubsan_no_recover=true', - }, - - 'updater': { 'gn_args': 'enable_updater=true', }, @@ -3062,10 +2852,6 @@ 'gn_args': 'v8_enable_future=true', }, - 'v8_heap': { - 'gn_args': 'v8_enable_verify_heap=true', - }, - 'v8_pointer_compression': { # TODO(machenbach): Temporarily toggle pointer-compression off while it # is on by default.
diff --git a/tools/mb/mb_config_expectations/chromium.fyi.json b/tools/mb/mb_config_expectations/chromium.fyi.json index e329195..3f458ec 100644 --- a/tools/mb/mb_config_expectations/chromium.fyi.json +++ b/tools/mb/mb_config_expectations/chromium.fyi.json
@@ -775,7 +775,7 @@ }, "linux-wpt-chromium-rel": { "gn_args": { - "dcheck_always_on": false, + "dcheck_always_on": true, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/tools/mb/mb_config_expectations/chromium.memory.fyi.json b/tools/mb/mb_config_expectations/chromium.memory.fyi.json deleted file mode 100644 index badac82..0000000 --- a/tools/mb/mb_config_expectations/chromium.memory.fyi.json +++ /dev/null
@@ -1,58 +0,0 @@ -{ - "linux-exp-asan-lsan-fyi-rel": { - "gn_args": { - "dcheck_always_on": true, - "fail_on_san_warnings": true, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "is_lsan": true, - "symbol_level": 1, - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, - "linux-exp-msan-fyi-rel": { - "gn_args": { - "dcheck_always_on": false, - "fail_on_san_warnings": true, - "is_component_build": false, - "is_debug": false, - "is_msan": true, - "msan_track_origins": 2, - "use_remoteexec": true - } - }, - "linux-exp-tsan-fyi-rel": { - "gn_args": { - "dcheck_always_on": false, - "enable_nacl": false, - "fail_on_san_warnings": true, - "is_component_build": false, - "is_debug": false, - "is_tsan": true, - "use_remoteexec": true - } - }, - "linux-ubsan-fyi-rel": { - "gn_args": { - "dcheck_always_on": false, - "is_component_build": false, - "is_debug": false, - "is_ubsan": true, - "is_ubsan_no_recover": true, - "use_remoteexec": true - } - }, - "mac-lsan-fyi-rel": { - "gn_args": { - "dcheck_always_on": false, - "enable_nacl": false, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "is_lsan": true, - "use_remoteexec": true - } - } -} \ No newline at end of file
diff --git a/tools/mb/mb_config_expectations/chromium.memory.json b/tools/mb/mb_config_expectations/chromium.memory.json deleted file mode 100644 index a7168a8..0000000 --- a/tools/mb/mb_config_expectations/chromium.memory.json +++ /dev/null
@@ -1,183 +0,0 @@ -{ - "Linux ASan LSan Builder": { - "gn_args": { - "dcheck_always_on": true, - "fail_on_san_warnings": true, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "is_lsan": true, - "symbol_level": 1, - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, - "Linux CFI": { - "gn_args": { - "dcheck_always_on": true, - "is_cfi": true, - "is_component_build": false, - "is_debug": false, - "use_cfi_cast": true, - "use_cfi_diag": true, - "use_cfi_icall": true, - "use_remoteexec": true, - "use_thin_lto": true - } - }, - "Linux Chromium OS ASan LSan Builder": { - "gn_args": { - "dcheck_always_on": true, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "is_lsan": true, - "symbol_level": 1, - "target_os": "chromeos", - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, - "Linux ChromiumOS MSan Builder": { - "gn_args": { - "dcheck_always_on": false, - "is_component_build": false, - "is_debug": false, - "is_msan": true, - "msan_track_origins": 2, - "target_os": "chromeos", - "use_remoteexec": true - } - }, - "Linux MSan Builder": { - "gn_args": { - "dcheck_always_on": false, - "is_component_build": false, - "is_debug": false, - "is_msan": true, - "msan_track_origins": 2, - "use_remoteexec": true - } - }, - "Linux TSan Builder": { - "gn_args": { - "dcheck_always_on": false, - "enable_nacl": false, - "is_component_build": false, - "is_debug": false, - "is_tsan": true, - "use_remoteexec": true - } - }, - "Mac ASan 64 Builder": { - "gn_args": { - "dcheck_always_on": true, - "enable_nacl": false, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "symbol_level": 1, - "use_remoteexec": true - } - }, - "WebKit Linux ASAN": { - "gn_args": { - "dcheck_always_on": false, - "ffmpeg_branding": "Chrome", - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "is_lsan": true, - "proprietary_codecs": true, - "use_remoteexec": true - } - }, - "WebKit Linux Leak": { - "gn_args": { - "dcheck_always_on": false, - "ffmpeg_branding": "Chrome", - "is_component_build": false, - "is_debug": false, - "proprietary_codecs": true, - "use_remoteexec": true - } - }, - "WebKit Linux MSAN": { - "gn_args": { - "dcheck_always_on": false, - "ffmpeg_branding": "Chrome", - "is_component_build": false, - "is_debug": false, - "is_msan": true, - "msan_track_origins": 2, - "proprietary_codecs": true, - "use_remoteexec": true - } - }, - "android-asan": { - "gn_args": { - "dcheck_always_on": false, - "debuggable_apks": false, - "ffmpeg_branding": "Chrome", - "is_asan": true, - "is_clang": true, - "is_component_build": false, - "is_debug": false, - "proprietary_codecs": true, - "strip_debug_info": true, - "symbol_level": 1, - "target_os": "android", - "use_remoteexec": true - } - }, - "ios-asan": { - "gn_args": { - "dcheck_always_on": false, - "enable_run_ios_unittests_with_xctest": true, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "target_cpu": "x64", - "target_environment": "simulator", - "target_os": "ios", - "use_remoteexec": true - } - }, - "linux-lacros-asan-lsan-rel": { - "gn_args": { - "also_build_ash_chrome": true, - "chromeos_is_browser_only": true, - "dcheck_always_on": true, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "is_lsan": true, - "symbol_level": 1, - "target_os": "chromeos", - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, - "linux-ubsan-vptr": { - "gn_args": { - "dcheck_always_on": false, - "is_component_build": false, - "is_debug": false, - "is_ubsan_no_recover": true, - "is_ubsan_vptr": true, - "use_remoteexec": true - } - }, - "win-asan": { - "gn_args": { - "dcheck_always_on": false, - "enable_ipc_fuzzer": true, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "symbol_level": 1, - "use_remoteexec": true, - "v8_enable_verify_heap": true - } - } -} \ No newline at end of file
diff --git a/tools/mb/mb_config_expectations/chromium.rust.json b/tools/mb/mb_config_expectations/chromium.rust.json deleted file mode 100644 index 280fdc7..0000000 --- a/tools/mb/mb_config_expectations/chromium.rust.json +++ /dev/null
@@ -1,102 +0,0 @@ -{ - "android-rust-arm32-rel": { - "gn_args": { - "dcheck_always_on": true, - "debuggable_apks": false, - "enable_all_rust_features": true, - "ffmpeg_branding": "Chrome", - "is_component_build": false, - "is_debug": false, - "proprietary_codecs": true, - "symbol_level": 1, - "target_cpu": "arm", - "target_os": "android", - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, - "android-rust-arm64-dbg": { - "gn_args": { - "debuggable_apks": false, - "enable_all_rust_features": true, - "ffmpeg_branding": "Chrome", - "is_component_build": true, - "is_debug": true, - "proprietary_codecs": true, - "symbol_level": 1, - "target_cpu": "arm64", - "target_os": "android", - "use_remoteexec": true - } - }, - "android-rust-arm64-rel": { - "gn_args": { - "dcheck_always_on": true, - "debuggable_apks": false, - "enable_all_rust_features": true, - "ffmpeg_branding": "Chrome", - "is_component_build": false, - "is_debug": false, - "proprietary_codecs": true, - "symbol_level": 1, - "target_cpu": "arm64", - "target_os": "android", - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, - "linux-rust-x64-dbg": { - "gn_args": { - "enable_all_rust_features": true, - "is_component_build": true, - "is_debug": true, - "symbol_level": 1, - "target_cpu": "x64", - "use_remoteexec": true - } - }, - "linux-rust-x64-rel": { - "gn_args": { - "dcheck_always_on": true, - "enable_all_rust_features": true, - "is_component_build": false, - "is_debug": false, - "symbol_level": 1, - "target_cpu": "x64", - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, - "mac-rust-x64-dbg": { - "gn_args": { - "enable_all_rust_features": true, - "is_component_build": true, - "is_debug": true, - "symbol_level": 1, - "target_cpu": "x64", - "use_remoteexec": true - } - }, - "win-rust-x64-dbg": { - "gn_args": { - "enable_all_rust_features": true, - "is_component_build": true, - "is_debug": true, - "symbol_level": 1, - "target_cpu": "x64", - "use_remoteexec": true - } - }, - "win-rust-x64-rel": { - "gn_args": { - "dcheck_always_on": true, - "enable_all_rust_features": true, - "is_component_build": false, - "is_debug": false, - "symbol_level": 1, - "target_cpu": "x64", - "use_dummy_lastchange": true, - "use_remoteexec": true - } - } -} \ No newline at end of file
diff --git a/tools/mb/mb_config_expectations/tryserver.blink.json b/tools/mb/mb_config_expectations/tryserver.blink.json index d92beb8c..1b4959b1 100644 --- a/tools/mb/mb_config_expectations/tryserver.blink.json +++ b/tools/mb/mb_config_expectations/tryserver.blink.json
@@ -12,7 +12,7 @@ }, "linux-wpt-chromium-rel": { "gn_args": { - "dcheck_always_on": false, + "dcheck_always_on": true, "ffmpeg_branding": "Chrome", "is_component_build": false, "is_debug": false,
diff --git a/tools/mb/mb_config_expectations/tryserver.chromium.android.json b/tools/mb/mb_config_expectations/tryserver.chromium.android.json index cf4d3322..0d077f4 100644 --- a/tools/mb/mb_config_expectations/tryserver.chromium.android.json +++ b/tools/mb/mb_config_expectations/tryserver.chromium.android.json
@@ -1,21 +1,4 @@ { - "android-asan": { - "gn_args": { - "dcheck_always_on": true, - "debuggable_apks": false, - "ffmpeg_branding": "Chrome", - "is_asan": true, - "is_clang": true, - "is_component_build": false, - "is_debug": false, - "proprietary_codecs": true, - "strip_debug_info": true, - "symbol_level": 1, - "target_os": "android", - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, "android-clobber-rel": { "gn_args": { "dcheck_always_on": true,
diff --git a/tools/mb/mb_config_expectations/tryserver.chromium.linux.json b/tools/mb/mb_config_expectations/tryserver.chromium.linux.json index ed588e8..c6c82f62 100644 --- a/tools/mb/mb_config_expectations/tryserver.chromium.linux.json +++ b/tools/mb/mb_config_expectations/tryserver.chromium.linux.json
@@ -155,16 +155,6 @@ "use_remoteexec": true } }, - "layout_test_leak_detection": { - "gn_args": { - "dcheck_always_on": true, - "is_component_build": false, - "is_debug": false, - "symbol_level": 0, - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, "linux-afl-asan-rel": { "gn_args": { "dcheck_always_on": true, @@ -267,41 +257,6 @@ "use_remoteexec": true } }, - "linux-exp-asan-lsan-fyi-rel": { - "gn_args": { - "dcheck_always_on": true, - "fail_on_san_warnings": true, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "is_lsan": true, - "symbol_level": 1, - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, - "linux-exp-msan-fyi-rel": { - "gn_args": { - "dcheck_always_on": false, - "fail_on_san_warnings": true, - "is_component_build": false, - "is_debug": false, - "is_msan": true, - "msan_track_origins": 2, - "use_remoteexec": true - } - }, - "linux-exp-tsan-fyi-rel": { - "gn_args": { - "dcheck_always_on": false, - "enable_nacl": false, - "fail_on_san_warnings": true, - "is_component_build": false, - "is_debug": false, - "is_tsan": true, - "use_remoteexec": true - } - }, "linux-fieldtrial-rel": { "gn_args": { "dcheck_always_on": false, @@ -325,21 +280,6 @@ "use_remoteexec": true } }, - "linux-lacros-asan-lsan-rel": { - "gn_args": { - "also_build_ash_chrome": true, - "chromeos_is_browser_only": true, - "dcheck_always_on": true, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "is_lsan": true, - "symbol_level": 1, - "target_os": "chromeos", - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, "linux-lacros-fyi-rel": { "gn_args": { "also_build_ash_chrome": true, @@ -430,26 +370,6 @@ "use_goma": true } }, - "linux-ubsan-fyi-rel": { - "gn_args": { - "dcheck_always_on": false, - "is_component_build": false, - "is_debug": false, - "is_ubsan": true, - "is_ubsan_no_recover": true, - "use_remoteexec": true - } - }, - "linux-ubsan-vptr": { - "gn_args": { - "dcheck_always_on": false, - "is_component_build": false, - "is_debug": false, - "is_ubsan_no_recover": true, - "is_ubsan_vptr": true, - "use_remoteexec": true - } - }, "linux-viz-rel": { "gn_args": { "dcheck_always_on": true, @@ -460,28 +380,6 @@ "use_remoteexec": true } }, - "linux-webkit-asan-rel": { - "gn_args": { - "dcheck_always_on": false, - "ffmpeg_branding": "Chrome", - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "is_lsan": true, - "proprietary_codecs": true, - "use_remoteexec": true - } - }, - "linux-webkit-msan-rel": { - "gn_args": { - "dcheck_always_on": false, - "is_component_build": false, - "is_debug": false, - "is_msan": true, - "msan_track_origins": 2, - "use_remoteexec": true - } - }, "linux-wpt-content-shell-fyi-rel": { "gn_args": { "dcheck_always_on": false, @@ -512,19 +410,6 @@ "use_remoteexec": true } }, - "linux_chromium_asan_rel_ng": { - "gn_args": { - "dcheck_always_on": true, - "fail_on_san_warnings": true, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "is_lsan": true, - "symbol_level": 1, - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, "linux_chromium_asan_siso_rel_ng": { "gn_args": { "dcheck_always_on": true, @@ -538,44 +423,6 @@ "use_remoteexec": true } }, - "linux_chromium_cfi_rel_ng": { - "gn_args": { - "dcheck_always_on": true, - "is_cfi": true, - "is_component_build": false, - "is_debug": false, - "use_cfi_cast": true, - "use_cfi_diag": true, - "use_cfi_icall": true, - "use_dummy_lastchange": true, - "use_remoteexec": true, - "use_thin_lto": true - } - }, - "linux_chromium_chromeos_asan_rel_ng": { - "gn_args": { - "dcheck_always_on": true, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "is_lsan": true, - "symbol_level": 1, - "target_os": "chromeos", - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, - "linux_chromium_chromeos_msan_rel_ng": { - "gn_args": { - "dcheck_always_on": false, - "is_component_build": false, - "is_debug": false, - "is_msan": true, - "msan_track_origins": 2, - "target_os": "chromeos", - "use_remoteexec": true - } - }, "linux_chromium_clobber_deterministic": { "gn_args": { "dcheck_always_on": true, @@ -596,28 +443,6 @@ "use_remoteexec": true } }, - "linux_chromium_msan_rel_ng": { - "gn_args": { - "dcheck_always_on": false, - "is_component_build": false, - "is_debug": false, - "is_msan": true, - "msan_track_origins": 2, - "use_remoteexec": true - } - }, - "linux_chromium_tsan_rel_ng": { - "gn_args": { - "dcheck_always_on": true, - "enable_nacl": false, - "is_component_build": false, - "is_debug": false, - "is_tsan": true, - "symbol_level": 1, - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, "linux_chromium_tsan_siso_rel_ng": { "gn_args": { "dcheck_always_on": true,
diff --git a/tools/mb/mb_config_expectations/tryserver.chromium.mac.json b/tools/mb/mb_config_expectations/tryserver.chromium.mac.json index bb80835..d063f7a 100644 --- a/tools/mb/mb_config_expectations/tryserver.chromium.mac.json +++ b/tools/mb/mb_config_expectations/tryserver.chromium.mac.json
@@ -204,19 +204,6 @@ "use_remoteexec": true } }, - "ios-asan": { - "gn_args": { - "dcheck_always_on": false, - "enable_run_ios_unittests_with_xctest": true, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "target_cpu": "x64", - "target_environment": "simulator", - "target_os": "ios", - "use_remoteexec": true - } - }, "ios-blink-dbg-fyi": { "gn_args": { "dcheck_always_on": true, @@ -518,16 +505,6 @@ "use_remoteexec": true } }, - "mac_chromium_asan_rel_ng": { - "gn_args": { - "dcheck_always_on": false, - "enable_nacl": false, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "use_remoteexec": true - } - }, "mac_optional_gpu_tests_rel": { "gn_args": { "dcheck_always_on": true,
diff --git a/tools/mb/mb_config_expectations/tryserver.chromium.rust.json b/tools/mb/mb_config_expectations/tryserver.chromium.rust.json deleted file mode 100644 index 280fdc7..0000000 --- a/tools/mb/mb_config_expectations/tryserver.chromium.rust.json +++ /dev/null
@@ -1,102 +0,0 @@ -{ - "android-rust-arm32-rel": { - "gn_args": { - "dcheck_always_on": true, - "debuggable_apks": false, - "enable_all_rust_features": true, - "ffmpeg_branding": "Chrome", - "is_component_build": false, - "is_debug": false, - "proprietary_codecs": true, - "symbol_level": 1, - "target_cpu": "arm", - "target_os": "android", - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, - "android-rust-arm64-dbg": { - "gn_args": { - "debuggable_apks": false, - "enable_all_rust_features": true, - "ffmpeg_branding": "Chrome", - "is_component_build": true, - "is_debug": true, - "proprietary_codecs": true, - "symbol_level": 1, - "target_cpu": "arm64", - "target_os": "android", - "use_remoteexec": true - } - }, - "android-rust-arm64-rel": { - "gn_args": { - "dcheck_always_on": true, - "debuggable_apks": false, - "enable_all_rust_features": true, - "ffmpeg_branding": "Chrome", - "is_component_build": false, - "is_debug": false, - "proprietary_codecs": true, - "symbol_level": 1, - "target_cpu": "arm64", - "target_os": "android", - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, - "linux-rust-x64-dbg": { - "gn_args": { - "enable_all_rust_features": true, - "is_component_build": true, - "is_debug": true, - "symbol_level": 1, - "target_cpu": "x64", - "use_remoteexec": true - } - }, - "linux-rust-x64-rel": { - "gn_args": { - "dcheck_always_on": true, - "enable_all_rust_features": true, - "is_component_build": false, - "is_debug": false, - "symbol_level": 1, - "target_cpu": "x64", - "use_dummy_lastchange": true, - "use_remoteexec": true - } - }, - "mac-rust-x64-dbg": { - "gn_args": { - "enable_all_rust_features": true, - "is_component_build": true, - "is_debug": true, - "symbol_level": 1, - "target_cpu": "x64", - "use_remoteexec": true - } - }, - "win-rust-x64-dbg": { - "gn_args": { - "enable_all_rust_features": true, - "is_component_build": true, - "is_debug": true, - "symbol_level": 1, - "target_cpu": "x64", - "use_remoteexec": true - } - }, - "win-rust-x64-rel": { - "gn_args": { - "dcheck_always_on": true, - "enable_all_rust_features": true, - "is_component_build": false, - "is_debug": false, - "symbol_level": 1, - "target_cpu": "x64", - "use_dummy_lastchange": true, - "use_remoteexec": true - } - } -} \ No newline at end of file
diff --git a/tools/mb/mb_config_expectations/tryserver.chromium.win.json b/tools/mb/mb_config_expectations/tryserver.chromium.win.json index 749cf19..c8bc8fc 100644 --- a/tools/mb/mb_config_expectations/tryserver.chromium.win.json +++ b/tools/mb/mb_config_expectations/tryserver.chromium.win.json
@@ -137,18 +137,6 @@ "use_remoteexec": true } }, - "win-asan": { - "gn_args": { - "dcheck_always_on": false, - "enable_ipc_fuzzer": true, - "is_asan": true, - "is_component_build": false, - "is_debug": false, - "symbol_level": 1, - "use_remoteexec": true, - "v8_enable_verify_heap": true - } - }, "win-celab-try-rel": { "gn_args": { "dcheck_always_on": false,
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 59b2b9d..02bf873e 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -2162,8 +2162,8 @@ <int value="25" label="ZIP or state requirement: Violated"/> <int value="26" label="Line1 or house number requirement: Fulfilled"/> <int value="27" label="Line1 or house number requirement: Violated"/> - <int value="28" label="Full name requirement: Fulfilled"/> - <int value="29" label="Full name requirement: Violated"/> + <int value="28" label="Deprecated full name requirement: Fulfilled"/> + <int value="29" label="Deprecated full name requirement: Violated"/> </enum> <enum name="AutofillAddressProfileImportStatus"> @@ -9868,6 +9868,10 @@ label="aggregatable_source_registration_time has unknown value"/> <int value="36" label="Filters is using a reserved key (starts with "_")"/> + <int value="37" label="trigger_context_id value is invalid"/> + <int value="38" + label="trigger_context_id disallowed for + aggregatable_source_registration_time"/> </enum> <enum name="ConversionTriggerVerificationGetHeadersStatus"> @@ -29259,12 +29263,21 @@ <int value="7" label="Unknown error"/> </enum> +<enum name="InstantTethering_ConnectionToHostResult_EndResult"> + <int value="0" label="Success"/> + <int value="1" label="Internal error"/> + <int value="2" label="User cancelled connection attempt"/> + <int value="3" label="Provisioning failed"/> + <int value="4" label="No cellular data"/> + <int value="5" label="Tethering unsupported"/> +</enum> + <enum name="InstantTethering_ConnectionToHostResult_Failure"> <int value="0" label="Unknown error"/> <int value="1" label="Tethering timed out"/> <int value="2" label="Client connection error"/> - <int value="3" label="Tethering unsupported"/> - <int value="4" label="No cellular data"/> + <int value="3" label="(obsolete) Tethering unsupported"/> + <int value="4" label="(obsolete) No cellular data"/> <int value="5" label="Enabling hotspot failed"/> <int value="6" label="Enabling hotspot timed out"/> <int value="7" label="No response"/> @@ -29279,7 +29292,7 @@ <enum name="InstantTethering_ConnectionToHostResult_Failure_ClientConnection"> <int value="0" label="Timeout while waiting to connect"/> - <int value="1" label="Canceled"/> + <int value="1" label="(obsolete) Canceled"/> <int value="2" label="Internal error"/> </enum> @@ -33532,6 +33545,7 @@ <int value="-1575131701" label="AppServiceAsh:disabled"/> <int value="-1575043928" label="OriginKeyedProcessesByDefault:enabled"/> <int value="-1574799991" label="SkipServiceWorkerForInstallPromot:enabled"/> + <int value="-1574315456" label="ArchiveTabService:disabled"/> <int value="-1573468162" label="ClientStorageAccessContextAuditing:enabled"/> <int value="-1572374515" label="SafeSitesFilterBehaviorPolicyAndroid:disabled"/> @@ -36088,6 +36102,7 @@ <int value="-360453785" label="LeftToRightUrls:disabled"/> <int value="-360038744" label="invert-viewport-scroll-order"/> <int value="-359886807" label="AppPreloadService:disabled"/> + <int value="-359452972" label="ProjectorV2:enabled"/> <int value="-359331504" label="InputDeviceSettingsSplit:enabled"/> <int value="-357464687" label="SharingPreferVapid:enabled"/> <int value="-357250869" @@ -36506,6 +36521,7 @@ label="ColorProviderRedirectionForThemeProvider:disabled"/> <int value="-163146178" label="NtpRealboxIsTall:disabled"/> <int value="-162928621" label="ForceStartupSigninPromo:disabled"/> + <int value="-162871977" label="PrivateNetworkAccessNullIpAddress:disabled"/> <int value="-162377456" label="SecurePaymentConfirmationExtensions:enabled"/> <int value="-162294119" label="FeedSportsCard:disabled"/> <int value="-161782023" label="AndroidMessagesProdEndpoint:enabled"/> @@ -37980,6 +37996,7 @@ <int value="543210543" label="DisableQuickAnswersV2Translation:disabled"/> <int value="544334545" label="AlwaysAbandonScheduledTask:enabled"/> <int value="544443920" label="QuickAnswers:disabled"/> + <int value="545280747" label="ArchiveTabService:enabled"/> <int value="546043947" label="ImplicitRootScroller:enabled"/> <int value="546464390" label="LiveCaption:enabled"/> <int value="546520086" label="enable-data-reduction-proxy-savings-promo"/> @@ -40350,6 +40367,7 @@ <int value="1674803174" label="AddEduAccountFromAccountSettingsForSupervisedUsers:disabled"/> <int value="1675848452" label="BluetoothQualityReport:disabled"/> + <int value="1675857410" label="PrivateNetworkAccessNullIpAddress:enabled"/> <int value="1677167062" label="AutomaticPasswordGeneration:enabled"/> <int value="1677258310" label="DragAppsInTabletMode:disabled"/> <int value="1677610330" label="OmniboxExpandedStateHeight:enabled"/> @@ -40433,6 +40451,7 @@ <int value="1712697097" label="QuickAnswersV2:disabled"/> <int value="1712880335" label="FiltersInRecents:enabled"/> <int value="1713230497" label="ColorCorrectRendering:disabled"/> + <int value="1713419708" label="ProjectorV2:disabled"/> <int value="1713509078" label="NewBaseUrlInheritanceBehavior:enabled"/> <int value="1714016217" label="EnableHeuristicPalmDetectionFilter:enabled"/> <int value="1714520147" label="MBIMode:disabled"/> @@ -45046,6 +45065,7 @@ <int value="2" label="First party (NTP) theme with refresh daily enabled"/> <int value="3" label="Third party theme"/> <int value="4" label="Uploaded image"/> + <int value="5" label="Wallpaper search image"/> </enum> <enum name="NTPChromeWebStoreOpen"> @@ -51313,6 +51333,11 @@ <int value="6" label="Failed to create directory"/> </enum> +<enum name="RaceTaskPriority"> + <int value="0" label="LowerPriority"/> + <int value="1" label="NormalPriority"/> +</enum> + <enum name="RankerModelStatus"> <int value="0" label="OK"/> <int value="1" label="Download Throttled"/>
diff --git a/tools/metrics/histograms/metadata/ash/enums.xml b/tools/metrics/histograms/metadata/ash/enums.xml index 880b7b4..d0d2de5 100644 --- a/tools/metrics/histograms/metadata/ash/enums.xml +++ b/tools/metrics/histograms/metadata/ash/enums.xml
@@ -1255,6 +1255,7 @@ <int value="21" label="Multitask Menu Tablet"/> <int value="22" label="Capture Mode Education Shortcut Nudge"/> <int value="23" label="Capture Mode Education Shortcut Tutorial"/> + <int value="24" label="Capture Mode Education Quick Settings Nudge"/> </enum> <enum name="OnDeviceToServerSpeechRecognitionFallbackReason">
diff --git a/tools/metrics/histograms/metadata/ash/histograms.xml b/tools/metrics/histograms/metadata/ash/histograms.xml index cfb3ca29..86c9f12 100644 --- a/tools/metrics/histograms/metadata/ash/histograms.xml +++ b/tools/metrics/histograms/metadata/ash/histograms.xml
@@ -6986,6 +6986,16 @@ </summary> </histogram> +<histogram name="Ash.Wallpaper.Collection.Settled" enum="WallpaperCollection" + expires_after="2024-11-27"> + <owner>jasontt@chromium.org</owner> + <owner>assistive-eng@google.com</owner> + <summary> + The wallpaper collection of the online image currently set as the active + wallpaper. Emitted once for every UMA upload. + </summary> +</histogram> + <histogram name="Ash.Wallpaper.CustomLayout" enum="WallpaperLayout" expires_after="2024-05-19"> <owner>xiaohuic@chromium.org</owner> @@ -7071,6 +7081,16 @@ </summary> </histogram> +<histogram name="Ash.Wallpaper.Image.Settled" enum="WallpaperImage" + expires_after="2024-11-27"> + <owner>jasontt@chromium.org</owner> + <owner>assistive-eng@google.com</owner> + <summary> + The online image currently set as the active wallpaper. Emitted once for + every UMA upload. + </summary> +</histogram> + <histogram name="Ash.Wallpaper.IsSetToTimeOfDayAfterOobe" enum="Boolean" expires_after="2024-05-23"> <owner>jasontt@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/autofill/histograms.xml b/tools/metrics/histograms/metadata/autofill/histograms.xml index 4ca36701..0d74b5aa 100644 --- a/tools/metrics/histograms/metadata/autofill/histograms.xml +++ b/tools/metrics/histograms/metadata/autofill/histograms.xml
@@ -171,6 +171,7 @@ </variants> <variants name="Autofill.ServerCardUnmaskFlowType"> + <variant name="DeviceUnlock" summary="Device unlock authentication"/> <variant name="Fido" summary="FIDO authentication only"/> <variant name="Otp" summary="OTP auth only"/> <variant name="OtpFallbackFromFido" @@ -3821,8 +3822,20 @@ </summary> </histogram> +<histogram name="Autofill.RiskBasedAuth.{CardType}.Attempt" + enum="BooleanAttempted" expires_after="2024-07-01"> + <owner>junhuihe@google.com</owner> + <owner>payments-autofill-team@google.com</owner> + <summary> + Emits true when a risk-based authentication starts, and does not emit any + value otherwise. Currently, ServerCard and VirtualCard support risk-based + authentication. + </summary> + <token key="CardType" variants="Autofill.PaymentsRpcCardType"/> +</histogram> + <histogram name="Autofill.RiskBasedAuth.{CardType}.Result" - enum="AutofillRiskBasedAuthEvent" expires_after="2024-11-14"> + enum="AutofillRiskBasedAuthEvent" expires_after="2024-07-01"> <owner>junhuihe@google.com</owner> <owner>payments-autofill-team@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/blink/histograms.xml b/tools/metrics/histograms/metadata/blink/histograms.xml index f600ac6..95fc7f85 100644 --- a/tools/metrics/histograms/metadata/blink/histograms.xml +++ b/tools/metrics/histograms/metadata/blink/histograms.xml
@@ -3427,6 +3427,50 @@ </summary> </histogram> +<histogram + name="Blink.Script.PostTaskWithLowPriorityUntilTimeout.RaceTaskPriority" + enum="RaceTaskPriority" expires_after="2024-02-01"> + <owner>chikamune@chromium.org</owner> + <owner>yyanagisawa@chromium.org</owner> + <owner>kouhei@chromium.org</owner> + <summary> + Record which task priority's task was run in + `PostTaskWithLowPriorityUntilTimeout()` that uses LowerPriority task queue + and NormalPriority task queue. This is recorded when the + LowPriorityAsyncScriptExecution behavior is applied to async scripts. + </summary> +</histogram> + +<histogram name="Blink.Script.PostTaskWithLowPriorityUntilTimeout.Time" + units="ms" expires_after="2024-02-01"> + <owner>chikamune@chromium.org</owner> + <owner>yyanagisawa@chromium.org</owner> + <owner>kouhei@chromium.org</owner> + <summary> + Record when the LowPriorityAsyncScriptExecution behavior is applied to async + scripts. Measures the duration between when a script is ready to run, to + when the script is about to run. + </summary> +</histogram> + +<histogram + name="Blink.Script.PostTaskWithLowPriorityUntilTimeout.Time.{RaceTaskPriority}" + units="ms" expires_after="2024-02-01"> + <owner>chikamune@chromium.org</owner> + <owner>yyanagisawa@chromium.org</owner> + <owner>kouhei@chromium.org</owner> + <summary> + Record when the LowPriorityAsyncScriptExecution behavior is applied to async + scripts, and {RaceTaskPriority} task was eventually run. Measures the + duration between when a script is ready to run, to when the script is about + to run. + </summary> + <token key="RaceTaskPriority"> + <variant name="LowerPriority"/> + <variant name="NormalPriority"/> + </token> +</histogram> + <histogram name="Blink.Script.SchedulingType" enum="ScriptSchedulingType" expires_after="2024-03-17"> <owner>kouhei@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/cookie/histograms.xml b/tools/metrics/histograms/metadata/cookie/histograms.xml index 6a037b1..dda9468 100644 --- a/tools/metrics/histograms/metadata/cookie/histograms.xml +++ b/tools/metrics/histograms/metadata/cookie/histograms.xml
@@ -1011,6 +1011,16 @@ </summary> </histogram> +<histogram name="Cookie.TimeDatabaseMigrationToV21" units="ms" + expires_after="2024-11-20"> + <owner>cfredric@chromium.org</owner> + <owner>src/net/cookies/OWNERS</owner> + <summary> + The amount of time (ms) to migrate a v20 cookie database to v21. Migration + occurs upon first startup of a browser version with v20 database code. + </summary> +</histogram> + <histogram name="Cookie.TimeInitializeDB" units="ms" expires_after="2024-05-19"> <owner>bingler@chromium.org</owner> <owner>src/net/cookies/OWNERS</owner>
diff --git a/tools/metrics/histograms/metadata/cross_device/histograms.xml b/tools/metrics/histograms/metadata/cross_device/histograms.xml index ed3491a..10c76ec 100644 --- a/tools/metrics/histograms/metadata/cross_device/histograms.xml +++ b/tools/metrics/histograms/metadata/cross_device/histograms.xml
@@ -1228,6 +1228,29 @@ </summary> </histogram> +<histogram name="InstantTethering.ConnectionToHostResult.EndResult" + enum="InstantTethering_ConnectionToHostResult_EndResult" + expires_after="2024-12-01"> + <owner>joeantonetti@chromium.org</owner> + <owner>chromeos-cross-device-eng@google.com</owner> + <summary> + Provides a top-level breakdown of all connection end results, and what the + results were. This replaces + InstantTethering.ConnectionToHostResult.ProvisioningFailureRate. + + The statuses here are designed to reflect normal conculsions to Instant + Tethering, with only "Internal Error" representing product + failures. + + An "Internal Error" is caused by the host returning an + "Internal Error" response code. Tethering timing out and client + connection error are both broken down further in + InstantTethering.ConnectionToHostResult.Failure.TetheringTimeout and + InstantTethering.ConnectionToHostResult.Failure.ClientConnection, + respectively. + </summary> +</histogram> + <histogram name="InstantTethering.ConnectionToHostResult.Failure" enum="InstantTethering_ConnectionToHostResult_Failure" expires_after="2024-05-05">
diff --git a/tools/metrics/histograms/metadata/custom_tabs/histograms.xml b/tools/metrics/histograms/metadata/custom_tabs/histograms.xml index c40c730..90db17c 100644 --- a/tools/metrics/histograms/metadata/custom_tabs/histograms.xml +++ b/tools/metrics/histograms/metadata/custom_tabs/histograms.xml
@@ -69,18 +69,6 @@ </summary> </histogram> -<histogram name="CustomTabs.Branding.BrandingCheckCanceled" - enum="BooleanCanceled" expires_after="2023-12-31"> - <owner>wenyufu@chromium.org</owner> - <owner>chrome-connective-tissue@google.com</owner> - <summary> - For every CCT launch, Chrome will start an async task in the background - checking the last time branding is shown for the client app. Record whether - such branding check is canceled due to timeout when it is finished. Record - for Android CCT only. - </summary> -</histogram> - <histogram name="CustomTabs.Branding.BrandingCheckDuration" units="ms" expires_after="2024-04-28"> <owner>wenyufu@chromium.org</owner> @@ -110,22 +98,6 @@ </summary> </histogram> -<histogram name="CustomTabs.Branding.IsPackageNameValid" enum="BooleanValid" - expires_after="2023-12-31"> - <owner>wenyufu@chromium.org</owner> - <owner>chrome-connective-tissue@google.com</owner> - <summary> - For every CCT launch, Chrome will start an async task in the background - checking the last time branding is shown for the client app. Recorded - whether the package name of CCT client app can be found on device when the - async task is finished. Record for Android CCT only. - - If the client app is using CCT service connection, the client app package - name will be read from CCT service; otherwise the package name will be - parsed from the Activity#getReferrer of CustomTabsActivity. - </summary> -</histogram> - <histogram name="CustomTabs.Branding.NumberOfClients" units="count" expires_after="2024-04-28"> <owner>wenyufu@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/enterprise/histograms.xml b/tools/metrics/histograms/metadata/enterprise/histograms.xml index e7bd3d1e..fde8bf17 100644 --- a/tools/metrics/histograms/metadata/enterprise/histograms.xml +++ b/tools/metrics/histograms/metadata/enterprise/histograms.xml
@@ -2348,12 +2348,6 @@ </summary> </histogram> -<histogram name="Enterprise.ONC.PolicyValidation" enum="BooleanSuccess" - expires_after="M85"> - <owner>mnissler@chromium.org</owner> - <summary>Result of the OpenNetworkConfiguration policy validation.</summary> -</histogram> - <histogram name="Enterprise.OnPrint.{ContentAnalysisType}.PrintType" enum="PrintScanningContext" expires_after="2024-07-12"> <owner>domfc@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/extensions/histograms.xml b/tools/metrics/histograms/metadata/extensions/histograms.xml index 2e3e712..577f603 100644 --- a/tools/metrics/histograms/metadata/extensions/histograms.xml +++ b/tools/metrics/histograms/metadata/extensions/histograms.xml
@@ -3437,16 +3437,6 @@ <token key="ManifestLocation" variants="ManifestLocationGroup"/> </histogram> -<histogram name="Extensions.MenuManager.MenuItemsCount" units="items" - expires_after="2024-03-31"> - <owner>dbertoni@chromium.org</owner> - <owner>extensions-core@chromium.org</owner> - <summary> - The number of context menu items loaded from storage when an extension is - loaded. - </summary> -</histogram> - <histogram name="Extensions.Messaging.ExtensionPortsCreated{ExtensionMessagingPortCreationTime}" units="number of ports" expires_after="M85">
diff --git a/tools/metrics/histograms/metadata/fastpair/histograms.xml b/tools/metrics/histograms/metadata/fastpair/histograms.xml index 2218c07..0d2b65f 100644 --- a/tools/metrics/histograms/metadata/fastpair/histograms.xml +++ b/tools/metrics/histograms/metadata/fastpair/histograms.xml
@@ -50,7 +50,7 @@ </histogram> <histogram name="FastPair.GattServiceDiscovery.Latency" units="ms" - expires_after="2023-12-31"> + expires_after="2024-12-31"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -103,7 +103,7 @@ </histogram> <histogram name="FastPair.KeyBasedNotify.Latency" units="ms" - expires_after="2023-12-31"> + expires_after="2024-12-31"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -116,7 +116,7 @@ </histogram> <histogram name="FastPair.KeyBasedWriteRequest.Latency" units="ms" - expires_after="2023-12-31"> + expires_after="2024-12-31"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -129,7 +129,7 @@ </histogram> <histogram name="FastPair.PasskeyNotify.Latency" units="ms" - expires_after="2023-12-31"> + expires_after="2024-12-31"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -142,7 +142,7 @@ </histogram> <histogram name="FastPair.PasskeyWriteRequest.Latency" units="ms" - expires_after="2023-12-31"> + expires_after="2024-12-31"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner> @@ -279,7 +279,7 @@ <histogram name="FastPair.{PairingScenario}.Initialization.RetriesBeforeSuccess" - units="count" expires_after="2023-12-31"> + units="count" expires_after="2024-12-31"> <owner>jackshira@google.com</owner> <owner>dclasson@google.com</owner> <owner>brandosocarras@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/gpu/histograms.xml b/tools/metrics/histograms/metadata/gpu/histograms.xml index 01ba3f69..c2fad8d 100644 --- a/tools/metrics/histograms/metadata/gpu/histograms.xml +++ b/tools/metrics/histograms/metadata/gpu/histograms.xml
@@ -75,7 +75,7 @@ <owner>gildekel@chromium.org</owner> <owner>chromeos-gfx-display@chromium.org</owner> <summary> - Modeset attempt result of an internal display. This is recorded after Chrome + Modeset attempt result of an external display. This is recorded after Chrome attempted all the available modes and finally modeset the display. All the previously attempted modes and refreshes, including the successful one will be recorded.
diff --git a/tools/metrics/histograms/metadata/histogram_suffixes_list.xml b/tools/metrics/histograms/metadata/histogram_suffixes_list.xml index 0a5b8302..1536191 100644 --- a/tools/metrics/histograms/metadata/histogram_suffixes_list.xml +++ b/tools/metrics/histograms/metadata/histogram_suffixes_list.xml
@@ -3291,7 +3291,6 @@ label="Link triggered prerender, rel=prerender, same domain."/> <affected-histogram name="Prerender.FinalStatus"/> <affected-histogram name="Prerender.NetworkBytesWasted"/> - <affected-histogram name="Prerender.PrerendersPerSessionCount"/> </histogram_suffixes> <histogram_suffixes name="ProcessMemoryAllocator2" separator=".">
diff --git a/tools/metrics/histograms/metadata/media/histograms.xml b/tools/metrics/histograms/metadata/media/histograms.xml index 760ef0e9..d62cff1 100644 --- a/tools/metrics/histograms/metadata/media/histograms.xml +++ b/tools/metrics/histograms/metadata/media/histograms.xml
@@ -5822,15 +5822,6 @@ </summary> </histogram> -<histogram name="Media.VideoCaptureGpuJpegDecoder.InitDecodeSuccess" - enum="BooleanSuccess" expires_after="M77"> - <owner>henryhsu@chromium.org</owner> - <summary> - Indicates whether we were successful in initializing hardware jpeg decoder - for attempts to VideoCaptureGpuJpegDecoder::Initialize(). - </summary> -</histogram> - <histogram name="Media.VideoCaptureManager" units="ms" expires_after="M85"> <owner>mcasas@chromium.org</owner> <summary>Measures the time taken for VideoCaptureManager::</summary> @@ -6583,7 +6574,7 @@ </histogram> <histogram name="MediaRouter.CastStreaming.Start.Failure.AccessCodeManualEntry" - enum="MirroringServiceErrorType" expires_after="2023-12-01"> + enum="MirroringServiceErrorType" expires_after="2024-05-01"> <owner>bzielinski@google.com</owner> <owner>cros-edu-eng@google.com</owner> <summary> @@ -6594,7 +6585,7 @@ <histogram name="MediaRouter.CastStreaming.Start.Failure.AccessCodeRememberedDevice" - enum="MirroringServiceErrorType" expires_after="2023-12-01"> + enum="MirroringServiceErrorType" expires_after="2024-05-01"> <owner>bzielinski@google.com</owner> <owner>cros-edu-eng@google.com</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/navigation/histograms.xml b/tools/metrics/histograms/metadata/navigation/histograms.xml index 9113d27..27c2d06 100644 --- a/tools/metrics/histograms/metadata/navigation/histograms.xml +++ b/tools/metrics/histograms/metadata/navigation/histograms.xml
@@ -2036,16 +2036,6 @@ </summary> </histogram> -<histogram name="Prerender.PrerendersPerSessionCount" units="units" - expires_after="2021-04-22"> - <owner>ryansturm@chromium.org</owner> - <owner>tbansal@chromium.org</owner> - <summary> - The number of sessions that have at least X successful prerenders. Recorded - only on iOS since 2017-09. - </summary> -</histogram> - <histogram name="Prerender.PrerenderTimeSaved" units="ms" expires_after="2024-04-28"> <owner>gambard@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/optimization/enums.xml b/tools/metrics/histograms/metadata/optimization/enums.xml index ab8493c8..0b12945 100644 --- a/tools/metrics/histograms/metadata/optimization/enums.xml +++ b/tools/metrics/histograms/metadata/optimization/enums.xml
@@ -216,6 +216,40 @@ </int> </enum> +<enum name="OptimizationGuideOnDeviceAddContextResult"> + <int value="0" label="Used Server"/> + <int value="1" label="Used on-device"> + Context was sent to on-device model. + </int> + <int value="2" label="Failed creating message"> + Failed to create the message, and as a result will use server. + </int> +</enum> + +<enum name="OptimizationGuideOnDeviceExecuteModelResult"> + <int value="0" label="Used Server"/> + <int value="1" label="Used on-device"> + On-device model was used and it completed successfully. + </int> + <int value="2" label="Failed creating message"> + Failed to create the message, and as a result used server. + </int> + <int value="3" label="Failed creating response"> + Failed to create the response message. + </int> + <int value="4" label="Timed out">Timed out, and a result used server.</int> + <int value="5" label="Disconnect and fallback"> + Received a disconnect and as a result used server. + </int> + <int value="6" label="Disconnect and cancel"> + Received a disconnect and cancelled. + </int> + <int value="7" label="Cancelled"> + Execution was cancelled because either AddContext or ExecuteModel was called + again. + </int> +</enum> + <enum name="OptimizationGuideOnDeviceModelEligibilityReason"> <int value="0" label="Unknown"/> <int value="1" label="Success"/>
diff --git a/tools/metrics/histograms/metadata/optimization/histograms.xml b/tools/metrics/histograms/metadata/optimization/histograms.xml index 91c2b34..ebe1d97 100644 --- a/tools/metrics/histograms/metadata/optimization/histograms.xml +++ b/tools/metrics/histograms/metadata/optimization/histograms.xml
@@ -469,6 +469,18 @@ </histogram> <histogram + name="OptimizationGuide.ModelExecution.OnDeviceAddContextResult.{ModelExecutionFeature}" + enum="OptimizationGuideOnDeviceAddContextResult" expires_after="2024-05-29"> + <owner>sky@chromium.org</owner> + <owner>sophiechang@chromium.org</owner> + <summary> + Captures the possible outcomes of Session::AddContext(). Recorded everytime + Session::AddContext() is called. context. + </summary> + <token key="ModelExecutionFeature" variants="ModelExecutionFeature"/> +</histogram> + +<histogram name="OptimizationGuide.ModelExecution.OnDeviceContextTokensProcessed.{ModelExecutionFeature}" units="tokens" expires_after="2024-05-29"> <owner>cduvall@chromium.org</owner> @@ -481,6 +493,19 @@ </histogram> <histogram + name="OptimizationGuide.ModelExecution.OnDeviceExecuteModelResult.{ModelExecutionFeature}" + enum="OptimizationGuideOnDeviceExecuteModelResult" + expires_after="2024-05-29"> + <owner>sky@chromium.org</owner> + <owner>sophiechang@chromium.org</owner> + <summary> + Captures the possible outcomes of Session::ExecuteModel(). Recorded + everytime Session::ExecuteModel() is called. context. + </summary> + <token key="ModelExecutionFeature" variants="ModelExecutionFeature"/> +</histogram> + +<histogram name="OptimizationGuide.ModelExecution.OnDeviceFirstResponseTime.{ModelExecutionFeature}" units="ms" expires_after="2024-05-29"> <owner>cduvall@chromium.org</owner> @@ -1004,7 +1029,7 @@ <histogram name="OptimizationGuide.PageContentAnnotationsService.RelatedSearchesCache.CacheHit" - enum="BooleanCacheHit" expires_after="2023-12-10"> + enum="BooleanCacheHit" expires_after="2024-04-28"> <owner>khalidpeer@chromium.org</owner> <owner>sophiechang@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/others/histograms.xml b/tools/metrics/histograms/metadata/others/histograms.xml index 0f7a0fd6..0d9c1c15 100644 --- a/tools/metrics/histograms/metadata/others/histograms.xml +++ b/tools/metrics/histograms/metadata/others/histograms.xml
@@ -3460,7 +3460,7 @@ </summary> </histogram> -<histogram name="Conversions.TriggerRegistrationError8" +<histogram name="Conversions.TriggerRegistrationError9" enum="ConversionTriggerRegistrationError" expires_after="2024-05-10"> <owner>tquintanilla@chromium.org</owner> <owner>linnan@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/password/enums.xml b/tools/metrics/histograms/metadata/password/enums.xml index 529b8411..56f39e4b 100644 --- a/tools/metrics/histograms/metadata/password/enums.xml +++ b/tools/metrics/histograms/metadata/password/enums.xml
@@ -1152,7 +1152,6 @@ <int value="0" label="Uncategorized"/> <int value="1" label="AuthErrorResolvable"/> <int value="2" label="AuthErrorUnresolvable"/> - <int value="3" label="KeychainError"/> </enum> <enum name="PasswordSubmissionEvent">
diff --git a/tools/metrics/histograms/metadata/privacy/histograms.xml b/tools/metrics/histograms/metadata/privacy/histograms.xml index 4143d4a..8dd3c84 100644 --- a/tools/metrics/histograms/metadata/privacy/histograms.xml +++ b/tools/metrics/histograms/metadata/privacy/histograms.xml
@@ -1065,7 +1065,11 @@ enum="Boolean" expires_after="2024-09-30"> <owner>jacobstanley@google.com</owner> <owner>koilos@google.com</owner> - <summary>Records whether that the profile responded to the survey.</summary> + <summary> + WARNING: the values in this histograms are inverted. See b/313698252. + Currently, true is recorded when the profile was not presented with a survey + and false otherwise. + </summary> </histogram> <histogram name="PrivacySandbox.{ApiType}" enum="PrivacySandboxApiAllowed"
diff --git a/tools/metrics/histograms/metadata/sb_client/enums.xml b/tools/metrics/histograms/metadata/sb_client/enums.xml index 115ee0e..447e009a 100644 --- a/tools/metrics/histograms/metadata/sb_client/enums.xml +++ b/tools/metrics/histograms/metadata/sb_client/enums.xml
@@ -223,6 +223,8 @@ <int value="3" label="Scan canceled"/> <int value="4" label="Scan completed"/> <int value="5" label="Scan failed"/> + <int value="6" label="Scan deleted"/> + <int value="7" label="Prompt accepted from chrome://downloads"/> </enum> <enum name="SBDeepScanTriggers">
diff --git a/tools/metrics/histograms/metadata/sb_client/histograms.xml b/tools/metrics/histograms/metadata/sb_client/histograms.xml index f1cbf9b..60098afd5 100644 --- a/tools/metrics/histograms/metadata/sb_client/histograms.xml +++ b/tools/metrics/histograms/metadata/sb_client/histograms.xml
@@ -417,7 +417,10 @@ cancelation or completion. This is logged for consumer scans of {Encryption}. - Note: Logging of PromptAccepted was lost in M118. + Note: Logging of PromptAccepted was lost in M118. "Scan canceled" + and "Scan deleted" were added in M121. "Prompt accepted" + was split into "Prompt accepted" and "Prompt accepted from + chrome://downloads" in M121. </summary> <token key="Encryption"> <variant name="" summary="a file"/>
diff --git a/tools/metrics/histograms/metadata/signin/histograms.xml b/tools/metrics/histograms/metadata/signin/histograms.xml index dc8dc57b..794dc85 100644 --- a/tools/metrics/histograms/metadata/signin/histograms.xml +++ b/tools/metrics/histograms/metadata/signin/histograms.xml
@@ -541,7 +541,7 @@ </summary> </histogram> -<histogram name="Signin.BoundSessionCredentials.DeferredRequestDelay" +<histogram name="Signin.BoundSessionCredentials.Deferred{Type}RequestDelay" units="ms" expires_after="2024-04-28"> <owner>alexilin@chromium.org</owner> <owner>msalama@chromium.org</owner> @@ -550,7 +550,14 @@ Records for how long a request was delayed due to a missing bound cookie. Recorded every time a request was deferred by the bound session credentials throttle, right before the request is resumed or canceled. + + {Type} </summary> + <token key="Type"> + <variant name="" summary="Includes all requests."/> + <variant name="Navigation" + summary="Includes only main frame navigation requests."/> + </token> </histogram> <histogram name="Signin.BoundSessionCredentials.ResumeThrottledRequestsTrigger"
diff --git a/tools/metrics/histograms/metadata/xr/enums.xml b/tools/metrics/histograms/metadata/xr/enums.xml index 89dec0f..e89ccba 100644 --- a/tools/metrics/histograms/metadata/xr/enums.xml +++ b/tools/metrics/histograms/metadata/xr/enums.xml
@@ -50,6 +50,7 @@ <int value="6" label="WINDOWS_MIXED_REALITY_ID"/> <int value="7" label="ARCORE_DEVICE_ID"/> <int value="8" label="OPENXR_DEVICE_ID"/> + <int value="9" label="CARDBOARD_DEVICE_ID"/> </enum> </enums>
diff --git a/tools/perf/core/tbmv3/metrics/console_error_metric.proto b/tools/perf/core/tbmv3/metrics/console_error_metric.proto index e62a004d..3424aea 100644 --- a/tools/perf/core/tbmv3/metrics/console_error_metric.proto +++ b/tools/perf/core/tbmv3/metrics/console_error_metric.proto
@@ -6,6 +6,8 @@ package perfetto.protos; import "protos/perfetto/metrics/metrics.proto"; +// TODO(crbug.com/1012687): Ideally we won't need this second import. +import "protos/perfetto/metrics/custom_options.proto"; message ConsoleErrorMetric { optional int64 all_errors = 1 [(unit) = "count_smallerIsBetter"];
diff --git a/tools/rust/build_rust.py b/tools/rust/build_rust.py index 6595636f..0a12081 100755 --- a/tools/rust/build_rust.py +++ b/tools/rust/build_rust.py
@@ -755,6 +755,11 @@ GitCherryPick(RUST_SRC_DIR, 'https://github.com/rust-lang/rust.git', '751f7b9431b41418e2035c2c155a39fefd5d318f') + # TODO: Remove once + # https://github.com/rust-lang/rust/pull/118410 has been merged. + GitCherryPick(RUST_SRC_DIR, 'https://github.com/rust-lang/rust.git', + '81cd7c5b11766ed1e3214a2233371fb6d72ed89c') + path = FetchBetaPackage('cargo', checkout_revision) if sys.platform == 'win32': cargo_bin = os.path.join(path, 'cargo', 'bin', 'cargo.exe')
diff --git a/tools/rust/update_rust.py b/tools/rust/update_rust.py index 119d875..745582e 100755 --- a/tools/rust/update_rust.py +++ b/tools/rust/update_rust.py
@@ -34,7 +34,7 @@ # In the case that a Rust roll fails and you want to roll Clang alone, reset # this back to its previous value _AND_ set `OVERRIDE_CLANG_REVISION` below # to the `CLANG_REVISION` that was in place before the roll. -RUST_REVISION = '855c6836b7c476385db95a0a95f2e57f5ff32fe1' +RUST_REVISION = 'df0295f07175acc7325ce3ca4152eb05752af1f2' RUST_SUB_REVISION = 1 # If not None, this overrides the `CLANG_REVISION` in
diff --git a/tools/typescript/ts_library.py b/tools/typescript/ts_library.py index 57b81cea..bce222f 100644 --- a/tools/typescript/ts_library.py +++ b/tools/typescript/ts_library.py
@@ -19,7 +19,7 @@ import node_modules from path_mappings import GetDepToPathMappings -from validate_tsconfig import validateTsconfigJson, validateJavaScriptAllowed, validateRootDir, isUnsupportedJsTarget +from validate_tsconfig import validateTsconfigJson, validateJavaScriptAllowed, validateRootDir, isUnsupportedJsTarget, isInAshFolder, isDependencyAllowed, isMappingAllowed, getTargetPath def _write_tsconfig_json(gen_dir, tsconfig, tsconfig_file): @@ -157,6 +157,9 @@ # Handle path mappings, for example chrome://resources/ URLs. path_mappings = collections.defaultdict(list) + target_path = getTargetPath(args.gen_dir, args.root_gen_dir) + is_ash_target = isInAshFolder(target_path) + if args.deps is not None: tsconfig['references'] = [{'path': dep} for dep in args.deps] @@ -168,6 +171,9 @@ args.platform) for dep in args.raw_deps: + assert isDependencyAllowed(is_ash_target, dep, target_path), \ + f'{target_path} should not use Ash-only dependency {dep}.' + if dep not in dep_to_path_mappings: assert not dep.startswith("//ui/webui/resources"), \ f'Missing path mapping for \'{dep}\'. Update ' \ @@ -185,6 +191,10 @@ if args.path_mappings is not None: for m in args.path_mappings: mapping = m.split('|') + mapping_path = os.path.relpath(mapping[1], args.root_src_dir) + assert isMappingAllowed(is_ash_target, target_path, mapping_path), \ + f'Cannot use mapping to Ash-specific folder {mapping_path} from ' \ + f'non-Ash target {target_path}' path_mappings[mapping[0]].append(os.path.join('./', mapping[1])) tsconfig['compilerOptions']['paths'] = path_mappings
diff --git a/tools/typescript/validate_tsconfig.py b/tools/typescript/validate_tsconfig.py index 6138d092..ea6429389 100644 --- a/tools/typescript/validate_tsconfig.py +++ b/tools/typescript/validate_tsconfig.py
@@ -152,14 +152,64 @@ 'code should be added in TypeScript.' +def getTargetPath(gen_dir, root_gen_dir): + root_gen_dir_from_build = os.path.normpath(os.path.join( + gen_dir, root_gen_dir)).replace('\\', '/') + return os.path.relpath(gen_dir, root_gen_dir_from_build).replace('\\', '/') + + +def isInAshFolder(path): + # TODO (https://crbug.com/1506296): Organize Ash WebUI code under fewer + # directories. + ash_folders = [ + # Source code folders + 'ash/webui', + 'chrome/browser/resources/ash/settings', + 'chrome/browser/resources/chromeos', + 'chrome/browser/resources/nearby_share', + 'ui/file_manager', + + # Test folders + 'chrome/test/data/webui/chromeos', + 'chrome/test/data/webui/cr_components/chromeos', + 'chrome/test/data/webui/settings/chromeos', + ] + return any(path.startswith(folder) for folder in ash_folders) + + +def isDependencyAllowed(is_ash_target, raw_dep, target_path): + is_ash_dep = isInAshFolder(raw_dep[2:]) + if not is_ash_dep or is_ash_target: + return True + + exceptions = [ + # TODO(https://crbug.com/1506299): Remove this incorrect dependency + 'chrome/browser/resources/settings', + # TODO(https://crbug.com/1347740): Move remaining Ash-only test files to + # chrome/test/data/webui/chromeos. + 'chrome/test/data/webui', + ] + + return target_path in exceptions + + +def isMappingAllowed(is_ash_target, target_path, mapping_path): + if is_ash_target: + return True + + # TODO(https://crbug.com/1506304): Remove these incorrect dependencies. + exceptions = [ + 'chrome/browser/resources/inline_login', + 'chrome/test/data/webui/inline_login', + ] + + return not isInAshFolder(mapping_path) or target_path in exceptions + + # TODO (https://www.crbug.com/1412158): Remove all exceptions below and this # function; these build targets rely on implicitly unmapped dependencies. def isUnsupportedJsTarget(gen_dir, root_gen_dir): - root_gen_dir_from_build = os.path.normpath(os.path.join( - gen_dir, root_gen_dir)).replace('\\', '/') - target_path = os.path.relpath(gen_dir, - root_gen_dir_from_build).replace('\\', '/') - + target_path = getTargetPath(gen_dir, root_gen_dir) exceptions = [ 'ash/webui/color_internals/resources', 'ash/webui/face_ml_app_ui/resources/trusted',
diff --git a/ui/base/models/list_selection_model.cc b/ui/base/models/list_selection_model.cc index d788bbf..a89b35e 100644 --- a/ui/base/models/list_selection_model.cc +++ b/ui/base/models/list_selection_model.cc
@@ -106,14 +106,30 @@ void ListSelectionModel::SetSelectedIndex(absl::optional<size_t> index) { anchor_ = active_ = index; selected_indices_.clear(); - if (index.has_value()) + if (index.has_value()) { selected_indices_.insert(index.value()); + // The reason for adding last_accessed_map_ specifically in SetSelectedIndex + // is that it is the primary method responsible for updating the selected + // index, and it's where we have a clear indication of when a tab is being + // actively selected by user. + last_accessed_map_[index.value()] = base::Time::Now(); + } } bool ListSelectionModel::IsSelected(size_t index) const { return base::Contains(selected_indices_, index); } +absl::optional<base::Time> ListSelectionModel::GetLastAccessed( + size_t index) const { + const auto it = last_accessed_map_.find(index); + if (it == last_accessed_map_.end()) { + return absl::nullopt; + } + + return it->second; +} + void ListSelectionModel::AddIndexToSelection(size_t index) { selected_indices_.insert(index); }
diff --git a/ui/base/models/list_selection_model.h b/ui/base/models/list_selection_model.h index a558d8b..a581c798 100644 --- a/ui/base/models/list_selection_model.h +++ b/ui/base/models/list_selection_model.h
@@ -7,8 +7,11 @@ #include <stddef.h> +#include <map> + #include "base/component_export.h" #include "base/containers/flat_set.h" +#include "base/time/time.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace ui { @@ -73,6 +76,9 @@ // Returns true if |index| is selected. bool IsSelected(size_t index) const; + // Returns the last time |index| was accessed. + absl::optional<base::Time> GetLastAccessed(size_t index) const; + // Adds |index| to the selection. This does not change the active or anchor // indices. void AddIndexToSelection(size_t index); @@ -116,6 +122,7 @@ private: SelectedIndices selected_indices_; + std::map<size_t, base::Time> last_accessed_map_; absl::optional<size_t> active_ = absl::nullopt; absl::optional<size_t> anchor_ = absl::nullopt; };
diff --git a/ui/display/DEPS b/ui/display/DEPS index ff68b60..4b202f5 100644 --- a/ui/display/DEPS +++ b/ui/display/DEPS
@@ -2,7 +2,9 @@ "+components/device_event_log", "+mojo/public", "+skia/ext", + "+skia/public/mojom", "+third_party/cros_system_api", "+third_party/re2", + "+third_party/skia/modules/skcms", "+ui/gfx", ]
diff --git a/ui/display/mojom/BUILD.gn b/ui/display/mojom/BUILD.gn index 9f0d573..e14bfad4 100644 --- a/ui/display/mojom/BUILD.gn +++ b/ui/display/mojom/BUILD.gn
@@ -23,6 +23,7 @@ public_deps = [ "//mojo/public/mojom/base", + "//skia/public/mojom", "//ui/gfx/geometry/mojom", "//ui/gfx/mojom", ] @@ -181,9 +182,21 @@ { types = [ { + mojom = "display.mojom.ColorCalibration" + cpp = "::display::ColorCalibration" + }, + { + mojom = "display.mojom.ColorTemperatureAdjustment" + cpp = "::display::ColorTemperatureAdjustment" + }, + { mojom = "display.mojom.DisplayConfigurationParams" cpp = "::display::DisplayConfigurationParams" }, + { + mojom = "display.mojom.GammaAdjustment" + cpp = "::display::GammaAdjustment" + }, ] traits_sources = [ "display_configuration_params_mojom_traits.cc" ] traits_headers = [ "display_configuration_params_mojom_traits.h" ]
diff --git a/ui/display/mojom/display_color_management.mojom b/ui/display/mojom/display_color_management.mojom index cbd228d..0ec598f 100644 --- a/ui/display/mojom/display_color_management.mojom +++ b/ui/display/mojom/display_color_management.mojom
@@ -4,6 +4,7 @@ module display.mojom; +import "skia/public/mojom/skcolorspace.mojom"; import "ui/display/mojom/gamma_ramp_rgb_entry.mojom"; // A structure that specifies curves for the red, green, and blue color @@ -14,3 +15,32 @@ // 0 which evaluates to identity and 1 which evaluates to a constant). array<GammaRampRGBEntry> lut; }; + +// A structure that contains color calibration information extracted from an +// ICC profile. +struct ColorCalibration { + // The curve that converts from sRGB to sRGB linear space. + display.mojom.GammaCurve srgb_to_linear; + + // The matrix that converts from sRGB linear space to the device's linear + // space. + skia.mojom.SkcmsMatrix3x3 srgb_to_device_matrix; + + // The curve that converts from the device's linear space to the device's + // encoding space. + display.mojom.GammaCurve linear_to_device; +}; + +// A structure that contains the transformation to make to the display's color +// due to adaptations for color temperature. +struct ColorTemperatureAdjustment { + // A matrix to apply in sRGB space. + skia.mojom.SkcmsMatrix3x3 srgb_matrix; +}; + +// A structure that contains a per-channel transformation to make in the +// display's color space to adjust the brightness of the screen. +struct GammaAdjustment { + display.mojom.GammaCurve curve; +}; +
diff --git a/ui/display/mojom/display_color_management_mojom_traits.cc b/ui/display/mojom/display_color_management_mojom_traits.cc index 63add662..955f7446 100644 --- a/ui/display/mojom/display_color_management_mojom_traits.cc +++ b/ui/display/mojom/display_color_management_mojom_traits.cc
@@ -20,4 +20,43 @@ return true; } +// static +bool StructTraits<::display::mojom::ColorCalibrationDataView, + ::display::ColorCalibration>:: + Read(::display::mojom::ColorCalibrationDataView data, + ::display::ColorCalibration* out) { + if (!data.ReadSrgbToLinear(&out->srgb_to_linear)) { + return false; + } + if (!data.ReadSrgbToDeviceMatrix(&out->srgb_to_device_matrix)) { + return false; + } + if (!data.ReadLinearToDevice(&out->linear_to_device)) { + return false; + } + return true; +} + +// static +bool StructTraits<::display::mojom::ColorTemperatureAdjustmentDataView, + ::display::ColorTemperatureAdjustment>:: + Read(::display::mojom::ColorTemperatureAdjustmentDataView data, + ::display::ColorTemperatureAdjustment* out) { + if (!data.ReadSrgbMatrix(&out->srgb_matrix)) { + return false; + } + return true; +} + +// static +bool StructTraits<::display::mojom::GammaAdjustmentDataView, + ::display::GammaAdjustment>:: + Read(::display::mojom::GammaAdjustmentDataView data, + ::display::GammaAdjustment* out) { + if (!data.ReadCurve(&out->curve)) { + return false; + } + return true; +} + } // namespace mojo
diff --git a/ui/display/mojom/display_color_management_mojom_traits.h b/ui/display/mojom/display_color_management_mojom_traits.h index 8efe07b03..5953f3c0 100644 --- a/ui/display/mojom/display_color_management_mojom_traits.h +++ b/ui/display/mojom/display_color_management_mojom_traits.h
@@ -5,13 +5,14 @@ #ifndef UI_DISPLAY_MOJOM_DISPLAY_COLOR_MANAGEMENT_MOJOM_TRAITS_H_ #define UI_DISPLAY_MOJOM_DISPLAY_COLOR_MANAGEMENT_MOJOM_TRAITS_H_ +#include "skia/public/mojom/skcolorspace_mojom_traits.h" #include "ui/display/mojom/display_color_management.mojom-shared.h" #include "ui/display/mojom/gamma_ramp_rgb_entry.mojom-shared.h" - #include "ui/display/types/display_color_management.h" namespace mojo { +// GammaCurve template <> struct StructTraits<::display::mojom::GammaCurveDataView, ::display::GammaCurve> { @@ -24,6 +25,53 @@ ::display::GammaCurve* out); }; +// ColorCalibration +template <> +struct StructTraits<::display::mojom::ColorCalibrationDataView, + ::display::ColorCalibration> { + static const ::display::GammaCurve& srgb_to_linear( + const ::display::ColorCalibration& in) { + return in.srgb_to_linear; + } + static const ::skcms_Matrix3x3& srgb_to_device_matrix( + const ::display::ColorCalibration& in) { + return in.srgb_to_device_matrix; + } + static const ::display::GammaCurve& linear_to_device( + const ::display::ColorCalibration& in) { + return in.linear_to_device; + } + + static bool Read(::display::mojom::ColorCalibrationDataView data, + ::display::ColorCalibration* out); +}; + +// ColorTemperatureAdjustment +template <> +struct StructTraits<::display::mojom::ColorTemperatureAdjustmentDataView, + ::display::ColorTemperatureAdjustment> { + static const ::skcms_Matrix3x3& srgb_matrix( + const ::display::ColorTemperatureAdjustment& in) { + return in.srgb_matrix; + } + + static bool Read(::display::mojom::ColorTemperatureAdjustmentDataView data, + ::display::ColorTemperatureAdjustment* out); +}; + +// GammaAdjustment +template <> +struct StructTraits<::display::mojom::GammaAdjustmentDataView, + ::display::GammaAdjustment> { + static const ::display::GammaCurve& curve( + const ::display::GammaAdjustment& in) { + return in.curve; + } + + static bool Read(::display::mojom::GammaAdjustmentDataView data, + ::display::GammaAdjustment* out); +}; + } // namespace mojo #endif // UI_DISPLAY_MOJOM_DISPLAY_COLOR_MANAGEMENT_MOJOM_TRAITS_H_
diff --git a/ui/display/mojom/display_mojom_traits_unittest.cc b/ui/display/mojom/display_mojom_traits_unittest.cc index 742263e..887c2c8 100644 --- a/ui/display/mojom/display_mojom_traits_unittest.cc +++ b/ui/display/mojom/display_mojom_traits_unittest.cc
@@ -277,6 +277,65 @@ EXPECT_EQ(input.b, output.b); } +TEST(DisplayStructTraitsTest, ColorCalibrationRoundtrip) { + uint16_t in_r, in_g, in_b; + uint16_t out_r, out_g, out_b; + + ColorCalibration input; + input.srgb_to_linear = GammaCurve({{0, 0, 0}, {10, 20, 30}}); + input.linear_to_device = GammaCurve({{5, 5, 5}, {10, 20, 30}}); + input.srgb_to_device_matrix = SkNamedGamut::kDisplayP3; + + ColorCalibration output; + SerializeAndDeserialize<mojom::ColorCalibration>(input, &output); + + // Validate `srgb_to_device_matrix`. + EXPECT_EQ(0, memcmp(&input.srgb_to_device_matrix, + &output.srgb_to_device_matrix, sizeof(skcms_Matrix3x3))); + + // Valdiate `srgb_to_linear`. + input.srgb_to_linear.Evaluate(0.5f, in_r, in_g, in_b); + output.srgb_to_linear.Evaluate(0.5f, out_r, out_g, out_b); + EXPECT_EQ(in_r, out_r); + EXPECT_EQ(in_g, out_g); + EXPECT_EQ(in_b, out_b); + + // Valdiate `linear_to_device`. + input.linear_to_device.Evaluate(0.5f, in_r, in_g, in_b); + output.linear_to_device.Evaluate(0.5f, out_r, out_g, out_b); + EXPECT_EQ(in_r, out_r); + EXPECT_EQ(in_g, out_g); + EXPECT_EQ(in_b, out_b); +} + +TEST(DisplayStructTraitsTest, ColorTemperatureAdjustmentRoundtrip) { + ColorTemperatureAdjustment input; + input.srgb_matrix = SkNamedGamut::kDisplayP3; + + ColorTemperatureAdjustment output; + SerializeAndDeserialize<mojom::ColorTemperatureAdjustment>(input, &output); + + EXPECT_EQ(0, memcmp(&input.srgb_matrix, &output.srgb_matrix, + sizeof(skcms_Matrix3x3))); +} + +TEST(DisplayStructTraitsTest, GammaAdjustmentRoundtrip) { + uint16_t in_r, in_g, in_b; + uint16_t out_r, out_g, out_b; + + GammaAdjustment input; + input.curve = GammaCurve({{0, 10, 20}, {10, 20, 30}}); + GammaAdjustment output; + + SerializeAndDeserialize<mojom::GammaAdjustment>(input, &output); + + input.curve.Evaluate(0.5f, in_r, in_g, in_b); + output.curve.Evaluate(0.5f, out_r, out_g, out_b); + EXPECT_EQ(in_r, out_r); + EXPECT_EQ(in_g, out_g); + EXPECT_EQ(in_b, out_b); +} + // One display mode, current and native mode nullptr. TEST(DisplayStructTraitsTest, DisplaySnapshotCurrentAndNativeModesNull) { // Prepare sample input with random values.
diff --git a/ui/display/types/BUILD.gn b/ui/display/types/BUILD.gn index 15f2a89..0ccdba12 100644 --- a/ui/display/types/BUILD.gn +++ b/ui/display/types/BUILD.gn
@@ -29,6 +29,7 @@ deps = [ "//base", "//skia", + "//skia:skcms", "//ui/gfx:color_space", "//ui/gfx:memory_buffer", "//ui/gfx/geometry",
diff --git a/ui/display/types/display_color_management.h b/ui/display/types/display_color_management.h index d3bd64d4..d9cbdff 100644 --- a/ui/display/types/display_color_management.h +++ b/ui/display/types/display_color_management.h
@@ -7,6 +7,7 @@ #include <vector> +#include "third_party/skia/modules/skcms/skcms.h" #include "ui/display/types/display_types_export.h" #include "ui/display/types/gamma_ramp_rgb_entry.h" @@ -47,6 +48,45 @@ std::vector<GammaRampRGBEntry> lut_; }; +// A structure that contains color calibration information extracted from an +// ICC profile. This is a more general structure than the usual SkColorSpace +// or gfx::ColorSpace that is extracted from an ICC profile in that it allows +// for lookup table based curves and separate curves for each color channel. +// This functionality was added historically (in https://crbug.com/471749 and +// https://crbug.com/495196, for ChromeOS), and may be more information than +// is needed (in which case, the internals of this can be replaced with an +// SkColorSpace or similar). +struct ColorCalibration { + // The curve that converts from sRGB to sRGB linear space. This does not + // depend on the monitor and is almost certainly unneeded. + GammaCurve srgb_to_linear; + + // The matrix that converts from sRGB linear space to the device's linear + // space. + skcms_Matrix3x3 srgb_to_device_matrix = {{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}}; + + // The curve that converts from the device's linear space to the device's + // encoding space. + GammaCurve linear_to_device; +}; + +// A structure that contains the transformation to make to the display's color +// due to adaptations for color temperature (e.g, https://crbug.com/705816, for +// ChromeOS night light). +struct ColorTemperatureAdjustment { + // A matrix to apply in sRGB space. In practice, this matrix always diagonal + // and is applied in the device's color space (not sRGB), though this behavior + // is subject to change. + skcms_Matrix3x3 srgb_matrix = {{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}}; +}; + +// A structure that contains a per-channel transformation to make in the +// display's color space to adjust the brightness of the screen (e.g, +// b/109942195, for Chromecast gamma adaptation). +struct GammaAdjustment { + GammaCurve curve; +}; + } // namespace display #endif // UI_DISPLAY_TYPES_DISPLAY_COLOR_MANAGEMENT_H_
diff --git a/ui/file_manager/file_manager/background/js/crostini.ts b/ui/file_manager/file_manager/background/js/crostini.ts index e3d6592..6f376225 100644 --- a/ui/file_manager/file_manager/background/js/crostini.ts +++ b/ui/file_manager/file_manager/background/js/crostini.ts
@@ -4,8 +4,6 @@ /** * @fileoverview Handles shares for Crostini VMs. - * Disable type checking for closure, as it is done by the typescript compiler. - * @suppress {checkTypes} */ import {assert} from 'chrome://resources/ash/common/assert.js';
diff --git a/ui/file_manager/file_manager/background/js/launcher.ts b/ui/file_manager/file_manager/background/js/launcher.ts index 7be5d31..1f4ec6d 100644 --- a/ui/file_manager/file_manager/background/js/launcher.ts +++ b/ui/file_manager/file_manager/background/js/launcher.ts
@@ -7,12 +7,6 @@ import {AppWindowWrapper} from './app_window_wrapper.js'; /** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} -*/ - -/** * Prefix for the file manager window ID. */ const FILES_ID_PREFIX = 'files#';
diff --git a/ui/file_manager/file_manager/background/js/runtime_loaded_test_util.js b/ui/file_manager/file_manager/background/js/runtime_loaded_test_util.js index 6d9f7767..e0bf997 100644 --- a/ui/file_manager/file_manager/background/js/runtime_loaded_test_util.js +++ b/ui/file_manager/file_manager/background/js/runtime_loaded_test_util.js
@@ -1236,10 +1236,6 @@ /** * Returns the MetadataStats collected in MetadataModel, it will be serialized * as a plain object when sending to test extension. - * - * @suppress {missingProperties} metadataStats is only defined for foreground - * Window so it isn't visible in the background. Here it will return as JSON - * object to test extension. */ // @ts-ignore: error TS7006: Parameter 'contentWindow' implicitly has an 'any' // type. @@ -1253,8 +1249,6 @@ * * @param {Array<String>} properties Content metadata properties to get. * @param {function(*):void} callback Callback with metadata results returned. - * @suppress {missingProperties} getContentMetadata isn't visible in the - * background window. */ // @ts-ignore: error TS7006: Parameter 'contentWindow' implicitly has an 'any' // type. @@ -1347,8 +1341,6 @@ /** * Tells background page progress center to never notify a completed operation. - * @suppress {checkTypes} Remove suppress when migrating Files app. This is only - * used for Files app. */ test.util.sync.progressCenterNeverNotifyCompleted = () => { // @ts-ignore: error TS2339: Property 'background' does not exist on type @@ -1360,10 +1352,7 @@ /** * Waits for the background page to initialize. * @param {function():void} callback Callback function called when background - * page - * has finished initializing. - * @suppress {missingProperties}: ready() isn't available for Audio and Video - * Player. + * page has finished initializing. */ test.util.async.waitForBackgroundReady = callback => { // @ts-ignore: error TS2339: Property 'background' does not exist on type @@ -1378,10 +1367,7 @@ * @param {Window} contentWindow Window to be tested. * @param {string} bannerTagName Tag name of the banner to isolate. * @param {function(boolean):void} callback Callback function to be called with - * a - * boolean indicating success or failure. - * @suppress {missingProperties} banners is only defined for foreground - * Window so it isn't visible in the background. + * a boolean indicating success or failure. */ test.util.async.isolateBannerForTesting = async (contentWindow, bannerTagName, callback) => { @@ -1404,10 +1390,7 @@ * * @param {Window} contentWindow Window the banner controller exists. * @param {function(boolean):void} callback Callback function to be called with - * a - * boolean indicating success or failure. - * @suppress {missingProperties} banners is only defined for foreground - * Window so it isn't visible in the background. + * a boolean indicating success or failure. */ test.util.async.disableBannersForTesting = async (contentWindow, callback) => { try { @@ -1427,10 +1410,7 @@ * * @param {Window} contentWindow Window the banner controller exists. * @param {function(boolean):void} callback Callback function to be called with - * a - * boolean indicating success or failure. - * @suppress {missingProperties} nudgeContainer is only defined for foreground - * Window so it isn't visible in the background. + * a boolean indicating success or failure. */ test.util.async.disableNudgeExpiry = async (contentWindow, callback) => { // @ts-ignore: error TS2339: Property 'ui_' does not exist on type
diff --git a/ui/file_manager/file_manager/background/js/volume_info_list_impl.ts b/ui/file_manager/file_manager/background/js/volume_info_list_impl.ts index 184ebf4f..f81558d5 100644 --- a/ui/file_manager/file_manager/background/js/volume_info_list_impl.ts +++ b/ui/file_manager/file_manager/background/js/volume_info_list_impl.ts
@@ -4,8 +4,6 @@ /** * @fileoverview The container of the VolumeInfo for each mounted volume. - * Disable type checking for closure, as it is done by the typescript compiler. - * @suppress {checkTypes} */ import {ArrayDataModel} from '../../common/js/array_data_model.js';
diff --git a/ui/file_manager/file_manager/common/js/dom_utils.ts b/ui/file_manager/file_manager/common/js/dom_utils.ts index 321342b6..c05d88b 100644 --- a/ui/file_manager/file_manager/common/js/dom_utils.ts +++ b/ui/file_manager/file_manager/common/js/dom_utils.ts
@@ -167,7 +167,6 @@ /** * @param name Error name for the file error. * @param {string=} message Optional message for this error. - * @suppress {checkTypes} Closure externs for DOMError doesn't have * constructor with 1 arg. */ constructor(name: string, message?: string) {
diff --git a/ui/file_manager/file_manager/common/js/files_app_entry_types_unittest.js b/ui/file_manager/file_manager/common/js/files_app_entry_types_unittest.js index df9df1c..84d10b3 100644 --- a/ui/file_manager/file_manager/common/js/files_app_entry_types_unittest.js +++ b/ui/file_manager/file_manager/common/js/files_app_entry_types_unittest.js
@@ -173,7 +173,6 @@ /** * Tests VolumeEntry's methods findIndexByVolumeInfo, removeByVolumeType, * removeAllByRootType, removeChildEntry. - * @suppress {accessControls} to be able to access private properties. */ export function testVolumeEntryFindIndex() { const fakeRootEntry = createFakeDisplayRoot();
diff --git a/ui/file_manager/file_manager/common/js/filtered_volume_manager_unittest.js b/ui/file_manager/file_manager/common/js/filtered_volume_manager_unittest.ts similarity index 94% rename from ui/file_manager/file_manager/common/js/filtered_volume_manager_unittest.js rename to ui/file_manager/file_manager/common/js/filtered_volume_manager_unittest.ts index 64803b31..0d40b43 100644 --- a/ui/file_manager/file_manager/common/js/filtered_volume_manager_unittest.js +++ b/ui/file_manager/file_manager/common/js/filtered_volume_manager_unittest.ts
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {assert} from 'chrome://resources/ash/common/assert.js'; +import {assert} from 'chrome://resources/js/assert.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js'; import {MockVolumeManager} from '../../background/js/mock_volume_manager.js'; @@ -12,23 +12,18 @@ /** * Create a new MockVolumeManager for each test fixture. - * @return {!MockVolumeManager} */ -function createMockVolumeManager() { +function createMockVolumeManager(): MockVolumeManager { // Create mock volume manager. const volumeManager = new MockVolumeManager(); // Patch its addEventListener, removeEventListener methods to make them log // (instead of throw) "not implemented", since those throw events break the // FilteredVolumeManager initialization code in tests. - // @ts-ignore: error TS6133: 'handler' is declared but its value is never - // read. - volumeManager.addEventListener = (type, handler) => { + volumeManager.addEventListener = (_type, _handler) => { console.log('MockVolumeManager.addEventListener not implemented'); }; - // @ts-ignore: error TS6133: 'handler' is declared but its value is never - // read. - volumeManager.removeEventListener = (type, handler) => { + volumeManager.removeEventListener = (_type, _handler) => { console.log('MockVolumeManager.removeEventListener not implemented'); }; @@ -37,9 +32,8 @@ /** * Tests FilteredVolumeManager default volume filter. - * @param {()=>void} done */ -export function testVolumeDefaultFilter(done) { +export function testVolumeDefaultFilter() { // Create mock volume manager. const volumeManager = createMockVolumeManager(); @@ -121,16 +115,13 @@ // Check: the DOCUMENTS_PROVIDER volume should be a normal volume. assertEquals('Documents provider normal volume', info.label); assertEquals('documents-provider-path', info.devicePath); - - done(); }); } /** * Tests FilteredVolumeManager 'fusebox-only' volume filter. - * @param {()=>void} done */ -export function testVolumeFuseboxOnlyFilter(done) { +export function testVolumeFuseboxOnlyFilter() { // Create mock volume manager. const volumeManager = createMockVolumeManager(); @@ -204,16 +195,13 @@ assertEquals('MTP fusebox volume', info.label); assertEquals('fusebox/mtp-path', info.devicePath); assertEquals('fusebox', info.diskFileSystemType); - - done(); }); } /** * Tests FilteredVolumeManager 'media-store-files-only' volume filter. - * @param {()=>void} done */ -export function testVolumeMediaStoreFilesOnlyFilter(done) { +export function testVolumeMediaStoreFilesOnlyFilter() { // Create mock volume manager. const volumeManager = createMockVolumeManager(); @@ -307,16 +295,13 @@ info = filteredVolumeManager.volumeInfoList.item(1); assert(info, 'volume[1] REMOVABLE expected'); assertEquals(VolumeType.REMOVABLE, info.volumeType); - - done(); }); } /** * Tests the disabled volume related functions. - * @param {()=>void} done */ -export function testDisabledVolumes(done) { +export function testDisabledVolumes() { // Create mock volume manager. const volumeManager = createMockVolumeManager(); @@ -363,7 +348,5 @@ // Check: isDisabled() should return false for REMOVABLE. assertFalse(filteredVolumeManager.isDisabled(VolumeType.REMOVABLE)); - - done(); }); }
diff --git a/ui/file_manager/file_manager/common/js/glitch.js b/ui/file_manager/file_manager/common/js/glitch.ts similarity index 74% rename from ui/file_manager/file_manager/common/js/glitch.js rename to ui/file_manager/file_manager/common/js/glitch.ts index 32f37bc..d35d89d 100644 --- a/ui/file_manager/file_manager/common/js/glitch.js +++ b/ui/file_manager/file_manager/common/js/glitch.ts
@@ -13,22 +13,19 @@ * * Must be kept in synch with FileManagerGlitch defined in * //tools/metrics/histograms/enums.xml - * - * @enum {number} - * @const */ -export const GlitchType = { - UNKNOWN: 0, - UNHANDLED_ERROR: 1, - UNHANDLED_REJECTION: 2, +export enum GlitchType { + UNKNOWN = 0, + UNHANDLED_ERROR = 1, + UNHANDLED_REJECTION = 2, // Do not use it to report all caught exceptions. Only those exceptions that // we catch to work around errors that should never occur. - CAUGHT_EXCEPTION: 3, -}; + CAUGHT_EXCEPTION = 3, +} /** - * @param {!GlitchType} glitchType What type of glitch was it. + * @param glitchType What type of glitch was it. */ -export function reportGlitch(glitchType) { +export function reportGlitch(glitchType: GlitchType) { recordEnum(`Glitch`, glitchType, Object.values(GlitchType)); }
diff --git a/ui/file_manager/file_manager/common/js/mock_chrome.js b/ui/file_manager/file_manager/common/js/mock_chrome.js index a3a3bdc..ca2de8b2 100644 --- a/ui/file_manager/file_manager/common/js/mock_chrome.js +++ b/ui/file_manager/file_manager/common/js/mock_chrome.js
@@ -7,7 +7,6 @@ * @param {!Object} mockChrome */ export function installMockChrome(mockChrome) { - /** @suppress {const|checkTypes} */ // @ts-ignore: error TS2739: Type '{}' is missing the following properties // from type 'typeof chrome': fileManagerPrivate, metricsPrivate, runtime, // tabs @@ -41,7 +40,6 @@ // @ts-ignore: error TS2339: Property 'commandLinePrivate' does not exist on // type 'typeof chrome'. if (!chrome.commandLinePrivate) { - /** @suppress {checkTypes, const} */ // @ts-ignore: error TS2339: Property 'commandLinePrivate' does not exist // on type 'typeof chrome'. chrome.commandLinePrivate = {}; @@ -75,17 +73,14 @@ /** @type {Object<?>} */ this.state = {}; - /** @suppress {const} */ // @ts-ignore: error TS2739: Type '{}' is missing the following properties // from type 'typeof chrome': fileManagerPrivate, metricsPrivate, runtime, // tabs window.chrome = window.chrome || {}; - /** @suppress {const} */ // @ts-ignore: error TS2739: Type '{}' is missing the following properties // from type 'typeof runtime': getURL, getManifest, lastError, id, // onMessageExternal window.chrome.runtime = window.chrome.runtime || {}; // For lastError. - /** @suppress {checkTypes, const} */ // @ts-ignore: error TS2339: Property 'storage' does not exist on type // 'typeof chrome'. window.chrome.storage = { @@ -157,36 +152,29 @@ */ this.driveQuotaMetadata_ = undefined; - /** @suppress {const} */ // @ts-ignore: error TS2739: Type '{}' is missing the following properties // from type 'typeof chrome': fileManagerPrivate, metricsPrivate, runtime, // tabs window.chrome = window.chrome || {}; - /** @suppress {const} */ // @ts-ignore: error TS2740: Type '{}' is missing the following properties // from type 'typeof fileManagerPrivate': setPreferences, // getDriveConnectionState, PreferencesChange, DriveConnectionStateType, and // 186 more. window.chrome.fileManagerPrivate = window.chrome.fileManagerPrivate || {}; - /** @suppress {const} */ window.chrome.fileManagerPrivate.onDirectoryChanged = window.chrome.fileManagerPrivate.onDirectoryChanged || {}; - /** @suppress {const} */ window.chrome.fileManagerPrivate.onDirectoryChanged.addListener = this.addListener_.bind(this); - /** @suppress {const} */ window.chrome.fileManagerPrivate.onDirectoryChanged.removeListener = this.removeListener_.bind(this); - /** @suppress {const} */ window.chrome.fileManagerPrivate.getSizeStats = this.getSizeStats_.bind(this); - /** @suppress {const} */ window.chrome.fileManagerPrivate.getDriveQuotaMetadata = this.getDriveQuotaMetadata_.bind(this);
diff --git a/ui/file_manager/file_manager/common/js/trash.ts b/ui/file_manager/file_manager/common/js/trash.ts index 7368641..2a0f5e87 100644 --- a/ui/file_manager/file_manager/common/js/trash.ts +++ b/ui/file_manager/file_manager/common/js/trash.ts
@@ -6,9 +6,6 @@ * @fileoverview Trash implementation is based on * https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html. * - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - * * When you move /dir/hello.txt to trash, you get: * .Trash/files/hello.txt * .Trash/info/hello.trashinfo
diff --git a/ui/file_manager/file_manager/common/js/unittest_util.js b/ui/file_manager/file_manager/common/js/unittest_util.js deleted file mode 100644 index 3c01f82..0000000 --- a/ui/file_manager/file_manager/common/js/unittest_util.js +++ /dev/null
@@ -1,134 +0,0 @@ -// Copyright 2014 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import {assertEquals, assertTrue} from 'chrome://webui-test/chromeos/chai_assert.js'; - -/** - * Asserts that two lists contain the same set of Entries. Entries are deemed - * to be the same if they point to the same full path. - * - * @param {!Array<!FileEntry>} expected - * @param {!Array<!FileEntry>} actual - */ -export function assertFileEntryListEquals(expected, actual) { - // @ts-ignore: error TS7006: Parameter 'entry' implicitly has an 'any' type. - const entryToPath = entry => { - assertTrue(entry.isFile); - return entry.fullPath; - }; - - assertFileEntryPathsEqual(expected.map(entryToPath), actual); -} - -/** - * Asserts that a list of FileEntry instances point to the expected paths. - * - * @param {!Array<string>} expectedPaths - * @param {!Array<!FileEntry>} fileEntries - */ -export function assertFileEntryPathsEqual(expectedPaths, fileEntries) { - assertEquals(expectedPaths.length, fileEntries.length); - - // @ts-ignore: error TS7006: Parameter 'entry' implicitly has an 'any' type. - const entryToPath = entry => { - assertTrue(entry.isFile); - return entry.fullPath; - }; - - const actualPaths = fileEntries.map(entryToPath); - actualPaths.sort(); - expectedPaths = expectedPaths.slice(); - expectedPaths.sort(); - - assertEquals(JSON.stringify(expectedPaths), JSON.stringify(actualPaths)); -} - -/** - * A class that captures calls to a function so that values can be validated. - * For use in tests only. - * - * <p>Example: - * <pre> - * var recorder = new TestCallRecorder(); - * someClass.addListener(recorder.callback); - * // do stuff ... - * recorder.assertCallCount(1); - * assertEquals(recorder.getListCall()[0], 'hammy'); - * </pre> - */ -export class TestCallRecorder { - constructor() { - /** @private @type {!Array<!*>} */ - this.calls_ = []; - - /** - * The recording function. Bound in our constructor to ensure we always - * return the same object. This is necessary as some clients may make use - * of object equality. - * - * @type {function(*):void} - */ - this.callback = this.recordArguments_.bind(this); - } - - /** - * Records the magic {@code arguments} value for later inspection. - * @private - */ - recordArguments_() { - this.calls_.push(arguments); - } - - /** - * Asserts that the recorder was called {@code expected} times. - * @param {number} expected The expected number of calls. - */ - assertCallCount(expected) { - const actual = this.calls_.length; - assertEquals( - expected, actual, - 'Expected ' + expected + ' call(s), but was ' + actual + '.'); - } - - /** - * @return {?Array<*>} Returns the {@code Arguments} for the last call, - * or null if the recorder hasn't been called. - */ - getLastArguments() { - return (this.calls_.length === 0) ? null : - this.calls_[this.calls_.length - 1]; - } - - /** - * @param {number} index Index of which args to return. - * @return {?Array<*>} Returns the {@code Arguments} for the call specified - * by indexed. - */ - getArguments(index) { - return (index < this.calls_.length) ? this.calls_[index] : null; - } -} - -/** - * Wait for the update (render/re-render) of the `element` to be finished - * in unit test. - * - * @param {!HTMLElement} element - * @return {!Promise<void>} - */ -export async function waitForElementUpdate(element) { - // For LitElement we explicitly await the internal updateComplete promise. - // @ts-ignore: error TS2339: Property 'updateComplete' does not exist on type - // 'HTMLElement'. - if (element.updateComplete && element.updateComplete.then) { - // @ts-ignore: error TS2339: Property 'updateComplete' does not exist on - // type 'HTMLElement'. - await element.updateComplete; - // Wait for nested LitElements to finish rendering. Assumes that all nested - // elements' render() complete in microtasks. - return new Promise(resolve => setTimeout(resolve, 0)); - } - // For others, wait for the next animation frame. - return new Promise(resolve => window.requestAnimationFrame(() => resolve())); -}
diff --git a/ui/file_manager/file_manager/common/js/unittest_util.ts b/ui/file_manager/file_manager/common/js/unittest_util.ts new file mode 100644 index 0000000..447a4885 --- /dev/null +++ b/ui/file_manager/file_manager/common/js/unittest_util.ts
@@ -0,0 +1,23 @@ +// Copyright 2014 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {XfBase} from '../../widgets/xf_base.js'; + +/** + * Wait for the update (render/re-render) of the `element` to be finished + * in unit test. + * + */ +export async function waitForElementUpdate(element: HTMLElement): + Promise<void> { + // For LitElement we explicitly await the internal updateComplete promise. + if (element instanceof XfBase) { + await element.updateComplete; + // Wait for nested LitElements to finish rendering. Assumes that all nested + // elements' render() complete in microtasks. + return new Promise(resolve => setTimeout(resolve, 0)); + } + // For others, wait for the next animation frame. + return new Promise(resolve => window.requestAnimationFrame(() => resolve())); +}
diff --git a/ui/file_manager/file_manager/common/js/volume_manager_types.ts b/ui/file_manager/file_manager/common/js/volume_manager_types.ts index b73a141a7..245801d 100644 --- a/ui/file_manager/file_manager/common/js/volume_manager_types.ts +++ b/ui/file_manager/file_manager/common/js/volume_manager_types.ts
@@ -23,6 +23,7 @@ EXT4 = 'ext4', ISO9660 = 'iso9660', UDF = 'udf', + FUSEBOX = 'fusebox', }
diff --git a/ui/file_manager/file_manager/containers/cloud_panel_container.ts b/ui/file_manager/file_manager/containers/cloud_panel_container.ts index 9e5247f..72023e17 100644 --- a/ui/file_manager/file_manager/containers/cloud_panel_container.ts +++ b/ui/file_manager/file_manager/containers/cloud_panel_container.ts
@@ -5,7 +5,6 @@ /** * @fileoverview Maintains the state of the `<xf-cloud-panel>` and ensures the * information is passed to it appropriately. - * @suppress {checkTypes} TS already checks this file. */ import {canBulkPinningCloudPanelShow} from '../common/js/util.js';
diff --git a/ui/file_manager/file_manager/containers/directory_tree_container.ts b/ui/file_manager/file_manager/containers/directory_tree_container.ts index 8a89ec16..0878a997 100644 --- a/ui/file_manager/file_manager/containers/directory_tree_container.ts +++ b/ui/file_manager/file_manager/containers/directory_tree_container.ts
@@ -30,7 +30,6 @@ /** * @fileoverview The Directory Tree aka Navigation Tree. - * @suppress {checkTypes} TS already checks this file. */ const NAVIGATION_TYPES_WITHOUT_CHILDREN = new Set([ @@ -957,8 +956,18 @@ // If Drive fake root is selected and it has Drive volume inside, we // expand it and go to the My Drive (1st child) directly. element.expanded = true; - this.store_.dispatch( - changeDirectory({toKey: fileData.children[0]!})); + const myDriveKey = fileData.children[0]!; + const isMyDriveActive = this.isCurrentDirectoryActive_(myDriveKey); + // If My Drive is already active, dispatching the changeDirectory + // below with STARTED status won't trigger a SUCCESS status in + // DirectoryModel because toKey is the same with the current + // directory key in the store. As we rely on the SUCCESS status to + // decide which tree item to select, we need to dispatch a SUCCESS + // status changeDirectory action in this case. + this.store_.dispatch(changeDirectory({ + toKey: myDriveKey, + status: isMyDriveActive ? PropStatus.SUCCESS : PropStatus.STARTED, + })); } return; }
diff --git a/ui/file_manager/file_manager/containers/directory_tree_container_unittest.ts b/ui/file_manager/file_manager/containers/directory_tree_container_unittest.ts index e9bc353..846249b 100644 --- a/ui/file_manager/file_manager/containers/directory_tree_container_unittest.ts +++ b/ui/file_manager/file_manager/containers/directory_tree_container_unittest.ts
@@ -6,17 +6,15 @@ import {assertArrayEquals, assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {MockVolumeManager} from '../background/js/mock_volume_manager.js'; -import {EntryList, FakeEntryImpl, VolumeEntry} from '../common/js/files_app_entry_types.js'; import {installMockChrome} from '../common/js/mock_chrome.js'; import {MockFileSystem} from '../common/js/mock_entry.js'; import {waitUntil} from '../common/js/test_error_reporting.js'; import {waitForElementUpdate} from '../common/js/unittest_util.js'; -import {RootType, VolumeType} from '../common/js/volume_manager_types.js'; -import {State} from '../externs/ts/state.js'; -import {convertEntryToFileData} from '../state/ducks/all_entries.js'; -import {addVolume, convertVolumeInfoAndMetadataToVolume, driveRootEntryListKey, removeVolume} from '../state/ducks/volumes.js'; +import {VolumeType} from '../common/js/volume_manager_types.js'; +import {addAndroidApps} from '../state/ducks/android_apps.js'; +import {addVolume, removeVolume} from '../state/ducks/volumes.js'; import {createFakeVolumeMetadata, setUpFileManagerOnWindow, setupStore} from '../state/for_tests.js'; -import {getEmptyState, getEntry, getFileData, getStore} from '../state/store.js'; +import {getStore} from '../state/store.js'; import {XfTree} from '../widgets/xf_tree.js'; import {DirectoryTreeContainer} from './directory_tree_container.js'; @@ -45,6 +43,7 @@ // Initialize directory tree container. const {directoryModel, volumeManager} = window.fileManager; window.store = null; + setupStore(); directoryTreeContainer = new DirectoryTreeContainer(document.body, directoryModel, volumeManager); } @@ -69,50 +68,27 @@ } /** - * Add MyFiles and Drive data to the store. - * Note: it will modify the state passed in place. + * Dispatch MyFiles and Drive volumes data to the store. */ -async function addMyFilesAndDriveToStore(state: State): +async function addMyFilesAndDriveVolumes(): Promise<{myFilesFs: MockFileSystem, driveFs: MockFileSystem}> { const {volumeManager} = window.fileManager; + const store = getStore(); // Prepare data for MyFiles. const downloadsVolumeInfo = volumeManager.getCurrentProfileVolumeInfo(VolumeType.DOWNLOADS)!; - const downloadsEntry = new VolumeEntry(downloadsVolumeInfo); - state.allEntries[downloadsEntry.toURL()] = - convertEntryToFileData(downloadsEntry); - state.volumes[downloadsVolumeInfo.volumeId] = - convertVolumeInfoAndMetadataToVolume( - downloadsVolumeInfo, createFakeVolumeMetadata(downloadsVolumeInfo)); + store.dispatch(addVolume({ + volumeInfo: downloadsVolumeInfo, + volumeMetadata: createFakeVolumeMetadata(downloadsVolumeInfo), + })); // Prepare data for Drive. - // - Fake drive root. - const driveRootEntryList = - new EntryList('Google Drive', RootType.DRIVE_FAKE_ROOT); - state.allEntries[driveRootEntryListKey] = - convertEntryToFileData(driveRootEntryList); - state.uiEntries.push(driveRootEntryListKey); - // - My Drive const driveVolumeInfo = volumeManager.getCurrentProfileVolumeInfo(VolumeType.DRIVE)!; await driveVolumeInfo.resolveDisplayRoot(); - const driveEntry = new VolumeEntry(driveVolumeInfo); - state.allEntries[driveEntry.toURL()] = convertEntryToFileData(driveEntry); - state.volumes[driveVolumeInfo.volumeId] = - convertVolumeInfoAndMetadataToVolume( - driveVolumeInfo, createFakeVolumeMetadata(driveVolumeInfo)); - driveRootEntryList.addEntry(driveEntry); - // - Shared with me - const sharedWithMeEntry = - driveVolumeInfo.fakeEntries[RootType.DRIVE_SHARED_WITH_ME]!; - state.allEntries[sharedWithMeEntry.toURL()] = - convertEntryToFileData(sharedWithMeEntry); - state.uiEntries.push(sharedWithMeEntry.toURL()); - driveRootEntryList.addEntry(sharedWithMeEntry); - // - Offline - const offlineEntry = driveVolumeInfo.fakeEntries[RootType.DRIVE_OFFLINE]!; - state.allEntries[offlineEntry.toURL()] = convertEntryToFileData(offlineEntry); - state.uiEntries.push(offlineEntry.toURL()); - driveRootEntryList.addEntry(offlineEntry); + store.dispatch(addVolume({ + volumeInfo: driveVolumeInfo, + volumeMetadata: createFakeVolumeMetadata(driveVolumeInfo), + })); return { myFilesFs: downloadsVolumeInfo.fileSystem as MockFileSystem, @@ -121,65 +97,61 @@ } /** - * Add Team drives data with optional children to the store. - * Note: it will modify the state passed in place. + * Add MyFiles children and trigger file watcher change event. */ -function addTeamDrivesToStore(state: State, childEntries: string[] = []) { +function addMyFilesChildren(parentEntry: Entry, childEntries: string[]) { const {volumeManager} = window.fileManager; - const driveVolumeInfo = - volumeManager.getCurrentProfileVolumeInfo(VolumeType.DRIVE)!; - const teamDrivesEntry = driveVolumeInfo.sharedDriveDisplayRoot; - state.allEntries[teamDrivesEntry.toURL()] = - convertEntryToFileData(teamDrivesEntry); - state.uiEntries.push(teamDrivesEntry.toURL()); - const driveRootEntryList = - getEntry(state, driveRootEntryListKey) as EntryList; - const existingChildren = driveRootEntryList.getUIChildren(); - existingChildren.splice(1, 0, teamDrivesEntry); + const downloadsVolumeInfo = + volumeManager.getCurrentProfileVolumeInfo(VolumeType.DOWNLOADS)!; + const myFilesFs = downloadsVolumeInfo.fileSystem as MockFileSystem; + myFilesFs.populate(childEntries); - if (childEntries.length > 0) { - const driveFs = driveVolumeInfo.fileSystem as MockFileSystem; - driveFs.populate(childEntries); + // Trigger file watcher event. + const event = { + entry: parentEntry, + eventType: 'changed', + }; + for (const listener of directoryChangedListeners) { + listener(event); } } + /** - * Add Computers data with optional children to the store. - * Note: it will modify the state passed in place. + * Add Drive children and trigger file watcher change event. */ -function addComputerDrivesToStore(state: State, childEntries: string[] = []) { +function addDriveChildren(parentEntry: Entry, childEntries: string[]) { const {volumeManager} = window.fileManager; const driveVolumeInfo = volumeManager.getCurrentProfileVolumeInfo(VolumeType.DRIVE)!; - const computersEntry = driveVolumeInfo.computersDisplayRoot; - state.allEntries[computersEntry.toURL()] = - convertEntryToFileData(computersEntry); - state.uiEntries.push(computersEntry.toURL()); - const driveRootEntryList = - getEntry(state, driveRootEntryListKey) as EntryList; - const existingChildren = driveRootEntryList.getUIChildren(); - // Computers entry should be inserted after Team drives entry if it exists. - const insertIndex = existingChildren[1] instanceof FakeEntryImpl ? 1 : 2; - existingChildren.splice(insertIndex, 0, computersEntry); + const driveFs = driveVolumeInfo.fileSystem as MockFileSystem; + driveFs.populate(childEntries); - if (childEntries.length > 0) { - const driveFs = driveVolumeInfo.fileSystem as MockFileSystem; - driveFs.populate(childEntries); + // Trigger file watcher event. + const event = { + entry: parentEntry, + eventType: 'changed', + }; + for (const listener of directoryChangedListeners) { + listener(event); } } /** * Add Android app navigation data to the store. - * Note: it will modify the state passed in place. */ -function addAndroidAppToStore(state: State) { - state.androidApps['com.test.app1'] = { - name: 'App 1', - packageName: 'com.test.app1', - activityName: 'Activity1', - iconSet: {icon16x16Url: 'url1', icon32x32Url: 'url2'}, - icon: '', - }; +function addAndroidAppToStore() { + const store = getStore(); + store.dispatch(addAndroidApps({ + apps: [ + { + name: 'App 1', + packageName: 'com.test.app1', + activityName: 'Activity1', + iconSet: {icon16x16Url: 'url1', icon32x32Url: 'url2'}, + }, + ], + })); } /** @@ -193,13 +165,10 @@ * - Offline */ export async function testCreateDirectoryTree() { - const initialState = getEmptyState(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - await addMyFilesAndDriveToStore(initialState); - // Store initialization will notify DirectoryTree. - setupStore(initialState); + await addMyFilesAndDriveVolumes(); // At top level, MyFiles and Drive should be listed. await waitUntil(() => directoryTree.items.length === 2); @@ -231,15 +200,12 @@ * - Offline */ export async function testCreateDirectoryTreeWithTeamDrive() { - const initialState = getEmptyState(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - await addMyFilesAndDriveToStore(initialState); + const {driveFs} = await addMyFilesAndDriveVolumes(); // Add Team Drives. - addTeamDrivesToStore(initialState, ['/team_drives/a/']); - // Store initialization will notify DirectoryTree. - setupStore(initialState); + addDriveChildren(driveFs.entries['/team_drives']!, ['/team_drives/a/']); // At top level, MyFiles and Drive should be listed. await waitUntil(() => directoryTree.items.length === 2); @@ -267,15 +233,10 @@ * The Team Drives subtree should be removed if the user has no team drives. */ export async function testCreateDirectoryTreeWithEmptyTeamDrive() { - const initialState = getEmptyState(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - await addMyFilesAndDriveToStore(initialState); - // No directories exist under Team Drives. - addTeamDrivesToStore(initialState); - // Store initialization will notify DirectoryTree. - setupStore(initialState); + await addMyFilesAndDriveVolumes(); // At top level, MyFiles and Drive should be listed. await waitUntil(() => directoryTree.items.length === 2); @@ -315,15 +276,12 @@ * - Offline */ export async function testCreateDirectoryTreeWithComputers() { - const initialState = getEmptyState(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - await addMyFilesAndDriveToStore(initialState); + const {driveFs} = await addMyFilesAndDriveVolumes(); // Add Computers. - addComputerDrivesToStore(initialState, ['/Computers/My Laptop/']); - // Store initialization will notify DirectoryTree. - setupStore(initialState); + addDriveChildren(driveFs.entries['/Computers']!, ['/Computers/My Laptop/']); // At top level, MyFiles and Drive should be listed. await waitUntil(() => directoryTree.items.length === 2); @@ -351,15 +309,10 @@ * The Computers subtree should be removed if the user has no computers. */ export async function testCreateDirectoryTreeWithEmptyComputers() { - const initialState = getEmptyState(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - await addMyFilesAndDriveToStore(initialState); - // No directories exist under Computers. - addComputerDrivesToStore(initialState); - // Store initialization will notify DirectoryTree. - setupStore(initialState); + await addMyFilesAndDriveVolumes(); // At top level, MyFiles and Drive should be listed. await waitUntil(() => directoryTree.items.length === 2); @@ -400,18 +353,14 @@ * - Offline */ export async function testCreateDirectoryTreeWithTeamDrivesAndComputers() { - const initialState = getEmptyState(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - await addMyFilesAndDriveToStore(initialState); + const {driveFs} = await addMyFilesAndDriveVolumes(); // Add Team drives. - addTeamDrivesToStore(initialState, ['/team_drives/a/']); + addDriveChildren(driveFs.entries['/team_drives']!, ['/team_drives/a/']); // Add Computers. - addComputerDrivesToStore(initialState, ['/Computers/My Laptop/']); - // Store initialization will notify DirectoryTree. - setupStore(initialState); - + addDriveChildren(driveFs.entries['/Computers']!, ['/Computers/My Laptop/']); // At top level, MyFiles and Drive should be listed. await waitUntil(() => directoryTree.items.length === 2); const myFilesItem = directoryTree.items[0]!; @@ -447,15 +396,12 @@ * Android app 1 */ export async function testSeparatorInNavigationSections() { - const initialState = getEmptyState(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - await addMyFilesAndDriveToStore(initialState); + await addMyFilesAndDriveVolumes(); // Add Android apps. - addAndroidAppToStore(initialState); - // Store initialization will notify DirectoryTree. - setupStore(initialState); + addAndroidAppToStore(); // At top level, MyFiles, Drive and Android app should be listed. await waitUntil(() => directoryTree.items.length === 3); @@ -484,13 +430,11 @@ * up to/disappear from the list correctly. */ export async function testDirectoryTreeUpdateWithVolumeChanges() { - const initialState = getEmptyState(); const directoryTree = directoryTreeContainer.tree; + const store = getStore(); // Add MyFiles and Drive to the store. - await addMyFilesAndDriveToStore(initialState); - // Store initialization will notify DirectoryTree. - const store = setupStore(initialState); + await addMyFilesAndDriveVolumes(); // There are 2 volumes, MyFiles and Drive, at first. await waitUntil(() => directoryTree.items.length === 2); @@ -563,13 +507,12 @@ * clicking on the item or the expand icon shouldn't do anything. */ export async function testDirectoryTreeWithAndroidDisabled() { - const initialState = getEmptyState(); + const store = getStore(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - await addMyFilesAndDriveToStore(initialState); - // Store initialization will notify DirectoryTree. - const store = setupStore(initialState); + await addMyFilesAndDriveVolumes(); + await waitUntil(() => directoryTree.items.length === 2); // Create Android 'Play files' volume and set as disabled. @@ -614,13 +557,12 @@ * but cannot be selected or expanded. */ export async function testDirectoryTreeWithRemovableDisabled() { - const initialState = getEmptyState(); + const store = getStore(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - await addMyFilesAndDriveToStore(initialState); - // Store initialization will notify DirectoryTree. - const store = setupStore(initialState); + await addMyFilesAndDriveVolumes(); + await waitUntil(() => directoryTree.items.length === 2); // Create removable volume and set as disabled. @@ -669,21 +611,19 @@ * expand icon shouldn't do anything. */ export async function testDirectoryTreeWithDriveDisabled() { - const initialState = getEmptyState(); const directoryTree = directoryTreeContainer.tree; + // Disable Drive volume before adding it. + const {volumeManager} = window.fileManager; + volumeManager.isDisabled = (volumeType) => { + return volumeType === VolumeType.DRIVE; + }; + // Add MyFiles and Drive to the store. - const {myFilesFs, driveFs} = await addMyFilesAndDriveToStore(initialState); + const {myFilesFs, driveFs} = await addMyFilesAndDriveVolumes(); // Add sub folders for them. - myFilesFs.populate(['/folder1/']); - driveFs.populate(['/root/folder1/']); - const driveRootEntryFileData = - getFileData(initialState, driveRootEntryListKey)!; - // Disable the drive root entry. - driveRootEntryFileData.disabled = true; - (driveRootEntryFileData.entry as EntryList).disabled = true; - // Store initialization will notify DirectoryTree. - setupStore(initialState); + addMyFilesChildren(myFilesFs.entries['/']!, ['/folder1/']); + addDriveChildren(driveFs.entries['/root']!, ['/root/folder1/']); // At top level, MyFiles and Drive should be listed. await waitUntil(() => directoryTree.items.length === 2); @@ -723,15 +663,10 @@ * delivered. */ export async function testAddFirstTeamDrive() { - const initialState = getEmptyState(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - const {driveFs} = await addMyFilesAndDriveToStore(initialState); - // No directories exist under Team Drives. - addTeamDrivesToStore(initialState); - // Store initialization will notify DirectoryTree. - setupStore(initialState); + const {driveFs} = await addMyFilesAndDriveVolumes(); // At top level, MyFiles and Drive should be listed. await waitUntil(() => directoryTree.items.length === 2); @@ -743,14 +678,7 @@ }); // Add one folder to the Team drives. - driveFs.populate(['/team_drives/a/']); - const event = { - entry: driveFs.entries['/team_drives'], - eventType: 'changed', - }; - for (const listener of directoryChangedListeners) { - listener(event); - } + addDriveChildren(driveFs.entries['/team_drives']!, ['/team_drives/a/']); // Expand Drive before checking Team drives. driveItem.expanded = true; await waitUntil(() => { @@ -765,15 +693,12 @@ * delivered. */ export async function testRemoveLastTeamDrive() { - const initialState = getEmptyState(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - const {driveFs} = await addMyFilesAndDriveToStore(initialState); + const {driveFs} = await addMyFilesAndDriveVolumes(); // Add one entry under Team Drives. - addTeamDrivesToStore(initialState, ['/team_drives/a/']); - // Store initialization will notify DirectoryTree. - setupStore(initialState); + addDriveChildren(driveFs.entries['/team_drives']!, ['/team_drives/a/']); // At top level, MyFiles and Drive should be listed. await waitUntil(() => directoryTree.items.length === 2); @@ -815,15 +740,10 @@ * delivered. */ export async function testAddFirstComputer() { - const initialState = getEmptyState(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - const {driveFs} = await addMyFilesAndDriveToStore(initialState); - // No directories exist under Computers. - addComputerDrivesToStore(initialState); - // Store initialization will notify DirectoryTree. - setupStore(initialState); + const {driveFs} = await addMyFilesAndDriveVolumes(); // At top level, MyFiles and Drive should be listed. await waitUntil(() => directoryTree.items.length === 2); @@ -837,14 +757,7 @@ // Test that we initially do not have a Computers item under Drive, and that // adding a filesystem "/Computers/My Laptop" results in the Computers item // being displayed under Drive. - driveFs.populate(['/Computers/My laptop/']); - const event = { - entry: driveFs.entries['/Computers'], - eventType: 'changed', - }; - for (const listener of directoryChangedListeners) { - listener(event); - } + addDriveChildren(driveFs.entries['/Computers']!, ['/Computers/My Laptop/']); // Expand Drive before checking Computers. driveItem.expanded = true; await waitUntil(() => { @@ -859,15 +772,12 @@ * delivered. */ export async function testRemoveLastComputer() { - const initialState = getEmptyState(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - const {driveFs} = await addMyFilesAndDriveToStore(initialState); + const {driveFs} = await addMyFilesAndDriveVolumes(); // Add one entry under Computers. - addComputerDrivesToStore(initialState, ['/Computers/My Laptop/']); - // Store initialization will notify DirectoryTree. - setupStore(initialState); + addDriveChildren(driveFs.entries['/Computers']!, ['/Computers/My Laptop/']); // At top level, MyFiles and Drive should be listed. await waitUntil(() => directoryTree.items.length === 2); @@ -909,13 +819,11 @@ * Sub directories should be fetched for FSPs, but not for the Smb FSP. */ export async function testAddProviders() { - const initialState = getEmptyState(); + const store = getStore(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - await addMyFilesAndDriveToStore(initialState); - // Store initialization will notify DirectoryTree. - const store = setupStore(initialState); + await addMyFilesAndDriveVolumes(); const volumeManager = window.fileManager.volumeManager as MockVolumeManager; // Add a volume representing a non-Smb provider to the mock filesystem. @@ -985,13 +893,11 @@ * clicked. */ export async function testSmbNotFetchedUntilClick() { - const initialState = getEmptyState(); + const store = getStore(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - await addMyFilesAndDriveToStore(initialState); - // Store initialization will notify DirectoryTree. - const store = setupStore(initialState); + await addMyFilesAndDriveVolumes(); const volumeManager = window.fileManager.volumeManager as MockVolumeManager; // Add a volume representing a smb provider to the mock filesystem. @@ -1030,16 +936,13 @@ /** Test aria-expanded attribute for directory tree item. */ export async function testAriaExpanded() { - const initialState = getEmptyState(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - const {myFilesFs, driveFs} = await addMyFilesAndDriveToStore(initialState); + const {myFilesFs, driveFs} = await addMyFilesAndDriveVolumes(); // Add sub folders for them. - myFilesFs.populate(['/folder1/']); - driveFs.populate(['/root/folder1']); - // Store initialization will notify DirectoryTree. - setupStore(initialState); + addMyFilesChildren(myFilesFs.entries['/']!, ['/folder1/']); + addDriveChildren(driveFs.entries['/root']!, ['/root/folder1']); // At top level, MyFiles and Drive should be listed. await waitUntil(() => directoryTree.items.length === 2); @@ -1076,13 +979,10 @@ /** Test aria-description attribute for selected directory tree item. */ export async function testAriaDescription() { - const initialState = getEmptyState(); const directoryTree = directoryTreeContainer.tree; // Add MyFiles and Drive to the store. - await addMyFilesAndDriveToStore(initialState); - // Store initialization will notify DirectoryTree. - setupStore(initialState); + await addMyFilesAndDriveVolumes(); // At top level, MyFiles and Drive should be listed. await waitUntil(() => directoryTree.items.length === 2);
diff --git a/ui/file_manager/file_manager/containers/search_container.ts b/ui/file_manager/file_manager/containers/search_container.ts index afcd5ae..247d837c 100644 --- a/ui/file_manager/file_manager/containers/search_container.ts +++ b/ui/file_manager/file_manager/containers/search_container.ts
@@ -23,12 +23,6 @@ import type {XfOption} from '../widgets/xf_select.js'; /** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - -/** * Defines the possible states of the query input widget. This is a widget with * a search button, text input and clear button. By default, the widget is * closed. When active, it is open. Due to CSS transitions it has two
diff --git a/ui/file_manager/file_manager/foreground/elements/files_format_dialog.ts b/ui/file_manager/file_manager/foreground/elements/files_format_dialog.ts index 8506e9e..be9ea96 100644 --- a/ui/file_manager/file_manager/foreground/elements/files_format_dialog.ts +++ b/ui/file_manager/file_manager/foreground/elements/files_format_dialog.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import 'chrome://resources/cr_elements/cr_button/cr_button.js'; import 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; import 'chrome://resources/cr_elements/cr_input/cr_input.js';
diff --git a/ui/file_manager/file_manager/foreground/js/banner_controller.ts b/ui/file_manager/file_manager/foreground/js/banner_controller.ts index 2e012a8e..bdd7d6b 100644 --- a/ui/file_manager/file_manager/foreground/js/banner_controller.ts +++ b/ui/file_manager/file_manager/foreground/js/banner_controller.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {NativeEventTarget as EventTarget} from 'chrome://resources/ash/common/event_target.js'; import {getDriveQuotaMetadata, getSizeStats} from '../../common/js/api.js';
diff --git a/ui/file_manager/file_manager/foreground/js/banner_controller_unittest.ts b/ui/file_manager/file_manager/foreground/js/banner_controller_unittest.ts index 92e693e..cb75b3a 100644 --- a/ui/file_manager/file_manager/foreground/js/banner_controller_unittest.ts +++ b/ui/file_manager/file_manager/foreground/js/banner_controller_unittest.ts
@@ -977,7 +977,6 @@ /** * Test that a banner with timeLimit set hides after the defined time limit. - * @suppress {accessControls} to call updateTimeLimit on BannerController. */ export async function testTimeLimitReachedHidesBanner() { controller.setWarningBannersInOrder([testWarningBanners[0]!.tagName]); @@ -1015,7 +1014,6 @@ /** * Test that the constant Banner.INFINITE_TIME allows the banner to display for * a super long time. - * @suppress {accessControls} to call updateTimeLimit on BannerController. */ export async function testInfiniteTimeLimitWorks() { controller.setWarningBannersInOrder([testWarningBanners[0]!.tagName]); @@ -1114,7 +1112,6 @@ /** * Test that custom filters can be attached to banners in the event specific * logic needs to be ran for individual banners. - * @suppress {accessControls} to call registerCustomBannerFilter. */ export async function testCustomFiltersCanBeAttached() { // Add 1 educational banner and 1 warning banner. @@ -1155,7 +1152,6 @@ /** * Test that custom filters interact with other configuration elements. - * @suppress {accessControls} to call registerCustomBannerFilter. */ export async function testCustomFiltersInteract() { // Add 2 educational banners and 1 warning banner. @@ -1219,7 +1215,6 @@ /** * Test that custom banners receive their requested context when the filter * function is executed. - * @suppress {accessControls} to call registerCustomBannerFilter. */ export async function testCustomContextIsReceivedByBanner() { // Add 1 warning banner. @@ -1259,7 +1254,6 @@ /** * Test that if multiple filters are registered to a single banner, only the * winning filter has their associated context passed to the banner. - * @suppress {accessControls} to call registerCustomBannerFilter. */ export async function testWinningFilterContextIsPassed() { // Add 1 warning banner.
diff --git a/ui/file_manager/file_manager/foreground/js/directory_contents.js b/ui/file_manager/file_manager/foreground/js/directory_contents.js index 0c15eff..e5df2b2 100644 --- a/ui/file_manager/file_manager/foreground/js/directory_contents.js +++ b/ui/file_manager/file_manager/foreground/js/directory_contents.js
@@ -1526,10 +1526,7 @@ // Call callback first, so isScanning() returns false in the event // handlers. callback(); - const event = new Event('scan-failed'); - // @ts-ignore: error TS2339: Property 'error' does not exist on type - // 'Event'. - event.error = error; + const event = new CustomEvent('scan-failed', {detail: {error}}); this.dispatchEvent(event); }); } @@ -1624,7 +1621,7 @@ } /** - * @param {!Array<!Entry>} entries Files. + * @param {!Array<!Entry|!FilesAppEntry>} entries Files. * @param {boolean} refresh True to refresh metadata, or false to use cached * one. * @param {function(Object):void} callback Callback on done.
diff --git a/ui/file_manager/file_manager/foreground/js/directory_model.js b/ui/file_manager/file_manager/foreground/js/directory_model.ts similarity index 65% rename from ui/file_manager/file_manager/foreground/js/directory_model.js rename to ui/file_manager/file_manager/foreground/js/directory_model.ts index 77a77cf..8fa88ea6 100644 --- a/ui/file_manager/file_manager/foreground/js/directory_model.js +++ b/ui/file_manager/file_manager/foreground/js/directory_model.ts
@@ -8,17 +8,20 @@ import {Aggregator, AsyncQueue} from '../../common/js/async_util.js'; import {isModal} from '../../common/js/dialog_type.js'; -import {convertURLsToEntries, entriesToURLs, isFakeEntry, isGuestOs, isNativeEntry, isOneDriveId, isRecentRootType, isSameEntry, urlToEntry} from '../../common/js/entry_utils.js'; -import {EntryList, GuestOsPlaceholder, VolumeEntry} from '../../common/js/files_app_entry_types.js'; +import {convertURLsToEntries, entriesToURLs, getRootType, isFakeEntry, isGuestOs, isNativeEntry, isOneDriveId, isRecentRootType, isSameEntry, urlToEntry} from '../../common/js/entry_utils.js'; +import type {GuestOsPlaceholder} from '../../common/js/files_app_entry_types.js'; import {isDlpEnabled, isDriveFsBulkPinningEnabled} from '../../common/js/flags.js'; import {recordMediumCount, recordUserAction} from '../../common/js/metrics.js'; import {getEntryLabel} from '../../common/js/translations.js'; import {testSendMessage} from '../../common/js/util.js'; -import {getVolumeTypeFromRootType, isNative, RootType, Source, VolumeType} from '../../common/js/volume_manager_types.js'; -import {FakeEntry, FilesAppDirEntry, FilesAppEntry} from '../../externs/files_app_entry_interfaces.js'; +import {FileSystemType, getVolumeTypeFromRootType, isNative, RootType, Source, VolumeType} from '../../common/js/volume_manager_types.js'; +import type {ArrayDataModelSpliceEvent} from '../../definitions/array_data_model_splice_event.js'; +import type {FakeEntry, FilesAppDirEntry, FilesAppEntry} from '../../externs/files_app_entry_interfaces.js'; import {PropStatus, SearchLocation, SearchOptions, State, Volume, VolumeId} from '../../externs/ts/state.js'; -// @ts-ignore: error TS6133: 'Store' is declared but its value is never read. -import {Store} from '../../externs/ts/store.js'; +import type {SearchData} from '../../externs/ts/state.js'; +import type {Store} from '../../externs/ts/store.js'; +import type {VolumeInfo} from '../../externs/volume_info.js'; +import type {VolumeManager} from '../../externs/volume_manager.js'; import {getMyFiles} from '../../state/ducks/all_entries.js'; import {changeDirectory} from '../../state/ducks/current_directory.js'; import {clearSearch, getDefaultSearchOptions, updateSearch} from '../../state/ducks/search.js'; @@ -27,11 +30,33 @@ import {constants} from './constants.js'; import {ContentScanner, CrostiniMounter, DirectoryContents, DirectoryContentScanner, DriveMetadataSearchContentScanner, FileFilter, FileListContext, GuestOsMounter, MediaViewContentScanner, RecentContentScanner, SearchV2ContentScanner, TrashContentScanner} from './directory_contents.js'; import {FileListModel} from './file_list_model.js'; -import {FileWatcher} from './file_watcher.js'; -import {MetadataModel} from './metadata/metadata_model.js'; +import {FileWatcher, type WatcherDirectoryChangedEvent} from './file_watcher.js'; +import type {MetadataModel} from './metadata/metadata_model.js'; import {FileListSelectionModel, FileListSingleSelectionModel} from './ui/file_list_selection_model.js'; -import {ListSelectionModel} from './ui/list_selection_model.js'; -import {ListSingleSelectionModel} from './ui/list_single_selection_model.js'; +import type {ListSelectionModel} from './ui/list_selection_model.js'; +import type {ListSingleSelectionModel} from './ui/list_single_selection_model.js'; + +/** + * Used to track asynchronous directory change use like: + * const tracker = directoryModel.createDirectoryChangeTracker(); + * tracker.start(); + * try { + * ... async code here ... + * if (tracker.hasChanged) { + * // This code shouldn't continue anymore. + * } + * } finally { + * tracker.stop(); + * } + */ +export interface DirectoryChangeTracker { + start(): void; + stop(): void; + // Indicates that another directory change has occurred since start(). The + // change tracker that sees a `hasChanged=true` should not proceed to change + // the directory, because they became stale. + hasChanged: boolean; +} // If directory files changes too often, don't rescan directory more than once // per specified interval @@ -45,14 +70,11 @@ * between V1 and V2 versions of search, when the user searches in Recent, and * uses Recent as location, we reuse the Recent scanner. Otherwise, the true * search scanner is used. - * @param {!DirectoryEntry|!FilesAppEntry} entry Directory entry. - * @param {SearchOptions=} options search options. - * @private */ -function isRecentScan(entry, options) { - // @ts-ignore: error TS2339: Property 'rootType' does not exist on type - // 'FileSystemDirectoryEntry | FilesAppEntry'. - if (isRecentRootType(entry.rootType)) { +function isRecentScan( + entry: DirectoryEntry|FilesAppEntry, + options?: SearchOptions): entry is FakeEntry { + if (isRecentRootType(getRootType(entry))) { // Potential search in Recents. However, if options are present and are // indicating that the user wishes to scan current entry, still use Recent // scanner. @@ -66,11 +88,10 @@ /** * Helper function that determines the category of files we are looking for * based on the fake entry, query and options. - * @param {!FakeEntry} entry - * @param {string|undefined} query - * @param {!SearchOptions|undefined} options */ -function getFileCategory(entry, query, options) { +function getFileCategory( + entry: FakeEntry, query: string|undefined, + options: SearchOptions|undefined) { if (query) { if (options) { return options.fileCategory; @@ -83,55 +104,51 @@ * Data model of the file manager. */ export class DirectoryModel extends EventTarget { + private fileListSelection_: FileListSingleSelectionModel| + FileListSelectionModel; + private runningScan_: DirectoryContents|null = null; + private pendingScan_: boolean|null = null; + private pendingRescan_: boolean|null = null; + private rescanTime_: number|null = null; + private rescanTimeoutId_?: number; + private changeDirectorySequence_ = 0; + private cachedSearch_: SearchData|undefined|{} = {}; + private scanFailures_ = 0; + private onSearchCompleted_: ((e: Event) => void)|null = null; + private ignoreCurrentDirectoryDeletion_ = false; + private directoryChangeQueue_ = new AsyncQueue(); /** - * @param {boolean} singleSelection True if only one file could be selected - * at the time. - * @param {FileFilter} fileFilter Instance of FileFilter. - * @param {!MetadataModel} metadataModel Metadata model. - * service. - * @param {!import('../../externs/volume_manager.js').VolumeManager} - * volumeManager The volume manager. + * Number of running directory change trackers. */ - constructor(singleSelection, fileFilter, metadataModel, volumeManager) { + private numChangeTrackerRunning_ = 0; + private rescanAggregator_ = + new Aggregator(this.rescanSoon.bind(this, true), 500); + private currentFileListContext_: FileListContext; + private currentDirContents_: DirectoryContents; + private emptyFileList_: FileListModel; + private fileWatcher_ = new FileWatcher(); + private lastSearchQuery_ = ''; + private volumes_: (Record<VolumeId, Volume>)|null = null; + private store_: Store; + + /** + * @param singleSelection True if only one file could be selected at the time. + */ + constructor( + singleSelection: boolean, private fileFilter_: FileFilter, + private metadataModel_: MetadataModel, + private volumeManager_: VolumeManager) { super(); this.fileListSelection_ = singleSelection ? new FileListSingleSelectionModel() : new FileListSelectionModel(); - this.runningScan_ = null; - this.pendingScan_ = null; - this.pendingRescan_ = null; - this.rescanTime_ = null; - this.scanFailures_ = 0; - this.changeDirectorySequence_ = 0; - this.cachedSearch_ = {}; - - /** @private @type {?function(Event): void} */ - this.onSearchCompleted_ = null; - - /** - * @private @type {boolean} - */ - this.ignoreCurrentDirectoryDeletion_ = false; - - this.directoryChangeQueue_ = new AsyncQueue(); - - /** - * Number of running directory change trackers. - * @private @type {number} - */ - this.numChangeTrackerRunning_ = 0; - - this.rescanAggregator_ = - new Aggregator(this.rescanSoon.bind(this, true), 500); - - this.fileFilter_ = fileFilter; this.fileFilter_.addEventListener( 'changed', this.onFilterChanged_.bind(this)); - this.currentFileListContext_ = - new FileListContext(fileFilter, metadataModel, volumeManager); + this.currentFileListContext_ = new FileListContext( + this.fileFilter_, this.metadataModel_, this.volumeManager_); this.currentDirContents_ = new DirectoryContents( this.currentFileListContext_, false, undefined, () => { return new DirectoryContentScanner(undefined); @@ -139,56 +156,37 @@ /** * Empty file list which is used as a dummy for inactive view of file list. - * @private @type {!FileListModel} */ - this.emptyFileList_ = new FileListModel(metadataModel); + this.emptyFileList_ = new FileListModel(this.metadataModel_); - this.metadataModel_ = metadataModel; - - this.volumeManager_ = volumeManager; this.volumeManager_.volumeInfoList.addEventListener( - 'splice', this.onVolumeInfoListUpdated_.bind(this)); + 'splice', this.onVolumeInfoListUpdated_.bind(this) as EventListener); - /** - * File watcher. - * @private @type {!FileWatcher} - * @const - */ - this.fileWatcher_ = new FileWatcher(); this.fileWatcher_.addEventListener( 'watcher-directory-changed', this.onWatcherDirectoryChanged_.bind(this)); // For non-watchable directories (e.g. FakeEntry) and volumes (MTP) we need // to subscribe to the IOTask and manually refresh. chrome.fileManagerPrivate.onIOTaskProgressStatus.addListener( - this.updateFileListAfterIOTask_.bind(this)); + this.updateFileListAfterIoTask_.bind(this)); - /** @private @type {string} */ - this.lastSearchQuery_ = ''; - - /** @private @type {?Record<!VolumeId, !Volume>} */ - this.volumes_ = null; - - /** @private @type {!Store} */ this.store_ = getStore(); this.store_.subscribe(this); } - /** @param {!State} state latest state from the store. */ - onStateChanged(state) { + onStateChanged(state: State) { this.handleDirectoryState_(state); this.handleSearchState_(state); } /** * Handles the current directory slice of the store's state. - * @param {!State} state latest state from the store. - * @private + * @param state latest state from the store. */ - handleDirectoryState_(state) { + private handleDirectoryState_(state: State) { const currentEntry = this.getCurrentDirEntry(); const currentURL = currentEntry ? currentEntry.toURL() : null; - let newURL = state.currentDirectory ? state.currentDirectory.key : null; + const newURL = state.currentDirectory ? state.currentDirectory.key : null; // Observe volume changes. if (this.volumes_ !== state.volumes) { @@ -196,17 +194,15 @@ this.volumes_ = state.volumes; } - // If the directory is the same, ignore it. - if (currentURL === newURL) { + // If the directory is the same or the newURL is null, ignore it. + if (currentURL === newURL || !newURL) { return; } // When something changed the current directory status to STARTED, Here we // initiate the actual change and will update to SUCCESS at the end. if (state.currentDirectory?.status === PropStatus.STARTED) { - newURL = /** @type {string} */ (newURL); - const entry = - state.allEntries[newURL] ? state.allEntries[newURL]?.entry : null; + const entry = state.allEntries[newURL!]?.entry ?? null; if (!entry) { // TODO(lucmult): Fix potential race condition in this await/then. @@ -216,23 +212,21 @@ return; } // Initiate the directory change. - this.changeDirectoryEntry(/** @type {!DirectoryEntry} */ (entry)); + this.changeDirectoryEntry(entry as DirectoryEntry); }); return; } // Initiate the directory change. - this.changeDirectoryEntry(/** @type {!DirectoryEntry} */ (entry)); + this.changeDirectoryEntry(entry as DirectoryEntry); } } /** * Reacts to changes in the search state of the store. If the search changed * and the query is not empty, this method triggers a new directory search. - * @param {!State} state - * @private */ - handleSearchState_(state) { + private handleSearchState_(state: State) { const currentEntry = this.getCurrentDirEntry(); // Do not handle any search state until we have the current directory set. // Requests to handle current search state may be triggered by the files app @@ -248,8 +242,6 @@ // Cache the last received search state for future comparisons. const lastSearch = this.cachedSearch_; - // @ts-ignore: error TS2322: Type 'SearchData | undefined' is not assignable - // to type '{}'. this.cachedSearch_ = search; // We change the search state (STARTED, SUCCESS, etc.) so only trigger @@ -257,11 +249,8 @@ if (!search) { return; } - // @ts-ignore: error TS2339: Property 'query' does not exist on type '{}'. - if (!lastSearch || lastSearch.query !== search.query || - // @ts-ignore: error TS2339: Property 'options' does not exist on type - // '{}'. - lastSearch.options !== search.options) { + if (!lastSearch || (lastSearch as SearchData).query !== search.query || + (lastSearch as SearchData).options !== search.options) { const dialogType = state.launchParams.dialogType; if (dialogType) { recordUserAction( @@ -275,37 +264,35 @@ /** * Disposes the directory model by removing file watchers. */ - dispose() { + dispose(): void { this.fileWatcher_.dispose(); } /** - * @return {FileListModel} Files in the current directory. + * @return Files in the current directory. */ - getFileList() { + getFileList(): FileListModel { return this.currentFileListContext_.fileList; } /** - * @return {!FileListModel} File list which is always empty. + * @return File list which is always empty. */ - getEmptyFileList() { + getEmptyFileList(): FileListModel { return this.emptyFileList_; } /** - * @return {!FileListSelectionModel|!FileListSingleSelectionModel} Selection - * in the fileList. + * @return Selection in the fileList. */ - getFileListSelection() { + getFileListSelection(): FileListSelectionModel|FileListSingleSelectionModel { return this.fileListSelection_; } /** * Obtains current volume information. - * @return {import('../../externs/volume_info.js').VolumeInfo|null} */ - getCurrentVolumeInfo() { + getCurrentVolumeInfo(): VolumeInfo|null { const entry = this.getCurrentDirEntry(); if (!entry) { return null; @@ -314,10 +301,9 @@ } /** - * @return {?RootType} Root type of current root, or null - * if not found. + * @return Root type of current root, or null if not found. */ - getCurrentRootType() { + getCurrentRootType(): RootType|null { const entry = this.currentDirContents_.getDirectoryEntry(); if (!entry) { return null; @@ -333,17 +319,16 @@ /** * Metadata property names that are expected to be Prefetched. - * @return {!Array<string>} */ - getPrefetchPropertyNames() { + getPrefetchPropertyNames(): string[] { return this.currentFileListContext_.prefetchPropertyNames; } /** - * @return {boolean} True if the current directory is read only. If there is - * no entry set, then returns true. + * @return True if the current directory is read only. If there is no entry + * set, then returns true. */ - isReadOnly() { + isReadOnly(): boolean { const currentDirEntry = this.getCurrentDirEntry(); if (currentDirEntry) { const locationInfo = this.volumeManager_.getLocationInfo(currentDirEntry); @@ -355,72 +340,60 @@ } /** - * @return {boolean} True if entries in the current directory can be deleted. - * Similar to !isReadOnly() except that we allow items in the read-only - * Trash root to be deleted. If there is no entry set, then returns false. + * @return True if entries in the current directory can be deleted. Similar to + * !isReadOnly() except that we allow items in the read-only Trash root to + * be deleted. If there is no entry set, then returns false. */ - canDeleteEntries() { + canDeleteEntries(): boolean { const currentDirEntry = this.getCurrentDirEntry(); - if (currentDirEntry && - // @ts-ignore: error TS2339: Property 'rootType' does not exist on type - // 'FileSystemDirectoryEntry | FilesAppDirEntry | FakeEntry'. - currentDirEntry.rootType === RootType.TRASH) { + if (currentDirEntry && getRootType(currentDirEntry) === RootType.TRASH) { return true; } return !this.isReadOnly(); } /** - * @return {boolean} True if the a scan is active. + * @return True if the a scan is active. */ - isScanning() { + isScanning(): boolean { return this.currentDirContents_.isScanning(); } /** - * @return {boolean} True if search is in progress. + * @return True if search is in progress. */ - isSearching() { + isSearching(): boolean { return this.currentDirContents_.isSearch(); } /** - * @return {boolean} True if it's on Drive. + * @return True if it's on Drive. */ - isOnDrive() { + isOnDrive(): boolean { return this.isCurrentRootVolumeType_(VolumeType.DRIVE); } /** - * @return {boolean} True if it's on MTP volume. + * @return True if the current volume is provided by FuseBox. */ - isOnMTP() { - return this.isCurrentRootVolumeType_(VolumeType.MTP); - } - - /** - * @return {boolean} True if the current volume is provided by FuseBox. - */ - isOnFuseBox() { + isOnFuseBox(): boolean { const info = this.getCurrentVolumeInfo(); - return info ? - /** @type {string} */ (info.diskFileSystemType) === 'fusebox' : - false; + return info ? info.diskFileSystemType === FileSystemType.FUSEBOX : false; } /** - * @return {boolean} True if it's on a Linux native volume. + * @return True if it's on a Linux native volume. */ - isOnNative() { + isOnNative(): boolean { const rootType = this.getCurrentRootType(); return rootType != null && !isRecentRootType(rootType) && isNative(getVolumeTypeFromRootType(rootType)); } /** - * @return {boolean} True if the current volume is blocked by DLP. + * @return True if the current volume is blocked by DLP. */ - isDlpBlocked() { + isDlpBlocked(): boolean { if (!isDlpEnabled()) { return false; } @@ -429,12 +402,10 @@ } /** - * @param {VolumeType} volumeType Volume Type - * @return {boolean} True if current root volume type is equal to specified - * volume type. - * @private + * @param volumeType Volume Type + * @return True if current root volume type is equal to specified volume type. */ - isCurrentRootVolumeType_(volumeType) { + private isCurrentRootVolumeType_(volumeType: VolumeType): boolean { const rootType = this.getCurrentRootType(); return rootType != null && !isRecentRootType(rootType) && getVolumeTypeFromRootType(rootType) === volumeType; @@ -445,12 +416,12 @@ * If updateFunc returns true, it force to dispatch the change event even if * the selection index is not changed. * - * @param {ListSelectionModel|ListSingleSelectionModel} selection - * Selection to be updated. - * @param {function(): boolean} updateFunc Function updating the selection. - * @private + * @param selection Selection to be updated. + * @param updateFunc Function updating the selection. */ - updateSelectionAndPublishEvent_(selection, updateFunc) { + private updateSelectionAndPublishEvent_( + selection: ListSelectionModel|ListSingleSelectionModel, + updateFunc: () => boolean) { // Begin change. selection.beginChange(); @@ -481,23 +452,17 @@ * Sets to ignore current directory deletion. This method is used to prevent * going up to the volume root with the deletion of current directory by * rename operation in directory tree. - * @param {boolean} value True to ignore current directory deletion. + * @param value True to ignore current directory deletion. */ - setIgnoringCurrentDirectoryDeletion(value) { + setIgnoringCurrentDirectoryDeletion(value: boolean) { this.ignoreCurrentDirectoryDeletion_ = value; } /** * Invoked when a change in the directory is detected by the watcher. - * @param {Event} event Event object. - * @private + * @param event Event object. */ - onWatcherDirectoryChanged_(event) { - const customEvent = - /** - @type {import('./file_watcher.js').WatcherDirectoryChangedEvent}>} - */ - (event); + private onWatcherDirectoryChanged_(event: WatcherDirectoryChangedEvent) { const directoryEntry = this.getCurrentDirEntry(); if (!this.ignoreCurrentDirectoryDeletion_ && directoryEntry) { @@ -505,6 +470,7 @@ // directory. directoryEntry.getDirectory( directoryEntry.fullPath, {create: false}, () => {}, async () => { + assert(directoryEntry); const volumeInfo = this.volumeManager_.getVolumeInfo(directoryEntry); if (volumeInfo) { @@ -514,14 +480,10 @@ }); } - if (customEvent.detail?.changedFiles) { - // @ts-ignore: error TS7034: Variable 'addedOrUpdatedFileUrls' implicitly - // has type 'any[]' in some locations where its type cannot be determined. - const addedOrUpdatedFileUrls = []; - // @ts-ignore: error TS7034: Variable 'deletedFileUrls' implicitly has - // type 'any[]' in some locations where its type cannot be determined. - let deletedFileUrls = []; - customEvent.detail.changedFiles.forEach(change => { + if (event.detail?.changedFiles) { + const addedOrUpdatedFileUrls: string[] = []; + let deletedFileUrls: string[] = []; + event.detail.changedFiles.forEach(change => { if (change.changes.length === 1 && change.changes[0] === 'delete') { deletedFileUrls.push(change.url); } else { @@ -529,12 +491,8 @@ } }); - // @ts-ignore: error TS7005: Variable 'addedOrUpdatedFileUrls' implicitly - // has an 'any[]' type. convertURLsToEntries(addedOrUpdatedFileUrls) .then(result => { - // @ts-ignore: error TS7005: Variable 'deletedFileUrls' implicitly - // has an 'any[]' type. deletedFileUrls = deletedFileUrls.concat(result.failureUrls); // Passing the resolved entries and failed URLs as the removed @@ -558,13 +516,11 @@ /** * Invoked when filters are changed. - * @private */ - async onFilterChanged_() { + private async onFilterChanged_() { const currentDirectory = this.getCurrentDirEntry(); if (currentDirectory && isNativeEntry(currentDirectory) && - !this.fileFilter_.filter( - /** @type {!DirectoryEntry} */ (currentDirectory))) { + !this.fileFilter_.filter(currentDirectory)) { // If the current directory should be hidden in the new filter setting, // change the current directory to the current volume's root. const volumeInfo = this.volumeManager_.getVolumeInfo(currentDirectory); @@ -579,10 +535,9 @@ /** * Invoked when volumes have been modified in the state. - * @param {!State} state latest state from the store. - * @private + * @param state latest state from the store. */ - onStateVolumeChanged_(state) { + private onStateVolumeChanged_(state: State) { if (!state.currentDirectory) { return; } @@ -594,44 +549,26 @@ continue; } const currentDirectoryFileData = - // @ts-ignore: error TS18048: 'state.currentDirectory' is possibly - // 'undefined'. getFileData(state, state.currentDirectory.key); const currentDirectoryOnOdfs = isOneDriveId(getVolume(state, currentDirectoryFileData)?.providerId); if (currentDirectoryOnOdfs) { - const {myFilesEntry} = /** - @type {{myFilesVolume: (Volume|null), - myFilesEntry: (VolumeEntry|EntryList)}} - */ - (getMyFiles(state)); + const {myFilesEntry} = getMyFiles(state); const myFilesRootKey = myFilesEntry.toURL(); this.store_.dispatch(changeDirectory({toKey: myFilesRootKey})); } } } - /** - * Returns the filter. - * @return {FileFilter} The file filter. - */ - getFileFilter() { + getFileFilter(): FileFilter { return this.fileFilter_; } - /** - * @return {DirectoryEntry|FakeEntry|FilesAppDirEntry|undefined} Current - * directory. - */ - getCurrentDirEntry() { + getCurrentDirEntry(): DirectoryEntry|FakeEntry|FilesAppDirEntry|undefined { return this.currentDirContents_.getDirectoryEntry(); } - /** - * @public - * @return {string} - */ - getCurrentDirName() { + getCurrentDirName(): string { const dirEntry = this.getCurrentDirEntry(); if (!dirEntry) { return ''; @@ -642,10 +579,9 @@ } /** - * @return {Array<Entry>} Array of selected entries. - * @private + * @return Array of selected entries. */ - getSelectedEntries_() { + private getSelectedEntries_(): Entry[] { const indexes = this.fileListSelection_.selectedIndexes; const fileList = this.getFileList(); if (fileList) { @@ -655,10 +591,9 @@ } /** - * @param {Array<Entry>} value List of selected entries. - * @private + * @param value List of selected entries. */ - setSelectedEntries_(value) { + private setSelectedEntries_(value: Entry[]) { const indexes = []; const fileList = this.getFileList(); const urls = entriesToURLs(value); @@ -672,26 +607,20 @@ } /** - * @return {Entry} Lead entry. - * @private + * @return Lead entry. */ - getLeadEntry_() { + private getLeadEntry_(): Entry { const index = this.fileListSelection_.leadIndex; - // @ts-ignore: error TS2322: Type 'FileSystemEntry | null' is not assignable - // to type 'FileSystemEntry'. - return index >= 0 ? - /** @type {Entry} */ (this.getFileList().item(index)) : - null; + return index >= 0 ? this.getFileList().item(index) : null; } /** - * @param {Entry} value The new lead entry. - * @private + * @param value The new lead entry. */ - setLeadEntry_(value) { + private setLeadEntry_(value: Entry) { const fileList = this.getFileList(); for (let i = 0; i < fileList.length; i++) { - if (isSameEntry(/** @type {Entry} */ (fileList.item(i)), value)) { + if (isSameEntry(fileList.item(i), value)) { this.fileListSelection_.leadIndex = i; return; } @@ -700,26 +629,24 @@ /** * Schedule rescan with short delay. - * @param {boolean} refresh True to refresh metadata, or false to use cached - * one. - * @param {boolean=} invalidateCache True to invalidate the backend scanning - * result cache. This param only works if the corresponding backend - * scanning supports cache. + * @param refresh True to refresh metadata, or false to use cached one. + * @param invalidateCache True to invalidate the backend scanning result + * cache. This param only works if the corresponding backend scanning + * supports cache. */ - rescanSoon(refresh, invalidateCache = false) { + rescanSoon(refresh: boolean, invalidateCache: boolean = false) { this.scheduleRescan(SHORT_RESCAN_INTERVAL, refresh, invalidateCache); } /** * Schedule rescan with delay. Designed to handle directory change * notification. - * @param {boolean} refresh True to refresh metadata, or false to use cached - * one. - * @param {boolean=} invalidateCache True to invalidate the backend scanning - * result cache. This param only works if the corresponding backend - * scanning supports cache. + * @param refresh True to refresh metadata, or false to use cached one. + * @param invalidateCache True to invalidate the backend scanning result + * cache. This param only works if the corresponding backend scanning + * supports cache. */ - rescanLater(refresh, invalidateCache = false) { + rescanLater(refresh: boolean, invalidateCache: boolean = false) { this.scheduleRescan(SIMULTANEOUS_RESCAN_INTERVAL, refresh, invalidateCache); } @@ -727,14 +654,14 @@ * Schedule rescan with delay. If another rescan has been scheduled does * nothing. File operation may cause a few notifications what should cause * a single refresh. - * @param {number} delay Delay in ms after which the rescan will be performed. - * @param {boolean} refresh True to refresh metadata, or false to use cached - * one. - * @param {boolean=} invalidateCache True to invalidate the backend scanning - * result cache. This param only works if the corresponding backend - * scanning supports cache. + * @param delay Delay in ms after which the rescan will be performed. + * @param refresh True to refresh metadata, or false to use cached one. + * @param invalidateCache True to invalidate the backend scanning result + * cache. This param only works if the corresponding backend scanning + * supports cache. */ - scheduleRescan(delay, refresh, invalidateCache = false) { + scheduleRescan( + delay: number, refresh: boolean, invalidateCache: boolean = false) { if (this.rescanTime_) { if (this.rescanTime_ <= Date.now() + delay) { return; @@ -746,7 +673,7 @@ this.rescanTime_ = Date.now() + delay; this.rescanTimeoutId_ = setTimeout(() => { - this.rescanTimeoutId_ = null; + this.rescanTimeoutId_ = undefined; if (sequence === this.changeDirectorySequence_) { this.rescan(refresh, invalidateCache); } @@ -755,13 +682,12 @@ /** * Cancel a rescan on timeout if it is scheduled. - * @private */ - clearRescanTimeout_() { + private clearRescanTimeout_() { this.rescanTime_ = null; if (this.rescanTimeoutId_) { clearTimeout(this.rescanTimeoutId_); - this.rescanTimeoutId_ = null; + this.rescanTimeoutId_ = undefined; } } @@ -773,13 +699,12 @@ * * This should be to scan the contents of current directory (or search). * - * @param {boolean} refresh True to refresh metadata, or false to use cached - * one. - * @param {boolean=} invalidateCache True to invalidate the backend scanning - * result cache. This param only works if the corresponding backend - * scanning supports cache. + * @param refresh True to refresh metadata, or false to use cached one. + * @param invalidateCache True to invalidate the backend scanning result + * cache. This param only works if the corresponding backend scanning + * supports cache. */ - rescan(refresh, invalidateCache = false) { + rescan(refresh: boolean, invalidateCache: boolean = false) { this.clearRescanTimeout_(); if (this.runningScan_) { this.pendingRescan_ = true; @@ -811,13 +736,13 @@ * * This should be used when changing directory or initiating a new search. * - * @param {DirectoryContents} newDirContents New DirectoryContents instance to - * replace currentDirContents_. - * @param {function(boolean):void} callback Callback with result. True if the - * scan is completed successfully, false if the scan is failed. - * @private + * @param newDirContents New DirectoryContents instance to replace + * currentDirContents_. + * @param callback Callback with result. True if the scan is completed + * successfully, false if the scan is failed. */ - clearAndScan_(newDirContents, callback) { + private clearAndScan_( + newDirContents: DirectoryContents, callback: (result: boolean) => void) { if (this.currentDirContents_.isScanning()) { this.currentDirContents_.cancelScan(); } @@ -847,8 +772,7 @@ callback(true); }; - /** @param {DOMError} error error. */ - const onFailed = error => { + const onFailed = (error: DOMError) => { if (cancelled) { return; } @@ -905,9 +829,6 @@ } if (!isFakeEntry(currentEntry)) { this.metadataModel_.get( - // @ts-ignore: error TS2322: Type 'FileSystemDirectoryEntry | - // FilesAppDirEntry | FakeEntry' is not assignable to type - // 'FileSystemEntry'. [currentEntry], constants.LIST_CONTAINER_METADATA_PREFETCH_PROPERTY_NAMES.concat( constants.DLP_METADATA_PREFETCH_PROPERTY_NAMES)); @@ -915,7 +836,6 @@ } // Clear the table, and start scanning. - // @ts-ignore: error TS2555: Expected at least 3 arguments, but got 2. fileList.splice(0, fileList.length); dispatchSimpleEvent(this, 'scan-started'); this.scan_( @@ -944,11 +864,10 @@ /** * Adds/removes/updates items of file list. - * @param {Array<Entry>} changedEntries Entries of updated/added files. - * @param {Array<string>} removedUrls URLs of removed files. - * @private + * @param changedEntries Entries of updated/added files. + * @param removedUrls URLs of removed files. */ - partialUpdate_(changedEntries, removedUrls) { + private partialUpdate_(changedEntries: Entry[], removedUrls: string[]) { // This update should be included in the current running update. if (this.pendingScan_) { return; @@ -1003,27 +922,27 @@ * Perform a directory contents scan. Should be called only from rescan() and * clearAndScan_(). * - * @param {DirectoryContents} dirContents DirectoryContents instance on which - * the scan will be run. - * @param {boolean} refresh True to refresh metadata, or false to use cached - * one. - * @param {boolean} invalidateCache True to invalidate scanning result cache. - * @param {function():void} successCallback Callback on success. - * @param {function(DOMError):void} failureCallback Callback on failure. - * @param {function():void} updatedCallback Callback on update. Only on the - * last update, {@code successCallback} is called instead of this. - * @param {function():void} cancelledCallback Callback on cancel. - * @private + * @param dirContents DirectoryContents instance on which the scan will be + * run. + * @param refresh True to refresh metadata, or false to use cached one. + * @param invalidateCache True to invalidate scanning result cache. + * @param successCallback Callback on success. + * @param failureCallback Callback on failure. + * @param updatedCallback Callback on update. Only on the last update, + * successCallback is called instead of this. + * @param cancelledCallback Callback on cancel. */ - scan_( - dirContents, refresh, invalidateCache, successCallback, failureCallback, - updatedCallback, cancelledCallback) { + private scan_( + dirContents: DirectoryContents, refresh: boolean, + invalidateCache: boolean, successCallback: VoidCallback, + failureCallback: (error: DOMError) => void, updatedCallback: VoidCallback, + cancelledCallback: VoidCallback) { /** * Runs pending scan if there is one. * - * @return {boolean} Did pending scan exist. + * @return Did pending scan exist. */ - const maybeRunPendingRescan = () => { + const maybeRunPendingRescan = (): boolean => { if (this.pendingRescan_) { this.rescanSoon(refresh); this.pendingRescan_ = false; @@ -1060,29 +979,30 @@ maybeRunPendingRescan(); }; - // @ts-ignore: error TS7006: Parameter 'event' implicitly has an 'any' type. - const onFailure = event => { - onFinished(); + const onFailure = + ((event: CustomEvent<{error: DOMError}>) => { + onFinished(); - this.runningScan_ = null; - this.scanFailures_++; - failureCallback(event.error); + this.runningScan_ = null; + this.scanFailures_++; + failureCallback(event.detail.error); - if (maybeRunPendingRescan()) { - return; - } + if (maybeRunPendingRescan()) { + return; + } - // Do not rescan for Guest OS (including Crostini) errors. - // TODO(crbug/1293229): Guest OS currently reuses the Crostini error - // string, but once it gets its own strings this needs to include both. - if (event.error.name === constants.CROSTINI_CONNECT_ERR) { - return; - } + // Do not rescan for Guest OS (including Crostini) errors. + // TODO(crbug/1293229): Guest OS currently reuses the Crostini error + // string, but once it gets its own strings this needs to include + // both. + if (event.detail.error.name === constants.CROSTINI_CONNECT_ERR) { + return; + } - if (this.scanFailures_ <= 1) { - this.rescanLater(refresh); - } - }; + if (this.scanFailures_ <= 1) { + this.rescanLater(refresh); + } + }) as EventListenerOrEventListenerObject; const onCancelled = () => { onFinished(); @@ -1099,11 +1019,10 @@ } /** - * @param {DirectoryContents} dirContents DirectoryContents instance. This - * must be a different instance from this.currentDirContents_. - * @private + * @param dirContents DirectoryContents instance. This must be a different + * instance from this.currentDirContents_. */ - replaceDirectoryContents_(dirContents) { + private replaceDirectoryContents_(dirContents: DirectoryContents) { console.assert( this.currentDirContents_ !== dirContents, 'Give directory contents instance must be different from current one.'); @@ -1117,9 +1036,6 @@ const leadEntry = this.getLeadEntry_(); const isCheckSelectMode = this.fileListSelection_.getCheckSelectMode(); - // @ts-ignore: error TS6133: 'previousDirContents' is declared but its - // value is never read. - const previousDirContents = this.currentDirContents_; this.currentDirContents_ = dirContents; this.currentDirContents_.replaceContextFileList(); @@ -1151,41 +1067,24 @@ } /** - * @param {Entry} entry The entry to be searched. - * @return {number} The index in the fileList, or -1 if not found. - * @private - */ - // @ts-ignore: error TS6133: 'findIndexByEntry_' is declared but its value is - // never read. - findIndexByEntry_(entry) { - const fileList = this.getFileList(); - for (let i = 0; i < fileList.length; i++) { - if (isSameEntry(/** @type {Entry} */ (fileList.item(i)), entry)) { - return i; - } - } - return -1; - } - - /** * Called when rename is done successfully. * Note: conceptually, DirectoryModel should work without this, because * entries can be renamed by other systems anytime and the Files app should * reflect it correctly. * TODO(hidehiko): investigate more background, and remove this if possible. * - * @param {!Entry} oldEntry The old entry. - * @param {!Entry} newEntry The new entry. - * @return {!Promise<void>} Resolves on completion. + * @param oldEntry The old entry. + * @param newEntry The new entry. + * @return Resolves on completion. */ - onRenameEntry(oldEntry, newEntry) { + onRenameEntry(oldEntry: Entry, newEntry: Entry|FilesAppEntry): Promise<void> { return new Promise(resolve => { this.currentDirContents_.prefetchMetadata([newEntry], true, () => { // If the current directory is the old entry, then quietly change to the // new one. if (isSameEntry(oldEntry, this.getCurrentDirEntry())) { this.changeDirectoryEntry( - /** @type {!DirectoryEntry|!FilesAppDirEntry} */ (newEntry)); + newEntry as DirectoryEntry | FilesAppDirEntry); } // Replace the old item with the new item. oldEntry instance itself may @@ -1226,12 +1125,13 @@ /** * Updates data model and selects new directory. - * @param {!DirectoryEntry} newDirectory Directory entry to be selected. - * @return {!Promise<void>} A promise which is resolved when new directory is - * selected. If current directory has changed during the operation, this - * will be rejected. + * @param newDirectory Directory entry to be selected. + * @return A promise which is resolved when new directory is selected. If + * current directory has changed during the operation, this will be + * rejected. */ - async updateAndSelectNewDirectory(newDirectory) { + async updateAndSelectNewDirectory(newDirectory: DirectoryEntry): + Promise<void> { // Refresh the cache. this.metadataModel_.notifyEntriesCreated([newDirectory]); const dirContents = this.currentDirContents_; @@ -1261,9 +1161,8 @@ /** * Gets the current MyFilesEntry. - * @return {FilesAppDirEntry} myFilesEntry */ - getMyFiles() { + getMyFiles(): FilesAppDirEntry { const {myFilesEntry} = getMyFiles(getStore().getState()); return myFilesEntry; } @@ -1279,12 +1178,12 @@ * activateDirectoryEntry instead of this, which is higher-level function and * cares about the selection. * - * @param {!DirectoryEntry|!FilesAppDirEntry} dirEntry The entry of the new - * directory to be opened. - * @param {function(boolean)=} opt_callback Executed if the directory loads - * successfully. + * @param dirEntry The entry of the new directory to be opened. + * @param callback Executed if the directory loads successfully. */ - changeDirectoryEntry(dirEntry, opt_callback) { + changeDirectoryEntry( + dirEntry: DirectoryEntry|FilesAppDirEntry, + callback?: (result: boolean) => void) { // Increment the sequence value. const sequence = ++this.changeDirectorySequence_; this.stopActiveSearch_(); @@ -1321,8 +1220,8 @@ this.clearAndScan_(newDirectoryContents, result => { // Calls the callback of the method and inform it about success or lack // of thereof. - if (opt_callback) { - opt_callback(result); + if (callback) { + callback(result); } // Notify that the current task of this.directoryChangeQueue_ // is completed. @@ -1355,13 +1254,8 @@ this.clearLastSearchQuery(); } // Notify the Store that the new directory has successfully changed. - this.store_.dispatch( - // @ts-ignore: error TS2345: Argument of type '{ to: - // FileSystemDirectoryEntry | FilesAppDirEntry; status: string; }' is - // not assignable to parameter of type '{ to?: - // FileSystemDirectoryEntry | FilesAppDirEntry | undefined; toKey: - // string; status?: string | undefined; }'. - changeDirectory({to: dirEntry, status: PropStatus.SUCCESS})); + this.store_.dispatch(changeDirectory( + {to: dirEntry, toKey: dirEntry.toURL(), status: PropStatus.SUCCESS})); }); } @@ -1372,12 +1266,11 @@ * directory. * - Clears the selection, if the given directory is the current directory. * - * @param {!DirectoryEntry|!FilesAppDirEntry} dirEntry The entry of the new - * directory to be opened. - * @param {function()=} opt_callback Executed if the directory loads - * successfully. + * @param dirEntry The entry of the new directory to be opened. + * @param callback Executed if the directory loads successfully. */ - activateDirectoryEntry(dirEntry, opt_callback) { + activateDirectoryEntry( + dirEntry: DirectoryEntry|FilesAppDirEntry, callback?: VoidCallback) { const currentDirectoryEntry = this.getCurrentDirEntry(); if (currentDirectoryEntry && isSameEntry(dirEntry, currentDirectoryEntry)) { // On activating the current directory, clear the selection on the @@ -1385,7 +1278,7 @@ this.clearSelection(); } else { // Otherwise, changes the current directory. - this.changeDirectoryEntry(dirEntry, opt_callback); + this.changeDirectoryEntry(dirEntry, callback); } } @@ -1400,9 +1293,9 @@ * Creates an object which could say whether directory has changed while it * has been active or not. Designed for long operations that should be * cancelled if the used change current directory. - * @return {!DirectoryChangeTracker} Created object. + * @return Created object. */ - createDirectoryChangeTracker() { + createDirectoryChangeTracker(): DirectoryChangeTracker { const tracker = { dm_: this, active_: false, @@ -1427,9 +1320,7 @@ } }, - // @ts-ignore: error TS7006: Parameter 'event' implicitly has an 'any' - // type. - onDirectoryChange_: function(event) { + onDirectoryChange_: function(_event: Event) { tracker.stop(); tracker.hasChanged = true; }, @@ -1438,9 +1329,9 @@ } /** - * @param {Entry} entry Entry to be selected. + * @param entry Entry to be selected. */ - selectEntry(entry) { + selectEntry(entry: Entry) { const fileList = this.getFileList(); for (let i = 0; i < fileList.length; i++) { if (fileList.item(i).toURL() === entry.toURL()) { @@ -1451,9 +1342,9 @@ } /** - * @param {Array<Entry>} entries Array of entries. + * @param entries Array of entries. */ - selectEntries(entries) { + selectEntries(entries: Entry[]) { // URLs are needed here, since we are comparing Entries by URLs. const urls = entriesToURLs(entries); const fileList = this.getFileList(); @@ -1468,10 +1359,9 @@ } /** - * @param {number} index Index of file. + * @param index Index of file. */ - selectIndex(index) { - // this.focusCurrentList_(); + selectIndex(index: number) { if (index >= this.getFileList().length) { return; } @@ -1482,15 +1372,10 @@ /** * Handles update of VolumeInfoList. - * @param {Event} event Event of VolumeInfoList's 'splice'. - * @private + * @param event Event of VolumeInfoList's 'splice'. */ - onVolumeInfoListUpdated_(event) { - const - spliceEventDetail = /** - @type {import('../../definitions/array_data_model_splice_event.js').ArrayDataModelSpliceEvent} - */ - (event).detail; + private onVolumeInfoListUpdated_(event: ArrayDataModelSpliceEvent) { + const spliceEventDetail = event.detail; // Fallback to the default volume's root if the current volume is unmounted. if (this.hasCurrentDirEntryBeenUnmounted_(spliceEventDetail.removed)) { this.volumeManager_.getDefaultDisplayRoot((displayRoot) => { @@ -1517,9 +1402,7 @@ if (this.getCurrentRootType() === RootType.DRIVE_FAKE_ROOT) { for (const newVolume of spliceEventDetail.added) { if (newVolume.volumeType === VolumeType.DRIVE) { - // @ts-ignore: error TS7006: Parameter 'displayRoot' implicitly has an - // 'any' type. - newVolume.resolveDisplayRoot().then((displayRoot) => { + newVolume.resolveDisplayRoot().then((displayRoot: DirectoryEntry) => { this.changeDirectoryEntry(displayRoot); }); } @@ -1536,9 +1419,7 @@ // Note, that this is a temporary solution for https://crbug.com/427776. // * Crostini is mounted, redirect if it is the currently selected dir. if (!currentDir || - // @ts-ignore: error TS2339: Property 'isFocused' does not exist on type - // 'Window & typeof globalThis'. - (window.isFocused() && + (window.isFocused && window.isFocused() && spliceEventDetail.added[0].volumeType === VolumeType.PROVIDED && spliceEventDetail.added[0].source === Source.FILE) || (spliceEventDetail.added[0].volumeType === VolumeType.CROSTINI && @@ -1549,29 +1430,27 @@ this.getCurrentRootType() === RootType.GUEST_OS)) { // Resolving a display root on FSP volumes is instant, despite the // asynchronous call. - // @ts-ignore: error TS7006: Parameter 'displayRoot' implicitly has an - // 'any' type. - spliceEventDetail.added[0].resolveDisplayRoot().then((displayRoot) => { - // Only change directory if "currentDir" hasn't changed during the - // display root resolution and if there isn't a directory change in - // progress, because other part of the system will eventually change the - // directory. - if (currentDir === this.getCurrentDirEntry() && - this.numChangeTrackerRunning_ === 0) { - this.changeDirectoryEntry(spliceEventDetail.added[0].displayRoot); - } - }); + spliceEventDetail.added[0].resolveDisplayRoot().then( + (_displayRoot: DirectoryEntry) => { + // Only change directory if "currentDir" hasn't changed during the + // display root resolution and if there isn't a directory change in + // progress, because other part of the system will eventually change + // the directory. + if (currentDir === this.getCurrentDirEntry() && + this.numChangeTrackerRunning_ === 0) { + this.changeDirectoryEntry(spliceEventDetail.added[0].displayRoot); + } + }); } } /** * Returns whether the current directory entry has been unmounted. * - * @param {!Array<!import('../../externs/volume_info.js').VolumeInfo>} - * removedVolumes The removed volumes. - * @private + * @param removedVolumes The removed volumes. */ - hasCurrentDirEntryBeenUnmounted_(removedVolumes) { + private hasCurrentDirEntryBeenUnmounted_(removedVolumes: VolumeInfo[]): + boolean { const entry = this.getCurrentDirEntry(); if (!entry) { return false; @@ -1583,8 +1462,7 @@ const rootType = this.getCurrentRootType(); for (const volume of removedVolumes) { - // @ts-ignore: error TS2538: Type 'null' cannot be used as an index type. - if (volume.fakeEntries[rootType]) { + if (rootType && volume.fakeEntries[rootType]) { return true; } // The removable root is selected and one of its child partitions has been @@ -1599,26 +1477,18 @@ /** * Returns true if directory search should be used for the entry and query. * - * @param {!DirectoryEntry|!FilesAppEntry} entry Directory entry. - * @param {string=} query Search query string. - * @return {boolean} True if directory search should be used for the entry - * and query. + * @param entry Directory entry. + * @param query Search query string. + * @return True if directory search should be used for the entry and query. */ - isSearchDirectory(entry, query) { - // @ts-ignore: error TS2339: Property 'rootType' does not exist on type - // 'FileSystemDirectoryEntry | FilesAppEntry'. - if (isRecentRootType(entry.rootType) || - // @ts-ignore: error TS2339: Property 'rootType' does not exist on type - // 'FileSystemDirectoryEntry | FilesAppEntry'. - entry.rootType == RootType.CROSTINI || - // @ts-ignore: error TS2339: Property 'rootType' does not exist on type - // 'FileSystemDirectoryEntry | FilesAppEntry'. - entry.rootType == RootType.DRIVE_FAKE_ROOT) { + isSearchDirectory(entry: DirectoryEntry|FilesAppEntry, query?: string): + boolean { + const rootType = getRootType(entry); + if (isRecentRootType(rootType) || rootType == RootType.CROSTINI || + rootType == RootType.DRIVE_FAKE_ROOT) { return true; } - // @ts-ignore: error TS2339: Property 'rootType' does not exist on type - // 'FileSystemDirectoryEntry | FilesAppEntry'. - if (entry.rootType == RootType.MY_FILES) { + if (rootType == RootType.MY_FILES) { return false; } @@ -1638,60 +1508,48 @@ /** * Creates scanner factory for the entry and query. * - * @param {!DirectoryEntry|!FilesAppEntry} entry Directory entry. - * @param {string=} query Search query string. - * @param {SearchOptions=} options search options. - * @return {function():ContentScanner} The factory to create ContentScanner - * instance. + * @param entry Directory entry. + * @param query Search query string. + * @param options search options. + * @return The factory to create ContentScanner instance. */ - createScannerFactory(entry, query, options) { + createScannerFactory( + entry: DirectoryEntry|FilesAppEntry, query?: string, + options?: SearchOptions): () => ContentScanner { const sanitizedQuery = (query || '').trimStart(); const locationInfo = this.volumeManager_.getLocationInfo(entry); if (isRecentScan(entry, options)) { - const fakeEntry = /** @type {!FakeEntry} */ (entry); return () => { return new RecentContentScanner( - sanitizedQuery, 30, this.volumeManager_, - fakeEntry.sourceRestriction, - getFileCategory(fakeEntry, sanitizedQuery, options)); + sanitizedQuery, 30, this.volumeManager_, entry.sourceRestriction, + getFileCategory(entry, sanitizedQuery, options)); }; } // TODO(b/271485133): Make sure the entry here is a fake entry, not real // volume entry. - // @ts-ignore: error TS2339: Property 'rootType' does not exist on type - // 'FileSystemDirectoryEntry | FilesAppEntry'. - if (entry.rootType == RootType.CROSTINI) { + const rootType = getRootType(entry); + if (rootType == RootType.CROSTINI) { return () => { return new CrostiniMounter(); }; } - // @ts-ignore: error TS2339: Property 'rootType' does not exist on type - // 'FileSystemDirectoryEntry | FilesAppEntry'. - if (entry.rootType == RootType.GUEST_OS) { + if (rootType == RootType.GUEST_OS) { return () => { - const placeholder = /** @type {!GuestOsPlaceholder} */ (entry); - return new GuestOsMounter(placeholder.guest_id); + return new GuestOsMounter((entry as GuestOsPlaceholder).guest_id); }; } - // @ts-ignore: error TS2339: Property 'rootType' does not exist on type - // 'FileSystemDirectoryEntry | FilesAppEntry'. - if (entry.rootType == RootType.MY_FILES) { + if (rootType == RootType.MY_FILES) { return () => { - return new DirectoryContentScanner( - /** @type {!FilesAppDirEntry} */ (entry)); + return new DirectoryContentScanner(entry as FilesAppDirEntry); }; } - // @ts-ignore: error TS2339: Property 'rootType' does not exist on type - // 'FileSystemDirectoryEntry | FilesAppEntry'. - if (entry.rootType == RootType.DRIVE_FAKE_ROOT) { + if (rootType == RootType.DRIVE_FAKE_ROOT) { return () => { return new ContentScanner(); }; } - // @ts-ignore: error TS2339: Property 'rootType' does not exist on type - // 'FileSystemDirectoryEntry | FilesAppEntry'. - if (entry.rootType == RootType.TRASH) { + if (rootType == RootType.TRASH) { return () => { return new TrashContentScanner(this.volumeManager_); }; @@ -1705,16 +1563,13 @@ } if (locationInfo && locationInfo.rootType == RootType.MEDIA_VIEW) { return () => { - return new MediaViewContentScanner( - /** @type {!DirectoryEntry} */ (entry)); + return new MediaViewContentScanner(entry as DirectoryEntry); }; } if (locationInfo && locationInfo.isRootEntry && locationInfo.isSpecialSearchRoot) { // Drive special search. - // @ts-ignore: error TS7034: Variable 'searchType' implicitly has type - // 'any' in some locations where its type cannot be determined. - let searchType; + let searchType: chrome.fileManagerPrivate.SearchType; switch (locationInfo.rootType) { case RootType.DRIVE_OFFLINE: searchType = chrome.fileManagerPrivate.SearchType.OFFLINE; @@ -1730,29 +1585,27 @@ throw new Error('Unknown special search type.'); } return () => { - // @ts-ignore: error TS7005: Variable 'searchType' implicitly has an - // 'any' type. return new DriveMetadataSearchContentScanner(searchType); }; } // Local fetch or search. return () => { - return new DirectoryContentScanner( - /** @type {!DirectoryEntry} */ (entry)); + return new DirectoryContentScanner(entry as DirectoryEntry); }; } /** * Creates directory contents for the entry and query. * - * @param {FileListContext} context File list context. - * @param {!DirectoryEntry|!FilesAppDirEntry} entry Current directory. - * @param {string=} query Search query string. - * @param {SearchOptions=} options Search options. - * @return {!DirectoryContents} Directory contents. - * @private + * @param context File list context. + * @param entry Current directory. + * @param query Search query string. + * @param options Search options. + * @return Directory contents. */ - createDirectoryContents_(context, entry, query, options) { + private createDirectoryContents_( + context: FileListContext, entry: DirectoryEntry|FilesAppDirEntry, + query?: string, options?: SearchOptions): DirectoryContents { const isSearch = this.isSearchDirectory(entry, query); const scannerFactory = this.createScannerFactory(entry, query, options); return new DirectoryContents(context, isSearch, entry, scannerFactory); @@ -1760,9 +1613,9 @@ /** * Gets the last search query. - * @return {string} the last search query. + * @return the last search query. */ - getLastSearchQuery() { + getLastSearchQuery(): string { return this.lastSearchQuery_; } @@ -1779,12 +1632,10 @@ * over drive mount point. If the current directory is not on the drive, file * name search over current directory will be performed. * - * @param {string} query Query that will be searched for. - * @param {!SearchOptions} options Search options, such as file - * type, etc. - * @private + * @param query Query that will be searched for. + * @param options Search options, such as file type, etc. */ - search_(query, options) { + private search_(query: string, options: SearchOptions) { this.lastSearchQuery_ = query; this.stopActiveSearch_(); const currentDirEntry = this.getCurrentDirEntry(); @@ -1819,18 +1670,15 @@ return; } - this.store_.dispatch( - // @ts-ignore: error TS2345: Argument of type '{ query: string; - // status: string; }' is not assignable to parameter of type - // 'SearchData'. - updateSearch({query: query, status: PropStatus.STARTED})); - // @ts-ignore: error TS7019: Rest parameter 'args' implicitly has an - // 'any[]' type. - this.onSearchCompleted_ = (...args) => { + this.store_.dispatch(updateSearch( + {query: query, status: PropStatus.STARTED, options: undefined})); + this.onSearchCompleted_ = () => { // Notify the store-aware parts. - // @ts-ignore: error TS2345: Argument of type '{ status: string; }' is - // not assignable to parameter of type 'SearchData'. - this.store_.dispatch(updateSearch({status: PropStatus.SUCCESS})); + this.store_.dispatch(updateSearch({ + status: PropStatus.SUCCESS, + query: undefined, + options: undefined, + })); }; this.addEventListener('scan-completed', this.onSearchCompleted_); this.clearAndScan_(newDirContents, callback); @@ -1840,9 +1688,8 @@ /** * In case the search was active, remove listeners and send notifications on * its canceling. - * @private */ - stopActiveSearch_() { + private stopActiveSearch_() { if (!this.isSearching()) { return; } @@ -1857,19 +1704,17 @@ * Update the file list when certain IO task is finished. To keep the file * list refresh for non-watchable fake directory entries and volumes, we need * to explicitly subscribe to the IO task status event, and manually refresh. - * @param {!chrome.fileManagerPrivate.ProgressStatus} event - * @private */ - updateFileListAfterIOTask_(event) { + private updateFileListAfterIoTask_( + event: chrome.fileManagerPrivate.ProgressStatus) { let rescan = false; - /** @type {!Set<?RootType>} */ const fakeDirectoryEntryRootTypes = new Set([ RootType.RECENT, RootType.TRASH, ]); const currentRootType = this.getCurrentRootType(); const currentVolumeInfo = this.getCurrentVolumeInfo(); - if (fakeDirectoryEntryRootTypes.has(currentRootType)) { + if (currentRootType && fakeDirectoryEntryRootTypes.has(currentRootType)) { // Refresh if non-watchable fake directory entry. rescan = true; } else if (currentVolumeInfo && !currentVolumeInfo.watchable) { @@ -1886,25 +1731,3 @@ } } } - -/** - * Used to track asynchronous directory change use like: - * const tracker = directoryModel.createDirectoryChangeTracker(); - * tracker.start(); - * try { - * ... async code here ... - * if (tracker.hasChanged) { - * // This code shouldn't continue anymore. - * } - * } finally { - * tracker.stop(); - * } - * @typedef {{ - * start: function():void, - * stop: function():void, - * hasChanged: boolean, - * }} - */ -// @ts-ignore: error TS7005: Variable 'DirectoryChangeTracker' implicitly has an -// 'any' type. -export let DirectoryChangeTracker;
diff --git a/ui/file_manager/file_manager/foreground/js/directory_model_unittest.js b/ui/file_manager/file_manager/foreground/js/directory_model_unittest.ts similarity index 71% rename from ui/file_manager/file_manager/foreground/js/directory_model_unittest.js rename to ui/file_manager/file_manager/foreground/js/directory_model_unittest.ts index 4dd1623f..34e80e64 100644 --- a/ui/file_manager/file_manager/foreground/js/directory_model_unittest.js +++ b/ui/file_manager/file_manager/foreground/js/directory_model_unittest.ts
@@ -7,15 +7,16 @@ import {MockVolumeManager} from '../../background/js/mock_volume_manager.js'; import {installMockChrome} from '../../common/js/mock_chrome.js'; import {RootType} from '../../common/js/volume_manager_types.js'; +import type {VolumeInfo} from '../../externs/volume_info.js'; import {FileFilter} from './directory_contents.js'; import {DirectoryModel} from './directory_model.js'; import {MockMetadataModel} from './metadata/mock_metadata.js'; -/** - * @type {?function(!chrome.fileManagerPrivate.ProgressStatus):void} - */ -let onIOTaskProgressStatusCallback; +type ProgressStatusCallback = + (status: chrome.fileManagerPrivate.ProgressStatus) => void; + +let onIOTaskProgressStatusCallback: ProgressStatusCallback; /** * Initializes the test environment. @@ -23,16 +24,11 @@ export function setUp() { /** * Mock chrome APIs. - * @type {!Object} */ const mockChrome = { fileManagerPrivate: { onIOTaskProgressStatus: { - /** - * @param {?function(!chrome.fileManagerPrivate.ProgressStatus):void} - * callback - */ - addListener(callback) { + addListener(callback: ProgressStatusCallback) { onIOTaskProgressStatusCallback = callback; }, }, @@ -46,17 +42,13 @@ /** * Mock DirectoryModel's dependencies and return a DirectoryModel instance. * - * @returns {!DirectoryModel} */ -function getDirectoryModel() { +function getDirectoryModel(): DirectoryModel { const volumeManager = new MockVolumeManager(); MockVolumeManager.installMockSingleton(volumeManager); const fileFilter = new FileFilter(volumeManager); const metadataModel = new MockMetadataModel({}); - return new DirectoryModel( - // @ts-ignore: error TS2345: Argument of type 'MockMetadataModel' is not - // assignable to parameter of type 'MetadataModel'. - false, fileFilter, metadataModel, volumeManager); + return new DirectoryModel(false, fileFilter, metadataModel, volumeManager); } /** @@ -64,14 +56,14 @@ * operation. */ export function testRecanAfterDeletionForRecents() { - const deleteEvent = /** @type {chrome.fileManagerPrivate.ProgressStatus} */ ({ + const deleteEvent = { type: chrome.fileManagerPrivate.IOTaskType.DELETE, state: chrome.fileManagerPrivate.IOTaskState.SUCCESS, - }); - const copyEvent = /** @type {chrome.fileManagerPrivate.ProgressStatus} */ ({ + } as chrome.fileManagerPrivate.ProgressStatus; + const copyEvent = { type: chrome.fileManagerPrivate.IOTaskType.COPY, state: chrome.fileManagerPrivate.IOTaskState.SUCCESS, - }); + } as chrome.fileManagerPrivate.ProgressStatus; const directoryModel = getDirectoryModel(); let isRescanCalled = false; @@ -81,20 +73,16 @@ // Current directory is not Recent. directoryModel.getCurrentRootType = () => RootType.DOWNLOADS; - // @ts-ignore: error TS2721: Cannot invoke an object which is possibly 'null'. onIOTaskProgressStatusCallback(deleteEvent); assertFalse(isRescanCalled); - // @ts-ignore: error TS2721: Cannot invoke an object which is possibly 'null'. onIOTaskProgressStatusCallback(copyEvent); assertFalse(isRescanCalled); // Current directory is Recent. directoryModel.getCurrentRootType = () => RootType.RECENT; - // @ts-ignore: error TS2721: Cannot invoke an object which is possibly 'null'. onIOTaskProgressStatusCallback(deleteEvent); assertTrue(isRescanCalled); isRescanCalled = false; - // @ts-ignore: error TS2721: Cannot invoke an object which is possibly 'null'. onIOTaskProgressStatusCallback(copyEvent); assertTrue(isRescanCalled); } @@ -110,12 +98,10 @@ isRescanCalled = true; }; // Current directory is non-watchable. - // @ts-ignore: error TS2322: Type '() => { watchable: false; }' is not - // assignable to type '() => VolumeInfo'. directoryModel.getCurrentVolumeInfo = () => { return { watchable: false, - }; + } as VolumeInfo; }; /** @type {!Array<!chrome.fileManagerPrivate.IOTaskType>} */ @@ -132,14 +118,12 @@ ]; for (const operation of operations) { - const event = /** @type {chrome.fileManagerPrivate.ProgressStatus} */ ({ + const event = { type: operation, state: chrome.fileManagerPrivate.IOTaskState.SUCCESS, - }); + } as chrome.fileManagerPrivate.ProgressStatus; isRescanCalled = false; - // @ts-ignore: error TS2721: Cannot invoke an object which is possibly - // 'null'. onIOTaskProgressStatusCallback(event); assertTrue(isRescanCalled); }
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager.js b/ui/file_manager/file_manager/foreground/js/file_manager.js index 6d2d96e..fe314a7 100644 --- a/ui/file_manager/file_manager/foreground/js/file_manager.js +++ b/ui/file_manager/file_manager/foreground/js/file_manager.js
@@ -429,7 +429,6 @@ /** @private @type {!Store} */ this.store_ = getStore(); - /** @suppress {checkTypes} */ (function() { ColorChangeUpdater.forDocument().start(); })();
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js index 08ad0d48..55e561c 100644 --- a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js +++ b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js
@@ -41,6 +41,16 @@ /** + * TODO(TS): Remove when converting to TS. + * + * @param {!Event} event + */ +function getCommand(event) { + return /** @type {import('ui/command.js').CommandEvent} */ (event) + .detail.command; +} + +/** * A command. * @abstract */ @@ -292,6 +302,7 @@ event.canExecute = enabled; // @ts-ignore: error TS2339: Property 'command' does not exist on type // 'Event'. + event.command.setHidden(!enabled); }; @@ -318,14 +329,11 @@ } }); node.addEventListener('command', event => { - // @ts-ignore: error TS2339: Property 'command' does not exist on type - // 'Event'. - if (event.command.id !== commandId) { + const command = getCommand(event); + if (command.id !== commandId) { return; } - // @ts-ignore: error TS2339: Property 'command' does not exist on type - // 'Event'. - document.execCommand(event.command.id); + document.execCommand(command.id); event.cancelBubble = true; }); node.addEventListener('canExecute', event => { @@ -730,9 +738,8 @@ if (CommandUtil.shouldIgnoreEvents(assert(this.fileManager_.document))) { return; } - // @ts-ignore: error TS2339: Property 'command' does not exist on type - // 'Event'. - const handler = CommandHandler.COMMANDS_[event.command.id]; + const command = getCommand(event); + const handler = CommandHandler.COMMANDS_[command.id]; // @ts-ignore: error TS18048: 'handler' is possibly 'undefined'. handler.execute.call( /** @type {FilesCommand} */ (handler), event, this.fileManager_); @@ -1386,7 +1393,8 @@ execute(event, fileManager) { const visible = !fileManager.fileFilter.isHiddenFilesVisible(); fileManager.fileFilter.setHiddenFilesVisible(visible); - event.command.checked = visible; // Checkmark for "Show hidden files". + const command = getCommand(event); + command.checked = visible; // Check-mark for "Show hidden files". CommandHandler.recordMenuItemSelected( visible ? CommandHandler.MenuCommandsForUMA.HIDDEN_FILES_SHOW : CommandHandler.MenuCommandsForUMA.HIDDEN_FILES_HIDE); @@ -1406,7 +1414,8 @@ execute(event, fileManager) { const visible = !fileManager.fileFilter.isAllAndroidFoldersVisible(); fileManager.fileFilter.setAllAndroidFoldersVisible(visible); - event.command.checked = visible; + const command = getCommand(event); + command.checked = visible; CommandHandler.recordMenuItemSelected( visible ? CommandHandler.MenuCommandsForUMA.HIDDEN_ANDROID_FOLDERS_SHOW : @@ -1476,9 +1485,8 @@ */ execute(event, fileManager) { const entries = CommandUtil.getCommandEntries(fileManager, event.target); - // @ts-ignore: error TS2339: Property 'command' does not exist on type - // 'Event'. - const permanentlyDelete = event.command.id === 'delete'; + const command = getCommand(event); + const permanentlyDelete = command.id === 'delete'; // Execute might be called without a call of canExecute method, e.g., // called directly from code, crbug.com/509483. See toolbar controller @@ -1681,9 +1689,6 @@ /** * Restores selected files from trash. - * - * @suppress {invalidCasts} See FilesAppEntry in files_app_entry_interfaces.js - * for explanation of why FilesAppEntry cannot extend Entry. */ CommandHandler // @ts-ignore: error TS2341: Property 'COMMANDS_' is private and only @@ -1857,7 +1862,7 @@ if (CommandUtil.isOnTrashRoot(fileManager)) { return; } - fileManager.document.execCommand(event.command.id); + fileManager.document.execCommand(getCommand(event).id); } /** @override */ @@ -2015,7 +2020,7 @@ // Cancel check-select-mode on cut/copy. Any further selection of a dir // should start a new selection rather than add to the existing selection. fileManager.directoryModel.getFileListSelection().setCheckSelectMode(false); - fileManager.document.execCommand(event.command.id); + fileManager.document.execCommand(getCommand(event).id); } /** @override */
diff --git a/ui/file_manager/file_manager/foreground/js/file_tasks.ts b/ui/file_manager/file_manager/foreground/js/file_tasks.ts index aacfca7..53bdb93 100644 --- a/ui/file_manager/file_manager/foreground/js/file_tasks.ts +++ b/ui/file_manager/file_manager/foreground/js/file_tasks.ts
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ import {assert} from 'chrome://resources/ash/common/assert.js'; import {executeTask, getDirectory, getFileTasks} from '../../common/js/api.js'; @@ -29,7 +24,7 @@ import {USER_CANCELLED, XfPasswordDialog} from '../../widgets/xf_password_dialog.js'; import {constants} from './constants.js'; -import {DirectoryChangeTracker, DirectoryModel} from './directory_model.js'; +import {type DirectoryChangeTracker, DirectoryModel} from './directory_model.js'; import {FileTransferController, PastePlan} from './file_transfer_controller.js'; import {MetadataItem} from './metadata/metadata_item.js'; import {MetadataModel} from './metadata/metadata_model.js';
diff --git a/ui/file_manager/file_manager/foreground/js/file_tasks_unittest.ts b/ui/file_manager/file_manager/foreground/js/file_tasks_unittest.ts index e9e0b05..5f1dff8 100644 --- a/ui/file_manager/file_manager/foreground/js/file_tasks_unittest.ts +++ b/ui/file_manager/file_manager/foreground/js/file_tasks_unittest.ts
@@ -548,7 +548,6 @@ /** * Checks that the progress center is properly updated when mounting archives * successfully. - * @suppress {visibility} */ export async function testMountArchiveAndChangeDirectoryNotificationSuccess( done: () => void) { @@ -592,7 +591,6 @@ /** * Checks that the progress center is properly updated when mounting an archive * resolves with an error. - * @suppress {visibility} */ export async function testMountArchiveAndChangeDirectoryNotificationInvalidArchive(done: () => void) { @@ -631,7 +629,6 @@ /** * Checks that the progress center is properly updated when the password prompt * for an encrypted archive is canceled. - * @suppress {visibility} */ export async function testMountArchiveAndChangeDirectoryNotificationCancelPassword(done: () => void) { @@ -675,7 +672,6 @@ /** * Checks that the progress center is properly updated when mounting an * encrypted archive. - * @suppress {visibility} */ export async function testMountArchiveAndChangeDirectoryNotificationEncryptedArchive(
diff --git a/ui/file_manager/file_manager/foreground/js/file_transfer_controller_unittest.ts b/ui/file_manager/file_manager/foreground/js/file_transfer_controller_unittest.ts index 2a23d99b..0b813c3 100644 --- a/ui/file_manager/file_manager/foreground/js/file_transfer_controller_unittest.ts +++ b/ui/file_manager/file_manager/foreground/js/file_transfer_controller_unittest.ts
@@ -156,9 +156,6 @@ /** * Tests isDocumentWideEvent_. - * - * @suppress {accessControls} To be able to access private method - * isDocumentWideEvent_ */ export function testIsDocumentWideEvent() { const input = document.querySelector<HTMLInputElement>('#free-text')!;
diff --git a/ui/file_manager/file_manager/foreground/js/list_thumbnail_loader_unittest.js b/ui/file_manager/file_manager/foreground/js/list_thumbnail_loader_unittest.js index 11e0d3d..704fa236 100644 --- a/ui/file_manager/file_manager/foreground/js/list_thumbnail_loader_unittest.js +++ b/ui/file_manager/file_manager/foreground/js/list_thumbnail_loader_unittest.js
@@ -65,16 +65,11 @@ export function setUp() { currentVolumeType = ListThumbnailLoader.TEST_VOLUME_TYPE; - /** @suppress {const} */ ListThumbnailLoader.CACHE_SIZE = 5; - /** @suppress {const} */ ListThumbnailLoader.numOfMaxActiveTasksForTest = 2; - /** @suppress {const} */ MockThumbnailLoader.errorUrls = []; - /** @suppress {const} */ MockThumbnailLoader.testImageWidth = 160; - /** @suppress {const} */ MockThumbnailLoader.testImageHeight = 160; // Create an image dataURL for testing. @@ -91,7 +86,6 @@ /** @const @type {string} */ const testImageDataUrl = canvas.toDataURL('image/jpeg', 0.5); - /** @suppress {const} */ MockThumbnailLoader.testImageDataUrl = testImageDataUrl; getCallbacks = {}; @@ -131,7 +125,6 @@ } } - /** @suppress {checkTypes} */ directoryModel = /** @type {!DirectoryModel} */ (new TestDirectoryModel()); const fakeVolumeManager =
diff --git a/ui/file_manager/file_manager/foreground/js/metadata/image_parsers.js b/ui/file_manager/file_manager/foreground/js/metadata/image_parsers.ts similarity index 62% rename from ui/file_manager/file_manager/foreground/js/metadata/image_parsers.js rename to ui/file_manager/file_manager/foreground/js/metadata/image_parsers.ts index 51ab624a..7112831 100644 --- a/ui/file_manager/file_manager/foreground/js/metadata/image_parsers.js +++ b/ui/file_manager/file_manager/foreground/js/metadata/image_parsers.ts
@@ -3,76 +3,64 @@ // found in the LICENSE file. import {ByteOrder, ByteReader} from './byte_reader.js'; -import {ImageParser, MetadataParser} from './metadata_parser.js'; +import {ParserMetadata} from './metadata_item.js'; +import {ImageParser, MetadataParser, MetadataParserLogger} from './metadata_parser.js'; /** * Base class for image metadata parsers that only need to look at a short * fragment at the start of the file. - * @abstract */ -export class SimpleImageParser extends ImageParser { +export abstract class SimpleImageParser extends ImageParser { /** - * @param {!import("./metadata_parser.js").MetadataParserLogger} - * parent Parent object. - * @param {string} type Image type. - * @param {!RegExp} urlFilter RegExp to match URLs. - * @param {number} headerSize Size of header. + * @param parent Parent object. + * @param type Image type. + * @param urlFilter RegExp to match URLs. + * @param headerSize Size of header. */ - constructor(parent, type, urlFilter, headerSize) { + constructor( + parent: MetadataParserLogger, type: string, urlFilter: RegExp, + public readonly headerSize: number) { super(parent, type, urlFilter); - /** @public @const @type {number} */ - this.headerSize = headerSize; } /** - * @param {File} file File to be parses. - * @param {Object} metadata Metadata object of the file. - * @param {function(Object):void} callback Success callback. - * @param {function(string):void} errorCallback Error callback. + * @param file File to be parsed. + * @param metadata Metadata object of the file. + * @param callback Success callback. + * @param errorCallback Error callback. */ - parse(file, metadata, callback, errorCallback) { + parse( + file: File, metadata: ParserMetadata, + callback: (metadata: ParserMetadata) => void, + errorCallback: (error: string) => void) { const self = this; - // @ts-ignore: error TS6133: 'file' is declared but its value is never read. - MetadataParser.readFileBytes(file, 0, this.headerSize, (file, br) => { + MetadataParser.readFileBytes(file, 0, this.headerSize, (_file, br) => { try { self.parseHeader(metadata, br); callback(metadata); } catch (e) { - // @ts-ignore: error TS18046: 'e' is of type 'unknown'. - errorCallback(e.toString()); + errorCallback(e!.toString()); } }, errorCallback); } /** * Parse header of an image. Inherited class must implement this. - * @abstract - * @param {Object} metadata Dictionary to store the parsed metadata. - * @param {ByteReader} byteReader Reader for header binary data. + * @param metadata Dictionary to store the parsed metadata. + * @param byteReader Reader for header binary data. */ - // @ts-ignore: error TS6133: 'byteReader' is declared but its value is never - // read. - parseHeader(metadata, byteReader) {} + abstract parseHeader(metadata: ParserMetadata, byteReader: ByteReader): void; } /** * Parser for the header of png files. - * @final */ export class PngParser extends SimpleImageParser { - /** - * @param {!import("./metadata_parser.js").MetadataParserLogger} - * parent Parent object. - */ - constructor(parent) { + constructor(parent: MetadataParserLogger) { super(parent, 'png', /\.png$/i, 24); } - /** - * @override - */ - // @ts-ignore: error TS7006: Parameter 'br' implicitly has an 'any' type. - parseHeader(metadata, br) { + override parseHeader(metadata: ParserMetadata, br: ByteReader) { br.setByteOrder(ByteOrder.BIG_ENDIAN); const signature = br.readString(8); @@ -93,22 +81,13 @@ /** * Parser for the header of bmp files. - * @final */ export class BmpParser extends SimpleImageParser { - /** - * @param {!import("./metadata_parser.js").MetadataParserLogger} - * parent Parent object. - */ - constructor(parent) { + constructor(parent: MetadataParserLogger) { super(parent, 'bmp', /\.bmp$/i, 28); } - /** - * @override - */ - // @ts-ignore: error TS7006: Parameter 'br' implicitly has an 'any' type. - parseHeader(metadata, br) { + override parseHeader(metadata: ParserMetadata, br: ByteReader) { br.setByteOrder(ByteOrder.LITTLE_ENDIAN); const signature = br.readString(2); @@ -124,22 +103,13 @@ /** * Parser for the header of gif files. - * @final */ export class GifParser extends SimpleImageParser { - /** - * @param {!import("./metadata_parser.js").MetadataParserLogger} - * parent Parent object. - */ - constructor(parent) { + constructor(parent: MetadataParserLogger) { super(parent, 'gif', /\.Gif$/i, 10); } - /** - * @override - */ - // @ts-ignore: error TS7006: Parameter 'br' implicitly has an 'any' type. - parseHeader(metadata, br) { + override parseHeader(metadata: ParserMetadata, br: ByteReader) { br.setByteOrder(ByteOrder.LITTLE_ENDIAN); const signature = br.readString(6); @@ -154,22 +124,13 @@ /** * Parser for the header of webp files. - * @final */ export class WebpParser extends SimpleImageParser { - /** - * @param {!import("./metadata_parser.js").MetadataParserLogger} - * parent Parent object. - */ - constructor(parent) { + constructor(parent: MetadataParserLogger) { super(parent, 'webp', /\.webp$/i, 30); } - /** - * @override - */ - // @ts-ignore: error TS7006: Parameter 'br' implicitly has an 'any' type. - parseHeader(metadata, br) { + override parseHeader(metadata: ParserMetadata, br: ByteReader) { br.setByteOrder(ByteOrder.LITTLE_ENDIAN); const riffSignature = br.readString(4); @@ -231,23 +192,13 @@ /** * Parser for the header of .ico icon files. - * @final */ export class IcoParser extends SimpleImageParser { - /** - * @param {!import("./metadata_parser.js").MetadataParserLogger} - * parent Parent metadata dispatcher object. - */ - constructor(parent) { + constructor(parent: MetadataParserLogger) { super(parent, 'ico', /\.ico$/i, 8); } - /** - * @override - */ - // @ts-ignore: error TS7006: Parameter 'byteReader' implicitly has an 'any' - // type. - parseHeader(metadata, byteReader) { + override parseHeader(metadata: ParserMetadata, byteReader: ByteReader) { byteReader.setByteOrder(ByteOrder.LITTLE_ENDIAN); const signature = byteReader.readString(4);
diff --git a/ui/file_manager/file_manager/foreground/js/metadata_box_controller.ts b/ui/file_manager/file_manager/foreground/js/metadata_box_controller.ts index 743d53a6..c877e1f5 100644 --- a/ui/file_manager/file_manager/foreground/js/metadata_box_controller.ts +++ b/ui/file_manager/file_manager/foreground/js/metadata_box_controller.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {isDirectoryEntry, isSameEntry, unwrapEntry} from '../../common/js/entry_utils.js'; import {getType} from '../../common/js/file_type.js'; import {strf} from '../../common/js/translations.js';
diff --git a/ui/file_manager/file_manager/foreground/js/mock_directory_model.js b/ui/file_manager/file_manager/foreground/js/mock_directory_model.js deleted file mode 100644 index 3151603..0000000 --- a/ui/file_manager/file_manager/foreground/js/mock_directory_model.js +++ /dev/null
@@ -1,110 +0,0 @@ -// Copyright 2014 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import {NativeEventTarget as EventTarget} from 'chrome://resources/ash/common/event_target.js'; - -import {RootType} from '../../common/js/volume_manager_types.js'; -import {FakeEntry, FilesAppDirEntry} from '../../externs/files_app_entry_interfaces.js'; - -import {FileFilter} from './directory_contents.js'; -import {DirectoryModel} from './directory_model.js'; -import {FileListModel} from './file_list_model.js'; - -/** - * @returns {!FileFilter} fake for unittests. - */ -function createFakeFileFilter() { - /** - * FileFilter fake. - */ - class FakeFileFilter extends EventTarget { - /** - * @param {Entry} entry File entry. - * @return {boolean} True if the file should be shown. - */ - // @ts-ignore: error TS6133: 'entry' is declared but its value is never - // read. - filter(entry) { - return true; - } - } - - const filter = /** @type {!Object} */ (new FakeFileFilter()); - return /** @type {!FileFilter} */ (filter); -} - -/** - * @returns {!DirectoryModel} fake for unittests. - */ -export function createFakeDirectoryModel() { - /** - * DirectoryModel fake. - */ - class FakeDirectoryModel extends EventTarget { - constructor() { - super(); - - /** @private @type {!FileFilter} */ - this.fileFilter_ = createFakeFileFilter(); - } - - /** - * @return {!FileFilter} file filter. - */ - getFileFilter() { - return this.fileFilter_; - } - - /** - * @return {DirectoryEntry|FakeEntry|FilesAppDirEntry} Current directory. - */ - getCurrentDirEntry() { - // @ts-ignore: error TS2322: Type 'null' is not assignable to type - // 'FileSystemDirectoryEntry | FilesAppDirEntry | FakeEntry'. - return null; - } - - /** - * @returns {?import("../../externs/volume_info.js").VolumeInfo} - */ - getCurrentVolumeInfo() { - return null; - } - - /** - * @returns {?RootType} - */ - getCurrentRootType() { - return null; - } - - /** - * @returns {?FileListModel} - */ - getFileList() { - return null; - } - - /** - * @param {!DirectoryEntry|!FilesAppDirEntry} dirEntry The entry of the new - * directory to be changed to. - * @param {function()=} opt_callback Executed if the directory loads - * successfully. - */ - // @ts-ignore: error TS6133: 'dirEntry' is declared but its value is never - // read. - changeDirectoryEntry(dirEntry, opt_callback) { - if (opt_callback) { - opt_callback(); - } - } - - isReadOnly() { - return false; - } - } - - const model = /** @type {!Object} */ (new FakeDirectoryModel()); - return /** @type {!DirectoryModel} */ (model); -}
diff --git a/ui/file_manager/file_manager/foreground/js/mock_directory_model.ts b/ui/file_manager/file_manager/foreground/js/mock_directory_model.ts new file mode 100644 index 0000000..84c2f7d --- /dev/null +++ b/ui/file_manager/file_manager/foreground/js/mock_directory_model.ts
@@ -0,0 +1,99 @@ +// Copyright 2014 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {NativeEventTarget as EventTarget} from 'chrome://resources/ash/common/event_target.js'; + +import {RootType} from '../../common/js/volume_manager_types.js'; +import type {FakeEntry, FilesAppDirEntry} from '../../externs/files_app_entry_interfaces.js'; +import type {VolumeInfo} from '../../externs/volume_info.js'; + +import {FileFilter} from './directory_contents.js'; +import {DirectoryModel} from './directory_model.js'; +import {FileListModel} from './file_list_model.js'; + +/** + * @return fake for unittests. + */ +function createFakeFileFilter(): FileFilter { + /** + * FileFilter fake. + */ + class FakeFileFilter extends EventTarget { + /** + * @param entry File entry. + * @return True if the file should be shown. + */ + filter(_entry: Entry): boolean { + return true; + } + } + + return new FakeFileFilter() as unknown as FileFilter; +} + +/** + * @return fake for unittests. + */ +export function createFakeDirectoryModel(): DirectoryModel { + /** + * DirectoryModel fake. + */ + class FakeDirectoryModel extends EventTarget { + private fileFilter_ = createFakeFileFilter(); + constructor() { + super(); + } + + /** + * @return file filter. + */ + getFileFilter(): FileFilter { + return this.fileFilter_; + } + + /** + * @return Current directory. + */ + getCurrentDirEntry(): DirectoryEntry|FakeEntry|FilesAppDirEntry|undefined { + return undefined; + } + + /** + */ + getCurrentVolumeInfo(): VolumeInfo|null { + return null; + } + + /** + */ + getCurrentRootType(): RootType|null { + return null; + } + + /** + */ + getFileList(): FileListModel|null { + return null; + } + + /** + * @param dirEntry The entry of the new + * directory to be changed to. + * @param opt_callback Executed if the directory loads + * successfully. + */ + changeDirectoryEntry( + _dirEntry: DirectoryEntry|FilesAppDirEntry, callback?: VoidCallback) { + if (callback) { + callback(); + } + } + + isReadOnly() { + return false; + } + } + + return new FakeDirectoryModel() as unknown as DirectoryModel; +}
diff --git a/ui/file_manager/file_manager/foreground/js/quick_view_controller.ts b/ui/file_manager/file_manager/foreground/js/quick_view_controller.ts index 51e0edc..03a6752 100644 --- a/ui/file_manager/file_manager/foreground/js/quick_view_controller.ts +++ b/ui/file_manager/file_manager/foreground/js/quick_view_controller.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes|moduleLoad|lintChecks} - */ - import {ImageLoaderClient} from 'chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp/image_loader_client.js'; import {LoadImageRequest, LoadImageResponse, LoadImageResponseStatus} from 'chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp/load_image_request.js'; import {assert} from 'chrome://resources/js/assert.js'; @@ -90,30 +84,22 @@ this.onFileSelectionChanged_.bind(this) as EventListener); this.listContainer_.element.addEventListener( 'keydown', this.onKeyDownToOpen_.bind(this)); + + // Selection menu command can be triggered with focus outside of file list + // or button e.g.: from the directory tree. dialogDom.addEventListener( - 'command', ((event: CommandEvent) => { - // Selection menu command can be triggered with focus - // outside of file list or button e.g.: from the directory - // tree. - if (event.command.id === 'get-info') { - event.stopPropagation(); - this.display_(WayToOpen.SELECTION_MENU); - } - }) as EventListener); + 'command', this.onCommad_.bind(this, WayToOpen.SELECTION_MENU)); this.listContainer_.element.addEventListener( - 'command', ((event: CommandEvent) => { - if (event.command.id === 'get-info') { - event.stopPropagation(); - this.display_(WayToOpen.CONTEXT_MENU); - } - }) as EventListener); + 'command', this.onCommad_.bind(this, WayToOpen.CONTEXT_MENU)); selectionMenuButton.addEventListener( - 'command', ((event: CommandEvent) => { - if (event.command.id === 'get-info') { - event.stopPropagation(); - this.display_(WayToOpen.SELECTION_MENU); - } - }) as EventListener); + 'command', this.onCommad_.bind(this, WayToOpen.SELECTION_MENU)); + } + + private onCommad_(wayToOpen: WayToOpen, event: CommandEvent) { + if (event.detail.command.id === 'get-info') { + event.stopPropagation(); + this.display_(wayToOpen); + } } /**
diff --git a/ui/file_manager/file_manager/foreground/js/quick_view_model.ts b/ui/file_manager/file_manager/foreground/js/quick_view_model.ts index 342b1273..dead89e 100644 --- a/ui/file_manager/file_manager/foreground/js/quick_view_model.ts +++ b/ui/file_manager/file_manager/foreground/js/quick_view_model.ts
@@ -6,12 +6,6 @@ import {NativeEventTarget as EventTarget} from 'chrome://resources/ash/common/event_target.js'; /** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - -/** * Quick view model that doesn't fit into properties of quick view element. */ export class QuickViewModel extends EventTarget {
diff --git a/ui/file_manager/file_manager/foreground/js/task_controller.ts b/ui/file_manager/file_manager/foreground/js/task_controller.ts index 22085e9..96e5350a 100644 --- a/ui/file_manager/file_manager/foreground/js/task_controller.ts +++ b/ui/file_manager/file_manager/foreground/js/task_controller.ts
@@ -2,11 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ import {assertInstanceof, assertNotReached} from 'chrome://resources/ash/common/assert.js'; import {getMimeType, startIOTask} from '../../common/js/api.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/dlp_restricted_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/dlp_restricted_banner.ts index b3ea43b8..cc155593 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/dlp_restricted_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/dlp_restricted_banner.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {str} from '../../../../common/js/translations.js'; import {RootType} from '../../../../common/js/volume_manager_types.js'; import {DialogType} from '../../../../externs/ts/state.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_bulk_pinning_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_bulk_pinning_banner.ts index cfa5198..89c065db 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_bulk_pinning_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_bulk_pinning_banner.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {RootType, VolumeType} from '../../../../common/js/volume_manager_types.js'; import {XfBulkPinningDialog} from '../../../../widgets/xf_bulk_pinning_dialog.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_low_individual_space_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_low_individual_space_banner.ts index 8a7909b1..46737fd 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_low_individual_space_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_low_individual_space_banner.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {bytesToString, strf} from '../../../../common/js/translations.js'; import {RootType, VolumeType} from '../../../../common/js/volume_manager_types.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_low_shared_drive_space_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_low_shared_drive_space_banner.ts index 20dcef9f..b3d2bc5 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_low_shared_drive_space_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_low_shared_drive_space_banner.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {bytesToString, strf} from '../../../../common/js/translations.js'; import {RootType, VolumeType} from '../../../../common/js/volume_manager_types.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_offline_pinning_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_offline_pinning_banner.ts index 2731244..472d8fd 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_offline_pinning_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_offline_pinning_banner.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {str, strf} from '../../../../common/js/translations.js'; import {RootType, VolumeType} from '../../../../common/js/volume_manager_types.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_out_of_individual_space_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_out_of_individual_space_banner.ts index b1c54fd..1948894 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_out_of_individual_space_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_out_of_individual_space_banner.ts
@@ -2,13 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - - import {RootType, VolumeType} from '../../../../common/js/volume_manager_types.js'; import {getTemplate} from './drive_out_of_individual_space_banner.html.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_out_of_organization_space_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_out_of_organization_space_banner.ts index 1af3da12d..88eae8d5 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_out_of_organization_space_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_out_of_organization_space_banner.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {str, strf} from '../../../../common/js/translations.js'; import {RootType, VolumeType} from '../../../../common/js/volume_manager_types.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_out_of_shared_drive_space_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_out_of_shared_drive_space_banner.ts index cad449e..e4b47ba 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_out_of_shared_drive_space_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_out_of_shared_drive_space_banner.ts
@@ -2,13 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - - import {RootType, VolumeType} from '../../../../common/js/volume_manager_types.js'; import {getTemplate} from './drive_out_of_shared_drive_space_banner.html.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_welcome_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_welcome_banner.ts index f9a5df3f..15f0465 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/drive_welcome_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/drive_welcome_banner.ts
@@ -2,13 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - - import {RootType, VolumeType} from '../../../../common/js/volume_manager_types.js'; import {getTemplate} from './drive_welcome_banner.html.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/educational_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/educational_banner.ts index 7be477e..2f7d248 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/educational_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/educational_banner.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import 'chrome://resources/cros_components/button/button.js'; import {isCrosComponentsEnabled} from '../../../../common/js/flags.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/educational_banner_unittest.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/educational_banner_unittest.ts index da76984..cdf2125 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/educational_banner_unittest.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/educational_banner_unittest.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {CrButtonElement} from 'chrome://resources/cr_elements/cr_button/cr_button.js'; import {getTrustedHTML} from 'chrome://resources/js/static_types.js'; import {assertEquals} from 'chrome://webui-test/chromeos/chai_assert.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/google_one_offer_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/google_one_offer_banner.ts index 7e507aa..0e02a3326 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/google_one_offer_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/google_one_offer_banner.ts
@@ -5,8 +5,6 @@ /** * @fileoverview The Google One banner highlights the benefit for Chromebook * users when navigating to Drive. - * Disable type checking for closure, as it is done by the typescript compiler. - * @suppress {checkTypes} */ import {recordUserAction} from '../../../../common/js/metrics.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/holding_space_welcome_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/holding_space_welcome_banner.ts index a8fac373..d124d88 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/holding_space_welcome_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/holding_space_welcome_banner.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {RootType, VolumeType} from '../../../../common/js/volume_manager_types.js'; import {HoldingSpaceUtil} from '../../holding_space_util.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/invalid_usb_filesystem_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/invalid_usb_filesystem_banner.ts index 180e399..c3f4081f 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/invalid_usb_filesystem_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/invalid_usb_filesystem_banner.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {str} from '../../../../common/js/translations.js'; import {RootType, VolumeError} from '../../../../common/js/volume_manager_types.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/local_disk_low_space_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/local_disk_low_space_banner.ts index f1d9525..e517d6d 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/local_disk_low_space_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/local_disk_low_space_banner.ts
@@ -2,13 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - - import {RootType, VolumeType} from '../../../../common/js/volume_manager_types.js'; import {getTemplate} from './local_disk_low_space_banner.html.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/photos_welcome_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/photos_welcome_banner.ts index 66a63c06..ed0b055 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/photos_welcome_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/photos_welcome_banner.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {PHOTOS_DOCUMENTS_PROVIDER_VOLUME_ID, VolumeType} from '../../../../common/js/volume_manager_types.js'; import {EducationalBanner} from './educational_banner.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/shared_with_crostini_pluginvm_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/shared_with_crostini_pluginvm_banner.ts index 8e5d3f02..fa8e5070 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/shared_with_crostini_pluginvm_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/shared_with_crostini_pluginvm_banner.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {str} from '../../../../common/js/translations.js'; import {RootType} from '../../../../common/js/volume_manager_types.js'; import {constants} from '../../constants.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/state_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/state_banner.ts index 8bda6737..8de41436 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/state_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/state_banner.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {assertInstanceof} from 'chrome://resources/ash/common/assert.js'; import {visitURL} from '../../../../common/js/util.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/trash_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/trash_banner.ts index cf13fbe..59e6f89c4 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/trash_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/trash_banner.ts
@@ -2,13 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - - import {RootType} from '../../../../common/js/volume_manager_types.js'; import {StateBanner} from './state_banner.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/banners/warning_banner.ts b/ui/file_manager/file_manager/foreground/js/ui/banners/warning_banner.ts index 9bbf4dbc..48edbeb 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/banners/warning_banner.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/banners/warning_banner.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {visitURL} from '../../../../common/js/util.js'; import {type AllowedVolumeOrType, Banner, BannerEvent} from './types.js';
diff --git a/ui/file_manager/file_manager/foreground/js/ui/command.ts b/ui/file_manager/file_manager/foreground/js/ui/command.ts index 012aaa2..74841f9 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/command.ts +++ b/ui/file_manager/file_manager/foreground/js/ui/command.ts
@@ -23,13 +23,8 @@ import {MenuItem} from './menu_item.js'; -export type CommandEvent = Event&{ - command: Command, -}; - /** * Creates a new command element. - * @constructor */ export class Command extends HTMLElement { private shortcut_: string|null = null; @@ -64,8 +59,12 @@ const doc = this.ownerDocument; if (doc.activeElement) { - const e = new Event('command', {bubbles: true}) as CommandEvent; - e.command = this; + const e = new CustomEvent('command', { + bubbles: true, + detail: { + command: this, + }, + }); (element || doc.activeElement).dispatchEvent(e); } @@ -309,3 +308,15 @@ this.preventDefault(); } } + +// Event triggered when a Command is executed. +export type CommandEvent = CustomEvent<{command: Command}>; + +// These event can bubble, so we can listen to it in any element parent of the +// <command>. +declare global { + interface HTMLElementEventMap { + 'command': CommandEvent; + 'canExecute': CanExecuteEvent; + } +}
diff --git a/ui/file_manager/file_manager/foreground/js/ui/file_manager_dialog_base.js b/ui/file_manager/file_manager/foreground/js/ui/file_manager_dialog_base.js index ed71634..368957a 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/file_manager_dialog_base.js +++ b/ui/file_manager/file_manager/foreground/js/ui/file_manager_dialog_base.js
@@ -125,7 +125,6 @@ /** * @override - * @suppress {accessControls} */ // @ts-ignore: error TS7019: Rest parameter 'args' implicitly has an 'any[]' // type.
diff --git a/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js b/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js index 89337b81..5ca7070 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js +++ b/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
@@ -617,8 +617,6 @@ /** * TODO(hirono): Merge the method into initAdditionalUI. * @param {!(DirectoryTree|DirectoryTreeContainer)} directoryTree - * - * @suppress {checkTypes} closure can't cast Element to XfTree. */ initDirectoryTree(directoryTree) { if (isNewDirectoryTreeEnabled()) {
diff --git a/ui/file_manager/file_manager/foreground/js/ui/files_alert_dialog.js b/ui/file_manager/file_manager/foreground/js/ui/files_alert_dialog.js index 941ad822..b2573e4 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/files_alert_dialog.js +++ b/ui/file_manager/file_manager/foreground/js/ui/files_alert_dialog.js
@@ -36,7 +36,6 @@ /** * @override - * @suppress {accessControls} */ // @ts-ignore: error TS7019: Rest parameter 'args' implicitly has an 'any[]' // type.
diff --git a/ui/file_manager/file_manager/foreground/js/ui/files_confirm_dialog.js b/ui/file_manager/file_manager/foreground/js/ui/files_confirm_dialog.js index ad951f4..4f2d8b2 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/files_confirm_dialog.js +++ b/ui/file_manager/file_manager/foreground/js/ui/files_confirm_dialog.js
@@ -58,7 +58,6 @@ /** * @override - * @suppress {accessControls} */ // @ts-ignore: error TS7019: Rest parameter 'args' implicitly has an 'any[]' // type.
diff --git a/ui/file_manager/file_manager/foreground/js/ui/install_linux_package_dialog_unittest.js b/ui/file_manager/file_manager/foreground/js/ui/install_linux_package_dialog_unittest.js index 09f7197..d202bb7 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/install_linux_package_dialog_unittest.js +++ b/ui/file_manager/file_manager/foreground/js/ui/install_linux_package_dialog_unittest.js
@@ -8,13 +8,11 @@ export function testInstallButtonHiddenUntilInfoReady() { // Polyfill chrome.app.window.current(). - /** @suppress {checkTypes,const} */ // @ts-ignore: error TS2339: Property 'app' does not exist on type 'typeof // chrome'. chrome.app = {window: {current: () => null}}; let getInfoCallback; - /** @suppress {checkTypes,const} */ // @ts-ignore: error TS2740: Type '{ getLinuxPackageInfo: (entry: // FileSystemEntry, callback: (arg0: LinuxPackageInfo) => void) => void; }' is // missing the following properties from type 'typeof fileManagerPrivate':
diff --git a/ui/file_manager/file_manager/state/ducks/all_entries.ts b/ui/file_manager/file_manager/state/ducks/all_entries.ts index 534dba1..53d4b11c 100644 --- a/ui/file_manager/file_manager/state/ducks/all_entries.ts +++ b/ui/file_manager/file_manager/state/ducks/all_entries.ts
@@ -28,7 +28,6 @@ /** * @fileoverview Entries slice of the store. - * @suppress {checkTypes} TS already checks this file. */ const slice = new Slice<State, State['allEntries']>('allEntries');
diff --git a/ui/file_manager/file_manager/state/ducks/android_apps.ts b/ui/file_manager/file_manager/state/ducks/android_apps.ts index de7c780..ec3e7ca 100644 --- a/ui/file_manager/file_manager/state/ducks/android_apps.ts +++ b/ui/file_manager/file_manager/state/ducks/android_apps.ts
@@ -9,7 +9,6 @@ /** * @fileoverview Android apps slice of the store. - * @suppress {checkTypes} * * Android App is something we get from private API * `chrome.fileManagerPrivate.getAndroidPickerApps`, it will be shown as a
diff --git a/ui/file_manager/file_manager/state/ducks/bulk_pinning.ts b/ui/file_manager/file_manager/state/ducks/bulk_pinning.ts index 848d1b8..d42d6fd 100644 --- a/ui/file_manager/file_manager/state/ducks/bulk_pinning.ts +++ b/ui/file_manager/file_manager/state/ducks/bulk_pinning.ts
@@ -7,7 +7,6 @@ /** * @fileoverview Bulk pinning slice of the store. - * @suppress {checkTypes} * * BulkPinProgress is the current state of files that are being pinned when the * BulkPinning feature is enabled. During bulk pinning, all the users items in
diff --git a/ui/file_manager/file_manager/state/ducks/current_directory.ts b/ui/file_manager/file_manager/state/ducks/current_directory.ts index 2087cf9..dfab0b7 100644 --- a/ui/file_manager/file_manager/state/ducks/current_directory.ts +++ b/ui/file_manager/file_manager/state/ducks/current_directory.ts
@@ -20,7 +20,6 @@ /** * @fileoverview Current directory slice of the store. - * @suppress {checkTypes} */ const slice = new Slice<State, State['currentDirectory']>('currentDirectory');
diff --git a/ui/file_manager/file_manager/state/ducks/device.ts b/ui/file_manager/file_manager/state/ducks/device.ts index 0ccdabff..a99040f 100644 --- a/ui/file_manager/file_manager/state/ducks/device.ts +++ b/ui/file_manager/file_manager/state/ducks/device.ts
@@ -7,7 +7,6 @@ /** * @fileoverview Device slice of the store. - * @suppress {checkTypes} */ const slice = new Slice<State, State['device']>('device');
diff --git a/ui/file_manager/file_manager/state/ducks/drive.ts b/ui/file_manager/file_manager/state/ducks/drive.ts index 9ec8baf..3c34ef9 100644 --- a/ui/file_manager/file_manager/state/ducks/drive.ts +++ b/ui/file_manager/file_manager/state/ducks/drive.ts
@@ -7,7 +7,6 @@ /** * @fileoverview Drive slice of the store. - * @suppress {checkTypes} */ const slice = new Slice<State, State['drive']>('drive');
diff --git a/ui/file_manager/file_manager/state/ducks/folder_shortcuts.ts b/ui/file_manager/file_manager/state/ducks/folder_shortcuts.ts index f09cc2f..6907a1f 100644 --- a/ui/file_manager/file_manager/state/ducks/folder_shortcuts.ts +++ b/ui/file_manager/file_manager/state/ducks/folder_shortcuts.ts
@@ -9,11 +9,6 @@ import {cacheEntries} from './all_entries.js'; -/** - * @fileoverview Folder shortcuts slice of the store. - * @suppress {checkTypes} - */ - const slice = new Slice<State, State['folderShortcuts']>('folderShortcuts'); export {slice as folderShortcutsSlice};
diff --git a/ui/file_manager/file_manager/state/ducks/navigation.ts b/ui/file_manager/file_manager/state/ducks/navigation.ts index 1f55bc0..f7d6f9a 100644 --- a/ui/file_manager/file_manager/state/ducks/navigation.ts +++ b/ui/file_manager/file_manager/state/ducks/navigation.ts
@@ -15,7 +15,6 @@ /** * @fileoverview Navigation slice of the store. - * @suppress {checkTypes} */ const slice = new Slice<State, State['navigation']>('navigation');
diff --git a/ui/file_manager/file_manager/state/ducks/preferences.ts b/ui/file_manager/file_manager/state/ducks/preferences.ts index f8d2a113..4f9bc82 100644 --- a/ui/file_manager/file_manager/state/ducks/preferences.ts +++ b/ui/file_manager/file_manager/state/ducks/preferences.ts
@@ -7,7 +7,6 @@ /** * @fileoverview Chrome preferences slice of the store. - * @suppress {checkTypes} * * Chrome preferences store user data that is persisted to disk OR across * profiles, this takes care of initially populating these values then keeping
diff --git a/ui/file_manager/file_manager/state/ducks/search.ts b/ui/file_manager/file_manager/state/ducks/search.ts index 6546cc7..ec483b3 100644 --- a/ui/file_manager/file_manager/state/ducks/search.ts +++ b/ui/file_manager/file_manager/state/ducks/search.ts
@@ -7,7 +7,6 @@ /** * @fileoverview Search slice of the store. - * @suppress {checkTypes} */ const slice = new Slice<State, State['search']>('search');
diff --git a/ui/file_manager/file_manager/state/ducks/ui_entries.ts b/ui/file_manager/file_manager/state/ducks/ui_entries.ts index eab415bc..ac8bca6 100644 --- a/ui/file_manager/file_manager/state/ducks/ui_entries.ts +++ b/ui/file_manager/file_manager/state/ducks/ui_entries.ts
@@ -13,7 +13,6 @@ /** * @fileoverview UI entries slice of the store. - * @suppress {checkTypes} * * UI entries represents entries shown on UI only (aka FakeEntry, e.g. * Recents/Trash/Google Drive wrapper), they don't have a real entry backup in
diff --git a/ui/file_manager/file_manager/state/ducks/volumes.ts b/ui/file_manager/file_manager/state/ducks/volumes.ts index 3fd1c14..b60418f 100644 --- a/ui/file_manager/file_manager/state/ducks/volumes.ts +++ b/ui/file_manager/file_manager/state/ducks/volumes.ts
@@ -19,7 +19,6 @@ /** * @fileoverview Volumes slice of the store. - * @suppress {checkTypes} */ const slice = new Slice<State, State['volumes']>('volumes');
diff --git a/ui/file_manager/file_manager/widgets/xf_base.ts b/ui/file_manager/file_manager/widgets/xf_base.ts index e8df7b43..4ba02b7 100644 --- a/ui/file_manager/file_manager/widgets/xf_base.ts +++ b/ui/file_manager/file_manager/widgets/xf_base.ts
@@ -4,7 +4,6 @@ /** * @fileoverview A base class for all Files app(xf) widgets. - * @suppress {checkTypes} closure can't recognize LitElement */ import '../common/js/tslib_shim.js';
diff --git a/ui/file_manager/file_manager/widgets/xf_cloud_panel.ts b/ui/file_manager/file_manager/widgets/xf_cloud_panel.ts index edc5b6cb..13c21c0a 100644 --- a/ui/file_manager/file_manager/widgets/xf_cloud_panel.ts +++ b/ui/file_manager/file_manager/widgets/xf_cloud_panel.ts
@@ -4,8 +4,6 @@ /** * @fileoverview xf-cloud-panel element. - * Disable type checking for closure, as it is done by the typescript compiler. - * @suppress {checkTypes} */ import type {CrActionMenuElement} from 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js';
diff --git a/ui/file_manager/file_manager/widgets/xf_jellybean.ts b/ui/file_manager/file_manager/widgets/xf_jellybean.ts index c3970ec..d9b0b861 100644 --- a/ui/file_manager/file_manager/widgets/xf_jellybean.ts +++ b/ui/file_manager/file_manager/widgets/xf_jellybean.ts
@@ -4,8 +4,6 @@ /** * @fileoverview Element which controls pre- and post-jellybean migration UI. - * Disable type checking for closure, as it is done by the typescript compiler. - * @suppress{missingProperties} */ import {isCrosComponentsEnabled} from '../common/js/flags.js';
diff --git a/ui/file_manager/file_manager/widgets/xf_password_dialog.ts b/ui/file_manager/file_manager/widgets/xf_password_dialog.ts index 8656fdd..6276e65 100644 --- a/ui/file_manager/file_manager/widgets/xf_password_dialog.ts +++ b/ui/file_manager/file_manager/widgets/xf_password_dialog.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview - * This file is checked via TS, so we suppress Closure checks. - * @suppress {checkTypes} - */ - import {loadTimeData} from 'chrome://resources/ash/common/load_time_data.m.js'; import {CrButtonElement} from 'chrome://resources/cr_elements/cr_button/cr_button.js'; import {CrDialogElement} from 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js';
diff --git a/ui/file_manager/file_manager/widgets/xf_search_options.ts b/ui/file_manager/file_manager/widgets/xf_search_options.ts index 917a9f6f4..e44d6e1 100644 --- a/ui/file_manager/file_manager/widgets/xf_search_options.ts +++ b/ui/file_manager/file_manager/widgets/xf_search_options.ts
@@ -2,12 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** - * @fileoverview A search widget that allows users to choose search options. - * Disable type checking for closure, as it is done by the typescript compiler. - * @suppress {checkTypes} - */ - import {getTemplate} from './xf_search_options.html.js'; import {XfSelect} from './xf_select.js';
diff --git a/ui/file_manager/file_manager/widgets/xf_select.ts b/ui/file_manager/file_manager/widgets/xf_select.ts index e680ab0e..9715cc7 100644 --- a/ui/file_manager/file_manager/widgets/xf_select.ts +++ b/ui/file_manager/file_manager/widgets/xf_select.ts
@@ -4,8 +4,6 @@ /** * @fileoverview xf-select element which is ChromeOS <select>..</select>. - * Disable type checking for closure, as it is done by the typescript compiler. - * @suppress{missingProperties} */ import {AnchorAlignment, CrActionMenuElement} from 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js';
diff --git a/ui/file_manager/file_names.gni b/ui/file_manager/file_names.gni index d1ec655..d11ccd3 100644 --- a/ui/file_manager/file_names.gni +++ b/ui/file_manager/file_names.gni
@@ -22,7 +22,6 @@ # Files Common: "file_manager/common/js/array_data_model.js", - "file_manager/common/js/glitch.js", "file_manager/common/js/files_app_entry_types.js", "file_manager/common/js/filtered_volume_manager.js", @@ -54,7 +53,6 @@ "file_manager/foreground/js/deferred_elements.js", "file_manager/foreground/js/dialog_action_controller.js", "file_manager/foreground/js/directory_contents.js", - "file_manager/foreground/js/directory_model.js", "file_manager/foreground/js/directory_tree_naming_controller.js", "file_manager/foreground/js/elements_importer.js", "file_manager/foreground/js/fake_android_app_list_model.js", @@ -71,7 +69,6 @@ "file_manager/foreground/js/list_thumbnail_loader.js", "file_manager/foreground/js/metadata_update_controller.js", "file_manager/foreground/js/metrics_start.js", - "file_manager/foreground/js/mock_directory_model.js", "file_manager/foreground/js/mock_folder_shortcut_data_model.js", "file_manager/foreground/js/mock_navigation_list_model.js", "file_manager/foreground/js/mock_thumbnail_loader.js", @@ -89,7 +86,6 @@ # Metadata: "file_manager/foreground/js/metadata/id3_parser.js", - "file_manager/foreground/js/metadata/image_parsers.js", "file_manager/foreground/js/metadata/metadata_cache_item.js", "file_manager/foreground/js/metadata/metadata_cache_set.js", "file_manager/foreground/js/metadata/metadata_dispatcher.js", @@ -134,15 +130,16 @@ "file_manager/common/js/app_util.ts", "file_manager/common/js/async_util.ts", "file_manager/common/js/cr_ui.ts", - "file_manager/common/js/files_app_state.ts", - "file_manager/common/js/file_type.ts", - "file_manager/common/js/dom_utils.ts", "file_manager/common/js/dialog_type.ts", + "file_manager/common/js/dom_utils.ts", "file_manager/common/js/entry_utils.ts", "file_manager/common/js/error_counter.ts", "file_manager/common/js/file_tasks.ts", + "file_manager/common/js/file_type.ts", "file_manager/common/js/file_types_base.ts", + "file_manager/common/js/files_app_state.ts", "file_manager/common/js/flags.ts", + "file_manager/common/js/glitch.ts", "file_manager/common/js/icon_util.ts", "file_manager/common/js/lru_cache.ts", "file_manager/common/js/metrics.ts", @@ -286,6 +283,7 @@ "file_manager/foreground/js/actions_controller.ts", "file_manager/background/js/app_window_wrapper.ts", "file_manager/background/js/crostini.ts", + "file_manager/foreground/js/directory_model.ts", "file_manager/background/js/drive_sync_handler.ts", "file_manager/background/js/entry_location_impl.ts", "file_manager/background/js/file_operation_handler.ts", @@ -295,6 +293,7 @@ "file_manager/background/js/metrics_start.ts", "file_manager/foreground/js/mock_actions_model.ts", "file_manager/background/js/mock_crostini.ts", + "file_manager/foreground/js/mock_directory_model.ts", "file_manager/background/js/mock_progress_center.ts", "file_manager/background/js/mock_volume_manager.ts", "file_manager/background/js/progress_center.ts", @@ -360,6 +359,7 @@ "file_manager/foreground/js/metadata/file_system_metadata_provider.ts", "file_manager/foreground/js/metadata/function_parallel.ts", "file_manager/foreground/js/metadata/function_sequence.ts", + "file_manager/foreground/js/metadata/image_parsers.ts", "file_manager/foreground/js/metadata/metadata_item.ts", "file_manager/foreground/js/metadata/metadata_model.ts", "file_manager/foreground/js/metadata/metadata_parser.ts", @@ -415,6 +415,8 @@ ] ts_test_files = [ + "file_manager/common/js/filtered_volume_manager_unittest.ts", + # 3-line header to avoid conflict. # Don't remove this. # These lines will be removed at the end of the TS migration. @@ -427,8 +429,9 @@ "file_manager/common/js/recent_date_bucket_unittest.ts", "file_manager/common/js/storage_unittest.ts", "file_manager/common/js/translations_unittest.ts", - "file_manager/common/js/volume_manager_types_unittest.ts", + "file_manager/common/js/unittest_util.ts", "file_manager/common/js/util_unittest.ts", + "file_manager/common/js/volume_manager_types_unittest.ts", # 3-line header to avoid conflict. # Don't remove this. @@ -510,6 +513,7 @@ "file_manager/foreground/js/banner_controller_unittest.ts", "file_manager/foreground/js/banner_util_unittest.ts", "file_manager/foreground/js/directory_contents_unittest.ts", + "file_manager/foreground/js/directory_model_unittest.ts", "file_manager/foreground/js/empty_folder_controller_unittest.ts", "file_manager/foreground/js/file_tasks_unittest.ts", "file_manager/foreground/js/file_transfer_controller_unittest.ts", @@ -607,9 +611,7 @@ # Common: "file_manager/common/js/array_data_model_unittest.js", "file_manager/common/js/files_app_entry_types_unittest.js", - "file_manager/common/js/filtered_volume_manager_unittest.js", "file_manager/common/js/test_error_reporting.js", - "file_manager/common/js/unittest_util.js", # Background: @@ -633,7 +635,6 @@ "file_manager/foreground/js/ui/position_util_unittest.js", "file_manager/foreground/js/ui/directory_tree_unittest.js", "file_manager/foreground/js/navigation_list_model_unittest.js", - "file_manager/foreground/js/directory_model_unittest.js", # Image Loader: "image_loader/scheduler_unittest.js",
diff --git a/ui/file_manager/integration_tests/file_manager/directory_tree.js b/ui/file_manager/integration_tests/file_manager/directory_tree.js index a9cce18..a4563dc 100644 --- a/ui/file_manager/integration_tests/file_manager/directory_tree.js +++ b/ui/file_manager/integration_tests/file_manager/directory_tree.js
@@ -583,3 +583,23 @@ appId, '/My files/Downloads/aaa'); await directoryTree.waitForSelectedItemByLabel('aaa'); }; + + +/** + * When My Drive is active, clicking Google Drive shouldn't change the current + * directory. + */ +testcase.directoryTreeClickDriveRootWhenMyDriveIsActive = async () => { + // Open Files app. + const appId = await setupAndWaitUntilReady(RootPath.DRIVE, []); + const directoryTree = await DirectoryTreePageObject.create(appId, remoteCall); + await directoryTree.waitForSelectedItemByLabel('My Drive'); + + // Select Google Drive. + await directoryTree.selectItemByLabel('Google Drive'); + + // My Drive should still be selected. + await directoryTree.waitForSelectedItemByLabel('My Drive'); + // Current directory is still My Drive, not Google Drive. + await remoteCall.waitUntilCurrentDirectoryIsChanged(appId, '/My Drive'); +};
diff --git a/ui/message_center/views/message_view.h b/ui/message_center/views/message_view.h index 7d0d72d..d5112b52 100644 --- a/ui/message_center/views/message_view.h +++ b/ui/message_center/views/message_view.h
@@ -92,14 +92,6 @@ ~MessageView() override; - // Animates the grouped child notification when switching between expand and - // collapse state. - virtual void AnimateGroupedChildExpandedCollapse(bool expanded) {} - - // Animations when converting from single to group notification. - virtual void AnimateSingleToGroup(const std::string& notification_id, - std::string parent_id) {} - // Updates this view with an additional grouped notification. If the view // wasn't previously grouped it also takes care of converting the view to // the grouped notification state. @@ -116,13 +108,8 @@ virtual void PopulateGroupNotifications( const std::vector<const Notification*>& notifications) {} - // Removes the grouped notification view associated with the provided - // `notification_id`. virtual void RemoveGroupNotification(const std::string& notification_id) {} - // Updates the expanded state for grouped child notification. - virtual void SetGroupedChildExpanded(bool expanded) {} - // Creates text for spoken feedback from the data contained in the // notification. std::u16string CreateAccessibleName(const Notification& notification);
diff --git a/ui/views/bubble/tooltip_icon.cc b/ui/views/bubble/tooltip_icon.cc index ca85514..e18c5c2 100644 --- a/ui/views/bubble/tooltip_icon.cc +++ b/ui/views/bubble/tooltip_icon.cc
@@ -24,7 +24,10 @@ namespace views { TooltipIcon::TooltipIcon(const std::u16string& tooltip, int tooltip_icon_size) - : tooltip_(tooltip), tooltip_icon_size_(tooltip_icon_size) { + : tooltip_(tooltip), + tooltip_icon_size_(tooltip_icon_size), + + bubble_(nullptr) { SetFocusBehavior(PlatformStyle::kDefaultFocusBehavior); set_suppress_default_focus_handling(); FocusRing::Install(this); @@ -136,7 +139,7 @@ SetDrawAsHovered(true); - bubble_ = std::make_unique<InfoBubble>(this, anchor_point_arrow_, tooltip_); + bubble_ = new InfoBubble(this, anchor_point_arrow_, tooltip_); bubble_->set_preferred_width(preferred_width_); // When shown due to a gesture event, close on deactivate (i.e. don't use // "focusless"). @@ -167,7 +170,7 @@ SetDrawAsHovered(false); mouse_watcher_.reset(); - bubble_.reset(); + bubble_ = nullptr; } BEGIN_METADATA(TooltipIcon, ImageView)
diff --git a/ui/views/bubble/tooltip_icon.h b/ui/views/bubble/tooltip_icon.h index 4faf6dd..231813d6 100644 --- a/ui/views/bubble/tooltip_icon.h +++ b/ui/views/bubble/tooltip_icon.h
@@ -98,8 +98,8 @@ // Whether the mouse is inside this tooltip. bool mouse_inside_ = false; - // A bubble shown on hover. NULL while hiding. - std::unique_ptr<InfoBubble> bubble_; + // A bubble shown on hover. Weak; owns itself. NULL while hiding. + raw_ptr<InfoBubble> bubble_; // The width the tooltip prefers to be. Default is 0 (no preference). int preferred_width_ = 0;
diff --git a/ui/views/controls/button/image_button.cc b/ui/views/controls/button/image_button.cc index 0728b1f8..59196ec 100644 --- a/ui/views/controls/button/image_button.cc +++ b/ui/views/controls/button/image_button.cc
@@ -158,7 +158,7 @@ int icon_size = (icon_style == MaterialIconStyle::kLarge) ? kLargeIconSize : kSmallIconSize; std::unique_ptr<ImageButton> icon_button = - std::make_unique<ImageButton>(callback); + std::make_unique<ImageButton>(std::move(callback)); icon_button->SetImageModel( ButtonState::STATE_NORMAL, ui::ImageModel::FromVectorIcon(icon, ui::kColorIcon, icon_size));
diff --git a/ui/views/controls/button/toggle_button.cc b/ui/views/controls/button/toggle_button.cc index 307f7ab..f082363 100644 --- a/ui/views/controls/button/toggle_button.cc +++ b/ui/views/controls/button/toggle_button.cc
@@ -220,7 +220,7 @@ }; ToggleButton::ToggleButton(PressedCallback callback) - : ToggleButton(callback, + : ToggleButton(std::move(callback), /*has_thumb_shadow=*/!features::IsChromeRefresh2023()) {} ToggleButton::ToggleButton(PressedCallback callback, bool has_thumb_shadow)
diff --git a/ui/views/examples/colored_dialog_example.cc b/ui/views/examples/colored_dialog_example.cc index 57ef1e1..6b62f487 100644 --- a/ui/views/examples/colored_dialog_example.cc +++ b/ui/views/examples/colored_dialog_example.cc
@@ -59,7 +59,7 @@ TextVectorImageButton(PressedCallback callback, const std::u16string& text, const gfx::VectorIcon& icon) - : MdTextButton(callback, text), icon_(icon) {} + : MdTextButton(std::move(callback), text), icon_(icon) {} TextVectorImageButton(const TextVectorImageButton&) = delete; TextVectorImageButton& operator=(const TextVectorImageButton&) = delete; ~TextVectorImageButton() override = default;
diff --git a/ui/views/examples/examples_main_proc.cc b/ui/views/examples/examples_main_proc.cc index 659af82..6ea78ab 100644 --- a/ui/views/examples/examples_main_proc.cc +++ b/ui/views/examples/examples_main_proc.cc
@@ -91,7 +91,7 @@ // window to not render. See http://crbug.com/936249. gl::SetGlWorkarounds(gl::GlWorkarounds{.disable_direct_composition = true}); - base::FeatureList::InitializeInstance( + base::FeatureList::InitInstance( command_line->GetSwitchValueASCII(switches::kEnableFeatures), command_line->GetSwitchValueASCII(switches::kDisableFeatures));
diff --git a/v8 b/v8 index 30e8263..e91bf13 160000 --- a/v8 +++ b/v8
@@ -1 +1 @@ -Subproject commit 30e826391ad51011e6829dde5a1b246dd1588f19 +Subproject commit e91bf136784e87899d01ddd36ed3d41de55a91e1