mirror of
https://github.com/imputnet/helium.git
synced 2026-08-20 00:57:32 +02:00
Compare commits
430 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 396d021b13 | |||
| a02357fc6a | |||
| 1f3ce33b97 | |||
| 98a39bd850 | |||
| 0ab0230834 | |||
| 72a181713d | |||
| 51a9f128f6 | |||
| 4bf1d44499 | |||
| 98349e032e | |||
| 5317670956 | |||
| 11262be4ed | |||
| 04e5e237a6 | |||
| 77639b83b4 | |||
| 5726f53740 | |||
| 22e1524b9d | |||
| 4ebee38006 | |||
| a78275ad90 | |||
| 9f6326c8c3 | |||
| 146f20eb46 | |||
| 728663c003 | |||
| 032fefbb3b | |||
| 2beef48bb0 | |||
| 07eb5e6464 | |||
| 4f5f829926 | |||
| ca70c10c6e | |||
| 94dcccdb1f | |||
| e5c8b6dd5d | |||
| 6881a55227 | |||
| 47f145b53f | |||
| b8f64f5647 | |||
| d1c61d67f6 | |||
| 8c8ba4780b | |||
| fd4ebb9451 | |||
| 3ef1b41ede | |||
| 3f5b4b7412 | |||
| 6fd9b6bece | |||
| dd2e11f361 | |||
| e8e57e3486 | |||
| 643674676d | |||
| 2b388075c3 | |||
| ff63ad4bbd | |||
| 2a1432b0e4 | |||
| e56531d482 | |||
| 47a6b26022 | |||
| abe3bf12d8 | |||
| 46578b03ec | |||
| c1c4d007dc | |||
| edfd9ad0ea | |||
| 6f7b4a9029 | |||
| 4bbcd21640 | |||
| 54de4017ee | |||
| c0b9568b65 | |||
| 941352d902 | |||
| 4cf9165668 | |||
| 4963889d71 | |||
| 01a6615e60 | |||
| a6994c688e | |||
| 23908b348c | |||
| 1a3f947eb8 | |||
| 9aed4b3a85 | |||
| 024340269c | |||
| b662c376d1 | |||
| 13e5ba2196 | |||
| df2f950984 | |||
| 838688ad33 | |||
| 3b6fd05352 | |||
| 5642bceece | |||
| 8d2c72bdda | |||
| ef21369a09 | |||
| 09de5cf3fd | |||
| 35b5c49350 | |||
| 7fc527c933 | |||
| 9e55d51f84 | |||
| 378ebe1d22 | |||
| 18fb49be09 | |||
| 02af40f670 | |||
| 36ec10ebbc | |||
| 13390812d1 | |||
| 230b8485a4 | |||
| 63caeac89d | |||
| bdffe08340 | |||
| 22a84c5105 | |||
| bdd66ca1c0 | |||
| 941e0a2ac1 | |||
| dcfeb0daa9 | |||
| d081925071 | |||
| 8a9652acd5 | |||
| 0440e3a923 | |||
| cb05352645 | |||
| bd375e6c4f | |||
| 51ef564b48 | |||
| da2d921f8f | |||
| d868911b55 | |||
| 6594e9f332 | |||
| 80ad3fc0c6 | |||
| 0776559aef | |||
| 0691459d2c | |||
| ae9fe23a5f | |||
| aacb18d4fd | |||
| b6378d5d93 | |||
| 9377353176 | |||
| 695726d37a | |||
| bb19cfa083 | |||
| 7607c88d3f | |||
| af7ab99ba4 | |||
| 298971df7f | |||
| ead83f7e78 | |||
| 3e78654f40 | |||
| cd196d63c7 | |||
| 6f43432519 | |||
| d20aad643e | |||
| 985688b9a9 | |||
| 50167df4d4 | |||
| 8e4b1b1204 | |||
| 24c34d93f7 | |||
| e00d3ef9e3 | |||
| 6325cb4b30 | |||
| 84dbbf159c | |||
| d006f5961a | |||
| 1031fdae23 | |||
| 6a97b1949d | |||
| efd166b84f | |||
| 8d8052b9d5 | |||
| cbcffd188c | |||
| b1c7c7ec55 | |||
| 53d84da528 | |||
| effc1998db | |||
| a59d037abf | |||
| 99df2f5ce0 | |||
| 43a4670139 | |||
| 9fa95f14d5 | |||
| 1fffbef8d8 | |||
| d69044982f | |||
| a8f0ed3382 | |||
| 4c8f19152a | |||
| fd840637d0 | |||
| fab928a47d | |||
| 4ab4dc360d | |||
| 2faa7811ca | |||
| 3e38464b94 | |||
| d842e99049 | |||
| 894352c8d5 | |||
| e88afce78d | |||
| 3777d75236 | |||
| a3d44e6cc1 | |||
| 55438d5cbc | |||
| 1135b4aa89 | |||
| 39cd99cc8d | |||
| 8ca6ce276b | |||
| 6af846d7a3 | |||
| 7d014c2076 | |||
| 7cc336dcb2 | |||
| d57e242e5e | |||
| 26252d38c2 | |||
| d9282c041e | |||
| edea8fe4f7 | |||
| ff09b25f95 | |||
| cb4f6ca17b | |||
| 2f826d1ee9 | |||
| e8f5addcff | |||
| b6e5b77e31 | |||
| 5903dd18e8 | |||
| 868121c2fc | |||
| 0c355bda1b | |||
| 00501e2311 | |||
| 114aca58c5 | |||
| 8b563c0d01 | |||
| 824cf71ff3 | |||
| 63be29609d | |||
| d1cdab8975 | |||
| b5c22404c6 | |||
| d6f4210a41 | |||
| a939d1d8b0 | |||
| 76fbefad51 | |||
| 95a1030f70 | |||
| 7375679377 | |||
| 2ee49a1059 | |||
| 1be2432a9a | |||
| 5d96434aa0 | |||
| 56d1a136ab | |||
| 688af14009 | |||
| 1341de3a37 | |||
| 4e6eda294f | |||
| f32b04755e | |||
| 75d044b9a6 | |||
| 0ec967b7d6 | |||
| 5354646288 | |||
| f03eea9638 | |||
| 42e783c0bb | |||
| 4cfbfe2710 | |||
| 7c51e1f0f6 | |||
| b45d47cf07 | |||
| c4482c5655 | |||
| 8930f2ae91 | |||
| 714939df2c | |||
| db5ddc92c1 | |||
| e64526ce10 | |||
| b82e2921d4 | |||
| a16ae4bd88 | |||
| 07018baf2e | |||
| f4937943ca | |||
| d27f87f754 | |||
| a2b3cd02bb | |||
| 20915c82d9 | |||
| 7c45f2fcd6 | |||
| 8cb698e496 | |||
| 009a2e74c7 | |||
| b06b34b5e9 | |||
| b102956f52 | |||
| 1676a4071e | |||
| 89699b019b | |||
| 9b49458bc2 | |||
| b3733ec6aa | |||
| ac863716dd | |||
| 05ab79d610 | |||
| e67c0db58f | |||
| 8041351f2b | |||
| 2fd8ab8736 | |||
| bb720ee09f | |||
| 3175ba89bd | |||
| 1d218c894b | |||
| 3e07bd785f | |||
| a3072fedab | |||
| a749a3e3e2 | |||
| d145111dd0 | |||
| 2ce45ab9f2 | |||
| ab9a39c516 | |||
| 7b77584e8c | |||
| bcf3330b42 | |||
| a2d63db83b | |||
| b3f08938ce | |||
| 4a95606bfa | |||
| 76462eb66c | |||
| ec8480c3f5 | |||
| c94c96e62e | |||
| fa41ca5fca | |||
| 9df88459b8 | |||
| 7e1d9dd767 | |||
| ccb227dc03 | |||
| 94fa070851 | |||
| 1a266da9a3 | |||
| 6312142913 | |||
| 64ef95a6eb | |||
| a7e5433e7c | |||
| 4f803de791 | |||
| aebf0a4387 | |||
| be8ba95803 | |||
| c3ba3d8999 | |||
| 403e3fe01d | |||
| 5ee42465ab | |||
| aa487a75cd | |||
| 24b594f89e | |||
| 6a1cd43391 | |||
| 675cf80cde | |||
| 0008cd2cec | |||
| fece071fb4 | |||
| 43dfac4447 | |||
| 5d33305095 | |||
| 52dc69ac18 | |||
| 633d41748b | |||
| c8a824ec85 | |||
| 1fe645253d | |||
| a4f89dfb1c | |||
| 13f49f28cc | |||
| e9a04a2ccf | |||
| 80dfd780db | |||
| c9a0eaf2c0 | |||
| 9f7755dbd7 | |||
| 110cab3432 | |||
| 0f9df28d13 | |||
| 060fa834e5 | |||
| be47d96c1f | |||
| f049404ad5 | |||
| 232f940dbd | |||
| b3d929f6e2 | |||
| 5f296ba37d | |||
| 3668280470 | |||
| 673aaf7698 | |||
| 9113a4cda7 | |||
| e9de843abe | |||
| 367118d103 | |||
| 8da7b370f7 | |||
| 06a3ebf3d3 | |||
| 4991dcc364 | |||
| 7222174274 | |||
| 2315522ef2 | |||
| dc61f5cf4f | |||
| 8486eb8436 | |||
| 537ba368e9 | |||
| 61c7f706eb | |||
| ee6294e217 | |||
| e3bcfa4148 | |||
| 4700d1bc7e | |||
| 617bd4b75e | |||
| 7b31f0b137 | |||
| 7815dd5522 | |||
| 48577b920b | |||
| a264ac047d | |||
| eaf2714853 | |||
| cc1db76e65 | |||
| ae476a674c | |||
| 74779ebab4 | |||
| 70627f67f4 | |||
| c50904a16e | |||
| 2300b0f239 | |||
| 19d1c7fa61 | |||
| 36f1f56e6a | |||
| 0455a0ebc1 | |||
| 34ebe96fcc | |||
| 0198aeaac1 | |||
| 7c6d64e244 | |||
| eadab75c6e | |||
| 0366b01487 | |||
| 83a38925d8 | |||
| c12e746219 | |||
| 9cfd581f96 | |||
| 6a7a75d0d4 | |||
| e0995b8b42 | |||
| c7275e01d6 | |||
| 3952195984 | |||
| d7451e760c | |||
| efaf686acf | |||
| 0b535463d6 | |||
| 792a3d0dfa | |||
| bf550b7cb2 | |||
| b2050c2c8b | |||
| ec7340c086 | |||
| 35fe39c483 | |||
| 2e9125d326 | |||
| e347cca951 | |||
| 2a79cab2b4 | |||
| 256b83e902 | |||
| f7ad164068 | |||
| ed72676c85 | |||
| b3031f79b3 | |||
| ab6faeaed9 | |||
| 5bf2bc5966 | |||
| 68ef8ffe61 | |||
| 11b9b4f0eb | |||
| fd4e3ec87b | |||
| 7f886834a7 | |||
| 1c4ad07e9c | |||
| ce80c9748f | |||
| ea61e0bcd5 | |||
| d813f47f4e | |||
| dd24681d9d | |||
| 50e0255fe2 | |||
| b735b3ae1d | |||
| 115cf2e55a | |||
| 7022a9e02e | |||
| 9fc0ab1720 | |||
| abb3c6628a | |||
| f62b1281a3 | |||
| f46cc85e7c | |||
| 6f6679d446 | |||
| 662041df27 | |||
| 86710deb6a | |||
| 8f51e9f904 | |||
| f01e2d502a | |||
| 5ed9e4cff3 | |||
| 0fbca2dcbd | |||
| 1da4771ecd | |||
| 7cc782cf18 | |||
| eff0437c87 | |||
| 6eaf98d1c5 | |||
| 739f2f2fd2 | |||
| 1fd0941818 | |||
| 12534c0398 | |||
| 67bf782dac | |||
| 62b06ba077 | |||
| b066056346 | |||
| 139c0cfa36 | |||
| 0d7f1ab5fe | |||
| 6f004aa444 | |||
| 6f18e3293c | |||
| b11373dc1f | |||
| 2d19e843bd | |||
| 00af1fcf09 | |||
| 01541411bb | |||
| a56d8adbf9 | |||
| d2a745498b | |||
| 13d2de5691 | |||
| f07f00bad4 | |||
| 851ffe6c62 | |||
| c7434cb02e | |||
| 62c15e6720 | |||
| a6c3e9365c | |||
| 241320ecf8 | |||
| 53fb10ad9f | |||
| 35a97e939a | |||
| 63a7f2a8f6 | |||
| ec1d464f81 | |||
| c0be4cb6f6 | |||
| 643d756f99 | |||
| f4bff59760 | |||
| 65b83952ab | |||
| f222e11317 | |||
| 0fb8ca5007 | |||
| b21cc8eee0 | |||
| 425b998ad1 | |||
| d6f09b3963 | |||
| 7b5e85c9c7 | |||
| 44155aff41 | |||
| 290a999fbc | |||
| ece7f03452 | |||
| f4c4fdfa0e | |||
| 1160f1b98d | |||
| ba6dce63e5 | |||
| f4ddea3723 | |||
| 32f0cf8c81 | |||
| 99f65cfbcd | |||
| b0f30bffcf | |||
| c8be580734 | |||
| 34fb66f3cb | |||
| a228d8d3e6 | |||
| 4a2db8bd77 | |||
| d5a8399923 | |||
| 06e5b89b3a | |||
| f1204f7694 | |||
| a0d6aa20e3 | |||
| 6771b17612 | |||
| c9845885f6 | |||
| 16ab1cf6fb | |||
| f8269d2587 | |||
| 5ec769b511 | |||
| aaffd20cda | |||
| 38e39f466b | |||
| e625432f33 | |||
| e19261507e | |||
| 92ebfbe654 |
+4
-1
@@ -36,6 +36,7 @@ validate_with_source_task:
|
||||
rm -rf chromium_download_cache
|
||||
mkdir chromium_download_cache
|
||||
# Attempt to download tarball
|
||||
./utils/downloads.py retrieve -i deps.ini -c chromium_download_cache &
|
||||
if ! ./utils/downloads.py retrieve -i downloads.ini -c chromium_download_cache ; then
|
||||
# If tarball is not available, attempt a clone
|
||||
./utils/clone.py -o chromium_src
|
||||
@@ -44,10 +45,12 @@ validate_with_source_task:
|
||||
tar cf chromium_download_cache/chromium-$(cat chromium_version.txt)-lite.tar.xz \
|
||||
--transform s/chromium_src/chromium-$(cat chromium_version.txt)/ chromium_src
|
||||
fi
|
||||
wait
|
||||
unpack_source_script: |
|
||||
if [ ! -d chromium_src ]; then
|
||||
./utils/downloads.py unpack -i downloads.ini -c chromium_download_cache chromium_src
|
||||
./utils/downloads.py unpack -i downloads.ini -c chromium_download_cache chromium_src
|
||||
fi
|
||||
./utils/downloads.py unpack -i deps.ini -c chromium_download_cache chromium_src
|
||||
validate_patches_script:
|
||||
- ./devutils/validate_patches.py -l chromium_src -v
|
||||
validate_lists_script:
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
*.patch linguist-language=C++
|
||||
@@ -0,0 +1 @@
|
||||
https://helium.computer/funding.json
|
||||
@@ -0,0 +1,77 @@
|
||||
name: Bug Report
|
||||
description: Report a bug building or running Helium
|
||||
labels: ["bug"]
|
||||
title: "[Bug]: "
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Before submitting this bug report, please search existing issues and make sure it's unique.
|
||||
If you ignore this text, and create this one, you will be permanently banned from
|
||||
interacting with the entire organization.
|
||||
|
||||
If you suspect your bug might be specific to a certain platform (e.g. macOS),
|
||||
please submit it to the relevant repository instead of the root "helium" repo.
|
||||
- type: dropdown
|
||||
id: os
|
||||
attributes:
|
||||
label: Operating system
|
||||
description: The OS you are running Helium on
|
||||
options:
|
||||
- macOS
|
||||
- Linux
|
||||
- Windows
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: Can be copied from helium://settings/help
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Have you tested that this is not an upstream issue or an issue with your configuration?
|
||||
options:
|
||||
- label: I have tried reproducing this issue in Chrome and it could not be reproduced there
|
||||
- label: I have tried reproducing this issue in ungoogled-chromium and it could not be reproduced there
|
||||
- label: I have tried reproducing this issue in Helium with a new and empty profile using `--user-data-dir` command line argument and it could not be reproduced there
|
||||
- type: input
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: A clear and concise description (in one line) of what the bug is.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: repro
|
||||
attributes:
|
||||
label: How to Reproduce?
|
||||
description: Steps to reproduce the behavior
|
||||
placeholder: |
|
||||
1. Go to '...'
|
||||
2. Click on '...'
|
||||
3. Scroll down to '...'
|
||||
4. See error
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: actual
|
||||
attributes:
|
||||
label: Actual behavior
|
||||
description: A clear and concise description of what actually happened
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected
|
||||
attributes:
|
||||
label: Expected behavior
|
||||
description: A clear and concise description of what you expected to happen
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: additional
|
||||
attributes:
|
||||
label: Additional context
|
||||
description: Add any other context about the problem here. If applicable, add screenshots to help explain your problem.
|
||||
@@ -0,0 +1 @@
|
||||
blank_issues_enabled: false
|
||||
@@ -0,0 +1,49 @@
|
||||
name: Feature request
|
||||
description: Suggest an idea
|
||||
labels: ["feat", "pending"]
|
||||
title: "[FR]: "
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Before submitting this request, please search existing issues and make sure it's unique.
|
||||
If you ignore this text, and create this one, you will be permanently banned from
|
||||
interacting with the entire organization.
|
||||
|
||||
Please do not use AI for writing your request's description, no one wishes
|
||||
to read that and thus your request will be closed.
|
||||
|
||||
If your request is for a platform-specific feature (e.g. for macOS), please
|
||||
submit it to the relevant platform repo instead of the generic "helium" repo.
|
||||
- type: input
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: A clear and concise description (in one line) of what your suggestion is
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Who's implementing?
|
||||
options:
|
||||
- label: I'm willing to implement this feature myself
|
||||
- type: textarea
|
||||
id: prob
|
||||
attributes:
|
||||
label: The problem
|
||||
description: Please describe the problem you are solving or new feature you're suggesting
|
||||
placeholder: I'm always frustrated when [...] happens
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: sol
|
||||
attributes:
|
||||
label: Possible solutions
|
||||
description: Please describe possible solution(-s) to your problem
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: additional
|
||||
attributes:
|
||||
label: Additional context
|
||||
description: Add any other context about the feature request here
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Blank issue
|
||||
about: Create a new issue from scratch
|
||||
---
|
||||
|
||||
For your issue to not get closed without review, please confirm that:
|
||||
|
||||
- [ ] This issue does not fit into any of the predefined categories, which is
|
||||
why I am making a blank issue from scratch.
|
||||
- [ ] I am not reporting a security vulnerability through this issue, because
|
||||
I am aware that there is an appropriate channel for that.
|
||||
- [x] I understand that I will be permanently banned from interacting with this
|
||||
organization if I lied by checking any of these checkboxes.
|
||||
|
||||
---
|
||||
|
||||
[your issue text goes here]
|
||||
@@ -0,0 +1,18 @@
|
||||
For your pull request to not get closed without review, please confirm that:
|
||||
|
||||
- [ ] An issue exists where the maintainers agreed that this should be implemented
|
||||
(an approved feature request, or confirmed bug).
|
||||
- [ ] I tested that my contribution works locally, and does not break anything,
|
||||
otherwise I have marked my PR as draft.
|
||||
- [ ] If my contribution is non-trivial, I did not use AI to write most of it.
|
||||
- [x] I understand that I will be permanently banned from interacting with this
|
||||
organization if I lied by checking any of these checkboxes.
|
||||
|
||||
Tested on (check one or more):
|
||||
- [ ] Windows
|
||||
- [ ] macOS
|
||||
- [ ] Linux
|
||||
|
||||
---
|
||||
|
||||
[short description of your PR goes here]
|
||||
@@ -13,6 +13,14 @@ runs:
|
||||
shell: bash
|
||||
run: sudo apt install quilt
|
||||
|
||||
- name: Clear disk space
|
||||
shell: bash
|
||||
run: |
|
||||
sudo rm -rf /usr/lib/jvm \
|
||||
/usr/lib/google-cloud-sdk \
|
||||
/usr/lib/dotnet \
|
||||
/usr/share/swift
|
||||
|
||||
- name: Bump revision and make PR
|
||||
shell: bash
|
||||
env:
|
||||
@@ -36,6 +44,7 @@ runs:
|
||||
|
||||
# get versions and compare them after submodule update
|
||||
version_before=$(get_version)
|
||||
export version_before
|
||||
|
||||
pushd "$HELIUM_DIR"
|
||||
git fetch origin main
|
||||
@@ -56,10 +65,11 @@ runs:
|
||||
fi
|
||||
|
||||
version_after=$(get_version)
|
||||
export version_after
|
||||
|
||||
mkdir -p build/{src,download_cache}
|
||||
|
||||
for file in "$HELIUM_DIR/downloads.ini" "$PLATFORM_DIR/downloads.ini"; do
|
||||
for file in "$HELIUM_DIR/downloads.ini" "$HELIUM_DIR/deps.ini" "$PLATFORM_DIR/downloads.ini"; do
|
||||
if ! [ -f "$file" ]; then continue; fi
|
||||
|
||||
run_upstream utils/downloads.py retrieve \
|
||||
@@ -81,11 +91,17 @@ runs:
|
||||
popd
|
||||
|
||||
# commit, push, make pr
|
||||
TITLE="update: helium-chromium $version_after"
|
||||
TITLE="update: helium $version_after"
|
||||
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git config user.name "helium-bot"
|
||||
git config user.email "helium-bot@imput.net"
|
||||
git add -u patches helium-chromium revision.txt
|
||||
|
||||
PLATFORM_HOOK="$PLATFORM_DIR/.github/bump-hook.sh"
|
||||
if [ -f "$PLATFORM_HOOK" ]; then
|
||||
"$PLATFORM_HOOK";
|
||||
fi
|
||||
|
||||
if ! git status | tail -1 | grep -q 'nothing to commit'; then
|
||||
git commit -m "$TITLE"
|
||||
git push origin update
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
name: New version check
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
|
||||
on:
|
||||
# enabling manual trigger
|
||||
workflow_dispatch:
|
||||
# running every hour
|
||||
schedule:
|
||||
- cron: '48 * * * *'
|
||||
|
||||
jobs:
|
||||
check:
|
||||
# do not run in forks
|
||||
if: github.repository == 'ungoogled-software/ungoogled-chromium'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set maintainer groups
|
||||
id: maintainers
|
||||
run: |
|
||||
echo "all=@networkException" >> $GITHUB_OUTPUT
|
||||
echo "linux=@rany2 @clickot @emilylange" >> $GITHUB_OUTPUT
|
||||
echo "windows=" >> $GITHUB_OUTPUT
|
||||
echo "macos=" >> $GITHUB_OUTPUT
|
||||
- name: Get the latest Chromium version
|
||||
id: latest-version
|
||||
run: |
|
||||
set -eo pipefail
|
||||
BASE_URL="https://versionhistory.googleapis.com/v1/chrome/platforms"
|
||||
END_URL="channels/stable/versions/all/releases?filter=endtime%3Dnone%2Cfraction%3E%3D0.5&order_by=version%20desc"
|
||||
JQ_FILTER='if .releases | select(type=="array") | length > 0 then .releases | first | .version else "null" end'
|
||||
for platform in linux win mac; do
|
||||
printf %s "${platform}_version=" >> $GITHUB_OUTPUT
|
||||
curl -sf "${BASE_URL}/${platform}/${END_URL}" | jq -re "${JQ_FILTER}" >> $GITHUB_OUTPUT
|
||||
done
|
||||
- uses: actions/checkout@v3
|
||||
- name: Create Issue for all platforms
|
||||
if: |
|
||||
contains(steps.latest-version.outputs.win_version, steps.latest-version.outputs.mac_version) &&
|
||||
contains(steps.latest-version.outputs.mac_version, steps.latest-version.outputs.linux_version) &&
|
||||
!contains(steps.latest-version.outputs.linux_version, 'null')
|
||||
uses: dblock/create-a-github-issue@v3
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
VERSION: ${{ steps.latest-version.outputs.linux_version }}
|
||||
PLATFORM: all platforms
|
||||
NOTIFY_MAINTAINERS: "${{ steps.maintainers.outputs.all }} ${{ steps.maintainers.outputs.linux }} ${{ steps.maintainers.outputs.windows }} ${{ steps.maintainers.outputs.macos }}"
|
||||
with:
|
||||
update_existing: false
|
||||
search_existing: all
|
||||
filename: .github/ISSUE_TEMPLATE/create-an--updating-to-chromium-x-x-x-x-.md
|
||||
- name: Create Issue for Linux
|
||||
if: |
|
||||
(
|
||||
!contains(steps.latest-version.outputs.win_version, steps.latest-version.outputs.mac_version) ||
|
||||
!contains(steps.latest-version.outputs.mac_version, steps.latest-version.outputs.linux_version)
|
||||
) && !contains(steps.latest-version.outputs.linux_version, 'null')
|
||||
uses: dblock/create-a-github-issue@v3
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
VERSION: ${{ steps.latest-version.outputs.linux_version }}
|
||||
PLATFORM: Linux
|
||||
NOTIFY_MAINTAINERS: "${{ steps.maintainers.outputs.all }} ${{ steps.maintainers.outputs.linux }}"
|
||||
with:
|
||||
update_existing: false
|
||||
search_existing: all
|
||||
filename: .github/ISSUE_TEMPLATE/create-an--updating-to-chromium-x-x-x-x-.md
|
||||
- name: Create Issue for macOS
|
||||
if: |
|
||||
(
|
||||
!contains(steps.latest-version.outputs.win_version, steps.latest-version.outputs.mac_version) ||
|
||||
!contains(steps.latest-version.outputs.mac_version, steps.latest-version.outputs.linux_version)
|
||||
) && !contains(steps.latest-version.outputs.mac_version, 'null')
|
||||
uses: dblock/create-a-github-issue@v3
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
VERSION: ${{ steps.latest-version.outputs.mac_version }}
|
||||
PLATFORM: macOS
|
||||
NOTIFY_MAINTAINERS: "${{ steps.maintainers.outputs.all }} ${{ steps.maintainers.outputs.macos }}"
|
||||
with:
|
||||
update_existing: false
|
||||
search_existing: all
|
||||
filename: .github/ISSUE_TEMPLATE/create-an--updating-to-chromium-x-x-x-x-.md
|
||||
- name: Create Issue for Windows
|
||||
if: |
|
||||
(
|
||||
!contains(steps.latest-version.outputs.win_version, steps.latest-version.outputs.mac_version) ||
|
||||
!contains(steps.latest-version.outputs.mac_version, steps.latest-version.outputs.linux_version)
|
||||
) && !contains(steps.latest-version.outputs.win_version, 'null')
|
||||
uses: dblock/create-a-github-issue@v3
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
VERSION: ${{ steps.latest-version.outputs.win_version }}
|
||||
PLATFORM: Windows
|
||||
NOTIFY_MAINTAINERS: "${{ steps.maintainers.outputs.all }} ${{ steps.maintainers.outputs.windows }}"
|
||||
with:
|
||||
update_existing: false
|
||||
search_existing: all
|
||||
filename: .github/ISSUE_TEMPLATE/create-an--updating-to-chromium-x-x-x-x-.md
|
||||
@@ -1,6 +1,6 @@
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2015-2023, The ungoogled-chromium Authors
|
||||
Copyright (c) 2015-2026, The ungoogled-chromium Authors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -1,20 +1,47 @@
|
||||
# Helium
|
||||
Bullshit-free web browser, based on Chromium. Follows [imput](https://github.com/imputnet)'s ethics and norms.
|
||||
<div align="center">
|
||||
<br/>
|
||||
<p>
|
||||
<img src="resources/branding/app_icon/raw.png"
|
||||
title="Helium" alt="Helium logo" width="120" />
|
||||
<h1>Helium</h1>
|
||||
</p>
|
||||
<p width="120">
|
||||
The Chromium-based web browser made for people, with love.
|
||||
<br>
|
||||
Best privacy by default, unbiased ad-blocking, no bloat and no noise.
|
||||
</p>
|
||||
<a href="https://helium.computer/">
|
||||
helium.computer
|
||||
</a>
|
||||
<br/>
|
||||
</div>
|
||||
|
||||
First and foremost, we're making a good browser for ourselves.
|
||||
We don't intend to reinvent the wheel or target everyone, it isn't Helium's goal.
|
||||
The main goal is to provide an honest, comfortable, privacy-respecting, and non-invasive experience.
|
||||
If you don't like it - you don't like it, that's totally okay, and we don't care.
|
||||
## Downloads
|
||||
> [!NOTE]
|
||||
> Helium is still in beta, so unexpected issues may occur. We are not responsible
|
||||
for any damage caused by usage of beta software.
|
||||
|
||||
There's a lot more to Helium, but we don't have a complete set of features yet.
|
||||
We'll update the documentation when we're closer to a public release!
|
||||
Best way to download Helium is to open [helium.computer](https://helium.computer/) on your computer.
|
||||
It'll pick the right build for your OS and architecture automatically.
|
||||
|
||||
## Platform-specific packaging
|
||||
At the moment, only [Helium for macOS](https://github.com/imputnet/helium-macos) is polished and ready for daily use.
|
||||
If you wish to download builds "straight from the tap" with all options in one place,
|
||||
you can do it on GitHub in the Releases section in each platform's repo:
|
||||
- [macOS](https://github.com/imputnet/helium-macos/releases/latest)
|
||||
- [Linux](https://github.com/imputnet/helium-linux/releases/latest) (AppImage)
|
||||
- [Windows](https://github.com/imputnet/helium-windows/releases/latest) (no auto-updates yet)
|
||||
|
||||
We also have packaging for Linux and Windows, but both of them are WIP:
|
||||
- [Helium for Linux](https://github.com/imputnet/helium-linux) (AppImage)
|
||||
- [Helium for Windows](https://github.com/imputnet/helium-windows) (no auto-updates yet)
|
||||
## Platform packaging
|
||||
Helium is available on all major desktop platforms, with entirety of source code
|
||||
for all of them published here:
|
||||
- [Helium for macOS](https://github.com/imputnet/helium-macos)
|
||||
- [Helium for Linux](https://github.com/imputnet/helium-linux)
|
||||
- [Helium for Windows](https://github.com/imputnet/helium-windows)
|
||||
|
||||
## Other Helium repos
|
||||
Along with the main repo and platform packaging, these projects are also a part of Helium:
|
||||
- [Helium services](https://github.com/imputnet/helium-services)
|
||||
- [Helium onboarding](https://github.com/imputnet/helium-onboarding) (the onboarding page seen in Helium at `helium://setup`)
|
||||
- [uBlock Origin packaging](https://github.com/imputnet/ublock-origin-crx)
|
||||
|
||||
## Credits
|
||||
### ungoogled-chromium
|
||||
@@ -41,3 +68,8 @@ repositories is licensed under GPL-3.0. See [LICENSE](LICENSE).
|
||||
Any content imported from other projects retains its original license (for
|
||||
example, any original unmodified code imported from ungoogled-chromium remains
|
||||
licensed under their [BSD 3-Clause license](LICENSE.ungoogled_chromium)).
|
||||
|
||||
## More documentation (soon)
|
||||
> [!NOTE]
|
||||
> We will add more documentation along with design and motivation guidelines in the future.
|
||||
All docs will be linked here along with other related content.
|
||||
|
||||
@@ -1 +1 @@
|
||||
140.0.7339.132
|
||||
146.0.7680.71
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# Everything that's downloaded after cloning Chromium goes here.
|
||||
# It will not work from main downloads.ini
|
||||
[search_engines_data]
|
||||
url = https://gist.githubusercontent.com/wukko/2a591364dda346e10219e4adabd568b1/raw/e75ae3c4a1ce940ef7627916a48bc40882d24d40/nonfree-search-engines-data.tar.gz
|
||||
download_filename = nonfree-search-engines-data.tar.gz
|
||||
sha256 = 00a87050fa3f941d04d67fb5763991e0b8ea399a88b505ab0e56dd263f06864c
|
||||
output_path = ./third_party/search_engines_data/resources_internal
|
||||
|
||||
[onboarding]
|
||||
version = 202603080703
|
||||
url = https://github.com/imputnet/helium-onboarding/releases/download/%(version)s/helium-onboarding-%(version)s.tar.gz
|
||||
download_filename = onboarding-page-%(version)s.tar.gz
|
||||
sha256 = 6883e90d7bdca572a37fa584dbc60504d5f2072a399daf58cdc3d1c9764eb508
|
||||
output_path = ./components/helium_onboarding
|
||||
|
||||
# If you are bumping this, you *NEED* to re-strip the assets.json
|
||||
# file *every time* by using `devutils/clear-ublock-assets.js`.
|
||||
[ublock_origin]
|
||||
version = 1.70.0
|
||||
url = https://github.com/imputnet/uBlock/releases/download/%(version)s/uBlock0_%(version)s.chromium.zip
|
||||
sha256 = d36ad2515c8dac907d17ae56d015c91c97fe27980fca1dc7575d0dfdba68e0d4
|
||||
download_filename = ublock-origin-%(version)s.zip
|
||||
output_path = third_party/ublock
|
||||
strip_leading_dirs = uBlock0.chromium
|
||||
+29
-7
@@ -5,7 +5,7 @@
|
||||
|
||||
from third_party import unidiff
|
||||
|
||||
LICENSE_HEADER_IGNORES = ["html", "license", "readme"]
|
||||
LICENSE_HEADER_IGNORES = ["html", "license", "readme", "deps"]
|
||||
|
||||
patches_dir = None
|
||||
series = None
|
||||
@@ -16,6 +16,10 @@ def _read_text(path):
|
||||
return filter(str, f.read().splitlines())
|
||||
|
||||
|
||||
def _read_patch(path):
|
||||
return unidiff.PatchSet('\n'.join(_read_text(path)))
|
||||
|
||||
|
||||
def _init(root):
|
||||
global patches_dir
|
||||
global series
|
||||
@@ -59,8 +63,7 @@ def c_all_new_files_have_license_header():
|
||||
if 'helium' not in patch:
|
||||
continue
|
||||
|
||||
patch_set = unidiff.PatchSet('\n'.join(_read_text(patch)))
|
||||
added_files = filter(lambda f: f.is_added_file, patch_set)
|
||||
added_files = filter(lambda f: f.is_added_file, _read_patch(patch))
|
||||
|
||||
for file in added_files:
|
||||
if any(p in file.path.lower() for p in LICENSE_HEADER_IGNORES):
|
||||
@@ -75,8 +78,8 @@ def c_all_new_headers_have_correct_guard():
|
||||
if 'helium' not in patch:
|
||||
continue
|
||||
|
||||
patch_set = unidiff.PatchSet('\n'.join(_read_text(patch)))
|
||||
added_files = filter(lambda f: f.is_added_file and f.path.endswith('.h'), patch_set)
|
||||
added_files = filter(lambda f: f.is_added_file and f.path.endswith('.h'),
|
||||
_read_patch(patch))
|
||||
|
||||
for file in added_files:
|
||||
expected_macro_name = file.path.upper() \
|
||||
@@ -98,11 +101,11 @@ def c_all_new_headers_have_correct_guard():
|
||||
for _line in file[0]:
|
||||
line = str(_line)
|
||||
|
||||
if '#ifndef' in line:
|
||||
if expected["ifndef"] in line:
|
||||
assert found["define"] is None
|
||||
assert found["ifndef"] is None
|
||||
found["ifndef"] = line
|
||||
elif '#define' in line:
|
||||
elif expected["define"] in line:
|
||||
assert found["ifndef"] is not None
|
||||
assert found["define"] is None
|
||||
found["define"] = line
|
||||
@@ -112,3 +115,22 @@ def c_all_new_headers_have_correct_guard():
|
||||
assert value == f"+{expected[macro_type]}\n", \
|
||||
f"Patch {patch} has unexpected {macro_type} in {file.path}:" \
|
||||
f"{value_print}, expecting: {expected[macro_type]}"
|
||||
|
||||
|
||||
def d_no_whitespace_only_changes():
|
||||
for patch in series:
|
||||
if 'helium' not in patch:
|
||||
continue
|
||||
|
||||
for file in _read_patch(patch):
|
||||
for hunk in file:
|
||||
seen_nonws = False
|
||||
for line in hunk:
|
||||
line = str(line)
|
||||
|
||||
if line.startswith('+') or line.startswith('-'):
|
||||
seen_nonws = seen_nonws or len(line.rstrip()) > 1
|
||||
|
||||
assert seen_nonws, \
|
||||
f"Patch {patch} contains hunk consisting of "\
|
||||
f"only whitespace characters in {file.path}: {hunk}"
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
// Copyright 2025 The Helium Authors
|
||||
// You can use, redistribute, and/or modify this source code under
|
||||
// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
|
||||
// Program for updating the assets.json file in uB0 to disable all
|
||||
// outgoing connections before the user is able to consent to them.
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
const err = () => {
|
||||
console.error('usage: node clear-ublock-assets <path to uB0 assets.json');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const assets_path = process.argv[2] || err();
|
||||
|
||||
const stripURLs = (c) =>
|
||||
[c].flat().filter(s => !URL.canParse(s));
|
||||
|
||||
const breakKey = (obj, key_) => {
|
||||
const keys = Object.keys(obj);
|
||||
const idx = keys.indexOf(key_);
|
||||
|
||||
if (idx === -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let key of keys.splice(idx)) {
|
||||
const val = obj[key];
|
||||
delete obj[key];
|
||||
|
||||
if (key === key_) {
|
||||
key = `^${key}`;
|
||||
}
|
||||
|
||||
obj[key] = val;
|
||||
}
|
||||
}
|
||||
|
||||
const clear = obj => {
|
||||
for (const filter of Object.values(obj)) {
|
||||
if (filter.off) {
|
||||
continue;
|
||||
}
|
||||
|
||||
filter.contentURL = stripURLs(filter.contentURL);
|
||||
breakKey(filter, 'cdnURLs');
|
||||
breakKey(filter, 'patchURLs');
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
fs.writeFileSync(
|
||||
assets_path,
|
||||
JSON.stringify(clear(
|
||||
JSON.parse(fs.readFileSync(
|
||||
assets_path
|
||||
))
|
||||
), null, '\t') + '\n'
|
||||
);
|
||||
@@ -11,8 +11,8 @@ set -gx QUILT_PATCHES "$REPO_ROOT/patches"
|
||||
set -gx QUILT_PUSH_ARGS "--color=auto"
|
||||
set -gx QUILT_DIFF_OPTS "--show-c-function"
|
||||
set -gx QUILT_PATCH_OPTS "--unified --reject-format=unified"
|
||||
set -gx QUILT_DIFF_ARGS "-p ab --no-timestamps --no-index --color=auto --sort"
|
||||
set -gx QUILT_REFRESH_ARGS "-p ab --no-timestamps --no-index --sort --strip-trailing-whitespace"
|
||||
set -gx QUILT_DIFF_ARGS "-p ab --no-timestamps --no-index --color=auto"
|
||||
set -gx QUILT_REFRESH_ARGS "-p ab --no-timestamps --no-index --strip-trailing-whitespace"
|
||||
set -gx QUILT_COLORS "diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
|
||||
set -gx QUILT_SERIES_ARGS "--color=auto"
|
||||
set -gx QUILT_PATCHES_ARGS "--color=auto"
|
||||
|
||||
@@ -17,8 +17,8 @@ export QUILT_PATCHES="$REPO_ROOT/patches"
|
||||
export QUILT_PUSH_ARGS="--color=auto"
|
||||
export QUILT_DIFF_OPTS="--show-c-function"
|
||||
export QUILT_PATCH_OPTS="--unified --reject-format=unified"
|
||||
export QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto --sort"
|
||||
export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index --sort --strip-trailing-whitespace"
|
||||
export QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto"
|
||||
export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index --strip-trailing-whitespace"
|
||||
export QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
|
||||
export QUILT_SERIES_ARGS="--color=auto"
|
||||
export QUILT_PATCHES_ARGS="--color=auto"
|
||||
|
||||
@@ -66,12 +66,11 @@ PRUNING_EXCLUDE_PATTERNS = [
|
||||
'third_party/icu/android/icudtl.dat',
|
||||
'third_party/icu/common/icudtb.dat',
|
||||
# Exclusion for rollup v4.0+
|
||||
'third_party/devtools-frontend/src/node_modules/@rollup/wasm-node/dist/wasm-node/bindings_wasm_bg.wasm',
|
||||
'third_party/node/node_modules/@rollup/wasm-node/dist/wasm-node/bindings_wasm_bg.wasm',
|
||||
# Exclusion for performance tracing
|
||||
'third_party/perfetto/src/trace_processor/importers/proto/atoms.descriptor',
|
||||
# Exclusion for jiff
|
||||
'third_party/rust/chromium_crates_io/vendor/jiff-tzdb-v0_1/concatenated-zoneinfo.dat',
|
||||
# Exclusion for zoneinfo64
|
||||
'third_party/rust/chromium_crates_io/vendor/zoneinfo64-v0_2/src/data/zoneinfo64.res',
|
||||
# Exclusions for safe file extensions
|
||||
'*.avif',
|
||||
'*.ttf',
|
||||
@@ -105,6 +104,7 @@ PRUNING_EXCLUDE_PATTERNS = [
|
||||
'*.js',
|
||||
'*.json',
|
||||
'*.txt',
|
||||
'*.binarypb',
|
||||
'*.xtb'
|
||||
]
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2025 The Helium Authors
|
||||
# You can use, redistribute, and/or modify this source code under
|
||||
# the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
|
||||
# Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE.ungoogled_chromium file.
|
||||
@@ -67,19 +63,19 @@ def _dir_empty(path):
|
||||
return False
|
||||
|
||||
|
||||
def _rename_files_with_dirs(root_dir, sorted_file_iter):
|
||||
def _rename_files_with_dirs(root_dir, source_dir, sorted_file_iter):
|
||||
'''
|
||||
Moves a list of sorted files back to the upstream repo, removing empty directories along the way
|
||||
Moves a list of sorted files back to their original location,
|
||||
removing empty directories along the way
|
||||
'''
|
||||
past_parent = None
|
||||
upstream_path = Path(os.path.dirname(os.path.realpath(__file__))) / '../patches'
|
||||
for partial_path in sorted_file_iter:
|
||||
complete_path = Path(root_dir, partial_path)
|
||||
complete_upstream_path = Path(upstream_path, partial_path)
|
||||
complete_source_path = Path(source_dir, partial_path)
|
||||
try:
|
||||
complete_path.rename(complete_upstream_path)
|
||||
complete_path.rename(complete_source_path)
|
||||
except FileNotFoundError:
|
||||
get_logger().warning('Could not remove prepended patch: %s', complete_path)
|
||||
get_logger().warning('Could not move prepended patch: %s', complete_path)
|
||||
if past_parent != complete_path.parent:
|
||||
while past_parent and _dir_empty(past_parent):
|
||||
past_parent.rmdir()
|
||||
@@ -91,7 +87,7 @@ def _rename_files_with_dirs(root_dir, sorted_file_iter):
|
||||
complete_path = complete_path.parent
|
||||
|
||||
|
||||
def unmerge_platform_patches(platform_patches_dir):
|
||||
def unmerge_platform_patches(platform_patches_dir, prepend_patches_dir):
|
||||
'''
|
||||
Undo merge_platform_patches(), adding any new patches from series.merged as necessary
|
||||
|
||||
@@ -105,8 +101,8 @@ def unmerge_platform_patches(platform_patches_dir):
|
||||
filter(len,
|
||||
(platform_patches_dir / _SERIES_PREPEND).read_text(encoding=ENCODING).splitlines()))
|
||||
|
||||
# Move prepended files to original location, preserving changes, and clean up
|
||||
_rename_files_with_dirs(platform_patches_dir, sorted(prepend_series))
|
||||
# Move prepended files back to original location, preserving changes
|
||||
_rename_files_with_dirs(platform_patches_dir, prepend_patches_dir, sorted(prepend_series))
|
||||
|
||||
# Determine positions of blank spaces in series.orig
|
||||
if not (platform_patches_dir / _SERIES_ORIG).exists():
|
||||
@@ -175,10 +171,11 @@ def main():
|
||||
repo_dir = Path(__file__).resolve().parent.parent
|
||||
|
||||
success = False
|
||||
prepend_patches_dir = repo_dir / 'patches'
|
||||
if args.command == 'merge':
|
||||
success = merge_platform_patches(args.platform_patches, repo_dir / 'patches')
|
||||
success = merge_platform_patches(args.platform_patches, prepend_patches_dir)
|
||||
elif args.command == 'unmerge':
|
||||
success = unmerge_platform_patches(args.platform_patches)
|
||||
success = unmerge_platform_patches(args.platform_patches, prepend_patches_dir)
|
||||
else:
|
||||
raise NotImplementedError(args.command)
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ class _NotInRepoError(RuntimeError):
|
||||
|
||||
class _DepsNodeVisitor(ast.NodeVisitor):
|
||||
_valid_syntax_types = (ast.mod, ast.expr_context, ast.boolop, ast.Assign, ast.Add, ast.Name,
|
||||
ast.Dict, ast.Str, ast.NameConstant, ast.List, ast.BinOp)
|
||||
ast.Dict, ast.Constant, ast.List, ast.BinOp)
|
||||
_allowed_callables = ('Var', )
|
||||
|
||||
def visit_Call(self, node): #pylint: disable=invalid-name
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ fonts(\\*?)\.googleapis(\\*?)\.com#f0ntz\g<1>.9oo91e8p1\g<2>.qjz9zk
|
||||
google([A-Za-z\-]*?\\*?)\.com(?!mon)#9oo91e\g<1>.qjz9zk
|
||||
gstatic([A-Za-z\-]*?\\*?)\.com#95tat1c\g<1>.qjz9zk
|
||||
chrome([A-Za-z\-]*?\\*?)\.com(?!ponent)#ch40me\g<1>.qjz9zk
|
||||
chromium([A-Za-z\-]*?\\*?)\.org#ch40m1um\g<1>.qjz9zk
|
||||
chromium(?!app)([A-Za-z\-]*?\\*?)\.org#ch40m1um\g<1>.qjz9zk
|
||||
mozilla([A-Za-z\-]*?\\*?)\.org#m0z111a\g<1>.qjz9zk
|
||||
facebook([A-Za-z\-]*?\\*?)\.com#f8c3b00k\g<1>.qjz9zk
|
||||
appspot([A-Za-z\-]*?\\*?)\.com#8pp2p8t\g<1>.qjz9zk
|
||||
|
||||
+2300
-665
File diff suppressed because it is too large
Load Diff
@@ -6,16 +6,3 @@ download_filename = chromium-%(_chromium_version)s-lite.tar.xz
|
||||
hash_url = chromium|chromium-%(_chromium_version)s-lite.tar.xz.hashes|https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%(_chromium_version)s-lite.tar.xz.hashes
|
||||
output_path = ./
|
||||
strip_leading_dirs = chromium-%(_chromium_version)s
|
||||
|
||||
[search_engines_data]
|
||||
url = https://gist.githubusercontent.com/wukko/2a591364dda346e10219e4adabd568b1/raw/e75ae3c4a1ce940ef7627916a48bc40882d24d40/nonfree-search-engines-data.tar.gz
|
||||
download_filename = nonfree-search-engines-data.tar.gz
|
||||
sha256 = 00a87050fa3f941d04d67fb5763991e0b8ea399a88b505ab0e56dd263f06864c
|
||||
output_path = ./third_party/search_engines_data/resources_internal
|
||||
|
||||
[onboarding]
|
||||
version = 202509121547
|
||||
url = https://github.com/imputnet/helium-onboarding/releases/download/%(version)s/helium-onboarding-%(version)s.tar.gz
|
||||
download_filename = onboarding-page-%(version)s.tar.gz
|
||||
sha256 = 4b44ba5d434f1925bc45ed2eb966d8d00398513bf56ff3598ea39335a6d9af9c
|
||||
output_path = ./components/helium_onboarding
|
||||
|
||||
+43
-40
@@ -48,7 +48,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+namespace {
|
||||
+void AddChromeToProfiles(
|
||||
+ std::vector<user_data_importer::SourceProfile>* profiles,
|
||||
+ base::Value::List chrome_profiles,
|
||||
+ base::ListValue chrome_profiles,
|
||||
+ const base::FilePath& user_data_folder,
|
||||
+ const std::string& brand,
|
||||
+ user_data_importer::ImporterType type) {
|
||||
@@ -189,7 +189,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+} // namespace
|
||||
--- /dev/null
|
||||
+++ b/chrome/common/importer/chrome_importer_utils.cc
|
||||
@@ -0,0 +1,241 @@
|
||||
@@ -0,0 +1,243 @@
|
||||
+/* Copyright (c) 2019 The Brave Authors, 2025 imput. All rights reserved.
|
||||
+ * This Source Code Form is subject to the terms of the Mozilla Public
|
||||
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
@@ -226,7 +226,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+namespace {
|
||||
+#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
+
|
||||
+std::optional<base::Value::Dict> GetChromeExtensionsListFromFile(
|
||||
+std::optional<base::DictValue> GetChromeExtensionsListFromFile(
|
||||
+ const base::FilePath& preference_path) {
|
||||
+ if (!base::PathExists(preference_path))
|
||||
+ return std::nullopt;
|
||||
@@ -234,8 +234,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ std::string preference_content;
|
||||
+ base::ReadFileToString(preference_path, &preference_content);
|
||||
+
|
||||
+ std::optional<base::Value::Dict> preference =
|
||||
+ base::JSONReader::ReadDict(preference_content);
|
||||
+ std::optional<base::DictValue> preference =
|
||||
+ base::JSONReader::ReadDict(preference_content,
|
||||
+ base::JSON_PARSE_CHROMIUM_EXTENSIONS);
|
||||
+ if (!preference) {
|
||||
+ return std::nullopt;
|
||||
+ }
|
||||
@@ -251,13 +252,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+}
|
||||
+
|
||||
+std::vector<std::string> GetImportableListFromChromeExtensionsList(
|
||||
+ const base::Value::Dict& extensions_list) {
|
||||
+ const base::DictValue& extensions_list) {
|
||||
+ std::vector<std::string> extensions;
|
||||
+ for (const auto [key, value] : extensions_list) {
|
||||
+ if (!value.is_dict()) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ const base::Value::Dict& dict = value.GetDict();
|
||||
+ const base::DictValue& dict = value.GetDict();
|
||||
+ // Only import if type is extension, it's came from webstore and it's not
|
||||
+ // installed by default.
|
||||
+ if (dict.FindBool("was_installed_by_default").value_or(true))
|
||||
@@ -291,7 +292,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ return extensions;
|
||||
+}
|
||||
+
|
||||
+std::optional<base::Value::Dict> GetChromeExtensionsList(
|
||||
+std::optional<base::DictValue> GetChromeExtensionsList(
|
||||
+ const base::FilePath& profile_path) {
|
||||
+ auto list_from_secure_preference = GetChromeExtensionsListFromFile(
|
||||
+ profile_path.AppendASCII(kChromeSecurePreferencesFile));
|
||||
@@ -313,7 +314,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+#endif
|
||||
+
|
||||
+bool IsLastActiveProfile(const std::string& profile,
|
||||
+ const base::Value::List& last_active_profiles) {
|
||||
+ const base::ListValue& last_active_profiles) {
|
||||
+ for (const auto& it : last_active_profiles) {
|
||||
+ if (it.GetString() == profile) {
|
||||
+ return true;
|
||||
@@ -328,14 +329,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
+base::Value::List GetChromeSourceProfiles(
|
||||
+base::ListValue GetChromeSourceProfiles(
|
||||
+ const base::FilePath& local_state_path) {
|
||||
+ base::Value::List profiles;
|
||||
+ base::ListValue profiles;
|
||||
+ if (base::PathExists(local_state_path)) {
|
||||
+ std::string local_state_content;
|
||||
+ base::ReadFileToString(local_state_path, &local_state_content);
|
||||
+ std::optional<base::Value::Dict> local_state_dict =
|
||||
+ base::JSONReader::ReadDict(local_state_content);
|
||||
+ std::optional<base::DictValue> local_state_dict =
|
||||
+ base::JSONReader::ReadDict(local_state_content,
|
||||
+ base::JSON_PARSE_CHROMIUM_EXTENSIONS);
|
||||
+ if (!local_state_dict)
|
||||
+ return profiles;
|
||||
+
|
||||
@@ -355,7 +357,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ if (!name) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ base::Value::Dict entry;
|
||||
+ base::DictValue entry;
|
||||
+ entry.Set("id", value.first);
|
||||
+ entry.Set("name", *name);
|
||||
+ if (last_active_profiles)
|
||||
@@ -376,7 +378,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ }
|
||||
+ }
|
||||
+ if (profiles.empty()) {
|
||||
+ base::Value::Dict entry;
|
||||
+ base::DictValue entry;
|
||||
+ entry.Set("id", "");
|
||||
+ entry.Set("name", "Default");
|
||||
+ profiles.Append(std::move(entry));
|
||||
@@ -489,7 +491,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+#if BUILDFLAG(IS_LINUX)
|
||||
+base::FilePath GetOperaSnapUserDataFolder();
|
||||
+#endif
|
||||
+base::Value::List GetChromeSourceProfiles(const base::FilePath& local_state);
|
||||
+base::ListValue GetChromeSourceProfiles(const base::FilePath& local_state);
|
||||
+bool ChromeImporterCanImport(const base::FilePath& profile,
|
||||
+ user_data_importer::ImporterType type,
|
||||
+ uint16_t* services_supported);
|
||||
@@ -1092,7 +1094,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+void BraveImportDataHandler::NotifyImportProgress(
|
||||
+ const user_data_importer::SourceProfile& source_profile,
|
||||
+ const base::Value::Dict& info) {
|
||||
+ const base::DictValue& info) {
|
||||
+ const std::string* event = info.FindString("event");
|
||||
+ if (!event) {
|
||||
+ return;
|
||||
@@ -1106,7 +1108,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void BraveImportDataHandler::HandleImportData(const base::Value::List& args) {
|
||||
+void BraveImportDataHandler::HandleImportData(const base::ListValue& args) {
|
||||
+ ImportDataHandler::HandleImportData(args);
|
||||
+}
|
||||
+
|
||||
@@ -1243,7 +1245,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+ const user_data_importer::SourceProfile& GetSourceProfileAt(
|
||||
+ int browser_index);
|
||||
+ void HandleImportData(const base::Value::List& args);
|
||||
+ void HandleImportData(const base::ListValue& args);
|
||||
+ // ImportDataHandler overrides:
|
||||
+ void StartImport(const user_data_importer::SourceProfile& source_profile,
|
||||
+ uint16_t imported_items) override;
|
||||
@@ -1253,7 +1255,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ Profile* profile);
|
||||
+ virtual void NotifyImportProgress(
|
||||
+ const user_data_importer::SourceProfile& source_profile,
|
||||
+ const base::Value::Dict& info);
|
||||
+ const base::DictValue& info);
|
||||
+ virtual void OnImportEnded(
|
||||
+ const user_data_importer::SourceProfile& source_profile);
|
||||
+
|
||||
@@ -1322,7 +1324,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ if (import_started_called_)
|
||||
+ return;
|
||||
+ import_started_called_ = true;
|
||||
+ base::Value::Dict data;
|
||||
+ base::DictValue data;
|
||||
+ data.Set("importer_name", source_profile_.importer_name);
|
||||
+ data.Set("importer_type", source_profile_.importer_type);
|
||||
+ data.Set("items_to_import", imported_items_);
|
||||
@@ -1332,7 +1334,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+void BraveImporterObserver::ImportItemStarted(
|
||||
+ user_data_importer::ImportItem item) {
|
||||
+ base::Value::Dict data;
|
||||
+ base::DictValue data;
|
||||
+ data.Set("importer_name", source_profile_.importer_name);
|
||||
+ data.Set("importer_type", source_profile_.importer_type);
|
||||
+ data.Set("items_to_import", imported_items_);
|
||||
@@ -1343,7 +1345,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+void BraveImporterObserver::ImportItemEnded(
|
||||
+ user_data_importer::ImportItem item) {
|
||||
+ base::Value::Dict data;
|
||||
+ base::DictValue data;
|
||||
+ data.Set("importer_name", source_profile_.importer_name);
|
||||
+ data.Set("importer_type", source_profile_.importer_type);
|
||||
+ data.Set("items_to_import", imported_items_);
|
||||
@@ -1353,7 +1355,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+}
|
||||
+
|
||||
+void BraveImporterObserver::ImportEnded() {
|
||||
+ base::Value::Dict data;
|
||||
+ base::DictValue data;
|
||||
+ data.Set("importer_name", source_profile_.importer_name);
|
||||
+ data.Set("importer_type", source_profile_.importer_type);
|
||||
+ data.Set("items_to_import", imported_items_);
|
||||
@@ -1395,7 +1397,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ public:
|
||||
+ using ReportProgressCallback = base::RepeatingCallback<void(
|
||||
+ const user_data_importer::SourceProfile& source_profile,
|
||||
+ const base::Value::Dict&)>;
|
||||
+ const base::DictValue&)>;
|
||||
+
|
||||
+ BraveImporterObserver(ExternalProcessImporterHost* host,
|
||||
+ const user_data_importer::SourceProfile& source_profile,
|
||||
@@ -2733,7 +2735,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+#endif // BRAVE_UTILITY_IMPORTER_BRAVE_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_
|
||||
--- /dev/null
|
||||
+++ b/chrome/utility/importer/chrome_importer.cc
|
||||
@@ -0,0 +1,435 @@
|
||||
@@ -0,0 +1,436 @@
|
||||
+/* Copyright (c) 2019 The Brave Authors. All rights reserved.
|
||||
+ * This Source Code Form is subject to the terms of the Mozilla Public
|
||||
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
@@ -2821,8 +2823,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ const base::FilePath& local_state_path) {
|
||||
+ std::string local_state_content;
|
||||
+ base::ReadFileToString(local_state_path, &local_state_content);
|
||||
+ std::optional<base::Value::Dict> local_state =
|
||||
+ base::JSONReader::ReadDict(local_state_content);
|
||||
+ std::optional<base::DictValue> local_state =
|
||||
+ base::JSONReader::ReadDict(local_state_content,
|
||||
+ base::JSON_PARSE_CHROMIUM_EXTENSIONS);
|
||||
+ if (!local_state) {
|
||||
+ return false;
|
||||
+ }
|
||||
@@ -3005,16 +3008,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+
|
||||
+ base::ReadFileToString(copy_bookmark_file.copied_file_path(),
|
||||
+ &bookmarks_content);
|
||||
+ std::optional<base::Value::Dict> bookmark_dict =
|
||||
+ base::JSONReader::ReadDict(bookmarks_content);
|
||||
+ std::optional<base::DictValue> bookmark_dict =
|
||||
+ base::JSONReader::ReadDict(bookmarks_content,
|
||||
+ base::JSON_PARSE_CHROMIUM_EXTENSIONS);
|
||||
+ if (!bookmark_dict)
|
||||
+ return;
|
||||
+
|
||||
+ std::vector<user_data_importer::ImportedBookmarkEntry> bookmarks;
|
||||
+ const base::Value::Dict* roots = bookmark_dict->FindDict("roots");
|
||||
+ const base::DictValue* roots = bookmark_dict->FindDict("roots");
|
||||
+ if (roots) {
|
||||
+ // Importing bookmark bar items
|
||||
+ const base::Value::Dict* bookmark_bar = roots->FindDict("bookmark_bar");
|
||||
+ const base::DictValue* bookmark_bar = roots->FindDict("bookmark_bar");
|
||||
+ if (bookmark_bar) {
|
||||
+ std::vector<std::u16string> path;
|
||||
+ const auto* name = bookmark_bar->FindString("name");
|
||||
@@ -3023,7 +3027,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ RecursiveReadBookmarksFolder(bookmark_bar, path, true, &bookmarks);
|
||||
+ }
|
||||
+ // Importing other items
|
||||
+ const base::Value::Dict* other = roots->FindDict("other");
|
||||
+ const base::DictValue* other = roots->FindDict("other");
|
||||
+ if (other) {
|
||||
+ std::vector<std::u16string> path;
|
||||
+ const auto* name = other->FindString("name");
|
||||
@@ -3099,8 +3103,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ if (!usage.favicon_url.is_valid())
|
||||
+ continue; // Don't bother importing favicons with invalid URLs.
|
||||
+
|
||||
+ std::vector<uint8_t> data;
|
||||
+ s.ColumnBlobAsVector(1, &data);
|
||||
+ std::vector<uint8_t> data = s.ColumnBlobAsVector(1);
|
||||
+ if (data.empty())
|
||||
+ continue; // Data definitely invalid.
|
||||
+
|
||||
@@ -3118,14 +3121,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+}
|
||||
+
|
||||
+void ChromeImporter::RecursiveReadBookmarksFolder(
|
||||
+ const base::Value::Dict* folder,
|
||||
+ const base::DictValue* folder,
|
||||
+ const std::vector<std::u16string>& parent_path,
|
||||
+ bool is_in_toolbar,
|
||||
+ std::vector<user_data_importer::ImportedBookmarkEntry>* bookmarks) {
|
||||
+ const base::Value::List* children = folder->FindList("children");
|
||||
+ const base::ListValue* children = folder->FindList("children");
|
||||
+ if (children) {
|
||||
+ for (const auto& value : *children) {
|
||||
+ const base::Value::Dict* dict = value.GetIfDict();
|
||||
+ const base::DictValue* dict = value.GetIfDict();
|
||||
+ if (!dict)
|
||||
+ continue;
|
||||
+ const auto* date_added = dict->FindString("date_added");
|
||||
@@ -3137,7 +3140,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ if (type && *type == "folder") {
|
||||
+ // Folders are added implicitly on adding children, so we only
|
||||
+ // explicitly add empty folders.
|
||||
+ const base::Value::List* inner_children = dict->FindList("children");
|
||||
+ const base::ListValue* inner_children = dict->FindList("children");
|
||||
+ if (inner_children && inner_children->empty()) {
|
||||
+ entry.in_toolbar = is_in_toolbar;
|
||||
+ entry.is_folder = true;
|
||||
@@ -3239,7 +3242,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+ favicon_base::FaviconUsageDataList* favicons);
|
||||
+
|
||||
+ void RecursiveReadBookmarksFolder(
|
||||
+ const base::Value::Dict* folder,
|
||||
+ const base::DictValue* folder,
|
||||
+ const std::vector<std::u16string>& parent_path,
|
||||
+ bool is_in_toolbar,
|
||||
+ std::vector<user_data_importer::ImportedBookmarkEntry>* bookmarks);
|
||||
@@ -177,10 +177,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
} // namespace user_data_importer
|
||||
--- a/tools/metrics/histograms/metadata/sql/histograms.xml
|
||||
+++ b/tools/metrics/histograms/metadata/sql/histograms.xml
|
||||
@@ -39,6 +39,7 @@ chromium-metrics-reviews@google.com.
|
||||
<variant name="DataSharingGroupStorage" summary="DataSharingGroupStorage"/>
|
||||
@@ -50,6 +50,7 @@ chromium-metrics-reviews@google.com.
|
||||
<variant name="DBSCSessions" summary="DBSCSessions"/>
|
||||
<variant name="DIPS" summary="DIPS"/>
|
||||
<variant name="DownloadRecord" summary="DownloadRecord"/>
|
||||
+ <variant name="Favicons" summary="Favicons"/>
|
||||
<variant name="FileIndexService" summary="FileIndexService"/>
|
||||
<variant name="FirefoxImporter" summary="FirefoxImporter"/>
|
||||
@@ -197,7 +197,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
};
|
||||
|
||||
// Information about a profile needed by an importer to do import work.
|
||||
@@ -109,6 +110,7 @@ enum VisitSource {
|
||||
@@ -111,6 +112,7 @@ enum VisitSource {
|
||||
VISIT_SOURCE_FIREFOX_IMPORTED = 1,
|
||||
VISIT_SOURCE_IE_IMPORTED = 2,
|
||||
VISIT_SOURCE_SAFARI_IMPORTED = 3,
|
||||
@@ -207,7 +207,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
} // namespace user_data_importer
|
||||
--- a/chrome/common/importer/profile_import_process_param_traits_macros.h
|
||||
+++ b/chrome/common/importer/profile_import_process_param_traits_macros.h
|
||||
@@ -20,11 +20,11 @@
|
||||
@@ -23,11 +23,11 @@
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
IPC_ENUM_TRAITS_MIN_MAX_VALUE(user_data_importer::ImporterType,
|
||||
user_data_importer::TYPE_UNKNOWN,
|
||||
@@ -244,7 +244,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -4273,6 +4273,9 @@ inline constexpr char kServiceWorkerToCo
|
||||
@@ -4297,6 +4297,9 @@ inline constexpr char kServiceWorkerToCo
|
||||
inline constexpr char kSharedWorkerBlobURLFixEnabled[] =
|
||||
"worker.shared_worker_blob_url_fix_enabled";
|
||||
|
||||
@@ -256,7 +256,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
inline constexpr char kClearWindowNameForNewBrowsingContextGroup[] =
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -1157,6 +1157,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
@@ -1168,6 +1168,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kImportDialogSearchEngine] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
@@ -267,15 +267,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// Supervised Users. This setting is queried in our Tast tests (b/241943380).
|
||||
--- a/chrome/browser/ui/webui/settings/settings_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_ui.cc
|
||||
@@ -62,6 +62,7 @@
|
||||
#include "chrome/browser/ui/webui/settings/font_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/hats_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/import_data_handler.h"
|
||||
@@ -58,6 +58,7 @@
|
||||
#include "chrome/browser/ui/webui/settings/about_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/accessibility_main_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/appearance_handler.h"
|
||||
+#include "chrome/browser/ui/webui/settings/brave_import_data_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/metrics_reporting_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/on_startup_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/password_manager_handler.h"
|
||||
@@ -202,6 +203,7 @@ void SettingsUI::RegisterProfilePrefs(
|
||||
#include "chrome/browser/ui/webui/settings/browser_lifetime_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/downloads_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/font_handler.h"
|
||||
@@ -214,6 +215,7 @@ void SettingsUI::RegisterProfilePrefs(
|
||||
registry->RegisterBooleanPref(prefs::kImportDialogHistory, true);
|
||||
registry->RegisterBooleanPref(prefs::kImportDialogSavedPasswords, true);
|
||||
registry->RegisterBooleanPref(prefs::kImportDialogSearchEngine, true);
|
||||
@@ -283,7 +283,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
|
||||
SettingsUI::SettingsUI(content::WebUI* web_ui)
|
||||
@@ -231,7 +233,7 @@ SettingsUI::SettingsUI(content::WebUI* w
|
||||
@@ -243,7 +245,7 @@ SettingsUI::SettingsUI(content::WebUI* w
|
||||
AddSettingsPageUIHandler(std::make_unique<DownloadsHandler>(profile));
|
||||
AddSettingsPageUIHandler(std::make_unique<ExtensionControlHandler>());
|
||||
AddSettingsPageUIHandler(std::make_unique<FontHandler>(profile));
|
||||
@@ -294,7 +294,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -907,6 +907,8 @@ void AddImportDataStrings(content::WebUI
|
||||
@@ -1026,6 +1026,8 @@ void AddImportDataStrings(content::WebUI
|
||||
{"importHistory", IDS_SETTINGS_IMPORT_HISTORY_CHECKBOX},
|
||||
{"importFavorites", IDS_SETTINGS_IMPORT_FAVORITES_CHECKBOX},
|
||||
{"importPasswords", IDS_SETTINGS_IMPORT_PASSWORDS_CHECKBOX},
|
||||
@@ -319,7 +319,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
</div>
|
||||
--- a/chrome/browser/ui/BUILD.gn
|
||||
+++ b/chrome/browser/ui/BUILD.gn
|
||||
@@ -1311,6 +1311,10 @@ static_library("ui") {
|
||||
@@ -1249,6 +1249,10 @@ static_library("ui") {
|
||||
"webui/settings/accessibility_main_handler.h",
|
||||
"webui/settings/appearance_handler.cc",
|
||||
"webui/settings/appearance_handler.h",
|
||||
@@ -330,7 +330,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"webui/settings/browser_lifetime_handler.cc",
|
||||
"webui/settings/browser_lifetime_handler.h",
|
||||
"webui/settings/captions_handler.cc",
|
||||
@@ -1463,6 +1467,13 @@ static_library("ui") {
|
||||
@@ -1414,6 +1418,13 @@ static_library("ui") {
|
||||
]
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// Corresponds to the "id" column of the "visits" SQL table.
|
||||
--- a/components/history/core/browser/visit_database.cc
|
||||
+++ b/components/history/core/browser/visit_database.cc
|
||||
@@ -119,6 +119,8 @@ VisitSource VisitSourceFromInt(int value
|
||||
@@ -123,6 +123,8 @@ VisitSource VisitSourceFromInt(int value
|
||||
case SOURCE_SAFARI_IMPORTED:
|
||||
case SOURCE_ACTOR:
|
||||
case SOURCE_OS_MIGRATION_IMPORTED:
|
||||
@@ -423,7 +423,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// In cases of database corruption, SOURCE_BROWSED is a safe default value.
|
||||
--- a/chrome/browser/importer/in_process_importer_bridge.cc
|
||||
+++ b/chrome/browser/importer/in_process_importer_bridge.cc
|
||||
@@ -53,6 +53,8 @@ history::VisitSource ConvertImporterVisi
|
||||
@@ -52,6 +52,8 @@ history::VisitSource ConvertImporterVisi
|
||||
return history::SOURCE_IE_IMPORTED;
|
||||
case user_data_importer::VISIT_SOURCE_SAFARI_IMPORTED:
|
||||
return history::SOURCE_SAFARI_IMPORTED;
|
||||
@@ -434,7 +434,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
--- a/chrome/utility/BUILD.gn
|
||||
+++ b/chrome/utility/BUILD.gn
|
||||
@@ -92,6 +92,12 @@ static_library("utility") {
|
||||
@@ -93,6 +93,12 @@ static_library("utility") {
|
||||
sources += [
|
||||
"importer/bookmarks_file_importer.cc",
|
||||
"importer/bookmarks_file_importer.h",
|
||||
@@ -449,17 +449,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
"importer/importer.cc",
|
||||
--- a/chrome/utility/services.cc
|
||||
+++ b/chrome/utility/services.cc
|
||||
@@ -56,7 +56,9 @@
|
||||
@@ -57,7 +57,9 @@
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
#include "chrome/common/importer/profile_import.mojom.h"
|
||||
+#include "chrome/common/importer/chrome_profile_import.mojom.h"
|
||||
#include "chrome/utility/importer/profile_import_impl.h"
|
||||
+#include "chrome/utility/importer/brave_profile_import_impl.h"
|
||||
#include "components/legion/oak_session_service/oak_session_service.h" // nogncheck
|
||||
#include "components/mirroring/service/mirroring_service.h"
|
||||
#include "services/passage_embeddings/passage_embeddings_service.h"
|
||||
#include "services/proxy_resolver/proxy_resolver_factory_impl.h" // nogncheck
|
||||
@@ -146,6 +148,13 @@ static_assert(BUILDFLAG(ENABLE_PRINTING)
|
||||
@@ -139,6 +141,13 @@ static_assert(BUILDFLAG(ENABLE_PRINTING)
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -473,14 +473,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
auto RunFilePatcher(mojo::PendingReceiver<patch::mojom::FilePatcher> receiver) {
|
||||
return std::make_unique<patch::FilePatcherImpl>(std::move(receiver));
|
||||
}
|
||||
@@ -465,6 +474,7 @@ void RegisterMainThreadServices(mojo::Se
|
||||
services.Add(ContentBookmarkParser);
|
||||
@@ -440,6 +449,7 @@ void RegisterMainThreadServices(mojo::Se
|
||||
services.Add(RunPassageEmbeddingsService);
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
+ services.Add(RunBraveProfileImporter);
|
||||
services.Add(RunOakSessionService);
|
||||
services.Add(RunProfileImporter);
|
||||
services.Add(RunMirroringService);
|
||||
services.Add(RunPassageEmbeddingsService);
|
||||
--- a/chrome/utility/importer/external_process_importer_bridge.h
|
||||
+++ b/chrome/utility/importer/external_process_importer_bridge.h
|
||||
@@ -72,7 +72,7 @@ class ExternalProcessImporterBridge : pu
|
||||
@@ -583,7 +583,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// entire group has been collected and is ready to be written to the profile.
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -11002,6 +11002,15 @@ Check your passwords anytime in <ph name
|
||||
@@ -11579,6 +11579,15 @@ Check your passwords anytime in <ph name
|
||||
Microsoft Edge
|
||||
</message>
|
||||
</if>
|
||||
@@ -0,0 +1,58 @@
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
Copyright (c) 2025, The Brave Authors
|
||||
Copyright (c) 2025, The Helium Authors
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License Version 3, as described below:
|
||||
|
||||
Copyright (C) 2025 The Helium Authors
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
--- a/extensions/browser/extension_registrar.cc
|
||||
+++ b/extensions/browser/extension_registrar.cc
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/devtools_agent_host.h"
|
||||
+#include "extensions/browser/api/content_settings/content_settings_service.h"
|
||||
#include "extensions/browser/blocklist_extension_prefs.h"
|
||||
#include "extensions/browser/delayed_install_manager.h"
|
||||
#include "extensions/browser/disable_reason.h"
|
||||
@@ -550,6 +551,22 @@ void ExtensionRegistrar::AddComponentExt
|
||||
}
|
||||
|
||||
AddExtension(extension);
|
||||
+
|
||||
+ if (!IsExtensionEnabled(extension->id()))
|
||||
+ return;
|
||||
+
|
||||
+ // ContentSettingsStore::RegisterExtension is only called for default
|
||||
+ // components on the first run with a fresh profile. All restarts of the
|
||||
+ // browser after that do not call it. This causes ContentSettingsStore's
|
||||
+ // `entries_` to never insert the component ID and then
|
||||
+ // ContentSettingsStore::GetValueMap always returns nullptr. I don't think
|
||||
+ // Chromium is affected by this simply because they don't use content settings
|
||||
+ // from default component extensions.
|
||||
+ extension_prefs_->OnExtensionInstalled(
|
||||
+ extension, /*disable_reasons=*/{}, syncer::StringOrdinal(),
|
||||
+ extensions::kInstallFlagNone, std::string(), {} /* ruleset_checksums */);
|
||||
+ extensions::ContentSettingsService::Get(browser_context_)
|
||||
+ ->OnExtensionPrefsLoaded(extension->id(), extension_prefs_);
|
||||
}
|
||||
|
||||
void ExtensionRegistrar::RemoveComponentExtension(
|
||||
@@ -0,0 +1,260 @@
|
||||
Based on Brave's MRU tab cycling implementation, adapted for Helium.
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
Copyright (c) 2025, The Brave Authors
|
||||
Copyright (c) 2025, The Helium Authors
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License Version 3, as described below:
|
||||
|
||||
Copyright (C) 2025 The Helium Authors
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
--- a/chrome/browser/ui/tabs/tab_strip_model.cc
|
||||
+++ b/chrome/browser/ui/tabs/tab_strip_model.cc
|
||||
@@ -74,6 +74,7 @@
|
||||
#include "chrome/browser/ui/thumbnails/thumbnail_tab_helper.h"
|
||||
#include "chrome/browser/ui/ui_features.h"
|
||||
#include "chrome/browser/ui/user_education/browser_user_education_interface.h"
|
||||
+#include "chrome/browser/ui/views/frame/browser_view.h"
|
||||
#include "chrome/browser/ui/views/tabs/dragging/tab_drag_controller.h"
|
||||
#include "chrome/browser/ui/web_applications/web_app_dialog_utils.h"
|
||||
#include "chrome/browser/ui/web_applications/web_app_launch_utils.h"
|
||||
@@ -3987,6 +3988,44 @@ TabStripSelectionChange TabStripModel::S
|
||||
return selection;
|
||||
}
|
||||
|
||||
+void TabStripModel::SelectMRUTab(TabRelativeDirection direction,
|
||||
+ TabStripUserGestureDetails detail) {
|
||||
+ if (mru_cycle_list_.empty()) {
|
||||
+ Browser* browser = chrome::FindBrowserWithTab(GetWebContentsAt(0));
|
||||
+ if (!browser) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ for (int i = 0; i < count(); ++i) {
|
||||
+ mru_cycle_list_.push_back(i);
|
||||
+ }
|
||||
+
|
||||
+ std::sort(mru_cycle_list_.begin(), mru_cycle_list_.end(),
|
||||
+ [this](int a, int b) {
|
||||
+ return GetWebContentsAt(a)->GetLastActiveTimeTicks() >
|
||||
+ GetWebContentsAt(b)->GetLastActiveTimeTicks();
|
||||
+ });
|
||||
+
|
||||
+ if (BrowserView* browser_view = browser->window()->AsBrowserView()) {
|
||||
+ browser_view->StartTabCycling();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (direction == TabRelativeDirection::kNext) {
|
||||
+ std::rotate(mru_cycle_list_.begin(), mru_cycle_list_.begin() + 1,
|
||||
+ mru_cycle_list_.end());
|
||||
+ } else {
|
||||
+ std::rotate(mru_cycle_list_.rbegin(), mru_cycle_list_.rbegin() + 1,
|
||||
+ mru_cycle_list_.rend());
|
||||
+ }
|
||||
+
|
||||
+ ActivateTabAt(mru_cycle_list_[0], detail);
|
||||
+}
|
||||
+
|
||||
+void TabStripModel::StopMRUCycling() {
|
||||
+ mru_cycle_list_.clear();
|
||||
+}
|
||||
+
|
||||
void TabStripModel::SelectRelativeTab(TabRelativeDirection direction,
|
||||
TabStripUserGestureDetails detail) {
|
||||
// This may happen during automated testing or if a user somehow buffers
|
||||
--- a/chrome/browser/ui/tabs/tab_strip_model.h
|
||||
+++ b/chrome/browser/ui/tabs/tab_strip_model.h
|
||||
@@ -615,6 +615,10 @@ class TabStripModel {
|
||||
TabStripUserGestureDetails detail = TabStripUserGestureDetails(
|
||||
TabStripUserGestureDetails::GestureType::kOther));
|
||||
|
||||
+ // Stops cycling through tabs in MRU order when Ctrl is released.
|
||||
+ // Used in BrowserView::StopTabCycling().
|
||||
+ void StopMRUCycling();
|
||||
+
|
||||
// Moves the active in the specified direction. Respects group boundaries.
|
||||
void MoveTabNext();
|
||||
void MoveTabPrevious();
|
||||
@@ -1178,6 +1182,11 @@ class TabStripModel {
|
||||
kPrevious,
|
||||
};
|
||||
|
||||
+ // Selects either the most recently used tab
|
||||
+ // or the least recently used tab.
|
||||
+ void SelectMRUTab(TabRelativeDirection direction,
|
||||
+ TabStripUserGestureDetails detail);
|
||||
+
|
||||
// Selects either the next tab (kNext), or the previous tab (kPrevious).
|
||||
void SelectRelativeTab(TabRelativeDirection direction,
|
||||
TabStripUserGestureDetails detail);
|
||||
@@ -1457,6 +1466,9 @@ class TabStripModel {
|
||||
// The focused group. If no group is focused, this is nullopt.
|
||||
std::optional<tab_groups::TabGroupId> focused_group_;
|
||||
|
||||
+ // List of tabs for MRU cycling
|
||||
+ std::vector<int> mru_cycle_list_;
|
||||
+
|
||||
base::WeakPtrFactory<TabStripModel> weak_factory_{this};
|
||||
};
|
||||
|
||||
--- a/chrome/browser/ui/views/frame/browser_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/browser_view.cc
|
||||
@@ -312,7 +312,10 @@
|
||||
#include "ui/compositor/paint_recorder.h"
|
||||
#include "ui/content_accelerators/accelerator_util.h"
|
||||
#include "ui/display/screen.h"
|
||||
+#include "ui/events/event.h"
|
||||
+#include "ui/events/event_handler.h"
|
||||
#include "ui/events/event_utils.h"
|
||||
+#include "ui/events/keycodes/keyboard_codes.h"
|
||||
#include "ui/gfx/animation/animation_runner.h"
|
||||
#include "ui/gfx/canvas.h"
|
||||
#include "ui/gfx/color_utils.h"
|
||||
@@ -330,6 +333,7 @@
|
||||
#include "ui/views/controls/button/menu_button.h"
|
||||
#include "ui/views/controls/textfield/textfield.h"
|
||||
#include "ui/views/controls/webview/webview.h"
|
||||
+#include "ui/views/event_monitor.h"
|
||||
#include "ui/views/interaction/element_tracker_views.h"
|
||||
#include "ui/views/layout/fill_layout.h"
|
||||
#include "ui/views/view.h"
|
||||
@@ -839,6 +843,83 @@ class BrowserView::ExclusiveAccessContex
|
||||
base::WeakPtrFactory<ExclusiveAccessContextImpl> weak_ptr_factory_{this};
|
||||
};
|
||||
|
||||
+// Handles events during MRU tab cycling to start/stop tab cycling.
|
||||
+class TabCyclingEventHandler : public ui::EventObserver,
|
||||
+ public views::WidgetObserver {
|
||||
+ public:
|
||||
+ explicit TabCyclingEventHandler(BrowserView* browser_view)
|
||||
+ : browser_view_(browser_view) {
|
||||
+ Start();
|
||||
+ }
|
||||
+
|
||||
+ ~TabCyclingEventHandler() override { Stop(); }
|
||||
+
|
||||
+ TabCyclingEventHandler(const TabCyclingEventHandler&) = delete;
|
||||
+ TabCyclingEventHandler& operator=(const TabCyclingEventHandler&) = delete;
|
||||
+
|
||||
+ private:
|
||||
+ // ui::EventObserver overrides:
|
||||
+ void OnEvent(const ui::Event& event) override {
|
||||
+ if (event.type() == ui::EventType::kKeyReleased &&
|
||||
+ event.AsKeyEvent()->key_code() == ui::VKEY_CONTROL) {
|
||||
+ // Ctrl key was released, stop the tab cycling.
|
||||
+ Stop();
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (event.type() == ui::EventType::kMousePressed) {
|
||||
+ Stop();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // views::WidgetObserver overrides:
|
||||
+ void OnWidgetActivationChanged(views::Widget* widget, bool active) override {
|
||||
+ // We should stop cycling if other application gets active state.
|
||||
+ if (!active) {
|
||||
+ Stop();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Handle browser widget closing while tab cycling is in-progress.
|
||||
+ void OnWidgetClosing(views::Widget* widget) override { Stop(); }
|
||||
+
|
||||
+ void Start() {
|
||||
+ // Add the event handler.
|
||||
+ auto* widget = browser_view_->GetWidget();
|
||||
+ if (widget->GetNativeWindow()) {
|
||||
+ monitor_ = views::EventMonitor::CreateWindowMonitor(
|
||||
+ this, widget->GetNativeWindow(),
|
||||
+ {ui::EventType::kMousePressed, ui::EventType::kKeyReleased});
|
||||
+ }
|
||||
+ widget->AddObserver(this);
|
||||
+ }
|
||||
+
|
||||
+ void Stop() {
|
||||
+ if (!monitor_) {
|
||||
+ // Already stopped.
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // Remove event handler.
|
||||
+ auto* widget = browser_view_->GetWidget();
|
||||
+ monitor_.reset();
|
||||
+ widget->RemoveObserver(this);
|
||||
+ browser_view_->StopTabCycling();
|
||||
+ }
|
||||
+
|
||||
+ raw_ptr<BrowserView> browser_view_;
|
||||
+ std::unique_ptr<views::EventMonitor> monitor_;
|
||||
+};
|
||||
+
|
||||
+void BrowserView::StartTabCycling() {
|
||||
+ tab_cycling_event_handler_ = std::make_unique<TabCyclingEventHandler>(this);
|
||||
+}
|
||||
+
|
||||
+void BrowserView::StopTabCycling() {
|
||||
+ tab_cycling_event_handler_.reset();
|
||||
+ browser()->tab_strip_model()->StopMRUCycling();
|
||||
+}
|
||||
+
|
||||
class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver {
|
||||
public:
|
||||
explicit AccessibilityModeObserver(BrowserView* browser_view)
|
||||
--- a/chrome/browser/ui/views/frame/browser_view.h
|
||||
+++ b/chrome/browser/ui/views/frame/browser_view.h
|
||||
@@ -86,6 +86,7 @@ class MultiContentsView;
|
||||
class ProjectsPanelView;
|
||||
class ScrimView;
|
||||
class SidePanel;
|
||||
+class TabCyclingEventHandler;
|
||||
class TabDragTarget;
|
||||
class TabSearchBubbleHost;
|
||||
class TabStrip;
|
||||
@@ -590,6 +591,10 @@ class BrowserView : public BrowserWindow
|
||||
bool IsBorderlessModeEnabled() const override;
|
||||
void ShowChromeLabs() override;
|
||||
BrowserView* AsBrowserView() override;
|
||||
+
|
||||
+ void StartTabCycling();
|
||||
+ void StopTabCycling();
|
||||
+
|
||||
SharingDialog* ShowSharingDialog(content::WebContents* contents,
|
||||
SharingDialogData data) override;
|
||||
void ShowUpdateChromeDialog() override;
|
||||
@@ -873,6 +878,7 @@ class BrowserView : public BrowserWindow
|
||||
friend class BrowserViewLayoutDelegateImpl;
|
||||
friend class BrowserViewLayoutDelegateImplOld;
|
||||
friend class BrowserViewLayoutDelegateImplBrowsertest;
|
||||
+ friend class TabCyclingEventHandler;
|
||||
friend class TopControlsSlideControllerTest;
|
||||
FRIEND_TEST_ALL_PREFIXES(BrowserViewTest, BrowserView);
|
||||
FRIEND_TEST_ALL_PREFIXES(BrowserViewTest, AccessibleWindowTitle);
|
||||
@@ -1457,6 +1463,8 @@ class BrowserView : public BrowserWindow
|
||||
TabStripAndWebAppViewsReparentedState::kMaxValue>
|
||||
tab_strip_web_apps_reparented_state_;
|
||||
|
||||
+ std::unique_ptr<TabCyclingEventHandler> tab_cycling_event_handler_;
|
||||
+
|
||||
mutable base::WeakPtrFactory<BrowserView> weak_ptr_factory_{this};
|
||||
};
|
||||
|
||||
+5
-5
@@ -10,7 +10,7 @@ Subject: Disable fetching of all field trials
|
||||
|
||||
--- 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
|
||||
@@ -60,7 +60,7 @@ public abstract class ChromeFeatureList
|
||||
@@ -62,7 +62,7 @@ public abstract class ChromeFeatureList
|
||||
* |kFeaturesExposedToJava| in chrome/browser/flags/android/chrome_feature_list.cc
|
||||
*/
|
||||
public static String getFieldTrialParamByFeature(String featureName, String paramName) {
|
||||
@@ -19,7 +19,7 @@ Subject: Disable fetching of all field trials
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,8 +72,7 @@ public abstract class ChromeFeatureList
|
||||
@@ -74,8 +74,7 @@ public abstract class ChromeFeatureList
|
||||
*/
|
||||
public static boolean getFieldTrialParamByFeatureAsBoolean(
|
||||
String featureName, String paramName, boolean defaultValue) {
|
||||
@@ -29,7 +29,7 @@ Subject: Disable fetching of all field trials
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,8 +84,7 @@ public abstract class ChromeFeatureList
|
||||
@@ -87,8 +86,7 @@ public abstract class ChromeFeatureList
|
||||
*/
|
||||
public static int getFieldTrialParamByFeatureAsInt(
|
||||
String featureName, String paramName, int defaultValue) {
|
||||
@@ -39,7 +39,7 @@ Subject: Disable fetching of all field trials
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,8 +96,7 @@ public abstract class ChromeFeatureList
|
||||
@@ -100,8 +98,7 @@ public abstract class ChromeFeatureList
|
||||
*/
|
||||
public static double getFieldTrialParamByFeatureAsDouble(
|
||||
String featureName, String paramName, double defaultValue) {
|
||||
@@ -51,7 +51,7 @@ Subject: Disable fetching of all field trials
|
||||
/**
|
||||
--- a/components/variations/service/variations_service.cc
|
||||
+++ b/components/variations/service/variations_service.cc
|
||||
@@ -223,22 +223,7 @@ bool GetInstanceManipulations(const net:
|
||||
@@ -224,22 +224,7 @@ bool GetInstanceManipulations(const net:
|
||||
// Variations seed fetching is only enabled in official Chrome builds, if a URL
|
||||
// is specified on the command line, and for testing.
|
||||
bool IsFetchingEnabled() {
|
||||
+39
-47
@@ -9,7 +9,7 @@
|
||||
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -2617,6 +2617,7 @@ static_library("browser") {
|
||||
@@ -2528,6 +2528,7 @@ static_library("browser") {
|
||||
"//third_party/libyuv",
|
||||
"//third_party/metrics_proto",
|
||||
"//third_party/re2",
|
||||
@@ -19,7 +19,7 @@
|
||||
"//third_party/widevine/cdm:headers",
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -183,6 +183,7 @@
|
||||
@@ -188,6 +188,7 @@
|
||||
#include "components/translate/core/common/translate_util.h"
|
||||
#include "components/trusted_vault/features.h"
|
||||
#include "components/ui_devtools/switches.h"
|
||||
@@ -54,7 +54,7 @@
|
||||
"//tools/v8_context_snapshot:buildflags",
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -81,6 +81,7 @@
|
||||
@@ -83,6 +83,7 @@
|
||||
#include "components/services/storage/public/cpp/quota_error_or.h"
|
||||
#include "components/services/storage/public/mojom/cache_storage_control.mojom.h"
|
||||
#include "components/tracing/common/tracing_switches.h"
|
||||
@@ -62,7 +62,7 @@
|
||||
#include "components/viz/common/switches.h"
|
||||
#include "components/viz/host/gpu_client.h"
|
||||
#include "components/viz/host/host_frame_sink_manager.h"
|
||||
@@ -3498,6 +3499,8 @@ void RenderProcessHostImpl::PropagateBro
|
||||
@@ -3709,6 +3710,8 @@ void RenderProcessHostImpl::PropagateBro
|
||||
switches::kEnableWebGLImageChromium,
|
||||
switches::kEnableWebGPUDeveloperFeatures,
|
||||
switches::kFileUrlPathAlias,
|
||||
@@ -73,7 +73,7 @@
|
||||
switches::kForceHighContrast,
|
||||
--- a/content/child/BUILD.gn
|
||||
+++ b/content/child/BUILD.gn
|
||||
@@ -110,6 +110,7 @@ target(link_target_type, "child") {
|
||||
@@ -113,6 +113,7 @@ target(link_target_type, "child") {
|
||||
"//third_party/blink/public/common:buildflags",
|
||||
"//third_party/blink/public/strings",
|
||||
"//third_party/ced",
|
||||
@@ -83,7 +83,7 @@
|
||||
"//ui/events/blink",
|
||||
--- a/content/child/runtime_features.cc
|
||||
+++ b/content/child/runtime_features.cc
|
||||
@@ -41,6 +41,7 @@
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "third_party/blink/public/common/loader/referrer_utils.h"
|
||||
#include "third_party/blink/public/common/switches.h"
|
||||
#include "third_party/blink/public/platform/web_runtime_features.h"
|
||||
@@ -91,7 +91,7 @@
|
||||
#include "ui/accessibility/accessibility_features.h"
|
||||
#include "ui/base/ui_base_features.h"
|
||||
#include "ui/events/blink/blink_features.h"
|
||||
@@ -481,6 +482,10 @@ void SetRuntimeFeaturesFromCommandLine(c
|
||||
@@ -489,6 +490,10 @@ void SetRuntimeFeaturesFromCommandLine(c
|
||||
true},
|
||||
{wrf::EnableWebAudioBypassOutputBufferingOptOut,
|
||||
blink::switches::kWebAudioBypassOutputBufferingOptOut, true},
|
||||
@@ -104,7 +104,7 @@
|
||||
for (const auto& mapping : switchToFeatureMapping) {
|
||||
--- a/third_party/blink/public/platform/web_runtime_features.h
|
||||
+++ b/third_party/blink/public/platform/web_runtime_features.h
|
||||
@@ -71,6 +71,9 @@ class BLINK_PLATFORM_EXPORT WebRuntimeFe
|
||||
@@ -70,6 +70,9 @@ class BLINK_PLATFORM_EXPORT WebRuntimeFe
|
||||
|
||||
static void EnableLocalNetworkAccessWebRTC(bool);
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
|
||||
--- a/third_party/blink/renderer/core/dom/document.cc
|
||||
+++ b/third_party/blink/renderer/core/dom/document.cc
|
||||
@@ -41,6 +41,7 @@
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "base/i18n/time_formatting.h"
|
||||
#include "base/metrics/histogram_functions.h"
|
||||
#include "base/notreached.h"
|
||||
@@ -124,9 +124,9 @@
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/trace_event/trace_event.h"
|
||||
@@ -1085,6 +1086,11 @@ Document::Document(const DocumentInit& i
|
||||
TRACE_EVENT_WITH_FLOW0("blink", "Document::Document", TRACE_ID_LOCAL(this),
|
||||
TRACE_EVENT_FLAG_FLOW_OUT);
|
||||
@@ -1043,6 +1044,11 @@ Document::Document(const DocumentInit& i
|
||||
data_(MakeGarbageCollected<DocumentData>(GetExecutionContext())) {
|
||||
TRACE_EVENT("blink", "Document::Document", perfetto::Flow::FromPointer(this));
|
||||
DCHECK(agent_);
|
||||
+ if (RuntimeEnabledFeatures::FingerprintingClientRectsNoiseEnabled()) {
|
||||
+ // Precompute -0.0003% to 0.0003% noise factor for get*ClientRect*() fingerprinting
|
||||
@@ -136,7 +136,7 @@
|
||||
if (base::FeatureList::IsEnabled(features::kDelayAsyncScriptExecution) &&
|
||||
features::kDelayAsyncScriptExecutionDelayByDefaultParam.Get()) {
|
||||
script_runner_delayer_->Activate();
|
||||
@@ -1215,6 +1221,14 @@ const Position Document::PositionAdjuste
|
||||
@@ -1176,6 +1182,14 @@ const Position Document::PositionAdjuste
|
||||
return Position::BeforeNode(*shadow_host);
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
selector_query_cache_ = MakeGarbageCollected<SelectorQueryCache>();
|
||||
--- a/third_party/blink/renderer/core/dom/document.h
|
||||
+++ b/third_party/blink/renderer/core/dom/document.h
|
||||
@@ -572,6 +572,10 @@ class CORE_EXPORT Document : public Cont
|
||||
@@ -571,6 +571,10 @@ class CORE_EXPORT Document : public Cont
|
||||
has_xml_declaration_ = has_xml_declaration ? 1 : 0;
|
||||
}
|
||||
|
||||
@@ -164,31 +164,29 @@
|
||||
V8VisibilityState visibilityState() const;
|
||||
String visibilityStateAsString() const;
|
||||
bool IsPageVisible() const;
|
||||
@@ -2770,6 +2774,9 @@ class CORE_EXPORT Document : public Cont
|
||||
@@ -2842,6 +2846,9 @@ class CORE_EXPORT Document : public Cont
|
||||
|
||||
base::ElapsedTimer start_time_;
|
||||
|
||||
+ double noise_factor_x_ = 1;
|
||||
+ double noise_factor_y_ = 1;
|
||||
+
|
||||
Member<ScriptRunner> script_runner_;
|
||||
Member<ScriptRunnerDelayer> script_runner_delayer_;
|
||||
|
||||
// The script runner is used to run scripts of the following scheduling types:
|
||||
// - ScriptSchedulingType::kAsync
|
||||
// - ScriptSchedulingType::kInOrder
|
||||
--- a/third_party/blink/renderer/core/dom/element.cc
|
||||
+++ b/third_party/blink/renderer/core/dom/element.cc
|
||||
@@ -3092,6 +3092,11 @@ DOMRectList* Element::getClientRects() {
|
||||
DCHECK(element_layout_object);
|
||||
GetDocument().AdjustQuadsForScrollAndAbsoluteZoom(quads,
|
||||
*element_layout_object);
|
||||
+ if (RuntimeEnabledFeatures::FingerprintingClientRectsNoiseEnabled()) {
|
||||
+ for (gfx::QuadF& quad : quads) {
|
||||
@@ -3444,6 +3444,9 @@ Vector<gfx::RectF> Element::GetClientRec
|
||||
}
|
||||
Vector<gfx::RectF> result;
|
||||
for (auto& quad : quads) {
|
||||
+ if (RuntimeEnabledFeatures::FingerprintingClientRectsNoiseEnabled()) {
|
||||
+ quad.Scale(GetDocument().GetNoiseFactorX(), GetDocument().GetNoiseFactorY());
|
||||
+ }
|
||||
+ }
|
||||
return MakeGarbageCollected<DOMRectList>(quads);
|
||||
}
|
||||
|
||||
@@ -3119,6 +3124,9 @@ gfx::RectF Element::GetBoundingClientRec
|
||||
result.emplace_back(quad.BoundingBox());
|
||||
}
|
||||
return result;
|
||||
@@ -3473,6 +3476,9 @@ gfx::RectF Element::GetBoundingClientRec
|
||||
DCHECK(element_layout_object);
|
||||
GetDocument().AdjustRectForScrollAndAbsoluteZoom(result,
|
||||
*element_layout_object);
|
||||
@@ -200,7 +198,7 @@
|
||||
|
||||
--- a/third_party/blink/renderer/core/dom/range.cc
|
||||
+++ b/third_party/blink/renderer/core/dom/range.cc
|
||||
@@ -1655,6 +1655,12 @@ DOMRectList* Range::getClientRects() con
|
||||
@@ -1656,6 +1656,12 @@ DOMRectList* Range::getClientRects() con
|
||||
Vector<gfx::QuadF> quads;
|
||||
GetBorderAndTextQuads(quads);
|
||||
|
||||
@@ -213,7 +211,7 @@
|
||||
return MakeGarbageCollected<DOMRectList>(quads);
|
||||
}
|
||||
|
||||
@@ -1662,7 +1668,11 @@ DOMRect* Range::getBoundingClientRect()
|
||||
@@ -1663,7 +1669,11 @@ DOMRect* Range::getBoundingClientRect()
|
||||
// TODO(crbug.com/1499981): This should be removed once synchronized scrolling
|
||||
// impact is understood.
|
||||
SyncScrollAttemptHeuristic::DidAccessScrollOffset();
|
||||
@@ -228,9 +226,9 @@
|
||||
// TODO(editing-dev): We should make
|
||||
--- a/third_party/blink/renderer/core/html/canvas/text_metrics.cc
|
||||
+++ b/third_party/blink/renderer/core/html/canvas/text_metrics.cc
|
||||
@@ -106,6 +106,24 @@ const ShapeResult* ShapeWord(const TextR
|
||||
@@ -90,6 +90,24 @@ TextMetrics::TextMetrics(const Font* fon
|
||||
Update(font, direction, baseline, align, text, text_painter);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
+void TextMetrics::Shuffle(const double factor) {
|
||||
+ // x-direction
|
||||
@@ -255,7 +253,7 @@
|
||||
const V8CanvasTextBaseline::Enum baseline,
|
||||
--- a/third_party/blink/renderer/core/html/canvas/text_metrics.h
|
||||
+++ b/third_party/blink/renderer/core/html/canvas/text_metrics.h
|
||||
@@ -111,6 +111,8 @@ class CORE_EXPORT TextMetrics final : pu
|
||||
@@ -110,6 +110,8 @@ class CORE_EXPORT TextMetrics final : pu
|
||||
float x_position_;
|
||||
};
|
||||
|
||||
@@ -266,7 +264,7 @@
|
||||
const TextDirection& direction,
|
||||
--- a/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
|
||||
+++ b/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
|
||||
@@ -108,6 +108,9 @@
|
||||
@@ -102,6 +102,9 @@
|
||||
// https://github.com/include-what-you-use/include-what-you-use/issues/1122
|
||||
// IWYU pragma: no_include "base/numerics/clamped_math.h"
|
||||
|
||||
@@ -276,20 +274,14 @@
|
||||
namespace blink {
|
||||
|
||||
class MemoryManagedPaintCanvas;
|
||||
@@ -1248,13 +1251,26 @@ TextMetrics* BaseRenderingContext2D::mea
|
||||
@@ -1165,9 +1168,22 @@ TextMetrics* BaseRenderingContext2D::mea
|
||||
TextDirection direction =
|
||||
ToTextDirection(state.GetDirection(), host, computed_style);
|
||||
|
||||
- return MakeGarbageCollected<TextMetrics>(
|
||||
- font, direction, state.GetTextBaseline().AsEnum(),
|
||||
- state.GetTextAlign().AsEnum(), text,
|
||||
+ TextMetrics* text_metrics = MakeGarbageCollected<TextMetrics>(
|
||||
+ font, direction, GetState().GetTextBaseline().AsEnum(),
|
||||
+ GetState().GetTextAlign().AsEnum(), text,
|
||||
RuntimeEnabledFeatures::CanvasTextNgEnabled(
|
||||
host->GetTopExecutionContext())
|
||||
? &host->GetPlainTextPainter()
|
||||
: nullptr);
|
||||
font, direction, state.GetTextBaseline(), state.GetTextAlign(), text,
|
||||
host->GetPlainTextPainter());
|
||||
+
|
||||
+ // Scale text metrics if enabled
|
||||
+ if (RuntimeEnabledFeatures::FingerprintingCanvasMeasureTextNoiseEnabled()) {
|
||||
@@ -308,7 +300,7 @@
|
||||
String BaseRenderingContext2D::lang() const {
|
||||
--- a/third_party/blink/renderer/platform/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/platform/BUILD.gn
|
||||
@@ -1797,6 +1797,7 @@ component("platform") {
|
||||
@@ -1812,6 +1812,7 @@ component("platform") {
|
||||
"//components/paint_preview/common",
|
||||
"//components/search_engines:search_engine_utils",
|
||||
"//components/translate/core/language_detection",
|
||||
@@ -318,7 +310,7 @@
|
||||
"//components/webrtc:net_address_utils",
|
||||
--- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc
|
||||
+++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
|
||||
@@ -73,4 +73,12 @@ void WebRuntimeFeatures::EnableLocalNetw
|
||||
@@ -68,4 +68,12 @@ void WebRuntimeFeatures::EnableLocalNetw
|
||||
RuntimeEnabledFeatures::SetLocalNetworkAccessWebRTCEnabled(enable);
|
||||
}
|
||||
|
||||
@@ -343,7 +335,7 @@
|
||||
#include "third_party/skia/include/core/SkImage.h"
|
||||
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
@@ -2273,6 +2273,12 @@
|
||||
@@ -2626,6 +2626,12 @@
|
||||
status: "stable",
|
||||
},
|
||||
{
|
||||
+19
-54
@@ -17,7 +17,7 @@ with limited CPU/memory resources and it is disabled by default.
|
||||
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -2295,6 +2295,7 @@ static_library("browser") {
|
||||
@@ -2213,6 +2213,7 @@ static_library("browser") {
|
||||
"//components/net_log",
|
||||
"//components/network_hints/common:mojo_bindings",
|
||||
"//components/network_session_configurator/browser",
|
||||
@@ -32,8 +32,8 @@ with limited CPU/memory resources and it is disabled by default.
|
||||
#ifndef CHROME_BROWSER_BROMITE_FLAG_CHOICES_H_
|
||||
#define CHROME_BROWSER_BROMITE_FLAG_CHOICES_H_
|
||||
+const FeatureEntry::Choice kMaxConnectionsPerHostChoices[] = {
|
||||
+ {features::kMaxConnectionsPerHostChoiceDefault, "", ""},
|
||||
+ {features::kMaxConnectionsPerHostChoice15, switches::kMaxConnectionsPerHost, "15"},
|
||||
+ {flags_ui::kGenericExperimentChoiceDefault, "", ""},
|
||||
+ {"15", switches::kMaxConnectionsPerHost, "15"},
|
||||
+};
|
||||
#endif // CHROME_BROWSER_BROMITE_FLAG_CHOICES_H_
|
||||
--- a/chrome/browser/bromite_flag_entries.h
|
||||
@@ -49,7 +49,7 @@ with limited CPU/memory resources and it is disabled by default.
|
||||
#endif // CHROME_BROWSER_BROMITE_FLAG_ENTRIES_H_
|
||||
--- a/chrome/browser/browser_process_impl.cc
|
||||
+++ b/chrome/browser/browser_process_impl.cc
|
||||
@@ -26,6 +26,7 @@
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/functional/callback_helpers.h"
|
||||
#include "base/location.h"
|
||||
@@ -57,7 +57,7 @@ with limited CPU/memory resources and it is disabled by default.
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/metrics/histogram_functions.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
@@ -33,6 +34,7 @@
|
||||
@@ -29,6 +30,7 @@
|
||||
#include "base/notreached.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/run_loop.h"
|
||||
@@ -73,7 +73,7 @@ with limited CPU/memory resources and it is disabled by default.
|
||||
#include "components/network_time/network_time_tracker.h"
|
||||
#include "components/os_crypt/async/browser/os_crypt_async.h"
|
||||
#include "components/permissions/permissions_client.h"
|
||||
@@ -153,6 +156,7 @@
|
||||
@@ -156,6 +159,7 @@
|
||||
#include "extensions/common/constants.h"
|
||||
#include "media/media_buildflags.h"
|
||||
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
||||
@@ -81,7 +81,7 @@ with limited CPU/memory resources and it is disabled by default.
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "services/network/public/cpp/network_switches.h"
|
||||
@@ -421,6 +425,18 @@ void BrowserProcessImpl::Init() {
|
||||
@@ -470,6 +474,18 @@ void BrowserProcessImpl::Init() {
|
||||
pref_change_registrar_.Add(metrics::prefs::kMetricsReportingEnabled,
|
||||
base::BindRepeating(&ApplyMetricsReportingPolicy));
|
||||
|
||||
@@ -93,61 +93,26 @@ with limited CPU/memory resources and it is disabled by default.
|
||||
+ << " expected integer; got (\"" << switch_value << "\" instead)";
|
||||
+ }
|
||||
+ if (max_connections_per_host != 0) {
|
||||
+ net::ClientSocketPoolManager::set_max_sockets_per_group(
|
||||
+ net::ClientSocketPoolManager::set_max_sockets_per_group_for_test(
|
||||
+ net::HttpNetworkSession::NORMAL_SOCKET_POOL, max_connections_per_host);
|
||||
+ }
|
||||
+
|
||||
DCHECK(!webrtc_event_log_manager_);
|
||||
webrtc_event_log_manager_ = WebRtcEventLogManager::CreateSingletonInstance();
|
||||
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -2657,6 +2657,10 @@ const char kMantisFeatureKeyDescription[
|
||||
"Feature key to use the Mantis feature on ChromeOS.";
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
+const char kMaxConnectionsPerHostName[] = "Maximum connections per host";
|
||||
+const char kMaxConnectionsPerHostDescription[] =
|
||||
+ "Customize maximum allowed connections per host. ungoogled-chromium flag, Bromite feature.";
|
||||
+
|
||||
const char kMediaRouterCastAllowAllIPsName[] =
|
||||
"Connect to Cast devices on all IP addresses";
|
||||
const char kMediaRouterCastAllowAllIPsDescription[] =
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -1548,6 +1548,9 @@ extern const char kMantisFeatureKeyName[
|
||||
extern const char kMantisFeatureKeyDescription[];
|
||||
#endif // IS_CHROMEOS
|
||||
@@ -2765,6 +2765,10 @@ inline constexpr char kLogJsConsoleMessa
|
||||
"Enable logging JS console messages in system logs, please note that they "
|
||||
"may contain PII.";
|
||||
|
||||
+extern const char kMaxConnectionsPerHostName[];
|
||||
+extern const char kMaxConnectionsPerHostDescription[];
|
||||
+inline constexpr char kMaxConnectionsPerHostName[] = "Maximum connections per host";
|
||||
+inline constexpr char kMaxConnectionsPerHostDescription[] =
|
||||
+ "Customize maximum allowed connections per host. ungoogled-chromium flag, Bromite feature.";
|
||||
+
|
||||
extern const char kMediaRouterCastAllowAllIPsName[];
|
||||
extern const char kMediaRouterCastAllowAllIPsDescription[];
|
||||
|
||||
--- a/components/network_session_configurator/common/network_features.cc
|
||||
+++ b/components/network_session_configurator/common/network_features.cc
|
||||
@@ -8,4 +8,7 @@
|
||||
|
||||
namespace features {
|
||||
|
||||
+const char kMaxConnectionsPerHostChoiceDefault[] = "6",
|
||||
+ kMaxConnectionsPerHostChoice15[] = "15";
|
||||
+
|
||||
} // namespace features
|
||||
--- a/components/network_session_configurator/common/network_features.h
|
||||
+++ b/components/network_session_configurator/common/network_features.h
|
||||
@@ -10,6 +10,10 @@
|
||||
|
||||
namespace features {
|
||||
|
||||
+NETWORK_SESSION_CONFIGURATOR_EXPORT extern const char kMaxConnectionsPerHostChoiceDefault[],
|
||||
+ kMaxConnectionsPerHostChoice6[],
|
||||
+ kMaxConnectionsPerHostChoice15[];
|
||||
+
|
||||
} // namespace features
|
||||
|
||||
#endif // COMPONENTS_NETWORK_SESSION_CONFIGURATOR_COMMON_NETWORK_FEATURES_H_
|
||||
inline constexpr char kMediaRouterCastAllowAllIPsName[] =
|
||||
"Connect to Cast devices on all IP addresses";
|
||||
inline constexpr char kMediaRouterCastAllowAllIPsDescription[] =
|
||||
--- a/components/network_session_configurator/common/network_switch_list.h
|
||||
+++ b/components/network_session_configurator/common/network_switch_list.h
|
||||
@@ -19,6 +19,10 @@ NETWORK_SWITCH(kEnableUserAlternateProto
|
||||
@@ -159,5 +124,5 @@ with limited CPU/memory resources and it is disabled by default.
|
||||
+NETWORK_SWITCH(kMaxConnectionsPerHost, "max-connections-per-host")
|
||||
+
|
||||
// Ignores certificate-related errors.
|
||||
NETWORK_SWITCH(kIgnoreCertificateErrors, "ignore-certificate-errors")
|
||||
|
||||
// Note: In tests using net::EmbeddedTestServer with a custom hostname not
|
||||
// covered by the default test certs, using this switch is usually incorrect.
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
From c89ce946e5328ca8a7df923d421e904bb6bfe9b6 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Tue, 7 Jul 2015 18:28:46 +0200
|
||||
Subject: [PATCH 63/76] safe_browsing: disable reporting of safebrowsing
|
||||
override
|
||||
|
||||
Disables reporting of the safebrowsing override, i.e. the report sent
|
||||
if a user decides to visit a page that was flagged as "insecure".
|
||||
This prevents trk:148 (phishing) and trk:149 (malware).
|
||||
---
|
||||
components/safe_browsing/content/browser/client_side_detection_service.cc | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
--- a/components/safe_browsing/content/browser/client_side_detection_service.cc
|
||||
+++ b/components/safe_browsing/content/browser/client_side_detection_service.cc
|
||||
@@ -281,6 +281,10 @@ void ClientSideDetectionService::StartCl
|
||||
return;
|
||||
}
|
||||
|
||||
+#if 1
|
||||
+ if (!callback.is_null())
|
||||
+ callback.Run(GURL(request->url()), false);
|
||||
+#else
|
||||
std::string request_data;
|
||||
request->SerializeToString(&request_data);
|
||||
|
||||
@@ -362,6 +366,7 @@ void ClientSideDetectionService::StartCl
|
||||
base::BindOnce(&WebUIInfoSingleton::AddToClientPhishingRequestsSent,
|
||||
base::Unretained(WebUIInfoSingleton::GetInstance()),
|
||||
std::move(request), access_token));
|
||||
+#endif
|
||||
}
|
||||
|
||||
void ClientSideDetectionService::HandlePhishingVerdict(
|
||||
@@ -1,69 +0,0 @@
|
||||
# Disable some background communication with clients2.google.com
|
||||
|
||||
--- a/chrome/browser/chrome_content_browser_client.cc
|
||||
+++ b/chrome/browser/chrome_content_browser_client.cc
|
||||
@@ -2711,24 +2711,6 @@ void ChromeContentBrowserClient::AppendE
|
||||
command_line->AppendSwitchASCII(switches::kMetricsClientID,
|
||||
client_info->client_id);
|
||||
}
|
||||
-#elif BUILDFLAG(IS_POSIX)
|
||||
-#if !BUILDFLAG(IS_ANDROID)
|
||||
- pid_t pid;
|
||||
- if (crash_reporter::GetHandlerSocket(nullptr, &pid)) {
|
||||
- command_line->AppendSwitchASCII(
|
||||
- crash_reporter::switches::kCrashpadHandlerPid,
|
||||
- base::NumberToString(pid));
|
||||
- }
|
||||
-#endif
|
||||
- std::string switch_value;
|
||||
- std::unique_ptr<metrics::ClientInfo> client_info =
|
||||
- GoogleUpdateSettings::LoadMetricsClientInfo();
|
||||
- if (client_info) {
|
||||
- switch_value = client_info->client_id;
|
||||
- }
|
||||
- switch_value.push_back(',');
|
||||
- switch_value.append(chrome::GetChannelName(chrome::WithExtendedStable(true)));
|
||||
- command_line->AppendSwitchASCII(switches::kEnableCrashReporter, switch_value);
|
||||
#endif
|
||||
|
||||
if (logging::DialogsAreSuppressed()) {
|
||||
--- a/components/crash/core/app/crashpad.cc
|
||||
+++ b/components/crash/core/app/crashpad.cc
|
||||
@@ -72,6 +72,12 @@ void InitializeDatabasePath(const base::
|
||||
}
|
||||
|
||||
bool InitializeCrashpadImpl(bool initial_client,
|
||||
+ const std::string& a, const std::string& b, const base::FilePath& c,
|
||||
+ const std::vector<std::string>& d, bool e) {
|
||||
+ return false;
|
||||
+}
|
||||
+[[maybe_unused]]
|
||||
+bool DeadInitializeCrashpadImpl(bool initial_client,
|
||||
const std::string& process_type,
|
||||
const std::string& user_data_dir,
|
||||
const base::FilePath& exe_path,
|
||||
--- a/components/gwp_asan/client/gwp_asan.cc
|
||||
+++ b/components/gwp_asan/client/gwp_asan.cc
|
||||
@@ -345,6 +345,11 @@ GWP_ASAN_EXPORT std::optional<AllocatorS
|
||||
|
||||
// Exported for testing.
|
||||
GWP_ASAN_EXPORT std::optional<AllocatorSettings> GetAllocatorSettings(
|
||||
+ const base::Feature& a, bool b, std::string_view c) {
|
||||
+ return std::nullopt;
|
||||
+}
|
||||
+[[maybe_unused]]
|
||||
+std::optional<AllocatorSettings> DeadGetAllocatorSettings(
|
||||
const base::Feature& feature,
|
||||
bool boost_sampling,
|
||||
std::string_view process_type) {
|
||||
--- a/third_party/crashpad/crashpad/client/crashpad_client_linux.cc
|
||||
+++ b/third_party/crashpad/crashpad/client/crashpad_client_linux.cc
|
||||
@@ -747,8 +747,6 @@ void CrashpadClient::CrashWithoutDump(co
|
||||
// static
|
||||
void CrashpadClient::SetFirstChanceExceptionHandler(
|
||||
FirstChanceHandler handler) {
|
||||
- DCHECK(SignalHandler::Get());
|
||||
- SignalHandler::Get()->SetFirstChanceHandler(handler);
|
||||
}
|
||||
|
||||
// static
|
||||
+1
-1
@@ -3,7 +3,7 @@ author: Michael Gilbert <mgilbert@debian.org>
|
||||
|
||||
--- a/chrome/browser/ui/startup/infobar_utils.cc
|
||||
+++ b/chrome/browser/ui/startup/infobar_utils.cc
|
||||
@@ -175,10 +175,6 @@ void AddInfoBarsIfNecessary(Browser* bro
|
||||
@@ -186,10 +186,6 @@ void AddInfoBarsIfNecessary(BrowserWindo
|
||||
infobars::ContentInfoBarManager* infobar_manager =
|
||||
infobars::ContentInfoBarManager::FromWebContents(web_contents);
|
||||
|
||||
@@ -1,326 +0,0 @@
|
||||
# NOTE: Changes made:
|
||||
# * Added flag --fingerprinting-canvas-image-data-noise to enable/disable
|
||||
# Canvas image data fingerprinting deception
|
||||
# * Removed WebGLDebugRendererInfo disabling in favor of an alternative
|
||||
# implementation in ungoogled-chromium/disable-webgl-renderer-info.patch
|
||||
# * Tweak subchannel noise generation to require fewer random number generation
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 24 Mar 2018 05:18:03 +0100
|
||||
Subject: Canvas: fingerprinting mitigations for image data and webGL
|
||||
|
||||
Disable webGL renderer info and modify the color data returned by ToBlob,
|
||||
ToDataURL and getImageData so that it will contain randomly manipulated
|
||||
pixels (maximum 10) that slightly change the color of the R,G,B components
|
||||
without a visible effect.
|
||||
|
||||
Credits to Slaviro (https://github.com/Slaviro) for coming up with a better
|
||||
approach to change color components.
|
||||
---
|
||||
.../platform/graphics/image_data_buffer.cc | 5 +
|
||||
.../platform/graphics/static_bitmap_image.cc | 154 +++++++++++++++++++++
|
||||
.../platform/graphics/static_bitmap_image.h | 2 +
|
||||
4 files changed, 163 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/chrome/browser/bromite_flag_entries.h
|
||||
+++ b/chrome/browser/bromite_flag_entries.h
|
||||
@@ -16,4 +16,8 @@
|
||||
flag_descriptions::kMaxConnectionsPerHostName,
|
||||
flag_descriptions::kMaxConnectionsPerHostDescription,
|
||||
kOsAll, MULTI_VALUE_TYPE(kMaxConnectionsPerHostChoices)},
|
||||
+ {"fingerprinting-canvas-image-data-noise",
|
||||
+ "Enable Canvas image data fingerprint deception",
|
||||
+ "Slightly modifies at most 10 pixels in Canvas image data extracted via JS APIs. ungoogled-chromium flag, Bromite feature.",
|
||||
+ kOsAll, SINGLE_VALUE_TYPE(switches::kFingerprintingCanvasImageDataNoise)},
|
||||
#endif // CHROME_BROWSER_BROMITE_FLAG_ENTRIES_H_
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -3501,6 +3501,7 @@ void RenderProcessHostImpl::PropagateBro
|
||||
switches::kFileUrlPathAlias,
|
||||
switches::kFingerprintingClientRectsNoise,
|
||||
switches::kFingerprintingCanvasMeasureTextNoise,
|
||||
+ switches::kFingerprintingCanvasImageDataNoise,
|
||||
switches::kForceDeviceScaleFactor,
|
||||
switches::kForceDisplayColorProfile,
|
||||
switches::kForceHighContrast,
|
||||
--- a/content/child/runtime_features.cc
|
||||
+++ b/content/child/runtime_features.cc
|
||||
@@ -486,6 +486,8 @@ void SetRuntimeFeaturesFromCommandLine(c
|
||||
switches::kFingerprintingClientRectsNoise, true},
|
||||
{wrf::EnableFingerprintingCanvasMeasureTextNoise,
|
||||
switches::kFingerprintingCanvasMeasureTextNoise, true},
|
||||
+ {wrf::EnableFingerprintingCanvasImageDataNoise,
|
||||
+ switches::kFingerprintingCanvasImageDataNoise, true},
|
||||
};
|
||||
|
||||
for (const auto& mapping : switchToFeatureMapping) {
|
||||
--- a/third_party/blink/public/platform/web_runtime_features.h
|
||||
+++ b/third_party/blink/public/platform/web_runtime_features.h
|
||||
@@ -73,6 +73,7 @@ class BLINK_PLATFORM_EXPORT WebRuntimeFe
|
||||
|
||||
static void EnableFingerprintingClientRectsNoise(bool);
|
||||
static void EnableFingerprintingCanvasMeasureTextNoise(bool);
|
||||
+ static void EnableFingerprintingCanvasImageDataNoise(bool);
|
||||
|
||||
WebRuntimeFeatures() = delete;
|
||||
};
|
||||
--- a/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
|
||||
+++ b/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
|
||||
@@ -557,6 +557,9 @@ ImageData* BaseRenderingContext2D::getIm
|
||||
snapshot->PaintImageForCurrentFrame().GetSkImageInfo().bounds();
|
||||
DCHECK(!bounds.intersect(SkIRect::MakeXYWH(sx, sy, sw, sh)));
|
||||
}
|
||||
+ if (read_pixels_successful && RuntimeEnabledFeatures::FingerprintingCanvasImageDataNoiseEnabled()) {
|
||||
+ StaticBitmapImage::ShuffleSubchannelColorData(image_data_pixmap.addr(), image_data_pixmap.info(), sx, sy);
|
||||
+ }
|
||||
}
|
||||
|
||||
return image_data;
|
||||
--- a/third_party/blink/renderer/platform/BUILD.gn
|
||||
+++ b/third_party/blink/renderer/platform/BUILD.gn
|
||||
@@ -1741,7 +1741,9 @@ component("platform") {
|
||||
"//third_party/blink/renderer:non_test_config",
|
||||
]
|
||||
|
||||
- include_dirs = []
|
||||
+ include_dirs = [
|
||||
+ "//third_party/skia/include/private", # For shuffler in graphics/static_bitmap_image.cc
|
||||
+ ]
|
||||
|
||||
allow_circular_includes_from = [
|
||||
"//third_party/blink/renderer/platform/blob",
|
||||
--- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc
|
||||
+++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
|
||||
@@ -81,4 +81,8 @@ void WebRuntimeFeatures::EnableFingerpri
|
||||
RuntimeEnabledFeatures::SetFingerprintingCanvasMeasureTextNoiseEnabled(enable);
|
||||
}
|
||||
|
||||
+void WebRuntimeFeatures::EnableFingerprintingCanvasImageDataNoise(bool enable) {
|
||||
+ RuntimeEnabledFeatures::SetFingerprintingCanvasImageDataNoiseEnabled(enable);
|
||||
+}
|
||||
+
|
||||
} // namespace blink
|
||||
--- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
|
||||
+++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.cc
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
|
||||
|
||||
+#include "base/rand_util.h"
|
||||
+#include "base/logging.h"
|
||||
#include "base/numerics/checked_math.h"
|
||||
#include "gpu/command_buffer/client/gles2_interface.h"
|
||||
#include "third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h"
|
||||
@@ -11,11 +13,13 @@
|
||||
#include "third_party/blink/renderer/platform/graphics/image_observer.h"
|
||||
#include "third_party/blink/renderer/platform/graphics/paint/paint_image.h"
|
||||
#include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h"
|
||||
+#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
|
||||
#include "third_party/blink/renderer/platform/transforms/affine_transform.h"
|
||||
#include "third_party/skia/include/core/SkCanvas.h"
|
||||
#include "third_party/skia/include/core/SkImage.h"
|
||||
#include "third_party/skia/include/core/SkPaint.h"
|
||||
#include "third_party/skia/include/core/SkSurface.h"
|
||||
+#include "third_party/skia/src/core/SkColorData.h"
|
||||
#include "ui/gfx/geometry/skia_conversions.h"
|
||||
#include "v8/include/v8.h"
|
||||
|
||||
@@ -114,4 +118,154 @@ void StaticBitmapImage::DrawHelper(cc::P
|
||||
ToSkiaRectConstraint(draw_options.clamping_mode));
|
||||
}
|
||||
|
||||
+// set the component to maximum-delta if it is >= maximum, or add to existing color component (color + delta)
|
||||
+#define shuffleComponent(color, max, delta) ( (color) >= (max) ? ((max)-(delta)) : ((color)+(delta)) )
|
||||
+
|
||||
+#define writable_addr(T, p, stride, x, y) (T*)((const char *)p + y * stride + x * sizeof(T))
|
||||
+
|
||||
+void StaticBitmapImage::ShuffleSubchannelColorData(const void *addr, const SkImageInfo& info, int srcX, int srcY) {
|
||||
+ auto w = info.width() - srcX, h = info.height() - srcY;
|
||||
+
|
||||
+ // skip tiny images; info.width()/height() can also be 0
|
||||
+ if ((w < 8) || (h < 8)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // generate the first random number here
|
||||
+ double shuffleX = base::RandDouble();
|
||||
+
|
||||
+ // cap maximum pixels to change
|
||||
+ auto pixels = (w + h) / 128;
|
||||
+ if (pixels > 10) {
|
||||
+ pixels = 10;
|
||||
+ } else if (pixels < 2) {
|
||||
+ pixels = 2;
|
||||
+ }
|
||||
+
|
||||
+ auto colorType = info.colorType();
|
||||
+ auto fRowBytes = info.minRowBytes(); // stride
|
||||
+
|
||||
+ DLOG(INFO) << "BRM: ShuffleSubchannelColorData() w=" << w << " h=" << h << " colorType=" << colorType << " fRowBytes=" << fRowBytes;
|
||||
+
|
||||
+ // second random number (for y/height)
|
||||
+ double shuffleY = base::RandDouble();
|
||||
+
|
||||
+ // calculate random coordinates using bisection
|
||||
+ auto currentW = w, currentH = h;
|
||||
+ for(;pixels >= 0; pixels--) {
|
||||
+ int x = currentW * shuffleX, y = currentH * shuffleY;
|
||||
+
|
||||
+ // calculate randomisation amounts for each RGB component
|
||||
+ uint8_t shuffleR = base::RandInt(0, 4);
|
||||
+ uint8_t shuffleG = (shuffleR + x) % 4;
|
||||
+ uint8_t shuffleB = (shuffleG + y) % 4;
|
||||
+
|
||||
+ // manipulate pixel data to slightly change the R, G, B components
|
||||
+ switch (colorType) {
|
||||
+ case kAlpha_8_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint8_t, addr, fRowBytes, x, y);
|
||||
+ auto r = SkColorGetR(*pixel), g = SkColorGetG(*pixel), b = SkColorGetB(*pixel), a = SkColorGetA(*pixel);
|
||||
+
|
||||
+ r = shuffleComponent(r, UINT8_MAX-1, shuffleR);
|
||||
+ g = shuffleComponent(g, UINT8_MAX-1, shuffleG);
|
||||
+ b = shuffleComponent(b, UINT8_MAX-1, shuffleB);
|
||||
+ // alpha is left unchanged
|
||||
+
|
||||
+ *pixel = SkColorSetARGB(a, r, g, b);
|
||||
+ }
|
||||
+ break;
|
||||
+ case kGray_8_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint8_t, addr, fRowBytes, x, y);
|
||||
+ *pixel = shuffleComponent(*pixel, UINT8_MAX-1, shuffleB);
|
||||
+ }
|
||||
+ break;
|
||||
+ case kRGB_565_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint16_t, addr, fRowBytes, x, y);
|
||||
+ unsigned r = SkPacked16ToR32(*pixel);
|
||||
+ unsigned g = SkPacked16ToG32(*pixel);
|
||||
+ unsigned b = SkPacked16ToB32(*pixel);
|
||||
+
|
||||
+ r = shuffleComponent(r, 31, shuffleR);
|
||||
+ g = shuffleComponent(g, 63, shuffleG);
|
||||
+ b = shuffleComponent(b, 31, shuffleB);
|
||||
+
|
||||
+ unsigned r16 = (r & SK_R16_MASK) << SK_R16_SHIFT;
|
||||
+ unsigned g16 = (g & SK_G16_MASK) << SK_G16_SHIFT;
|
||||
+ unsigned b16 = (b & SK_B16_MASK) << SK_B16_SHIFT;
|
||||
+
|
||||
+ *pixel = r16 | g16 | b16;
|
||||
+ }
|
||||
+ break;
|
||||
+ case kARGB_4444_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint16_t, addr, fRowBytes, x, y);
|
||||
+ auto a = SkGetPackedA4444(*pixel), r = SkGetPackedR4444(*pixel), g = SkGetPackedG4444(*pixel), b = SkGetPackedB4444(*pixel);
|
||||
+
|
||||
+ r = shuffleComponent(r, 15, shuffleR);
|
||||
+ g = shuffleComponent(g, 15, shuffleG);
|
||||
+ b = shuffleComponent(b, 15, shuffleB);
|
||||
+ // alpha is left unchanged
|
||||
+
|
||||
+ unsigned a4 = (a & 0xF) << SK_A4444_SHIFT;
|
||||
+ unsigned r4 = (r & 0xF) << SK_R4444_SHIFT;
|
||||
+ unsigned g4 = (g & 0xF) << SK_G4444_SHIFT;
|
||||
+ unsigned b4 = (b & 0xF) << SK_B4444_SHIFT;
|
||||
+
|
||||
+ *pixel = r4 | b4 | g4 | a4;
|
||||
+ }
|
||||
+ break;
|
||||
+ case kRGBA_8888_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint32_t, addr, fRowBytes, x, y);
|
||||
+ auto a = SkGetPackedA32(*pixel), r = SkGetPackedR32(*pixel), g = SkGetPackedG32(*pixel), b = SkGetPackedB32(*pixel);
|
||||
+
|
||||
+ r = shuffleComponent(r, UINT8_MAX-1, shuffleR);
|
||||
+ g = shuffleComponent(g, UINT8_MAX-1, shuffleG);
|
||||
+ b = shuffleComponent(b, UINT8_MAX-1, shuffleB);
|
||||
+ // alpha is left unchanged
|
||||
+
|
||||
+ *pixel = (a << SK_A32_SHIFT) | (r << SK_R32_SHIFT) |
|
||||
+ (g << SK_G32_SHIFT) | (b << SK_B32_SHIFT);
|
||||
+ }
|
||||
+ break;
|
||||
+ case kBGRA_8888_SkColorType:
|
||||
+ {
|
||||
+ auto *pixel = writable_addr(uint32_t, addr, fRowBytes, x, y);
|
||||
+ auto a = SkGetPackedA32(*pixel), b = SkGetPackedR32(*pixel), g = SkGetPackedG32(*pixel), r = SkGetPackedB32(*pixel);
|
||||
+
|
||||
+ r = shuffleComponent(r, UINT8_MAX-1, shuffleR);
|
||||
+ g = shuffleComponent(g, UINT8_MAX-1, shuffleG);
|
||||
+ b = shuffleComponent(b, UINT8_MAX-1, shuffleB);
|
||||
+ // alpha is left unchanged
|
||||
+
|
||||
+ *pixel = (a << SK_BGRA_A32_SHIFT) | (r << SK_BGRA_R32_SHIFT) |
|
||||
+ (g << SK_BGRA_G32_SHIFT) | (b << SK_BGRA_B32_SHIFT);
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ // the remaining formats are not expected to be used in Chromium
|
||||
+ LOG(WARNING) << "BRM: ShuffleSubchannelColorData(): Ignoring pixel format";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // keep bisecting or reset current width/height as needed
|
||||
+ if (x == 0) {
|
||||
+ currentW = w;
|
||||
+ } else {
|
||||
+ currentW = x;
|
||||
+ }
|
||||
+ if (y == 0) {
|
||||
+ currentH = h;
|
||||
+ } else {
|
||||
+ currentH = y;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#undef writable_addr
|
||||
+#undef shuffleComponent
|
||||
+
|
||||
} // namespace blink
|
||||
--- a/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
|
||||
+++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image.h
|
||||
@@ -38,6 +38,8 @@ class PLATFORM_EXPORT StaticBitmapImage
|
||||
|
||||
StaticBitmapImage(ImageOrientation orientation) : orientation_(orientation) {}
|
||||
|
||||
+ static void ShuffleSubchannelColorData(const void *addr, const SkImageInfo& info, int srcX, int srcY);
|
||||
+
|
||||
bool IsStaticBitmapImage() const override { return true; }
|
||||
|
||||
// Methods overridden by all sub-classes
|
||||
--- a/third_party/blink/renderer/platform/image-encoders/image_encoder.cc
|
||||
+++ b/third_party/blink/renderer/platform/image-encoders/image_encoder.cc
|
||||
@@ -14,6 +14,8 @@
|
||||
#include <stdio.h> // Needed by jpeglib.h
|
||||
|
||||
#include "jpeglib.h" // for JPEG_MAX_DIMENSION
|
||||
+#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
|
||||
+#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
|
||||
#include "third_party/libwebp/src/src/webp/encode.h" // for WEBP_MAX_DIMENSION
|
||||
|
||||
namespace blink {
|
||||
@@ -43,6 +45,10 @@ bool ImageEncoder::Encode(Vector<unsigne
|
||||
const SkPixmap& src,
|
||||
ImageEncodingMimeType mime_type,
|
||||
double quality) {
|
||||
+ if (RuntimeEnabledFeatures::FingerprintingCanvasImageDataNoiseEnabled()) {
|
||||
+ // shuffle subchannel color data within the pixmap
|
||||
+ StaticBitmapImage::ShuffleSubchannelColorData(src.writable_addr(), src.info(), 0, 0);
|
||||
+ }
|
||||
switch (mime_type) {
|
||||
case kMimeTypeJpeg: {
|
||||
SkJpegEncoder::Options options;
|
||||
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
@@ -2279,6 +2279,9 @@
|
||||
name: "FingerprintingCanvasMeasureTextNoise",
|
||||
},
|
||||
{
|
||||
+ name: "FingerprintingCanvasImageDataNoise",
|
||||
+ },
|
||||
+ {
|
||||
name: "Fledge",
|
||||
status: "stable",
|
||||
base_feature: "none",
|
||||
@@ -1,12 +0,0 @@
|
||||
--- a/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc
|
||||
+++ b/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc
|
||||
@@ -17,9 +17,6 @@
|
||||
// static
|
||||
void GoogleApiKeysInfoBarDelegate::Create(
|
||||
infobars::ContentInfoBarManager* infobar_manager) {
|
||||
- infobar_manager->AddInfoBar(
|
||||
- CreateConfirmInfoBar(std::unique_ptr<ConfirmInfoBarDelegate>(
|
||||
- new GoogleApiKeysInfoBarDelegate())));
|
||||
}
|
||||
|
||||
GoogleApiKeysInfoBarDelegate::GoogleApiKeysInfoBarDelegate() = default;
|
||||
@@ -1,17 +0,0 @@
|
||||
--- a/sandbox/linux/BUILD.gn
|
||||
+++ b/sandbox/linux/BUILD.gn
|
||||
@@ -299,6 +299,14 @@ if (is_linux || is_chromeos) {
|
||||
"suid/process_util_linux.c",
|
||||
"suid/sandbox.c",
|
||||
]
|
||||
+
|
||||
+ cflags = [
|
||||
+ "-fPIE",
|
||||
+ ]
|
||||
+
|
||||
+ ldflags = [
|
||||
+ "-pie",
|
||||
+ ]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
From d32e222a2706cb59f9855b9cf4330f88d1af5435 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Thu, 2 Apr 2015 12:44:23 +0200
|
||||
Subject: [PATCH 41/66] Remove EV certificates
|
||||
|
||||
The team chose to let EV certificates appear just like normal
|
||||
certificates. The web of trust is considered a failure in itself, so
|
||||
do not give users a false sense of extra security with EV certs.
|
||||
Instead, let them appear just like regular ones.
|
||||
|
||||
--- a/net/cert/ev_root_ca_metadata.cc
|
||||
+++ b/net/cert/ev_root_ca_metadata.cc
|
||||
@@ -36,7 +36,17 @@ struct EVMetadata {
|
||||
const std::string_view policy_oids[kMaxOIDsPerCA];
|
||||
};
|
||||
|
||||
-#include "net/data/ssl/chrome_root_store/chrome-ev-roots-inc.cc"
|
||||
+static const EVMetadata kEvRootCaMetadata[] = {
|
||||
+ // need some dummy thing to make compiler happy, because
|
||||
+ // arraysize() is implemented as a convoluted template rather than
|
||||
+ // the traditional sizeof(x)/sizeof(*x)
|
||||
+ { { { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } },
|
||||
+ {
|
||||
+ "0",
|
||||
+ }
|
||||
+ }
|
||||
+};
|
||||
|
||||
#endif // defined(PLATFORM_USES_CHROMIUM_EV_METADATA)
|
||||
} // namespace
|
||||
@@ -1,19 +0,0 @@
|
||||
From 7134d5fd762237ad2d80093b68ccbd1582476640 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Bauch <jojo@struktur.de>
|
||||
Date: Thu, 25 Jun 2015 15:51:59 +0200
|
||||
Subject: [PATCH 56/66] browser: disable profile auto-import on first run
|
||||
|
||||
--- a/chrome/browser/chrome_browser_main.cc
|
||||
+++ b/chrome/browser/chrome_browser_main.cc
|
||||
@@ -1588,11 +1588,6 @@ int ChromeBrowserMainParts::PreMainMessa
|
||||
// and preferences have been registered since some of the import code depends
|
||||
// on preferences.
|
||||
if (first_run::IsChromeFirstRun()) {
|
||||
- // `profile` may be nullptr even on first run, for example when the
|
||||
- // "BrowserSignin" policy is set to "Force". If so, skip the auto import.
|
||||
- if (profile) {
|
||||
- first_run::AutoImport(profile, master_prefs_->import_bookmarks_path);
|
||||
- }
|
||||
|
||||
// Note: This can pop-up the first run consent dialog on Linux & Mac.
|
||||
first_run::DoPostImportTasks(master_prefs_->make_chrome_default_for_user);
|
||||
@@ -1,21 +0,0 @@
|
||||
From d3dcad96b3c2091026c3a81054bb3ce56538a702 Mon Sep 17 00:00:00 2001
|
||||
From: Jan Engelhardt <jengelh@inai.de>
|
||||
Date: Thu, 29 Jan 2015 10:46:40 +0100
|
||||
Subject: [PATCH 16/66] mime_util: force text/x-suse-ymp to be downloaded
|
||||
|
||||
YMP files (YaST One Click Install) are plaintext XML, but also not
|
||||
very interesting in themselves. Force them to be stored.
|
||||
---
|
||||
components/mime_util/mime_util.cc | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/third_party/blink/common/mime_util/mime_util.cc
|
||||
+++ b/third_party/blink/common/mime_util/mime_util.cc
|
||||
@@ -88,6 +88,7 @@ constexpr auto kUnsupportedTextTypes =
|
||||
"text/x-csv",
|
||||
"text/x-vcf",
|
||||
"text/rtf",
|
||||
+ "text/x-suse-ymp",
|
||||
"text/comma-separated-values",
|
||||
"text/csv",
|
||||
"text/tab-separated-values",
|
||||
@@ -1,21 +0,0 @@
|
||||
--- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
||||
@@ -74,6 +74,7 @@ class FrameGrabHandle : public views::Vi
|
||||
// Reserve some space for the frame to be grabbed by, even if the tabstrip
|
||||
// is full.
|
||||
// TODO(tbergquist): Define this relative to the NTB insets again.
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("remove-grab-handle")) return gfx::Size(0, 0);
|
||||
return gfx::Size(42, 0);
|
||||
}
|
||||
};
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -68,4 +68,8 @@
|
||||
"Disable QR Generator",
|
||||
"Disables the QR generator for sharing page links. ungoogled-chromium flag",
|
||||
kOsDesktop, FEATURE_VALUE_TYPE(kDisableQRGenerator)},
|
||||
+ {"remove-grab-handle",
|
||||
+ "Remove Grab Handle",
|
||||
+ "Removes the reserved empty space in the tabstrip for moving the window. ungoogled-chromium flag",
|
||||
+ kOsDesktop, SINGLE_VALUE_TYPE("remove-grab-handle")},
|
||||
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
|
||||
@@ -1,46 +0,0 @@
|
||||
--- a/chrome/browser/ui/qrcode_generator/qrcode_generator_bubble_controller.cc
|
||||
+++ b/chrome/browser/ui/qrcode_generator/qrcode_generator_bubble_controller.cc
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/prefs/pref_change_registrar.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
+#include "components/sharing_message/features.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
@@ -38,7 +39,7 @@ QRCodeGeneratorBubbleController::~QRCode
|
||||
|
||||
// static
|
||||
bool QRCodeGeneratorBubbleController::IsGeneratorAvailable(const GURL& url) {
|
||||
- if (!url.SchemeIsHTTPOrHTTPS()) {
|
||||
+ if (!url.SchemeIsHTTPOrHTTPS() || base::FeatureList::IsEnabled(kDisableQRGenerator)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -64,4 +64,8 @@
|
||||
"Remove Tabsearch Button",
|
||||
"Removes the tabsearch button from the tabstrip. ungoogled-chromium flag",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("remove-tabsearch-button")},
|
||||
+ {"disable-qr-generator",
|
||||
+ "Disable QR Generator",
|
||||
+ "Disables the QR generator for sharing page links. ungoogled-chromium flag",
|
||||
+ kOsDesktop, FEATURE_VALUE_TYPE(kDisableQRGenerator)},
|
||||
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
|
||||
--- a/components/sharing_message/features.cc
|
||||
+++ b/components/sharing_message/features.cc
|
||||
@@ -7,3 +7,5 @@
|
||||
#include "build/build_config.h"
|
||||
|
||||
BASE_FEATURE(kClickToCall, "ClickToCall", base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+
|
||||
+BASE_FEATURE(kDisableQRGenerator, "DisableQRGenerator", base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
--- a/components/sharing_message/features.h
|
||||
+++ b/components/sharing_message/features.h
|
||||
@@ -10,4 +10,5 @@
|
||||
|
||||
BASE_DECLARE_FEATURE(kClickToCall);
|
||||
|
||||
+BASE_DECLARE_FEATURE(kDisableQRGenerator);
|
||||
#endif // COMPONENTS_SHARING_MESSAGE_FEATURES_H_
|
||||
@@ -1,64 +0,0 @@
|
||||
--- a/chrome/browser/ui/browser_command_controller.cc
|
||||
+++ b/chrome/browser/ui/browser_command_controller.cc
|
||||
@@ -1585,7 +1585,8 @@ void BrowserCommandController::InitComma
|
||||
command_updater_.UpdateCommandEnabled(IDC_WINDOW_CLOSE_OTHER_TABS,
|
||||
normal_window);
|
||||
|
||||
- const bool enable_tab_search_commands = browser_->is_type_normal();
|
||||
+ const bool enable_tab_search_commands = browser_->is_type_normal() &&
|
||||
+ !base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button");
|
||||
command_updater_.UpdateCommandEnabled(IDC_TAB_SEARCH,
|
||||
enable_tab_search_commands);
|
||||
command_updater_.UpdateCommandEnabled(IDC_TAB_SEARCH_CLOSE,
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -594,6 +594,10 @@ static std::string GetCountryCode() {
|
||||
}
|
||||
|
||||
bool HasTabSearchToolbarButton() {
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button")) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
static const bool is_tab_search_moving = [] {
|
||||
if (GetCountryCode() == "us" &&
|
||||
base::FeatureList::IsEnabled(
|
||||
--- a/chrome/browser/ui/views/frame/browser_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/browser_view.cc
|
||||
@@ -5148,6 +5148,7 @@ void BrowserView::AddedToWidget() {
|
||||
|
||||
toolbar_->Init();
|
||||
|
||||
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button"))
|
||||
if (GetIsNormalType()) {
|
||||
if (features::HasTabSearchToolbarButton()) {
|
||||
tab_search_bubble_host_ = std::make_unique<TabSearchBubbleHost>(
|
||||
--- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "chrome/browser/ui/views/frame/tab_strip_region_view.h"
|
||||
|
||||
+#include "base/command_line.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
@@ -127,6 +128,7 @@ TabStripRegionView::TabStripRegionView(s
|
||||
std::unique_ptr<TabStripActionContainer> tab_strip_action_container;
|
||||
std::unique_ptr<ProductSpecificationsButton> product_specifications_button;
|
||||
if (browser &&
|
||||
+ !base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button") &&
|
||||
(browser->GetType() == BrowserWindowInterface::Type::TYPE_NORMAL)) {
|
||||
if (features::HasTabSearchToolbarButton()) {
|
||||
tab_strip_action_container = std::make_unique<TabStripActionContainer>(
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -60,4 +60,8 @@
|
||||
"Clear data on exit",
|
||||
"Clears all browsing data on exit. ungoogled-chromium flag",
|
||||
kOsDesktop, FEATURE_VALUE_TYPE(features::kClearDataOnExit)},
|
||||
+ {"remove-tabsearch-button",
|
||||
+ "Remove Tabsearch Button",
|
||||
+ "Removes the tabsearch button from the tabstrip. ungoogled-chromium flag",
|
||||
+ kOsDesktop, SINGLE_VALUE_TYPE("remove-tabsearch-button")},
|
||||
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
|
||||
@@ -1,29 +0,0 @@
|
||||
--- a/chrome/browser/sharing_hub/sharing_hub_features.cc
|
||||
+++ b/chrome/browser/sharing_hub/sharing_hub_features.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "chrome/browser/sharing_hub/sharing_hub_features.h"
|
||||
|
||||
+#include "base/command_line.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
@@ -36,6 +37,7 @@ bool ScreenshotsDisabledByPolicy(content
|
||||
} // namespace
|
||||
|
||||
bool SharingHubOmniboxEnabled(content::BrowserContext* context) {
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("disable-sharing-hub")) return false;
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
return false;
|
||||
#else
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -96,4 +96,8 @@
|
||||
"Custom HTTP Accept Header",
|
||||
"Set a custom value for the Accept header which is sent by the browser with every HTTP request. (e.g. `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8`). ungoogled-chromium flag.",
|
||||
kOsAll, ORIGIN_LIST_VALUE_TYPE("http-accept-header", "")},
|
||||
+ {"disable-sharing-hub",
|
||||
+ "Disable Sharing Hub",
|
||||
+ "Disables the sharing hub button. ungoogled-chromium flag.",
|
||||
+ kOsDesktop, SINGLE_VALUE_TYPE("disable-sharing-hub")},
|
||||
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
|
||||
@@ -1,247 +0,0 @@
|
||||
# Disables file download quarantining
|
||||
|
||||
--- a/components/download/internal/common/base_file.cc
|
||||
+++ b/components/download/internal/common/base_file.cc
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "components/download/public/common/download_interrupt_reasons_utils.h"
|
||||
#include "components/download/public/common/download_item.h"
|
||||
#include "components/download/public/common/download_stats.h"
|
||||
-#include "components/services/quarantine/quarantine.h"
|
||||
#include "crypto/secure_hash.h"
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
@@ -563,94 +562,10 @@ DownloadInterruptReason BaseFile::Publis
|
||||
}
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
-namespace {
|
||||
-
|
||||
-DownloadInterruptReason QuarantineFileResultToReason(
|
||||
- quarantine::mojom::QuarantineFileResult result) {
|
||||
- switch (result) {
|
||||
- case quarantine::mojom::QuarantineFileResult::OK:
|
||||
- return DOWNLOAD_INTERRUPT_REASON_NONE;
|
||||
- case quarantine::mojom::QuarantineFileResult::VIRUS_INFECTED:
|
||||
- return DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED;
|
||||
- case quarantine::mojom::QuarantineFileResult::SECURITY_CHECK_FAILED:
|
||||
- return DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED;
|
||||
- case quarantine::mojom::QuarantineFileResult::BLOCKED_BY_POLICY:
|
||||
- return DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED;
|
||||
- case quarantine::mojom::QuarantineFileResult::ACCESS_DENIED:
|
||||
- return DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED;
|
||||
-
|
||||
- case quarantine::mojom::QuarantineFileResult::FILE_MISSING:
|
||||
- // Don't have a good interrupt reason here. This return code means that
|
||||
- // the file at |full_path_| went missing before QuarantineFile got to
|
||||
- // look at it. Not expected to happen, but we've seen instances where a
|
||||
- // file goes missing immediately after BaseFile closes the handle.
|
||||
- //
|
||||
- // Intentionally using a different error message than
|
||||
- // SECURITY_CHECK_FAILED in order to distinguish the two.
|
||||
- return DOWNLOAD_INTERRUPT_REASON_FILE_FAILED;
|
||||
-
|
||||
- case quarantine::mojom::QuarantineFileResult::ANNOTATION_FAILED:
|
||||
- // This means that the mark-of-the-web couldn't be applied. The file is
|
||||
- // already on the file system under its final target name.
|
||||
- //
|
||||
- // Causes of failed annotations typically aren't transient. E.g. the
|
||||
- // target file system may not support extended attributes or alternate
|
||||
- // streams. We are going to allow these downloads to progress on the
|
||||
- // assumption that failures to apply MOTW can't reliably be introduced
|
||||
- // remotely.
|
||||
- return DOWNLOAD_INTERRUPT_REASON_NONE;
|
||||
- }
|
||||
- return DOWNLOAD_INTERRUPT_REASON_FILE_FAILED;
|
||||
-}
|
||||
-
|
||||
-} // namespace
|
||||
-
|
||||
// static
|
||||
GURL BaseFile::GetEffectiveAuthorityURL(const GURL& source_url,
|
||||
const GURL& referrer_url) {
|
||||
- if (source_url.is_valid()) {
|
||||
- // http{,s} has an authority and are supported.
|
||||
- if (source_url.SchemeIsHTTPOrHTTPS())
|
||||
- return source_url;
|
||||
-
|
||||
- // If the download source is file:// ideally we should copy the MOTW from
|
||||
- // the original file, but given that Chrome/Chromium places strict
|
||||
- // restrictions on which schemes can reference file:// URLs, this code is
|
||||
- // going to assume that at this point it's okay to treat this download as
|
||||
- // being from the local system.
|
||||
- if (source_url.SchemeIsFile())
|
||||
return source_url;
|
||||
-
|
||||
- // ftp:// has an authority.
|
||||
- if (source_url.SchemeIs(url::kFtpScheme))
|
||||
- return source_url;
|
||||
-
|
||||
- if (source_url.SchemeIs(url::kBlobScheme))
|
||||
- return url::Origin::Create(source_url).GetURL();
|
||||
- }
|
||||
-
|
||||
- if (referrer_url.is_valid() && referrer_url.SchemeIsHTTPOrHTTPS())
|
||||
- return referrer_url;
|
||||
-
|
||||
- return GURL();
|
||||
-}
|
||||
-
|
||||
-void BaseFile::OnFileQuarantined(
|
||||
- quarantine::mojom::QuarantineFileResult result) {
|
||||
- DCHECK(on_annotation_done_callback_);
|
||||
- quarantine_service_.reset();
|
||||
- std::move(on_annotation_done_callback_)
|
||||
- .Run(QuarantineFileResultToReason(result));
|
||||
-}
|
||||
-
|
||||
-void BaseFile::OnQuarantineServiceError(const GURL& source_url,
|
||||
- const GURL& referrer_url) {
|
||||
-#if BUILDFLAG(IS_WIN)
|
||||
- OnFileQuarantined(quarantine::SetInternetZoneIdentifierDirectly(
|
||||
- full_path_, source_url, referrer_url));
|
||||
-#else // !BUILDFLAG(IS_WIN)
|
||||
- NOTREACHED() << "In-process quarantine service should not have failed.";
|
||||
-#endif // !BUILDFLAG(IS_WIN)
|
||||
}
|
||||
|
||||
void BaseFile::AnnotateWithSourceInformation(
|
||||
@@ -660,32 +575,8 @@ void BaseFile::AnnotateWithSourceInforma
|
||||
const std::optional<url::Origin>& request_initiator,
|
||||
mojo::PendingRemote<quarantine::mojom::Quarantine> remote_quarantine,
|
||||
OnAnnotationDoneCallback on_annotation_done_callback) {
|
||||
- GURL authority_url = GetEffectiveAuthorityURL(source_url, referrer_url);
|
||||
- if (!remote_quarantine) {
|
||||
-#if BUILDFLAG(IS_WIN)
|
||||
- quarantine::mojom::QuarantineFileResult result =
|
||||
- quarantine::SetInternetZoneIdentifierDirectly(full_path_, authority_url,
|
||||
- referrer_url);
|
||||
-#else
|
||||
- quarantine::mojom::QuarantineFileResult result =
|
||||
- quarantine::mojom::QuarantineFileResult::ANNOTATION_FAILED;
|
||||
-#endif
|
||||
- std::move(on_annotation_done_callback)
|
||||
- .Run(QuarantineFileResultToReason(result));
|
||||
- } else {
|
||||
- quarantine_service_.Bind(std::move(remote_quarantine));
|
||||
-
|
||||
- on_annotation_done_callback_ = std::move(on_annotation_done_callback);
|
||||
-
|
||||
- quarantine_service_.set_disconnect_handler(base::BindOnce(
|
||||
- &BaseFile::OnQuarantineServiceError, weak_factory_.GetWeakPtr(),
|
||||
- authority_url, referrer_url));
|
||||
-
|
||||
- quarantine_service_->QuarantineFile(
|
||||
- full_path_, authority_url, referrer_url, request_initiator, client_guid,
|
||||
- base::BindOnce(&BaseFile::OnFileQuarantined,
|
||||
- weak_factory_.GetWeakPtr()));
|
||||
- }
|
||||
+ std::move(on_annotation_done_callback)
|
||||
+ .Run(DOWNLOAD_INTERRUPT_REASON_NONE);
|
||||
}
|
||||
|
||||
} // namespace download
|
||||
--- a/content/browser/BUILD.gn
|
||||
+++ b/content/browser/BUILD.gn
|
||||
@@ -138,7 +138,6 @@ source_set("browser") {
|
||||
"//components/performance_manager/scenario_api",
|
||||
"//components/power_monitor",
|
||||
"//components/services/filesystem:lib",
|
||||
- "//components/services/quarantine",
|
||||
"//components/services/storage",
|
||||
"//components/services/storage:filesystem_proxy_factory",
|
||||
"//components/services/storage/dom_storage:local_storage_proto",
|
||||
--- a/content/browser/file_system_access/file_system_access_safe_move_helper.cc
|
||||
+++ b/content/browser/file_system_access/file_system_access_safe_move_helper.cc
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "base/task/thread_pool.h"
|
||||
#include "base/thread_annotations.h"
|
||||
#include "build/build_config.h"
|
||||
-#include "components/services/quarantine/quarantine.h"
|
||||
#include "content/browser/file_system_access/features.h"
|
||||
#include "content/browser/file_system_access/file_system_access_error.h"
|
||||
#include "content/public/browser/content_browser_client.h"
|
||||
@@ -229,22 +228,9 @@ void FileSystemAccessSafeMoveHelper::Did
|
||||
// not exist anymore. In case of error, the source file URL will point to a
|
||||
// valid filesystem location.
|
||||
base::OnceCallback<void(base::File::Error)> result_callback;
|
||||
- if (RequireQuarantine()) {
|
||||
- GURL referrer_url = manager_->is_off_the_record() ? GURL() : context_.url;
|
||||
- mojo::Remote<quarantine::mojom::Quarantine> quarantine_remote;
|
||||
- if (quarantine_connection_callback_) {
|
||||
- quarantine_connection_callback_.Run(
|
||||
- quarantine_remote.BindNewPipeAndPassReceiver());
|
||||
- }
|
||||
- result_callback =
|
||||
- base::BindOnce(&FileSystemAccessSafeMoveHelper::DidFileDoQuarantine,
|
||||
- weak_factory_.GetWeakPtr(), dest_url(), referrer_url,
|
||||
- std::move(quarantine_remote));
|
||||
- } else {
|
||||
result_callback =
|
||||
base::BindOnce(&FileSystemAccessSafeMoveHelper::DidFileSkipQuarantine,
|
||||
weak_factory_.GetWeakPtr());
|
||||
- }
|
||||
manager_->DoFileSystemOperation(
|
||||
FROM_HERE, &storage::FileSystemOperationRunner::Move,
|
||||
std::move(result_callback), source_url(), dest_url(), options_,
|
||||
@@ -261,7 +247,6 @@ void FileSystemAccessSafeMoveHelper::Did
|
||||
void FileSystemAccessSafeMoveHelper::DidFileDoQuarantine(
|
||||
const storage::FileSystemURL& target_url,
|
||||
const GURL& referrer_url,
|
||||
- mojo::Remote<quarantine::mojom::Quarantine> quarantine_remote,
|
||||
base::File::Error result) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
@@ -292,40 +277,9 @@ void FileSystemAccessSafeMoveHelper::Did
|
||||
referrer_url.is_valid() && referrer_url.SchemeIsHTTPOrHTTPS()
|
||||
? referrer_url
|
||||
: GURL();
|
||||
-
|
||||
- if (quarantine_remote) {
|
||||
- quarantine::mojom::Quarantine* raw_quarantine = quarantine_remote.get();
|
||||
- raw_quarantine->QuarantineFile(
|
||||
- target_url.path(), authority_url, referrer_url,
|
||||
- // TODO(crbug.com/351165321): Consider propagating request_initiator
|
||||
- // information here.
|
||||
- /*request_initiator=*/std::nullopt,
|
||||
- GetContentClient()
|
||||
- ->browser()
|
||||
- ->GetApplicationClientGUIDForQuarantineCheck(),
|
||||
- mojo::WrapCallbackWithDefaultInvokeIfNotRun(
|
||||
- base::BindOnce(&FileSystemAccessSafeMoveHelper::DidAnnotateFile,
|
||||
- weak_factory_.GetWeakPtr(),
|
||||
- std::move(quarantine_remote)),
|
||||
- quarantine::mojom::QuarantineFileResult::ANNOTATION_FAILED));
|
||||
- } else {
|
||||
-#if BUILDFLAG(IS_WIN)
|
||||
- base::ThreadPool::PostTaskAndReplyWithResult(
|
||||
- FROM_HERE, {base::MayBlock()},
|
||||
- base::BindOnce(&quarantine::SetInternetZoneIdentifierDirectly,
|
||||
- target_url.path(), authority_url, referrer_url),
|
||||
- base::BindOnce(&FileSystemAccessSafeMoveHelper::DidAnnotateFile,
|
||||
- weak_factory_.GetWeakPtr(),
|
||||
- std::move(quarantine_remote)));
|
||||
-#else
|
||||
- DidAnnotateFile(std::move(quarantine_remote),
|
||||
- quarantine::mojom::QuarantineFileResult::ANNOTATION_FAILED);
|
||||
-#endif
|
||||
- }
|
||||
}
|
||||
|
||||
void FileSystemAccessSafeMoveHelper::DidAnnotateFile(
|
||||
- mojo::Remote<quarantine::mojom::Quarantine> quarantine_remote,
|
||||
quarantine::mojom::QuarantineFileResult result) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
--- a/content/browser/file_system_access/file_system_access_safe_move_helper.h
|
||||
+++ b/content/browser/file_system_access/file_system_access_safe_move_helper.h
|
||||
@@ -66,10 +66,8 @@ class CONTENT_EXPORT FileSystemAccessSaf
|
||||
void DidFileDoQuarantine(
|
||||
const storage::FileSystemURL& target_url,
|
||||
const GURL& referrer_url,
|
||||
- mojo::Remote<quarantine::mojom::Quarantine> quarantine_remote,
|
||||
base::File::Error result);
|
||||
void DidAnnotateFile(
|
||||
- mojo::Remote<quarantine::mojom::Quarantine> quarantine_remote,
|
||||
quarantine::mojom::QuarantineFileResult result);
|
||||
|
||||
void ComputeHashForSourceFile(HashCallback callback);
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/components/download/public/common/download_features.cc
|
||||
+++ b/components/download/public/common/download_features.cc
|
||||
@@ -44,7 +44,7 @@ BASE_FEATURE(kRefreshExpirationDate,
|
||||
|
||||
BASE_FEATURE(kDisplayInitiatorOrigin,
|
||||
"DownloadsDisplayInitiatorOrigin",
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
BASE_FEATURE(kDownloadNotificationServiceUnifiedAPI,
|
||||
"DownloadNotificationServiceUnifiedAPI",
|
||||
@@ -1,22 +0,0 @@
|
||||
# Disables omission of URL elements in Omnibox and status bubble
|
||||
|
||||
--- a/chrome/browser/ui/status_bubble.h
|
||||
+++ b/chrome/browser/ui/status_bubble.h
|
||||
@@ -17,7 +17,7 @@ class GURL;
|
||||
class StatusBubble {
|
||||
public:
|
||||
// On hover, expand status bubble to fit long URL after this delay.
|
||||
- static const int kExpandHoverDelayMS = 1600;
|
||||
+ static const int kExpandHoverDelayMS = 0;
|
||||
|
||||
virtual ~StatusBubble() = default;
|
||||
|
||||
--- a/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.cc
|
||||
+++ b/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.cc
|
||||
@@ -268,5 +268,5 @@ TemplateURLService* ChromeLocationBarMod
|
||||
// static
|
||||
void ChromeLocationBarModelDelegate::RegisterProfilePrefs(
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
- registry->RegisterBooleanPref(omnibox::kPreventUrlElisionsInOmnibox, false);
|
||||
+ registry->RegisterBooleanPref(omnibox::kPreventUrlElisionsInOmnibox, true);
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
# Enable extra locales not normally shipped with Chromium on desktop
|
||||
|
||||
--- a/build/config/locales.gni
|
||||
+++ b/build/config/locales.gni
|
||||
@@ -186,12 +186,6 @@ _non_android_locales = [ "cy" ]
|
||||
|
||||
# Setup |platform_pak_locales| for each platform.
|
||||
platform_pak_locales = all_chrome_locales
|
||||
-if (is_android) {
|
||||
- platform_pak_locales -= _non_android_locales
|
||||
- extended_locales -= _non_android_locales
|
||||
-} else {
|
||||
- platform_pak_locales -= extended_locales
|
||||
-}
|
||||
|
||||
# The base list for all platforms except Android excludes the extended locales.
|
||||
# Add or subtract platform specific locales below.
|
||||
--- a/chrome/app/resources/locale_settings_linux.grd
|
||||
+++ b/chrome/app/resources/locale_settings_linux.grd
|
||||
@@ -4,11 +4,11 @@
|
||||
<output filename="grit/platform_locale_settings.h" type="rc_header">
|
||||
<emit emit_type='prepend'></emit>
|
||||
</output>
|
||||
- <if expr="is_android">
|
||||
<output filename="platform_locale_settings_as.pak" type="data_package" lang="as" />
|
||||
<output filename="platform_locale_settings_az.pak" type="data_package" lang="az" />
|
||||
<output filename="platform_locale_settings_be.pak" type="data_package" lang="be" />
|
||||
<output filename="platform_locale_settings_bs.pak" type="data_package" lang="bs" />
|
||||
+ <output filename="platform_locale_settings_cy.pak" type="data_package" lang="cy" />
|
||||
<output filename="platform_locale_settings_eu.pak" type="data_package" lang="eu" />
|
||||
<output filename="platform_locale_settings_fr-CA.pak" type="data_package" lang="fr-CA" />
|
||||
<output filename="platform_locale_settings_gl.pak" type="data_package" lang="gl" />
|
||||
@@ -31,7 +31,6 @@
|
||||
<output filename="platform_locale_settings_uz.pak" type="data_package" lang="uz" />
|
||||
<output filename="platform_locale_settings_zh-HK.pak" type="data_package" lang="zh-HK" />
|
||||
<output filename="platform_locale_settings_zu.pak" type="data_package" lang="zu" />
|
||||
- </if>
|
||||
<output filename="platform_locale_settings_af.pak" type="data_package" lang="af" />
|
||||
<output filename="platform_locale_settings_am.pak" type="data_package" lang="am" />
|
||||
<output filename="platform_locale_settings_ar.pak" type="data_package" lang="ar" />
|
||||
--- a/chrome/app/resources/locale_settings_mac.grd
|
||||
+++ b/chrome/app/resources/locale_settings_mac.grd
|
||||
@@ -4,6 +4,33 @@
|
||||
<output filename="grit/platform_locale_settings.h" type="rc_header">
|
||||
<emit emit_type='prepend'></emit>
|
||||
</output>
|
||||
+ <output filename="platform_locale_settings_as.pak" type="data_package" lang="as" />
|
||||
+ <output filename="platform_locale_settings_az.pak" type="data_package" lang="az" />
|
||||
+ <output filename="platform_locale_settings_be.pak" type="data_package" lang="be" />
|
||||
+ <output filename="platform_locale_settings_bs.pak" type="data_package" lang="bs" />
|
||||
+ <output filename="platform_locale_settings_cy.pak" type="data_package" lang="cy" />
|
||||
+ <output filename="platform_locale_settings_eu.pak" type="data_package" lang="eu" />
|
||||
+ <output filename="platform_locale_settings_fr-CA.pak" type="data_package" lang="fr-CA" />
|
||||
+ <output filename="platform_locale_settings_gl.pak" type="data_package" lang="gl" />
|
||||
+ <output filename="platform_locale_settings_hy.pak" type="data_package" lang="hy" />
|
||||
+ <output filename="platform_locale_settings_is.pak" type="data_package" lang="is" />
|
||||
+ <output filename="platform_locale_settings_ka.pak" type="data_package" lang="ka" />
|
||||
+ <output filename="platform_locale_settings_kk.pak" type="data_package" lang="kk" />
|
||||
+ <output filename="platform_locale_settings_km.pak" type="data_package" lang="km" />
|
||||
+ <output filename="platform_locale_settings_ky.pak" type="data_package" lang="ky" />
|
||||
+ <output filename="platform_locale_settings_lo.pak" type="data_package" lang="lo" />
|
||||
+ <output filename="platform_locale_settings_mk.pak" type="data_package" lang="mk" />
|
||||
+ <output filename="platform_locale_settings_mn.pak" type="data_package" lang="mn" />
|
||||
+ <output filename="platform_locale_settings_my.pak" type="data_package" lang="my" />
|
||||
+ <output filename="platform_locale_settings_ne.pak" type="data_package" lang="ne" />
|
||||
+ <output filename="platform_locale_settings_or.pak" type="data_package" lang="or" />
|
||||
+ <output filename="platform_locale_settings_pa.pak" type="data_package" lang="pa" />
|
||||
+ <output filename="platform_locale_settings_si.pak" type="data_package" lang="si" />
|
||||
+ <output filename="platform_locale_settings_sq.pak" type="data_package" lang="sq" />
|
||||
+ <output filename="platform_locale_settings_sr-Latn.pak" type="data_package" lang="sr-Latn" />
|
||||
+ <output filename="platform_locale_settings_uz.pak" type="data_package" lang="uz" />
|
||||
+ <output filename="platform_locale_settings_zh-HK.pak" type="data_package" lang="zh-HK" />
|
||||
+ <output filename="platform_locale_settings_zu.pak" type="data_package" lang="zu" />
|
||||
<output filename="platform_locale_settings_af.pak" type="data_package" lang="af" />
|
||||
<output filename="platform_locale_settings_am.pak" type="data_package" lang="am" />
|
||||
<output filename="platform_locale_settings_ar.pak" type="data_package" lang="ar" />
|
||||
--- a/chrome/app/resources/locale_settings_win.grd
|
||||
+++ b/chrome/app/resources/locale_settings_win.grd
|
||||
@@ -4,6 +4,33 @@
|
||||
<output filename="grit/platform_locale_settings.h" type="rc_header">
|
||||
<emit emit_type='prepend'></emit>
|
||||
</output>
|
||||
+ <output filename="platform_locale_settings_as.pak" type="data_package" lang="as" />
|
||||
+ <output filename="platform_locale_settings_az.pak" type="data_package" lang="az" />
|
||||
+ <output filename="platform_locale_settings_be.pak" type="data_package" lang="be" />
|
||||
+ <output filename="platform_locale_settings_bs.pak" type="data_package" lang="bs" />
|
||||
+ <output filename="platform_locale_settings_cy.pak" type="data_package" lang="cy" />
|
||||
+ <output filename="platform_locale_settings_eu.pak" type="data_package" lang="eu" />
|
||||
+ <output filename="platform_locale_settings_fr-CA.pak" type="data_package" lang="fr-CA" />
|
||||
+ <output filename="platform_locale_settings_gl.pak" type="data_package" lang="gl" />
|
||||
+ <output filename="platform_locale_settings_hy.pak" type="data_package" lang="hy" />
|
||||
+ <output filename="platform_locale_settings_is.pak" type="data_package" lang="is" />
|
||||
+ <output filename="platform_locale_settings_ka.pak" type="data_package" lang="ka" />
|
||||
+ <output filename="platform_locale_settings_kk.pak" type="data_package" lang="kk" />
|
||||
+ <output filename="platform_locale_settings_km.pak" type="data_package" lang="km" />
|
||||
+ <output filename="platform_locale_settings_ky.pak" type="data_package" lang="ky" />
|
||||
+ <output filename="platform_locale_settings_lo.pak" type="data_package" lang="lo" />
|
||||
+ <output filename="platform_locale_settings_mk.pak" type="data_package" lang="mk" />
|
||||
+ <output filename="platform_locale_settings_mn.pak" type="data_package" lang="mn" />
|
||||
+ <output filename="platform_locale_settings_my.pak" type="data_package" lang="my" />
|
||||
+ <output filename="platform_locale_settings_ne.pak" type="data_package" lang="ne" />
|
||||
+ <output filename="platform_locale_settings_or.pak" type="data_package" lang="or" />
|
||||
+ <output filename="platform_locale_settings_pa.pak" type="data_package" lang="pa" />
|
||||
+ <output filename="platform_locale_settings_si.pak" type="data_package" lang="si" />
|
||||
+ <output filename="platform_locale_settings_sq.pak" type="data_package" lang="sq" />
|
||||
+ <output filename="platform_locale_settings_sr-Latn.pak" type="data_package" lang="sr-Latn" />
|
||||
+ <output filename="platform_locale_settings_uz.pak" type="data_package" lang="uz" />
|
||||
+ <output filename="platform_locale_settings_zh-HK.pak" type="data_package" lang="zh-HK" />
|
||||
+ <output filename="platform_locale_settings_zu.pak" type="data_package" lang="zu" />
|
||||
<output filename="platform_locale_settings_af.pak" type="data_package" lang="af" />
|
||||
<output filename="platform_locale_settings_am.pak" type="data_package" lang="am" />
|
||||
<output filename="platform_locale_settings_ar.pak" type="data_package" lang="ar" />
|
||||
@@ -1,77 +0,0 @@
|
||||
# Add more URL schemes allowed for saving
|
||||
|
||||
--- a/chrome/browser/ui/browser_commands.cc
|
||||
+++ b/chrome/browser/ui/browser_commands.cc
|
||||
@@ -611,11 +611,6 @@ int GetContentRestrictions(const Browser
|
||||
CoreTabHelper* core_tab_helper =
|
||||
CoreTabHelper::FromWebContents(current_tab);
|
||||
content_restrictions = core_tab_helper->content_restrictions();
|
||||
- NavigationEntry* last_committed_entry =
|
||||
- current_tab->GetController().GetLastCommittedEntry();
|
||||
- if (!content::IsSavableURL(last_committed_entry->GetURL())) {
|
||||
- content_restrictions |= CONTENT_RESTRICTION_SAVE;
|
||||
- }
|
||||
}
|
||||
return content_restrictions;
|
||||
}
|
||||
@@ -1938,8 +1933,7 @@ bool CanSavePage(const Browser* browser)
|
||||
policy::DownloadRestriction::ALL_FILES) {
|
||||
return false;
|
||||
}
|
||||
- return !browser->is_type_devtools() &&
|
||||
- !(GetContentRestrictions(browser) & CONTENT_RESTRICTION_SAVE);
|
||||
+ return true;
|
||||
}
|
||||
|
||||
void Print(Browser* browser) {
|
||||
--- a/components/offline_pages/core/offline_page_model.cc
|
||||
+++ b/components/offline_pages/core/offline_page_model.cc
|
||||
@@ -21,7 +21,7 @@ OfflinePageModel::SavePageParams::~SaveP
|
||||
|
||||
// static
|
||||
bool OfflinePageModel::CanSaveURL(const GURL& url) {
|
||||
- return url.is_valid() && url.SchemeIsHTTPOrHTTPS();
|
||||
+ return url.is_valid();
|
||||
}
|
||||
|
||||
OfflinePageModel::OfflinePageModel() = default;
|
||||
--- a/content/common/url_schemes.cc
|
||||
+++ b/content/common/url_schemes.cc
|
||||
@@ -24,13 +24,21 @@ namespace {
|
||||
bool g_registered_url_schemes = false;
|
||||
|
||||
const char* const kDefaultSavableSchemes[] = {
|
||||
+ url::kAboutScheme,
|
||||
+ url::kBlobScheme,
|
||||
+ url::kContentScheme,
|
||||
url::kHttpScheme,
|
||||
url::kHttpsScheme,
|
||||
url::kFileScheme,
|
||||
url::kFileSystemScheme,
|
||||
kChromeDevToolsScheme,
|
||||
kChromeUIScheme,
|
||||
- url::kDataScheme
|
||||
+ url::kDataScheme,
|
||||
+ url::kJavaScriptScheme,
|
||||
+ url::kMailToScheme,
|
||||
+ url::kWsScheme,
|
||||
+ url::kWssScheme,
|
||||
+ kViewSourceScheme
|
||||
};
|
||||
|
||||
// These lists are lazily initialized below and are leaked on shutdown to
|
||||
--- a/content/public/common/url_utils.cc
|
||||
+++ b/content/public/common/url_utils.cc
|
||||
@@ -33,11 +33,7 @@ bool HasWebUIOrigin(const url::Origin& o
|
||||
}
|
||||
|
||||
bool IsSavableURL(const GURL& url) {
|
||||
- for (auto& scheme : GetSavableSchemes()) {
|
||||
- if (url.SchemeIs(scheme))
|
||||
- return true;
|
||||
- }
|
||||
- return false;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
bool IsURLHandledByNetworkStack(const GURL& url) {
|
||||
@@ -1,34 +0,0 @@
|
||||
--- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
||||
@@ -222,12 +222,10 @@ TabStripRegionView::TabStripRegionView(s
|
||||
new_tab_button_->GetViewAccessibility().SetName(
|
||||
l10n_util::GetStringUTF16(IDS_ACCNAME_NEWTAB));
|
||||
|
||||
-#if BUILDFLAG(IS_LINUX)
|
||||
// The New Tab Button can be middle-clicked on Linux.
|
||||
new_tab_button_->SetTriggerableEventFlags(
|
||||
new_tab_button_->GetTriggerableEventFlags() |
|
||||
ui::EF_MIDDLE_MOUSE_BUTTON);
|
||||
-#endif
|
||||
}
|
||||
|
||||
reserved_grab_handle_space_ =
|
||||
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
|
||||
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
|
||||
@@ -2273,8 +2273,6 @@ void TabStrip::NewTabButtonPressed(const
|
||||
|
||||
const ui::MouseEvent& mouse = static_cast<const ui::MouseEvent&>(event);
|
||||
if (mouse.IsOnlyMiddleMouseButton()) {
|
||||
- if (ui::Clipboard::IsSupportedClipboardBuffer(
|
||||
- ui::ClipboardBuffer::kSelection)) {
|
||||
ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
|
||||
CHECK(clipboard)
|
||||
<< "Clipboard instance is not available, cannot proceed with "
|
||||
@@ -2285,7 +2283,6 @@ void TabStrip::NewTabButtonPressed(const
|
||||
if (!clipboard_text.empty()) {
|
||||
controller_->CreateNewTabWithLocation(clipboard_text);
|
||||
}
|
||||
- }
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
--- a/components/dom_distiller/core/css/distilledpage.css
|
||||
+++ b/components/dom_distiller/core/css/distilledpage.css
|
||||
@@ -28,6 +28,11 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
+.material-icons {
|
||||
+ font-family: Material Icons;
|
||||
+ font-style: normal !important;
|
||||
+}
|
||||
+
|
||||
/* Remove all margins and padding from certain element and add word wrap. */
|
||||
|
||||
blockquote,
|
||||
@@ -1,41 +0,0 @@
|
||||
--- a/components/webui/flags/flags_state.cc
|
||||
+++ b/components/webui/flags/flags_state.cc
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
#include "build/build_config.h"
|
||||
+#include "chrome/browser/unexpire_flags.h"
|
||||
#include "components/variations/field_trial_config/field_trial_util.h"
|
||||
#include "components/variations/variations_associated_data.h"
|
||||
#include "components/variations/variations_switches.h"
|
||||
@@ -686,14 +687,19 @@ void FlagsState::GetFlagFeatureEntries(
|
||||
int current_platform = GetCurrentPlatform();
|
||||
|
||||
for (const FeatureEntry& entry : feature_entries_) {
|
||||
+ std::string desc = entry.visible_description;
|
||||
if (skip_feature_entry.Run(entry)) {
|
||||
+ if (flags::IsFlagExpired(flags_storage, entry.internal_name)) {
|
||||
+ desc.insert(0, "!!! NOTE: THIS FLAG IS EXPIRED AND MAY STOP FUNCTIONING OR BE REMOVED SOON !!! ");
|
||||
+ } else {
|
||||
continue;
|
||||
+ }
|
||||
}
|
||||
|
||||
base::Value::Dict data;
|
||||
data.Set("internal_name", entry.internal_name);
|
||||
data.Set("name", entry.visible_name);
|
||||
- data.Set("description", entry.visible_description);
|
||||
+ data.Set("description", desc);
|
||||
|
||||
base::Value::List supported_platforms;
|
||||
AddOsStrings(entry.supported_platforms, &supported_platforms);
|
||||
@@ -1102,7 +1108,9 @@ bool FlagsState::IsSupportedFeature(cons
|
||||
continue;
|
||||
}
|
||||
if (delegate_ && delegate_->ShouldExcludeFlag(storage, entry)) {
|
||||
+ if (!flags::IsFlagExpired(storage, entry.internal_name)) {
|
||||
continue;
|
||||
+ }
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
# Remove the "--disable-setuid-sandbox" command line flag as a bad flag
|
||||
|
||||
--- a/chrome/browser/ui/startup/bad_flags_prompt.cc
|
||||
+++ b/chrome/browser/ui/startup/bad_flags_prompt.cc
|
||||
@@ -77,7 +77,6 @@ const char* const kBadFlags[] = {
|
||||
sandbox::policy::switches::kDisableGpuSandbox,
|
||||
sandbox::policy::switches::kDisableLandlockSandbox,
|
||||
sandbox::policy::switches::kDisableSeccompFilterSandbox,
|
||||
- sandbox::policy::switches::kDisableSetuidSandbox,
|
||||
sandbox::policy::switches::kNoSandbox,
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
sandbox::policy::switches::kAllowThirdPartyModules,
|
||||
@@ -0,0 +1,238 @@
|
||||
--- a/extensions/common/extension_l10n_util.h
|
||||
+++ b/extensions/common/extension_l10n_util.h
|
||||
@@ -81,7 +81,8 @@ bool LocalizeManifest(const extensions::
|
||||
bool LocalizeExtension(const base::FilePath& extension_path,
|
||||
base::DictValue* manifest,
|
||||
GzippedMessagesPermission gzip_permission,
|
||||
- std::string* error);
|
||||
+ std::string* error,
|
||||
+ bool is_component = false);
|
||||
|
||||
// Adds locale_name to the extension if it's in chrome_locales, and
|
||||
// if messages file is present (we don't check content of messages file here).
|
||||
@@ -129,6 +130,11 @@ extensions::MessageBundle* LoadMessageCa
|
||||
GzippedMessagesPermission gzip_permission,
|
||||
std::string* error);
|
||||
|
||||
+extensions::MessageBundle* LoadComponentMessageCatalogs(
|
||||
+ const base::FilePath& extension_root,
|
||||
+ const std::string& default_locale,
|
||||
+ std::string* error);
|
||||
+
|
||||
// Loads message catalogs for all locales to check for validity. Used for
|
||||
// validating unpacked extensions.
|
||||
bool ValidateExtensionLocales(const base::FilePath& extension_path,
|
||||
--- a/extensions/common/extension_l10n_util.cc
|
||||
+++ b/extensions/common/extension_l10n_util.cc
|
||||
@@ -17,14 +17,18 @@
|
||||
#include "base/files/file_enumerator.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/json/json_file_value_serializer.h"
|
||||
+#include "base/json/json_string_value_serializer.h"
|
||||
#include "base/json/json_reader.h"
|
||||
#include "base/logging.h"
|
||||
+#include "base/memory/ref_counted_memory.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/strings/strcat.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
+#include "extensions/browser/component_extension_resource_manager.h"
|
||||
+#include "extensions/browser/extensions_browser_client.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "extensions/common/error_utils.h"
|
||||
#include "extensions/common/extension.h"
|
||||
@@ -37,6 +41,7 @@
|
||||
#include "third_party/icu/source/common/unicode/uloc.h"
|
||||
#include "third_party/zlib/google/compression_utils.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
+#include "ui/base/resource/resource_bundle.h"
|
||||
|
||||
namespace errors = extensions::manifest_errors;
|
||||
namespace keys = extensions::manifest_keys;
|
||||
@@ -113,6 +118,19 @@ std::optional<base::DictValue> LoadMessa
|
||||
return dictionary;
|
||||
}
|
||||
|
||||
+std::optional<base::DictValue> LoadMessageFile(
|
||||
+ int resource_id, std::string* error) {
|
||||
+ const ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
|
||||
+ JSONStringValueDeserializer messages_deserializer(
|
||||
+ base::as_string_view(*rb.LoadDataResourceBytes(resource_id)));
|
||||
+
|
||||
+ if (auto value = messages_deserializer.Deserialize(nullptr, error); value) {
|
||||
+ return std::move(*value).TakeDict();
|
||||
+ }
|
||||
+
|
||||
+ return std::nullopt;
|
||||
+}
|
||||
+
|
||||
// Localizes manifest value of string type for a given key.
|
||||
bool LocalizeManifestValue(const std::string& key,
|
||||
const extensions::MessageBundle& messages,
|
||||
@@ -360,13 +378,16 @@ bool LocalizeManifest(const extensions::
|
||||
bool LocalizeExtension(const base::FilePath& extension_path,
|
||||
base::DictValue* manifest,
|
||||
GzippedMessagesPermission gzip_permission,
|
||||
- std::string* error) {
|
||||
+ std::string* error,
|
||||
+ bool is_component) {
|
||||
DCHECK(manifest);
|
||||
|
||||
std::string default_locale = GetDefaultLocaleFromManifest(*manifest, error);
|
||||
|
||||
std::unique_ptr<extensions::MessageBundle> message_bundle(
|
||||
- extensions::file_util::LoadMessageBundle(extension_path, default_locale,
|
||||
+ is_component ? extensions::file_util::LoadComponentMessageBundle(extension_path,
|
||||
+ default_locale, error)
|
||||
+ : extensions::file_util::LoadMessageBundle(extension_path, default_locale,
|
||||
gzip_permission, error));
|
||||
|
||||
if (!message_bundle && !error->empty())
|
||||
@@ -504,6 +525,42 @@ extensions::MessageBundle* LoadMessageCa
|
||||
return extensions::MessageBundle::Create(catalogs, error);
|
||||
}
|
||||
|
||||
+extensions::MessageBundle* LoadComponentMessageCatalogs(
|
||||
+ const base::FilePath& extension_root,
|
||||
+ const std::string& default_locale,
|
||||
+ std::string* error) {
|
||||
+ std::vector<std::string> all_fallback_locales;
|
||||
+ base::FilePath locale_path(extensions::kLocaleFolder);
|
||||
+
|
||||
+ auto* manager =
|
||||
+ extensions::ExtensionsBrowserClient::Get()->GetComponentExtensionResourceManager();
|
||||
+
|
||||
+ GetAllFallbackLocales(default_locale, &all_fallback_locales);
|
||||
+
|
||||
+ extensions::MessageBundle::CatalogVector catalogs;
|
||||
+ for (const auto& fallback_locale : all_fallback_locales) {
|
||||
+ base::FilePath this_locale_path =
|
||||
+ locale_path.AppendASCII(fallback_locale)
|
||||
+ .Append(extensions::kMessagesFilename);
|
||||
+ int resource_id = 0;
|
||||
+
|
||||
+ if (!manager->IsComponentExtensionResource(
|
||||
+ extension_root, this_locale_path, &resource_id)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ std::optional<base::DictValue> catalog = LoadMessageFile(resource_id, error);
|
||||
+ if (!catalog.has_value()) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ catalogs.push_back(std::move(*catalog));
|
||||
+ }
|
||||
+
|
||||
+ return extensions::MessageBundle::Create(
|
||||
+ catalogs, error);
|
||||
+}
|
||||
+
|
||||
bool ValidateExtensionLocales(const base::FilePath& extension_path,
|
||||
const base::DictValue& manifest,
|
||||
std::u16string* error) {
|
||||
--- a/extensions/browser/l10n_file_util.h
|
||||
+++ b/extensions/browser/l10n_file_util.h
|
||||
@@ -47,7 +47,8 @@ LoadMessageBundleSubstitutionMapFromPath
|
||||
const std::vector<base::FilePath>& paths,
|
||||
const ExtensionId& extension_id,
|
||||
const std::string& default_locale,
|
||||
- extension_l10n_util::GzippedMessagesPermission gzip_permission);
|
||||
+ extension_l10n_util::GzippedMessagesPermission gzip_permission,
|
||||
+ bool is_component = false);
|
||||
|
||||
} // namespace extensions::l10n_file_util
|
||||
|
||||
--- a/extensions/browser/l10n_file_util.cc
|
||||
+++ b/extensions/browser/l10n_file_util.cc
|
||||
@@ -38,7 +38,8 @@ LoadMessageBundleSubstitutionMapFromPath
|
||||
const std::vector<base::FilePath>& paths,
|
||||
const ExtensionId& extension_id,
|
||||
const std::string& default_locale,
|
||||
- extension_l10n_util::GzippedMessagesPermission gzip_permission) {
|
||||
+ extension_l10n_util::GzippedMessagesPermission gzip_permission,
|
||||
+ bool is_component) {
|
||||
std::unique_ptr<MessageBundle::SubstitutionMap> return_value =
|
||||
LoadNonLocalizedMessageBundleSubstitutionMap(extension_id);
|
||||
|
||||
@@ -49,8 +50,13 @@ LoadMessageBundleSubstitutionMapFromPath
|
||||
|
||||
std::string error;
|
||||
for (const base::FilePath& path : paths) {
|
||||
- std::unique_ptr<MessageBundle> bundle(file_util::LoadMessageBundle(
|
||||
- path, default_locale, gzip_permission, &error));
|
||||
+ std::unique_ptr<MessageBundle> bundle(
|
||||
+ is_component
|
||||
+ ? file_util::LoadComponentMessageBundle(
|
||||
+ path, default_locale, &error)
|
||||
+ : file_util::LoadMessageBundle(
|
||||
+ path, default_locale, gzip_permission, &error));
|
||||
+
|
||||
if (bundle) {
|
||||
for (const auto& iter : *bundle->dictionary()) {
|
||||
// |insert| only adds new entries, and does not replace entries in
|
||||
--- a/extensions/common/file_util.h
|
||||
+++ b/extensions/common/file_util.h
|
||||
@@ -162,6 +162,11 @@ MessageBundle* LoadMessageBundle(
|
||||
extension_l10n_util::GzippedMessagesPermission gzip_permission,
|
||||
std::string* error);
|
||||
|
||||
+MessageBundle* LoadComponentMessageBundle(
|
||||
+ const base::FilePath& extension_root,
|
||||
+ const std::string& default_locale,
|
||||
+ std::string* error);
|
||||
+
|
||||
// Helper functions for getting paths for files used in content verification.
|
||||
base::FilePath GetVerifiedContentsPath(const base::FilePath& extension_path);
|
||||
base::FilePath GetComputedHashesPath(const base::FilePath& extension_path);
|
||||
--- a/extensions/common/file_util.cc
|
||||
+++ b/extensions/common/file_util.cc
|
||||
@@ -605,6 +605,25 @@ MessageBundle* LoadMessageBundle(
|
||||
return message_bundle;
|
||||
}
|
||||
|
||||
+MessageBundle* LoadComponentMessageBundle(
|
||||
+ const base::FilePath& extension_root,
|
||||
+ const std::string& default_locale,
|
||||
+ std::string* error) {
|
||||
+ error->clear();
|
||||
+
|
||||
+ std::set<std::string> chrome_locales;
|
||||
+ extension_l10n_util::GetAllLocales(&chrome_locales);
|
||||
+
|
||||
+ if (default_locale.empty() || !chrome_locales.contains(default_locale)) {
|
||||
+ *error = l10n_util::GetStringUTF8(
|
||||
+ IDS_EXTENSION_LOCALES_NO_DEFAULT_LOCALE_SPECIFIED);
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ return extension_l10n_util::LoadComponentMessageCatalogs(
|
||||
+ extension_root, default_locale, error);
|
||||
+}
|
||||
+
|
||||
base::FilePath GetVerifiedContentsPath(const base::FilePath& extension_path) {
|
||||
return extension_path.Append(kMetadataFolder)
|
||||
.Append(kVerifiedContentsFilename);
|
||||
--- a/extensions/browser/renderer_startup_helper.cc
|
||||
+++ b/extensions/browser/renderer_startup_helper.cc
|
||||
@@ -731,6 +731,18 @@ void RendererStartupHelper::GetMessageBu
|
||||
paths_to_load.push_back(imported_extension->path());
|
||||
}
|
||||
|
||||
+ bool is_component =
|
||||
+ extension->location() == extensions::mojom::ManifestLocation::kComponent;
|
||||
+
|
||||
+ if (is_component) {
|
||||
+ auto dictionary_map = l10n_file_util::LoadMessageBundleSubstitutionMapFromPaths(
|
||||
+ paths_to_load, extension_id, default_locale,
|
||||
+ extension_l10n_util::GzippedMessagesPermission::kAllowForTrustedSource,
|
||||
+ is_component);
|
||||
+ std::move(callback).Run(ToFlatMap(*dictionary_map));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
// This blocks tab loading. Priority is inherited from the calling context.
|
||||
base::ThreadPool::PostTaskAndReplyWithResult(
|
||||
FROM_HERE, {base::MayBlock()},
|
||||
@@ -0,0 +1,144 @@
|
||||
--- a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
|
||||
+++ b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
|
||||
@@ -98,9 +98,11 @@ class ManagedValueStoreCache::ExtensionT
|
||||
|
||||
// Loads the schemas of the |extensions| and passes a ComponentMap to
|
||||
// Register().
|
||||
+ void LoadSchemasOnUIThread(ExtensionSet extensions);
|
||||
static void LoadSchemasOnFileTaskRunner(ExtensionSet extensions,
|
||||
base::WeakPtr<ExtensionTracker> self);
|
||||
- void Register(const policy::ComponentMap* components);
|
||||
+ void Register(const policy::ComponentMap* components,
|
||||
+ ExtensionSet extensions);
|
||||
|
||||
raw_ptr<Profile> profile_;
|
||||
policy::PolicyDomain policy_domain_;
|
||||
@@ -179,6 +181,22 @@ bool ManagedValueStoreCache::ExtensionTr
|
||||
return extension->manifest()->FindPath(manifest_keys::kStorageManagedSchema);
|
||||
}
|
||||
|
||||
+void ManagedValueStoreCache::ExtensionTracker::LoadSchemasOnUIThread(ExtensionSet extensions) {
|
||||
+ auto components = std::make_unique<policy::ComponentMap>();
|
||||
+
|
||||
+ for (const auto& extension : extensions) {
|
||||
+ if (!Manifest::IsComponentLocation(extension->location())) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ (*components)[extension->id()] =
|
||||
+ StorageSchemaManifestHandler::GetComponentSchema(extension.get())
|
||||
+ .value_or(policy::Schema());
|
||||
+ }
|
||||
+
|
||||
+ schema_registry_->RegisterComponents(policy_domain_, *components);
|
||||
+}
|
||||
+
|
||||
// static
|
||||
void ManagedValueStoreCache::ExtensionTracker::LoadSchemasOnFileTaskRunner(
|
||||
ExtensionSet extensions,
|
||||
@@ -208,14 +226,21 @@ void ManagedValueStoreCache::ExtensionTr
|
||||
|
||||
content::GetUIThreadTaskRunner({})->PostTask(
|
||||
FROM_HERE, base::BindOnce(&ExtensionTracker::Register, self,
|
||||
- base::Owned(components.release())));
|
||||
+ base::Owned(components.release()),
|
||||
+ std::move(extensions)));
|
||||
}
|
||||
|
||||
void ManagedValueStoreCache::ExtensionTracker::Register(
|
||||
- const policy::ComponentMap* components) {
|
||||
+ const policy::ComponentMap* components,
|
||||
+ ExtensionSet extensions) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
schema_registry_->RegisterComponents(policy_domain_, *components);
|
||||
|
||||
+ // Our uBlock Origin component has a policy schema, but is
|
||||
+ // not anywhere on the actual filesystem - so we need to pull
|
||||
+ // it out on the UI thread from resources.
|
||||
+ LoadSchemasOnUIThread(std::move(extensions));
|
||||
+
|
||||
// The first SetExtensionsDomainsReady() call is performed after the
|
||||
// ExtensionSystem is ready, even if there are no managed extensions. It will
|
||||
// trigger a loading of the initial policy for any managed extensions, and
|
||||
--- a/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc
|
||||
+++ b/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc
|
||||
@@ -15,6 +15,8 @@
|
||||
#include "base/types/expected.h"
|
||||
#include "base/types/expected_macros.h"
|
||||
#include "components/policy/core/common/schema.h"
|
||||
+#include "extensions/browser/extensions_browser_client.h"
|
||||
+#include "extensions/browser/component_extension_resource_manager.h"
|
||||
#include "extensions/common/extension.h"
|
||||
#include "extensions/common/install_warning.h"
|
||||
#include "extensions/common/manifest.h"
|
||||
@@ -23,6 +25,7 @@
|
||||
#include "extensions/common/permissions/api_permission.h"
|
||||
#include "extensions/common/permissions/api_permission_set.h"
|
||||
#include "extensions/common/permissions/permissions_info.h"
|
||||
+#include "ui/base/resource/resource_bundle.h"
|
||||
|
||||
using extensions::manifest_keys::kStorageManagedSchema;
|
||||
|
||||
@@ -34,6 +37,33 @@ StorageSchemaManifestHandler::~StorageSc
|
||||
|
||||
// static
|
||||
base::expected<policy::Schema, std::string>
|
||||
+StorageSchemaManifestHandler::GetComponentSchema(const Extension* extension) {
|
||||
+ auto* manager =
|
||||
+ extensions::ExtensionsBrowserClient::Get()->GetComponentExtensionResourceManager();
|
||||
+ const ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
|
||||
+
|
||||
+ int resource_id;
|
||||
+ std::string path;
|
||||
+ if (const std::string* temp =
|
||||
+ extension->manifest()->FindStringPath(kStorageManagedSchema)) {
|
||||
+ path = *temp;
|
||||
+ } else {
|
||||
+ return base::unexpected(base::StringPrintf(
|
||||
+ "%s does not have a schema path", extension->id()));
|
||||
+ }
|
||||
+
|
||||
+ if (!manager->IsComponentExtensionResource(
|
||||
+ extension->path(), base::FilePath::FromUTF8Unsafe(path), &resource_id)) {
|
||||
+ return base::unexpected(base::StringPrintf(
|
||||
+ "%s/%s is not a component extension resource",
|
||||
+ base::UTF16ToUTF8(extension->path().LossyDisplayName()), path));
|
||||
+ }
|
||||
+
|
||||
+ return policy::Schema::Parse(rb.LoadDataResourceString(resource_id));
|
||||
+}
|
||||
+
|
||||
+// static
|
||||
+base::expected<policy::Schema, std::string>
|
||||
StorageSchemaManifestHandler::GetSchema(const Extension* extension) {
|
||||
std::string path;
|
||||
if (const std::string* temp =
|
||||
--- a/chrome/common/extensions/api/storage/storage_schema_manifest_handler.h
|
||||
+++ b/chrome/common/extensions/api/storage/storage_schema_manifest_handler.h
|
||||
@@ -29,6 +29,8 @@ class StorageSchemaManifestHandler : pub
|
||||
// If the schema is invalid then the Schema returned is invalid too, and
|
||||
// the failure reason is stored in |error|.
|
||||
// This function does file I/O and must be called on a thread that allows I/O.
|
||||
+ static base::expected<policy::Schema, std::string> GetComponentSchema(
|
||||
+ const Extension* extension);
|
||||
static base::expected<policy::Schema, std::string> GetSchema(
|
||||
const Extension* extension);
|
||||
|
||||
--- a/chrome/common/extensions/BUILD.gn
|
||||
+++ b/chrome/common/extensions/BUILD.gn
|
||||
@@ -82,6 +82,7 @@ source_set("extensions") {
|
||||
"//components/url_formatter",
|
||||
"//components/version_info",
|
||||
"//extensions:extensions_resources",
|
||||
+ "//extensions/browser",
|
||||
"//extensions/common",
|
||||
"//extensions/common:common_constants",
|
||||
"//extensions/common:core_api_provider",
|
||||
@@ -89,6 +90,7 @@ source_set("extensions") {
|
||||
"//extensions/strings",
|
||||
"//ui/gfx/geometry",
|
||||
"//ui/message_center/public/cpp",
|
||||
+ "//ui/base",
|
||||
"//url",
|
||||
]
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -1415,6 +1415,11 @@ inline constexpr char kExtensionCommands
|
||||
inline constexpr char kPluginsAlwaysOpenPdfExternally[] =
|
||||
"plugins.always_open_pdf_externally";
|
||||
|
||||
+// Boolean indicating that the user has rejected setting
|
||||
+// the browser as default for an indefinite amount of time.
|
||||
+inline constexpr char kHeliumDefaultBrowserRejected[] =
|
||||
+ "helium.browser.default_browser_infobar_rejected";
|
||||
+
|
||||
// Int64 containing the internal value of the time at which the default browser
|
||||
// infobar was last dismissed by the user.
|
||||
inline constexpr char kDefaultBrowserLastDeclined[] =
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -80,6 +80,8 @@ void RegisterBrowserPrefs(PrefRegistrySi
|
||||
registry->RegisterIntegerPref(prefs::kDefaultBrowserDeclinedCount, 0);
|
||||
registry->RegisterTimePref(prefs::kDefaultBrowserFirstShownTime,
|
||||
base::Time());
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumDefaultBrowserRejected, false);
|
||||
+
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
|
||||
registry->RegisterTimePref(prefs::kPdfInfoBarLastShown, base::Time());
|
||||
registry->RegisterIntegerPref(prefs::kPdfInfoBarTimesShown, 0);
|
||||
--- a/chrome/browser/ui/startup/infobar_utils.cc
|
||||
+++ b/chrome/browser/ui/startup/infobar_utils.cc
|
||||
@@ -211,6 +211,11 @@ void AddInfoBarsIfNecessary(BrowserWindo
|
||||
}
|
||||
#endif
|
||||
|
||||
+ PrefService* local_state = g_browser_process->local_state();
|
||||
+ if (local_state && local_state->GetBoolean(prefs::kHeliumDefaultBrowserRejected)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
#if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID)
|
||||
if (is_web_app ||
|
||||
startup_command_line.HasSwitch(switches::kNoDefaultBrowserCheck) ||
|
||||
--- a/components/infobars/core/confirm_infobar_delegate.h
|
||||
+++ b/components/infobars/core/confirm_infobar_delegate.h
|
||||
@@ -91,6 +91,8 @@ class ConfirmInfoBarDelegate : public in
|
||||
// on the infobar.
|
||||
virtual int GetLinkSpacingWhenPositionedBeforeButton() const;
|
||||
|
||||
+ virtual bool OkButtonShouldAlwaysLead() const;
|
||||
+
|
||||
#if BUILDFLAG(IS_IOS)
|
||||
// Returns whether or not a tint should be applied to the icon background.
|
||||
// Defaults to true.
|
||||
--- a/components/infobars/core/confirm_infobar_delegate.cc
|
||||
+++ b/components/infobars/core/confirm_infobar_delegate.cc
|
||||
@@ -79,6 +79,10 @@ int ConfirmInfoBarDelegate::GetLinkSpaci
|
||||
return 0;
|
||||
}
|
||||
|
||||
+bool ConfirmInfoBarDelegate::OkButtonShouldAlwaysLead() const {
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
#if BUILDFLAG(IS_IOS)
|
||||
bool ConfirmInfoBarDelegate::UseIconBackgroundTint() const {
|
||||
return true;
|
||||
--- a/chrome/browser/ui/startup/default_browser_prompt/default_browser_infobar_delegate.cc
|
||||
+++ b/chrome/browser/ui/startup/default_browser_prompt/default_browser_infobar_delegate.cc
|
||||
@@ -7,14 +7,17 @@
|
||||
#include <memory>
|
||||
|
||||
#include "base/types/pass_key.h"
|
||||
+#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/infobars/confirm_infobar_creator.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt_prefs.h"
|
||||
+#include "chrome/common/pref_names.h"
|
||||
#include "chrome/grit/branded_strings.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "components/infobars/core/confirm_infobar_delegate.h"
|
||||
#include "components/infobars/core/infobar.h"
|
||||
#include "components/omnibox/browser/vector_icons.h"
|
||||
+#include "components/prefs/pref_service.h"
|
||||
#include "components/vector_icons/vector_icons.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
|
||||
@@ -68,13 +71,15 @@ std::u16string DefaultBrowserInfoBarDele
|
||||
}
|
||||
|
||||
int DefaultBrowserInfoBarDelegate::GetButtons() const {
|
||||
- return BUTTON_OK;
|
||||
+ return BUTTON_OK | BUTTON_CANCEL;
|
||||
}
|
||||
|
||||
std::u16string DefaultBrowserInfoBarDelegate::GetButtonLabel(
|
||||
InfoBarButton button) const {
|
||||
- DCHECK_EQ(BUTTON_OK, button);
|
||||
- return l10n_util::GetStringUTF16(IDS_DEFAULT_BROWSER_INFOBAR_OK_BUTTON_LABEL);
|
||||
+ DCHECK(button == BUTTON_OK || button == BUTTON_CANCEL);
|
||||
+ return l10n_util::GetStringUTF16(
|
||||
+ button == BUTTON_OK ? IDS_DEFAULT_BROWSER_INFOBAR_OK_BUTTON_LABEL
|
||||
+ : IDS_CARET_BROWSING_DO_NOT_ASK);
|
||||
}
|
||||
|
||||
bool DefaultBrowserInfoBarDelegate::Accept() {
|
||||
@@ -86,6 +91,22 @@ bool DefaultBrowserInfoBarDelegate::Acce
|
||||
return ConfirmInfoBarDelegate::Accept();
|
||||
}
|
||||
|
||||
+bool DefaultBrowserInfoBarDelegate::Cancel() {
|
||||
+ PrefService* local_state = g_browser_process->local_state();
|
||||
+ if (!local_state) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ local_state->SetBoolean(prefs::kHeliumDefaultBrowserRejected, true);
|
||||
+ ConfirmInfoBarDelegate::InfoBarDismissed();
|
||||
+
|
||||
+ return ConfirmInfoBarDelegate::Cancel();
|
||||
+}
|
||||
+
|
||||
bool DefaultBrowserInfoBarDelegate::ShouldHideInFullscreen() const {
|
||||
return true;
|
||||
}
|
||||
+
|
||||
+bool DefaultBrowserInfoBarDelegate::OkButtonShouldAlwaysLead() const {
|
||||
+ return true;
|
||||
+}
|
||||
--- a/chrome/browser/ui/startup/default_browser_prompt/default_browser_infobar_delegate.h
|
||||
+++ b/chrome/browser/ui/startup/default_browser_prompt/default_browser_infobar_delegate.h
|
||||
@@ -47,7 +47,9 @@ class DefaultBrowserInfoBarDelegate : pu
|
||||
int GetButtons() const override;
|
||||
std::u16string GetButtonLabel(InfoBarButton button) const override;
|
||||
bool Accept() override;
|
||||
+ bool Cancel() override;
|
||||
bool ShouldHideInFullscreen() const override;
|
||||
+ bool OkButtonShouldAlwaysLead() const override;
|
||||
|
||||
// The WebContents's corresponding profile.
|
||||
raw_ptr<Profile> profile_;
|
||||
--- a/chrome/browser/ui/views/infobars/confirm_infobar.cc
|
||||
+++ b/chrome/browser/ui/views/infobars/confirm_infobar.cc
|
||||
@@ -225,7 +225,9 @@ void ConfirmInfoBar::Layout(PassKey) {
|
||||
}
|
||||
|
||||
if constexpr (!views::PlatformStyle::kIsOkButtonLeading) {
|
||||
- std::ranges::reverse(order_of_buttons);
|
||||
+ if (!GetDelegate()->OkButtonShouldAlwaysLead()) {
|
||||
+ std::ranges::reverse(order_of_buttons);
|
||||
+ }
|
||||
}
|
||||
|
||||
for (views::MdTextButton* button : order_of_buttons) {
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "base/containers/to_vector.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/functional/bind.h"
|
||||
@@ -249,6 +250,10 @@ network::mojom::SSLConfigPtr SSLConfigSe
|
||||
@@ -268,6 +269,10 @@ network::mojom::SSLConfigPtr SSLConfigSe
|
||||
|
||||
config->ech_enabled = ech_enabled_.GetValue();
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
])
|
||||
|
||||
# If the command finished with a non-zero return code, then report the
|
||||
@@ -378,7 +378,7 @@ def Main(argv):
|
||||
@@ -423,7 +423,7 @@ def Main(argv):
|
||||
# http://lists.apple.com/archives/carbon-dev/2006/Jun/msg00139.html
|
||||
# BUILD will always be an increasing value, so BUILD_PATH gives us
|
||||
# something unique that meetings what LS wants.
|
||||
@@ -43,7 +43,7 @@
|
||||
return PRODUCT_VERSION;
|
||||
--- a/chrome/browser/ui/webui/version/version_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/version/version_ui.cc
|
||||
@@ -221,6 +221,8 @@ void VersionUI::AddVersionDetailStrings(
|
||||
@@ -233,6 +233,8 @@ void VersionUI::AddVersionDetailStrings(
|
||||
VersionProcessorVariation());
|
||||
|
||||
// Data strings.
|
||||
@@ -52,7 +52,7 @@
|
||||
html_source->AddString(version_ui::kVersion,
|
||||
version_info::GetVersionNumber());
|
||||
html_source->AddString(version_ui::kVersionSuffix,
|
||||
@@ -310,12 +312,14 @@ void VersionUI::AddVersionDetailStrings(
|
||||
@@ -320,12 +322,14 @@ void VersionUI::AddVersionDetailStrings(
|
||||
std::u16string VersionUI::GetAnnotatedVersionStringForUi() {
|
||||
return l10n_util::GetStringFUTF16(
|
||||
IDS_SETTINGS_ABOUT_PAGE_BROWSER_VERSION,
|
||||
@@ -152,7 +152,7 @@
|
||||
}
|
||||
--- a/components/webui/version/resources/about_version.css
|
||||
+++ b/components/webui/version/resources/about_version.css
|
||||
@@ -91,6 +91,7 @@ body {
|
||||
@@ -90,6 +90,7 @@ body {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
@@ -160,3 +160,26 @@
|
||||
#copy-to-clipboard,
|
||||
#copy-variations-to-clipboard {
|
||||
background-color: var(--background-color);
|
||||
--- a/chrome/app/chrome_main_delegate.cc
|
||||
+++ b/chrome/app/chrome_main_delegate.cc
|
||||
@@ -365,16 +365,16 @@ bool HandleCreditsSwitch(const base::Com
|
||||
bool HandleVersionSwitches(const base::CommandLine& command_line) {
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
if (command_line.HasSwitch(switches::kProductVersion)) {
|
||||
- UNSAFE_TODO(printf("%s\n", version_info::GetVersionNumber().data()));
|
||||
+ UNSAFE_TODO(printf("%s\n", version_info::GetHeliumVersionNumber().data()));
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (command_line.HasSwitch(switches::kVersion)) {
|
||||
UNSAFE_TODO(printf(
|
||||
- "%s %s %s\n", version_info::GetProductName().data(),
|
||||
- version_info::GetVersionNumber().data(),
|
||||
- chrome::GetChannelName(chrome::WithExtendedStable(true)).c_str()));
|
||||
+ "%s %s (Chromium %s)\n", version_info::GetProductName().data(),
|
||||
+ version_info::GetHeliumVersionNumber().data(),
|
||||
+ version_info::GetVersionNumber().data()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
--- a/third_party/search_engines_data/resources/definitions/regional_settings.json
|
||||
+++ b/third_party/search_engines_data/resources/definitions/regional_settings.json
|
||||
@@ -10,7 +10,8 @@
|
||||
"&ecosia",
|
||||
"&bing",
|
||||
"&break_stuff_google",
|
||||
- "&qwant"
|
||||
+ "&qwant",
|
||||
+ "&kagi"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -0,0 +1,66 @@
|
||||
--- a/chrome/browser/helium_flag_choices.h
|
||||
+++ b/chrome/browser/helium_flag_choices.h
|
||||
@@ -34,6 +34,8 @@ namespace helium {
|
||||
constexpr const char kHeliumNoiseCpuCoresCommandLine[] =
|
||||
"helium-noise-hw-concurrency";
|
||||
|
||||
+ constexpr const char kMiddleClickAutoscrollCommandLine[] = "middle-click-autoscroll";
|
||||
+
|
||||
} // namespace helium
|
||||
|
||||
#endif /* CHROME_BROWSER_HELIUM_FLAG_CHOICES_H_ */
|
||||
--- a/chrome/browser/helium_flag_entries.h
|
||||
+++ b/chrome/browser/helium_flag_entries.h
|
||||
@@ -33,4 +33,8 @@
|
||||
"Randomizes the number of cores returned by "
|
||||
"`navigator.hardwareConcurrency` in a reasonable range. Helium flag.",
|
||||
kOsAll, FEATURE_VALUE_TYPE(blink::features::kHeliumNoiseCpuCores)},
|
||||
+ {helium::kMiddleClickAutoscrollCommandLine,
|
||||
+ "Middle Click Autoscroll",
|
||||
+ "Enables autoscroll on middle click. Helium flag, Chromium feature.",
|
||||
+ kOsDesktop, FEATURE_VALUE_TYPE(blink::features::kHeliumMiddleClickAutoscroll)},
|
||||
#endif /* CHROME_BROWSER_HELIUM_FLAG_ENTRIES_H_ */
|
||||
--- a/third_party/blink/public/common/features.h
|
||||
+++ b/third_party/blink/public/common/features.h
|
||||
@@ -45,6 +45,8 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE
|
||||
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumNoiseAudio);
|
||||
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumNoiseCpuCores);
|
||||
|
||||
+BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumMiddleClickAutoscroll);
|
||||
+
|
||||
// Controls whether to include information about the page's open popup in
|
||||
// AIPageContent.
|
||||
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAIPageContentIncludePopupWindows);
|
||||
--- a/third_party/blink/common/features.cc
|
||||
+++ b/third_party/blink/common/features.cc
|
||||
@@ -19,6 +19,15 @@
|
||||
|
||||
namespace blink::features {
|
||||
|
||||
+BASE_FEATURE(kHeliumMiddleClickAutoscroll,
|
||||
+ "HeliumMiddleClickAutoscroll",
|
||||
+#if BUILDFLAG(IS_WIN)
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT
|
||||
+#else
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT
|
||||
+#endif
|
||||
+);
|
||||
+
|
||||
BASE_FEATURE(kDisableLinkDrag, "DisableLinkDrag", base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
BASE_FEATURE(kReducedSystemInfo, "ReducedSystemInfo", base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
BASE_FEATURE(kRemoveClientHints, "RemoveClientHints", base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -1905,9 +1905,9 @@ void WebView::ApplyWebPreferences(const
|
||||
prefs.default_maximum_page_scale_factor);
|
||||
#endif
|
||||
|
||||
-#if BUILDFLAG(IS_WIN)
|
||||
- RuntimeEnabledFeatures::SetMiddleClickAutoscrollEnabled(true);
|
||||
-#endif
|
||||
+ RuntimeEnabledFeatures::SetMiddleClickAutoscrollEnabled(
|
||||
+ base::FeatureList::IsEnabled(features::kHeliumMiddleClickAutoscroll)
|
||||
+ );
|
||||
|
||||
RuntimeEnabledFeatures::SetTranslateServiceEnabled(
|
||||
prefs.translate_service_available);
|
||||
@@ -49,8 +49,8 @@
|
||||
"//components/database_utils",
|
||||
+ "//components/helium_services",
|
||||
"//components/infobars/core",
|
||||
"//components/lens",
|
||||
"//components/lens/proto/server:proto",
|
||||
"//components/lens:features",
|
||||
"//components/lens:lens_url_utils",
|
||||
--- a/components/search_engines/template_url_data_util.cc
|
||||
+++ b/components/search_engines/template_url_data_util.cc
|
||||
@@ -15,6 +15,7 @@
|
||||
@@ -61,7 +61,7 @@
|
||||
#include "third_party/search_engines_data/resources/definitions/prepopulated_engines.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "url/gurl.h"
|
||||
@@ -512,3 +513,20 @@ std::unique_ptr<TemplateURLData> Templat
|
||||
@@ -520,3 +521,20 @@ std::unique_ptr<TemplateURLData> Templat
|
||||
|
||||
return turl;
|
||||
}
|
||||
@@ -84,7 +84,7 @@
|
||||
+}
|
||||
--- a/components/search_engines/template_url_service.cc
|
||||
+++ b/components/search_engines/template_url_service.cc
|
||||
@@ -40,6 +40,8 @@
|
||||
@@ -39,6 +39,8 @@
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "build/build_config.h"
|
||||
#include "components/country_codes/country_codes.h"
|
||||
@@ -93,7 +93,7 @@
|
||||
#include "components/google/core/common/google_util.h"
|
||||
#include "components/omnibox/common/omnibox_feature_configs.h"
|
||||
#include "components/omnibox/common/omnibox_features.h"
|
||||
@@ -58,7 +60,9 @@
|
||||
@@ -57,7 +59,9 @@
|
||||
#include "components/search_engines/search_engines_switches.h"
|
||||
#include "components/search_engines/search_terms_data.h"
|
||||
#include "components/search_engines/template_url.h"
|
||||
@@ -103,7 +103,7 @@
|
||||
#include "components/search_engines/template_url_prepopulate_data.h"
|
||||
#include "components/search_engines/template_url_prepopulate_data_resolver.h"
|
||||
#include "components/search_engines/template_url_service_client.h"
|
||||
@@ -73,6 +77,7 @@
|
||||
@@ -72,6 +76,7 @@
|
||||
#include "components/sync/protocol/search_engine_specifics.pb.h"
|
||||
#include "components/url_formatter/url_fixer.h"
|
||||
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
|
||||
@@ -111,7 +111,7 @@
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
#include "url/third_party/mozilla/url_parse.h"
|
||||
@@ -582,6 +587,7 @@ class TemplateURLService::PreLoadingProv
|
||||
@@ -580,6 +585,7 @@ class TemplateURLService::PreLoadingProv
|
||||
// TemplateURLService ---------------------------------------------------------
|
||||
TemplateURLService::TemplateURLService(
|
||||
PrefService& prefs,
|
||||
@@ -119,7 +119,7 @@
|
||||
search_engines::SearchEngineChoiceService& search_engine_choice_service,
|
||||
TemplateURLPrepopulateData::Resolver& prepopulate_data_resolver,
|
||||
std::unique_ptr<SearchTermsData> search_terms_data,
|
||||
@@ -594,6 +600,8 @@ TemplateURLService::TemplateURLService(
|
||||
@@ -592,6 +598,8 @@ TemplateURLService::TemplateURLService(
|
||||
prepopulate_data_resolver_(prepopulate_data_resolver),
|
||||
search_terms_data_(std::move(search_terms_data)),
|
||||
web_data_service_(web_data_service),
|
||||
@@ -128,7 +128,7 @@
|
||||
client_(std::move(client)),
|
||||
dsp_change_callback_(dsp_change_callback),
|
||||
pre_loading_providers_(std::make_unique<PreLoadingProviders>()),
|
||||
@@ -610,11 +618,13 @@ TemplateURLService::TemplateURLService(
|
||||
@@ -608,11 +616,13 @@ TemplateURLService::TemplateURLService(
|
||||
|
||||
TemplateURLService::TemplateURLService(
|
||||
PrefService& prefs,
|
||||
@@ -142,7 +142,7 @@
|
||||
search_engine_choice_service,
|
||||
prepopulate_data_resolver,
|
||||
/*search_terms_data=*/std::make_unique<SearchTermsData>(),
|
||||
@@ -695,6 +705,10 @@ bool TemplateURLService::ShowInActivesLi
|
||||
@@ -693,6 +703,10 @@ bool TemplateURLService::ShowInActivesLi
|
||||
}
|
||||
|
||||
bool TemplateURLService::HiddenFromLists(const TemplateURL* t_url) const {
|
||||
@@ -153,7 +153,7 @@
|
||||
switch (t_url->policy_origin()) {
|
||||
case TemplateURLData::PolicyOrigin::kDefaultSearchProvider:
|
||||
return false;
|
||||
@@ -1524,11 +1538,37 @@ void TemplateURLService::Load() {
|
||||
@@ -1529,11 +1543,37 @@ void TemplateURLService::Load() {
|
||||
|
||||
if (web_data_service_) {
|
||||
load_handle_ = web_data_service_->GetKeywords(this);
|
||||
@@ -170,7 +170,7 @@
|
||||
+}
|
||||
+
|
||||
+void TemplateURLService::BangsLoadedCallback() {
|
||||
+ LOG(INFO) << "BangsLoadedCallback() called";
|
||||
+ VLOG(2) << "BangsLoadedCallback() called";
|
||||
+
|
||||
+ for (const auto& bang : bang_manager_->GetBangs()) {
|
||||
+ auto template_data = TemplateURLDataFromBang(bang);
|
||||
@@ -191,7 +191,7 @@
|
||||
base::CallbackListSubscription TemplateURLService::RegisterOnLoadedCallback(
|
||||
base::OnceClosure callback) {
|
||||
return loaded_ ? base::CallbackListSubscription()
|
||||
@@ -2516,6 +2556,13 @@ void TemplateURLService::Init() {
|
||||
@@ -2520,6 +2560,13 @@ void TemplateURLService::Init() {
|
||||
&TemplateURLService::OnDefaultSearchProviderGUIDChanged,
|
||||
base::Unretained(this)));
|
||||
|
||||
@@ -207,11 +207,12 @@
|
||||
default_search_manager_.GetDefaultSearchEngine(&source);
|
||||
--- a/components/search_engines/template_url_service.h
|
||||
+++ b/components/search_engines/template_url_service.h
|
||||
@@ -34,10 +34,12 @@
|
||||
@@ -34,11 +34,13 @@
|
||||
#include "components/search_engines/search_host_to_urls_map.h"
|
||||
#include "components/search_engines/search_terms_data.h"
|
||||
#include "components/search_engines/template_url.h"
|
||||
+#include "components/search_engines/template_url_bang_manager.h"
|
||||
#include "components/search_engines/template_url_starter_pack_data.h"
|
||||
#include "components/sync/model/sync_change.h"
|
||||
#include "components/sync/model/syncable_service.h"
|
||||
#include "components/sync/protocol/search_engine_specifics.pb.h"
|
||||
@@ -220,7 +221,7 @@
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
#include "base/android/scoped_java_ref.h"
|
||||
#endif
|
||||
@@ -150,6 +152,7 @@ class TemplateURLService final : public
|
||||
@@ -155,6 +157,7 @@ class TemplateURLService final : public
|
||||
|
||||
TemplateURLService(
|
||||
PrefService& prefs,
|
||||
@@ -228,7 +229,7 @@
|
||||
search_engines::SearchEngineChoiceService& search_engine_choice_service,
|
||||
TemplateURLPrepopulateData::Resolver& prepopulate_data_resolver,
|
||||
std::unique_ptr<SearchTermsData> search_terms_data,
|
||||
@@ -161,6 +164,7 @@ class TemplateURLService final : public
|
||||
@@ -166,6 +169,7 @@ class TemplateURLService final : public
|
||||
// some template URL data.
|
||||
explicit TemplateURLService(
|
||||
PrefService& prefs,
|
||||
@@ -236,7 +237,7 @@
|
||||
search_engines::SearchEngineChoiceService& search_engine_choice_service,
|
||||
TemplateURLPrepopulateData::Resolver& prepopulate_data_resolver,
|
||||
base::span<const TemplateURLService::Initializer> initializers = {});
|
||||
@@ -475,6 +479,8 @@ class TemplateURLService final : public
|
||||
@@ -484,6 +488,8 @@ class TemplateURLService final : public
|
||||
// OnTemplateURLServiceChanged.
|
||||
void Load();
|
||||
|
||||
@@ -245,7 +246,7 @@
|
||||
// Registers a callback to be called when the service has loaded.
|
||||
//
|
||||
// If the service has already loaded, this function does nothing.
|
||||
@@ -713,6 +719,8 @@ class TemplateURLService final : public
|
||||
@@ -722,6 +728,8 @@ class TemplateURLService final : public
|
||||
|
||||
void Init();
|
||||
|
||||
@@ -254,7 +255,7 @@
|
||||
// Simulate a loaded `TemplateURLService`.
|
||||
void ApplyInitializersForTesting(
|
||||
base::span<const TemplateURLService::Initializer> initializers);
|
||||
@@ -915,6 +923,10 @@ class TemplateURLService final : public
|
||||
@@ -924,6 +932,10 @@ class TemplateURLService final : public
|
||||
// Service used to store entries.
|
||||
scoped_refptr<KeywordWebDataService> web_data_service_;
|
||||
|
||||
@@ -267,7 +268,7 @@
|
||||
// This closure is run when the default search provider is set to Google.
|
||||
--- /dev/null
|
||||
+++ b/components/search_engines/template_url_bang_manager.cc
|
||||
@@ -0,0 +1,215 @@
|
||||
@@ -0,0 +1,217 @@
|
||||
+// Copyright 2025 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
@@ -382,7 +383,7 @@
|
||||
+}
|
||||
+
|
||||
+void BangManager::OnSimpleLoaderComplete(
|
||||
+ std::unique_ptr<std::string> response_body) {
|
||||
+ std::optional<std::string> response_body) {
|
||||
+ int response_code = -1;
|
||||
+ std::string mime_type;
|
||||
+
|
||||
@@ -401,6 +402,21 @@
|
||||
+ load_pending_ = false;
|
||||
+}
|
||||
+
|
||||
+std::vector<std::string> FilterTriggers(base::ListValue&& list) {
|
||||
+ std::vector<std::string> triggers;
|
||||
+ triggers.reserve(list.size());
|
||||
+
|
||||
+ for (auto& value : list) {
|
||||
+ if (!value.is_string()) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ triggers.push_back(std::move(value).TakeString());
|
||||
+ }
|
||||
+
|
||||
+ return triggers;
|
||||
+}
|
||||
+
|
||||
+void BangManager::LoadManifestFromString(const std::string& manifest) {
|
||||
+ auto parsed = base::JSONReader::ReadAndReturnValueWithError(
|
||||
+ manifest,
|
||||
@@ -426,49 +442,36 @@
|
||||
+ }
|
||||
+
|
||||
+ auto dict = std::move(bang).TakeDict();
|
||||
+ auto bname = dict.FindString("s");
|
||||
+ auto* name = dict.FindString("s");
|
||||
+ auto* triggers_ptr = dict.FindList("ts");
|
||||
+ auto* url_template = dict.FindString("u");
|
||||
+
|
||||
+ std::vector<const std::string*> triggers;
|
||||
+ if (auto bbang = dict.FindString("t")) {
|
||||
+ triggers.push_back(bbang);
|
||||
+ if (!name || !triggers_ptr || !url_template || triggers_ptr->empty()) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (auto bbangs = dict.FindList("ts")) {
|
||||
+ triggers.reserve(triggers.size() + bbangs->size());
|
||||
+ auto triggers = FilterTriggers(std::move(*triggers_ptr));
|
||||
+ auto bang_gurl = GURL(*url_template);
|
||||
+
|
||||
+ for (const auto& trigger : *bbangs) {
|
||||
+ const std::string* value = trigger.GetIfString();
|
||||
+ if (!value) continue;
|
||||
+ if (!bang_gurl.is_valid() || !bang_gurl.SchemeIsHTTPOrHTTPS()) {
|
||||
+ VLOG(2) << "invalid bang url " << *url_template;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ triggers.push_back(value);
|
||||
+ auto category = dict.FindString("sc");
|
||||
+
|
||||
+ for (auto&& trigger : std::move(triggers)) {
|
||||
+ if (category) {
|
||||
+ category_map_[index] = GetCategoryFromJSONObject(*category);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ auto burl_template = dict.FindString("u");
|
||||
+ if (!bname || !burl_template || triggers.empty()) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ auto b_gurl = GURL(*burl_template);
|
||||
+ if (!b_gurl.is_valid() || !b_gurl.SchemeIsHTTPOrHTTPS()) {
|
||||
+ LOG(INFO) << "invalid bang url " << *burl_template;
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ auto bcategory = dict.FindString("sc");
|
||||
+ if (bcategory) {
|
||||
+ category_map_[index] = GetCategoryFromJSONObject(*bcategory);
|
||||
+ }
|
||||
+
|
||||
+ for (auto trigger : triggers) {
|
||||
+ // We need to pass the URL here as-is, because otherwise URLs
|
||||
+ // which have the template in the path will have it %-encoded,
|
||||
+ // which will break everything.
|
||||
+ bangs_.emplace_back(index++, *bname, *trigger, *burl_template);
|
||||
+ bangs_.emplace_back(index++, *name, std::move(trigger), *url_template);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ LOG(INFO) << bangs_.size() << " bangs loaded";
|
||||
+ if (!callbacks_.empty()) {
|
||||
+ auto callbacks = std::move(callbacks_);
|
||||
+ for (auto& cb : callbacks) {
|
||||
@@ -543,7 +546,7 @@
|
||||
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
|
||||
+ PrefService& prefs
|
||||
+ );
|
||||
+ void OnSimpleLoaderComplete(std::unique_ptr<std::string> response_body);
|
||||
+ void OnSimpleLoaderComplete(std::optional<std::string> response_body);
|
||||
+ void LoadManifestFromString(const std::string& manifest);
|
||||
+ BangCategory GetCategoryFromJSONObject(std::string_view sc) const;
|
||||
+
|
||||
@@ -563,7 +566,7 @@
|
||||
+
|
||||
--- a/components/omnibox/browser/autocomplete_input.cc
|
||||
+++ b/components/omnibox/browser/autocomplete_input.cc
|
||||
@@ -739,9 +739,9 @@ bool AutocompleteInput::HasHTTPSScheme(c
|
||||
@@ -740,9 +740,9 @@ bool AutocompleteInput::HasHTTPSScheme(c
|
||||
// static
|
||||
AutocompleteInput::FeaturedKeywordMode
|
||||
AutocompleteInput::GetFeaturedKeywordMode(std::u16string_view text) {
|
||||
@@ -575,7 +578,7 @@
|
||||
return FeaturedKeywordMode::kPrefix;
|
||||
return FeaturedKeywordMode::kFalse;
|
||||
}
|
||||
@@ -909,6 +909,7 @@ std::u16string AutocompleteInput::Autoco
|
||||
@@ -885,6 +885,7 @@ std::u16string AutocompleteInput::Autoco
|
||||
const std::u16string& input,
|
||||
bool trim_leading_whitespace,
|
||||
std::u16string* remaining_input) {
|
||||
@@ -583,7 +586,7 @@
|
||||
// Find end of first token. The AutocompleteController has trimmed leading
|
||||
// whitespace, so we need not skip over that.
|
||||
const size_t first_white(input.find_first_of(base::kWhitespaceUTF16));
|
||||
@@ -917,6 +918,39 @@ std::u16string AutocompleteInput::Autoco
|
||||
@@ -893,6 +894,39 @@ std::u16string AutocompleteInput::Autoco
|
||||
return input; // Only one token provided.
|
||||
}
|
||||
|
||||
@@ -664,7 +667,7 @@
|
||||
size_t TemplateURLData::EstimateMemoryUsage() const {
|
||||
--- a/components/search_engines/template_url_data.h
|
||||
+++ b/components/search_engines/template_url_data.h
|
||||
@@ -262,6 +262,9 @@ struct TemplateURLData {
|
||||
@@ -263,6 +263,9 @@ struct TemplateURLData {
|
||||
// starter_pack_id > 0.
|
||||
int starter_pack_id{0};
|
||||
|
||||
@@ -676,7 +679,7 @@
|
||||
|
||||
--- a/components/search_engines/template_url.cc
|
||||
+++ b/components/search_engines/template_url.cc
|
||||
@@ -1672,6 +1672,8 @@ bool TemplateURL::IsBetterThanConflictin
|
||||
@@ -1758,6 +1758,8 @@ bool TemplateURL::IsBetterThanConflictin
|
||||
: base::Time(),
|
||||
// Prefer engines that CANNOT be auto-replaced.
|
||||
!engine->safe_for_autoreplace(),
|
||||
@@ -687,8 +690,8 @@
|
||||
// Favor prepopulated engines over other auto-generated engines.
|
||||
--- a/components/search_engines/template_url.h
|
||||
+++ b/components/search_engines/template_url.h
|
||||
@@ -832,6 +832,8 @@ class TemplateURL {
|
||||
starter_pack_id() == template_url_starter_pack_data::kAiMode;
|
||||
@@ -855,6 +855,8 @@ class TemplateURL {
|
||||
policy_origin() == TemplateURLData::PolicyOrigin::kSearchAggregator;
|
||||
}
|
||||
|
||||
+ int bang_id() const { return data().bang_id; }
|
||||
@@ -698,7 +701,7 @@
|
||||
// Sanity check for https://crbug.com/781703.
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -66,6 +66,11 @@ bool ShouldAccessExtensionService(const
|
||||
@@ -63,6 +63,11 @@ bool ShouldAccessExtensionService(const
|
||||
prefs.GetBoolean(prefs::kHeliumExtProxyEnabled);
|
||||
}
|
||||
|
||||
@@ -712,9 +715,9 @@
|
||||
return GetDummyURL();
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -18,6 +18,7 @@ const char kHeliumDefaultOrigin[] =
|
||||
const char kHeliumDummyOrigin[] =
|
||||
"https://helium-services-are-disabled.qjz9zk";
|
||||
@@ -20,6 +20,7 @@ const char kHeliumDummyOrigin[] =
|
||||
|
||||
bool ShouldAccessServices(const PrefService& prefs);
|
||||
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
@@ -722,19 +725,19 @@
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -1951,6 +1951,9 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
{"heliumServicesToggle", IDS_SETTINGS_HELIUM_SERVICES_TOGGLE},
|
||||
{"heliumServicesToggleDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_TOGGLE_DESCRIPTION},
|
||||
@@ -2233,6 +2233,9 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE},
|
||||
{"heliumExtProxyToggleDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE_DESCRIPTION},
|
||||
+ {"heliumBangsToggle", IDS_SETTINGS_HELIUM_SERVICES_BANGS_TOGGLE},
|
||||
+ {"heliumBangsToggleDescription",
|
||||
+ IDS_SETTINGS_HELIUM_SERVICES_BANGS_TOGGLE_DESCRIPTION},
|
||||
{"heliumExtProxyToggle",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE},
|
||||
{"heliumExtProxyToggleDescription",
|
||||
{"heliumOriginOverride", IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE},
|
||||
{"heliumOriginOverrideDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_DESCRIPTION},
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -1939,6 +1939,12 @@
|
||||
@@ -1995,6 +1995,12 @@
|
||||
<message name="IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE_DESCRIPTION" desc="Description of the toggle for enabling/disabling of downloading and proxying extensions">
|
||||
When enabled, Helium will proxy extension downloads and updates to protect your privacy. When disabled, downloading and updating extensions will not work.
|
||||
</message>
|
||||
@@ -749,23 +752,23 @@
|
||||
</message>
|
||||
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
@@ -12,6 +12,11 @@
|
||||
</settings-toggle-button>
|
||||
<div class="cr-col">
|
||||
<cr-collapse id="servicesCollapse" opened="[[prefs.helium.services.enabled.value]]">
|
||||
@@ -87,6 +87,11 @@
|
||||
label="$i18n{heliumExtProxyToggle}"
|
||||
sub-label="$i18n{heliumExtProxyToggleDescription}">
|
||||
</settings-toggle-button>
|
||||
+ <settings-toggle-button id="bangToggleButton"
|
||||
+ pref="{{prefs.helium.services.bangs}}"
|
||||
+ label="$i18n{heliumBangsToggle}"
|
||||
+ sub-label="$i18n{heliumBangsToggleDescription}">
|
||||
+ </settings-toggle-button>
|
||||
<settings-toggle-button id="extProxyToggleButton"
|
||||
pref="{{prefs.helium.services.ext_proxy}}"
|
||||
label="$i18n{heliumExtProxyToggle}"
|
||||
</cr-collapse>
|
||||
</div>
|
||||
</template>
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -196,6 +196,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
|
||||
{
|
||||
@@ -218,6 +218,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
registry->RegisterIntegerPref(prefs::kHeliumSchemaVersion, 0);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumDisableSchemaAlerts, false);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumServicesEnabled, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumBangsEnabled, true);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumExtProxyEnabled, true);
|
||||
@@ -773,7 +776,7 @@
|
||||
registry->RegisterBooleanPref(prefs::kHeliumDidOnboarding, false);
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -352,6 +352,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
@@ -385,6 +385,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kHeliumExtProxyEnabled] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
@@ -781,10 +784,10 @@
|
||||
+ settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kHeliumServicesOrigin] =
|
||||
settings_api::PrefType::kString;
|
||||
|
||||
(*s_allowlist)[::prefs::kHeliumServicesConsented] =
|
||||
--- a/components/helium_services/pref_names.h
|
||||
+++ b/components/helium_services/pref_names.h
|
||||
@@ -24,6 +24,9 @@ inline constexpr char kHeliumDidOnboardi
|
||||
@@ -30,6 +30,9 @@ inline constexpr char kHeliumDidOnboardi
|
||||
inline constexpr char kHeliumExtProxyEnabled[] =
|
||||
"helium.services.ext_proxy";
|
||||
|
||||
@@ -794,9 +797,68 @@
|
||||
} // namespace prefs
|
||||
|
||||
#endif // COMPONENTS_HELIUM_SERVICES_PREF_NAMES_H_
|
||||
--- a/components/omnibox/browser/omnibox_edit_model.cc
|
||||
+++ b/components/omnibox/browser/omnibox_edit_model.cc
|
||||
@@ -824,6 +824,17 @@ bool OmniboxEditModel::AcceptKeyword(
|
||||
--- a/third_party/metrics_proto/omnibox_event.proto
|
||||
+++ b/third_party/metrics_proto/omnibox_event.proto
|
||||
@@ -790,6 +790,8 @@ message OmniboxEventProto {
|
||||
// or tabbing to it.
|
||||
TOOLBELT = 9; // Select and activate a search shortcuts action
|
||||
// from the omnibox toolbelt.
|
||||
+ RETURN_BANG = 10; // Accept a bang at the end of the query by pressing
|
||||
+ // the Return/Enter key.
|
||||
}
|
||||
|
||||
optional KeywordModeEntryMethod keyword_mode_entry_method = 20;
|
||||
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.h
|
||||
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.h
|
||||
@@ -312,6 +312,9 @@ class OmniboxEditModel {
|
||||
return !is_keyword_hint_ && !keyword_.empty();
|
||||
}
|
||||
|
||||
+ // Accepts the bang at the end of the user query.
|
||||
+ void MaybeAcceptTrailingBang();
|
||||
+
|
||||
// Accepts the current keyword hint as a keyword. `entry_method` indicates how
|
||||
// the user entered keyword mode.
|
||||
void AcceptKeyword(
|
||||
@@ -677,6 +680,10 @@ class OmniboxEditModel {
|
||||
// triggering is enabled, false otherwise.
|
||||
bool AllowKeywordSpaceTriggering() const;
|
||||
|
||||
+ // Checks whether the user text contains a bang at the end of it
|
||||
+ // that can be accepted by pressing the Return key.
|
||||
+ bool HasTrailingBangKeyword() const;
|
||||
+
|
||||
// Whether the user just typed a space at the end of a keyword, with or
|
||||
// without inline autocompletion:
|
||||
// - youtube| -> youtube | (a space was appended to a keyword)
|
||||
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
|
||||
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
|
||||
@@ -906,6 +906,24 @@ void OmniboxEditModel::OpenCurrentSelect
|
||||
OpenSelection(popup_selection_, timestamp, disposition, via_keyboard);
|
||||
}
|
||||
|
||||
+void OmniboxEditModel::MaybeAcceptTrailingBang() {
|
||||
+ if (!HasTrailingBangKeyword()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ AcceptKeyword(OmniboxEventProto::RETURN_BANG);
|
||||
+
|
||||
+ const AutocompleteResult& result = autocomplete_controller()->result();
|
||||
+ for (size_t i = 0; i < result.size(); i++) {
|
||||
+ const AutocompleteMatch& match = result.match_at(i);
|
||||
+
|
||||
+ if (input_.text() == match.fill_into_edit) {
|
||||
+ SetPopupSelection(OmniboxPopupSelection(i));
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void OmniboxEditModel::AcceptKeyword(
|
||||
OmniboxEventProto::KeywordModeEntryMethod entry_method) {
|
||||
TRACE_EVENT0("omnibox", "OmniboxEditModel::AcceptKeyword");
|
||||
@@ -914,6 +932,17 @@ void OmniboxEditModel::AcceptKeyword(
|
||||
|
||||
controller_->StopAutocomplete(/*clear_result=*/false);
|
||||
|
||||
@@ -805,16 +867,16 @@
|
||||
+ keyword_);
|
||||
+
|
||||
+ if (turl && turl->bang_id() > 0 && !user_text_.starts_with(u'!')) {
|
||||
+ AutocompleteMatch match = CurrentMatch(nullptr);
|
||||
+ if (!match.fill_into_edit.empty()) {
|
||||
+ AutocompleteMatch match = CurrentMatch();
|
||||
+ if (match.fill_into_edit.length() > user_text_.length()) {
|
||||
+ user_text_ = match.fill_into_edit;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
is_keyword_hint_ = false;
|
||||
SetIsKeywordHint(false);
|
||||
keyword_mode_entry_method_ = entry_method;
|
||||
if (original_user_text_with_keyword_.empty()) {
|
||||
@@ -866,9 +877,6 @@ bool OmniboxEditModel::AcceptKeyword(
|
||||
@@ -956,9 +985,6 @@ void OmniboxEditModel::AcceptKeyword(
|
||||
}
|
||||
|
||||
base::RecordAction(base::UserMetricsAction("AcceptedKeywordHint"));
|
||||
@@ -822,31 +884,65 @@
|
||||
- controller_->client()->GetTemplateURLService()->GetTemplateURLForKeyword(
|
||||
- keyword_);
|
||||
EmitEnteredKeywordModeHistogram(entry_method, turl, !user_text_.empty());
|
||||
return true;
|
||||
}
|
||||
@@ -1520,7 +1528,13 @@ void OmniboxEditModel::InternalSetUserTe
|
||||
|
||||
std::u16string OmniboxEditModel::MaybeStripKeyword(
|
||||
const std::u16string& text) const {
|
||||
- return is_keyword_selected()
|
||||
+ std::u16string trimmed_text;
|
||||
+ base::TrimWhitespace(text, base::TRIM_LEADING, &trimmed_text);
|
||||
+
|
||||
+ std::u16string actual_keyword = base::ToLowerASCII(
|
||||
+ AutocompleteInput::SplitKeywordFromInput(trimmed_text, false, nullptr));
|
||||
+
|
||||
+ return is_keyword_selected() && actual_keyword == keyword_
|
||||
? AutocompleteInput::SplitReplacementStringFromInput(text, false)
|
||||
: text;
|
||||
@@ -2881,6 +2907,21 @@ bool OmniboxEditModel::AllowKeywordSpace
|
||||
return GetPrefService()->GetBoolean(omnibox::kKeywordSpaceTriggeringEnabled);
|
||||
}
|
||||
@@ -2787,9 +2801,8 @@ bool OmniboxEditModel::MaybeAcceptKeywor
|
||||
|
||||
+bool OmniboxEditModel::HasTrailingBangKeyword() const {
|
||||
+ if (!is_keyword_hint_ || input_.InKeywordMode()
|
||||
+ || !keyword_.starts_with('!')
|
||||
+ || !AutocompleteMatch::IsSearchType(current_match_.type)
|
||||
+ || !GetText().ends_with(keyword_)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ const TemplateURL* turl =
|
||||
+ controller_->client()->GetTemplateURLService()->GetTemplateURLForKeyword(
|
||||
+ keyword_);
|
||||
+
|
||||
+ return turl && turl->bang_id() > 0;
|
||||
+}
|
||||
+
|
||||
bool OmniboxEditModel::ShouldAcceptKeywordAfterInsertingSpaceAtEnd(
|
||||
const std::u16string& new_text) {
|
||||
// Check if the user has disabled space triggering.
|
||||
@@ -2904,16 +2945,20 @@ bool OmniboxEditModel::ShouldAcceptKeywo
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t keyword_length = new_text.length() - 1;
|
||||
- return is_keyword_hint_ && (keyword_.length() == keyword_length) &&
|
||||
+ return is_keyword_hint_ &&
|
||||
IsSpaceCharForAcceptingKeyword(new_text[keyword_length]) &&
|
||||
- !new_text.compare(0, keyword_length, keyword_, 0, keyword_length) &&
|
||||
AcceptKeyword(OmniboxEventProto::SPACE_AT_END);
|
||||
}
|
||||
- // `input` must end with space. Typing 'youtube' shouldn't enter
|
||||
- // keyword mode until the user types a final space.
|
||||
- if (!IsSpaceCharForAcceptingKeyword(new_text[new_text.length() - 1])) {
|
||||
+ // Parse the keyword from the input so bang keywords in the middle or at the
|
||||
+ // end are accepted when the trailing space is typed.
|
||||
+ std::u16string trimmed_text(
|
||||
+ base::TrimWhitespace(new_text, base::TRIM_LEADING));
|
||||
+ const std::u16string new_keyword = base::ToLowerASCII(
|
||||
+ AutocompleteInput::SplitKeywordFromInput(trimmed_text, false, nullptr));
|
||||
+
|
||||
+ if (new_keyword != keyword_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
- // Check the rest of the input matches `keyword`. This isn't necessary,
|
||||
- // `AutocompleteController` shouldn't show keyword hints on the default match
|
||||
- // for inputs like 'yout '. But that's not a guarantee.
|
||||
- if (new_text.substr(0, new_text.length() - 1) != keyword_) {
|
||||
+ // `input` must end with space. Typing 'youtube' shouldn't enter
|
||||
+ // keyword mode until the user types a final space.
|
||||
+ if (!IsSpaceCharForAcceptingKeyword(new_text[new_text.length() - 1])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
|
||||
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
|
||||
@@ -2050,6 +2050,7 @@ bool OmniboxViewViews::HandleKeyEvent(vi
|
||||
metric_value);
|
||||
if (controller()->IsPopupOpen() && !control) {
|
||||
// Normal case of pressing <return> when the popup is open.
|
||||
+ controller()->edit_model()->MaybeAcceptTrailingBang();
|
||||
controller()->edit_model()->OpenCurrentSelection(event.time_stamp(),
|
||||
disposition,
|
||||
/*via_keyboard=*/true);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -40,6 +40,7 @@
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "chrome/browser/apps/app_discovery_service/app_discovery_service.h"
|
||||
#include "chrome/browser/browser_features.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
+#include "chrome/browser/channel_selection.h"
|
||||
#include "chrome/browser/default_browser/default_browser_features.h"
|
||||
#include "chrome/browser/devtools/features.h"
|
||||
#include "chrome/browser/flag_descriptions.h"
|
||||
#include "chrome/browser/ip_protection/ip_protection_switches.h"
|
||||
#include "chrome/browser/first_run/first_run_features.h"
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/channel_selection.cc
|
||||
@@ -0,0 +1,28 @@
|
||||
@@ -90,12 +90,12 @@
|
||||
"Configures the frame rate the browser is throttled to when Energy Saver is enabled. Helium flag.",
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -304,6 +304,8 @@ static_library("browser") {
|
||||
"btm/btm_browser_signin_detector_factory.h",
|
||||
"btm/stateful_bounce_counter.cc",
|
||||
"btm/stateful_bounce_counter.h",
|
||||
+ "channel_selection.cc",
|
||||
+ "channel_selection.h",
|
||||
@@ -264,6 +264,8 @@ static_library("browser") {
|
||||
"browsing_topics/browsing_topics_service_factory.h",
|
||||
"chained_back_navigation_tracker.cc",
|
||||
"chained_back_navigation_tracker.h",
|
||||
+ "channel_selection.cc",
|
||||
+ "channel_selection.h",
|
||||
"child_process_host_flags.h",
|
||||
"chrome_browser_field_trials.cc",
|
||||
"chrome_browser_field_trials.h",
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
TODO: guard services_page.html with is_mac
|
||||
|
||||
--- a/components/helium_services/pref_names.h
|
||||
+++ b/components/helium_services/pref_names.h
|
||||
@@ -27,6 +27,9 @@ inline constexpr char kHeliumExtProxyEna
|
||||
@@ -33,6 +33,9 @@ inline constexpr char kHeliumExtProxyEna
|
||||
inline constexpr char kHeliumBangsEnabled[] =
|
||||
"helium.services.bangs";
|
||||
|
||||
@@ -14,7 +12,7 @@ TODO: guard services_page.html with is_mac
|
||||
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -20,11 +20,13 @@ const char kHeliumDummyOrigin[] =
|
||||
@@ -22,11 +22,13 @@ bool ShouldAccessServices(const PrefServ
|
||||
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
@@ -30,15 +28,7 @@ TODO: guard services_page.html with is_mac
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <optional>
|
||||
|
||||
#include "base/functional/bind.h"
|
||||
+#include "base/strings/stringprintf.h"
|
||||
#include "components/helium_services/pref_names.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "net/base/url_util.h"
|
||||
@@ -15,6 +16,12 @@
|
||||
@@ -16,6 +16,12 @@
|
||||
|
||||
namespace helium {
|
||||
|
||||
@@ -51,7 +41,7 @@ TODO: guard services_page.html with is_mac
|
||||
std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_) {
|
||||
if (user_url_.empty()) {
|
||||
return std::nullopt;
|
||||
@@ -76,6 +83,11 @@ bool ShouldFetchBangs(const PrefService&
|
||||
@@ -73,6 +79,11 @@ bool ShouldFetchBangs(const PrefService&
|
||||
prefs.GetBoolean(prefs::kHeliumBangsEnabled);
|
||||
}
|
||||
|
||||
@@ -63,7 +53,7 @@ TODO: guard services_page.html with is_mac
|
||||
GURL GetExtensionUpdateURL(const PrefService& prefs) {
|
||||
if (!ShouldAccessExtensionService(prefs)) {
|
||||
return GetDummyURL();
|
||||
@@ -101,6 +113,20 @@ GURL GetSpellcheckURL(const PrefService&
|
||||
@@ -98,6 +109,20 @@ GURL GetSpellcheckURL(const PrefService&
|
||||
return GetServicesBaseURL(prefs).Resolve("/dict/");
|
||||
}
|
||||
|
||||
@@ -86,26 +76,24 @@ TODO: guard services_page.html with is_mac
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
@@ -29,6 +29,13 @@
|
||||
@@ -99,6 +99,11 @@
|
||||
sub-label="$i18n{heliumSpellcheckToggleDescription}">
|
||||
</settings-toggle-button>
|
||||
</if>
|
||||
+ <if expr="is_macosx">
|
||||
+ <settings-toggle-button id="updatesToggleButton"
|
||||
+ pref="{{prefs.helium.services.browser_updates}}"
|
||||
+ label="$i18n{heliumUpdatesToggle}"
|
||||
+ sub-label="$i18n{heliumUpdatesToggleDescription}">
|
||||
+ </settings-toggle-button>
|
||||
+ </if>
|
||||
+ <settings-toggle-button id="updatesToggleButton"
|
||||
+ pref="{{prefs.helium.services.browser_updates}}"
|
||||
+ label="$i18n{heliumUpdatesToggle}"
|
||||
+ sub-label="$i18n{heliumUpdatesToggleDescription}">
|
||||
+ </settings-toggle-button>
|
||||
</cr-collapse>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -1959,6 +1959,10 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE},
|
||||
{"heliumExtProxyToggleDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE_DESCRIPTION},
|
||||
@@ -2239,6 +2239,10 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
{"heliumSpellcheckToggle", IDS_SETTINGS_HELIUM_SERVICES_SPELLCHECK_TOGGLE},
|
||||
{"heliumSpellcheckToggleDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_SPELLCHECK_TOGGLE_DESCRIPTION},
|
||||
+ {"heliumUpdatesToggle",
|
||||
+ IDS_SETTINGS_HELIUM_SERVICES_UPDATE},
|
||||
+ {"heliumUpdatesToggleDescription",
|
||||
@@ -115,7 +103,7 @@ TODO: guard services_page.html with is_mac
|
||||
IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_DESCRIPTION},
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -362,6 +362,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
@@ -389,6 +389,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kHeliumSpellcheckEnabled] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
@@ -123,10 +111,10 @@ TODO: guard services_page.html with is_mac
|
||||
+ settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kHeliumServicesOrigin] =
|
||||
settings_api::PrefType::kString;
|
||||
|
||||
(*s_allowlist)[::prefs::kHeliumServicesConsented] =
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -207,6 +207,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
@@ -224,6 +224,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
registry->RegisterStringPref(prefs::kHeliumServicesOrigin, "");
|
||||
registry->RegisterBooleanPref(prefs::kHeliumDidOnboarding, false);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumServicesConsented, false);
|
||||
@@ -136,16 +124,23 @@ TODO: guard services_page.html with is_mac
|
||||
registry->RegisterBooleanPref(
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -1951,6 +1951,12 @@
|
||||
@@ -2010,6 +2010,19 @@
|
||||
<message name="IDS_SETTINGS_HELIUM_SERVICES_SPELLCHECK_TOGGLE_DESCRIPTION" desc="Description of the for enabling/disabling of downloading spellcheck files">
|
||||
Helium will fetch dictionary files used for spell checking when requested. When disabled, spell checking will not work.
|
||||
</message>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_UPDATE" desc="Toggle for automatic update downloads">
|
||||
+ Allow automatic browser updates
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_UPDATE_DESCRIPTION" desc="Description of the toggle for automatic update downloads">
|
||||
+ Helium will automatically download and install browser updates as they become available. We recommend keeping this setting enabled to ensure you get the latest security patches and features.
|
||||
+ Allow automatic browser and component updates
|
||||
+ </message>
|
||||
+ <if expr="is_macosx">
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_UPDATE_DESCRIPTION" desc="Description of the toggle for automatic update downloads">
|
||||
+ Helium will automatically download and install browser and component updates as they become available. We recommend keeping this setting enabled to ensure you get the latest features and security updates.
|
||||
+ </message>
|
||||
+ </if>
|
||||
+ <if expr="not is_macosx">
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_UPDATE_DESCRIPTION" desc="Description of the toggle for automatic update downloads">
|
||||
+ Helium will automatically download and install browser and component updates as they become available. We recommend keeping this setting enabled to ensure you get the latest features and security updates. Automatic core browser updates are not available on this platform yet, but component updates are. Please use external software to keep Helium up to date.
|
||||
+ </message>
|
||||
+ </if>
|
||||
<message name="IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE" desc="Text input for overriding the Helium services server">
|
||||
Use your own instance of Helium services
|
||||
</message>
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
bool ExternalProcessImporterHost::CheckForFirefoxLock(
|
||||
const user_data_importer::SourceProfile& source_profile) {
|
||||
- if (source_profile.importer_type != user_data_importer::TYPE_FIREFOX) {
|
||||
+ if (source_profile.importer_type != user_data_importer::TYPE_FIREFOX
|
||||
+ && source_profile.importer_type != user_data_importer::TYPE_ZEN) {
|
||||
+ if (source_profile.importer_type != user_data_importer::TYPE_FIREFOX &&
|
||||
+ source_profile.importer_type != user_data_importer::TYPE_ZEN) {
|
||||
return true;
|
||||
}
|
||||
|
||||
--- a/chrome/browser/importer/importer_list.cc
|
||||
+++ b/chrome/browser/importer/importer_list.cc
|
||||
@@ -92,6 +92,51 @@ void DetectSafariProfiles(
|
||||
@@ -92,6 +92,52 @@ void DetectSafariProfiles(
|
||||
}
|
||||
#endif // BUILDFLAG(IS_MAC)
|
||||
|
||||
@@ -41,8 +41,9 @@
|
||||
+
|
||||
+ for (const auto& detail : details) {
|
||||
+ base::FilePath app_path;
|
||||
+ if (detail.path.empty())
|
||||
+ if (detail.path.empty()) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ int version;
|
||||
+ GetFirefoxVersionAndPathFromProfile(detail.path, &version, &app_path);
|
||||
@@ -63,8 +64,8 @@
|
||||
+ zen.app_path = app_path;
|
||||
+ }
|
||||
+
|
||||
+ zen.services_supported = user_data_importer::HISTORY
|
||||
+ | user_data_importer::FAVORITES;
|
||||
+ zen.services_supported =
|
||||
+ user_data_importer::HISTORY | user_data_importer::FAVORITES;
|
||||
+ zen.locale = locale;
|
||||
+ profiles->push_back(zen);
|
||||
+ }
|
||||
@@ -73,49 +74,99 @@
|
||||
// |locale|: The application locale used for lookups in Firefox's
|
||||
// locale-specific search engines feature (see firefox_importer.cc for
|
||||
// details).
|
||||
@@ -157,6 +202,8 @@ void DetectFirefoxProfiles(
|
||||
firefox.locale = locale;
|
||||
profiles->push_back(firefox);
|
||||
}
|
||||
+
|
||||
@@ -100,6 +146,7 @@ void DetectFirefoxProfiles(
|
||||
std::vector<user_data_importer::SourceProfile>* profiles) {
|
||||
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
|
||||
base::BlockingType::MAY_BLOCK);
|
||||
+ DetectZenProfiles(locale, profiles);
|
||||
}
|
||||
|
||||
std::vector<user_data_importer::SourceProfile> DetectSourceProfilesWorker(
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
const std::string firefox_install_id =
|
||||
shell_integration::GetFirefoxProgIdSuffix();
|
||||
--- a/chrome/common/importer/firefox_importer_utils_linux.cc
|
||||
+++ b/chrome/common/importer/firefox_importer_utils_linux.cc
|
||||
@@ -9,17 +9,26 @@
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/path_service.h"
|
||||
@@ -41,11 +41,16 @@ constexpr const base::FilePath::CharType
|
||||
kFlatpakFirefoxProfileStorageBasePath =
|
||||
FILE_PATH_LITERAL(".var/app/org.mozilla.firefox");
|
||||
|
||||
-base::FilePath GetProfilesINI() {
|
||||
+base::FilePath _GetProfilesINI(const char* folder) {
|
||||
base::FilePath ini_file;
|
||||
// The default location of the profile folder containing user data is
|
||||
// under user HOME directory in .mozilla/firefox folder on Linux.
|
||||
base::FilePath home;
|
||||
base::PathService::Get(base::DIR_HOME, &home);
|
||||
if (!home.empty()) {
|
||||
- ini_file = home.Append(".mozilla/firefox/profiles.ini");
|
||||
+ ini_file = home.Append(folder)
|
||||
+ .Append("profiles.ini");
|
||||
}
|
||||
if (base::PathExists(ini_file))
|
||||
+constexpr const base::FilePath::CharType* const
|
||||
+ kFlatpakZenProfileStorageBasePath =
|
||||
+ FILE_PATH_LITERAL(".var/app/app.zen_browser.zen");
|
||||
+
|
||||
// Search-priority-ordered array of base paths relative to the user $HOME
|
||||
// directory where the .mozilla directory may be located.
|
||||
constexpr const base::FilePath::CharType* const
|
||||
kFirefoxProfileStorageBasePaths[] = {kStandardFirefoxProfileStorageBasePath,
|
||||
kSnapFirefoxProfileStorageBasePath,
|
||||
+ kFlatpakZenProfileStorageBasePath,
|
||||
kFlatpakFirefoxProfileStorageBasePath};
|
||||
|
||||
// The subpath to the profiles.ini file relative to a profile storage base path.
|
||||
@@ -59,12 +64,18 @@ constexpr const base::FilePath::CharType
|
||||
constexpr const base::FilePath::StringViewType kFirefoxProfilesXdgIniSubpath =
|
||||
kFirefoxProfilesIniSubpath + 1;
|
||||
|
||||
-base::FilePath GetXdgProfilesINI() {
|
||||
+constexpr const base::FilePath::CharType* const kZenProfilesIniSubpath =
|
||||
+ FILE_PATH_LITERAL(".zen/profiles.ini");
|
||||
+
|
||||
+constexpr const base::FilePath::StringViewType kZenProfilesXdgIniSubpath =
|
||||
+ kZenProfilesIniSubpath + 1;
|
||||
+
|
||||
+base::FilePath GetXdgProfilesINIImpl(
|
||||
+ const base::FilePath::StringViewType ini_subpath) {
|
||||
auto env = base::Environment::Create();
|
||||
base::FilePath xdg_config_dir = base::nix::GetXDGDirectory(
|
||||
env.get(), base::nix::kXdgConfigHomeEnvVar, base::nix::kDotConfigDir);
|
||||
- base::FilePath ini_file =
|
||||
- xdg_config_dir.Append(kFirefoxProfilesXdgIniSubpath);
|
||||
+ base::FilePath ini_file = xdg_config_dir.Append(ini_subpath);
|
||||
if (base::PathExists(ini_file)) {
|
||||
return ini_file;
|
||||
}
|
||||
@@ -72,11 +83,11 @@ base::FilePath GetXdgProfilesINI() {
|
||||
return {};
|
||||
}
|
||||
|
||||
-} // namespace
|
||||
-
|
||||
-base::FilePath GetProfilesINI() {
|
||||
+base::FilePath GetProfilesINIImpl(const base::FilePath::CharType* ini_subpath,
|
||||
+ base::FilePath::StringViewType xdg_subpath) {
|
||||
// First, check the XDG-style (~/.config/mozilla/firefox) path.
|
||||
- if (auto xdg_ini_file = GetXdgProfilesINI(); !xdg_ini_file.empty()) {
|
||||
+ if (auto xdg_ini_file = GetXdgProfilesINIImpl(xdg_subpath);
|
||||
+ !xdg_ini_file.empty()) {
|
||||
return xdg_ini_file;
|
||||
}
|
||||
|
||||
@@ -93,8 +104,7 @@ base::FilePath GetProfilesINI() {
|
||||
|
||||
for (const auto* profile_storage_base : kFirefoxProfileStorageBasePaths) {
|
||||
base::FilePath ini_file = home;
|
||||
- ini_file = ini_file.Append(profile_storage_base)
|
||||
- .Append(kFirefoxProfilesIniSubpath);
|
||||
+ ini_file = ini_file.Append(profile_storage_base).Append(ini_subpath);
|
||||
if (base::PathExists(ini_file)) {
|
||||
return ini_file;
|
||||
}
|
||||
@@ -102,3 +112,14 @@ base::FilePath GetProfilesINI() {
|
||||
|
||||
return base::FilePath();
|
||||
}
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
+base::FilePath GetProfilesINI() {
|
||||
+ return _GetProfilesINI(".mozilla/firefox");
|
||||
+ return GetProfilesINIImpl(kFirefoxProfilesIniSubpath,
|
||||
+ kFirefoxProfilesXdgIniSubpath);
|
||||
+}
|
||||
+
|
||||
+base::FilePath GetZenProfilesINI() {
|
||||
+ return _GetProfilesINI(".zen");
|
||||
+ return GetProfilesINIImpl(kZenProfilesIniSubpath, kZenProfilesXdgIniSubpath);
|
||||
+}
|
||||
--- a/chrome/common/importer/firefox_importer_utils_mac.mm
|
||||
+++ b/chrome/common/importer/firefox_importer_utils_mac.mm
|
||||
@@ -7,15 +7,23 @@
|
||||
@@ -7,15 +7,22 @@
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/path_service.h"
|
||||
|
||||
@@ -125,9 +176,9 @@
|
||||
if (!base::PathService::Get(base::DIR_APP_DATA, &app_data_path)) {
|
||||
return base::FilePath();
|
||||
}
|
||||
base::FilePath ini_file =
|
||||
- base::FilePath ini_file =
|
||||
- app_data_path.Append("Firefox").Append("profiles.ini");
|
||||
+ app_data_path.Append(folder).Append("profiles.ini");
|
||||
+ base::FilePath ini_file = app_data_path.Append(folder).Append("profiles.ini");
|
||||
if (!base::PathExists(ini_file)) {
|
||||
return base::FilePath();
|
||||
}
|
||||
@@ -143,7 +194,7 @@
|
||||
+}
|
||||
--- a/chrome/common/importer/firefox_importer_utils_win.cc
|
||||
+++ b/chrome/common/importer/firefox_importer_utils_win.cc
|
||||
@@ -68,16 +68,23 @@ base::FilePath GetFirefoxInstallPathFrom
|
||||
@@ -68,16 +68,24 @@ base::FilePath GetFirefoxInstallPathFrom
|
||||
return (result != ERROR_SUCCESS) ? base::FilePath() : base::FilePath(buffer);
|
||||
}
|
||||
|
||||
@@ -152,8 +203,10 @@
|
||||
base::FilePath ini_file;
|
||||
// The default location of the profile folder containing user data is
|
||||
// under the "Application Data" folder in Windows XP, Vista, and 7.
|
||||
if (!base::PathService::Get(base::DIR_ROAMING_APP_DATA, &ini_file))
|
||||
- if (!base::PathService::Get(base::DIR_ROAMING_APP_DATA, &ini_file))
|
||||
+ if (!base::PathService::Get(base::DIR_ROAMING_APP_DATA, &ini_file)) {
|
||||
return base::FilePath();
|
||||
+ }
|
||||
|
||||
- ini_file = ini_file.AppendASCII("Mozilla");
|
||||
- ini_file = ini_file.AppendASCII("Firefox");
|
||||
@@ -175,14 +228,14 @@
|
||||
@@ -29,7 +29,8 @@ namespace {
|
||||
|
||||
// Retrieves the file system path of the profile name.
|
||||
base::FilePath GetProfilePath(const base::Value::Dict& root,
|
||||
base::FilePath GetProfilePath(const base::DictValue& root,
|
||||
- const std::string& profile_name) {
|
||||
+ const std::string& profile_name,
|
||||
+ const base::FilePath& base_dir) {
|
||||
std::string path_str;
|
||||
const std::string* is_relative =
|
||||
root.FindStringByDottedPath(profile_name + ".IsRelative");
|
||||
@@ -50,26 +51,41 @@ base::FilePath GetProfilePath(const base
|
||||
@@ -50,26 +51,39 @@ base::FilePath GetProfilePath(const base
|
||||
// path of profiles.ini. IsRelative=0 refers to a custom profile
|
||||
// location.
|
||||
if (*is_relative == "1")
|
||||
@@ -197,7 +250,7 @@
|
||||
-std::vector<FirefoxDetail> GetFirefoxDetails(
|
||||
- const std::string& firefox_install_id) {
|
||||
- base::FilePath ini_file = GetProfilesINI();
|
||||
+std::vector<FirefoxDetail> _GetFirefoxDetails(
|
||||
+std::vector<FirefoxDetail> GetFirefoxDetailsImpl(
|
||||
+ const std::string& firefox_install_id,
|
||||
+ base::FilePath ini_file) {
|
||||
std::string content;
|
||||
@@ -205,32 +258,30 @@
|
||||
DictionaryValueINIParser ini_parser;
|
||||
ini_parser.Parse(content);
|
||||
- return GetFirefoxDetailsFromDictionary(ini_parser.root(), firefox_install_id);
|
||||
+ return GetFirefoxDetailsFromDictionary(
|
||||
+ ini_parser.root(), firefox_install_id, ini_file.DirName());
|
||||
+ return GetFirefoxDetailsFromDictionary(ini_parser.root(), firefox_install_id,
|
||||
+ ini_file.DirName());
|
||||
+}
|
||||
+
|
||||
+std::vector<FirefoxDetail> GetFirefoxDetails(
|
||||
+ const std::string& firefox_install_id) {
|
||||
+ base::FilePath ini_file = GetProfilesINI();
|
||||
+ return _GetFirefoxDetails(firefox_install_id, ini_file);
|
||||
+ return GetFirefoxDetailsImpl(firefox_install_id, ini_file);
|
||||
+}
|
||||
+
|
||||
+std::vector<FirefoxDetail> GetZenDetails(
|
||||
+ const std::string& zen_install_id) {
|
||||
+std::vector<FirefoxDetail> GetZenDetails(const std::string& zen_install_id) {
|
||||
+ base::FilePath ini_file = GetZenProfilesINI();
|
||||
+ return _GetFirefoxDetails(zen_install_id, ini_file);
|
||||
+ return GetFirefoxDetailsImpl(zen_install_id, ini_file);
|
||||
}
|
||||
|
||||
+
|
||||
std::vector<FirefoxDetail> GetFirefoxDetailsFromDictionary(
|
||||
const base::Value::Dict& root,
|
||||
const base::DictValue& root,
|
||||
- const std::string& firefox_install_id) {
|
||||
+ const std::string& firefox_install_id,
|
||||
+ const base::FilePath& base_dir) {
|
||||
std::vector<FirefoxDetail> profile_details;
|
||||
|
||||
for (int i = 0; ; ++i) {
|
||||
@@ -84,7 +100,7 @@ std::vector<FirefoxDetail> GetFirefoxDet
|
||||
@@ -84,7 +98,7 @@ std::vector<FirefoxDetail> GetFirefoxDet
|
||||
continue;
|
||||
|
||||
FirefoxDetail details;
|
||||
@@ -241,26 +292,25 @@
|
||||
root.FindStringByDottedPath(current_profile + ".Name")) {
|
||||
--- a/chrome/common/importer/firefox_importer_utils.h
|
||||
+++ b/chrome/common/importer/firefox_importer_utils.h
|
||||
@@ -45,13 +45,17 @@ struct FirefoxDetail {
|
||||
@@ -41,13 +41,16 @@ struct FirefoxDetail {
|
||||
std::vector<FirefoxDetail> GetFirefoxDetails(
|
||||
const std::string& firefox_install_id);
|
||||
|
||||
+std::vector<FirefoxDetail> GetZenDetails(
|
||||
+ const std::string& zen_install_id);
|
||||
+std::vector<FirefoxDetail> GetZenDetails(const std::string& zen_install_id);
|
||||
+
|
||||
// Returns the path to the Firefox profile, using a custom dictionary.
|
||||
// If |firefox_install_id| is not empty returns the default profile associated
|
||||
// with that id.
|
||||
// Exposed for testing.
|
||||
std::vector<FirefoxDetail> GetFirefoxDetailsFromDictionary(
|
||||
const base::Value::Dict& root,
|
||||
const base::DictValue& root,
|
||||
- const std::string& firefox_install_id);
|
||||
+ const std::string& firefox_install_id,
|
||||
+ const base::FilePath& base_dir);
|
||||
|
||||
// Detects version of Firefox and installation path for the given Firefox
|
||||
// profile.
|
||||
@@ -62,6 +66,7 @@ bool GetFirefoxVersionAndPathFromProfile
|
||||
@@ -58,6 +61,7 @@ bool GetFirefoxVersionAndPathFromProfile
|
||||
// Gets the full path of the profiles.ini file. This file records the profiles
|
||||
// that can be used by Firefox. Returns an empty path if failed.
|
||||
base::FilePath GetProfilesINI();
|
||||
@@ -290,15 +340,14 @@
|
||||
} // namespace user_data_importer
|
||||
--- a/chrome/browser/ui/webui/settings/import_data_handler.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/import_data_handler.cc
|
||||
@@ -106,6 +106,12 @@ void ImportDataHandler::StartImport(
|
||||
@@ -106,6 +106,11 @@ void ImportDataHandler::StartImport(
|
||||
importer_host_ = new ExternalProcessImporterHost();
|
||||
importer_host_->set_observer(this);
|
||||
Profile* profile = Profile::FromWebUI(web_ui());
|
||||
+
|
||||
+ importer_host_->set_parent_window(
|
||||
+ web_ui()->GetWebContents()->GetTopLevelNativeWindow());
|
||||
+ importer_host_->set_parent_view(
|
||||
+ web_ui()->GetWebContents()->GetNativeView());
|
||||
+ importer_host_->set_parent_view(web_ui()->GetWebContents()->GetNativeView());
|
||||
+
|
||||
importer_host_->StartImportSettings(source_profile, profile, imported_items,
|
||||
new ProfileWriter(profile));
|
||||
@@ -321,115 +370,30 @@
|
||||
|
||||
#if BUILDFLAG(IS_POSIX)
|
||||
locale_ = source_profile.locale;
|
||||
@@ -375,10 +377,12 @@ void FirefoxImporter::ImportBookmarks()
|
||||
}
|
||||
}
|
||||
@@ -380,8 +382,8 @@ void FirefoxImporter::ImportBookmarks()
|
||||
|
||||
+ ImportZenPins(db, bookmarks);
|
||||
+
|
||||
// Write into profile.
|
||||
if (!bookmarks.empty() && !cancelled()) {
|
||||
- const std::u16string& first_folder_name =
|
||||
- bridge_->GetLocalizedString(IDS_BOOKMARK_GROUP_FROM_FIREFOX);
|
||||
+ std::u16string first_folder_name = l10n_util::GetStringFUTF16(
|
||||
+ IDS_IMPORTED_FROM_BOOKMARK_FOLDER, browser_name_);
|
||||
+ IDS_IMPORTED_FROM_BOOKMARK_FOLDER, browser_name_);
|
||||
bridge_->AddBookmarks(bookmarks, first_folder_name);
|
||||
}
|
||||
if (!search_engines.empty() && !cancelled()) {
|
||||
@@ -399,6 +403,81 @@ void FirefoxImporter::ImportBookmarks()
|
||||
}
|
||||
}
|
||||
|
||||
+constexpr char kZenPinQuery[] = "SELECT uuid, title, url, is_group, created_at, "
|
||||
+ " is_essential, folder_parent_uuid FROM zen_pins";
|
||||
+
|
||||
+using user_data_importer::ImportedBookmarkEntry;
|
||||
+void FirefoxImporter::ImportZenPins(sql::Database& db,
|
||||
+ std::vector<ImportedBookmarkEntry>& bookmarks_out) {
|
||||
+ sql::Statement s(db.GetUniqueStatement(kZenPinQuery));
|
||||
+
|
||||
+ if (!s.is_valid()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ std::map<std::string, std::string> parents;
|
||||
+ std::map<std::string, ImportedBookmarkEntry> entries;
|
||||
+
|
||||
+ // first, we need to pull out all pins from the DB
|
||||
+ while (s.Step() && !cancelled()) {
|
||||
+ bool is_folder = s.ColumnBool(3); /* is_group */
|
||||
+
|
||||
+ std::string uuid = s.ColumnString(0); /* uuid */
|
||||
+ std::string parent = s.ColumnString(6); /* folder_parent_uuid */
|
||||
+
|
||||
+ if (!parent.empty()) {
|
||||
+ parents[uuid] = std::move(parent);
|
||||
+ }
|
||||
+
|
||||
+ ImportedBookmarkEntry entry;
|
||||
+ entry.creation_time = base::Time::FromTimeT(
|
||||
+ s.ColumnInt64(4) / 1000); /* created_at */
|
||||
+
|
||||
+ entry.title = s.ColumnString16(1); /* title */
|
||||
+ if (entry.title.ends_with(u'/')) {
|
||||
+ entry.title = u"";
|
||||
+ }
|
||||
+
|
||||
+ entry.url = GURL(s.ColumnStringView(2)); /* url */
|
||||
+ entry.path = {};
|
||||
+ entry.in_toolbar = s.ColumnBool(5); /* is_essential */
|
||||
+ entry.is_folder = is_folder;
|
||||
+
|
||||
+ entries[uuid] = std::move(entry);
|
||||
+ }
|
||||
+
|
||||
+ // compute the folder hierarchy
|
||||
+ for (auto& [ uuid, entry ] : entries) {
|
||||
+ std::vector<std::u16string> path;
|
||||
+ std::string current = uuid;
|
||||
+
|
||||
+ while (true) {
|
||||
+ auto query = parents.find(current);
|
||||
+
|
||||
+ if (query == parents.end()) {
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ current = query->second;
|
||||
+ path.insert(path.begin(),
|
||||
+ entries.find(current)->second.title);
|
||||
+ }
|
||||
+
|
||||
+ entry.path = std::move(path);
|
||||
+
|
||||
+ // Folders are ad-hoc constructed based on the .path
|
||||
+ // attribute that we defined just before this.
|
||||
+ // `is_folder` makes empty folders, which we don't
|
||||
+ // really care about when importing pins.
|
||||
+ // If you use empty folders for something, sorry I guess?
|
||||
+ if (entry.is_folder) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ bookmarks_out.push_back(std::move(entry));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
void FirefoxImporter::ImportPasswords() {
|
||||
// Initializes NSS3.
|
||||
--- a/chrome/utility/importer/firefox_importer.h
|
||||
+++ b/chrome/utility/importer/firefox_importer.h
|
||||
@@ -63,6 +63,8 @@ class FirefoxImporter : public Importer
|
||||
@@ -63,6 +63,9 @@ class FirefoxImporter : public Importer
|
||||
FRIEND_TEST_ALL_PREFIXES(FirefoxImporterTest, ImportBookmarksV25);
|
||||
|
||||
void ImportBookmarks();
|
||||
+ void ImportZenPins(sql::Database& db,
|
||||
+ std::vector<user_data_importer::ImportedBookmarkEntry>& bookmarks_out);
|
||||
+ void ImportZenPins(
|
||||
+ sql::Database& db,
|
||||
+ std::vector<user_data_importer::ImportedBookmarkEntry>& bookmarks_out);
|
||||
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
void ImportPasswords();
|
||||
@@ -125,6 +127,8 @@ class FirefoxImporter : public Importer
|
||||
@@ -125,6 +128,8 @@ class FirefoxImporter : public Importer
|
||||
std::string locale_;
|
||||
#endif
|
||||
|
||||
@@ -440,47 +404,65 @@
|
||||
|
||||
--- a/chrome/browser/importer/importer_lock_dialog.h
|
||||
+++ b/chrome/browser/importer/importer_lock_dialog.h
|
||||
@@ -19,13 +19,13 @@ namespace importer {
|
||||
@@ -17,15 +17,17 @@ namespace importer {
|
||||
// downstream embedders can specify tailored messages in their implementations.
|
||||
// After closing the dialog, the ImportHost receives a callback
|
||||
// with the message either to skip the import, or to continue the process.
|
||||
void ShowImportLockDialog(gfx::NativeWindow parent,
|
||||
base::OnceCallback<void(bool)> callback,
|
||||
-void ShowImportLockDialog(gfx::NativeWindow parent,
|
||||
- base::OnceCallback<void(bool)> callback,
|
||||
- int importer_lock_title_id = IDS_IMPORTER_LOCK_TITLE,
|
||||
- int importer_lock_text_id = IDS_IMPORTER_LOCK_TEXT);
|
||||
+ int importer_lock_title_id = IDS_EXTENSIONS_IMPORTER_LOCK_TITLE,
|
||||
+ int importer_lock_text_id = IDS_EXTENSIONS_IMPORTER_LOCK_TEXT);
|
||||
void ShowImportLockDialog(gfx::NativeView parent_view,
|
||||
gfx::NativeWindow parent,
|
||||
base::OnceCallback<void(bool)> callback,
|
||||
-void ShowImportLockDialog(gfx::NativeView parent_view,
|
||||
- gfx::NativeWindow parent,
|
||||
- base::OnceCallback<void(bool)> callback,
|
||||
- int importer_lock_title_id = IDS_IMPORTER_LOCK_TITLE,
|
||||
- int importer_lock_text_id = IDS_IMPORTER_LOCK_TEXT);
|
||||
+ int importer_lock_title_id = IDS_EXTENSIONS_IMPORTER_LOCK_TITLE,
|
||||
+ int importer_lock_text_id = IDS_EXTENSIONS_IMPORTER_LOCK_TEXT);
|
||||
+void ShowImportLockDialog(
|
||||
+ gfx::NativeWindow parent,
|
||||
+ base::OnceCallback<void(bool)> callback,
|
||||
+ int importer_lock_title_id = IDS_EXTENSIONS_IMPORTER_LOCK_TITLE,
|
||||
+ int importer_lock_text_id = IDS_EXTENSIONS_IMPORTER_LOCK_TEXT);
|
||||
+void ShowImportLockDialog(
|
||||
+ gfx::NativeView parent_view,
|
||||
+ gfx::NativeWindow parent,
|
||||
+ base::OnceCallback<void(bool)> callback,
|
||||
+ int importer_lock_title_id = IDS_EXTENSIONS_IMPORTER_LOCK_TITLE,
|
||||
+ int importer_lock_text_id = IDS_EXTENSIONS_IMPORTER_LOCK_TEXT);
|
||||
|
||||
} // namespace importer
|
||||
|
||||
--- a/chrome/browser/ui/views/importer/import_lock_dialog_view.h
|
||||
+++ b/chrome/browser/ui/views/importer/import_lock_dialog_view.h
|
||||
@@ -21,13 +21,13 @@ class ImportLockDialogView : public view
|
||||
@@ -19,15 +19,17 @@ class ImportLockDialogView : public view
|
||||
ImportLockDialogView(const ImportLockDialogView&) = delete;
|
||||
ImportLockDialogView& operator=(const ImportLockDialogView&) = delete;
|
||||
|
||||
static void Show(gfx::NativeWindow parent,
|
||||
base::OnceCallback<void(bool)> callback,
|
||||
- static void Show(gfx::NativeWindow parent,
|
||||
- base::OnceCallback<void(bool)> callback,
|
||||
- int importer_lock_title_id = IDS_IMPORTER_LOCK_TITLE,
|
||||
- int importer_lock_text_id = IDS_IMPORTER_LOCK_TEXT);
|
||||
+ int importer_lock_title_id = IDS_EXTENSIONS_IMPORTER_LOCK_TITLE,
|
||||
+ int importer_lock_text_id = IDS_EXTENSIONS_IMPORTER_LOCK_TEXT);
|
||||
static void Show(gfx::NativeView parent_view,
|
||||
gfx::NativeWindow parent,
|
||||
base::OnceCallback<void(bool)> callback,
|
||||
- static void Show(gfx::NativeView parent_view,
|
||||
- gfx::NativeWindow parent,
|
||||
- base::OnceCallback<void(bool)> callback,
|
||||
- int importer_lock_title_id = IDS_IMPORTER_LOCK_TITLE,
|
||||
- int importer_lock_text_id = IDS_IMPORTER_LOCK_TEXT);
|
||||
+ int importer_lock_title_id = IDS_EXTENSIONS_IMPORTER_LOCK_TITLE,
|
||||
+ int importer_lock_text_id = IDS_EXTENSIONS_IMPORTER_LOCK_TEXT);
|
||||
+ static void Show(
|
||||
+ gfx::NativeWindow parent,
|
||||
+ base::OnceCallback<void(bool)> callback,
|
||||
+ int importer_lock_title_id = IDS_EXTENSIONS_IMPORTER_LOCK_TITLE,
|
||||
+ int importer_lock_text_id = IDS_EXTENSIONS_IMPORTER_LOCK_TEXT);
|
||||
+ static void Show(
|
||||
+ gfx::NativeView parent_view,
|
||||
+ gfx::NativeWindow parent,
|
||||
+ base::OnceCallback<void(bool)> callback,
|
||||
+ int importer_lock_title_id = IDS_EXTENSIONS_IMPORTER_LOCK_TITLE,
|
||||
+ int importer_lock_text_id = IDS_EXTENSIONS_IMPORTER_LOCK_TEXT);
|
||||
ui::mojom::ModalType GetModalType() const override;
|
||||
|
||||
private:
|
||||
--- a/chrome/common/importer/profile_import_process_param_traits_macros.h
|
||||
+++ b/chrome/common/importer/profile_import_process_param_traits_macros.h
|
||||
@@ -20,11 +20,11 @@
|
||||
@@ -23,11 +23,11 @@
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
IPC_ENUM_TRAITS_MIN_MAX_VALUE(user_data_importer::ImporterType,
|
||||
user_data_importer::TYPE_UNKNOWN,
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--- a/chrome/browser/ui/views/frame/system_menu_model_builder.cc
|
||||
+++ b/chrome/browser/ui/views/frame/system_menu_model_builder.cc
|
||||
@@ -104,6 +104,12 @@ void SystemMenuModelBuilder::BuildSystem
|
||||
|
||||
model->AddItemWithStringId(IDC_BOOKMARK_ALL_TABS, IDS_BOOKMARK_ALL_TABS);
|
||||
model->AddItemWithStringId(IDC_NAME_WINDOW, IDS_NAME_WINDOW);
|
||||
+
|
||||
+ if (!browser()->profile()->IsOffTheRecord()) {
|
||||
+ model->AddSeparator(ui::NORMAL_SEPARATOR);
|
||||
+ model->AddItemWithStringId(IDC_SHOW_CUSTOMIZE_CHROME_SIDE_PANEL,
|
||||
+ IDS_SHOW_CUSTOMIZE_CHROME_SIDE_PANEL);
|
||||
+ }
|
||||
#if BUILDFLAG(ENABLE_GLIC)
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// On Windows we can not remove an item when showing the menu. So only add
|
||||
@@ -1,16 +1,28 @@
|
||||
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
|
||||
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
|
||||
@@ -2157,7 +2157,6 @@ void RenderViewContextMenu::AppendPageIt
|
||||
@@ -1161,11 +1161,6 @@ void RenderViewContextMenu::InitMenu() {
|
||||
AppendSpellingAndSearchSuggestionItems();
|
||||
}
|
||||
|
||||
- if (content_type_->SupportsGroup(
|
||||
- ContextMenuContentType::ITEM_GROUP_AUTOFILL)) {
|
||||
- autofill_context_menu_manager_.AppendItems();
|
||||
- }
|
||||
-
|
||||
if (editable) {
|
||||
AppendOtherEditableItems();
|
||||
}
|
||||
@@ -2289,7 +2284,6 @@ void RenderViewContextMenu::AppendPageIt
|
||||
IDS_CONTENT_CONTEXT_SAVEPAGEAS);
|
||||
menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT);
|
||||
AppendLiveCaptionItem();
|
||||
- AppendMediaRouterItem();
|
||||
if (IsRegionSearchEnabled()) {
|
||||
AppendRegionSearchItem();
|
||||
}
|
||||
@@ -2286,8 +2285,7 @@ void RenderViewContextMenu::AppendMediaR
|
||||
|
||||
void RenderViewContextMenu::AppendReadingModeItem() {
|
||||
if (features::IsReadAnythingMenuShuffleExperimentEnabled()) {
|
||||
// This will be set to false in AppendRegionSearchItem() if it is called.
|
||||
@@ -2441,8 +2435,7 @@ void RenderViewContextMenu::AppendMediaR
|
||||
|
||||
void RenderViewContextMenu::AppendReadAnythingItem() {
|
||||
// Show Read Anything option if it's not already open in the side panel.
|
||||
- if (GetBrowser() && GetBrowser()->is_type_normal() &&
|
||||
- !IsReadAnythingEntryShowing(GetBrowser())) {
|
||||
@@ -18,7 +30,7 @@
|
||||
menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_OPEN_IN_READING_MODE,
|
||||
IDS_CONTENT_CONTEXT_READING_MODE);
|
||||
}
|
||||
@@ -3554,10 +3552,12 @@ void RenderViewContextMenu::ExecuteComma
|
||||
@@ -3724,10 +3717,12 @@ void RenderViewContextMenu::ExecuteComma
|
||||
}
|
||||
|
||||
void RenderViewContextMenu::AddSpellCheckServiceItem(bool is_checked) {
|
||||
@@ -31,7 +43,7 @@
|
||||
if (is_checked) {
|
||||
menu_model_.AddCheckItemWithStringId(
|
||||
IDC_CONTENT_CONTEXT_ACCESSIBILITY_LABELS_TOGGLE,
|
||||
@@ -3934,6 +3934,8 @@ bool RenderViewContextMenu::IsVideoFrame
|
||||
@@ -4118,6 +4113,8 @@ bool RenderViewContextMenu::IsVideoFrame
|
||||
bool RenderViewContextMenu::AppendQRCodeGeneratorItem(bool for_image,
|
||||
bool draw_icon,
|
||||
bool add_separator) {
|
||||
@@ -42,7 +54,7 @@
|
||||
}
|
||||
--- a/chrome/browser/ui/browser_tab_strip_model_delegate.cc
|
||||
+++ b/chrome/browser/ui/browser_tab_strip_model_delegate.cc
|
||||
@@ -340,6 +340,7 @@ void BrowserTabStripModelDelegate::AddTo
|
||||
@@ -306,6 +306,7 @@ void BrowserTabStripModelDelegate::AddTo
|
||||
}
|
||||
|
||||
bool BrowserTabStripModelDelegate::SupportsReadLater() {
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
--- a/chrome/browser/ui/omnibox/omnibox_pedal_implementations.cc
|
||||
+++ b/chrome/browser/ui/omnibox/omnibox_pedal_implementations.cc
|
||||
@@ -2029,12 +2029,7 @@ GetPedalImplementations(bool incognito,
|
||||
if (!incognito && !guest) {
|
||||
add(new OmniboxPedalClearBrowsingData(/*incognito=*/false));
|
||||
}
|
||||
- add(new OmniboxPedalManagePasswords());
|
||||
- add(new OmniboxPedalUpdateCreditCard());
|
||||
add(new OmniboxPedalLaunchIncognito());
|
||||
- if (!base::android::device_info::is_automotive()) {
|
||||
- add(new OmniboxPedalRunChromeSafetyCheck());
|
||||
- }
|
||||
add(new OmniboxPedalPlayChromeDinoGame());
|
||||
add(new OmniboxPedalManageSiteSettings());
|
||||
add(new OmniboxPedalManageChromeSettings());
|
||||
@@ -2046,37 +2041,15 @@ GetPedalImplementations(bool incognito,
|
||||
if (!guest) {
|
||||
add(new OmniboxPedalClearBrowsingData(incognito));
|
||||
}
|
||||
- add(new OmniboxPedalManagePasswords());
|
||||
- add(new OmniboxPedalUpdateCreditCard());
|
||||
add(new OmniboxPedalLaunchIncognito());
|
||||
- add(new OmniboxPedalTranslate());
|
||||
add(new OmniboxPedalUpdateChrome());
|
||||
- add(new OmniboxPedalRunChromeSafetyCheck());
|
||||
add(new OmniboxPedalManageSecuritySettings());
|
||||
add(new OmniboxPedalManageCookies());
|
||||
- add(new OmniboxPedalManageAddresses());
|
||||
- add(new OmniboxPedalManageSync());
|
||||
add(new OmniboxPedalManageSiteSettings());
|
||||
- add(new OmniboxPedalSeeChromeTips());
|
||||
-
|
||||
- if (testing || BUILDFLAG(GOOGLE_CHROME_BRANDING)) {
|
||||
- add(new OmniboxPedalCreateGoogleDoc());
|
||||
- add(new OmniboxPedalCreateGoogleSheet());
|
||||
- add(new OmniboxPedalCreateGoogleSlide());
|
||||
- add(new OmniboxPedalCreateGoogleCalendarEvent());
|
||||
- add(new OmniboxPedalCreateGoogleSite());
|
||||
- add(new OmniboxPedalCreateGoogleKeepNote());
|
||||
- add(new OmniboxPedalCreateGoogleForm());
|
||||
- add(new OmniboxPedalManageGoogleAccount());
|
||||
- add(new OmniboxPedalChangeGooglePassword());
|
||||
- }
|
||||
-
|
||||
if (incognito) {
|
||||
add(new OmniboxPedalCloseIncognitoWindows());
|
||||
}
|
||||
add(new OmniboxPedalPlayChromeDinoGame());
|
||||
- add(new OmniboxPedalFindMyPhone());
|
||||
- add(new OmniboxPedalManageGooglePrivacy());
|
||||
add(new OmniboxPedalManageChromeSettings());
|
||||
add(new OmniboxPedalManageChromeDownloads());
|
||||
add(new OmniboxPedalViewChromeHistory());
|
||||
@@ -0,0 +1,221 @@
|
||||
--- a/components/component_updater/component_updater_url_constants.cc
|
||||
+++ b/components/component_updater/component_updater_url_constants.cc
|
||||
@@ -15,9 +15,9 @@ namespace component_updater {
|
||||
// The value of |kDefaultUrlSource| can be overridden with
|
||||
// --component-updater=url-source=someurl.
|
||||
const char kUpdaterJSONDefaultUrl[] =
|
||||
- "https://update.googleapis.com/service/update2/json";
|
||||
+ "trk:345:https://update.googleapis.com/service/update2/json";
|
||||
|
||||
const char kUpdaterJSONFallbackUrl[] =
|
||||
- "http://update.googleapis.com/service/update2/json";
|
||||
+ "trk:346:http://update.googleapis.com/service/update2/json";
|
||||
|
||||
} // namespace component_updater
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "components/helium_services/pref_names.h"
|
||||
+#include "components/helium_services/schema.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "net/base/url_util.h"
|
||||
#include "url/gurl.h"
|
||||
@@ -84,6 +85,12 @@ bool ShouldAccessUpdateService(const Pre
|
||||
prefs.GetBoolean(prefs::kHeliumUpdateFetchingEnabled);
|
||||
}
|
||||
|
||||
+bool ShouldAccessComponentUpdateService(const PrefService& prefs) {
|
||||
+ return ShouldAccessServices(prefs) &&
|
||||
+ HasAcceptedSchema(prefs, 1) &&
|
||||
+ prefs.GetBoolean(prefs::kHeliumUpdateFetchingEnabled);
|
||||
+}
|
||||
+
|
||||
bool ShouldAccessUBlockAssets(const PrefService& prefs) {
|
||||
return ShouldAccessServices(prefs) &&
|
||||
prefs.GetBoolean(prefs::kHeliumUBlockAssetsEnabled);
|
||||
@@ -128,6 +135,14 @@ GURL GetBrowserUpdateURL(const PrefServi
|
||||
#endif
|
||||
}
|
||||
|
||||
+GURL GetComponentUpdateURL(const PrefService* prefs) {
|
||||
+ if (!prefs || !ShouldAccessComponentUpdateService(*prefs)) {
|
||||
+ return GetDummyURL();
|
||||
+ }
|
||||
+
|
||||
+ return GetServicesBaseURL(*prefs).Resolve("/com");
|
||||
+}
|
||||
+
|
||||
GURL GetUBlockAssetsURL(const PrefService& prefs) {
|
||||
if (!ShouldAccessUBlockAssets(prefs)) {
|
||||
return GetDummyURL();
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -23,6 +23,7 @@ bool ShouldAccessServices(const PrefServ
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessUpdateService(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessComponentUpdateService(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessUBlockAssets(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
@@ -30,6 +31,7 @@ COMPONENT_EXPORT(HELIUM) GURL GetExtensi
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetSpellcheckURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetBrowserUpdateURL(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetComponentUpdateURL(const PrefService* prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetUBlockAssetsURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
--- a/chrome/browser/component_updater/chrome_component_updater_configurator.cc
|
||||
+++ b/chrome/browser/component_updater/chrome_component_updater_configurator.cc
|
||||
@@ -26,11 +26,14 @@
|
||||
#include "chrome/browser/component_updater/component_updater_utils.h"
|
||||
#include "chrome/browser/component_updater/updater_state.h"
|
||||
#include "chrome/browser/net/system_network_context_manager.h"
|
||||
+#include "chrome/browser/profiles/profile.h"
|
||||
+#include "chrome/browser/profiles/profile_manager.h"
|
||||
#include "chrome/browser/update_client/chrome_update_query_params_delegate.h"
|
||||
#include "chrome/common/channel_info.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#include "components/component_updater/component_updater_command_line_config_policy.h"
|
||||
#include "components/component_updater/configurator_impl.h"
|
||||
+#include "components/helium_services/helium_services_helpers.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "components/services/patch/content/patch_service.h"
|
||||
#include "components/services/unzip/content/unzip_service.h"
|
||||
@@ -55,6 +58,26 @@
|
||||
namespace component_updater {
|
||||
namespace {
|
||||
|
||||
+PrefService* GetProfilePrefs() {
|
||||
+ // Browser process and profile manager are usually
|
||||
+ // not null, but they may be during tests.
|
||||
+ if (!g_browser_process) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ ProfileManager* pm = g_browser_process->profile_manager();
|
||||
+ if (!pm) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ Profile* profile = pm->GetLastUsedProfileIfLoaded();
|
||||
+ if (!profile) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ return profile->GetPrefs();
|
||||
+}
|
||||
+
|
||||
class ChromeConfigurator : public update_client::Configurator {
|
||||
public:
|
||||
ChromeConfigurator(const base::CommandLine* cmdline,
|
||||
@@ -154,12 +177,12 @@ base::TimeDelta ChromeConfigurator::Upda
|
||||
|
||||
std::vector<GURL> ChromeConfigurator::UpdateUrl() const {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
- return configurator_impl_.UpdateUrl();
|
||||
+ return {helium::GetComponentUpdateURL(GetProfilePrefs())};
|
||||
}
|
||||
|
||||
std::vector<GURL> ChromeConfigurator::PingUrl() const {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
- return configurator_impl_.PingUrl();
|
||||
+ return {helium::GetComponentUpdateURL(GetProfilePrefs())};
|
||||
}
|
||||
|
||||
std::string ChromeConfigurator::GetProdId() const {
|
||||
--- a/components/component_updater/component_installer.cc
|
||||
+++ b/components/component_updater/component_installer.cc
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
+#include "base/containers/fixed_flat_set.h"
|
||||
#include "base/files/file_enumerator.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
@@ -111,7 +112,22 @@ void ComponentInstaller::Register(Compon
|
||||
|
||||
std::vector<uint8_t> public_key_hash;
|
||||
installer_policy_->GetHash(&public_key_hash);
|
||||
+
|
||||
+ static constexpr auto kAllowedComponents =
|
||||
+ base::MakeFixedFlatSet<std::string_view>(
|
||||
+ base::sorted_unique,
|
||||
+ {
|
||||
+ "hfnkpimlhhgieaddgfemjhofmfblmnib", // CRLSet
|
||||
+ "oimompecagnajdejgnnjijobebaeigek", // WidevineCdm
|
||||
+ }
|
||||
+ );
|
||||
+
|
||||
const auto crx_id = update_client::GetCrxIdFromPublicKeyHash(public_key_hash);
|
||||
+
|
||||
+ if (!kAllowedComponents.contains(crx_id)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
Register(base::BindOnce(&ComponentUpdateService::RegisterComponent,
|
||||
base::Unretained(cus)),
|
||||
std::move(callback), cus->GetRegisteredVersion(crx_id),
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -7067,6 +7067,9 @@ Keep your key file in a safe place. You
|
||||
<message name="IDS_COMPONENTS_SVC_STATUS_UPDATE_ERROR" desc="Service Status">
|
||||
Update error
|
||||
</message>
|
||||
+ <message name="IDS_COMPONENTS_SVC_STATUS_ERROR_HELIUM_SERVICES" desc="Service Status">
|
||||
+ Component updates are disabled. See Helium services in settings.
|
||||
+ </message>
|
||||
<message name="IDS_COMPONENTS_UNKNOWN" desc="Service Status">
|
||||
Unknown
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/components/components_handler.cc
|
||||
+++ b/chrome/browser/ui/webui/components/components_handler.cc
|
||||
@@ -12,8 +12,12 @@
|
||||
#include "base/notreached.h"
|
||||
#include "base/values.h"
|
||||
#include "build/build_config.h"
|
||||
+#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
+#include "components/helium_services/helium_services_helpers.h"
|
||||
+#include "components/prefs/pref_service.h"
|
||||
#include "components/update_client/crx_update_item.h"
|
||||
+#include "content/public/browser/web_contents.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
|
||||
ComponentsHandler::ComponentsHandler(
|
||||
@@ -82,6 +86,20 @@ void ComponentsHandler::OnEvent(const up
|
||||
|
||||
std::u16string ComponentsHandler::ServiceStatusToString(
|
||||
update_client::ComponentState state) {
|
||||
+
|
||||
+ if (state == update_client::ComponentState::kUpdateError) {
|
||||
+ Profile* profile = Profile::FromBrowserContext(
|
||||
+ web_ui()->GetWebContents()->GetBrowserContext());
|
||||
+
|
||||
+ if (profile) {
|
||||
+ PrefService* prefs = profile->GetPrefs();
|
||||
+ if (prefs && !helium::ShouldAccessComponentUpdateService(*prefs)) {
|
||||
+ return l10n_util::GetStringUTF16(
|
||||
+ IDS_COMPONENTS_SVC_STATUS_ERROR_HELIUM_SERVICES);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
switch (state) {
|
||||
case update_client::ComponentState::kNew:
|
||||
return l10n_util::GetStringUTF16(IDS_COMPONENTS_SVC_STATUS_NEW);
|
||||
--- a/chrome/browser/ui/webui/components/components_handler.h
|
||||
+++ b/chrome/browser/ui/webui/components/components_handler.h
|
||||
@@ -40,7 +40,7 @@ class ComponentsHandler : public content
|
||||
void OnEvent(const update_client::CrxUpdateItem& item) override;
|
||||
|
||||
private:
|
||||
- static std::u16string ServiceStatusToString(
|
||||
+ std::u16string ServiceStatusToString(
|
||||
update_client::ComponentState state);
|
||||
|
||||
base::ListValue LoadComponents();
|
||||
@@ -1,55 +0,0 @@
|
||||
--- a/chrome/app/chrome_dll.rc
|
||||
+++ b/chrome/app/chrome_dll.rc
|
||||
@@ -49,7 +49,7 @@ BEGIN
|
||||
"W", IDC_CLOSE_WINDOW, VIRTKEY, CONTROL, SHIFT
|
||||
"I", IDC_DEV_TOOLS, VIRTKEY, CONTROL, SHIFT
|
||||
"J", IDC_DEV_TOOLS_CONSOLE, VIRTKEY, CONTROL, SHIFT
|
||||
- "C", IDC_DEV_TOOLS_INSPECT, VIRTKEY, CONTROL, SHIFT
|
||||
+ "C", IDC_COPY_URL, VIRTKEY, CONTROL, SHIFT
|
||||
VK_F12, IDC_DEV_TOOLS_TOGGLE, VIRTKEY
|
||||
"F", IDC_FIND, VIRTKEY, CONTROL
|
||||
"G", IDC_FIND_NEXT, VIRTKEY, CONTROL
|
||||
--- a/chrome/browser/global_keyboard_shortcuts_mac.mm
|
||||
+++ b/chrome/browser/global_keyboard_shortcuts_mac.mm
|
||||
@@ -145,7 +145,7 @@ const std::vector<KeyboardShortcutData>&
|
||||
|
||||
{true, true, false, false, kVK_ANSI_M, IDC_SHOW_AVATAR_MENU},
|
||||
{true, false, false, true, kVK_ANSI_L, IDC_SHOW_DOWNLOADS},
|
||||
- {true, true, false, false, kVK_ANSI_C, IDC_DEV_TOOLS_INSPECT},
|
||||
+ {true, true, false, false, kVK_ANSI_C, IDC_COPY_URL},
|
||||
{true, false, false, true, kVK_ANSI_C, IDC_DEV_TOOLS_INSPECT},
|
||||
{true, false, false, true, kVK_DownArrow, IDC_FOCUS_NEXT_PANE},
|
||||
{true, false, false, true, kVK_UpArrow, IDC_FOCUS_PREVIOUS_PANE},
|
||||
--- a/chrome/browser/ui/cocoa/accelerators_cocoa.mm
|
||||
+++ b/chrome/browser/ui/cocoa/accelerators_cocoa.mm
|
||||
@@ -37,7 +37,7 @@ const struct AcceleratorMapping {
|
||||
{IDC_CUT, ui::EF_COMMAND_DOWN, ui::VKEY_X},
|
||||
{IDC_DEV_TOOLS, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN, ui::VKEY_I},
|
||||
{IDC_DEV_TOOLS_CONSOLE, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN, ui::VKEY_J},
|
||||
- {IDC_DEV_TOOLS_INSPECT, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN, ui::VKEY_C},
|
||||
+ {IDC_COPY_URL, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN, ui::VKEY_C},
|
||||
{IDC_FIND, ui::EF_COMMAND_DOWN, ui::VKEY_F},
|
||||
{IDC_NEW_INCOGNITO_WINDOW, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN,
|
||||
ui::VKEY_N},
|
||||
--- a/chrome/browser/ui/views/accelerator_table.cc
|
||||
+++ b/chrome/browser/ui/views/accelerator_table.cc
|
||||
@@ -269,7 +269,7 @@ const AcceleratorMapping kDevToolsAccele
|
||||
{ui::VKEY_J, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
|
||||
IDC_DEV_TOOLS_CONSOLE},
|
||||
{ui::VKEY_C, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
|
||||
- IDC_DEV_TOOLS_INSPECT},
|
||||
+ IDC_COPY_URL},
|
||||
{ui::VKEY_U, ui::EF_CONTROL_DOWN, IDC_VIEW_SOURCE},
|
||||
#endif // !BUILDFLAG(IS_MAC)
|
||||
};
|
||||
--- a/chrome/browser/ui/cocoa/main_menu_builder.mm
|
||||
+++ b/chrome/browser/ui/cocoa/main_menu_builder.mm
|
||||
@@ -189,6 +189,8 @@ NSMenuItem* BuildEditMenu(NSApplication*
|
||||
Item(IDS_COPY_MAC)
|
||||
.tag(IDC_CONTENT_CONTEXT_COPY)
|
||||
.action(@selector(copy:)),
|
||||
+ Item(IDS_COPY_URL)
|
||||
+ .command_id(IDC_COPY_URL),
|
||||
Item(IDS_PASTE_MAC)
|
||||
.tag(IDC_CONTENT_CONTEXT_PASTE)
|
||||
.action(@selector(paste:)),
|
||||
@@ -0,0 +1,20 @@
|
||||
--- a/services/network/public/cpp/features.cc
|
||||
+++ b/services/network/public/cpp/features.cc
|
||||
@@ -466,7 +466,7 @@ BASE_FEATURE(kUpdateRequestForCorsRedire
|
||||
|
||||
// https://github.com/patcg-individual-drafts/topics
|
||||
// Kill switch for the Topics API.
|
||||
-BASE_FEATURE(kBrowsingTopics, base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+BASE_FEATURE(kBrowsingTopics, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
// Enable the shared storage API. Note that enabling this feature does not
|
||||
// automatically expose this API to the web, it only allows the element to be
|
||||
@@ -545,7 +545,7 @@ BASE_FEATURE(kSharedStorageTransactional
|
||||
|
||||
// Kill switch for the Interest Group API, i.e. if disabled, the
|
||||
// API exposure will be disabled regardless of the OT config.
|
||||
-BASE_FEATURE(kInterestGroupStorage, base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+BASE_FEATURE(kInterestGroupStorage, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
// TODO(crbug.com/40176812): Adjust these limits in response to usage.
|
||||
BASE_FEATURE_PARAM(int,
|
||||
kInterestGroupStorageMaxOwners,
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/components/bookmarks/browser/bookmark_utils.cc
|
||||
+++ b/components/bookmarks/browser/bookmark_utils.cc
|
||||
@@ -449,7 +449,7 @@ bool DoesBookmarkContainWords(const std:
|
||||
@@ -450,7 +450,7 @@ bool DoesBookmarkContainWords(const std:
|
||||
|
||||
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--- a/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc
|
||||
+++ b/chrome/browser/ui/views/webid/fedcm_account_selection_view_desktop.cc
|
||||
@@ -1294,6 +1294,9 @@ void FedCmAccountSelectionView::ShouldSh
|
||||
}
|
||||
|
||||
if (dialog_type_ == DialogType::BUBBLE) {
|
||||
+ should_show = false;
|
||||
+ return;
|
||||
+
|
||||
// Hide the bubble dialog if it can't fit.
|
||||
if (!CanFitInWebContents()) {
|
||||
should_show = false;
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/components/history_clusters/core/features.cc
|
||||
+++ b/components/history_clusters/core/features.cc
|
||||
@@ -16,11 +16,7 @@ namespace history_clusters {
|
||||
@@ -15,11 +15,7 @@ namespace history_clusters {
|
||||
namespace {
|
||||
|
||||
constexpr auto enabled_by_default_desktop_only =
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/components/live_caption/caption_util.cc
|
||||
+++ b/components/live_caption/caption_util.cc
|
||||
@@ -127,6 +127,7 @@ std::optional<ui::CaptionStyle> GetCapti
|
||||
@@ -125,6 +125,7 @@ std::optional<ui::CaptionStyle> GetCapti
|
||||
}
|
||||
|
||||
bool IsLiveCaptionFeatureSupported() {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/components/search/ntp_features.cc
|
||||
+++ b/components/search/ntp_features.cc
|
||||
@@ -225,7 +225,7 @@ BASE_FEATURE(kNtpNextFeatures, base::FEA
|
||||
BASE_FEATURE(kNtpOneGoogleBarAsyncBarParts, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
// If enabled, a footer will show on the NTP.
|
||||
-BASE_FEATURE(kNtpFooter, base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+BASE_FEATURE(kNtpFooter, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
// If enabled, tab groups module will be shown.
|
||||
BASE_FEATURE(kNtpTabGroupsModule,
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/upgrade_detector/upgrade_detector_impl.cc
|
||||
+++ b/chrome/browser/upgrade_detector/upgrade_detector_impl.cc
|
||||
@@ -214,6 +214,8 @@ void UpgradeDetectorImpl::DoCalculateThr
|
||||
@@ -220,6 +220,8 @@ void UpgradeDetectorImpl::DoCalculateThr
|
||||
|
||||
void UpgradeDetectorImpl::StartOutdatedBuildDetector() {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
--- a/ui/base/pointer/touch_ui_controller.cc
|
||||
+++ b/ui/base/pointer/touch_ui_controller.cc
|
||||
@@ -178,13 +178,7 @@ void TouchUiController::TouchUiScoperFor
|
||||
// static
|
||||
TouchUiController* TouchUiController::Get() {
|
||||
static base::NoDestructor<TouchUiController> instance([] {
|
||||
- const std::string switch_value =
|
||||
- base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
||||
- switches::kTopChromeTouchUi);
|
||||
- if (switch_value == switches::kTopChromeTouchUiDisabled)
|
||||
- return TouchUiState::kDisabled;
|
||||
- const bool enabled = switch_value == switches::kTopChromeTouchUiEnabled;
|
||||
- return enabled ? TouchUiState::kEnabled : TouchUiState::kAuto;
|
||||
+ return TouchUiState::kDisabled;
|
||||
}());
|
||||
return instance.get();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -499,7 +499,7 @@ BASE_FEATURE(kByDateHistoryInSidePanel,
|
||||
|
||||
BASE_FEATURE(kTabStripBrowserApi, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
-BASE_FEATURE(kNonMilestoneUpdateToast, base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+BASE_FEATURE(kNonMilestoneUpdateToast, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
BASE_FEATURE(kBookmarkTabGroupConversion, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
return false;
|
||||
--- a/components/user_education/common/tutorial/tutorial_registry.cc
|
||||
+++ b/components/user_education/common/tutorial/tutorial_registry.cc
|
||||
@@ -26,7 +26,6 @@ bool TutorialRegistry::IsTutorialRegiste
|
||||
@@ -25,7 +25,6 @@ bool TutorialRegistry::IsTutorialRegiste
|
||||
|
||||
const TutorialDescription* TutorialRegistry::GetTutorialDescription(
|
||||
TutorialIdentifier id) const {
|
||||
@@ -18,7 +18,7 @@
|
||||
auto pair = tutorial_registry_.find(id);
|
||||
if (pair == tutorial_registry_.end()) {
|
||||
return nullptr;
|
||||
@@ -36,7 +35,6 @@ const TutorialDescription* TutorialRegis
|
||||
@@ -35,7 +34,6 @@ const TutorialDescription* TutorialRegis
|
||||
|
||||
const std::vector<TutorialIdentifier> TutorialRegistry::GetTutorialIdentifiers()
|
||||
const {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
--- a/components/download/public/common/download_features.cc
|
||||
+++ b/components/download/public/common/download_features.cc
|
||||
@@ -9,13 +9,7 @@
|
||||
namespace download {
|
||||
namespace features {
|
||||
|
||||
-BASE_FEATURE(kParallelDownloading,
|
||||
-#if BUILDFLAG(IS_ANDROID)
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT
|
||||
-#else
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT
|
||||
-#endif
|
||||
-);
|
||||
+BASE_FEATURE(kParallelDownloading, base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
|
||||
BASE_FEATURE(kBackoffInDownloading, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
@@ -1,16 +1,17 @@
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -203,12 +203,7 @@ BASE_FEATURE(kTabGroupsCollapseFreezing,
|
||||
@@ -150,13 +150,7 @@ bool IsTabGroupMenuMoreEntryPointsEnable
|
||||
|
||||
// Enables preview images in tab-hover cards.
|
||||
// https://crbug.com/928954
|
||||
BASE_FEATURE(kTabHoverCardImages,
|
||||
"TabHoverCardImages",
|
||||
-BASE_FEATURE(kTabHoverCardImages,
|
||||
-#if BUILDFLAG(IS_MAC)
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT
|
||||
-#else
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT
|
||||
-#endif
|
||||
-);
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+BASE_FEATURE(kTabHoverCardImages, base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
BASE_FEATURE(kTabGroupHoverCards, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
BASE_FEATURE(kTabModalUsesDesktopWidget,
|
||||
"TabModalUsesDesktopWidget",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc
|
||||
+++ b/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc
|
||||
@@ -239,8 +239,7 @@ void PinnedToolbarActionsModel::MaybeMig
|
||||
@@ -249,8 +249,7 @@ void PinnedToolbarActionsModel::MaybeMig
|
||||
UpdatePinnedState(kActionShowChromeLabs, true);
|
||||
pref_service_->SetBoolean(prefs::kPinnedChromeLabsMigrationComplete, true);
|
||||
}
|
||||
@@ -21,23 +21,3 @@
|
||||
const std::optional<std::string>& tab_search_action =
|
||||
actions::ActionIdMap::ActionIdToString(kActionTabSearch);
|
||||
if (tab_search_action.has_value()) {
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -557,7 +557,7 @@ BASE_FEATURE(kTabStripBrowserApi,
|
||||
|
||||
BASE_FEATURE(kTabstripComboButton,
|
||||
"TabstripComboButton",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
// This serves as a "kill-switch" for migrating the Tab Search feature to be a
|
||||
// toolbar button for non-ChromeOS users in the US.
|
||||
@@ -593,6 +593,8 @@ bool HasTabSearchToolbarButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ return true;
|
||||
+
|
||||
static const bool is_tab_search_moving = [] {
|
||||
if (GetCountryCode() == "us" &&
|
||||
base::FeatureList::IsEnabled(
|
||||
|
||||
@@ -0,0 +1,360 @@
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -12935,11 +12935,338 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
// AboutFlagsHistogramTest unit test to verify this process).
|
||||
};
|
||||
|
||||
+// Flags that either break Helium functionality or are not relevant to Helium
|
||||
+constexpr auto kExcludedFlags = base::MakeFixedFlatSet<std::string_view>({
|
||||
+ // Misc UI features
|
||||
+ "enable-immersive-fullscreen-toolbar",
|
||||
+ "windows11-mica-titlebar",
|
||||
+ "omnibox-toolbelt",
|
||||
+ "webui-omnibox-popup",
|
||||
+ "top-chrome-touch-ui",
|
||||
+
|
||||
+ // Google's experimental APIs that don't work in Helium
|
||||
+ // due to missing model binaries
|
||||
+ "translation-api-streaming-by-sentence",
|
||||
+
|
||||
+ // Misc features not relevant to Helium
|
||||
+ "extensions-menu-access-control",
|
||||
+ "extensions-collapse-main-menu",
|
||||
+
|
||||
+ // NTP
|
||||
+ "omnibox-mia-zps",
|
||||
+ "ntp-calendar-module",
|
||||
+ "ntp-module-sign-in-requirement",
|
||||
+ "ntp-ogb-async-bar-parts",
|
||||
+ "ntp-outlook-calendar-module",
|
||||
+ "ntp-sharepoint-module",
|
||||
+ "ntp-tab-groups-module",
|
||||
+ "ntp-tab-groups-module-zero-state",
|
||||
+ "ntp-microsoft-authentication-module",
|
||||
+ "ntp-realbox-next",
|
||||
+ "ntp-next-features",
|
||||
+ "ntp-customize-chrome-auto-open",
|
||||
+ "ntp-feature-optimization-module-removal",
|
||||
+ "ntp-feature-optimization-shortcuts-removal",
|
||||
+ "ntp-feature-optimization-dismiss-modules-removal",
|
||||
+ "enable-ntp-enterprise-shortcuts",
|
||||
+ "ntp-drive-module",
|
||||
+ "ntp-drive-module-segmentation",
|
||||
+
|
||||
+ // Google Account & Sync & Synced profiles
|
||||
+ "use-sync-sandbox",
|
||||
+ "offer-migration-to-dice-users",
|
||||
+ "web-signin-leads-to-implicitly-signed-in-state",
|
||||
+ "collaboration-shared-tab-group-account-data",
|
||||
+ "enable-cross-device-pref-tracker",
|
||||
+ "pdf-save-to-drive",
|
||||
+ "mdm-errors-for-dasher-accounts-handling",
|
||||
+ "profile-creation-decline-signin-cta-experiment",
|
||||
+ "show-profile-picker-to-all-users-experiment",
|
||||
+ "migrate-syncing-user-to-signed-in",
|
||||
+ "undo-migration-of-syncing-user-to-signed-in",
|
||||
+ "profile-signals-reporting-enabled",
|
||||
+ "profile-creation-friction-reduction-experiment-prefill-name-requirement",
|
||||
+ "profile-creation-friction-reduction-experiment-remove-signin-step",
|
||||
+ "profile-creation-friction-reduction-experiment-skip-customize-profile",
|
||||
+ "open-all-profiles-from-profile-picker-experiment",
|
||||
+ "profile-picker-text-variations",
|
||||
+ "enable-oauth-multilogin-cookies-binding",
|
||||
+ "enable-oauth-multilogin-cookies-binding-server-experiment",
|
||||
+ "enable-chrome-refresh-token-binding",
|
||||
+ "enable-bound-session-credentials",
|
||||
+ "enable-bound-session-credentials-software-keys-for-manual-testing",
|
||||
+ "history-sync-alternative-illustration",
|
||||
+ "omnibox-drive-suggestions-no-sync-requirement",
|
||||
+ "enable-standard-device-bound-session-google",
|
||||
+ "enable-standard-device-bound-session-google-experiment-id",
|
||||
+
|
||||
+ // Gemini Nano / Other Google models
|
||||
+ "prompt-api-for-gemini-nano",
|
||||
+ "prompt-api-for-gemini-nano-multimodal-input",
|
||||
+ "writer-api-for-gemini-nano",
|
||||
+ "rewriter-api-for-gemini-nano",
|
||||
+ "proofreader-api-for-gemini-nano",
|
||||
+ "omnibox-on-device-tail-suggestions",
|
||||
+ "text-safety-classifier",
|
||||
+ "page-content-annotations",
|
||||
+ "page-content-annotations-remote-page-metadata",
|
||||
+ "gemini-antiscam-protections-metrics-only",
|
||||
+
|
||||
+ // AI Mode
|
||||
+ "ai-mode-omnibox-entry-point",
|
||||
+ "aim-server-eligibility",
|
||||
+ "hide-aim-omnibox-entrypoint-on-user-input",
|
||||
+ "omnibox-allow-ai-mode-matches",
|
||||
+ "enable-lens-search-aim-m3",
|
||||
+ "ntp-composebox",
|
||||
+ "composebox-uses-chrome-compose-client",
|
||||
+ "compose-selection-nudge",
|
||||
+ "contextual-tasks",
|
||||
+ "web-app-migrate-preinstalled-chat",
|
||||
+ "webui-omnibox-aim-popup",
|
||||
+ "aim-entry-point-direct-navigation",
|
||||
+ "aim-server-eligibility-include-client-locale",
|
||||
+ "aim-use-pec-api",
|
||||
+ "webui-omnibox-aim-popup-disable-animation",
|
||||
+
|
||||
+ // Contextual AI stuff (AI Mode entrypoints?)
|
||||
+ "contextual-search-box-uses-contextual-search-provider",
|
||||
+ "contextual-suggestions-ablate-others-when-present",
|
||||
+ "omnibox-contextual-search-on-focus-suggestions",
|
||||
+ "omnibox-contextual-suggestions",
|
||||
+ "contextual-cueing",
|
||||
+ "contextual-suggestion-ui-improvements",
|
||||
+ "contextual-tasks-context",
|
||||
+ "contextual-tasks-suggestions-enabled",
|
||||
+ "contextual-tasks-context-library",
|
||||
+ "contextual-tasks-expand-button",
|
||||
+
|
||||
+ // Shopping stuff
|
||||
+ "product-specifications",
|
||||
+ "shopping-list",
|
||||
+ "shopping-alternate-server",
|
||||
+ "price-tracking-subscription-service-locale-key",
|
||||
+ "price-tracking-subscription-service-product-version",
|
||||
+ "price-insights",
|
||||
+ "discount-on-navigation",
|
||||
+ "discount-autofill",
|
||||
+
|
||||
+ // History
|
||||
+ "history-embeddings",
|
||||
+ "history-embeddings-answers",
|
||||
+
|
||||
+ // Optimization Guide
|
||||
+ "optimization-guide-debug-logs",
|
||||
+ "optimization-guide-on-device-model",
|
||||
+ "optimization-guide-enable-dogfood-logging",
|
||||
+ "privacy-policy-insights",
|
||||
+
|
||||
+ // Google Lens
|
||||
+ "enable-lens-overlay",
|
||||
+ "enable-lens-overlay-image-context-menu-actions",
|
||||
+ "enable-lens-overlay-updated-visuals",
|
||||
+ "enable-lens-overlay-edu-action-chip",
|
||||
+ "enable-lens-overlay-entrypoint-label-alt",
|
||||
+ "enable-lens-overlay-text-selection-context-menu-entrypoint",
|
||||
+ "lens-overlay-omnibox-entry-point",
|
||||
+ "lens-overlay-permission-bubble-alt",
|
||||
+ "enable-lens-overlay-translate-button",
|
||||
+ "enable-lens-overlay-latency-optimizations",
|
||||
+ "enable-lens-overlay-translate-languages",
|
||||
+ "enable-lens-overlay-side-panel-open-in-new-tab",
|
||||
+ "enable-lens-search-side-panel-new-feedback",
|
||||
+ "enable-lens-overlay-straight-to-srp",
|
||||
+ "enable-lens-overlay-force-empty-csb-query",
|
||||
+ "contextual-search-open-lens-action-uses-thumbnail",
|
||||
+ "lens-reinvocation-affordance",
|
||||
+ "lens-search-zero-state-csb",
|
||||
+ "lens-updated-feedback-entrypoint",
|
||||
+ "lens-video-citations",
|
||||
+ "lens-aim-suggestions",
|
||||
+ "lens-aim-gradient-suggest-background",
|
||||
+ "lens-overlay-optimization-filter",
|
||||
+ "lens-overlay-non-blocking-privacy-notice",
|
||||
+ "lens-aim-suggestions-type",
|
||||
+
|
||||
+ // User education
|
||||
+ "ntp-middle-slot-promo-dismissal",
|
||||
+ "enable-educational-tip-default-browser-promo-card",
|
||||
+ "force-startup-signin-promo",
|
||||
+ "group-promo-prototype",
|
||||
+ "group-promo-prototype-cpa",
|
||||
+ "avatar-button-sync-promo",
|
||||
+ "replace-sync-promos-with-sign-in-promos-desktop",
|
||||
+ "clank-default-browser-promo-role-manager",
|
||||
+ "clank-default-browser-promo2",
|
||||
+ "policy-promotion-banner-flag",
|
||||
+ "management-promotion-banner-flag",
|
||||
+ "enable-ntp-browser-promos",
|
||||
+ "in-product-help-demo-mode-choice",
|
||||
+ "iph-extensions-menu-feature",
|
||||
+ "iph-extensions-request-access-button-feature",
|
||||
+ "google-one-offer-files-banner",
|
||||
+ "signin-level-up-button",
|
||||
+ "mobile-promo-on-desktop-force-promo-type",
|
||||
+ "mobile-promo-on-desktop-with-qr-code",
|
||||
+ "mobile-promo-on-desktop-with-reminder",
|
||||
+
|
||||
+ // GLIC (AI agent stuff)
|
||||
+ "glic",
|
||||
+ "glic-z-order-changes",
|
||||
+ "glic-actor",
|
||||
+ "glic-detached",
|
||||
+ "glic-panel-reset-top-chrome-button",
|
||||
+ "glic-panel-reset-on-start",
|
||||
+ "glic-panel-set-position-on-drag",
|
||||
+ "glic-panel-reset-on-session-timeout",
|
||||
+ "glic-panel-reset-size-and-location-on-open",
|
||||
+ "glic-pre-warming",
|
||||
+ "glic-fre-pre-warming",
|
||||
+ "browsing-history-actor-integration-M1",
|
||||
+ "browsing-history-actor-integration-M2",
|
||||
+ "browsing-history-actor-integration-M3",
|
||||
+ "glic-side-panel",
|
||||
+
|
||||
+ // Live captions
|
||||
+ "enable-headless-live-caption",
|
||||
+
|
||||
+ // Google Wallet
|
||||
+ "wallet-service-use-sandbox",
|
||||
+ "enable-secure-payment-confirmation-fallback-ux",
|
||||
+ "enable-web-payments-experimental-features",
|
||||
+ "enable-debug-for-store-billing",
|
||||
+
|
||||
+ // Safety Hub
|
||||
+ "safety-hub-weak-reused-passwords",
|
||||
+ "safety-hub-local-passwords-module",
|
||||
+ "safety-hub-unified-passwords-module",
|
||||
+ "safety-hub-disruptive-notification-revocation",
|
||||
+ "safety-hub-unused-permission-revocation-for-all-surfaces",
|
||||
+
|
||||
+ // Privacy Sandbox
|
||||
+ "privacy-sandbox-internals",
|
||||
+ "privacy-sandbox-enrollment-overrides",
|
||||
+ "privacy-sandbox-ads-api-ux-enhancements",
|
||||
+ "privacy-sandbox-ad-topics-content-parity",
|
||||
+
|
||||
+ // Password Manager
|
||||
+ "biometric-reauth-password-filling",
|
||||
+ "save-passwords-contextual-ui",
|
||||
+ "password-form-grouped-affiliations",
|
||||
+ "password-form-clientside-classifier",
|
||||
+ "three-button-password-save-dialog",
|
||||
+ "apply-clientside-model-predictions-for-password-types",
|
||||
+ "enable-site-isolation-for-password-sites",
|
||||
+ "pwm-show-suggestions-on-autofocus",
|
||||
+
|
||||
+ // Reading Mode
|
||||
+ "read-anything-read-aloud-phrase-highlighting",
|
||||
+ "read-anything-images-via-algorithm",
|
||||
+ "read-anything-docs-integration",
|
||||
+ "read-anything-docs-load-more-button",
|
||||
+ "read-anything-read-aloud-ts-text-segmentation",
|
||||
+ "read-anything-with-readability-enabled",
|
||||
+ "read-anything-omnibox-chip",
|
||||
+ "read-anything-immersive-reading-mode",
|
||||
+
|
||||
+ // Misc Google experiments
|
||||
+ "happiness-tracking-surveys-for-desktop-demo",
|
||||
+ "permissions-ai-v3",
|
||||
+ "permissions-ai-v4",
|
||||
+ "permissions-ai-p92",
|
||||
+ "private-metrics-enable-puma",
|
||||
+ "private-metrics-enable-puma-rc",
|
||||
+ "user-value-default-browser-strings",
|
||||
+ "invalidate-search-engine-choice-on-device-restore-detection",
|
||||
+ "variations-seed-corpus",
|
||||
+ "protected-audience-debug-token",
|
||||
+ "rcaps-dynamic-profile-country",
|
||||
+ "related-website-sets-permission-grants",
|
||||
+ "data-sharing",
|
||||
+ "data-sharing-join-only",
|
||||
+ "data-sharing-non-production-environment",
|
||||
+ "shared-data-types-kill-switch",
|
||||
+ "data-sharing-debug-logs",
|
||||
+ "chrome-web-store-navigation-throttle",
|
||||
+ "supervised-user-block-interstitial-v3",
|
||||
+ "omnibox-zero-suggest-prefetch-debouncing",
|
||||
+ "omnibox-zero-suggest-prefetching-on-srp",
|
||||
+ "omnibox-zero-suggest-prefetching-on-web",
|
||||
+ "cws-promotion-banner-flag",
|
||||
+ "use-primary-and-tonal-buttons-for-promos",
|
||||
+
|
||||
+ // Autofill
|
||||
+ "reintroduce-hybrid-passkey-entry-point",
|
||||
+ "fill-on-account-select",
|
||||
+ "show-autofill-type-predictions",
|
||||
+ "autofill-more-prominent-popup",
|
||||
+ "autofill-payments-field-swapping",
|
||||
+ "autofill-show-bubbles-based-on-priorities",
|
||||
+ "enable-show-autofill-signatures",
|
||||
+ "enable-autofill-credit-card-upload",
|
||||
+ "autofill-enable-offers-in-clank-keyboard-accessory",
|
||||
+ "fedcm-autofill",
|
||||
+ "sync-autofill-wallet-credential-data",
|
||||
+ "autofill-enable-cvc-storage-and-filling",
|
||||
+ "autofill-enable-prefetching-risk-data-for-retrieval",
|
||||
+ "autofill-enable-fpan-risk-based-authentication",
|
||||
+ "autofill-enable-vcn-3ds-authentication",
|
||||
+ "autofill-shared-storage-server-card-data",
|
||||
+ "autofill-enable-card-benefits-for-american-express",
|
||||
+ "autofill-enable-card-benefits-sync",
|
||||
+ "autofill-unmask-card-request-timeout",
|
||||
+ "autofill-enable-cvc-storage-and-filling-enhancement",
|
||||
+ "autofill-enable-buy-now-pay-later",
|
||||
+ "autofill-enable-buy-now-pay-later-syncing",
|
||||
+ "autofill-enable-cvc-storage-and-filling-standalone-form-enhancement",
|
||||
+ "autofill-enable-card-info-runtime-retrieval",
|
||||
+ "autofill-enable-save-and-fill",
|
||||
+ "autofill-enable-card-benefits-for-bmo",
|
||||
+ "autofill-enable-amount-extraction",
|
||||
+ "iph-autofill-credit-card-benefit-feature",
|
||||
+ "autofill-enable-amount-extraction-testing",
|
||||
+ "autofill-vcn-enroll-strike-expiry-time",
|
||||
+ "autofill-enable-flat-rate-card-benefits-from-curinos",
|
||||
+ "disable-autofill-strike-system",
|
||||
+ "autofill-enable-buy-now-pay-later-for-klarna",
|
||||
+ "autofill-enable-downstream-card-awareness-iph",
|
||||
+ "autofill-enable-buy-now-pay-later-for-externally-linked",
|
||||
+ "autofill-enable-separate-pix-preference-item",
|
||||
+ "autofill-manual-testing-data",
|
||||
+ "autofill-enable-support-for-home-and-work",
|
||||
+ "autofill-enable-support-for-name-and-email-profile",
|
||||
+ "autofill-prioritize-save-card-over-mandatory-reauth",
|
||||
+ "autofill-enable-buy-now-pay-later-updated-suggestion-second-line-string",
|
||||
+ "autofill-enable-ai-based-amount-extraction",
|
||||
+ "autofill-prefer-buy-now-pay-later-blocklists",
|
||||
+ "mark-all-credentials-as-leaked",
|
||||
+ "enable-your-saved-info-settings-page",
|
||||
+ "autofill-ai-based-amount-extraction-ignore-seen-terms-for-testing",
|
||||
+ "autofill-enable-new-fop-display-android",
|
||||
+ "autofill-enable-wallet-branding",
|
||||
+ "autofill-enable-pay-now-pay-later-tabs",
|
||||
+ "autofill-enable-non-affiliated-loyalty-cards",
|
||||
+ "autofill-disable-bnpl-country-check-for-testing",
|
||||
+ "password-upload-ui-update",
|
||||
+
|
||||
+ // Add new entries above this line and categorize them accordingly.
|
||||
+});
|
||||
+
|
||||
+const base::NoDestructor<std::vector<FeatureEntry>> kHeliumFeatureEntries([] {
|
||||
+ std::vector<FeatureEntry> filtered;
|
||||
+ for (const auto& entry : kFeatureEntries) {
|
||||
+ if (!kExcludedFlags.contains(entry.internal_name)) {
|
||||
+ filtered.push_back(entry);
|
||||
+ }
|
||||
+ }
|
||||
+ return filtered;
|
||||
+}());
|
||||
+
|
||||
class FlagsStateSingleton : public flags_ui::FlagsState::Delegate {
|
||||
public:
|
||||
FlagsStateSingleton()
|
||||
: flags_state_(
|
||||
- std::make_unique<flags_ui::FlagsState>(kFeatureEntries, this)) {}
|
||||
+ std::make_unique<flags_ui::FlagsState>(*kHeliumFeatureEntries, this)) {}
|
||||
FlagsStateSingleton(const FlagsStateSingleton&) = delete;
|
||||
FlagsStateSingleton& operator=(const FlagsStateSingleton&) = delete;
|
||||
~FlagsStateSingleton() override = default;
|
||||
@@ -12958,7 +13285,7 @@ class FlagsStateSingleton : public flags
|
||||
|
||||
void RestoreDefaultState() {
|
||||
flags_state_ =
|
||||
- std::make_unique<flags_ui::FlagsState>(kFeatureEntries, this);
|
||||
+ std::make_unique<flags_ui::FlagsState>(*kHeliumFeatureEntries, this);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -13295,7 +13622,7 @@ base::span<const FeatureEntry> GetFeatur
|
||||
!entries_for_testing->empty()) {
|
||||
return *entries_for_testing;
|
||||
}
|
||||
- return kFeatureEntries;
|
||||
+ return *kHeliumFeatureEntries;
|
||||
}
|
||||
|
||||
} // namespace testing
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/components/resources/BUILD.gn
|
||||
+++ b/components/resources/BUILD.gn
|
||||
@@ -92,7 +92,7 @@ grit("components_resources") {
|
||||
@@ -100,7 +100,7 @@ grit("components_resources") {
|
||||
deps += [ "//components/resources/ssl/ssl_error_assistant:make_ssl_error_assistant_protobuf" ]
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--- a/extensions/browser/extension_registrar.cc
|
||||
+++ b/extensions/browser/extension_registrar.cc
|
||||
@@ -542,9 +542,12 @@ void ExtensionRegistrar::AddComponentExt
|
||||
if (old_version.IsValid()) {
|
||||
UnregisterServiceWorkerWithRootScope(extension);
|
||||
}
|
||||
+
|
||||
+ base::flat_set<int> disable_reasons = GetDisableReasonsOnInstalled(extension);
|
||||
+
|
||||
// TODO(crbug.com/40508457): If needed, add support for Declarative Net
|
||||
// Request to component extensions and pass the ruleset install prefs here.
|
||||
- AddNewOrUpdatedExtension(extension, {}, kInstallFlagNone,
|
||||
+ AddNewOrUpdatedExtension(extension, std::move(disable_reasons), kInstallFlagNone,
|
||||
syncer::StringOrdinal(), std::string(),
|
||||
/*ruleset_install_prefs=*/{});
|
||||
return;
|
||||
@@ -0,0 +1,12 @@
|
||||
--- a/components/gcm_driver/instance_id/instance_id_impl.cc
|
||||
+++ b/components/gcm_driver/instance_id/instance_id_impl.cc
|
||||
@@ -263,9 +263,6 @@ gcm::InstanceIDHandler* InstanceIDImpl::
|
||||
}
|
||||
|
||||
void InstanceIDImpl::RunWhenReady(base::OnceClosure task) {
|
||||
- if (!delayed_task_controller_.CanRunTaskWithoutDelay())
|
||||
- delayed_task_controller_.AddTask(std::move(task));
|
||||
- else
|
||||
base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
|
||||
FROM_HERE, std::move(task));
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.cc
|
||||
+++ b/chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_model_listener.cc
|
||||
@@ -191,17 +191,7 @@ void SavedTabGroupModelListener::OnTabSt
|
||||
@@ -193,17 +193,7 @@ void SavedTabGroupModelListener::OnTabSt
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
--- a/components/extstore_fixups/BUILD.gn
|
||||
+++ b/components/extstore_fixups/BUILD.gn
|
||||
@@ -16,6 +16,7 @@ generate_grd("extstore_fixups_grd") {
|
||||
input_files_base_dir = rebase_path(".", "//")
|
||||
input_files = [
|
||||
"manifest.json",
|
||||
+ "chrome-webstore.js",
|
||||
]
|
||||
}
|
||||
|
||||
--- a/components/extstore_fixups/manifest.json
|
||||
+++ b/components/extstore_fixups/manifest.json
|
||||
@@ -9,5 +9,10 @@
|
||||
"version": "0.0.0",
|
||||
"manifest_version": 3,
|
||||
"content_scripts": [
|
||||
+ {
|
||||
+ "matches": [ "https://chromewebstore.google.com/*" ],
|
||||
+ "run_at": "document_start",
|
||||
+ "js": [ "chrome-webstore.js" ]
|
||||
+ }
|
||||
]
|
||||
}
|
||||
--- /dev/null
|
||||
+++ b/components/extstore_fixups/chrome-webstore.js
|
||||
@@ -0,0 +1,63 @@
|
||||
+// Copyright 2025 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+(() => {
|
||||
+ const PROMO_POPUP_SELECTOR = 'header > [aria-labelledby=promo-header]';
|
||||
+ const SWITCH_NAG_SELECTOR = 'main section [aria-label=Info]';
|
||||
+ const SWITCH_BTN_SELECTOR = 'button[aria-label^=\'Switch to Chrome\']';
|
||||
+ const removeChromeNags = () => {
|
||||
+ const promoPopup = document.querySelector(PROMO_POPUP_SELECTOR);
|
||||
+ if (promoPopup) {
|
||||
+ promoPopup.remove();
|
||||
+ }
|
||||
+
|
||||
+ const switchNag = document.querySelector(SWITCH_NAG_SELECTOR);
|
||||
+ if (switchNag && switchNag.querySelector(SWITCH_BTN_SELECTOR)) {
|
||||
+ switchNag.remove();
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
+ const replaceDownloadButtonText = (el) => {
|
||||
+ if (el.nodeType === Node.TEXT_NODE) {
|
||||
+ if (!el.nodeValue?.includes('Chrome')) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ el.nodeValue = el.nodeValue.replace(/\b(Google\s)?Chrome\b/, 'Helium');
|
||||
+ return true;
|
||||
+ } else if (el.childNodes) {
|
||||
+ for (const node of el.childNodes) {
|
||||
+ if (replaceDownloadButtonText(node)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+ };
|
||||
+
|
||||
+ const changeDownloadButtonText = () => {
|
||||
+ const mainTitles = document.querySelectorAll('main section h1');
|
||||
+
|
||||
+ for (const mainTitleEl of mainTitles) {
|
||||
+ const downloadButton =
|
||||
+ mainTitleEl?.parentElement?.parentElement?.querySelector('button');
|
||||
+ if (!downloadButton || !downloadButton.textContent?.includes('Chrome')) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (replaceDownloadButtonText(downloadButton)) {
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
+ const handleChanges = () => {
|
||||
+ removeChromeNags();
|
||||
+ changeDownloadButtonText();
|
||||
+ };
|
||||
+
|
||||
+ const observer = new MutationObserver(handleChanges);
|
||||
+ observer.observe(document, {childList: true, subtree: true});
|
||||
+})();
|
||||
@@ -0,0 +1,198 @@
|
||||
--- /dev/null
|
||||
+++ b/components/extstore_fixups/BUILD.gn
|
||||
@@ -0,0 +1,37 @@
|
||||
+# Copyright 2025 The Helium Authors
|
||||
+# You can use, redistribute, and/or modify this source code under
|
||||
+# the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+import("//ui/webui/resources/tools/generate_grd.gni")
|
||||
+import("//tools/grit/grit_rule.gni")
|
||||
+
|
||||
+generated_grd = "$target_gen_dir/resources.grd"
|
||||
+
|
||||
+generate_grd("extstore_fixups_grd") {
|
||||
+ out_grd = generated_grd
|
||||
+
|
||||
+ grd_prefix = "extstore_fixups"
|
||||
+ resource_path_prefix = "extstore_fixups"
|
||||
+
|
||||
+ input_files_base_dir = rebase_path(".", "//")
|
||||
+ input_files = [
|
||||
+ "manifest.json",
|
||||
+ ]
|
||||
+}
|
||||
+
|
||||
+grit("extstore_fixups") {
|
||||
+ source = generated_grd
|
||||
+
|
||||
+ # Required because the .grd is generated.
|
||||
+ enable_input_discovery_for_gn_analyze = false
|
||||
+ output_dir = "$target_gen_dir/resources"
|
||||
+
|
||||
+ outputs = [
|
||||
+ "grit/extstore_fixups_resources.h",
|
||||
+ "grit/extstore_fixups_resources_map.cc",
|
||||
+ "grit/extstore_fixups_resources_map.h",
|
||||
+ "extstore_fixups_resources.pak"
|
||||
+ ]
|
||||
+
|
||||
+ deps = [":extstore_fixups_grd"]
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/components/extstore_fixups/manifest.json
|
||||
@@ -0,0 +1,13 @@
|
||||
+// Copyright 2025 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+{
|
||||
+ "name": "extstore-fixups",
|
||||
+ // chrome-extension://jfnekidfgkhnfagaabpddmioknbjglgp
|
||||
+ "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDGyNfoa6gmayvnBUHaYz2fNyPT7CIj6e5VccAZcIbpM/w9bhshiU0zxe0Ci+oLzHy3E/mObNM1IrXhHAQZno7H3frUxTH+m2eIGiwcqLfJkaQFkXvSoInpsG2N3Q74W6YN3mKk7rBAE8PQT1Nyh5H8AmIaWRvLz1+vcowpPNjU/QIDAQAB",
|
||||
+ "version": "0.0.0",
|
||||
+ "manifest_version": 3,
|
||||
+ "content_scripts": [
|
||||
+ ]
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/components/extstore_fixups/extension_ids.h
|
||||
@@ -0,0 +1,15 @@
|
||||
+// Copyright 2025 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+#ifndef COMPONENTS_EXTSTORE_FIXUPS_EXTENSION_IDS_H_
|
||||
+#define COMPONENTS_EXTSTORE_FIXUPS_EXTENSION_IDS_H_
|
||||
+
|
||||
+namespace helium {
|
||||
+
|
||||
+inline constexpr char kExtstoreFixupsExtensionId[] =
|
||||
+ "jfnekidfgkhnfagaabpddmioknbjglgp";
|
||||
+
|
||||
+} // namespace helium
|
||||
+
|
||||
+#endif /* COMPONENTS_EXTSTORE_FIXUPS_EXTENSION_IDS_H_ */
|
||||
--- a/tools/gritsettings/resource_ids.spec
|
||||
+++ b/tools/gritsettings/resource_ids.spec
|
||||
@@ -205,7 +205,7 @@
|
||||
"META": {"sizes": {"includes": [20]}},
|
||||
"includes": [2820],
|
||||
},
|
||||
- "<(SHARED_INTERMEDIATE_DIR)/chrome/browser/resources/ash/inline_login/resources.grd": {
|
||||
+ "<(SHARED_INTERMEDIATE_DIR)/components/extstore_fixups/resources.grd": {
|
||||
"META": {"sizes": {"includes": [20]}},
|
||||
"includes": [2840],
|
||||
},
|
||||
--- a/chrome/chrome_paks.gni
|
||||
+++ b/chrome/chrome_paks.gni
|
||||
@@ -141,6 +141,7 @@ template("chrome_extra_paks") {
|
||||
"$root_gen_dir/components/translate_internals_resources.pak",
|
||||
"$root_gen_dir/components/user_actions_ui_resources.pak",
|
||||
"$root_gen_dir/components/version_ui_resources.pak",
|
||||
+ "$root_gen_dir/components/extstore_fixups/resources/extstore_fixups_resources.pak",
|
||||
"$root_gen_dir/content/attribution_internals_resources.pak",
|
||||
"$root_gen_dir/content/content_resources.pak",
|
||||
"$root_gen_dir/content/histograms_resources.pak",
|
||||
@@ -169,6 +170,7 @@ template("chrome_extra_paks") {
|
||||
"//components/enterprise/connectors/resources",
|
||||
"//components/metrics:server_urls_grd",
|
||||
"//components/resources",
|
||||
+ "//components/extstore_fixups",
|
||||
"//content:content_resources",
|
||||
"//content/browser/resources",
|
||||
"//mojo/public/js:resources",
|
||||
--- a/chrome/browser/extensions/BUILD.gn
|
||||
+++ b/chrome/browser/extensions/BUILD.gn
|
||||
@@ -587,6 +587,7 @@ source_set("extensions") {
|
||||
"//components/update_client:common_impl",
|
||||
"//components/user_prefs",
|
||||
"//components/vector_icons",
|
||||
+ "//components/extstore_fixups",
|
||||
"//content/public/browser",
|
||||
"//extensions/browser",
|
||||
"//extensions/browser:keepalive",
|
||||
--- a/chrome/browser/extensions/chrome_component_extension_resource_manager.cc
|
||||
+++ b/chrome/browser/extensions/chrome_component_extension_resource_manager.cc
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "chrome/grit/chrome_unscaled_resources.h"
|
||||
#include "chrome/grit/component_extension_resources_map.h"
|
||||
#include "chrome/grit/theme_resources.h"
|
||||
+#include "components/extstore_fixups/resources/grit/extstore_fixups_resources_map.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "extensions/buildflags/buildflags.h"
|
||||
#include "extensions/common/constants.h"
|
||||
@@ -96,6 +97,7 @@ ChromeComponentExtensionResourceManager:
|
||||
AddComponentResourceEntries(kComponentExtensionResources);
|
||||
AddComponentResourceEntries(kExtraComponentExtensionResources);
|
||||
AddComponentResourceEntries(kUblockResources);
|
||||
+ AddComponentResourceEntries(kExtstoreFixupsResources);
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Add Files app JS modules resources.
|
||||
--- a/chrome/browser/extensions/component_loader.h
|
||||
+++ b/chrome/browser/extensions/component_loader.h
|
||||
@@ -216,6 +216,7 @@ class ComponentLoader : public KeyedServ
|
||||
const std::string& description_string);
|
||||
void AddWebStoreApp();
|
||||
void AddUBlock();
|
||||
+ void AddExtstoreFixups();
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
void AddChromeApp();
|
||||
--- a/chrome/browser/extensions/component_loader.cc
|
||||
+++ b/chrome/browser/extensions/component_loader.cc
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "components/crx_file/id_util.h"
|
||||
#include "components/version_info/version_info.h"
|
||||
+#include "components/extstore_fixups/resources/grit/extstore_fixups_resources.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "extensions/browser/extension_file_task_runner.h"
|
||||
@@ -445,6 +446,11 @@ void ComponentLoader::AddUBlock() {
|
||||
}
|
||||
}
|
||||
|
||||
+void ComponentLoader::AddExtstoreFixups() {
|
||||
+ Add(IDR_EXTSTORE_FIXUPS_MANIFEST_JSON,
|
||||
+ base::FilePath(FILE_PATH_LITERAL("extstore_fixups")));
|
||||
+}
|
||||
+
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
void ComponentLoader::AddChromeApp() {
|
||||
AddWithNameAndDescription(
|
||||
@@ -523,6 +529,7 @@ void ComponentLoader::AddDefaultComponen
|
||||
if (!skip_session_components) {
|
||||
AddWebStoreApp();
|
||||
AddUBlock();
|
||||
+ AddExtstoreFixups();
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
AddChromeApp();
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
--- a/chrome/browser/extensions/component_extensions_allowlist/allowlist.cc
|
||||
+++ b/chrome/browser/extensions/component_extensions_allowlist/allowlist.cc
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "chrome/common/extensions/extension_constants.h"
|
||||
#include "chrome/grit/browser_resources.h"
|
||||
#include "components/helium_services/extension_ids.h"
|
||||
+#include "components/extstore_fixups/extension_ids.h"
|
||||
+#include "components/extstore_fixups/resources/grit/extstore_fixups_resources.h"
|
||||
#include "extensions/buildflags/buildflags.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
@@ -37,6 +39,7 @@ bool IsComponentExtensionAllowlisted(con
|
||||
extension_misc::kInAppPaymentsSupportAppId,
|
||||
extension_misc::kPdfExtensionId,
|
||||
helium::kUBlockOriginComponentId,
|
||||
+ helium::kExtstoreFixupsExtensionId,
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
extension_misc::kAssessmentAssistantExtensionId,
|
||||
extension_misc::kAccessibilityCommonExtensionId,
|
||||
@@ -93,6 +96,7 @@ bool IsComponentExtensionAllowlisted(int
|
||||
case IDR_READING_MODE_GDOCS_HELPER_MANIFEST:
|
||||
case IDR_WEBSTORE_MANIFEST:
|
||||
case IDR_UBLOCK_MANIFEST_JSON:
|
||||
+ case IDR_EXTSTORE_FIXUPS_MANIFEST_JSON:
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Separate ChromeOS list, as it is quite large.
|
||||
@@ -1,6 +1,21 @@
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -4926,11 +4926,13 @@ constexpr char kWebiumFlag[] = "webium";
|
||||
@@ -404,11 +404,11 @@ namespace about_flags {
|
||||
|
||||
namespace {
|
||||
|
||||
-const unsigned kOsAll = kOsMac | kOsWin | kOsLinux | kOsCrOS | kOsAndroid;
|
||||
-const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux | kOsCrOS;
|
||||
+const unsigned kOsAll = kOsMac | kOsWin | kOsLinux;
|
||||
+const unsigned kOsDesktop = kOsMac | kOsWin | kOsLinux;
|
||||
|
||||
#if defined(USE_AURA)
|
||||
-const unsigned kOsAura = kOsWin | kOsLinux | kOsCrOS;
|
||||
+const unsigned kOsAura = kOsWin | kOsLinux;
|
||||
#endif // USE_AURA
|
||||
|
||||
#if defined(USE_AURA)
|
||||
@@ -4669,11 +4669,13 @@ const FeatureEntry::FeatureVariation
|
||||
// calculate and verify checksum.
|
||||
//
|
||||
// When adding a new choice, add it to the end of the list.
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -12003,6 +12003,9 @@ Check your passwords anytime in <ph name
|
||||
<message name="IDS_TAB_CXMENU_DUPLICATE" desc="The label of the 'Duplicate' Tab context menu item.">
|
||||
Duplicate
|
||||
</message>
|
||||
+ <message name="IDS_TAB_CXMENU_HIBERNATE" desc="The label of the 'Hibernate' Tab context menu item.">
|
||||
+ Hibernate
|
||||
+ </message>
|
||||
<message name="IDS_TAB_CXMENU_CLOSETAB" desc="The label of the tab context menu item for closing one or more tabs.">
|
||||
Close
|
||||
</message>
|
||||
@@ -12122,6 +12125,9 @@ Check your passwords anytime in <ph name
|
||||
<message name="IDS_TAB_CXMENU_DUPLICATE" desc="In Title Case: The label of the 'Duplicate' Tab context menu item.">
|
||||
Duplicate
|
||||
</message>
|
||||
+ <message name="IDS_TAB_CXMENU_HIBERNATE" desc="In Title Case: The label of the 'Hibernate' Tab context menu item.">
|
||||
+ Hibernate
|
||||
+ </message>
|
||||
<message name="IDS_TAB_CXMENU_CLOSETAB" desc="In Title Case: The label of the tab context menu item for closing one or more tabs.">
|
||||
Close
|
||||
</message>
|
||||
--- a/chrome/browser/ui/tabs/tab_strip_model.h
|
||||
+++ b/chrome/browser/ui/tabs/tab_strip_model.h
|
||||
@@ -785,6 +785,7 @@ class TabStripModel {
|
||||
CommandGlicSwitchToRecentConversation,
|
||||
CommandGlicUnshare,
|
||||
#endif
|
||||
+ CommandDiscard,
|
||||
CommandLast
|
||||
};
|
||||
// LINT.ThenChange(//tools/metrics/histograms/metadata/tab/histograms.xml:TabContextMenuCommand)
|
||||
--- a/chrome/browser/ui/tabs/tab_strip_model.cc
|
||||
+++ b/chrome/browser/ui/tabs/tab_strip_model.cc
|
||||
@@ -44,8 +44,11 @@
|
||||
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
||||
#include "chrome/browser/extensions/tab_helper.h"
|
||||
#include "chrome/browser/lifetime/browser_shutdown.h"
|
||||
+#include "chrome/browser/performance_manager/policies/discard_eligibility_policy.h"
|
||||
+#include "chrome/browser/performance_manager/public/user_tuning/user_tuning_utils.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/reading_list/reading_list_model_factory.h"
|
||||
+#include "chrome/browser/resource_coordinator/lifecycle_unit_state.mojom.h"
|
||||
#include "chrome/browser/resource_coordinator/tab_helper.h"
|
||||
#include "chrome/browser/send_tab_to_self/send_tab_to_self_util.h"
|
||||
#include "chrome/browser/ui/bookmarks/bookmark_utils.h"
|
||||
@@ -90,6 +93,7 @@
|
||||
#include "components/content_settings/core/common/content_settings.h"
|
||||
#include "components/content_settings/core/common/content_settings_types.h"
|
||||
#include "components/feature_engagement/public/feature_constants.h"
|
||||
+#include "components/performance_manager/public/performance_manager.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "components/reading_list/core/reading_list_model.h"
|
||||
#include "components/split_tabs/split_tab_id.h"
|
||||
@@ -164,6 +168,53 @@ bool ShouldForgetOpenersForTransition(ui
|
||||
ui::PAGE_TRANSITION_AUTO_TOPLEVEL);
|
||||
}
|
||||
|
||||
+using DiscardEligibilityPolicy =
|
||||
+ performance_manager::policies::DiscardEligibilityPolicy;
|
||||
+using CanDiscardResult = performance_manager::policies::CanDiscardResult;
|
||||
+
|
||||
+DiscardEligibilityPolicy* GetDiscardEligibilityPolicy() {
|
||||
+ if (!performance_manager::PerformanceManager::IsAvailable()) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+ return DiscardEligibilityPolicy::GetFromGraph(
|
||||
+ performance_manager::PerformanceManager::GetGraph());
|
||||
+}
|
||||
+
|
||||
+base::WeakPtr<performance_manager::PageNode> GetDiscardCandidatePageNode(
|
||||
+ const TabStripModel* tab_strip_model,
|
||||
+ int index,
|
||||
+ DiscardEligibilityPolicy* eligibility_policy) {
|
||||
+ CHECK(eligibility_policy);
|
||||
+
|
||||
+ // The active tab can't be discarded.
|
||||
+ if (index == tab_strip_model->active_index()) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ WebContents* const contents = tab_strip_model->GetWebContentsAt(index);
|
||||
+ if (!contents || contents->WasDiscarded()) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ base::WeakPtr<performance_manager::PageNode> page_node =
|
||||
+ performance_manager::PerformanceManager::
|
||||
+ GetPrimaryPageNodeForWebContents(contents);
|
||||
+
|
||||
+ if (!page_node) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ CanDiscardResult can_discard_result = eligibility_policy->CanDiscard(
|
||||
+ page_node.get(), ::mojom::LifecycleUnitDiscardReason::PROACTIVE,
|
||||
+ base::TimeDelta());
|
||||
+
|
||||
+ if (can_discard_result != CanDiscardResult::kEligible) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ return page_node;
|
||||
+}
|
||||
+
|
||||
} // namespace
|
||||
|
||||
TabGroupModelFactory::TabGroupModelFactory() {
|
||||
@@ -2485,6 +2536,21 @@ bool TabStripModel::IsContextMenuCommand
|
||||
case CommandReload:
|
||||
return delegate_->CanReload();
|
||||
|
||||
+ case CommandDiscard: {
|
||||
+ auto* const eligibility_policy = GetDiscardEligibilityPolicy();
|
||||
+ if (!eligibility_policy) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ const std::vector<int> indices = GetIndicesForCommand(context_index);
|
||||
+ for (int index : indices) {
|
||||
+ if (GetDiscardCandidatePageNode(this, index, eligibility_policy)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
case CommandCloseOtherTabs:
|
||||
case CommandCloseTabsToRight: {
|
||||
return !GetIndicesClosedByCommand(context_index, command_id).empty();
|
||||
@@ -2651,6 +2717,27 @@ void TabStripModel::ExecuteContextMenuCo
|
||||
}
|
||||
break;
|
||||
}
|
||||
+
|
||||
+ case CommandDiscard: {
|
||||
+ auto* const eligibility_policy = GetDiscardEligibilityPolicy();
|
||||
+ if (!eligibility_policy) {
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ const std::vector<int> indices = GetIndicesForCommand(context_index);
|
||||
+ for (int index : indices) {
|
||||
+ base::WeakPtr<performance_manager::PageNode> page_node =
|
||||
+ GetDiscardCandidatePageNode(this, index, eligibility_policy);
|
||||
+ if (!page_node) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ performance_manager::user_tuning::DiscardPage(
|
||||
+ page_node.get(), ::mojom::LifecycleUnitDiscardReason::PROACTIVE,
|
||||
+ /*ignore_minimum_time_in_background=*/true);
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
case CommandCloseTab: {
|
||||
base::UmaHistogramCounts1000("Tab.ContextMenu.CloseTab.SelectedTabsCount",
|
||||
--- a/chrome/browser/ui/tabs/tab_menu_model.cc
|
||||
+++ b/chrome/browser/ui/tabs/tab_menu_model.cc
|
||||
@@ -343,6 +343,9 @@ void TabMenuModel::Build(TabStripModel*
|
||||
}
|
||||
|
||||
AddSeparator(ui::NORMAL_SEPARATOR);
|
||||
+
|
||||
+ AddItemWithStringId(TabStripModel::CommandDiscard, IDS_TAB_CXMENU_HIBERNATE);
|
||||
+
|
||||
AddItemWithStringId(TabStripModel::CommandCloseTab, IDS_TAB_CXMENU_CLOSETAB);
|
||||
AddItemWithStringId(TabStripModel::CommandCloseOtherTabs,
|
||||
IDS_TAB_CXMENU_CLOSEOTHERTABS);
|
||||
@@ -1,224 +0,0 @@
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -226,6 +226,10 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
(*s_allowlist)[::prefs::kPinSplitTabButton] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
|
||||
+ // Custom toolbar button settings.
|
||||
+ (*s_allowlist)[::prefs::kShowAvatarButton] =
|
||||
+ settings_api::PrefType::kBoolean;
|
||||
+
|
||||
// Appearance settings.
|
||||
(*s_allowlist)[::prefs::kCurrentThemeID] = settings_api::PrefType::kString;
|
||||
(*s_allowlist)[::prefs::kPinnedActions] = settings_api::PrefType::kList;
|
||||
--- a/chrome/browser/ui/actions/chrome_action_id.h
|
||||
+++ b/chrome/browser/ui/actions/chrome_action_id.h
|
||||
@@ -553,6 +553,7 @@
|
||||
#define TOOLBAR_PINNABLE_ACTION_IDS \
|
||||
E(kActionHome, IDC_HOME) \
|
||||
E(kActionForward, IDC_FORWARD) \
|
||||
+ E(kActionAvatar, IDC_SHOW_AVATAR_MENU) \
|
||||
E(kActionNewIncognitoWindow, IDC_NEW_INCOGNITO_WINDOW) \
|
||||
E(kActionSendSharedTabGroupFeedback, IDC_SEND_SHARED_TAB_GROUP_FEEDBACK) \
|
||||
E(kActionShowPasswordManager, IDC_SHOW_PASSWORD_MANAGER) \
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -113,6 +113,9 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
registry->RegisterBooleanPref(prefs::kPinSplitTabButton, false,
|
||||
pref_registration_flags);
|
||||
|
||||
+ registry->RegisterBooleanPref(
|
||||
+ prefs::kShowAvatarButton, true);
|
||||
+
|
||||
registry->RegisterInt64Pref(prefs::kDefaultBrowserLastDeclined, 0);
|
||||
registry->RegisterBooleanPref(prefs::kWebAppCreateOnDesktop, true);
|
||||
registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true);
|
||||
--- a/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc
|
||||
+++ b/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc
|
||||
@@ -215,6 +215,7 @@ void PinnedToolbarActionsModel::UpdatePi
|
||||
void PinnedToolbarActionsModel::ResetToDefault() {
|
||||
pref_service_->ClearPref(prefs::kShowHomeButton);
|
||||
pref_service_->ClearPref(prefs::kShowForwardButton);
|
||||
+ pref_service_->ClearPref(prefs::kShowAvatarButton);
|
||||
pref_service_->ClearPref(prefs::kPinnedActions);
|
||||
}
|
||||
|
||||
@@ -228,7 +229,10 @@ bool PinnedToolbarActionsModel::IsDefaul
|
||||
const bool forward_is_default =
|
||||
pref_service_->GetDefaultPrefValue(prefs::kShowForwardButton)
|
||||
->GetBool() == pref_service_->GetBoolean(prefs::kShowForwardButton);
|
||||
- return action_are_default && home_is_default && forward_is_default;
|
||||
+ const bool avatar_is_default =
|
||||
+ pref_service_->GetDefaultPrefValue(prefs::kShowAvatarButton)
|
||||
+ ->GetBool() == pref_service_->GetBoolean(prefs::kShowAvatarButton);
|
||||
+ return action_are_default && home_is_default && forward_is_default && avatar_is_default;
|
||||
}
|
||||
|
||||
void PinnedToolbarActionsModel::MaybeMigrateExistingPinnedStates() {
|
||||
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
@@ -457,8 +457,7 @@ void ToolbarView::Init() {
|
||||
#else
|
||||
// DevTools profiles are OffTheRecord, so hide it there.
|
||||
show_avatar_toolbar_button = browser_->profile()->IsIncognitoProfile() ||
|
||||
- browser_->profile()->IsGuestSession() ||
|
||||
- browser_->profile()->IsRegularProfile();
|
||||
+ browser_->profile()->IsGuestSession();
|
||||
#endif
|
||||
|
||||
const std::string sab_value = base::CommandLine::ForCurrentProcess()->
|
||||
@@ -527,6 +526,17 @@ void ToolbarView::Init() {
|
||||
|
||||
home_->SetVisible(show_home_button_.GetValue());
|
||||
|
||||
+ show_avatar_button_.Init(
|
||||
+ prefs::kShowAvatarButton, prefs,
|
||||
+ base::BindRepeating(&ToolbarView::OnShowAvatarButtonChanged,
|
||||
+ base::Unretained(this)));
|
||||
+
|
||||
+ // avatar is always shown in incognito and guest profiles,
|
||||
+ // but in regular profiles it's managed by the kShowAvatarButton pref
|
||||
+ if (browser_->profile()->IsRegularProfile()) {
|
||||
+ avatar_->SetVisible(show_avatar_button_.GetValue());
|
||||
+ }
|
||||
+
|
||||
InitLayout();
|
||||
|
||||
for (auto* button : std::array<views::Button*, 5>{back_, forward_, reload_,
|
||||
@@ -1246,6 +1256,10 @@ void ToolbarView::OnShowHomeButtonChange
|
||||
home_->SetVisible(show_home_button_.GetValue());
|
||||
}
|
||||
|
||||
+void ToolbarView::OnShowAvatarButtonChanged() {
|
||||
+ avatar_->SetVisible(show_avatar_button_.GetValue());
|
||||
+}
|
||||
+
|
||||
void ToolbarView::OnTouchUiChanged() {
|
||||
if (display_mode_ == DisplayMode::NORMAL) {
|
||||
// Update the internal margins for touch layout.
|
||||
--- a/chrome/browser/ui/views/toolbar/toolbar_view.h
|
||||
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.h
|
||||
@@ -274,6 +274,8 @@ class ToolbarView : public views::Access
|
||||
|
||||
void OnShowHomeButtonChanged();
|
||||
|
||||
+ void OnShowAvatarButtonChanged();
|
||||
+
|
||||
void OnTouchUiChanged();
|
||||
|
||||
void UpdateClipPath();
|
||||
@@ -325,6 +327,8 @@ class ToolbarView : public views::Access
|
||||
// Controls whether or not a home button should be shown on the toolbar.
|
||||
BooleanPrefMember show_home_button_;
|
||||
|
||||
+ BooleanPrefMember show_avatar_button_;
|
||||
+
|
||||
BooleanPrefMember show_chrome_labs_button_;
|
||||
|
||||
// The display mode used when laying out the toolbar.
|
||||
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar.mojom
|
||||
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar.mojom
|
||||
@@ -16,6 +16,7 @@ enum ActionId {
|
||||
kShowSearchCompanion,
|
||||
kHome,
|
||||
kForward,
|
||||
+ kAvatar,
|
||||
kNewIncognitoWindow,
|
||||
kShowPasswordManager,
|
||||
kShowPaymentMethods,
|
||||
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.cc
|
||||
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.cc
|
||||
@@ -50,6 +50,8 @@ MojoActionForChromeAction(actions::Actio
|
||||
return side_panel::customize_chrome::mojom::ActionId::kHome;
|
||||
case kActionForward:
|
||||
return side_panel::customize_chrome::mojom::ActionId::kForward;
|
||||
+ case kActionAvatar:
|
||||
+ return side_panel::customize_chrome::mojom::ActionId::kAvatar;
|
||||
case kActionNewIncognitoWindow:
|
||||
return side_panel::customize_chrome::mojom::ActionId::kNewIncognitoWindow;
|
||||
case kActionShowPasswordsBubbleOrPage:
|
||||
@@ -109,6 +111,8 @@ std::optional<actions::ActionId> ChromeA
|
||||
return kActionHome;
|
||||
case side_panel::customize_chrome::mojom::ActionId::kForward:
|
||||
return kActionForward;
|
||||
+ case side_panel::customize_chrome::mojom::ActionId::kAvatar:
|
||||
+ return kActionAvatar;
|
||||
case side_panel::customize_chrome::mojom::ActionId::kNewIncognitoWindow:
|
||||
return kActionNewIncognitoWindow;
|
||||
case side_panel::customize_chrome::mojom::ActionId::kShowPasswordManager:
|
||||
@@ -174,6 +178,10 @@ CustomizeToolbarHandler::CustomizeToolba
|
||||
prefs::kPinSplitTabButton,
|
||||
base::BindRepeating(&CustomizeToolbarHandler::OnPinSplitTabButtonChanged,
|
||||
base::Unretained(this)));
|
||||
+ pref_change_registrar_.Add(
|
||||
+ prefs::kShowAvatarButton,
|
||||
+ base::BindRepeating(&CustomizeToolbarHandler::OnShowAvatarButtonChanged,
|
||||
+ base::Unretained(this)));
|
||||
}
|
||||
|
||||
CustomizeToolbarHandler::~CustomizeToolbarHandler() = default;
|
||||
@@ -219,6 +227,19 @@ void CustomizeToolbarHandler::ListAction
|
||||
actions.push_back(std::move(home_action));
|
||||
actions.push_back(std::move(forward_action));
|
||||
|
||||
+ auto avatar_action = side_panel::customize_chrome::mojom::Action::New(
|
||||
+ MojoActionForChromeAction(kActionAvatar).value(),
|
||||
+ base::UTF16ToUTF8(l10n_util::GetStringUTF16(IDS_PROFILES_MENU_NAME)),
|
||||
+ prefs()->GetBoolean(prefs::kShowAvatarButton), false,
|
||||
+ side_panel::customize_chrome::mojom::CategoryId::kYourChrome,
|
||||
+ GURL(webui::EncodePNGAndMakeDataURI(
|
||||
+ ui::ImageModel::FromVectorIcon(
|
||||
+ vector_icons::kAccountCircleChromeRefreshIcon, icon_color_id)
|
||||
+ .Rasterize(&provider),
|
||||
+ scale_factor)));
|
||||
+
|
||||
+ actions.push_back(std::move(avatar_action));
|
||||
+
|
||||
if (base::FeatureList::IsEnabled(features::kSideBySide)) {
|
||||
auto split_tab_action = side_panel::customize_chrome::mojom::Action::New(
|
||||
MojoActionForChromeAction(kActionSplitTab).value(),
|
||||
@@ -367,6 +388,9 @@ void CustomizeToolbarHandler::PinAction(
|
||||
case kActionSplitTab:
|
||||
prefs()->SetBoolean(prefs::kPinSplitTabButton, pin);
|
||||
break;
|
||||
+ case kActionAvatar:
|
||||
+ prefs()->SetBoolean(prefs::kShowAvatarButton, pin);
|
||||
+ break;
|
||||
default:
|
||||
model_->UpdatePinnedState(chrome_action.value(), pin);
|
||||
const std::optional<std::string> metrics_name =
|
||||
@@ -420,6 +444,11 @@ void CustomizeToolbarHandler::OnPinSplit
|
||||
prefs()->GetBoolean(prefs::kPinSplitTabButton));
|
||||
}
|
||||
|
||||
+void CustomizeToolbarHandler::OnShowAvatarButtonChanged() {
|
||||
+ OnActionPinnedChanged(kActionAvatar,
|
||||
+ prefs()->GetBoolean(prefs::kShowAvatarButton));
|
||||
+}
|
||||
+
|
||||
void CustomizeToolbarHandler::OnActionItemChanged() {
|
||||
client_->NotifyActionsUpdated();
|
||||
}
|
||||
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h
|
||||
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h
|
||||
@@ -54,6 +54,7 @@ class CustomizeToolbarHandler
|
||||
void OnShowHomeButtonChanged();
|
||||
void OnShowForwardButtonChanged();
|
||||
void OnPinSplitTabButtonChanged();
|
||||
+ void OnShowAvatarButtonChanged();
|
||||
void OnActionItemChanged();
|
||||
|
||||
PrefService* prefs() const;
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -1323,6 +1323,10 @@ inline constexpr char kShowForwardButton
|
||||
// toolbar.
|
||||
inline constexpr char kPinSplitTabButton[] = "browser.pin_split_tab_button";
|
||||
|
||||
+// A boolean pref set to true if the Avatar button should be visible on the
|
||||
+// toolbar.
|
||||
+inline constexpr char kShowAvatarButton[] = "helium.browser.show_avatar_button";
|
||||
+
|
||||
// A boolean pref set to true if Gemini integration be enabled. This is managed
|
||||
// by enterprise policy.
|
||||
inline constexpr char kGeminiSettings[] = "browser.gemini_settings";
|
||||
@@ -1,234 +0,0 @@
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -229,6 +229,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
// Custom toolbar button settings.
|
||||
(*s_allowlist)[::prefs::kShowAvatarButton] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
+ (*s_allowlist)[::prefs::kShowExtensionsButton] =
|
||||
+ settings_api::PrefType::kBoolean;
|
||||
|
||||
// Appearance settings.
|
||||
(*s_allowlist)[::prefs::kCurrentThemeID] = settings_api::PrefType::kString;
|
||||
--- a/chrome/browser/ui/actions/chrome_action_id.h
|
||||
+++ b/chrome/browser/ui/actions/chrome_action_id.h
|
||||
@@ -554,6 +554,7 @@
|
||||
E(kActionHome, IDC_HOME) \
|
||||
E(kActionForward, IDC_FORWARD) \
|
||||
E(kActionAvatar, IDC_SHOW_AVATAR_MENU) \
|
||||
+ E(kActionExtensions) \
|
||||
E(kActionNewIncognitoWindow, IDC_NEW_INCOGNITO_WINDOW) \
|
||||
E(kActionSendSharedTabGroupFeedback, IDC_SEND_SHARED_TAB_GROUP_FEEDBACK) \
|
||||
E(kActionShowPasswordManager, IDC_SHOW_PASSWORD_MANAGER) \
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -115,6 +115,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kShowAvatarButton, true);
|
||||
+ registry->RegisterBooleanPref(
|
||||
+ prefs::kShowExtensionsButton, true);
|
||||
|
||||
registry->RegisterInt64Pref(prefs::kDefaultBrowserLastDeclined, 0);
|
||||
registry->RegisterBooleanPref(prefs::kWebAppCreateOnDesktop, true);
|
||||
--- a/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc
|
||||
+++ b/chrome/browser/ui/toolbar/pinned_toolbar/pinned_toolbar_actions_model.cc
|
||||
@@ -216,6 +216,7 @@ void PinnedToolbarActionsModel::ResetToD
|
||||
pref_service_->ClearPref(prefs::kShowHomeButton);
|
||||
pref_service_->ClearPref(prefs::kShowForwardButton);
|
||||
pref_service_->ClearPref(prefs::kShowAvatarButton);
|
||||
+ pref_service_->ClearPref(prefs::kShowExtensionsButton);
|
||||
pref_service_->ClearPref(prefs::kPinnedActions);
|
||||
}
|
||||
|
||||
@@ -232,7 +233,12 @@ bool PinnedToolbarActionsModel::IsDefaul
|
||||
const bool avatar_is_default =
|
||||
pref_service_->GetDefaultPrefValue(prefs::kShowAvatarButton)
|
||||
->GetBool() == pref_service_->GetBoolean(prefs::kShowAvatarButton);
|
||||
- return action_are_default && home_is_default && forward_is_default && avatar_is_default;
|
||||
+ const bool extensions_is_default =
|
||||
+ pref_service_->GetDefaultPrefValue(prefs::kShowExtensionsButton)
|
||||
+ ->GetBool() == pref_service_->GetBoolean(prefs::kShowExtensionsButton);
|
||||
+ return action_are_default && home_is_default &&
|
||||
+ forward_is_default && avatar_is_default &&
|
||||
+ extensions_is_default;
|
||||
}
|
||||
|
||||
void PinnedToolbarActionsModel::MaybeMigrateExistingPinnedStates() {
|
||||
--- a/chrome/browser/ui/views/extensions/extensions_toolbar_container.cc
|
||||
+++ b/chrome/browser/ui/views/extensions/extensions_toolbar_container.cc
|
||||
@@ -549,7 +549,9 @@ void ExtensionsToolbarContainer::AnchorA
|
||||
|
||||
// Fix the position of widgets. Without this fix, extension-installed-bubble
|
||||
// and extension-uninstall-dialog may be out of the window border on Linux.
|
||||
- if (base::CommandLine::ForCurrentProcess()->HasSwitch("hide-extensions-menu"))
|
||||
+ if (!browser_->profile()->GetPrefs()->GetBoolean(
|
||||
+ prefs::kShowExtensionsButton) ||
|
||||
+ base::CommandLine::ForCurrentProcess()->HasSwitch("hide-extensions-menu"))
|
||||
{
|
||||
views::View* anchor_view = BrowserView::GetBrowserViewForBrowser(browser_)
|
||||
->toolbar_button_provider()->GetAppMenuButton();
|
||||
@@ -971,7 +973,9 @@ void ExtensionsToolbarContainer::UpdateC
|
||||
}
|
||||
|
||||
bool ExtensionsToolbarContainer::ShouldContainerBeVisible() const {
|
||||
- if (base::CommandLine::ForCurrentProcess()->HasSwitch("hide-extensions-menu"))
|
||||
+ if (!browser_->profile()->GetPrefs()->GetBoolean(
|
||||
+ prefs::kShowExtensionsButton) ||
|
||||
+ base::CommandLine::ForCurrentProcess()->HasSwitch("hide-extensions-menu"))
|
||||
return false;
|
||||
|
||||
// The container (and extensions-menu button) should not be visible if we have
|
||||
--- a/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
@@ -537,6 +537,14 @@ void ToolbarView::Init() {
|
||||
avatar_->SetVisible(show_avatar_button_.GetValue());
|
||||
}
|
||||
|
||||
+ if (extensions_container_) {
|
||||
+ show_extensions_button_.Init(
|
||||
+ prefs::kShowExtensionsButton, prefs,
|
||||
+ base::BindRepeating(&ToolbarView::OnShowExtensionsButtonChanged,
|
||||
+ base::Unretained(this)));
|
||||
+ extensions_container_->SetVisible(show_extensions_button_.GetValue());
|
||||
+ }
|
||||
+
|
||||
InitLayout();
|
||||
|
||||
for (auto* button : std::array<views::Button*, 5>{back_, forward_, reload_,
|
||||
@@ -1260,6 +1268,10 @@ void ToolbarView::OnShowAvatarButtonChan
|
||||
avatar_->SetVisible(show_avatar_button_.GetValue());
|
||||
}
|
||||
|
||||
+void ToolbarView::OnShowExtensionsButtonChanged() {
|
||||
+ extensions_container_->SetVisible(show_extensions_button_.GetValue());
|
||||
+}
|
||||
+
|
||||
void ToolbarView::OnTouchUiChanged() {
|
||||
if (display_mode_ == DisplayMode::NORMAL) {
|
||||
// Update the internal margins for touch layout.
|
||||
--- a/chrome/browser/ui/views/toolbar/toolbar_view.h
|
||||
+++ b/chrome/browser/ui/views/toolbar/toolbar_view.h
|
||||
@@ -276,6 +276,8 @@ class ToolbarView : public views::Access
|
||||
|
||||
void OnShowAvatarButtonChanged();
|
||||
|
||||
+ void OnShowExtensionsButtonChanged();
|
||||
+
|
||||
void OnTouchUiChanged();
|
||||
|
||||
void UpdateClipPath();
|
||||
@@ -329,6 +331,8 @@ class ToolbarView : public views::Access
|
||||
|
||||
BooleanPrefMember show_avatar_button_;
|
||||
|
||||
+ BooleanPrefMember show_extensions_button_;
|
||||
+
|
||||
BooleanPrefMember show_chrome_labs_button_;
|
||||
|
||||
// The display mode used when laying out the toolbar.
|
||||
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar.mojom
|
||||
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar.mojom
|
||||
@@ -17,6 +17,7 @@ enum ActionId {
|
||||
kHome,
|
||||
kForward,
|
||||
kAvatar,
|
||||
+ kExtensions,
|
||||
kNewIncognitoWindow,
|
||||
kShowPasswordManager,
|
||||
kShowPaymentMethods,
|
||||
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.cc
|
||||
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.cc
|
||||
@@ -52,6 +52,8 @@ MojoActionForChromeAction(actions::Actio
|
||||
return side_panel::customize_chrome::mojom::ActionId::kForward;
|
||||
case kActionAvatar:
|
||||
return side_panel::customize_chrome::mojom::ActionId::kAvatar;
|
||||
+ case kActionExtensions:
|
||||
+ return side_panel::customize_chrome::mojom::ActionId::kExtensions;
|
||||
case kActionNewIncognitoWindow:
|
||||
return side_panel::customize_chrome::mojom::ActionId::kNewIncognitoWindow;
|
||||
case kActionShowPasswordsBubbleOrPage:
|
||||
@@ -113,6 +115,8 @@ std::optional<actions::ActionId> ChromeA
|
||||
return kActionForward;
|
||||
case side_panel::customize_chrome::mojom::ActionId::kAvatar:
|
||||
return kActionAvatar;
|
||||
+ case side_panel::customize_chrome::mojom::ActionId::kExtensions:
|
||||
+ return kActionExtensions;
|
||||
case side_panel::customize_chrome::mojom::ActionId::kNewIncognitoWindow:
|
||||
return kActionNewIncognitoWindow;
|
||||
case side_panel::customize_chrome::mojom::ActionId::kShowPasswordManager:
|
||||
@@ -182,6 +186,10 @@ CustomizeToolbarHandler::CustomizeToolba
|
||||
prefs::kShowAvatarButton,
|
||||
base::BindRepeating(&CustomizeToolbarHandler::OnShowAvatarButtonChanged,
|
||||
base::Unretained(this)));
|
||||
+ pref_change_registrar_.Add(
|
||||
+ prefs::kShowExtensionsButton,
|
||||
+ base::BindRepeating(&CustomizeToolbarHandler::OnShowExtensionsButtonChanged,
|
||||
+ base::Unretained(this)));
|
||||
}
|
||||
|
||||
CustomizeToolbarHandler::~CustomizeToolbarHandler() = default;
|
||||
@@ -240,6 +248,19 @@ void CustomizeToolbarHandler::ListAction
|
||||
|
||||
actions.push_back(std::move(avatar_action));
|
||||
|
||||
+ auto extensions_action = side_panel::customize_chrome::mojom::Action::New(
|
||||
+ MojoActionForChromeAction(kActionExtensions).value(),
|
||||
+ base::UTF16ToUTF8(l10n_util::GetStringUTF16(IDS_TOOLTIP_EXTENSIONS_BUTTON)),
|
||||
+ prefs()->GetBoolean(prefs::kShowExtensionsButton), false,
|
||||
+ side_panel::customize_chrome::mojom::CategoryId::kYourChrome,
|
||||
+ GURL(webui::EncodePNGAndMakeDataURI(
|
||||
+ ui::ImageModel::FromVectorIcon(
|
||||
+ vector_icons::kExtensionChromeRefreshIcon, icon_color_id)
|
||||
+ .Rasterize(&provider),
|
||||
+ scale_factor)));
|
||||
+
|
||||
+ actions.push_back(std::move(extensions_action));
|
||||
+
|
||||
if (base::FeatureList::IsEnabled(features::kSideBySide)) {
|
||||
auto split_tab_action = side_panel::customize_chrome::mojom::Action::New(
|
||||
MojoActionForChromeAction(kActionSplitTab).value(),
|
||||
@@ -391,6 +412,9 @@ void CustomizeToolbarHandler::PinAction(
|
||||
case kActionAvatar:
|
||||
prefs()->SetBoolean(prefs::kShowAvatarButton, pin);
|
||||
break;
|
||||
+ case kActionExtensions:
|
||||
+ prefs()->SetBoolean(prefs::kShowExtensionsButton, pin);
|
||||
+ break;
|
||||
default:
|
||||
model_->UpdatePinnedState(chrome_action.value(), pin);
|
||||
const std::optional<std::string> metrics_name =
|
||||
@@ -449,6 +473,11 @@ void CustomizeToolbarHandler::OnShowAvat
|
||||
prefs()->GetBoolean(prefs::kShowAvatarButton));
|
||||
}
|
||||
|
||||
+void CustomizeToolbarHandler::OnShowExtensionsButtonChanged() {
|
||||
+ OnActionPinnedChanged(kActionExtensions,
|
||||
+ prefs()->GetBoolean(prefs::kShowExtensionsButton));
|
||||
+}
|
||||
+
|
||||
void CustomizeToolbarHandler::OnActionItemChanged() {
|
||||
client_->NotifyActionsUpdated();
|
||||
}
|
||||
--- a/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h
|
||||
+++ b/chrome/browser/ui/webui/side_panel/customize_chrome/customize_toolbar/customize_toolbar_handler.h
|
||||
@@ -55,6 +55,7 @@ class CustomizeToolbarHandler
|
||||
void OnShowForwardButtonChanged();
|
||||
void OnPinSplitTabButtonChanged();
|
||||
void OnShowAvatarButtonChanged();
|
||||
+ void OnShowExtensionsButtonChanged();
|
||||
void OnActionItemChanged();
|
||||
|
||||
PrefService* prefs() const;
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -1327,6 +1327,10 @@ inline constexpr char kPinSplitTabButton
|
||||
// toolbar.
|
||||
inline constexpr char kShowAvatarButton[] = "helium.browser.show_avatar_button";
|
||||
|
||||
+// A boolean pref set to true if the Extensions button should be visible on the
|
||||
+// toolbar.
|
||||
+inline constexpr char kShowExtensionsButton[] = "helium.browser.show_extensions_button";
|
||||
+
|
||||
// A boolean pref set to true if Gemini integration be enabled. This is managed
|
||||
// by enterprise policy.
|
||||
inline constexpr char kGeminiSettings[] = "browser.gemini_settings";
|
||||
@@ -0,0 +1,22 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -133,7 +133,7 @@
|
||||
"Return generic values for WebGLDebugRendererInfo to remove a potential data leak while preventing potential website breakage. ungoogled-chromium flag.",
|
||||
kOsAll, FEATURE_WITH_PARAMS_VALUE_TYPE(blink::features::kSpoofWebGLInfo, kSpoofWebGLChoices, "SpoofWebGLInfo")},
|
||||
{"increase-incognito-storage-quota",
|
||||
- "Increases the storage quota for Incognito and Guest profiles",
|
||||
+ "Increase the storage quota for Incognito and Guest profiles",
|
||||
"Makes Incognito and Guest profiles compute the storage quota with the same algorithm that regular profiles use. This makes it harder for websites to detect Incognito mode, but may allow sites to induce heavy memory pressure. ungoogled-chromium flag.",
|
||||
kOsAll, FEATURE_VALUE_TYPE(storage::features::kIncreaseIncognitoStorageQuota)},
|
||||
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
|
||||
--- a/storage/browser/quota/quota_features.cc
|
||||
+++ b/storage/browser/quota/quota_features.cc
|
||||
@@ -39,7 +39,7 @@ BASE_FEATURE(kStaticStorageQuota, base::
|
||||
|
||||
BASE_FEATURE(kIncreaseIncognitoStorageQuota,
|
||||
"IncreaseIncognitoStorageQuota",
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
} // namespace features
|
||||
} // namespace storage
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/components/performance_manager/features.cc
|
||||
+++ b/components/performance_manager/features.cc
|
||||
@@ -210,7 +210,7 @@ BASE_FEATURE(kFreezingFollowsDiscardOptO
|
||||
|
||||
BASE_FEATURE(kRecordFreezingEligibilityUKM, base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
-BASE_FEATURE(kInfiniteTabsFreezing, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+BASE_FEATURE(kInfiniteTabsFreezing, base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
BASE_FEATURE_PARAM(int,
|
||||
kInfiniteTabsFreezing_NumProtectedTabs,
|
||||
@@ -0,0 +1,262 @@
|
||||
--- a/chrome/app/chrome_command_ids.h
|
||||
+++ b/chrome/app/chrome_command_ids.h
|
||||
@@ -93,9 +93,11 @@
|
||||
#define IDC_WEB_APP_MENU_APP_INFO 34063
|
||||
#define IDC_WEB_APP_UPGRADE_DIALOG 34064
|
||||
|
||||
+// Helium commands
|
||||
+#define IDC_COPY_OR_INSPECT_SHORTCUT 34080
|
||||
+
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Move window to other user commands
|
||||
-#define IDC_VISIT_DESKTOP_OF_LRU_USER_2 34080
|
||||
#define IDC_VISIT_DESKTOP_OF_LRU_USER_3 34081
|
||||
#define IDC_VISIT_DESKTOP_OF_LRU_USER_4 34082
|
||||
#define IDC_VISIT_DESKTOP_OF_LRU_USER_5 34083
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -1501,6 +1501,11 @@ inline constexpr char kPageColorsBlockLi
|
||||
inline constexpr char kPrefersDefaultScrollbarStyles[] =
|
||||
"settings.a11y.prefers_default_scrollbar_styles";
|
||||
|
||||
+// Boolean that indicates whether the user has enabled the keyboard shortcut
|
||||
+// for copying the current page URL to the clipboard.
|
||||
+inline constexpr char kCopyPageUrlShortcut[] =
|
||||
+ "helium.settings.a11y.copy_page_url_shortcut";
|
||||
+
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
// Boolean that indicates whether the application should show the info bar
|
||||
// asking the user to set up automatic updates when Keystone promotion is
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -154,6 +154,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
prefs::kWebRTCDiagnosticLogCollectionAllowedForOrigins,
|
||||
base::ListValue());
|
||||
|
||||
+ registry->RegisterBooleanPref(prefs::kCopyPageUrlShortcut, true);
|
||||
+
|
||||
// We need to register the type of these preferences in order to query
|
||||
// them even though they're only typically controlled via policy.
|
||||
registry->RegisterBooleanPref(policy::policy_prefs::kHideWebStoreIcon, false);
|
||||
--- a/chrome/browser/ui/browser_command_controller.cc
|
||||
+++ b/chrome/browser/ui/browser_command_controller.cc
|
||||
@@ -413,7 +413,9 @@ bool BrowserCommandController::IsReserve
|
||||
command_id == IDC_NEW_INCOGNITO_WINDOW || command_id == IDC_NEW_TAB ||
|
||||
command_id == IDC_NEW_WINDOW || command_id == IDC_RESTORE_TAB ||
|
||||
command_id == IDC_SELECT_NEXT_TAB ||
|
||||
- command_id == IDC_SELECT_PREVIOUS_TAB || command_id == IDC_EXIT;
|
||||
+ command_id == IDC_SELECT_PREVIOUS_TAB || command_id == IDC_EXIT ||
|
||||
+ command_id == IDC_COPY_OR_INSPECT_SHORTCUT || command_id == IDC_DEV_TOOLS ||
|
||||
+ command_id == IDC_DEV_TOOLS_TOGGLE || command_id == IDC_TAB_SEARCH;
|
||||
}
|
||||
|
||||
void BrowserCommandController::TabStateChanged() {
|
||||
@@ -1232,6 +1234,14 @@ bool BrowserCommandController::ExecuteCo
|
||||
case IDC_DUPLICATE_TARGET_TAB:
|
||||
DuplicateKeyboardFocusedTab(browser_);
|
||||
break;
|
||||
+ case IDC_COPY_OR_INSPECT_SHORTCUT: {
|
||||
+ PrefService* prefs = profile()->GetPrefs();
|
||||
+ bool copy = prefs->GetBoolean(prefs::kCopyPageUrlShortcut);
|
||||
+
|
||||
+ return ExecuteCommandWithDisposition(
|
||||
+ copy ? IDC_COPY_URL : IDC_DEV_TOOLS_INSPECT,
|
||||
+ disposition, time_stamp);
|
||||
+ }
|
||||
// Hosted App commands
|
||||
case IDC_COPY_URL:
|
||||
CopyURL(browser_, browser_->tab_strip_model()->GetActiveWebContents());
|
||||
@@ -2019,6 +2029,12 @@ void BrowserCommandController::UpdateCom
|
||||
|
||||
bool dev_tools_enabled = DevToolsWindow::AllowDevToolsFor(
|
||||
profile(), browser_->tab_strip_model()->GetActiveWebContents());
|
||||
+
|
||||
+ PrefService* prefs = profile()->GetPrefs();
|
||||
+ bool copy = prefs->GetBoolean(prefs::kCopyPageUrlShortcut);
|
||||
+ command_updater_.UpdateCommandEnabled(IDC_COPY_OR_INSPECT_SHORTCUT,
|
||||
+ copy || dev_tools_enabled);
|
||||
+
|
||||
command_updater_.UpdateCommandEnabled(IDC_DEV_TOOLS, dev_tools_enabled);
|
||||
command_updater_.UpdateCommandEnabled(IDC_DEV_TOOLS_CONSOLE,
|
||||
dev_tools_enabled);
|
||||
--- a/chrome/browser/ui/accelerator_table.cc
|
||||
+++ b/chrome/browser/ui/accelerator_table.cc
|
||||
@@ -269,8 +269,10 @@ const AcceleratorMapping kDevToolsAccele
|
||||
{ui::VKEY_I, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_DEV_TOOLS},
|
||||
{ui::VKEY_J, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
|
||||
IDC_DEV_TOOLS_CONSOLE},
|
||||
- {ui::VKEY_C, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
|
||||
+ {ui::VKEY_E, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
|
||||
IDC_DEV_TOOLS_INSPECT},
|
||||
+ {ui::VKEY_C, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN,
|
||||
+ IDC_COPY_OR_INSPECT_SHORTCUT},
|
||||
{ui::VKEY_U, ui::EF_CONTROL_DOWN, IDC_VIEW_SOURCE},
|
||||
#endif // !BUILDFLAG(IS_MAC)
|
||||
};
|
||||
--- a/chrome/browser/global_keyboard_shortcuts_mac.mm
|
||||
+++ b/chrome/browser/global_keyboard_shortcuts_mac.mm
|
||||
@@ -145,7 +145,9 @@ const std::vector<KeyboardShortcutData>&
|
||||
|
||||
{true, true, false, false, kVK_ANSI_M, IDC_SHOW_AVATAR_MENU},
|
||||
{true, false, false, true, kVK_ANSI_L, IDC_SHOW_DOWNLOADS},
|
||||
- {true, true, false, false, kVK_ANSI_C, IDC_DEV_TOOLS_INSPECT},
|
||||
+ {true, true, false, false, kVK_ANSI_I, IDC_DEV_TOOLS},
|
||||
+ {true, true, false, false, kVK_ANSI_E, IDC_DEV_TOOLS_INSPECT},
|
||||
+ {true, true, false, false, kVK_ANSI_C, IDC_COPY_OR_INSPECT_SHORTCUT},
|
||||
{true, false, false, true, kVK_ANSI_C, IDC_DEV_TOOLS_INSPECT},
|
||||
{true, false, false, true, kVK_DownArrow, IDC_FOCUS_NEXT_PANE},
|
||||
{true, false, false, true, kVK_UpArrow, IDC_FOCUS_PREVIOUS_PANE},
|
||||
--- a/chrome/browser/ui/cocoa/accelerators_cocoa.mm
|
||||
+++ b/chrome/browser/ui/cocoa/accelerators_cocoa.mm
|
||||
@@ -37,7 +37,9 @@ const struct AcceleratorMapping {
|
||||
{IDC_CUT, ui::EF_COMMAND_DOWN, ui::VKEY_X},
|
||||
{IDC_DEV_TOOLS, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN, ui::VKEY_I},
|
||||
{IDC_DEV_TOOLS_CONSOLE, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN, ui::VKEY_J},
|
||||
- {IDC_DEV_TOOLS_INSPECT, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN, ui::VKEY_C},
|
||||
+ {IDC_DEV_TOOLS_INSPECT, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN, ui::VKEY_E},
|
||||
+ {IDC_COPY_OR_INSPECT_SHORTCUT, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN, ui::VKEY_C},
|
||||
+ {IDC_NEW_SPLIT_TAB, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN, ui::VKEY_N},
|
||||
{IDC_FIND, ui::EF_COMMAND_DOWN, ui::VKEY_F},
|
||||
{IDC_NEW_INCOGNITO_WINDOW, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN,
|
||||
ui::VKEY_N},
|
||||
@@ -73,9 +75,6 @@ const struct AcceleratorMapping {
|
||||
// We used to define IDC_CLOSE_WINDOW here. Instead, see
|
||||
// AcceleratorForCloseWindow().
|
||||
{IDC_CLOSE_TAB, ui::EF_COMMAND_DOWN, ui::VKEY_W},
|
||||
-
|
||||
- {IDC_EMAIL_PAGE_LOCATION, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN,
|
||||
- ui::VKEY_I},
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
{IDC_BASIC_PRINT, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN, ui::VKEY_P},
|
||||
#endif // ENABLE_PRINTING
|
||||
--- a/chrome/app/chrome_dll.rc
|
||||
+++ b/chrome/app/chrome_dll.rc
|
||||
@@ -49,7 +49,8 @@ BEGIN
|
||||
"W", IDC_CLOSE_WINDOW, VIRTKEY, CONTROL, SHIFT
|
||||
"I", IDC_DEV_TOOLS, VIRTKEY, CONTROL, SHIFT
|
||||
"J", IDC_DEV_TOOLS_CONSOLE, VIRTKEY, CONTROL, SHIFT
|
||||
- "C", IDC_DEV_TOOLS_INSPECT, VIRTKEY, CONTROL, SHIFT
|
||||
+ "E", IDC_DEV_TOOLS_INSPECT, VIRTKEY, CONTROL, SHIFT
|
||||
+ "C", IDC_COPY_OR_INSPECT_SHORTCUT, VIRTKEY, CONTROL, SHIFT
|
||||
VK_F12, IDC_DEV_TOOLS_TOGGLE, VIRTKEY
|
||||
"F", IDC_FIND, VIRTKEY, CONTROL
|
||||
"G", IDC_FIND_NEXT, VIRTKEY, CONTROL
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -604,6 +604,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
|
||||
(*s_allowlist)[::prefs::kCaretBrowsingEnabled] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
+ (*s_allowlist)[::prefs::kCopyPageUrlShortcut] =
|
||||
+ settings_api::PrefType::kBoolean;
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Accounts / Users / People.
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -190,6 +190,16 @@
|
||||
Shows a confirmation when you copy links, images, or videos
|
||||
</message>
|
||||
</if>
|
||||
+ <if expr="is_macosx">
|
||||
+ <message name="IDS_SETTINGS_ACCESSIBILITY_COPY_PAGE_URL_SHORTCUT" desc="Toggle in settings that allows you to enable the keyboard shortcut that copies the current page URL to the clipboard. It's enabled by default.">
|
||||
+ Enable quick page link copying with ⌘+Shift+C
|
||||
+ </message>
|
||||
+ </if>
|
||||
+ <if expr="not is_macosx">
|
||||
+ <message name="IDS_SETTINGS_ACCESSIBILITY_COPY_PAGE_URL_SHORTCUT" desc="Toggle in settings that allows you to enable the keyboard shortcut that copies the current page URL to the clipboard. It's enabled by default.">
|
||||
+ Enable quick page link copying with Ctrl+Shift+C
|
||||
+ </message>
|
||||
+ </if>
|
||||
|
||||
<!-- Appearance Page -->
|
||||
<message name="IDS_SETTINGS_APPEARANCE" desc="Name of the settings page which displays appearance preferences.">
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -287,6 +287,7 @@ void AddA11yStrings(content::WebUIDataSo
|
||||
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
|
||||
{"axTreeFixingTitle", IDS_SETTINGS_AX_TREE_FIXING_TITLE},
|
||||
{"axTreeFixingSubtitle", IDS_SETTINGS_AX_TREE_FIXING_SUBTITLE},
|
||||
+ {"copyPageUrlShortcut", IDS_SETTINGS_ACCESSIBILITY_COPY_PAGE_URL_SHORTCUT},
|
||||
};
|
||||
html_source->AddLocalizedStrings(kLocalizedStrings);
|
||||
|
||||
--- a/chrome/browser/resources/settings/appearance_page/appearance_behavior_page.html
|
||||
+++ b/chrome/browser/resources/settings/appearance_page/appearance_behavior_page.html
|
||||
@@ -1,6 +1,11 @@
|
||||
<style include="cr-shared-style settings-shared"></style>
|
||||
<settings-section page-title="$i18n{behaviorPageTitle}">
|
||||
|
||||
+ <settings-toggle-button class="hr" id="copyPageUrlShortcut"
|
||||
+ pref="{{prefs.helium.settings.a11y.copy_page_url_shortcut}}"
|
||||
+ label="$i18n{copyPageUrlShortcut}">
|
||||
+ </settings-toggle-button>
|
||||
+
|
||||
<settings-toggle-button class="hr" id="autoPinNewTabGroups"
|
||||
pref="{{prefs.auto_pin_new_tab_groups}}"
|
||||
label="$i18n{autoPinNewTabGroups}">
|
||||
--- a/third_party/devtools-frontend/src/front_end/panels/elements/elements-meta.ts
|
||||
+++ b/third_party/devtools-frontend/src/front_end/panels/elements/elements-meta.ts
|
||||
@@ -446,11 +446,11 @@ UI.ActionRegistration.registerActionExte
|
||||
iconClass: UI.ActionRegistration.IconClass.LARGEICON_NODE_SEARCH,
|
||||
bindings: [
|
||||
{
|
||||
- shortcut: 'Ctrl+Shift+C',
|
||||
+ shortcut: 'Ctrl+Shift+E',
|
||||
platform: UI.ActionRegistration.Platforms.WINDOWS_LINUX,
|
||||
},
|
||||
{
|
||||
- shortcut: 'Meta+Shift+C',
|
||||
+ shortcut: 'Meta+Shift+E',
|
||||
platform: UI.ActionRegistration.Platforms.MAC,
|
||||
},
|
||||
],
|
||||
--- a/chrome/browser/ui/cocoa/main_menu_builder.mm
|
||||
+++ b/chrome/browser/ui/cocoa/main_menu_builder.mm
|
||||
@@ -193,6 +193,8 @@ NSMenuItem* BuildEditMenu(NSApplication*
|
||||
Item(IDS_COPY_MAC)
|
||||
.tag(IDC_CONTENT_CONTEXT_COPY)
|
||||
.action(@selector(copy:)),
|
||||
+ Item(IDS_COPY_URL)
|
||||
+ .command_id(IDC_COPY_URL),
|
||||
Item(IDS_PASTE_MAC)
|
||||
.tag(IDC_CONTENT_CONTEXT_PASTE)
|
||||
.action(@selector(paste:)),
|
||||
@@ -535,6 +537,8 @@ NSMenuItem* BuildTabMenu(NSApplication*
|
||||
Item(is_rtl ? IDS_TAB_CXMENU_NEWTABTOLEFT
|
||||
: IDS_TAB_CXMENU_NEWTABTORIGHT)
|
||||
.command_id(IDC_NEW_TAB_TO_RIGHT),
|
||||
+ Item(IDS_TAB_CXMENU_ADD_TAB_TO_NEW_SPLIT)
|
||||
+ .command_id(IDC_NEW_SPLIT_TAB),
|
||||
Item(IDS_NEXT_TAB_MAC)
|
||||
.command_id(IDC_SELECT_NEXT_TAB),
|
||||
Item(IDS_PREV_TAB_MAC)
|
||||
--- a/chrome/browser/ui/cocoa/share_menu_controller.mm
|
||||
+++ b/chrome/browser/ui/cocoa/share_menu_controller.mm
|
||||
@@ -98,12 +98,6 @@ bool CanShare() {
|
||||
// to fetch sharing services that can handle the NSURL type.
|
||||
NSArray* services = [NSSharingService
|
||||
sharingServicesForItems:@[ [NSURL URLWithString:@"https://google.com"] ]];
|
||||
- NSMenuItem* email = [[NSMenuItem alloc]
|
||||
- initWithTitle:l10n_util::GetNSString(IDS_EMAIL_LINK_MAC)
|
||||
- action:@selector(emailLink:)
|
||||
- keyEquivalent:[self keyEquivalentForMail]];
|
||||
- email.target = self;
|
||||
- [menu addItem:email];
|
||||
for (NSSharingService* service in services) {
|
||||
// Email share service causes mysterious crashes, so share directly.
|
||||
// See https://crbug.com/356643975
|
||||
@@ -297,13 +291,4 @@ bool CanShare() {
|
||||
return item;
|
||||
}
|
||||
|
||||
-- (NSString*)keyEquivalentForMail {
|
||||
- ui::Accelerator accelerator;
|
||||
- bool found = GetDefaultMacAcceleratorForCommandId(IDC_EMAIL_PAGE_LOCATION,
|
||||
- &accelerator);
|
||||
- DCHECK(found);
|
||||
- return GetKeyEquivalentAndModifierMaskFromAccelerator(accelerator)
|
||||
- .keyEquivalent;
|
||||
-}
|
||||
-
|
||||
@end
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/components/performance_manager/user_tuning/prefs.cc
|
||||
+++ b/components/performance_manager/user_tuning/prefs.cc
|
||||
@@ -25,7 +25,7 @@ void RegisterLocalStatePrefs(PrefRegistr
|
||||
@@ -24,7 +24,7 @@ void RegisterLocalStatePrefs(PrefRegistr
|
||||
kMemorySaverModeTimeBeforeDiscardInMinutes,
|
||||
kDefaultMemorySaverModeTimeBeforeDiscardInMinutes);
|
||||
registry->RegisterIntegerPref(
|
||||
|
||||
@@ -0,0 +1,423 @@
|
||||
--- a/chrome/browser/helium_flag_choices.h
|
||||
+++ b/chrome/browser/helium_flag_choices.h
|
||||
@@ -30,6 +30,7 @@ namespace helium {
|
||||
|
||||
constexpr const char kHeliumNoiseCommandLine[] = "helium-noise";
|
||||
constexpr const char kHeliumNoiseCanvasCommandLine[] = "helium-noise-canvas";
|
||||
+ constexpr const char kHeliumNoiseAudioCommandLine[] = "helium-noise-audio";
|
||||
|
||||
} // namespace helium
|
||||
|
||||
--- a/chrome/browser/helium_flag_entries.h
|
||||
+++ b/chrome/browser/helium_flag_entries.h
|
||||
@@ -24,4 +24,8 @@
|
||||
"[Helium Noise] Canvas pixel noising",
|
||||
"Adds insignificant noise to canvas pixels during readback to deceive canvas-based fingerprinting. Helium flag.",
|
||||
kOsAll, FEATURE_VALUE_TYPE(blink::features::kHeliumNoiseCanvas)},
|
||||
+ {helium::kHeliumNoiseAudioCommandLine,
|
||||
+ "[Helium Noise] Jitter audio context data",
|
||||
+ "Adds insignificant jitter to audio data to deceive AudioContext-based fingerprinting. Helium flag.",
|
||||
+ kOsAll, FEATURE_VALUE_TYPE(blink::features::kHeliumNoiseAudio)},
|
||||
#endif /* CHROME_BROWSER_HELIUM_FLAG_ENTRIES_H_ */
|
||||
--- a/third_party/blink/common/features.cc
|
||||
+++ b/third_party/blink/common/features.cc
|
||||
@@ -47,6 +47,10 @@ BASE_FEATURE(kHeliumNoise,
|
||||
BASE_FEATURE(kHeliumNoiseCanvas,
|
||||
base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
+// Audio Context jitter for fingerprinting protection.
|
||||
+BASE_FEATURE(kHeliumNoiseAudio,
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+
|
||||
// Controls whether to include information about the page's open popup in
|
||||
// AIPageContent.
|
||||
BASE_FEATURE(kAIPageContentIncludePopupWindows,
|
||||
--- a/third_party/blink/public/common/features.h
|
||||
+++ b/third_party/blink/public/common/features.h
|
||||
@@ -42,6 +42,7 @@ BLINK_COMMON_EXPORT extern const base::F
|
||||
|
||||
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumNoise);
|
||||
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumNoiseCanvas);
|
||||
+BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumNoiseAudio);
|
||||
|
||||
// Controls whether to include information about the page's open popup in
|
||||
// AIPageContent.
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_buffer.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.cc
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/containers/span.h"
|
||||
+#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/renderer/bindings/modules/v8/v8_audio_buffer_options.h"
|
||||
#include "third_party/blink/renderer/modules/webaudio/base_audio_context.h"
|
||||
#include "third_party/blink/renderer/platform/audio/audio_bus.h"
|
||||
@@ -200,6 +201,20 @@ AudioBuffer::AudioBuffer(AudioBus* bus)
|
||||
}
|
||||
}
|
||||
|
||||
+void AudioBuffer::JitterAudioData(ExecutionContext* context) {
|
||||
+ if (!base::FeatureList::IsEnabled(blink::features::kHeliumNoiseAudio)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ for (unsigned i = 0; i < channels_.size(); ++i) {
|
||||
+ if (NotShared<DOMFloat32Array> channel = getChannelData(i)) {
|
||||
+ for (float& sample : channel->AsSpan()) {
|
||||
+ sample = BaseAudioContext::JitterAudioData(sample, context);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
NotShared<DOMFloat32Array> AudioBuffer::getChannelData(
|
||||
unsigned channel_index,
|
||||
ExceptionState& exception_state) {
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_buffer.h
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.h
|
||||
@@ -41,6 +41,7 @@ namespace blink {
|
||||
|
||||
class AudioBus;
|
||||
class AudioBufferOptions;
|
||||
+class ExecutionContext;
|
||||
class ExceptionState;
|
||||
class SharedAudioBuffer;
|
||||
|
||||
@@ -115,6 +116,8 @@ class MODULES_EXPORT AudioBuffer final :
|
||||
|
||||
std::unique_ptr<SharedAudioBuffer> CreateSharedAudioBuffer();
|
||||
|
||||
+ void JitterAudioData(ExecutionContext* context);
|
||||
+
|
||||
private:
|
||||
static DOMFloat32Array* CreateFloat32ArrayOrNull(
|
||||
uint32_t length,
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_context.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_context.cc
|
||||
@@ -1125,7 +1125,12 @@ double AudioContext::baseLatency() const
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(main_thread_sequence_checker_);
|
||||
DCHECK(destination());
|
||||
|
||||
- return base_latency_;
|
||||
+ if (!base::FeatureList::IsEnabled(blink::features::kHeliumNoiseAudio)) {
|
||||
+ return base_latency_;
|
||||
+ }
|
||||
+
|
||||
+ // Round to two decimal places
|
||||
+ return std::round(base_latency_ * 100.0) / 100.0;
|
||||
}
|
||||
|
||||
double AudioContext::outputLatency() const {
|
||||
--- a/third_party/blink/renderer/modules/webaudio/base_audio_context.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/base_audio_context.cc
|
||||
@@ -26,10 +26,13 @@
|
||||
#include "third_party/blink/renderer/modules/webaudio/base_audio_context.h"
|
||||
|
||||
#include <algorithm>
|
||||
+#include <bit>
|
||||
|
||||
#include "base/metrics/histogram_functions.h"
|
||||
#include "build/build_config.h"
|
||||
#include "media/base/audio_bus.h"
|
||||
+#include "third_party/blink/public/common/features.h"
|
||||
+#include "third_party/blink/public/common/helium_noise/noise_token.h"
|
||||
#include "third_party/blink/public/mojom/devtools/console_message.mojom-blink.h"
|
||||
#include "third_party/blink/public/mojom/frame/lifecycle.mojom-shared.h"
|
||||
#include "third_party/blink/public/platform/platform.h"
|
||||
@@ -37,7 +40,9 @@
|
||||
#include "third_party/blink/renderer/bindings/core/v8/dictionary.h"
|
||||
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
|
||||
#include "third_party/blink/renderer/bindings/modules/v8/v8_periodic_wave_constraints.h"
|
||||
+#include "third_party/blink/renderer/core/helium_noise/helium_noise_hash.h"
|
||||
#include "third_party/blink/renderer/core/dom/dom_exception.h"
|
||||
+#include "third_party/blink/renderer/core/execution_context/execution_context.h"
|
||||
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
|
||||
#include "third_party/blink/renderer/core/frame/settings.h"
|
||||
#include "third_party/blink/renderer/core/html/media/html_media_element.h"
|
||||
@@ -777,6 +782,35 @@ LocalDOMWindow* BaseAudioContext::GetWin
|
||||
return To<LocalDOMWindow>(GetExecutionContext());
|
||||
}
|
||||
|
||||
+float BaseAudioContext::JitterAudioData(float data, ExecutionContext* context) {
|
||||
+ if (!base::FeatureList::IsEnabled(blink::features::kHeliumNoiseAudio)) {
|
||||
+ return data;
|
||||
+ }
|
||||
+
|
||||
+ if (!context || !context->GetHeliumNoiseTokens().contains(
|
||||
+ HeliumNoiseFeature::kAudio)) {
|
||||
+ return data;
|
||||
+ }
|
||||
+
|
||||
+ HeliumNoiseHash noise_hash(
|
||||
+ context->GetHeliumNoiseTokens().at(HeliumNoiseFeature::kAudio));
|
||||
+
|
||||
+ // Update the hash with audio data for extra entropy. This makes it
|
||||
+ // harder to identify or remove the noise, similar to how we do
|
||||
+ // it in canvas.
|
||||
+ uint64_t data_bits = std::bit_cast<uint64_t>(static_cast<double>(data));
|
||||
+ noise_hash.Update(data_bits);
|
||||
+
|
||||
+ // Generate jitter within [-0.0001, 0.0001] (aka ±0.01%)
|
||||
+ // Note: GetValueBelow(2) returns an int value, either 0 or 1.
|
||||
+ constexpr float scale = 0.0001f / 10000.0f;
|
||||
+ int noise_value = noise_hash.GetValueBelow(10000 + 1);
|
||||
+ int noise_sign = noise_hash.GetValueBelow(2) ? 1 : -1;
|
||||
+ float jitter = noise_value * noise_sign * scale;
|
||||
+
|
||||
+ return data * (1.0f + jitter);
|
||||
+}
|
||||
+
|
||||
void BaseAudioContext::NotifySourceNodeStartedProcessing(AudioNode* node) {
|
||||
DCHECK(IsMainThread());
|
||||
DeferredTaskHandler::GraphAutoLocker locker(this);
|
||||
--- a/third_party/blink/renderer/modules/webaudio/base_audio_context.h
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/base_audio_context.h
|
||||
@@ -328,6 +328,8 @@ class MODULES_EXPORT BaseAudioContext
|
||||
// if the execution context does not exist.
|
||||
bool CheckExecutionContextAndThrowIfNecessary(ExceptionState&);
|
||||
|
||||
+ static float JitterAudioData(float data, ExecutionContext* context);
|
||||
+
|
||||
protected:
|
||||
enum class ContextType { kRealtimeContext, kOfflineContext };
|
||||
|
||||
--- a/third_party/blink/renderer/modules/webaudio/offline_audio_context.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/offline_audio_context.cc
|
||||
@@ -411,6 +411,8 @@ void OfflineAudioContext::FireCompletion
|
||||
return;
|
||||
}
|
||||
|
||||
+ rendered_buffer->JitterAudioData(GetExecutionContext());
|
||||
+
|
||||
// Call the offline rendering completion event listener and resolve the
|
||||
// promise too.
|
||||
DispatchEvent(*OfflineAudioCompletionEvent::Create(rendered_buffer));
|
||||
--- a/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc
|
||||
@@ -33,6 +33,8 @@
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "media/base/audio_bus.h"
|
||||
+#include "third_party/blink/public/common/features.h"
|
||||
+#include "third_party/blink/renderer/modules/webaudio/base_audio_context.h"
|
||||
#include "third_party/blink/renderer/platform/audio/audio_bus.h"
|
||||
#include "third_party/blink/renderer/platform/audio/audio_utilities.h"
|
||||
#include "third_party/blink/renderer/platform/audio/vector_math.h"
|
||||
@@ -98,7 +100,8 @@ bool RealtimeAnalyser::SetFftSize(uint32
|
||||
}
|
||||
|
||||
void RealtimeAnalyser::GetFloatFrequencyData(DOMFloat32Array* destination_array,
|
||||
- double current_time) {
|
||||
+ double current_time,
|
||||
+ ExecutionContext* context) {
|
||||
DCHECK(IsMainThread());
|
||||
DCHECK(destination_array);
|
||||
|
||||
@@ -115,16 +118,22 @@ void RealtimeAnalyser::GetFloatFrequency
|
||||
const float* source = magnitude_buffer_.Data();
|
||||
float* destination = destination_array->Data();
|
||||
|
||||
+ const bool jitter_enabled = base::FeatureList::IsEnabled(
|
||||
+ blink::features::kHeliumNoiseAudio);
|
||||
+
|
||||
for (unsigned i = 0; i < len; ++i) {
|
||||
const float linear_value = UNSAFE_TODO(source[i]);
|
||||
const double db_mag = audio_utilities::LinearToDecibels(linear_value);
|
||||
- UNSAFE_TODO(destination[i]) = static_cast<float>(db_mag);
|
||||
+ auto db_value = static_cast<float>(db_mag);
|
||||
+ UNSAFE_TODO(destination[i]) = jitter_enabled ?
|
||||
+ BaseAudioContext::JitterAudioData(db_value, context) : db_value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RealtimeAnalyser::GetByteFrequencyData(DOMUint8Array* destination_array,
|
||||
- double current_time) {
|
||||
+ double current_time,
|
||||
+ ExecutionContext* context) {
|
||||
DCHECK(IsMainThread());
|
||||
DCHECK(destination_array);
|
||||
|
||||
@@ -150,15 +159,22 @@ void RealtimeAnalyser::GetByteFrequencyD
|
||||
const float* source = magnitude_buffer_.Data();
|
||||
unsigned char* destination = destination_array->Data();
|
||||
|
||||
+ const bool jitter_enabled = base::FeatureList::IsEnabled(
|
||||
+ blink::features::kHeliumNoiseAudio);
|
||||
+
|
||||
for (unsigned i = 0; i < len; ++i) {
|
||||
const float linear_value = UNSAFE_TODO(source[i]);
|
||||
const double db_mag = audio_utilities::LinearToDecibels(linear_value);
|
||||
|
||||
// The range m_minDecibels to m_maxDecibels will be scaled to byte values
|
||||
// from 0 to UCHAR_MAX.
|
||||
- const double scaled_value =
|
||||
+ double scaled_value =
|
||||
UCHAR_MAX * (db_mag - min_decibels) * range_scale_factor;
|
||||
|
||||
+ if (jitter_enabled) {
|
||||
+ scaled_value = BaseAudioContext::JitterAudioData(scaled_value, context);
|
||||
+ }
|
||||
+
|
||||
// Clip to valid range.
|
||||
UNSAFE_TODO(destination[i]) =
|
||||
static_cast<unsigned char>(ClampTo(scaled_value, 0, UCHAR_MAX));
|
||||
@@ -167,7 +183,8 @@ void RealtimeAnalyser::GetByteFrequencyD
|
||||
}
|
||||
|
||||
void RealtimeAnalyser::GetFloatTimeDomainData(
|
||||
- DOMFloat32Array* destination_array) {
|
||||
+ DOMFloat32Array* destination_array,
|
||||
+ ExecutionContext* context) {
|
||||
DCHECK(IsMainThread());
|
||||
DCHECK(destination_array);
|
||||
|
||||
@@ -183,18 +200,26 @@ void RealtimeAnalyser::GetFloatTimeDomai
|
||||
|
||||
const unsigned write_index = GetWriteIndex();
|
||||
|
||||
+ const bool jitter_enabled = base::FeatureList::IsEnabled(
|
||||
+ blink::features::kHeliumNoiseAudio);
|
||||
+
|
||||
for (unsigned i = 0; i < len; ++i) {
|
||||
// Buffer access is protected due to modulo operation.
|
||||
float value = UNSAFE_TODO(
|
||||
input_buffer[(i + write_index - fft_size + kInputBufferSize) %
|
||||
kInputBufferSize]);
|
||||
|
||||
+ if (jitter_enabled) {
|
||||
+ value = BaseAudioContext::JitterAudioData(value, context);
|
||||
+ }
|
||||
+
|
||||
UNSAFE_TODO(destination[i]) = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-void RealtimeAnalyser::GetByteTimeDomainData(DOMUint8Array* destination_array) {
|
||||
+void RealtimeAnalyser::GetByteTimeDomainData(DOMUint8Array* destination_array,
|
||||
+ ExecutionContext* context) {
|
||||
DCHECK(IsMainThread());
|
||||
DCHECK(destination_array);
|
||||
|
||||
@@ -210,12 +235,19 @@ void RealtimeAnalyser::GetByteTimeDomain
|
||||
|
||||
const unsigned write_index = GetWriteIndex();
|
||||
|
||||
+ const bool jitter_enabled = base::FeatureList::IsEnabled(
|
||||
+ blink::features::kHeliumNoiseAudio);
|
||||
+
|
||||
for (unsigned i = 0; i < len; ++i) {
|
||||
// Buffer access is protected due to modulo operation.
|
||||
- const float value = UNSAFE_TODO(
|
||||
+ float value = UNSAFE_TODO(
|
||||
input_buffer[(i + write_index - fft_size + kInputBufferSize) %
|
||||
kInputBufferSize]);
|
||||
|
||||
+ if (jitter_enabled) {
|
||||
+ value = BaseAudioContext::JitterAudioData(value, context);
|
||||
+ }
|
||||
+
|
||||
// Scale from nominal -1 -> +1 to unsigned byte.
|
||||
const double scaled_value = 128 * (value + 1);
|
||||
|
||||
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
@@ -660,7 +660,6 @@
|
||||
// AudioContext.playoutStats interface.
|
||||
// https://chromestatus.com/feature/5172818344148992
|
||||
name: "AudioContextPlayoutStats",
|
||||
- origin_trial_feature_name: "AudioContextPlayoutStats",
|
||||
status: "experimental",
|
||||
},
|
||||
{
|
||||
--- a/third_party/blink/renderer/modules/webaudio/analyser_handler.h
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/analyser_handler.h
|
||||
@@ -13,6 +13,7 @@ namespace blink {
|
||||
|
||||
class AudioNode;
|
||||
class ExceptionState;
|
||||
+class ExecutionContext;
|
||||
|
||||
class AnalyserHandler final : public AudioHandler {
|
||||
public:
|
||||
@@ -37,17 +38,17 @@ class AnalyserHandler final : public Aud
|
||||
}
|
||||
void SetSmoothingTimeConstant(double k, ExceptionState&);
|
||||
|
||||
- void GetFloatFrequencyData(DOMFloat32Array* array, double current_time) {
|
||||
- analyser_.GetFloatFrequencyData(array, current_time);
|
||||
+ void GetFloatFrequencyData(DOMFloat32Array* array, double current_time, ExecutionContext* context) {
|
||||
+ analyser_.GetFloatFrequencyData(array, current_time, context);
|
||||
}
|
||||
- void GetByteFrequencyData(DOMUint8Array* array, double current_time) {
|
||||
- analyser_.GetByteFrequencyData(array, current_time);
|
||||
+ void GetByteFrequencyData(DOMUint8Array* array, double current_time, ExecutionContext* context) {
|
||||
+ analyser_.GetByteFrequencyData(array, current_time, context);
|
||||
}
|
||||
- void GetFloatTimeDomainData(DOMFloat32Array* array) {
|
||||
- analyser_.GetFloatTimeDomainData(array);
|
||||
+ void GetFloatTimeDomainData(DOMFloat32Array* array, ExecutionContext* context) {
|
||||
+ analyser_.GetFloatTimeDomainData(array, context);
|
||||
}
|
||||
- void GetByteTimeDomainData(DOMUint8Array* array) {
|
||||
- analyser_.GetByteTimeDomainData(array);
|
||||
+ void GetByteTimeDomainData(DOMUint8Array* array, ExecutionContext* context) {
|
||||
+ analyser_.GetByteTimeDomainData(array, context);
|
||||
}
|
||||
|
||||
private:
|
||||
--- a/third_party/blink/renderer/modules/webaudio/analyser_node.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/analyser_node.cc
|
||||
@@ -118,20 +118,22 @@ double AnalyserNode::smoothingTimeConsta
|
||||
|
||||
void AnalyserNode::getFloatFrequencyData(NotShared<DOMFloat32Array> array) {
|
||||
GetAnalyserHandler().GetFloatFrequencyData(array.Get(),
|
||||
- context()->currentTime());
|
||||
+ context()->currentTime(),
|
||||
+ GetExecutionContext());
|
||||
}
|
||||
|
||||
void AnalyserNode::getByteFrequencyData(NotShared<DOMUint8Array> array) {
|
||||
GetAnalyserHandler().GetByteFrequencyData(array.Get(),
|
||||
- context()->currentTime());
|
||||
+ context()->currentTime(),
|
||||
+ GetExecutionContext());
|
||||
}
|
||||
|
||||
void AnalyserNode::getFloatTimeDomainData(NotShared<DOMFloat32Array> array) {
|
||||
- GetAnalyserHandler().GetFloatTimeDomainData(array.Get());
|
||||
+ GetAnalyserHandler().GetFloatTimeDomainData(array.Get(), GetExecutionContext());
|
||||
}
|
||||
|
||||
void AnalyserNode::getByteTimeDomainData(NotShared<DOMUint8Array> array) {
|
||||
- GetAnalyserHandler().GetByteTimeDomainData(array.Get());
|
||||
+ GetAnalyserHandler().GetByteTimeDomainData(array.Get(), GetExecutionContext());
|
||||
}
|
||||
|
||||
void AnalyserNode::ReportDidCreate() {
|
||||
--- a/third_party/blink/renderer/modules/webaudio/realtime_analyser.h
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/realtime_analyser.h
|
||||
@@ -36,6 +36,7 @@
|
||||
namespace blink {
|
||||
|
||||
class AudioBus;
|
||||
+class ExecutionContext;
|
||||
|
||||
class RealtimeAnalyser final {
|
||||
DISALLOW_NEW();
|
||||
@@ -65,10 +66,10 @@ class RealtimeAnalyser final {
|
||||
double SmoothingTimeConstant() const { return smoothing_time_constant_; }
|
||||
void SetSmoothingTimeConstant(double k) { smoothing_time_constant_ = k; }
|
||||
|
||||
- void GetFloatFrequencyData(DOMFloat32Array*, double);
|
||||
- void GetByteFrequencyData(DOMUint8Array*, double);
|
||||
- void GetFloatTimeDomainData(DOMFloat32Array*);
|
||||
- void GetByteTimeDomainData(DOMUint8Array*);
|
||||
+ void GetFloatFrequencyData(DOMFloat32Array*, double, ExecutionContext*);
|
||||
+ void GetByteFrequencyData(DOMUint8Array*, double, ExecutionContext*);
|
||||
+ void GetFloatTimeDomainData(DOMFloat32Array*, ExecutionContext*);
|
||||
+ void GetByteTimeDomainData(DOMUint8Array*, ExecutionContext*);
|
||||
|
||||
// The audio thread writes input data here.
|
||||
void WriteInput(AudioBus*, uint32_t frames_to_process);
|
||||
@@ -0,0 +1,439 @@
|
||||
# Some files in this patch are sourced from Chromium. They were
|
||||
# heavily modified to fit Helium's needs.
|
||||
#
|
||||
# Chromium's license header is maintained wherever applicable to
|
||||
# respect the original authorship of code.
|
||||
#
|
||||
# Chromium LICENSE:
|
||||
#
|
||||
# Copyright 2015 The Chromium Authors
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following disclaimer
|
||||
# in the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# * Neither the name of Google LLC nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
--- a/chrome/browser/helium_flag_choices.h
|
||||
+++ b/chrome/browser/helium_flag_choices.h
|
||||
@@ -29,6 +29,7 @@ namespace helium {
|
||||
constexpr const char kDisableEchCommandLine[] = "disable-ech";
|
||||
|
||||
constexpr const char kHeliumNoiseCommandLine[] = "helium-noise";
|
||||
+ constexpr const char kHeliumNoiseCanvasCommandLine[] = "helium-noise-canvas";
|
||||
|
||||
} // namespace helium
|
||||
|
||||
--- a/chrome/browser/helium_flag_entries.h
|
||||
+++ b/chrome/browser/helium_flag_entries.h
|
||||
@@ -20,4 +20,8 @@
|
||||
"Helium Noise",
|
||||
"Helium's anti-fingerprinting functionality. Adds insignificant noise to various features to deceive fingerprinting scripts. Enabled by default, must be enabled for other anti-fingerprinting features to work. Helium flag.",
|
||||
kOsAll, FEATURE_VALUE_TYPE(blink::features::kHeliumNoise)},
|
||||
+ {helium::kHeliumNoiseCanvasCommandLine,
|
||||
+ "[Helium Noise] Canvas pixel noising",
|
||||
+ "Adds insignificant noise to canvas pixels during readback to deceive canvas-based fingerprinting. Helium flag.",
|
||||
+ kOsAll, FEATURE_VALUE_TYPE(blink::features::kHeliumNoiseCanvas)},
|
||||
#endif /* CHROME_BROWSER_HELIUM_FLAG_ENTRIES_H_ */
|
||||
--- a/third_party/blink/common/features.cc
|
||||
+++ b/third_party/blink/common/features.cc
|
||||
@@ -43,6 +43,10 @@ const base::FeatureParam<std::string> kS
|
||||
BASE_FEATURE(kHeliumNoise,
|
||||
base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
+// Canvas noise for fingerprinting protection.
|
||||
+BASE_FEATURE(kHeliumNoiseCanvas,
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+
|
||||
// Controls whether to include information about the page's open popup in
|
||||
// AIPageContent.
|
||||
BASE_FEATURE(kAIPageContentIncludePopupWindows,
|
||||
--- a/third_party/blink/public/common/features.h
|
||||
+++ b/third_party/blink/public/common/features.h
|
||||
@@ -41,6 +41,7 @@ BLINK_COMMON_EXPORT extern const base::F
|
||||
// on the identifier name of the generated feature.
|
||||
|
||||
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumNoise);
|
||||
+BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kHeliumNoiseCanvas);
|
||||
|
||||
// Controls whether to include information about the page's open popup in
|
||||
// AIPageContent.
|
||||
--- /dev/null
|
||||
+++ b/third_party/blink/renderer/core/helium_noise/canvas_noising_helper.cc
|
||||
@@ -0,0 +1,258 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+// -----------------------------------------------------------------------
|
||||
+// Copyright 2025 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/helium_noise/canvas_noising_helper.h"
|
||||
+
|
||||
+#include <algorithm>
|
||||
+#include <array>
|
||||
+#include <cstddef>
|
||||
+#include <cstdint>
|
||||
+#include <vector>
|
||||
+
|
||||
+#include "base/check_op.h"
|
||||
+#include "base/containers/span.h"
|
||||
+#include "base/containers/span_writer.h"
|
||||
+#include "base/memory/scoped_refptr.h"
|
||||
+#include "base/numerics/byte_conversions.h"
|
||||
+#include "base/numerics/safe_conversions.h"
|
||||
+#include "third_party/blink/public/common/features.h"
|
||||
+#include "third_party/blink/renderer/core/execution_context/execution_context.h"
|
||||
+#include "third_party/blink/renderer/core/helium_noise/helium_noise_hash.h"
|
||||
+#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
|
||||
+#include "third_party/blink/renderer/platform/graphics/unaccelerated_static_bitmap_image.h"
|
||||
+#include "third_party/skia/include/core/SkBitmap.h"
|
||||
+#include "third_party/skia/include/core/SkImageInfo.h"
|
||||
+#include "ui/gfx/skia_span_util.h"
|
||||
+
|
||||
+namespace blink {
|
||||
+
|
||||
+namespace {
|
||||
+
|
||||
+constexpr uint8_t kNearbyPixelMaxOffset = 2u;
|
||||
+constexpr int kMaxSharedRgbNoise = 1;
|
||||
+constexpr int kMaxIndependentRgbNoise = 1;
|
||||
+constexpr int kMaxAlphaNoise = 1;
|
||||
+constexpr uint8_t kChannelsPerPixel = 4u;
|
||||
+constexpr std::array<uint8_t, 4u> kEmptyPixel({0, 0, 0, 0});
|
||||
+
|
||||
+struct PixelLocation {
|
||||
+ int x;
|
||||
+ int y;
|
||||
+};
|
||||
+
|
||||
+void ClampPixelLocation(PixelLocation* location,
|
||||
+ const int width,
|
||||
+ const int height) {
|
||||
+ CHECK(width >= 1 && height >= 1);
|
||||
+ location->x = std::min(std::max(0, location->x), width - 1);
|
||||
+ location->y = std::min(std::max(0, location->y), height - 1);
|
||||
+}
|
||||
+
|
||||
+// Returns two random pixel locations; one close to the offset and one
|
||||
+// randomly selected from the entire canvas.
|
||||
+std::pair<PixelLocation, PixelLocation> GetRandomPixelLocations(
|
||||
+ HeliumNoiseHash& token_hash,
|
||||
+ const PixelLocation offset,
|
||||
+ const int width,
|
||||
+ const int height) {
|
||||
+ std::pair<PixelLocation, PixelLocation> pixel_locations;
|
||||
+ // Uses at most 2 * bit_width(kNearbyPixelMaxOffset * 2) bits from hash.
|
||||
+ pixel_locations.first = {
|
||||
+ offset.x + token_hash.GetValueBelow(kNearbyPixelMaxOffset * 2) -
|
||||
+ kNearbyPixelMaxOffset + 1,
|
||||
+ offset.y + token_hash.GetValueBelow(kNearbyPixelMaxOffset * 2) -
|
||||
+ kNearbyPixelMaxOffset + 1};
|
||||
+ // x and y might be negative or go beyond the width or height here, so we need
|
||||
+ // to clamp them.
|
||||
+ ClampPixelLocation(&pixel_locations.first, width, height);
|
||||
+ // Uses at most bit_width(width) + bit_width(height) bits from hash.
|
||||
+ pixel_locations.second = {token_hash.GetValueBelow(width),
|
||||
+ token_hash.GetValueBelow(height)};
|
||||
+ // Uses at most 32 bits from hash.
|
||||
+ return pixel_locations;
|
||||
+}
|
||||
+
|
||||
+int GetSignedNoiseValue(HeliumNoiseHash& token_hash, int max_abs_noise) {
|
||||
+ if (max_abs_noise <= 0) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ return token_hash.GetValueBelow(max_abs_noise * 2 + 1) - max_abs_noise;
|
||||
+}
|
||||
+
|
||||
+void HeliumNoisePixel(base::span<uint8_t> pixel, HeliumNoiseHash& token_hash) {
|
||||
+ base::SpanWriter writer(base::as_writable_bytes(pixel));
|
||||
+ const int shared_rgb_noise =
|
||||
+ GetSignedNoiseValue(token_hash, kMaxSharedRgbNoise);
|
||||
+ for (int i = 0; i < kChannelsPerPixel; ++i) {
|
||||
+ int channel_value = pixel[i];
|
||||
+
|
||||
+ const bool is_alpha = i == kChannelsPerPixel - 1;
|
||||
+
|
||||
+ // Keep alpha limits stable.
|
||||
+ if (is_alpha && (channel_value == 0 || channel_value == 255)) {
|
||||
+ writer.WriteU8LittleEndian(base::checked_cast<uint8_t>(channel_value));
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ const int maxNoisePerChannel =
|
||||
+ is_alpha ? kMaxAlphaNoise
|
||||
+ : kMaxSharedRgbNoise + kMaxIndependentRgbNoise;
|
||||
+
|
||||
+ // Clamp min- and maxNoisedVal to [0, 255] and [1, 255] for the alpha
|
||||
+ // channel if it was non-zero before.
|
||||
+ const int lowerLimit = (is_alpha && channel_value > 0) ? 1 : 0;
|
||||
+ int minNoisedVal = std::max(lowerLimit, channel_value - maxNoisePerChannel);
|
||||
+ int maxNoisedVal = std::min(255, channel_value + maxNoisePerChannel);
|
||||
+
|
||||
+ int noise = 0;
|
||||
+ if (is_alpha) {
|
||||
+ noise = GetSignedNoiseValue(token_hash, kMaxAlphaNoise);
|
||||
+ } else {
|
||||
+ noise = shared_rgb_noise +
|
||||
+ GetSignedNoiseValue(token_hash, kMaxIndependentRgbNoise);
|
||||
+ }
|
||||
+
|
||||
+ const int noised_value =
|
||||
+ std::clamp(channel_value + noise, minNoisedVal, maxNoisedVal);
|
||||
+ writer.WriteU8LittleEndian(base::checked_cast<uint8_t>(noised_value));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+base::span<uint8_t, 4u> GetPixelAt(const int x,
|
||||
+ const int y,
|
||||
+ const int width,
|
||||
+ const base::span<uint8_t> pixels) {
|
||||
+ return pixels
|
||||
+ .subspan(static_cast<size_t>((x + y * width) * kChannelsPerPixel))
|
||||
+ .first<4u>();
|
||||
+}
|
||||
+
|
||||
+base::span<const uint8_t, 4u> GetPixelAt(
|
||||
+ const int x,
|
||||
+ const int y,
|
||||
+ const int width,
|
||||
+ const base::span<const uint8_t> pixels) {
|
||||
+ return pixels
|
||||
+ .subspan(static_cast<size_t>((x + y * width) * kChannelsPerPixel))
|
||||
+ .first<4u>();
|
||||
+}
|
||||
+
|
||||
+uint64_t GetValueFromPixelLocations(
|
||||
+ const std::pair<PixelLocation, PixelLocation> locations,
|
||||
+ const base::span<const uint8_t> pixels,
|
||||
+ int width) {
|
||||
+ uint64_t result = 0u;
|
||||
+ result |= base::U32FromLittleEndian(
|
||||
+ GetPixelAt(locations.first.x, locations.first.y, width, pixels));
|
||||
+ result <<= 32u;
|
||||
+ result |= base::U32FromLittleEndian(
|
||||
+ GetPixelAt(locations.second.x, locations.second.y, width, pixels));
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
+void CopyPixelValue(const base::span<const uint8_t> from_pixel,
|
||||
+ base::span<uint8_t> to_pixel) {
|
||||
+ base::SpanWriter writer(base::as_writable_bytes(to_pixel));
|
||||
+ writer.Write(from_pixel.first<kChannelsPerPixel>());
|
||||
+}
|
||||
+
|
||||
+// Adds noise to the provided pixels in place, using |token_hash| as the
|
||||
+// source for pseudo-randomness. This function assumes that there are 4
|
||||
+// channels per pixel.
|
||||
+void HeliumNoisePixels(const HeliumNoiseHash& token_hash,
|
||||
+ base::span<uint8_t> pixels,
|
||||
+ const int width,
|
||||
+ const int height) {
|
||||
+ CHECK_EQ(pixels.size(),
|
||||
+ static_cast<size_t>(width * height * kChannelsPerPixel));
|
||||
+
|
||||
+ std::vector<uint8_t> source_pixel_storage(pixels.begin(), pixels.end());
|
||||
+ base::span<const uint8_t> source_pixels(source_pixel_storage);
|
||||
+
|
||||
+ for (int y = 0; y < height; ++y) {
|
||||
+ for (int x = 0; x < width; ++x) {
|
||||
+ auto source_pixel = GetPixelAt(x, y, width, source_pixels);
|
||||
+ if (source_pixel == kEmptyPixel) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ auto pixel = GetPixelAt(x, y, width, pixels);
|
||||
+ CopyPixelValue(source_pixel, pixel);
|
||||
+
|
||||
+ HeliumNoiseHash hash_copy = token_hash;
|
||||
+ hash_copy.Update((static_cast<uint64_t>(y) << 32) |
|
||||
+ static_cast<uint32_t>(x));
|
||||
+ hash_copy.Update(base::U32FromLittleEndian(source_pixel));
|
||||
+ // GetRandomPixelLocations consumes at most 32 bits from hash.
|
||||
+ const std::pair<PixelLocation, PixelLocation> other_pixels =
|
||||
+ GetRandomPixelLocations(hash_copy, {x, y}, width, height);
|
||||
+ hash_copy.Update(
|
||||
+ GetValueFromPixelLocations(other_pixels, source_pixels, width));
|
||||
+ HeliumNoisePixel(pixel, hash_copy);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
+// static
|
||||
+bool CanvasNoisingHelper::MaybeNoiseSnapshot(
|
||||
+ ExecutionContext* execution_context,
|
||||
+ scoped_refptr<StaticBitmapImage>& snapshot) {
|
||||
+ CHECK(snapshot);
|
||||
+
|
||||
+ if (!base::FeatureList::IsEnabled(
|
||||
+ blink::features::kHeliumNoiseCanvas)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ // Check if execution context exists and has a canvas noise token
|
||||
+ if (!execution_context ||
|
||||
+ !execution_context->GetHeliumNoiseTokens().contains(
|
||||
+ HeliumNoiseFeature::kCanvas)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ // Use kUnpremul_SkAlphaType as alpha type as we are changing the pixel values
|
||||
+ // of all channels, including the alpha channel.
|
||||
+ auto info = SkImageInfo::Make(
|
||||
+ snapshot->GetSize().width(), snapshot->GetSize().height(),
|
||||
+ viz::ToClosestSkColorType(snapshot->GetSharedImageFormat()),
|
||||
+ kUnpremul_SkAlphaType, snapshot->GetColorSpace().ToSkColorSpace());
|
||||
+ SkBitmap bm;
|
||||
+ if (!bm.tryAllocPixels(info)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ // Copy the original pixels from snapshot to the modifiable SkPixmap. SkBitmap
|
||||
+ // should already allocate the correct amount of pixels, so this shouldn't
|
||||
+ // fail because of memory allocation.
|
||||
+ auto pixmap_to_noise = bm.pixmap();
|
||||
+ PaintImage paint_image = snapshot->PaintImageForCurrentFrame();
|
||||
+ if (!paint_image.readPixels(bm.info(), pixmap_to_noise.writable_addr(),
|
||||
+ bm.rowBytes(), 0, 0)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ base::span<uint8_t> modify_pixels =
|
||||
+ gfx::SkPixmapToWritableSpan(pixmap_to_noise);
|
||||
+
|
||||
+ auto token_hash =
|
||||
+ HeliumNoiseHash(execution_context->GetHeliumNoiseTokens().at(
|
||||
+ HeliumNoiseFeature::kCanvas));
|
||||
+
|
||||
+ HeliumNoisePixels(token_hash, modify_pixels, pixmap_to_noise.width(),
|
||||
+ pixmap_to_noise.height());
|
||||
+
|
||||
+ auto noised_image = bm.asImage();
|
||||
+ snapshot = blink::UnacceleratedStaticBitmapImage::Create(
|
||||
+ std::move(noised_image), snapshot->Orientation());
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+} // namespace blink
|
||||
--- /dev/null
|
||||
+++ b/third_party/blink/renderer/core/helium_noise/canvas_noising_helper.h
|
||||
@@ -0,0 +1,31 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+// -----------------------------------------------------------------------
|
||||
+// Copyright 2025 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_HELIUM_NOISE_CANVAS_NOISING_HELPER_H_
|
||||
+#define THIRD_PARTY_BLINK_RENDERER_CORE_HELIUM_NOISE_CANVAS_NOISING_HELPER_H_
|
||||
+
|
||||
+#include "third_party/blink/renderer/core/core_export.h"
|
||||
+#include "third_party/blink/renderer/core/execution_context/execution_context.h"
|
||||
+#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
|
||||
+
|
||||
+namespace blink {
|
||||
+
|
||||
+class CORE_EXPORT CanvasNoisingHelper {
|
||||
+ public:
|
||||
+ // If allowed, performs noising on a copy of the snapshot StaticBitmapImage
|
||||
+ // and modifies it in place. Returns true if noise was applied.
|
||||
+ static bool MaybeNoiseSnapshot(ExecutionContext* execution_context,
|
||||
+ scoped_refptr<StaticBitmapImage>& snapshot);
|
||||
+
|
||||
+ private:
|
||||
+ CanvasNoisingHelper() = delete;
|
||||
+};
|
||||
+
|
||||
+} // namespace blink
|
||||
+
|
||||
+#endif // THIRD_PARTY_BLINK_RENDERER_CORE_HELIUM_NOISE_CANVAS_NOISING_HELPER_H_
|
||||
--- a/third_party/blink/renderer/core/helium_noise/build.gni
|
||||
+++ b/third_party/blink/renderer/core/helium_noise/build.gni
|
||||
@@ -5,4 +5,6 @@
|
||||
blink_core_sources_helium_noise = [
|
||||
"helium_noise_hash.cc",
|
||||
"helium_noise_hash.h",
|
||||
+ "canvas_noising_helper.cc",
|
||||
+ "canvas_noising_helper.h",
|
||||
]
|
||||
--- a/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
|
||||
+++ b/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
|
||||
@@ -72,6 +72,7 @@
|
||||
#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/geometry/dom_matrix.h"
|
||||
+#include "third_party/blink/renderer/core/helium_noise/canvas_noising_helper.h"
|
||||
#include "third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.h"
|
||||
#include "third_party/blink/renderer/core/html/canvas/canvas_context_creation_attributes_core.h"
|
||||
#include "third_party/blink/renderer/core/html/canvas/canvas_draw_listener.h"
|
||||
@@ -1313,6 +1314,9 @@ String HTMLCanvasElement::ToDataURLInter
|
||||
|
||||
scoped_refptr<StaticBitmapImage> image_bitmap = Snapshot(source_buffer);
|
||||
if (image_bitmap) {
|
||||
+ CanvasNoisingHelper::MaybeNoiseSnapshot(GetExecutionContext(),
|
||||
+ image_bitmap);
|
||||
+
|
||||
std::unique_ptr<ImageDataBuffer> data_buffer =
|
||||
ImageDataBuffer::Create(image_bitmap);
|
||||
if (!data_buffer)
|
||||
@@ -1424,6 +1428,9 @@ void HTMLCanvasElement::toBlob(V8BlobCal
|
||||
CanvasAsyncBlobCreator* async_creator = nullptr;
|
||||
scoped_refptr<StaticBitmapImage> image_bitmap = Snapshot(kBackBuffer);
|
||||
if (image_bitmap) {
|
||||
+ CanvasNoisingHelper::MaybeNoiseSnapshot(GetExecutionContext(),
|
||||
+ image_bitmap);
|
||||
+
|
||||
auto* options = ImageEncodeOptions::Create();
|
||||
options->setType(ImageEncoderUtils::MimeTypeName(encoding_mime_type));
|
||||
async_creator = MakeGarbageCollected<CanvasAsyncBlobCreator>(
|
||||
--- a/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc
|
||||
+++ b/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "third_party/blink/renderer/core/fileapi/blob.h"
|
||||
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
|
||||
#include "third_party/blink/renderer/core/frame/local_frame.h"
|
||||
+#include "third_party/blink/renderer/core/helium_noise/canvas_noising_helper.h"
|
||||
#include "third_party/blink/renderer/core/html/canvas/canvas_async_blob_creator.h"
|
||||
#include "third_party/blink/renderer/core/html/canvas/canvas_context_creation_attributes_core.h"
|
||||
#include "third_party/blink/renderer/core/html/canvas/canvas_rendering_context.h"
|
||||
@@ -335,11 +336,13 @@ ScriptPromise<Blob> OffscreenCanvas::con
|
||||
base::TimeTicks start_time = base::TimeTicks::Now();
|
||||
scoped_refptr<StaticBitmapImage> image_bitmap = context_->GetImage();
|
||||
if (image_bitmap) {
|
||||
+ auto* execution_context = ExecutionContext::From(script_state);
|
||||
+ CanvasNoisingHelper::MaybeNoiseSnapshot(execution_context, image_bitmap);
|
||||
+
|
||||
auto* resolver = MakeGarbageCollected<ScriptPromiseResolver<Blob>>(
|
||||
script_state, exception_state.GetContext());
|
||||
CanvasAsyncBlobCreator::ToBlobFunctionType function_type =
|
||||
CanvasAsyncBlobCreator::kOffscreenCanvasConvertToBlobPromise;
|
||||
- auto* execution_context = ExecutionContext::From(script_state);
|
||||
auto* async_creator = MakeGarbageCollected<CanvasAsyncBlobCreator>(
|
||||
image_bitmap, options, function_type, start_time, execution_context,
|
||||
resolver);
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user