Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e215c18dc6 |
@@ -1,14 +0,0 @@
|
||||
{{ range .Versions }}
|
||||
<a name="{{ .Tag.Name }}"></a>
|
||||
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})
|
||||
|
||||
{{ range .Commits -}}
|
||||
{{ if not (contains .Type "[") }}- {{.Hash.Short}} {{ .Subject }}
|
||||
{{ if not (eq (len .Body) 0) }}{{ .Body }}{{ end }}
|
||||
{{ range .Refs -}}
|
||||
{{ " " }} - #{{ .Ref }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ end -}}
|
||||
@@ -1,20 +0,0 @@
|
||||
style: github
|
||||
template: CHANGELOG.tpl.md
|
||||
info:
|
||||
title: CHANGELOG
|
||||
repository_url: https://github.com/uazo/cromite
|
||||
options:
|
||||
commits:
|
||||
filters:
|
||||
Type:
|
||||
- "[AUTO]"
|
||||
commit_groups:
|
||||
# title_maps: []
|
||||
header:
|
||||
pattern: "^(\\[.*\\])?(.*)$"
|
||||
pattern_maps:
|
||||
- Type
|
||||
- Subject
|
||||
notes:
|
||||
keywords:
|
||||
- BREAKING CHANGE
|
||||
@@ -1,5 +0,0 @@
|
||||
[*.{yaml,sh,gn_args}]
|
||||
tab_width = 2
|
||||
indent_size = 2
|
||||
end_of_line = crlf
|
||||
indent_style = space
|
||||
@@ -1,2 +0,0 @@
|
||||
*.zip binary
|
||||
*.pdf binary
|
||||
@@ -0,0 +1,4 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
liberapay: csagan5
|
||||
custom: https://www.bromite.org/#donate
|
||||
@@ -0,0 +1,89 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a Bromite bug report
|
||||
|
||||
---
|
||||
|
||||
<!-- Welcome! Thanks for taking time to submit a bug report.
|
||||
Have you read the README? https://github.com/bromite/bromite/blob/master/README.md
|
||||
Have you searched the issue tracker? https://github.com/bromite/bromite/issues
|
||||
Are you sure this is not a Chromium bug? You have to test with Chromium before submitting a bug.
|
||||
Are you using the latest version of Bromite?
|
||||
|
||||
If instead of a bug report you want to ask a question then please use the GitHub Discussions: https://github.com/bromite/bromite/discussions
|
||||
-->
|
||||
|
||||
### Bromite version
|
||||
|
||||
Version: `89.0...`
|
||||
Arch: `arm` or `arm64` or `x86`
|
||||
Android version: (example: `9.0`)
|
||||
Device model: (example: `SM-G960UZKABST`)
|
||||
|
||||
### Flags
|
||||
|
||||
These are the flags changed under `chrome://flags`:
|
||||
|
||||
<!-- Report all the blue-highlighted flags here, those are the flags with non-default configuration -->
|
||||
|
||||
### Is this bug about the SystemWebView?
|
||||
|
||||
<!-- No support for SystemWebView installations is provided. -->
|
||||
|
||||
Yes/No
|
||||
|
||||
### Is the bug reproducible with latest version?
|
||||
|
||||
<!-- Do not report bugs which are not reproducible with latest version. -->
|
||||
|
||||
Yes/No
|
||||
|
||||
### Can the bug be reproduced with corresponding Chromium version?
|
||||
|
||||
<!--
|
||||
Please pick the same version of Chromium as Bromite from here: https://github.com/bromite/chromium/releases
|
||||
If the bug is reproducible then it might be a configuration issue or an upstream bug. Upstream bugs can be reported on the [Chromium issue tracker](https://bugs.chromium.org/p/chromium/issues/list) and do not forget to read [Chromium project bug reporting guidelines](https://www.chromium.org/for-testers/bug-reporting-guidelines) first.
|
||||
|
||||
If the bug is related to functionality that does not exist in Chromium then answer "No".
|
||||
-->
|
||||
|
||||
Yes/No
|
||||
|
||||
### Is this bug happening in an incognito tab?
|
||||
Yes/No
|
||||
|
||||
### Allow ads for the site; is the bug caused by the adblocker?
|
||||
Yes/No
|
||||
|
||||
### Is the bug a crash?
|
||||
|
||||
No
|
||||
|
||||
-- or --
|
||||
|
||||
Yes, this is the crash dump:
|
||||
```
|
||||
<paste here logcat dump individuated with 'adb logcat | grep chromium'>
|
||||
```
|
||||
|
||||
### Describe the bug
|
||||
|
||||
<!-- Write here a clear and concise description of the bug. -->
|
||||
|
||||
### Steps to reproduce the bug
|
||||
|
||||
Steps to reproduce the bug:
|
||||
1. Go to '...'
|
||||
2. Click on '...'
|
||||
3. Scroll down to '...'
|
||||
4. See error
|
||||
|
||||
Do not write "any website", specify which URLs can be used to reproduce the issue.
|
||||
|
||||
### Expected behavior
|
||||
|
||||
<!-- A clear and concise description of what you expected to happen. -->
|
||||
|
||||
### Screenshots
|
||||
|
||||
<!-- If applicable, add screenshots to help explain your problem. Otherwise remove this section. -->
|
||||
@@ -1,231 +0,0 @@
|
||||
name: Bug report
|
||||
description: Create a Cromite bug report
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Welcome! Thanks for taking the time to submit a bug report.
|
||||
|
||||
If this is not a bug about the Cromite browser, or you are looking for a place to ask a question to the community,
|
||||
then please use the [GitHub Discussions](https://github.com/uazo/cromite/discussions) instead.
|
||||
|
||||
Make sure you have acknowledged and completed this template before submitting your issue.
|
||||
|
||||
Please read it carefully: incorrect issues will be automatically closed and ignored.
|
||||
|
||||
- type: checkboxes
|
||||
id: preliminary_checklist
|
||||
attributes:
|
||||
label: Preliminary checklist
|
||||
options:
|
||||
- label: "I have read the [README](https://github.com/uazo/cromite/blob/master/README.md)."
|
||||
required: true
|
||||
- label: "I have searched the existing issues for my problem. This is a new ticket, NOT a duplicate or related to another open issue."
|
||||
required: true
|
||||
- label: "I have read the [FAQs](https://github.com/uazo/cromite/blob/master/docs/FAQ.md)."
|
||||
required: true
|
||||
- label: "I have updated Cromite to the latest version. The bug is reproducible on this latest version."
|
||||
required: true
|
||||
- label: "This is a bug report about the Cromite browser; not the website nor F-Droid nor anything else."
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: is_chromium
|
||||
attributes:
|
||||
label: Can the bug be reproduced with corresponding Chromium version?
|
||||
description: |
|
||||
Please pick the same version of Chromium as Cromite
|
||||
If the bug is reproducible then it might be a configuration issue or an upstream bug. Upstream bugs can be reported on the [Chromium issue tracker](https://bugs.chromium.org/p/chromium/issues/list) and
|
||||
do not forget to read [Chromium project bug reporting guidelines](https://www.chromium.org/for-testers/bug-reporting-guidelines) first.
|
||||
|
||||
If the bug is related to functionality that does not exist in Chromium then answer "No".
|
||||
multiple: false
|
||||
options:
|
||||
- "Yes"
|
||||
- "No"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: is_chromium2
|
||||
attributes:
|
||||
label: Are you sure?
|
||||
description: |
|
||||
Please check your answer above again, it is important information
|
||||
|
||||
If the bug is related to functionality that does not exist in Chromium then answer "No".
|
||||
multiple: false
|
||||
options:
|
||||
- "Yes"
|
||||
- "No"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: cromite_version
|
||||
attributes:
|
||||
label: Cromite version
|
||||
description: What version of Cromite are you using? Please specify a single version e.g. `96.0.4664.1` not `latest`. If this is not the latest version then please update and retry before submitting this bug report.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: device_architecture
|
||||
attributes:
|
||||
label: Device architecture
|
||||
multiple: false
|
||||
options:
|
||||
- arm
|
||||
- arm64
|
||||
- arm64-v8a
|
||||
- armeabi-v7a
|
||||
- x86
|
||||
- x64
|
||||
- windows
|
||||
- all
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: platform_version
|
||||
attributes:
|
||||
label: Platform version
|
||||
multiple: false
|
||||
description: What version of Android are you running?
|
||||
options:
|
||||
- Android 15
|
||||
- Android 14
|
||||
- Android 13
|
||||
- Android 12.1
|
||||
- Android 12
|
||||
- Android 11
|
||||
- Android 10
|
||||
- Android 9
|
||||
- Android 8.1
|
||||
- Android 8.0
|
||||
- Android 7.1
|
||||
- Android 7.0
|
||||
- Android Emulator
|
||||
- Windows 10
|
||||
- Windows 11
|
||||
- I prefer not to write it/No matter
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: device_model
|
||||
attributes:
|
||||
label: Android Device model
|
||||
description: What is your device model? This can usually be found in your device's settings in the "About" section.
|
||||
placeholder: (e.g. `OnePlus 8 (IN2010)`, or `SM-G960UZKABST`, etc.)
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: is_android_rooted
|
||||
attributes:
|
||||
label: Is the device rooted?
|
||||
description: |
|
||||
The information is important but not essential; it allows additional checks to be made.
|
||||
multiple: false
|
||||
options:
|
||||
- "Yes"
|
||||
- "No"
|
||||
- "I prefer not to write it"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: changed_flags
|
||||
attributes:
|
||||
label: Changed flags
|
||||
description: |
|
||||
These are the flags changed under `chrome://flags`.
|
||||
Report all the flags with non-default configuration (they will be blue-highlighted).
|
||||
|
||||
If no flags are changed then write 'no flags changed'.
|
||||
placeholder: show-overdraw-feedback, enable-parallel-downloading
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: is_incognito
|
||||
attributes:
|
||||
label: Is this bug happening ONLY in an incognito tab?
|
||||
multiple: false
|
||||
options:
|
||||
- "Yes"
|
||||
- "No"
|
||||
- "Always Incognito Mode"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: adblock
|
||||
attributes:
|
||||
label: Is this bug caused by the adblocker?
|
||||
description: You can test this by temporarily allowing ads for the site.
|
||||
multiple: false
|
||||
options:
|
||||
- "Yes"
|
||||
- "No"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: bug_crash
|
||||
attributes:
|
||||
label: Is this bug a crash?
|
||||
description: |
|
||||
1. No.
|
||||
2. Yes, I have attached the crash report dump that I downloaded from `chrome://crashes`
|
||||
3. Yes, I have copy/pasted the crash dump
|
||||
placeholder: |
|
||||
Drag the crash report dump here to attach it or paste the logcat dump individuated with `adb logcat | grep -E '( cr_|cromite|chromium)'`.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: bug_description
|
||||
attributes:
|
||||
label: Describe the bug
|
||||
description: Write a clear and concise description of the bug.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: bug_steps
|
||||
attributes:
|
||||
label: Steps to reproduce the bug
|
||||
description: |
|
||||
Explain how to cause the bug as clearly as possible. Bugs that are not reproducible cannot be investigated.
|
||||
|
||||
Also, do not write "any website": please specify which URLs can be used to reproduce the issue.
|
||||
placeholder: |
|
||||
Steps to reproduce the bug (e.g.):
|
||||
1. Go to '...'
|
||||
2. Click on '...'
|
||||
3. Scroll down to '...'
|
||||
4. See error
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: expected_behavior
|
||||
attributes:
|
||||
label: Expected behavior
|
||||
description: A clear and concise description of what you expected to happen.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: screenshots
|
||||
attributes:
|
||||
label: Screenshots
|
||||
description: |
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
Otherwise, ignore this section.
|
||||
placeholder: |
|
||||
Drag the screenshot files here to attach them.
|
||||
validations:
|
||||
required: false
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a privacy-related idea for this project
|
||||
|
||||
---
|
||||
|
||||
<!-- Welcome! Thanks for taking time to submit a feature request.
|
||||
Have you searched the issue tracker? https://github.com/bromite/bromite/issues
|
||||
Have you read the F.A.Q.s? https://github.com/bromite/bromite/blob/master/FAQ.md
|
||||
Have you read the README? https://github.com/bromite/bromite/blob/master/README.md
|
||||
Have you read the Wiki? https://github.com/bromite/bromite/wiki
|
||||
|
||||
If instead of a feature request you want to ask a question then please use the GitHub Discussions: https://github.com/bromite/bromite/discussions
|
||||
|
||||
-->
|
||||
|
||||
<!-- Do not submit feature requests for extensions support or adding a search engine. -->
|
||||
|
||||
### Is your feature request related to privacy?
|
||||
|
||||
<!-- Features that are not related to privacy are not considered. -->
|
||||
|
||||
### Is there a patch available for this feature somewhere?
|
||||
|
||||
<!-- If yes then provide URL and license information. -->
|
||||
|
||||
### Describe the solution you would like
|
||||
|
||||
<!-- A clear and concise description of what you want to happen.
|
||||
|
||||
Do not ask "I would like feature X which is available in browser Y"; such issues are closed immediately. -->
|
||||
|
||||
### Describe alternatives you have considered
|
||||
|
||||
<!-- A clear and concise description of any alternative solutions or features you have considered. -->
|
||||
@@ -1,69 +0,0 @@
|
||||
name: Feature request
|
||||
description: Create a Cromite feature request
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Welcome! Thanks for taking time to submit a feature request.
|
||||
|
||||
If this is not a feature request about the Cromite browser, or you are looking for a place
|
||||
to ask a question to the community then please use the [GitHub Discussions](https://github.com/uazo/cromite/discussions) instead.
|
||||
|
||||
Make sure you have acknowledged and completed this template before submitting your issue.
|
||||
|
||||
Please read it carefully: incorrect issues will be automatically closed and ignored.
|
||||
|
||||
Note:
|
||||
- Features unrelated to privacy will not be considered.
|
||||
- Do not ask "I would like feature X which is available in browser Y."
|
||||
|
||||
- type: checkboxes
|
||||
id: preliminary_checklist
|
||||
attributes:
|
||||
label: Preliminary checklist
|
||||
options:
|
||||
- label: "I have read the [README](https://github.com/uazo/cromite/blob/master/README.md)"
|
||||
required: true
|
||||
- label: "I have searched [existing issues](https://github.com/uazo/cromite/issues) for my feature request. This is a new issue (NOT a duplicate) and is not related to another issue."
|
||||
required: true
|
||||
- label: "I have searched [wont fix issues](https://github.com/uazo/cromite/issues?q=label%3Awontfix) and this request is not among them"
|
||||
required: true
|
||||
- label: "This is a feature request for the Cromite browser; not the website nor F-Droid nor anything else."
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: is_privacy_related
|
||||
attributes:
|
||||
label: Is your feature request related to privacy?
|
||||
description: Features that are not related to privacy are not considered.
|
||||
multiple: false
|
||||
options:
|
||||
- "<please select>"
|
||||
- "Yes"
|
||||
- "No"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: is_patch_available
|
||||
attributes:
|
||||
label: Is there a patch available for this feature somewhere?
|
||||
description: If yes please provide URL and related license information.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: solution_description
|
||||
attributes:
|
||||
label: Describe the solution you would like
|
||||
description: A clear and concise description of what you want to happen.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: alternatives_considered
|
||||
attributes:
|
||||
label: Describe alternatives you have considered
|
||||
description: A clear and concise description of any alternative solutions or features you have considered.
|
||||
validations:
|
||||
required: true
|
||||
@@ -1,15 +0,0 @@
|
||||
## Description
|
||||
|
||||
*Please explain here what feature or bugfix these changes are addressing and why they should be included*
|
||||
|
||||
## All submissions
|
||||
|
||||
* [ ] there are no other open [Pull Requests](../../../pulls) for the same update/change
|
||||
* [ ] Bromite can be built with these changes
|
||||
* [ ] I have tested that the new change works as intended (AVD or physical device will do)
|
||||
|
||||
### Format
|
||||
|
||||
* [ ] patch subject and filename match (e.g. `Subject: Alternative cache (NIK-based)` -> `Alternative-cache-NIK-based.patch`)
|
||||
* [ ] patch description contains explanation of changes
|
||||
* [ ] no unnecessary whitespace or unrelated changes
|
||||
@@ -1,229 +0,0 @@
|
||||
permissions:
|
||||
actions: none
|
||||
checks: none
|
||||
contents: none
|
||||
deployments: none
|
||||
issues: write
|
||||
packages: none
|
||||
pull-requests: none
|
||||
repository-projects: none
|
||||
security-events: none
|
||||
statuses: none
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'chromium version'
|
||||
required: false
|
||||
default: ''
|
||||
type:
|
||||
description: 'runner?'
|
||||
required: false
|
||||
default: 'ubuntu-latest'
|
||||
schedule:
|
||||
- cron: '0 1 * * *'
|
||||
|
||||
env:
|
||||
CHR_VERSION: ${{ github.event.inputs.version }}
|
||||
NEW_VERSION: ${{ null }}
|
||||
|
||||
name: Builds and pushes tagged image to DockerHub
|
||||
jobs:
|
||||
generate_build_deps:
|
||||
name: Generate Build Deps
|
||||
runs-on: ${{ fromJSON( format('["ubuntu-latest", "{0}"]', github.event.inputs.type) )[github.event.inputs.type != ''] }}
|
||||
steps:
|
||||
- name: Reclaiming disk space on / by removing dotnet/android/ghc
|
||||
#if: ${{ github.event.inputs.type == '' }}
|
||||
run: |
|
||||
df -h
|
||||
|
||||
DIR=/usr/share/dotnet && sudo rm -rf $DIR
|
||||
DIR=/usr/local/lib/android && sudo rm -rf $DIR
|
||||
DIR=/opt/ghc && sudo rm -rf $DIR
|
||||
DIR=/opt/hostedtoolcache/CodeQL && sudo rm -rf $DIR
|
||||
DIR=/usr/local/.ghcup && sudo rm -rf $DIR
|
||||
DIR=/usr/lib/jvm && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/local/julia1.10.5 && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/local/x86_64-linux-gnu && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/local/gcc && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/local/llvm-15 && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/local/llvm-14 && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/local/llvm-13 && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/local/heroku && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/share/swift && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/share/miniconda && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/share/az_12.1.0 && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/local/share/powershell && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/local/share/chromium && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/lib/gcc && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/lib/llvm-15 && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/lib/llvm-14 && test -d $DIR && sudo rm -rf $DIR
|
||||
DIR=/usr/lib/llvm-13 && test -d $DIR && sudo rm -rf $DIR
|
||||
|
||||
sudo apt-get remove google-cloud-cli azure-cli google-chrome-stable \
|
||||
firefox mysql-server-core-8.0 mono-devel podman \
|
||||
powershell || true
|
||||
sudo apt-get autoremove
|
||||
|
||||
df -h
|
||||
|
||||
- name: Enable proxy on container
|
||||
shell: bash
|
||||
if: ${{ github.event.inputs.type != '' && github.event.inputs.type != 'ubuntu-latest' }}
|
||||
run: |
|
||||
if ! [[ -z "${HTTP_PROXY}" ]]; then
|
||||
PROXY_ADDR=http://$(hostname -I | cut -d' ' -f1 | xargs):8118
|
||||
echo "PROXY_ADDR=$PROXY_ADDR" >> $GITHUB_ENV
|
||||
sudo iptables -D INPUT -p tcp -s localhost --dport 8118 -j ACCEPT
|
||||
sudo iptables -D INPUT -p tcp --dport 8118 -j DROP
|
||||
fi
|
||||
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: cromite
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Check versions
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -z $CHR_VERSION ]; then
|
||||
LATEST_WIN=$(curl -s 'https://versionhistory.googleapis.com/v1/chrome/platforms/win64/channels/stable/versions/all/releases' | jq -rc '.releases[].version' | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | tail -n 1)
|
||||
LATEST_ANDROID=$(curl -s 'https://versionhistory.googleapis.com/v1/chrome/platforms/android/channels/stable/versions/all/releases' | jq -rc '.releases[].version' | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | tail -n 1)
|
||||
CHR_VERSION=$(echo -e "$LATEST_ANDROID\n$LATEST_WIN" | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | tail -n 1)
|
||||
|
||||
echo "LATEST_WIN=$LATEST_WIN" >> $GITHUB_ENV
|
||||
echo "LATEST_ANDROID=$LATEST_ANDROID" >> $GITHUB_ENV
|
||||
echo "CHR_VERSION=$CHR_VERSION" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Download regctl
|
||||
shell: bash
|
||||
run: |
|
||||
curl -L https://github.com/regclient/regclient/releases/latest/download/regctl-linux-amd64 >regctl
|
||||
chmod 755 regctl
|
||||
|
||||
- name: Building build-deps container ${{ env.VERSION }}
|
||||
shell: bash
|
||||
run: |
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/build-deps:$CHR_VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
IS_PRESENT=$(./regctl image inspect uazo/build-deps:$CHR_VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
DOCKER_BUILDKIT=1 docker build -t uazo/build-deps:$CHR_VERSION \
|
||||
--progress plain \
|
||||
--build-arg VERSION=$CHR_VERSION \
|
||||
--build-arg HTTP_PROXY="$PROXY_ADDR" \
|
||||
--no-cache \
|
||||
cromite/tools/images/build-deps/.
|
||||
|
||||
docker push uazo/build-deps:$CHR_VERSION
|
||||
echo "NEW_VERSION=$CHR_VERSION" >> $GITHUB_ENV
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Building chromium container ${{ env.VERSION }}
|
||||
shell: bash
|
||||
run: |
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/chromium:$CHR_VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
IS_PRESENT=$(./regctl image inspect uazo/chromium:$CHR_VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
DOCKER_BUILDKIT=1 docker build -t uazo/chromium:$CHR_VERSION \
|
||||
--progress plain \
|
||||
--build-arg VERSION=$CHR_VERSION \
|
||||
--build-arg HTTP_PROXY="$PROXY_ADDR" \
|
||||
cromite/tools/images/chr-source/.
|
||||
|
||||
docker push uazo/chromium:$CHR_VERSION
|
||||
echo "NEW_VERSION=$CHR_VERSION" >> $GITHUB_ENV
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Update files under control
|
||||
shell: bash
|
||||
run: |
|
||||
cd cromite
|
||||
RELEASE=$(cat build/RELEASE | xargs)
|
||||
|
||||
cd tools/under-control
|
||||
|
||||
DO_UPDATE=0
|
||||
if [ -n "$NEW_VERSION" ]; then
|
||||
if [ "$RELEASE" != "$NEW_VERSION" ]; then
|
||||
DO_UPDATE=1
|
||||
fi
|
||||
|
||||
elif [ "$RELEASE" != "$(cat src/RELEASE | xargs)" ]; then
|
||||
DO_UPDATE=1
|
||||
NEW_VERSION=$RELEASE
|
||||
fi
|
||||
|
||||
if [[ DO_UPDATE -eq 1 ]]; then
|
||||
echo "Found new version $NEW_VERSION"
|
||||
echo "Under control: $(cat src/RELEASE | xargs)"
|
||||
echo "Current: $RELEASE"
|
||||
|
||||
test -d src && rm -rf src
|
||||
docker build --progress=plain --build-arg "TAG=$NEW_VERSION" -o . .
|
||||
echo $NEW_VERSION >src/RELEASE
|
||||
fi
|
||||
|
||||
CHANGES=0 && git diff --quiet || CHANGES=1
|
||||
echo "CHANGES=$CHANGES" >> $GITHUB_ENV
|
||||
if [[ CHANGES -eq 1 ]]; then
|
||||
git add src
|
||||
git diff --name-only --staged
|
||||
fi
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c #v6.1.0
|
||||
if: env.CHANGES == '1'
|
||||
with:
|
||||
token: ${{ secrets.CROMITE_PULLS }}
|
||||
path: cromite
|
||||
add-paths: |
|
||||
tools/under-control/*
|
||||
commit-message: '[AUTO][FILECONTROL] - version ${{ env.NEW_VERSION }}'
|
||||
title: '[AUTO][FILECONTROL] - version ${{ env.NEW_VERSION }}'
|
||||
body: ${{ env.MESSAGE }}
|
||||
delete-branch: true
|
||||
branch-suffix: short-commit-hash
|
||||
|
||||
- name: Create issue ${{ env.VERSION }}
|
||||
if: "${{ env.NEW_VERSION != '' }}"
|
||||
shell: bash
|
||||
run: |
|
||||
GH=../../gh_2.18.1_linux_amd64/bin/gh
|
||||
wget https://github.com/cli/cli/releases/download/v2.18.1/gh_2.18.1_linux_amd64.tar.gz
|
||||
tar xfz gh_2.18.1_linux_amd64.tar.gz
|
||||
|
||||
cd cromite/tools
|
||||
echo ${{ secrets.GITHUB_TOKEN }} | $GH auth login --with-token
|
||||
|
||||
echo Custom Release $CHR_VERSION >body.txt
|
||||
|
||||
if [[ "$LATEST_WIN" == "$CHR_VERSION" ]]; then
|
||||
echo Using Windows Release >body.txt
|
||||
echo "\`\`\`" >>body.txt
|
||||
curl -s 'https://chromiumdash.appspot.com/fetch_releases?channel=Stable&platform=Windows&num=10&offset=0' | \
|
||||
jq --arg LATEST "$LATEST_WIN" '.[] | select( .version == $LATEST )' >>body.txt
|
||||
echo "\`\`\`" >>body.txt
|
||||
fi
|
||||
|
||||
if [[ "$LATEST_ANDROID" == "$CHR_VERSION" ]]; then
|
||||
echo Using Android Release >body.txt
|
||||
echo "\`\`\`" >>body.txt
|
||||
curl -s 'https://chromiumdash.appspot.com/fetch_releases?channel=Stable&platform=Android&num=10&offset=0' | \
|
||||
jq --arg LATEST "$LATEST_ANDROID" '.[] | select( .version == $LATEST )' >>body.txt
|
||||
echo "\`\`\`" >>body.txt
|
||||
fi
|
||||
$GH issue create -t "$CHR_VERSION: new chromium version" -F body.txt
|
||||
@@ -1,46 +0,0 @@
|
||||
name: Build Sysbox
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
sha:
|
||||
description: 'Sysbox SHA'
|
||||
required: true
|
||||
default: ''
|
||||
|
||||
env:
|
||||
SYSBOX_SHA: ${{ github.event.inputs.sha }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: cromite
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Build patched sysbox
|
||||
run: |
|
||||
git clone --recursive https://github.com/nestybox/sysbox.git
|
||||
cd sysbox
|
||||
git checkout $SYSBOX_SHA
|
||||
git submodule update --recursive
|
||||
|
||||
cd sysbox-runc/
|
||||
git apply --ignore-whitespace ../../cromite/tools/images/sysbox/add-x86-x32-arch.patch
|
||||
git status
|
||||
cd ..
|
||||
|
||||
make sysbox-static TARGET_ARCH=x64
|
||||
|
||||
zip -r build.zip build
|
||||
|
||||
- name: Publish
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build.zip
|
||||
path: sysbox/build.zip
|
||||
@@ -1,267 +0,0 @@
|
||||
name: Build Additional Targets
|
||||
permissions:
|
||||
actions: none
|
||||
checks: none
|
||||
contents: none
|
||||
deployments: none
|
||||
issues: none
|
||||
packages: none
|
||||
pull-requests: none
|
||||
repository-projects: none
|
||||
security-events: none
|
||||
statuses: none
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
sha:
|
||||
description: 'uazo/cromite SHA'
|
||||
required: true
|
||||
default: ''
|
||||
type:
|
||||
description: 'runner? [dev/ci]'
|
||||
required: true
|
||||
default: 'ci'
|
||||
debug:
|
||||
description: 'debug? [true/false]'
|
||||
required: true
|
||||
default: 'false'
|
||||
|
||||
env:
|
||||
CROMITE_SHA: ${{ github.event.inputs.sha }}
|
||||
REMOVEDOCKERSUPPORT: true
|
||||
USELOCALIMAGE: true
|
||||
|
||||
jobs:
|
||||
check_images:
|
||||
runs-on: ${{ github.event.inputs.type }}
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: cromite
|
||||
ref: ${{ github.event.inputs.sha }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Enable proxy on container
|
||||
shell: bash
|
||||
run: |
|
||||
if ! [[ -z "${HTTP_PROXY}" ]]; then
|
||||
PROXY_ADDR=http://$(hostname -I | cut -d' ' -f1 | xargs):8118
|
||||
echo "PROXY_ADDR=$PROXY_ADDR" >> $GITHUB_ENV
|
||||
sudo iptables -D INPUT -p tcp -s localhost --dport 8118 -j ACCEPT
|
||||
sudo iptables -D INPUT -p tcp --dport 8118 -j DROP
|
||||
fi
|
||||
|
||||
- name: Get current chromium version
|
||||
shell: bash
|
||||
run: |
|
||||
export VERSION=$( cat ./cromite/build/RELEASE )
|
||||
|
||||
echo Current version is $VERSION
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
|
||||
cd cromite/tools
|
||||
|
||||
- name: Get uazo/cromite-build from docker hub if present
|
||||
shell: bash
|
||||
run: |
|
||||
IS_PRESENT=$(docker manifest inspect uazo/cromite-build:$VERSION-$CROMITE_SHA > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -eq "0" ]; then
|
||||
docker pull uazo/cromite-build:$VERSION-$CROMITE_SHA
|
||||
fi
|
||||
|
||||
- name: Mark image to build
|
||||
shell: bash
|
||||
run: |
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/cromite-build:build > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -eq "0" ]; then
|
||||
docker rmi uazo/cromite-build:build
|
||||
fi
|
||||
docker tag uazo/cromite-build:$VERSION-$CROMITE_SHA uazo/cromite-build:build
|
||||
|
||||
build:
|
||||
runs-on: ${{ github.event.inputs.type }}
|
||||
needs: check_images
|
||||
if: success()
|
||||
timeout-minutes: 1440
|
||||
|
||||
container:
|
||||
image: uazo/cromite-build:build
|
||||
env:
|
||||
REMOVEDOCKERSUPPORT: true # CUSTOM RUNNER: remove sharing of docker socket
|
||||
USELOCALIMAGE: true # CUSTOM RUNNER: permit use of local images
|
||||
USEINTERNALNETWORK: true # CUSTOM RUNNER: create the docker network as internal
|
||||
WORKSPACE: /home/lg/working_dir
|
||||
# kythe
|
||||
KYTHE_CORPUS: chromium.googlesource.com/chromium/src
|
||||
KYTHE_ROOT_DIRECTORY: /home/lg/working_dir/chromium/src
|
||||
KYTHE_OUTPUT_DIRECTORY: /home/lg/working_dir/chromium/src/out/arm64/kythe
|
||||
# cross build
|
||||
DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: /win_sdk/10.0.22621.0/
|
||||
WINDOWSSDKDIR: "/win_sdk/10.0.22621.0/Windows Kits/10/"
|
||||
GYP_MSVS_OVERRIDE_PATH: /win_sdk/10.0.22621.0/
|
||||
# compile in debug mode
|
||||
TARGET_ISDEBUG: ${{ github.event.inputs.debug }}
|
||||
USE_KEYSTORE: true
|
||||
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
||||
CROMITE_PREF_HASH_SEED_BIN: ${{ secrets.CROMITE_PREF_HASH_SEED_BIN }}
|
||||
volumes:
|
||||
- /storage/images/${{ github.event.inputs.sha }}/android/${{ github.event.inputs.debug }}/chr_arm:/home/lg/working_dir/chromium/src/out/chr_arm
|
||||
- /storage/images/${{ github.event.inputs.sha }}/android/${{ github.event.inputs.debug }}/chr_arm64:/home/lg/working_dir/chromium/src/out/chr_arm64
|
||||
- /storage/images/${{ github.event.inputs.sha }}/android/${{ github.event.inputs.debug }}/chr_x64:/home/lg/working_dir/chromium/src/out/chr_x64
|
||||
- /storage/images/${{ github.event.inputs.sha }}/android/${{ github.event.inputs.debug }}/x64_webview:/home/lg/working_dir/chromium/src/out/x64_webview
|
||||
- /storage/images/${{ github.event.inputs.sha }}/android/${{ github.event.inputs.debug }}/arm64_webview:/home/lg/working_dir/chromium/src/out/arm64_webview
|
||||
- /tmp/proxy:/tmp/proxy
|
||||
- /win_sdk:/win_sdk
|
||||
|
||||
steps:
|
||||
- name: Prepare Build Container
|
||||
shell: bash
|
||||
run: |
|
||||
# set workspace paths
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE
|
||||
|
||||
# reset proxy env
|
||||
HTTP_PROXY=
|
||||
HTTPS_PROXY=
|
||||
http_proxy=
|
||||
https_proxy=
|
||||
|
||||
# set out folder permissions
|
||||
test -d chromium/src/out/chr_arm || sudo mkdir -p chromium/src/out/chr_arm && \
|
||||
sudo chown lg chromium/src/out &&
|
||||
sudo chown lg chromium/src/out/chr_arm
|
||||
|
||||
test -d chromium/src/out/chr_arm64 || sudo mkdir -p chromium/src/out/chr_arm64 && \
|
||||
sudo chown lg chromium/src/out &&
|
||||
sudo chown lg chromium/src/out/chr_arm64
|
||||
|
||||
test -d chromium/src/out/chr_x64 || sudo mkdir -p chromium/src/out/chr_x64 && \
|
||||
sudo chown lg chromium/src/out &&
|
||||
sudo chown lg chromium/src/out/chr_x64
|
||||
|
||||
test -d chromium/src/out/x64_webview || sudo mkdir -p chromium/src/out/x64_webview && \
|
||||
sudo chown lg chromium/src/out &&
|
||||
sudo chown lg chromium/src/out/x64_webview
|
||||
|
||||
test -d chromium/src/out/arm64_webview || sudo mkdir -p chromium/src/out/arm64_webview && \
|
||||
sudo chown lg chromium/src/out &&
|
||||
sudo chown lg chromium/src/out/arm64_webview
|
||||
|
||||
sudo mkdir -p /run/user/1000/
|
||||
sudo chown lg /run/user/1000/
|
||||
sudo chmod g-rxw /run/user/1000/
|
||||
sudo chmod o-rxw /run/user/1000/
|
||||
|
||||
# prepare keystore
|
||||
echo "::group::-------- prepare keystore"
|
||||
cd $WORKSPACE
|
||||
echo "${{ secrets.KEYSTORE }}" > cromite.keystore.asc
|
||||
gpg --homedir ./ -d --passphrase "${{ secrets.KEYSTORE_PASSPHRASE }}" --batch cromite.keystore.asc > cromite.keystore
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Build Cromite System WebView x64
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
echo "::group::-------- gn gen"
|
||||
gn gen --args="target_os = \"android\" target_cpu = \"x64\" $(cat /home/lg/working_dir/cromite/build/cromite.gn_args) system_webview_package_name=\"com.android.webview\" enable_trybot_verification=false " out/x64_webview
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- gn args"
|
||||
gn args out/x64_webview/ --list --short
|
||||
gn args out/x64_webview/ --list >out/x64_webview/gn_list
|
||||
echo "::endgroup::"
|
||||
|
||||
ninja -C out/x64_webview system_webview_apk system_webview_shell
|
||||
cp ../../cromite/build/RELEASE out/x64_webview
|
||||
|
||||
- name: Build Cromite System WebView arm64
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
echo "::group::-------- gn gen"
|
||||
gn gen --args="target_os = \"android\" target_cpu = \"arm64\" $(cat /home/lg/working_dir/cromite/build/cromite.gn_args) system_webview_package_name=\"com.android.webview\" enable_trybot_verification=false " out/arm64_webview
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- gn args"
|
||||
gn args out/arm64_webview/ --list --short
|
||||
gn args out/arm64_webview/ --list >out/arm64_webview/gn_list
|
||||
echo "::endgroup::"
|
||||
|
||||
ninja -C out/arm64_webview system_webview_apk system_webview_shell
|
||||
cp ../../cromite/build/RELEASE out/arm64_webview
|
||||
|
||||
- name: Prepare Build Container for vanilla chromium
|
||||
shell: bash
|
||||
run: |
|
||||
# set workspace paths
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
# checkout chromium commit
|
||||
LAST_PATCH=$(git log --all --grep='Fix-chromium-vanilla.patch' --format="%H")
|
||||
git checkout $LAST_PATCH
|
||||
|
||||
- name: Build Chromium Vanilla Android x64
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
echo "::group::-------- gn gen"
|
||||
gn gen --args="target_os = \"android\" $(cat /home/lg/working_dir/cromite/build/chromium.gn_args) target_cpu = \"x64\" " out/chr_x64
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- gn args"
|
||||
gn args out/chr_x64/ --list --short
|
||||
gn args out/chr_x64/ --list >out/chr_x64/gn_list
|
||||
echo "::endgroup::"
|
||||
|
||||
ninja -C out/chr_x64 chrome_public_apk
|
||||
|
||||
cp ../../cromite/build/RELEASE out/chr_x64
|
||||
|
||||
- name: Build Chromium Vanilla Android arm64
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
echo "::group::-------- gn gen"
|
||||
gn gen --args="target_os = \"android\" $(cat /home/lg/working_dir/cromite/build/chromium.gn_args) target_cpu = \"arm64\" " out/chr_arm64
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- gn args"
|
||||
gn args out/chr_arm64/ --list --short
|
||||
gn args out/chr_arm64/ --list >out/chr_arm64/gn_list
|
||||
echo "::endgroup::"
|
||||
|
||||
ninja -C out/chr_arm64 chrome_public_apk
|
||||
|
||||
cp ../../cromite/build/RELEASE out/chr_arm64
|
||||
|
||||
- name: Build Chromium Vanilla Android arm
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
echo "::group::-------- gn gen"
|
||||
gn gen --args="target_os = \"android\" $(cat /home/lg/working_dir/cromite/build/chromium.gn_args) target_cpu = \"arm\" " out/chr_arm
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- gn args"
|
||||
gn args out/chr_arm/ --list --short
|
||||
gn args out/chr_arm/ --list >out/chr_arm/gn_list
|
||||
echo "::endgroup::"
|
||||
|
||||
ninja -C out/chr_arm chrome_public_apk
|
||||
|
||||
cp ../../cromite/build/RELEASE out/chr_arm
|
||||
@@ -1,438 +0,0 @@
|
||||
name: Build Cromite
|
||||
permissions:
|
||||
actions: none
|
||||
checks: none
|
||||
contents: none
|
||||
deployments: none
|
||||
issues: none
|
||||
packages: none
|
||||
pull-requests: none
|
||||
repository-projects: none
|
||||
security-events: none
|
||||
statuses: none
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
sha:
|
||||
description: 'uazo/cromite SHA'
|
||||
required: true
|
||||
default: ''
|
||||
target_os:
|
||||
description: 'targetos [android/win/linux/all]'
|
||||
required: true
|
||||
default: 'all'
|
||||
build:
|
||||
description: 'android arch [arm/arm64/x64/all]'
|
||||
required: true
|
||||
default: 'all'
|
||||
type:
|
||||
description: 'runner? [dev/ci]'
|
||||
required: true
|
||||
default: 'ci'
|
||||
debug:
|
||||
description: 'debug? [true/false]'
|
||||
required: true
|
||||
default: 'false'
|
||||
clangd:
|
||||
description: 'clangd? [true/false]'
|
||||
required: true
|
||||
default: 'false'
|
||||
|
||||
env:
|
||||
CROMITE_SHA: ${{ github.event.inputs.sha }}
|
||||
REMOVEDOCKERSUPPORT: true
|
||||
USELOCALIMAGE: true
|
||||
|
||||
jobs:
|
||||
check_images:
|
||||
runs-on: ${{ github.event.inputs.type }}
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: cromite
|
||||
ref: ${{ github.event.inputs.sha }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Enable proxy on container
|
||||
shell: bash
|
||||
run: |
|
||||
if ! [[ -z "${HTTP_PROXY}" ]]; then
|
||||
PROXY_ADDR=http://$(hostname -I | cut -d' ' -f1 | xargs):8118
|
||||
echo "PROXY_ADDR=$PROXY_ADDR" >> $GITHUB_ENV
|
||||
sudo iptables -D INPUT -p tcp -s localhost --dport 8118 -j ACCEPT
|
||||
sudo iptables -D INPUT -p tcp --dport 8118 -j DROP
|
||||
fi
|
||||
|
||||
- name: Download regctl
|
||||
shell: bash
|
||||
run: |
|
||||
curl -L https://github.com/regclient/regclient/releases/latest/download/regctl-linux-amd64 >regctl
|
||||
chmod 755 regctl
|
||||
|
||||
- name: Get current chromium version
|
||||
shell: bash
|
||||
run: |
|
||||
export VERSION=$( cat ./cromite/build/RELEASE )
|
||||
|
||||
echo Current version is $VERSION
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
|
||||
cd cromite/tools
|
||||
|
||||
- name: Building build-deps container ${{ env.VERSION }}
|
||||
shell: bash
|
||||
run: |
|
||||
docker pull uazo/build-deps:$VERSION || true
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/build-deps:$VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
IS_PRESENT=$(./regctl image inspect uazo/build-deps:$VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
DOCKER_BUILDKIT=1 docker build -t uazo/build-deps:$VERSION \
|
||||
--progress plain \
|
||||
--build-arg VERSION=$VERSION \
|
||||
--build-arg HTTP_PROXY="$PROXY_ADDR" \
|
||||
--no-cache \
|
||||
cromite/tools/images/build-deps/.
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Building chromium container ${{ env.VERSION }}
|
||||
shell: bash
|
||||
run: |
|
||||
docker pull uazo/chromium:$VERSION || true
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/chromium:$VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
IS_PRESENT=$(./regctl image inspect uazo/chromium:$VERSION > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
DOCKER_BUILDKIT=1 docker build -t uazo/chromium:$VERSION \
|
||||
--progress plain \
|
||||
--build-arg VERSION=$VERSION \
|
||||
--build-arg HTTP_PROXY="$PROXY_ADDR" \
|
||||
cromite/tools/images/chr-source/.
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Building cromite container ${{ env.VERSION }}-${{ env.CROMITE_SHA }}
|
||||
shell: bash
|
||||
run: |
|
||||
docker pull uazo/cromite:$VERSION-$CROMITE_SHA || true
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/cromite:$VERSION-$CROMITE_SHA > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
IS_PRESENT=$(./regctl image inspect uazo/cromite:$VERSION-$CROMITE_SHA > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
DOCKER_BUILDKIT=1 docker build -t uazo/cromite:$VERSION-$CROMITE_SHA --progress plain \
|
||||
--build-arg CROMITE_SHA=$CROMITE_SHA \
|
||||
--build-arg VERSION=$VERSION \
|
||||
--build-arg HTTP_PROXY="$PROXY_ADDR" \
|
||||
cromite/tools/images/cromite-source/.
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Building cromite-build container ${{ env.VERSION }}-${{ env.CROMITE_SHA }}
|
||||
shell: bash
|
||||
run: |
|
||||
docker pull uazo/cromite-build:$VERSION-$CROMITE_SHA || true
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/cromite-build:$VERSION-$CROMITE_SHA > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
IS_PRESENT=$(./regctl image inspect uazo/cromite-build:$VERSION-$CROMITE_SHA > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -ne "0" ]; then
|
||||
DOCKER_BUILDKIT=1 docker build -t uazo/cromite-build:$VERSION-$CROMITE_SHA --progress plain \
|
||||
--build-arg CROMITE_SHA=$CROMITE_SHA \
|
||||
--build-arg VERSION=$VERSION \
|
||||
--build-arg HTTP_PROXY="$PROXY_ADDR" \
|
||||
--no-cache \
|
||||
cromite/tools/images/cromite-build/.
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Get uazo/cromite-build from docker hub if present
|
||||
shell: bash
|
||||
run: |
|
||||
IS_PRESENT=$(./regctl image inspect uazo/cromite-build:$VERSION-$CROMITE_SHA > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -eq "0" ]; then
|
||||
docker pull uazo/cromite-build:$VERSION-$CROMITE_SHA
|
||||
fi
|
||||
|
||||
- name: Mark image to build
|
||||
shell: bash
|
||||
run: |
|
||||
IS_PRESENT=$(docker inspect --type=image uazo/cromite-build:build > /dev/null ; echo $?)
|
||||
if [ $IS_PRESENT -eq "0" ]; then
|
||||
docker rmi uazo/cromite-build:build
|
||||
fi
|
||||
docker tag uazo/cromite-build:$VERSION-$CROMITE_SHA uazo/cromite-build:build
|
||||
|
||||
build:
|
||||
runs-on: ${{ github.event.inputs.type }}
|
||||
needs: check_images
|
||||
if: success()
|
||||
timeout-minutes: 1440
|
||||
|
||||
container:
|
||||
image: uazo/cromite-build:build
|
||||
env:
|
||||
REMOVEDOCKERSUPPORT: true # CUSTOM RUNNER: remove sharing of docker socket
|
||||
USELOCALIMAGE: true # CUSTOM RUNNER: permit use of local images
|
||||
USEINTERNALNETWORK: true # CUSTOM RUNNER: create the docker network as internal
|
||||
WORKSPACE: /home/lg/working_dir
|
||||
# kythe
|
||||
KYTHE_CORPUS: chromium.googlesource.com/chromium/src
|
||||
KYTHE_ROOT_DIRECTORY: /home/lg/working_dir/chromium/src
|
||||
KYTHE_OUTPUT_DIRECTORY: /home/lg/working_dir/chromium/src/out/arm64/kythe
|
||||
# cross build
|
||||
DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: /win_sdk/sdks/Win11SDK_10.0.26100.0/
|
||||
WINDOWSSDKDIR: "/win_sdk/sdks/Win11SDK_10.0.26100.0/Windows Kits/10/"
|
||||
GYP_MSVS_OVERRIDE_PATH: /win_sdk/sdks/Win11SDK_10.0.26100.0/
|
||||
# compile in debug mode
|
||||
TARGET_ISDEBUG: ${{ github.event.inputs.debug }}
|
||||
TARGET_OS: ${{ github.event.inputs.target_os }}
|
||||
USE_KEYSTORE: true
|
||||
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
||||
CROMITE_PREF_HASH_SEED_BIN: ${{ secrets.CROMITE_PREF_HASH_SEED_BIN }}
|
||||
volumes:
|
||||
- /storage/images/${{ github.event.inputs.sha }}/android/${{ github.event.inputs.debug }}/arm:/home/lg/working_dir/chromium/src/out/arm
|
||||
- /storage/images/${{ github.event.inputs.sha }}/android/${{ github.event.inputs.debug }}/arm64:/home/lg/working_dir/chromium/src/out/arm64
|
||||
- /storage/images/${{ github.event.inputs.sha }}/android/${{ github.event.inputs.debug }}/x64:/home/lg/working_dir/chromium/src/out/x64
|
||||
- /storage/images/${{ github.event.inputs.sha }}/linux/${{ github.event.inputs.debug }}/lin64:/home/lg/working_dir/chromium/src/out/lin64
|
||||
- /storage/images/${{ github.event.inputs.sha }}/win/x64:/home/lg/working_dir/chromium/src/out/win64
|
||||
- /tmp/proxy:/tmp/proxy
|
||||
- /win_sdk:/win_sdk
|
||||
|
||||
steps:
|
||||
- name: Prepare Build Container
|
||||
shell: bash
|
||||
run: |
|
||||
# set workspace paths
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE
|
||||
|
||||
# reset proxy env
|
||||
HTTP_PROXY=
|
||||
HTTPS_PROXY=
|
||||
http_proxy=
|
||||
https_proxy=
|
||||
|
||||
# set out folder permissions
|
||||
test -d chromium/src/out/arm || sudo mkdir -p chromium/src/out/arm && \
|
||||
sudo chown lg chromium/src/out &&
|
||||
sudo chown lg chromium/src/out/arm
|
||||
|
||||
test -d chromium/src/out/arm64 || sudo mkdir -p chromium/src/out/arm64 && \
|
||||
sudo chown lg chromium/src/out &&
|
||||
sudo chown lg chromium/src/out/arm64
|
||||
|
||||
test -d chromium/src/out/win64 || sudo mkdir -p chromium/src/out/win64 && \
|
||||
sudo chown lg chromium/src/out &&
|
||||
sudo chown lg chromium/src/out/win64
|
||||
|
||||
test -d chromium/src/out/x64 || sudo mkdir -p chromium/src/out/x64 && \
|
||||
sudo chown lg chromium/src/out &&
|
||||
sudo chown lg chromium/src/out/x64
|
||||
|
||||
test -d chromium/src/out/lin64 || sudo mkdir -p chromium/src/out/lin64 && \
|
||||
sudo chown lg chromium/src/out &&
|
||||
sudo chown lg chromium/src/out/lin64
|
||||
|
||||
# make kythe output directory
|
||||
test -d $KYTHE_OUTPUT_DIRECTORY || mkdir -p $KYTHE_OUTPUT_DIRECTORY
|
||||
|
||||
sudo mkdir -p /run/user/1000/
|
||||
sudo chown lg /run/user/1000/
|
||||
sudo chmod g-rxw /run/user/1000/
|
||||
sudo chmod o-rxw /run/user/1000/
|
||||
|
||||
# prepare keystore
|
||||
echo "::group::-------- prepare keystore"
|
||||
cd $WORKSPACE
|
||||
echo "${{ secrets.KEYSTORE }}" > cromite.keystore.asc
|
||||
gpg --homedir ./ -d --passphrase "${{ secrets.KEYSTORE_PASSPHRASE }}" --batch cromite.keystore.asc > cromite.keystore
|
||||
echo "::endgroup::"
|
||||
|
||||
# bootstrap python3 for gn
|
||||
echo ../../../../../usr/bin >$WORKSPACE/depot_tools/python3_bin_reldir.txt
|
||||
|
||||
- name: Build Cromite Android x64
|
||||
if: ${{ (github.event.inputs.target_os == 'android' || github.event.inputs.target_os == 'all') && (github.event.inputs.build == 'x64' || github.event.inputs.build == 'all') }}
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
echo "::group::-------- gn gen"
|
||||
gn gen --args="target_os = \"android\" $(cat /home/lg/working_dir/cromite/build/cromite.gn_args) target_cpu = \"x64\" " out/x64
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- gn args"
|
||||
gn args out/x64/ --list --short
|
||||
gn args out/x64/ --list >out/x64/gn_list
|
||||
echo "::endgroup::"
|
||||
|
||||
ninja -C out/x64 chrome_public_bundle
|
||||
ninja -C out/x64 chrome_public_apk
|
||||
|
||||
cp ../../cromite/build/RELEASE out/x64
|
||||
|
||||
- name: Get ninja logs Android x64
|
||||
if: ${{ (github.event.inputs.target_os == 'android' || github.event.inputs.target_os == 'all') && (github.event.inputs.build == 'x64' || github.event.inputs.build == 'all') }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd $WORKSPACE
|
||||
$WORKSPACE/ninjatracing/ninjatracing -a $WORKSPACE/chromium/src/out/x64/.ninja_log >$WORKSPACE/chromium/src/out/x64/ninja_log_trace.json
|
||||
python3 $WORKSPACE/chromium/src/third_party/catapult/tracing/bin/trace2html $WORKSPACE/chromium/src/out/x64/ninja_log_trace.json
|
||||
|
||||
- name: Build Cromite Windows x64
|
||||
if: ${{ github.event.inputs.target_os == 'win' || github.event.inputs.target_os == 'all' }}
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
echo "::group::-------- gn gen"
|
||||
gn gen --args="target_os = \"win\" $(cat /home/lg/working_dir/cromite/build/cromite.gn_args) target_cpu = \"x64\" " out/win64
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- gn args"
|
||||
gn args out/win64/ --list --short
|
||||
gn args out/win64/ --list >out/win64/gn_list
|
||||
echo "::endgroup::"
|
||||
|
||||
ninja -C out/win64 chrome
|
||||
|
||||
cp ../../cromite/build/RELEASE out/win64
|
||||
|
||||
- name: Get ninja logs Windows x64
|
||||
if: ${{ github.event.inputs.target_os == 'win' || github.event.inputs.target_os == 'all' }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd $WORKSPACE
|
||||
$WORKSPACE/ninjatracing/ninjatracing -a $WORKSPACE/chromium/src/out/win64/.ninja_log >$WORKSPACE/chromium/src/out/win64/ninja_log_trace.json
|
||||
python3 $WORKSPACE/chromium/src/third_party/catapult/tracing/bin/trace2html $WORKSPACE/chromium/src/out/win64/ninja_log_trace.json
|
||||
|
||||
- name: Build Cromite Android arm64
|
||||
if: ${{ (github.event.inputs.target_os == 'android' || github.event.inputs.target_os == 'all') && (github.event.inputs.build == 'arm64' || github.event.inputs.build == 'all') }}
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
echo "::group::-------- gn gen"
|
||||
gn gen --args="target_os = \"android\" $(cat /home/lg/working_dir/cromite/build/cromite.gn_args) target_cpu = \"arm64\" " out/arm64
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- gn args"
|
||||
gn args out/arm64/ --list --short
|
||||
gn args out/arm64/ --list >out/arm64/gn_list
|
||||
echo "::endgroup::"
|
||||
|
||||
ninja -C out/arm64 chrome_public_bundle
|
||||
ninja -C out/arm64 chrome_public_apk
|
||||
|
||||
cp ../../cromite/build/RELEASE out/arm64
|
||||
|
||||
- name: Get ninja logs Android arm64
|
||||
if: ${{ (github.event.inputs.target_os == 'android' || github.event.inputs.target_os == 'all') && (github.event.inputs.build == 'arm64' || github.event.inputs.build == 'all') }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd $WORKSPACE
|
||||
$WORKSPACE/ninjatracing/ninjatracing -a $WORKSPACE/chromium/src/out/arm64/.ninja_log >$WORKSPACE/chromium/src/out/arm64/ninja_log_trace.json
|
||||
python3 $WORKSPACE/chromium/src/third_party/catapult/tracing/bin/trace2html $WORKSPACE/chromium/src/out/arm64/ninja_log_trace.json
|
||||
|
||||
- name: Generate breakpad symbols for Android arm64
|
||||
if: ${{ (github.event.inputs.target_os == 'android' || github.event.inputs.target_os == 'all') && (github.event.inputs.build == 'arm64' || github.event.inputs.build == 'all') }}
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
echo "::group::-------- generating breakpad symbols"
|
||||
ninja -C out/arm64 minidump_stackwalk dump_syms
|
||||
components/crash/content/tools/generate_breakpad_symbols.py --build-dir=out/arm64 \
|
||||
--symbols-dir=out/arm64/symbols/ --binary=out/arm64/lib.unstripped/libchrome.so \
|
||||
--platform=android --clear --verbose
|
||||
cp out/arm64/lib.unstripped/libchrome.so out/arm64/symbols/libchrome.lib.so
|
||||
cp out/arm64/minidump_stackwalk out/arm64/symbols
|
||||
cp out/arm64/dump_syms out/arm64/symbols
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Generate Supersize data for Android arm64
|
||||
if: ${{ github.event.inputs.debug == 'false' && (github.event.inputs.target_os == 'android' || github.event.inputs.target_os == 'all') && (github.event.inputs.build == 'arm64' || github.event.inputs.build == 'all') }}
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
tools/binary_size/supersize archive out/arm64/chrome.size --apk-file out/arm64/apks/ChromePublic.apk -v
|
||||
|
||||
- name: Build Cromite Android arm
|
||||
if: ${{ (github.event.inputs.target_os == 'android' || github.event.inputs.target_os == 'all') && (github.event.inputs.build == 'arm' || github.event.inputs.build == 'all') }}
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
echo "::group::-------- gn gen"
|
||||
gn gen --args="target_os = \"android\" $(cat /home/lg/working_dir/cromite/build/cromite.gn_args) target_cpu = \"arm\" " out/arm
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- gn args"
|
||||
gn args out/arm/ --list --short
|
||||
gn args out/arm/ --list >out/arm/gn_list
|
||||
echo "::endgroup::"
|
||||
|
||||
ninja -C out/arm chrome_public_bundle
|
||||
ninja -C out/arm chrome_public_apk
|
||||
|
||||
cp ../../cromite/build/RELEASE out/arm
|
||||
|
||||
- name: Get ninja logs Android arm
|
||||
if: ${{ (github.event.inputs.target_os == 'android' || github.event.inputs.target_os == 'all') && (github.event.inputs.build == 'arm' || github.event.inputs.build == 'all') }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd $WORKSPACE
|
||||
$WORKSPACE/ninjatracing/ninjatracing -a $WORKSPACE/chromium/src/out/arm/.ninja_log >$WORKSPACE/chromium/src/out/arm/ninja_log_trace.json
|
||||
python3 $WORKSPACE/chromium/src/third_party/catapult/tracing/bin/trace2html $WORKSPACE/chromium/src/out/arm/ninja_log_trace.json
|
||||
|
||||
- name: Build Cromite Linux 64
|
||||
if: ${{ (github.event.inputs.target_os == 'linux' || github.event.inputs.target_os == 'all') }}
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
echo "::group::-------- gn gen"
|
||||
gn gen --args="target_os = \"linux\" $(cat /home/lg/working_dir/cromite/build/cromite.gn_args) target_cpu = \"x64\" " out/lin64
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- gn args"
|
||||
gn args out/lin64/ --list --short
|
||||
gn args out/lin64/ --list >out/lin64/gn_list
|
||||
echo "::endgroup::"
|
||||
|
||||
ninja -C out/lin64 chrome chrome_sandbox
|
||||
|
||||
cp ../../cromite/build/RELEASE out/lin64
|
||||
|
||||
- name: Get ninja logs Linux 64
|
||||
if: ${{ (github.event.inputs.target_os == 'linux' || github.event.inputs.target_os == 'all') }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd $WORKSPACE
|
||||
$WORKSPACE/ninjatracing/ninjatracing -a $WORKSPACE/chromium/src/out/lin64/.ninja_log >$WORKSPACE/chromium/src/out/lin64/ninja_log_trace.json
|
||||
python3 $WORKSPACE/chromium/src/third_party/catapult/tracing/bin/trace2html $WORKSPACE/chromium/src/out/lin64/ninja_log_trace.json
|
||||
|
||||
- name: Generate clangd index for Android arm64
|
||||
if: ${{ github.event.inputs.clangd == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
test -f out/arm64/cromite.idx || \
|
||||
cp -r out/arm64 out/clangd && \
|
||||
gn gen --args="import(\"/home/lg/working_dir/cromite/build/cromite.gn_args\") $(cat ../../build_args.gni) skip_clangd_unsupported_options = true" out/clangd && \
|
||||
$WORKSPACE/ninja/ninja -C $WORKSPACE/chromium/src/out/clangd -a chrome_public_apk \
|
||||
-t compdb cc cxx objc objcxx >$WORKSPACE/chromium/src/out/clangd/compile_commands.json && \
|
||||
/home/lg/working_dir/clangd_snapshot_20250518/bin/clangd-indexer --executor=all-TUs out/clangd/compile_commands.json >out/arm64/cromite.idx && \
|
||||
rm -rf out/clangd
|
||||
@@ -1,154 +0,0 @@
|
||||
name: Check git apply
|
||||
permissions:
|
||||
# actions: none
|
||||
# checks: none
|
||||
# contents: write
|
||||
# deployments: none
|
||||
# issues: none
|
||||
# packages: none
|
||||
pull-requests: write
|
||||
# repository-projects: none
|
||||
# security-events: none
|
||||
# statuses: none
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'ci'
|
||||
paths:
|
||||
- 'build/**'
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
rtag:
|
||||
description: 'uazo/cromite TAG or COMMIT'
|
||||
required: true
|
||||
default: ''
|
||||
|
||||
env:
|
||||
RTAG: ${{ github.event.inputs.rtag }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: "Get value from dispatch"
|
||||
run: |
|
||||
if [ -z "${RTAG}" ]; then
|
||||
echo "RTAG=$GITHUB_SHA" >> $GITHUB_ENV
|
||||
echo "RTAG=$RTAG"
|
||||
fi
|
||||
|
||||
- name: Prepare container
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y wget unzip tar sed dos2unix patchutils wiggle curl
|
||||
|
||||
wget https://github.com/uazo/superpatch/releases/latest/download/SuperPatchUtils.tar.gz
|
||||
tar xfz SuperPatchUtils.tar.gz
|
||||
rm SuperPatchUtils.tar.gz
|
||||
|
||||
wget https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip
|
||||
unzip pup_v0.4.0_linux_amd64.zip
|
||||
rm pup_v0.4.0_linux_amd64.zip
|
||||
|
||||
BRANCH=$(curl https://github.com/uazo/cromite/branch_commits/$RTAG | ./pup -p li.branch:last-child a text{})
|
||||
if [ -z "${BRANCH}" ]; then
|
||||
BRANCH=$(curl https://github.com/uazo/cromite/branch_commits/$RTAG a | ./pup -p li.branch:first-child a text{})
|
||||
fi
|
||||
if [ -z "${BRANCH}" ]; then
|
||||
echo "Can not recover the base commit"
|
||||
exit 1
|
||||
fi
|
||||
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout 'uazo/cromite' ${{ env.BRANCH }}
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'uazo/cromite'
|
||||
ref: ${{ github.event.inputs.rtag }}
|
||||
path: 'cromite'
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Check chromium version
|
||||
run: |
|
||||
export HOME=$GITHUB_WORKSPACE
|
||||
VERSION=$(cat ~/cromite/build/RELEASE)
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Cache chromium sources
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: chromium-src
|
||||
key: chrsource-${{ env.VERSION }}
|
||||
|
||||
- name: Download chromium ${{ env.VERSION }} sources
|
||||
run: |
|
||||
export HOME=$GITHUB_WORKSPACE
|
||||
./bin/SuperPatchUtils bromite $RTAG ~/chromium-src
|
||||
mkdir -p ~/chromium/src && cp -rT ~/chromium-src ~/chromium/src
|
||||
cd ~/chromium/src
|
||||
git init
|
||||
git config user.email "you@example.com"
|
||||
git config user.name "Your Name"
|
||||
git add .
|
||||
git commit -m $VERSION
|
||||
git tag -a $VERSION -m $VERSION
|
||||
|
||||
git add -f v8 && git commit -m ":NOEXPORT: v8" || true
|
||||
|
||||
- name: Apply patches ${{ github.event.inputs.rtag }}
|
||||
run: |
|
||||
export HOME=$GITHUB_WORKSPACE
|
||||
cd ~/chromium/src
|
||||
|
||||
export SILENT=true
|
||||
export SKIPAUTOGENERATED=true
|
||||
bash ~/cromite/tools/apply-all-patch.sh || exit 1
|
||||
|
||||
rm -rf ~/cromite/build/patches-new/
|
||||
rm ~/cromite/build/cromite_patches_list_new.txt
|
||||
|
||||
- name: Export patches
|
||||
run: |
|
||||
export HOME=$GITHUB_WORKSPACE
|
||||
cd ~/chromium/src
|
||||
|
||||
bash ~/cromite/tools/export-all-patch.sh
|
||||
|
||||
cd ~/cromite
|
||||
rm -rf build/patches/*
|
||||
mv build/patches-new/* build/patches
|
||||
rm -rf build/patches-new/
|
||||
|
||||
- name: Check differences CHANGES=${{ env.CHANGES }}
|
||||
run: |
|
||||
export HOME=$GITHUB_WORKSPACE
|
||||
|
||||
cd ~/cromite
|
||||
CHANGES=0 && git diff --quiet || CHANGES=1
|
||||
echo "CHANGES=$CHANGES" >> $GITHUB_ENV
|
||||
|
||||
if [[ CHANGES -eq 1 ]]; then
|
||||
git add build/patches/*.patch
|
||||
git diff --name-only --staged
|
||||
# MESSAGE=$(git diff --name-only --staged)
|
||||
# echo "MESSAGE='$MESSAGE'" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c #v6.1.0
|
||||
if: env.CHANGES == '1'
|
||||
with:
|
||||
token: ${{ secrets.CROMITE_PULLS }}
|
||||
path: cromite
|
||||
base: ${{ env.BRANCH }}
|
||||
#push-to-fork: uazo/cromite
|
||||
add-paths: |
|
||||
build/patches/*.patch
|
||||
commit-message: '[AUTO] Patches auto-rebase'
|
||||
title: '[AUTO] Patches auto-rebase for ${{ env.BRANCH }} branch'
|
||||
body: ${{ env.MESSAGE }}
|
||||
delete-branch: true
|
||||
branch-suffix: short-commit-hash
|
||||
@@ -1,71 +0,0 @@
|
||||
name: 'Check NIST database'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 1 * * *'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout 'uazo/cromite' ${{ env.BRANCH }}
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'uazo/cromite'
|
||||
ref: ${{ github.event.inputs.rtag }}
|
||||
path: 'cromite'
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Get data
|
||||
run: |
|
||||
sudo apt update
|
||||
DEBIAN_FRONTEND=noninteractive sudo apt install -y sed
|
||||
|
||||
export HOME=$GITHUB_WORKSPACE
|
||||
cd ~/cromite/tools
|
||||
test -d cves || mkdir -p cves
|
||||
cd cves
|
||||
|
||||
CY=$(date +%Y)
|
||||
for i in $(seq 2020 $CY)
|
||||
do
|
||||
echo Asking for $i year
|
||||
docker run --rm --name tapir stratosphereips/tapir:latest \
|
||||
bash -c "python3 tapir.py -y $i libjxl -s" >>libjxl.ansi
|
||||
done
|
||||
|
||||
sed -e 's/\x1b\[[0-9;]*m//g' <libjxl.ansi >libjxl.txt
|
||||
rm libjxl.ansi
|
||||
|
||||
- name: Check differences
|
||||
run: |
|
||||
export HOME=$GITHUB_WORKSPACE
|
||||
cd ~/cromite
|
||||
CHANGES=0 && git diff --quiet || CHANGES=1
|
||||
echo "CHANGES=$CHANGES" >> $GITHUB_ENV
|
||||
|
||||
if [[ CHANGES -eq 1 ]]; then
|
||||
git add tools/cves/*.txt
|
||||
git diff --name-only --staged
|
||||
fi
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c #v6.1.0
|
||||
if: env.CHANGES == '1'
|
||||
with:
|
||||
token: ${{ secrets.CROMITE_PULLS }}
|
||||
path: cromite
|
||||
base: ${{ env.BRANCH }}
|
||||
#push-to-fork: uazo/cromite
|
||||
add-paths: |
|
||||
tools/cves/*.txt
|
||||
commit-message: 'AUTOMATED - CVE results'
|
||||
title: New CVE results
|
||||
delete-branch: true
|
||||
branch-suffix: short-commit-hash
|
||||
@@ -1,130 +0,0 @@
|
||||
name: Execute Tests
|
||||
permissions:
|
||||
actions: none
|
||||
checks: none
|
||||
contents: none
|
||||
deployments: none
|
||||
issues: none
|
||||
packages: none
|
||||
pull-requests: none
|
||||
repository-projects: none
|
||||
security-events: none
|
||||
statuses: none
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
sha:
|
||||
description: 'uazo/bromite SHA'
|
||||
required: true
|
||||
default: 'ce2f07034a3d3b257e9bada65d8293a6786bb95f'
|
||||
|
||||
env:
|
||||
BROMITE_SHA: ${{ github.event.inputs.sha }}
|
||||
REMOVEDOCKERSUPPORT: true
|
||||
USELOCALIMAGE: true
|
||||
|
||||
jobs:
|
||||
get_image:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Mark image to test
|
||||
shell: bash
|
||||
run: |
|
||||
docker tag uazo/bromite-build:$BROMITE_SHA uazo/bromite-build:test
|
||||
|
||||
exec-test:
|
||||
runs-on: self-hosted
|
||||
needs: get_image
|
||||
if: success()
|
||||
|
||||
container:
|
||||
image: uazo/bromite-build:test
|
||||
env:
|
||||
REMOVEDOCKERSUPPORT: true # CUSTOM RUNNER: remove sharing of docker socket
|
||||
USELOCALIMAGE: true # CUSTOM RUNNER: permit use of local images
|
||||
USEINTERNALNETWORK: true # CUSTOM RUNNER: create the docker network as internal
|
||||
WORKSPACE: /home/lg/working_dir
|
||||
ARTIFACS_DIR: /home/lg/working_dir/artifacs
|
||||
volumes:
|
||||
- /storage/images/${{ github.event.inputs.sha }}/out:/home/lg/working_dir/chromium/src/out/bromite:r
|
||||
- /storage/images/${{ github.event.inputs.sha }}/out/tests:/home/lg/working_dir/chromium/src/out/tests
|
||||
options: --device=/dev/kvm
|
||||
|
||||
steps:
|
||||
- name: Prepare Test Container
|
||||
shell: bash
|
||||
run: |
|
||||
# set workspace paths
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE
|
||||
|
||||
# copy artifacts
|
||||
#cd chromium/src
|
||||
#mkdir -p out/bromite
|
||||
#cp -arp $ARTIFACS_DIR/out/* out/bromite
|
||||
|
||||
rm -rf out/tests/*
|
||||
#mkdir -p out/tests
|
||||
|
||||
# reset proxy env
|
||||
#HTTP_PROXY=
|
||||
#HTTPS_PROXY=
|
||||
#http_proxy=
|
||||
#https_proxy=
|
||||
|
||||
# - name: Wait forever
|
||||
# shell: bash
|
||||
# run: |
|
||||
# sleep infinity
|
||||
|
||||
- name: Execute chrome junit test
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
out/bromite/bin/run_chrome_junit_tests --gtest_filter=*Bromite* || KO=1
|
||||
|
||||
- name: Start Android Emulator
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
|
||||
sudo mkdir -p /github/home/.android
|
||||
sudo chmod 666 /github/home/.android/
|
||||
tools/android/avd/avd.py install --avd-config ../../generic_android31.textpb -v
|
||||
tools/android/avd/avd.py start --avd-config ../../generic_android31.textpb -v
|
||||
|
||||
- name: Execute unit tests
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
out/bromite/unit_tests -v --fast-local-dev --gtest_filter=*Bromite* || KO=1
|
||||
|
||||
- name: Restart Android Emulator
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
pkill -f qemu-system-x86
|
||||
tools/android/avd/avd.py start --avd-config ../../generic_android31.textpb -v
|
||||
|
||||
- name: Execute instrumentation tests
|
||||
shell: bash
|
||||
run: |
|
||||
PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH
|
||||
cd $WORKSPACE/chromium/src
|
||||
out/bromite/bin/run_chrome_public_test_apk -v --num-retries=1 --gtest_filter=*Bromite* || KO=1
|
||||
|
||||
#- name: Wait forever
|
||||
# shell: bash
|
||||
# run: |
|
||||
# sleep infinity
|
||||
|
||||
- name: Copy results
|
||||
shell: bash
|
||||
run: |
|
||||
sudo cp -r $WORKSPACE/chromium/src/out/bromite/TEST_RESULTS* $WORKSPACE/chromium/src/out/tests/
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
name: Release Cromite CI
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
sha:
|
||||
description: 'uazo/cromite SHA'
|
||||
required: true
|
||||
default: ''
|
||||
type:
|
||||
description: 'runner? [dev/ci]'
|
||||
required: true
|
||||
default: 'ci'
|
||||
draft:
|
||||
description: 'draft? [true/false]'
|
||||
required: true
|
||||
default: 'false'
|
||||
comment:
|
||||
description: 'comment'
|
||||
required: true
|
||||
|
||||
env:
|
||||
CROMITE_SHA: ${{ github.event.inputs.sha }}
|
||||
REMOVEDOCKERSUPPORT: true
|
||||
USELOCALIMAGE: true
|
||||
COMMENT: ${{ github.event.inputs.comment }}
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ${{ github.event.inputs.type }}
|
||||
env:
|
||||
IS_DRAFT: ${{ github.event.inputs.draft }}
|
||||
OUTPUTFILE_ARM: /storage/images/${{ github.event.inputs.sha }}/android/false/arm/
|
||||
OUTPUTFILE_ARM64: /storage/images/${{ github.event.inputs.sha }}/android/false/arm64/
|
||||
OUTPUTFILE_X64: /storage/images/${{ github.event.inputs.sha }}/android/false/x64/
|
||||
OUTPUTFILE_WIN: /storage/images/${{ github.event.inputs.sha }}/win/x64/
|
||||
OUTPUTFILE_LIN: /storage/images/${{ github.event.inputs.sha }}/linux/false/lin64/
|
||||
|
||||
steps:
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Prepare container
|
||||
run: |
|
||||
wget https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip
|
||||
unzip pup_v0.4.0_linux_amd64.zip && rm pup_v0.4.0_linux_amd64.zip
|
||||
BRANCH=$(curl https://github.com/uazo/cromite/branch_commits/$CROMITE_SHA | ./pup -p li.branch:last-child a text{} | xargs)
|
||||
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout 'uazo/cromite'
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'uazo/cromite'
|
||||
path: 'cromite'
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Create release
|
||||
shell: bash
|
||||
run: |
|
||||
VERSION=v$(cat ${{ env.OUTPUTFILE_ARM64 }}/RELEASE)
|
||||
|
||||
cd cromite/tools
|
||||
|
||||
GH=gh_2.21.1_linux_amd64/bin/gh
|
||||
wget https://github.com/cli/cli/releases/download/v2.21.1/gh_2.21.1_linux_amd64.tar.gz
|
||||
tar xfz gh_2.21.1_linux_amd64.tar.gz
|
||||
|
||||
echo ${{ secrets.GITHUB_TOKEN }} | $GH auth login --with-token
|
||||
|
||||
echo $COMMENT >note
|
||||
|
||||
$GH release create $VERSION-$CROMITE_SHA --notes-file note -d
|
||||
|
||||
# android arm
|
||||
echo "::group::-------- android arm"
|
||||
sudo cp ${{ env.OUTPUTFILE_ARM }}/apks/ChromePublic.apk arm_ChromePublic.apk
|
||||
sudo chown runner arm_ChromePublic.apk
|
||||
echo Uploading arm_ChromePublic
|
||||
$GH release upload $VERSION-$CROMITE_SHA arm_ChromePublic.apk
|
||||
echo "::endgroup::"
|
||||
|
||||
# android arm64
|
||||
echo "::group::-------- android arm64"
|
||||
sudo cp ${{ env.OUTPUTFILE_ARM64 }}/apks/ChromePublic.apk arm64_ChromePublic.apk
|
||||
sudo chown runner arm64_ChromePublic.apk
|
||||
echo Uploading arm64_ChromePublic
|
||||
$GH release upload $VERSION-$CROMITE_SHA arm64_ChromePublic.apk
|
||||
echo "::endgroup::"
|
||||
|
||||
# android x64
|
||||
echo "::group::-------- android x64"
|
||||
sudo cp ${{ env.OUTPUTFILE_X64 }}/apks/ChromePublic.apk x64_ChromePublic.apk
|
||||
sudo chown runner x64_ChromePublic.apk
|
||||
echo Uploading x64_ChromePublic
|
||||
$GH release upload $VERSION-$CROMITE_SHA x64_ChromePublic.apk
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- chrome.size"
|
||||
test $VERSION-$CROMITE_SHA $OUTPUTFILE_ARM64/chrome.size && \
|
||||
$GH release upload $VERSION-$CROMITE_SHA $OUTPUTFILE_ARM64/chrome.size
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- ChromePublic.apk.mapping"
|
||||
sudo cp ${{ env.OUTPUTFILE_ARM64 }}/apks/ChromePublic.apk.mapping arm64_ChromePublic.apk.mapping
|
||||
$GH release upload $VERSION-$CROMITE_SHA arm64_ChromePublic.apk.mapping
|
||||
sudo cp ${{ env.OUTPUTFILE_X64 }}/apks/ChromePublic.apk.mapping x64_ChromePublic.apk.mapping
|
||||
$GH release upload $VERSION-$CROMITE_SHA x64_ChromePublic.apk.mapping
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- Uploading arm64_ninja_log_trace.html"
|
||||
test $OUTPUTFILE_ARM64/ninja_log_trace.html && \
|
||||
cp $OUTPUTFILE_ARM64/ninja_log_trace.html arm64_ninja_log_trace.html && \
|
||||
$GH release upload $VERSION-$CROMITE_SHA arm64_ninja_log_trace.html
|
||||
echo "::endgroup::"
|
||||
|
||||
# windows x64
|
||||
echo "::group::-------- windows x64"
|
||||
mkdir chrome-win/
|
||||
cp $OUTPUTFILE_WIN/*.manifest chrome-win/
|
||||
cp $OUTPUTFILE_WIN/chrome.dll chrome-win/
|
||||
cp $OUTPUTFILE_WIN/chrome.exe chrome-win/
|
||||
cp $OUTPUTFILE_WIN/chrome_100_percent.pak chrome-win/
|
||||
cp $OUTPUTFILE_WIN/chrome_200_percent.pak chrome-win/
|
||||
cp $OUTPUTFILE_WIN/chrome_elf.dll chrome-win/
|
||||
cp $OUTPUTFILE_WIN/chrome_proxy.exe chrome-win/
|
||||
cp $OUTPUTFILE_WIN/chrome_pwa_launcher.exe chrome-win/
|
||||
cp $OUTPUTFILE_WIN/chrome_wer.dll chrome-win/
|
||||
cp "/win_sdk/10.0.22621.0/Windows Kits/10/Redist/D3D/x64/d3dcompiler_47.dll" chrome-win/
|
||||
cp $OUTPUTFILE_WIN/elevation_service.exe chrome-win/
|
||||
cp "$OUTPUTFILE_WIN/First Run" chrome-win/
|
||||
cp $OUTPUTFILE_WIN/headless_lib_data.pak chrome-win/
|
||||
cp $OUTPUTFILE_WIN/icudtl.dat chrome-win/
|
||||
cp $OUTPUTFILE_WIN/libEGL.dll chrome-win/
|
||||
cp $OUTPUTFILE_WIN/libGLESv2.dll chrome-win/
|
||||
cp $OUTPUTFILE_WIN/Logo.png chrome-win/
|
||||
cp $OUTPUTFILE_WIN/notification_helper.exe chrome-win/
|
||||
cp $OUTPUTFILE_WIN/resources.pak chrome-win/
|
||||
cp $OUTPUTFILE_WIN/SmallLogo.png chrome-win/
|
||||
cp $OUTPUTFILE_WIN/snapshot_blob.bin chrome-win/
|
||||
cp $OUTPUTFILE_WIN/VkICD_mock_icd.dll chrome-win/
|
||||
cp $OUTPUTFILE_WIN/VkLayer_khronos_validation.dll chrome-win/
|
||||
cp $OUTPUTFILE_WIN/vk_swiftshader.dll chrome-win/
|
||||
cp $OUTPUTFILE_WIN/vulkan-1.dll chrome-win/
|
||||
cp -r $OUTPUTFILE_WIN/locales chrome-win/locales
|
||||
|
||||
#test chrome-win.zip && rm chrome-win.zip
|
||||
zip -r chrome-win.zip chrome-win/
|
||||
|
||||
echo Uploading chrome-win.zip
|
||||
$GH release upload $VERSION-$CROMITE_SHA chrome-win.zip
|
||||
echo "::endgroup::"
|
||||
|
||||
## linux
|
||||
echo "::group::-------- linux x64"
|
||||
mkdir chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/chrome chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/chrome_100_percent.pak chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/chrome_200_percent.pak chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/chrome_crashpad_handler chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/chrome-wrapper chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/icudtl.dat chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/libEGL.so chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/libGLESv2.so chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/libvulkan.so.1 chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/libqt5_shim.so chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/libqt6_shim.so chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/libvk_swiftshader.so chrome-lin/
|
||||
cp -r $OUTPUTFILE_LIN/locales/ chrome-lin/locales
|
||||
cp $OUTPUTFILE_LIN/product_logo_48.png chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/resources.pak chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/snapshot_blob.bin chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/xdg-mime chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/xdg-settings chrome-lin/
|
||||
cp $OUTPUTFILE_LIN/chrome_sandbox chrome-lin/
|
||||
|
||||
tar -czvf chrome-lin64.tar.gz chrome-lin/
|
||||
|
||||
echo Uploading chrome-lin64.tar.gz
|
||||
$GH release upload $VERSION-$CROMITE_SHA chrome-lin64.tar.gz
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::-------- arm64 symbols"
|
||||
zip arm64_symbols.zip ${{ env.OUTPUTFILE_ARM64 }}/dump_syms \
|
||||
${{ env.OUTPUTFILE_ARM64 }}/minidump_stackwalk \
|
||||
${{ env.OUTPUTFILE_ARM64 }}/libchrome.so
|
||||
$GH release upload $VERSION-$CROMITE_SHA arm64_symbols.zip
|
||||
echo "::endgroup::"
|
||||
|
||||
TIMESTAMP=$(date +%s -r chrome-win.zip)
|
||||
echo >updateurl.txt "browser=chromium;os=windows;architecture=64-bit;timestamp=$TIMESTAMP;editor=uazo;channel=stable;repository=https://github.com/uazo/cromite/releases;download=https://github.com/uazo/cromite/releases/latest/download/chrome-win.zip;version=$(cat $OUTPUTFILE_WIN/RELEASE);revision=1;commit=$CROMITE_SHA"
|
||||
$GH release upload $VERSION-$CROMITE_SHA updateurl.txt
|
||||
|
||||
$GH release edit $VERSION-$CROMITE_SHA -t $VERSION-$CROMITE_SHA
|
||||
|
||||
if [ $IS_DRAFT == "false" ]; then
|
||||
$GH release edit $VERSION-$CROMITE_SHA --draft=false
|
||||
fi
|
||||
|
||||
VERSION=$(cat ${{ env.OUTPUTFILE_ARM64 }}/RELEASE)
|
||||
docker push uazo/cromite:$VERSION-$CROMITE_SHA
|
||||
docker push uazo/cromite-build:$VERSION-$CROMITE_SHA
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
name: Release Additional Targets
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
sha:
|
||||
description: 'uazo/cromite SHA'
|
||||
required: true
|
||||
default: ''
|
||||
type:
|
||||
description: 'runner? [dev/ci]'
|
||||
required: true
|
||||
default: 'ci'
|
||||
|
||||
env:
|
||||
CROMITE_SHA: ${{ github.event.inputs.sha }}
|
||||
REMOVEDOCKERSUPPORT: true
|
||||
USELOCALIMAGE: true
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ${{ github.event.inputs.type }}
|
||||
env:
|
||||
IS_DRAFT: ${{ github.event.inputs.draft }}
|
||||
OUTPUTFILE_ARM64: /storage/images/${{ github.event.inputs.sha }}/android/false/arm64_webview/
|
||||
OUTPUTFILE_X64: /storage/images/${{ github.event.inputs.sha }}/android/false/x64_webview/
|
||||
OUTPUTFILE_CHR_ARM64: /storage/images/${{ github.event.inputs.sha }}/android/false/chr_arm64/
|
||||
OUTPUTFILE_CHR_ARM: /storage/images/${{ github.event.inputs.sha }}/android/false/chr_arm/
|
||||
OUTPUTFILE_CHR_X64: /storage/images/${{ github.event.inputs.sha }}/android/false/chr_x64/
|
||||
|
||||
steps:
|
||||
- name: Prepare container
|
||||
run: |
|
||||
wget https://github.com/ericchiang/pup/releases/download/v0.4.0/pup_v0.4.0_linux_amd64.zip
|
||||
unzip pup_v0.4.0_linux_amd64.zip && rm pup_v0.4.0_linux_amd64.zip
|
||||
BRANCH=$(curl https://github.com/uazo/cromite/branch_commits/$CROMITE_SHA | ./pup -p li.branch:last-child a text{} | xargs)
|
||||
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout 'uazo/cromite'
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'uazo/cromite'
|
||||
path: 'cromite'
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Create release
|
||||
shell: bash
|
||||
run: |
|
||||
VERSION=v$(cat ${{ env.OUTPUTFILE_ARM64 }}/RELEASE)
|
||||
|
||||
cd cromite/tools
|
||||
|
||||
GH=gh_2.21.1_linux_amd64/bin/gh
|
||||
wget https://github.com/cli/cli/releases/download/v2.21.1/gh_2.21.1_linux_amd64.tar.gz
|
||||
tar xfz gh_2.21.1_linux_amd64.tar.gz
|
||||
|
||||
echo ${{ secrets.GITHUB_TOKEN }} | $GH auth login --with-token
|
||||
|
||||
# android arm64
|
||||
echo "::group::-------- android systemwebview arm64"
|
||||
sudo cp ${{ env.OUTPUTFILE_ARM64 }}/apks/SystemWebView.apk arm64_SystemWebView.apk
|
||||
sudo chown runner arm64_SystemWebView.apk
|
||||
|
||||
sudo cp ${{ env.OUTPUTFILE_ARM64 }}/apks/SystemWebViewShell.apk arm64_SystemWebViewShell.apk
|
||||
sudo chown runner arm64_SystemWebViewShell.apk
|
||||
|
||||
echo Uploading arm64_SystemWebView
|
||||
$GH release upload $VERSION-$CROMITE_SHA arm64_SystemWebView.apk
|
||||
$GH release upload $VERSION-$CROMITE_SHA arm64_SystemWebViewShell.apk
|
||||
echo "::endgroup::"
|
||||
|
||||
# android x64
|
||||
echo "::group::-------- android systemwebview x64"
|
||||
sudo cp ${{ env.OUTPUTFILE_X64 }}/apks/SystemWebView.apk x64_SystemWebView.apk
|
||||
sudo chown runner x64_SystemWebView.apk
|
||||
|
||||
sudo cp ${{ env.OUTPUTFILE_X64 }}/apks/SystemWebViewShell.apk x64_SystemWebViewShell.apk
|
||||
sudo chown runner x64_SystemWebViewShell.apk
|
||||
|
||||
echo Uploading x64_SystemWebView
|
||||
$GH release upload $VERSION-$CROMITE_SHA x64_SystemWebView.apk
|
||||
$GH release upload $VERSION-$CROMITE_SHA x64_SystemWebViewShell.apk
|
||||
echo "::endgroup::"
|
||||
|
||||
# vanilla chromium arm
|
||||
echo "::group::-------- vanilla chromium arm"
|
||||
sudo cp ${{ env.OUTPUTFILE_CHR_ARM }}/apks/ChromePublic.apk arm_VanillaChromium.apk
|
||||
sudo chown runner arm_VanillaChromium.apk
|
||||
|
||||
echo Uploading arm_VanillaChromium
|
||||
$GH release upload $VERSION-$CROMITE_SHA arm_VanillaChromium.apk
|
||||
echo "::endgroup::"
|
||||
|
||||
# vanilla chromium arm64
|
||||
echo "::group::-------- vanilla chromium arm64"
|
||||
sudo cp ${{ env.OUTPUTFILE_CHR_ARM64 }}/apks/ChromePublic.apk arm64_VanillaChromium.apk
|
||||
sudo chown runner arm64_VanillaChromium.apk
|
||||
|
||||
echo Uploading arm64_VanillaChromium
|
||||
$GH release upload $VERSION-$CROMITE_SHA arm64_VanillaChromium.apk
|
||||
echo "::endgroup::"
|
||||
|
||||
# vanilla chromium x64
|
||||
echo "::group::-------- vanilla chromium x64"
|
||||
sudo cp ${{ env.OUTPUTFILE_CHR_X64 }}/apks/ChromePublic.apk x64_VanillaChromium.apk
|
||||
sudo chown runner x64_VanillaChromium.apk
|
||||
|
||||
echo Uploading x64_VanillaChromium
|
||||
$GH release upload $VERSION-$CROMITE_SHA x64_VanillaChromium.apk
|
||||
echo "::endgroup::"
|
||||
@@ -1,24 +0,0 @@
|
||||
name: 'Close stale issues and PRs'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 1 * * *'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v6
|
||||
with:
|
||||
exempt-all-milestones: true
|
||||
any-of-labels: 'awaiting info,wontfix'
|
||||
days-before-stale: 5
|
||||
days-before-close: 7
|
||||
stale-issue-message: "This issue has been automatically marked as stale as there has been no recent activity in response to our request for more information. Please respond so that we can proceed with this issue."
|
||||
close-issue-message: "This issue has been automatically closed as sufficient information hasn't been provided on the issue for further actions to be taken. Feel free to add more information."
|
||||
@@ -1,82 +0,0 @@
|
||||
name: Update patches doc
|
||||
permissions:
|
||||
# actions: none
|
||||
# checks: none
|
||||
# contents: write
|
||||
# deployments: none
|
||||
# issues: none
|
||||
# packages: none
|
||||
pull-requests: write
|
||||
# repository-projects: none
|
||||
# security-events: none
|
||||
# statuses: none
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
paths:
|
||||
- 'build/**'
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
rtag:
|
||||
description: 'uazo/cromite TAG or COMMIT'
|
||||
required: true
|
||||
default: ''
|
||||
|
||||
env:
|
||||
RTAG: ${{ github.event.inputs.rtag }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: "Get value from dispatch"
|
||||
run: |
|
||||
if [ -z "${RTAG}" ]; then
|
||||
echo "RTAG=$GITHUB_SHA" >> $GITHUB_ENV
|
||||
echo "RTAG=$RTAG"
|
||||
fi
|
||||
|
||||
- name: Checkout 'uazo/cromite' ${{ env.BRANCH }}
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: 'uazo/cromite'
|
||||
ref: ${{ github.event.inputs.rtag }}
|
||||
path: 'cromite'
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Generate patches doc
|
||||
run: |
|
||||
export HOME=$GITHUB_WORKSPACE
|
||||
|
||||
bash ~/cromite/tools/extract-all-patch-data.sh ~/cromite/build/patches
|
||||
|
||||
- name: Check differences CHANGES=${{ env.CHANGES }}
|
||||
run: |
|
||||
export HOME=$GITHUB_WORKSPACE
|
||||
|
||||
cd ~/cromite
|
||||
CHANGES=0 && git diff --quiet || CHANGES=1
|
||||
echo "CHANGES=$CHANGES" >> $GITHUB_ENV
|
||||
|
||||
if [[ CHANGES -eq 1 ]]; then
|
||||
git add docs/*.md
|
||||
fi
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c #v6.1.0
|
||||
if: env.CHANGES == '1'
|
||||
with:
|
||||
token: ${{ secrets.CROMITE_PULLS }}
|
||||
path: cromite
|
||||
base: ${{ env.BRANCH }}
|
||||
add-paths: |
|
||||
docs/*.md
|
||||
commit-message: '[AUTO][DOC] Generate patches doc for master branch'
|
||||
title: '[AUTO][DOC] Generate patches doc for master branch'
|
||||
body: ${{ env.MESSAGE }}
|
||||
delete-branch: true
|
||||
branch-suffix: short-commit-hash
|
||||
@@ -1,73 +0,0 @@
|
||||
name: Update fdroid repo
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
type:
|
||||
description: 'runner? [dev/ci]'
|
||||
required: true
|
||||
default: 'ci'
|
||||
|
||||
env:
|
||||
REMOVEDOCKERSUPPORT: true
|
||||
USELOCALIMAGE: true
|
||||
USEINTERNALNETWORK: true
|
||||
|
||||
jobs:
|
||||
update-fdroid:
|
||||
runs-on: ${{ github.event.inputs.type }}
|
||||
|
||||
container:
|
||||
image: uazo/fdroidserver:latest
|
||||
volumes:
|
||||
- /tmp/forward-proxy:/tmp/forward-proxy
|
||||
|
||||
steps:
|
||||
- name: Update fdroid repo
|
||||
shell: bash
|
||||
run: |
|
||||
export https_proxy=http://127.0.0.1:8118
|
||||
socat TCP-LISTEN:8118,reuseaddr,fork UNIX-CLIENT:/tmp/forward-proxy/proxy.sock &
|
||||
socat TCP-LISTEN:1080,reuseaddr,fork UNIX-CLIENT:/tmp/forward-proxy/ftp.sock &
|
||||
touch /etc/apt/apt.conf.d/proxy.conf
|
||||
echo "Acquire::http::Proxy \"$https_proxy\";" >/etc/apt/apt.conf.d/proxy.conf
|
||||
|
||||
cd /
|
||||
. fdroidserver-env/bin/activate
|
||||
apt update
|
||||
|
||||
DEBIAN_FRONTEND=noninteractive apt update && apt install -y wget unzip
|
||||
wget https://github.com/rclone/rclone/releases/download/v1.64.0/rclone-v1.64.0-linux-amd64.zip
|
||||
unzip rclone-v1.64.0-linux-amd64.zip
|
||||
export rclone=rclone-v1.64.0-linux-amd64/rclone
|
||||
|
||||
mkdir -p ~/.config/rclone
|
||||
echo "${{ secrets.RCLONE_CONF }}" > ~/.config/rclone/rclone.conf
|
||||
|
||||
$rclone sync ftp:www.cromite.org/fdroid fdroid --log-level INFO --ftp-socks-proxy 127.0.0.1:1080
|
||||
|
||||
test -d /usr/share/man/man1 || mkdir -p /usr/share/man/man1
|
||||
DEBIAN_FRONTEND=noninteractive apt install -y fdroidserver
|
||||
|
||||
cd fdroid/repo/
|
||||
wget https://github.com/uazo/cromite/releases/latest/download/arm_ChromePublic.apk
|
||||
wget https://github.com/uazo/cromite/releases/latest/download/arm64_ChromePublic.apk
|
||||
wget https://github.com/uazo/cromite/releases/latest/download/x64_ChromePublic.apk
|
||||
|
||||
test arm_ChromePublic.apk.1 && rm arm_ChromePublic.apk && mv arm_ChromePublic.apk.1 arm_ChromePublic.apk
|
||||
test arm64_ChromePublic.apk.1 && rm arm64_ChromePublic.apk && mv arm64_ChromePublic.apk.1 arm64_ChromePublic.apk
|
||||
test x64_ChromePublic.apk.1 && rm x64_ChromePublic.apk && mv x64_ChromePublic.apk.1 x64_ChromePublic.apk
|
||||
cd ..
|
||||
|
||||
gpg -d --passphrase "${{ secrets.FDROID_PASSPHRASE }}" --batch config.yml.asc >config.yml
|
||||
gpg -d --passphrase "${{ secrets.FDROID_PASSPHRASE }}" --batch keystore.p12.asc >keystore.p12
|
||||
|
||||
fdroid update -c; fdroid update
|
||||
rm config.yml keystore.p12
|
||||
cd ..
|
||||
|
||||
test -f fdroid/config.yml && exit 1
|
||||
test -f fdroid/keystore.p12 && exit 1
|
||||
|
||||
$rclone sync fdroid ftp:www.cromite.org/fdroid --log-level INFO --ftp-socks-proxy 127.0.0.1:1080
|
||||
$rclone sync fdroid ftp:www.cromite.org/fdroid --log-level INFO --ftp-socks-proxy 127.0.0.1:1080
|
||||
@@ -1,6 +0,0 @@
|
||||
################################################################################
|
||||
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
|
||||
################################################################################
|
||||
|
||||
/.vs
|
||||
/temp
|
||||
+949
@@ -0,0 +1,949 @@
|
||||
# 94.0.4606.102
|
||||
* add flag to disable pull-to-refresh effect
|
||||
* add recents, offlinepage and send to home screen for always incognito (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1182 and https://github.com/bromite/bromite/issues/1362)
|
||||
* prompt to restart when always-incognito is enabled (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1474)
|
||||
* merge patches for custom tab intents
|
||||
|
||||
# 94.0.4606.94
|
||||
* Bromite auto-update feature, disabled by default (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/706)
|
||||
* add site setting for images (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1339)
|
||||
* use SM-G960U as model provided via client hints and Javascript
|
||||
* drop patches already merged upstream
|
||||
|
||||
# 93.0.4577.110
|
||||
|
||||
* set enable_reporting to false (thanks to @nikolowry)
|
||||
* backported patches for security issues https://crbug.com/1245578 and https://crbug.com/1251787
|
||||
* disable AGSA by default
|
||||
* disable UA client hint for model
|
||||
* disable lock icon in address bar by default
|
||||
* enable share intent (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1062)
|
||||
* allow forcing external links to open in incognito (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/728)
|
||||
* avoid double restart for default tab groups flags status
|
||||
|
||||
# 93.0.4577.83
|
||||
* dropped patch for FLoC (already disabled by upstream)
|
||||
* dropped patch for build with system sysroots
|
||||
* disable tab groups by default (needs restart)
|
||||
* added 'services/network/public/mojom' to ad blocker patch to avoid a build error
|
||||
|
||||
# 92.0.4515.176
|
||||
* use upstream feature to prevent default search engine permissions grants
|
||||
* slightly improve error message for gateway attacks prevention error
|
||||
|
||||
# 92.0.4515.134
|
||||
|
||||
# 92.0.4515.125
|
||||
* replace patch for missing API keys warning
|
||||
* fix subresource filter not working (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1299)
|
||||
|
||||
# 92.0.4515.103
|
||||
* disable User Agent client hints
|
||||
* fix builds with system sysroots
|
||||
* force text/x-suse-ymp to be downloaded
|
||||
|
||||
# 91.0.4472.158
|
||||
* added x64 releases
|
||||
|
||||
# 91.0.4472.146
|
||||
* removed flags for device motion/orientation (fixes https://github.com/bromite/bromite/issues/1204)
|
||||
* prevent crash on download on API level 21 (fixes https://github.com/bromite/bromite/issues/1184)
|
||||
* fix crash reporting garbled UI for small screens (thanks to @uazo, https://github.com/bromite/bromite/pull/1236)
|
||||
* add flag to enable/disable vibration API (fixes https://github.com/bromite/bromite/issues/1045)
|
||||
|
||||
# 91.0.4472.143
|
||||
* add support for ISupportHelpAndFeedback
|
||||
* JIT-less toggle (fixes https://github.com/bromite/bromite/issues/1235)
|
||||
* enable crash reporting UI (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/944)
|
||||
|
||||
# 91.0.4472.102
|
||||
* fix opening new tabs from links in always-incognito mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1154)
|
||||
|
||||
# 91.0.4472.97
|
||||
* add flag for omnibox autocomplete filtering (fixes https://github.com/bromite/bromite/issues/1152)
|
||||
* enable IntentBlockExternalFormRedirectsNoGesture by default
|
||||
* add flag to disable external intent requests
|
||||
* fix for tab collection temporary/non-exportable (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1138)
|
||||
|
||||
# 91.0.4472.50
|
||||
* unexpire tab group flags `#enable-tab-groups` and `#enable-tab-groups-ui-improvements`
|
||||
* replace known good hostname used for DoH test (fixes https://github.com/bromite/bromite/issues/1148)
|
||||
* drop patch to disable preview fetching
|
||||
* drop patch to restore horizontal tab switcher
|
||||
|
||||
# 90.0.4430.204
|
||||
* fix for custom tab intent tab crashes when in always incognito mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1116)
|
||||
|
||||
# 90.0.4430.101
|
||||
* disable RTCGetCurrentBrowsingContextMedia by default
|
||||
* disable FLoC by default
|
||||
|
||||
# 90.0.4430.92
|
||||
* restore horizontal tab switcher feature (fixes https://github.com/bromite/bromite/issues/1077)
|
||||
* fix a couple of bugs in proxy saving UI (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1072)
|
||||
* disable feeds V2 toggle (fixes https://github.com/bromite/bromite/issues/1070)
|
||||
* allow fetching field trials from flags (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1021)
|
||||
* add AllowUserCertificates flag (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/921)
|
||||
* add IsCleartextPermitted flag (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1068)
|
||||
|
||||
# 90.0.4430.74
|
||||
* re-added patch for User agent customization (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1049)
|
||||
* fix always-incognito custom tab intents issues (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1047 and https://github.com/bromite/bromite/issues/1051)
|
||||
* prevent Omnibox URL elisions by default
|
||||
|
||||
# 90.0.4430.59
|
||||
* fix menu items not properly displayed with tab overflow menu regroup (fixes https://github.com/bromite/bromite/issues/963)
|
||||
* fix text displayed for menu entry to bookmark all tabs
|
||||
* bookmarks import/export: disable SAF by default (fixes https://github.com/bromite/bromite/issues/1039)
|
||||
* disable offline measurement background task
|
||||
* dropped patch to show warnings for TSLv1.0/v1.1 connections (upstream now disallows them)
|
||||
* disable AImageReader by default on Android 9 and below for Qualcomm (fixes https://github.com/bromite/bromite/issues/1005)
|
||||
|
||||
# 89.0.4389.117
|
||||
* disable AImageReader by default on Android 9 and below for ARM (fixes https://github.com/bromite/bromite/issues/1005)
|
||||
* log checksum of AdBlock filters
|
||||
|
||||
# 89.0.4389.100
|
||||
* enable AImageReader by default (fixes https://github.com/bromite/bromite/issues/1005)
|
||||
* fix missing flag for AImageReader
|
||||
* move incognito snapshots flag to proper section (fixes https://github.com/bromite/bromite/issues/1006)
|
||||
* add missing icon for exit menu
|
||||
* implement SAF for bookmarks export functionality (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/831)
|
||||
|
||||
# 89.0.4389.92
|
||||
* updated zh_CN translations (thanks to @zhmars, https://github.com/bromite/bromite/pull/1000)
|
||||
* introduce Alt+D hotkey to focus address bar (fixes https://github.com/bromite/bromite/issues/979)
|
||||
* use 64-bit ABI for webview processes (fixes https://github.com/bromite/bromite/issues/997)
|
||||
* use dedicated folder for bookmark all tabs
|
||||
* fix Javascript and cookies permissions missing (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/990)
|
||||
* fix missing enable save data header flag (fixes https://github.com/bromite/bromite/issues/989)
|
||||
* fix menu items not properly displayed with tab overflow menu regroup (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/963)
|
||||
|
||||
# 89.0.4389.78
|
||||
* make all favicon requests on-demand
|
||||
* restored older icon for view source menu item
|
||||
* prevent adblock filters update check on app start (fixes https://github.com/bromite/bromite/issues/967)
|
||||
* removed UI for adblock filters (fixes https://github.com/bromite/bromite/issues/941)
|
||||
* dropped patch for swapped favicons bug
|
||||
* dropped patch to enable reduced-referrer-granularity by default (already present upstream)
|
||||
* dropped password reuse detection patch
|
||||
* dropped UA customization patch
|
||||
* enabled PartitionExpectCTStateByNetworkIsolationKey and PartitionDomainReliabilityByNetworkIsolationKey (fixes https://github.com/bromite/bromite/issues/985)
|
||||
|
||||
# 88.0.4324.207
|
||||
* add flag for save-data-header
|
||||
* add option to force tablet UI
|
||||
* fix bug with adblock filters not being downloaded correctly (fixes https://github.com/bromite/bromite/issues/960)
|
||||
* move up bookmark all tabs menu item (fixes https://github.com/bromite/bromite/issues/943)
|
||||
* fix icons for exit and view source menu items
|
||||
|
||||
# 88.0.4324.187
|
||||
* fix exit menu item not working in tablet mode
|
||||
* add menu item to bookmark all tabs (fixes https://github.com/bromite/bromite/issues/570)
|
||||
* enable app overflow menu icons by default
|
||||
* UI for adblock filters (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/811)
|
||||
* dropped patch to not permit user-installed certificates
|
||||
* ignore enterprise policies for secure DNS (fixes https://github.com/bromite/bromite/issues/832)
|
||||
|
||||
# 88.0.4324.185
|
||||
* fix favicons fallback search (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/788)
|
||||
* fix potential DIAL crash when network state changes (thanks to @Ahrotahn)
|
||||
* fix crash when opening links in incognito-only mode (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/899)
|
||||
* disallow empty custom user agent (thanks to @uazo)
|
||||
|
||||
# 88.0.4324.149
|
||||
* fix proxy PAC URL option not working (fixes https://github.com/bromite/bromite/issues/908)
|
||||
* store proxy configuration in LocalState instead of Profile (thanks to @uazo)
|
||||
* fix toggle for reversing the meaning of bypass rules (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/884)
|
||||
* do not permit user-installed certificates
|
||||
|
||||
# 88.0.4324.141
|
||||
* fix bookmarks not opening (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/891)
|
||||
* fix proxy page not loading (fixes https://github.com/bromite/bromite/issues/890)
|
||||
|
||||
# 88.0.4324.95
|
||||
* fix broken recent tabs behaviour (fixes https://github.com/bromite/bromite/issues/886)
|
||||
* re-introduce flags for number of raster threads (fixes https://github.com/bromite/bromite/issues/875)
|
||||
* avoid initializing histogram data for the WebView (https://github.com/bromite/bromite/issues/873)
|
||||
* dropped patch for manifest changes for Q/R (already present upstream)
|
||||
* fix check for HTML extension in bookmark import dialog
|
||||
|
||||
# 87.0.4280.131
|
||||
* enable all network isolation features (fixes https://github.com/bromite/bromite/issues/836)
|
||||
* disable unified autoplay feature (fixes https://github.com/bromite/bromite/issues/804)
|
||||
|
||||
# 87.0.4280.106
|
||||
* enable SplitCacheByNetworkIsolationKey (fixes https://github.com/bromite/bromite/issues/836)
|
||||
* fix random timezone option (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/828)
|
||||
* disable autofill server communication by default
|
||||
* ask permission to play protected media by default
|
||||
* disable SystemWebView variations support
|
||||
|
||||
# 87.0.4280.81
|
||||
* fix text fragment not disabled by default, unexpire flag (fixes https://github.com/bromite/bromite/issues/803)
|
||||
* turn AImageReader off by default on ARM64 (fixes https://github.com/bromite/bromite/issues/814)
|
||||
* fix issue with global autoplay settings (thanks to @uazo, https://github.com/bromite/bromite/pull/825)
|
||||
* fix issues with user agent customization (thanks to @uazo, https://github.com/bromite/bromite/pull/823)
|
||||
* updated zh_CN translations (thanks to @zhmars, https://github.com/bromite/bromite/pull/821)
|
||||
|
||||
# 87.0.4280.68
|
||||
* user agent customization (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/798)
|
||||
* fix for intent handling for local apps on Android 11 (https://github.com/bromite/bromite/pull/816)
|
||||
|
||||
# 87.0.4280.67
|
||||
|
||||
# 86.0.4240.194
|
||||
* fix native pages displaying incorrectly with the sticky desktop mode (thanks to @uazo)
|
||||
* re-introduce simplified NTP (fixes https://github.com/bromite/bromite/issues/701)
|
||||
* re-introduce site settings to block autoplay (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/791)
|
||||
* fix Omnibox flag not working (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/789)
|
||||
|
||||
# 86.0.4240.181
|
||||
* allow sticky desktop mode for all tabs (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/780)
|
||||
|
||||
# 86.0.4240.112
|
||||
* fix crash in new overflow menu (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/771)
|
||||
|
||||
# 86.0.4240.99
|
||||
|
||||
# 86.0.4240.92
|
||||
* upstream fix for video playback audio issue (fixes https://github.com/bromite/bromite/issues/755)
|
||||
* fix order of entries in privacy settings (fixes https://github.com/bromite/bromite/issues/758)
|
||||
|
||||
# 86.0.4240.73
|
||||
* re-introduce ARM64 AImageReader mitigations (fixes https://github.com/bromite/bromite/issues/766)
|
||||
* re-introduce menu items for autocomplete, autofill assistant and contextual search (fixes https://github.com/bromite/bromite/issues/763)
|
||||
|
||||
# 86.0.4240.70
|
||||
* fixed crash on unused menu item tap (fixes https://github.com/bromite/bromite/issues/760)
|
||||
* fixed issue on new installations without DoH configuration (fixes https://github.com/bromite/bromite/issues/761)
|
||||
|
||||
# 86.0.4240.66
|
||||
* switch to upstream UI for DoH URL customization
|
||||
* remove weblayer dependency on Play Services
|
||||
* build fixes for password service
|
||||
* removed obsolete patch to kill Translate
|
||||
* removed patch to revert unified consent code
|
||||
* removed patch for dav1d library
|
||||
* removed patch for improved cookie controls defaults
|
||||
* removed patches for ARM64 AImageReader issues
|
||||
|
||||
# 85.0.4183.114
|
||||
|
||||
# 85.0.4183.110
|
||||
* hardening against incognito mode detection
|
||||
* fix background playback issue (fixes https://github.com/bromite/bromite/issues/734)
|
||||
|
||||
# 85.0.4183.94
|
||||
* disable the DIAL repeating discovery
|
||||
* removed patch for session-only cookies support
|
||||
* add timezone customization patch (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/331)
|
||||
* fixed bug happening when configuring proxies in incognito mode (thanks to @uazo)
|
||||
|
||||
# 85.0.4183.86
|
||||
* fix LocationBarPhone app crash at startup (fixes https://github.com/bromite/bromite/issues/565)
|
||||
|
||||
# 85.0.4183.84
|
||||
* fix crash in About page (fixes https://github.com/bromite/bromite/issues/710)
|
||||
* fix adding more than one proxy (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/679)
|
||||
* fix system proxy configuration (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/377)
|
||||
|
||||
# 85.0.4183.82
|
||||
* fixes bookmark button not working with always-incognito (fixes https://github.com/bromite/bromite/issues/654)
|
||||
* disable scroll-to-text-fragment
|
||||
* remove NTP blocklisted URLs when adding an URL as bookmark
|
||||
* removed duet flags
|
||||
* unexpire `#darken-websites-checkbox-in-themes-setting` flag
|
||||
* rollback dav1d upgrade which breaks x86
|
||||
|
||||
# 84.0.4147.132
|
||||
* fix exit menu item not always working (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/673)
|
||||
* session-only cookies site settings option (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/142)
|
||||
* add setting to enable history on incognito mode (thanks to @uazo)
|
||||
* removed old non-working site settings patches
|
||||
|
||||
# 84.0.4147.121
|
||||
* removed Qwant search engine
|
||||
* fixed zh_CN translations
|
||||
* added patch to not embed non-free unrar library (fixes https://github.com/bromite/bromite/issues/674)
|
||||
* enable improved cookie controls by default
|
||||
|
||||
# 84.0.4147.119
|
||||
* update zh_CN translations
|
||||
* disable CORS RFC1918 (fixes https://github.com/bromite/bromite/issues/664)
|
||||
* restore duet flags (fixes https://github.com/bromite/bromite/issues/667)
|
||||
|
||||
# 84.0.4147.113
|
||||
* block gateway attacks via websockets (fixes https://github.com/bromite/bromite/issues/590)
|
||||
* enable prefetch-privacy-changes by default (fixes https://github.com/bromite/bromite/issues/659)
|
||||
* enable reduced-referrer-granularity by default (fixes https://github.com/bromite/bromite/issues/659)
|
||||
|
||||
# 84.0.4147.106
|
||||
* fixed bug with Javascript site settings not showing
|
||||
* add exit menu item to overview menu (fixes https://github.com/bromite/bromite/issues/619)
|
||||
|
||||
# 84.0.4147.95
|
||||
* show warnings for TLSv1.0/TLSv1.1 connections (fixes https://github.com/bromite/bromite/issues/645)
|
||||
* fix bug with unconfigured DoH (fixes https://github.com/bromite/bromite/issues/646)
|
||||
|
||||
# 84.0.4147.90
|
||||
* added menu item to view source of current page
|
||||
* fixed dialog for SSL/TLS errors (fixes https://github.com/bromite/bromite/issues/638)
|
||||
* build with feeds support due to upstream build flags combination bugs
|
||||
|
||||
# 83.0.4103.119
|
||||
* restored non-CFI builds for x86
|
||||
|
||||
# 83.0.4103.101
|
||||
* enable HEVC and Dolby Vision
|
||||
|
||||
# 83.0.4103.93
|
||||
* fix undesired replacement for search engines (fixes https://github.com/bromite/bromite/issues/595)
|
||||
* fix resume flag not visible
|
||||
|
||||
# 83.0.4103.76
|
||||
* fixed inverted Omnibox flag
|
||||
* fixed LocationBarPhone/LocationBarTablet crash (fixes https://github.com/bromite/bromite/issues/565)
|
||||
|
||||
# 83.0.4103.53
|
||||
* updated zh_CN translations
|
||||
* mitigation for LocationBarPhone crash (https://github.com/bromite/bromite/issues/565)
|
||||
|
||||
# 83.0.4103.46
|
||||
* add zh_CN missing translations (fixes https://github.com/bromite/bromite/issues/546)
|
||||
* change default mode for WebRTC (fixes https://github.com/bromite/bromite/issues/553)
|
||||
* add flag to allow screenshots of incognito tabs (fixes https://github.com/bromite/bromite/issues/551)
|
||||
* reintroduced patches for disabling AImageReader
|
||||
* fixed DevTools issue with domain substitution (fixes https://github.com/bromite/bromite/issues/526)
|
||||
* drop patch to disable QUIC by default
|
||||
* drop patch for DoH minimum timeout (upstream also implemented it)
|
||||
* dropped patch for removal of support of CCT dynamic modules (upstream also removed it)
|
||||
* removed upstream patch for SD card not found issue (upstream merged it)
|
||||
* enable reporting because of COEP
|
||||
|
||||
# 81.0.4044.127
|
||||
* fix always-incognito crashes (https://github.com/bromite/bromite/issues/135 and https://github.com/bromite/bromite/pull/529)
|
||||
* improved crash uploader mock by calling done callback
|
||||
|
||||
# 81.0.4044.106
|
||||
* remove option to add NTP as homepage (fixes https://github.com/bromite/bromite/issues/517)
|
||||
|
||||
# 81.0.4044.97
|
||||
* disable browser auto-login by default
|
||||
* show download prompt again
|
||||
|
||||
# 81.0.4044.83
|
||||
|
||||
# 81.0.4044.76
|
||||
|
||||
# 81.0.4044.70
|
||||
* backport surface control fix (fixes https://github.com/bromite/bromite/issues/445)
|
||||
|
||||
# 81.0.4044.63
|
||||
* use upstream fix for SD card not found issue (fixes https://github.com/bromite/bromite/issues/485)
|
||||
* do not compile QR code sharing
|
||||
* remove obsolete patch for GCM experiment status
|
||||
* drop 2 patches for AImageReader crash fix (upstream has the same revert patches)
|
||||
|
||||
# 80.0.3987.118
|
||||
* disable AImageReader for all ARM64 devices (fixes https://github.com/bromite/bromite/issues/497)
|
||||
* use upstream possible workaround for SD card not found issue (fixes https://github.com/bromite/bromite/issues/485)
|
||||
|
||||
# 80.0.3987.109
|
||||
* restored GPU workaround for the ARM/ARM64 AImageReader crash (https://github.com/bromite/bromite/issues/445)
|
||||
|
||||
# 80.0.3987.95
|
||||
* enable user-agent freeze (fixes https://github.com/bromite/bromite/issues/483)
|
||||
* fix issue with AMP (fixes https://github.com/bromite/bromite/issues/488)
|
||||
* fix crash on home page (fixes https://github.com/bromite/bromite/issues/484)
|
||||
|
||||
# 80.0.3987.78
|
||||
* removed ungoogled-chromium patch for non-remote developer tools resources
|
||||
* removed patch for 64-bit webview (it is now a default from upstream)
|
||||
* removed patch for enabling dark mode menu entry by default (it is now a default from upstream)
|
||||
* removed patch for enabling download rename by default (it is now a default from upstream)
|
||||
* removed some redundant Iridium safe browsing patches
|
||||
|
||||
# 79.0.3945.139
|
||||
* remove patch to automatically disable video decoding acceleration on Android 10+ and arm64
|
||||
* fix referral headers bug in non-DoH requests (fixes https://github.com/bromite/bromite/issues/470)
|
||||
* disable smart selection by default, enable web search in incognito mode
|
||||
* disable DRM media pre-provisioning (fixes https://github.com/bromite/bromite/issues/471)
|
||||
|
||||
# 79.0.3945.123
|
||||
* updated User-agent version
|
||||
* increase minimum DoH timeout to 400ms (fixes https://github.com/bromite/bromite/issues/437)
|
||||
|
||||
# 79.0.3945.111
|
||||
* automatically disable video decoding acceleration on Android 10+ and arm64
|
||||
* restore enable-horizontal-tab-switcher flag
|
||||
* remove non-working contextual search settings
|
||||
* disable QUIC by default
|
||||
* remove logging for DoH timeouts
|
||||
|
||||
# 79.0.3945.107
|
||||
* always show cookies, javascript and ads site settings (fixes https://github.com/bromite/bromite/issues/133)
|
||||
* remove global ads and javascript menu options
|
||||
|
||||
# 79.0.3945.100
|
||||
* log timeout values for DoH
|
||||
* enable DFM (fixes https://github.com/bromite/bromite/issues/441)
|
||||
* updated User-agent version
|
||||
|
||||
# 79.0.3945.94
|
||||
* removed patches which do not apply anymore (Widevine version punting, always show homepage settings, network errors UMA recording)
|
||||
* removed split APKs support (Play integration)
|
||||
* disabled password reuse functionality (Play integration)
|
||||
* re-introduced minimal headers for DoH
|
||||
* removed Startpage
|
||||
* disable feed support
|
||||
* updated User-agent version
|
||||
|
||||
# 78.0.3904.130
|
||||
* support user-specified subresources filter URL (fixes https://github.com/bromite/bromite/issues/2)
|
||||
* revert removal of flag for disabling pull-to-refresh effect
|
||||
* fix crash when entering no DoH URL (fixes https://github.com/bromite/bromite/issues/430)
|
||||
* added Peter Lowe's Ad and tracking server list (fixes https://github.com/bromite/bromite/issues/423)
|
||||
* enabled dav1d_decoder
|
||||
|
||||
# 78.0.3904.119
|
||||
* replace fixed DNS-over-HTTPS feature flag with user-customizable option
|
||||
* fix background playback issue (fixes https://github.com/bromite/bromite/issues/424)
|
||||
|
||||
# 78.0.3904.105
|
||||
* add flag to disable WebGL (fixes https://github.com/bromite/bromite/issues/411)
|
||||
* more selective AMP sanitization (fixes https://github.com/bromite/bromite/issues/410)
|
||||
* build optimizations to disable debug information
|
||||
|
||||
# 78.0.3904.93
|
||||
* introduce flags to disable browser fingerprinting capabilities (fixes https://github.com/bromite/bromite/issues/402)
|
||||
* major enhancements to AMP sanitization for news/images
|
||||
* remove duplicate network predictions privacy setting
|
||||
* disable some signed exchanges features
|
||||
* ungoogled-chromium-android: patches to block all GCM/GMS/PlayServices integrations
|
||||
* ungoogled-chromium: block all connection requests to substituted domains
|
||||
* disable GVR services build flag
|
||||
* disable HEAD requests for single words typed and clicked in Omnibar
|
||||
* increase number of autocomplete matches from 5 to 10
|
||||
* replace DoH probe domain with RIPE domain
|
||||
* merged fixes for adblock/javascript menu text (https://github.com/bromite/bromite/pull/398)
|
||||
* updated User-agent phone model and version
|
||||
|
||||
# 78.0.3904.72
|
||||
* updated User-agent phone model and version
|
||||
* fix network predictions bug (fixes https://github.com/bromite/bromite/issues/387)
|
||||
* fix crash in settings (fixes https://github.com/bromite/bromite/issues/388)
|
||||
|
||||
# 78.0.3904.63
|
||||
* replace Beta DoH service URL for Google (https://developers.google.com/speed/public-dns/docs/doh/migration)
|
||||
* disable AImageReaderMediaPlayer until upstream bug is fixed (https://bugs.chromium.org/p/chromium/issues/detail?id=977583)
|
||||
* disabled face detection provider
|
||||
* removed non-working SystemWebView adblock patch (not working since v77)
|
||||
* bring back some privacy options which upstream moved to Sync settings (fixes https://github.com/bromite/bromite/issues/383)
|
||||
|
||||
# 77.0.3865.104
|
||||
* revert upstream commit for search privacy options and related translations removal (fixes https://github.com/bromite/bromite/issues/375)
|
||||
* remove unused patch for enabling subresource filter on all sites
|
||||
|
||||
# 77.0.3865.95
|
||||
|
||||
# 77.0.3865.81
|
||||
* use native subresource filtering instead of Bromite engine
|
||||
* introduce Bromite AdBlockUpdate service
|
||||
* keep using Bromite engine for SystemWebView
|
||||
* enable subresource filter for all sites
|
||||
* disable subresource filter popup
|
||||
* enable IPv6 probing by default
|
||||
* drop DnsTransaction default security level patch
|
||||
* drop patch to visualize all type of extensions
|
||||
* drop patches for Network Service
|
||||
* enable CFI for all architectures except x86
|
||||
|
||||
# 76.0.3809.129
|
||||
* disable CFI to fix x86 crashes (fixes https://github.com/bromite/bromite/issues/357)
|
||||
|
||||
# 76.0.3809.115
|
||||
* disable search-ready omnibox by default
|
||||
* disable unified consent
|
||||
|
||||
# 76.0.3809.100
|
||||
* use default feature flags for autofill (fixes https://github.com/bromite/bromite/issues/348)
|
||||
|
||||
# 76.0.3809.91
|
||||
|
||||
# 76.0.3809.85
|
||||
* add flag to toggle Network Service
|
||||
* disable Network Service by default
|
||||
* do not record UMA for network errors
|
||||
* use fixed User Agent and Android OS version
|
||||
* dropped patch for history requirement of user gesture
|
||||
|
||||
# 75.0.3770.139
|
||||
* disable media router and remoting by default (fixes https://github.com/bromite/bromite/issues/281)
|
||||
* enable CFI in GN build flags
|
||||
|
||||
# 75.0.3770.132
|
||||
|
||||
# 75.0.3770.109
|
||||
* disable payment support by default
|
||||
* disable background sync by default
|
||||
* better patch from GrapheneOS/Vanadium for disabling sensors access (fixes https://github.com/bromite/bromite/issues/319)
|
||||
* use new patch for content settings sensors allow/block (fixes https://github.com/bromite/bromite/issues/319)
|
||||
* fix impossible values in Battery Status API (fixes https://github.com/bromite/bromite/issues/322)
|
||||
|
||||
# 75.0.3770.86
|
||||
|
||||
# 75.0.3770.82
|
||||
|
||||
# 75.0.3770.70
|
||||
* enable changing default downloads storage location by default
|
||||
* enable download rename option by default
|
||||
* disable offline pages in the downloads home to be opened in CCT by default
|
||||
* increase minimum SDK from 17 to 19 (fixes https://github.com/bromite/bromite/issues/310)
|
||||
* prefs: disable SigninAllowed by default
|
||||
* prefs: always prompt for download directory by default
|
||||
* build: remove calling untrusted hooks
|
||||
|
||||
# 75.0.3770.53
|
||||
* fix crash when downloading or from browser-initiated requests (fixes https://github.com/bromite/bromite/issues/309)
|
||||
|
||||
# 75.0.3770.50
|
||||
* disable dynamic module loading
|
||||
* more fixes to allow building for SDK 17
|
||||
|
||||
# 74.0.3729.162
|
||||
* remove recent tabs signin
|
||||
|
||||
# 74.0.3729.154
|
||||
|
||||
# 74.0.3729.141
|
||||
|
||||
# 74.0.3729.122
|
||||
* remove more unnecessary permissions
|
||||
|
||||
# 74.0.3729.106
|
||||
* remove account/sync menu entries (fixes https://github.com/bromite/bromite/issues/285)
|
||||
* fix failed debug builds
|
||||
|
||||
# 74.0.3729.86
|
||||
* enable dark mode settings entry by default
|
||||
* fix permission request for Play services on reboot (fixes https://github.com/bromite/bromite/issues/281)
|
||||
|
||||
# 74.0.3729.80
|
||||
* increase minimum SDK version to 17 (Jelly Bean 4.2)
|
||||
* dropped obsolete patch for hyperlink auditing disable
|
||||
|
||||
# 73.0.3683.107
|
||||
* dropped patch to disable smooth scrolling
|
||||
* fixed custom tab intents issue (fixes https://github.com/bromite/bromite/issues/279)
|
||||
|
||||
# 73.0.3683.105
|
||||
* removed Fanboy's Annoyance List and Peter Lowe's adservers list from filters
|
||||
|
||||
# 73.0.3683.97
|
||||
* dropped redundant patch to hide NTP tiles (use home page + about:blank)
|
||||
|
||||
# 73.0.3683.88
|
||||
* add option to use home page as NTP
|
||||
|
||||
# 73.0.3683.82
|
||||
* remove force home page button flag
|
||||
* enable site per process isolation for devices with memory > 1GB
|
||||
* use 64-bit processes for SystemWebView
|
||||
* disable local field trials seed (redundant)
|
||||
* fix patch for classic new tab page (redundant)
|
||||
|
||||
# 73.0.3683.79
|
||||
* add missing Qwant engine from default engines list (fixes https://github.com/bromite/bromite/issues/262)
|
||||
* DoH: include upstream patch for DNS secure mode
|
||||
* DoH: enable DNS secure mode by default
|
||||
|
||||
# 73.0.3683.70
|
||||
|
||||
# 73.0.3683.61
|
||||
* drop patches with functionality now available from upstream (DuckDuckGo and Qwant search engines, TLS 1.3 final)
|
||||
* add only DuckDuckGo Lite search engine
|
||||
* provide image URL for Qwant
|
||||
* disable safe browsing subresource filter by default
|
||||
* fix PAC URL support in proxy configuration
|
||||
|
||||
# 72.0.3626.120
|
||||
* add support for resource type in adblock engine (fixes https://github.com/bromite/bromite/issues/115)
|
||||
* adblock engine speed optimizations
|
||||
* use adblock engine also in SystemWebView
|
||||
* add back uBlock Origin and EasyList filters
|
||||
* added Fanboy's Annoyance List
|
||||
* remove AdGuard filters
|
||||
|
||||
# 72.0.3626.119
|
||||
* use AdGuard filters
|
||||
* fixes for new tile rows usage
|
||||
* re-introduce patch to hide NTP tiles
|
||||
* disable NTP tile metrics collection
|
||||
|
||||
# 72.0.3626.114
|
||||
* use 4 tile rows instead of 2 in the new tab page
|
||||
* do not grant geolocation permission to default search engine (fixes https://github.com/bromite/bromite/issues/250)
|
||||
|
||||
# 72.0.3626.108
|
||||
|
||||
# 72.0.3626.99
|
||||
|
||||
# 72.0.3626.87
|
||||
* update bookmarks view after import
|
||||
|
||||
# 72.0.3626.81
|
||||
* serve empty content for blocked scripts/images (fixes https://github.com/bromite/bromite/issues/238)
|
||||
* keep support of Jelly Bean (workaround for upstream https://bugs.chromium.org/p/chromium/issues/detail?id=923477)
|
||||
|
||||
# 72.0.3626.73
|
||||
|
||||
# 72.0.3626.68
|
||||
* do not ignore save prompt for users without SD card (workaround for upstream wontfix https://bugs.chromium.org/p/chromium/issues/detail?id=916606)
|
||||
* remove third_party/analytics patch (now fixed upstream in https://chromium.googlesource.com/chromium/src.git/+/64d6a56f094efbab83802c07ad3ddffa014f9903)
|
||||
* AV1 codec support
|
||||
|
||||
# 71.0.3578.132
|
||||
* add patches from AndroidHardening project (fixes https://github.com/bromite/bromite/issues/226)
|
||||
|
||||
# 71.0.3578.123
|
||||
* disable jumbo builds (fixes https://github.com/bromite/bromite/issues/216 and https://github.com/bromite/bromite/issues/219)
|
||||
* disable preview fetching
|
||||
* do not consider Android Jelly Bean unsupported
|
||||
|
||||
# 71.0.3578.120
|
||||
* fix breakage of translate quick answers by anti-AMP (fixes https://github.com/bromite/bromite/issues/210)
|
||||
|
||||
# 71.0.3578.115
|
||||
* add AdGuard DNS-over-HTTPS option
|
||||
* use green icon for SystemWebView
|
||||
|
||||
# 71.0.3578.110
|
||||
|
||||
# 71.0.3578.104
|
||||
* fix AMP links sanitisation; have it working for news as well (fixes https://github.com/bromite/bromite/issues/202)
|
||||
* revert upstream patch responsible for the broken save dialog prompt (upstream: https://bugs.chromium.org/p/chromium/issues/detail?id=916606)
|
||||
|
||||
# 71.0.3578.101
|
||||
|
||||
# 71.0.3578.98
|
||||
* do not ask permissions for camera when importing bookmarks (fixes https://github.com/bromite/bromite/issues/200)
|
||||
|
||||
# 71.0.3578.88
|
||||
* add proxy configuration page (see https://github.com/bromite/bromite/wiki/ProxyConfiguration)
|
||||
* use more recent versions in User-Agent (fixes https://github.com/bromite/bromite/issues/156)
|
||||
|
||||
# 71.0.3578.85
|
||||
* fix blurry adaptive icon (fixes https://github.com/bromite/bromite/issues/197)
|
||||
|
||||
# 71.0.3578.76
|
||||
|
||||
# 71.0.3578.72
|
||||
* add flag to disable IPv6 probes
|
||||
|
||||
# 70.0.3538.107
|
||||
* added adaptive icon (fixes https://github.com/bromite/bromite/issues/181)
|
||||
* do not change randomisation at each call (fixes https://github.com/bromite/bromite/issues/177)
|
||||
* do not enable #enable-scroll-anchor-serialization by default
|
||||
|
||||
# 70.0.3538.102
|
||||
* do not grant notifications to default search engine
|
||||
* remove all promos from bookmark manager page
|
||||
* re-introduced various patches to eradicate binary blob dependencies (only Cast left)
|
||||
* remove contacts picker permission
|
||||
|
||||
# 70.0.3538.95
|
||||
* fix crash on bookmark edit activity (fixes https://github.com/bromite/bromite/issues/172)
|
||||
* fix slow chrome://flags (fixes https://github.com/bromite/bromite/issues/173)
|
||||
* enable TLS 1.3 final support by default (fixes https://github.com/bromite/bromite/issues/174)
|
||||
* dropped some patches related to GCM/GMS on suspicion of being related to random crashes
|
||||
|
||||
# 70.0.3538.87
|
||||
* enable history requirement of user gesture (fixes https://github.com/bromite/bromite/issues/171)
|
||||
* enable serialization of scroll position changes while loading (fixes https://github.com/bromite/bromite/issues/171)
|
||||
* remove passwords keyboard accessory option (fixes https://github.com/bromite/bromite/issues/171)
|
||||
* some improvements to bookmark import/export interaction
|
||||
* add flag to disable orientation API, disabled by default
|
||||
* disable device motion API by default (fixes https://github.com/bromite/bromite/issues/171)
|
||||
|
||||
# 70.0.3538.83
|
||||
* fix keep session cookies option showing on all site settings views
|
||||
* fix blank site settings entry showing (fixes https://github.com/bromite/bromite/issues/166)
|
||||
* offer builtin autocomplete for chrome://flags quick access
|
||||
|
||||
# 70.0.3538.80
|
||||
* add flag to disable video resume functionality, allowing to not pause video playback on tab switch (fixes https://github.com/bromite/bromite/issues/108)
|
||||
* prevent "are you there" prompts from appearing when playing videos
|
||||
* completely disable update scheduler checks to fix a related crash
|
||||
|
||||
# 70.0.3538.77
|
||||
* disable generic sensor APIs by default (fixes https://github.com/bromite/bromite/issues/160)
|
||||
* introduce flag to disable device motion API (fixes https://github.com/bromite/bromite/issues/160)
|
||||
* add Quad9 as a DNS-over-HTTPS (DoH) option (fixes https://github.com/bromite/bromite/issues/140)
|
||||
|
||||
# 70.0.3538.71
|
||||
* fix bug with canvas fingerprinting (fixes https://github.com/bromite/bromite/issues/154)
|
||||
|
||||
# 70.0.3538.67
|
||||
* re-enabled DNS-over-HTTPS (DoH) flag (fixes https://github.com/bromite/bromite/issues/139)
|
||||
* dropped GCM removal patch
|
||||
* disable kSigninAllowedOnNextStartup by default
|
||||
* permanently disable query-in-omnibox (fixes https://github.com/bromite/bromite/issues/143)
|
||||
|
||||
# 69.0.3497.113
|
||||
* disabled DNS-over-HTTPS (DoH) flag, not working since 69.0.3497.73 (see https://github.com/bromite/bromite/issues/139)
|
||||
|
||||
# 69.0.3497.109
|
||||
|
||||
# 69.0.3497.102
|
||||
* ungoogled-chromium: disable network time tracker
|
||||
* ungoogled-chromium: remove third-party/analytics
|
||||
* ungoogled-chromium: always use local Devtools instead of remote files
|
||||
* build without safebrowsing
|
||||
* drop "Hide NTP tiles" flag
|
||||
|
||||
# 69.0.3497.91
|
||||
* fixed crash when accessing site settings media preferences (fixes https://github.com/bromite/bromite/issues/122)
|
||||
|
||||
# 69.0.3497.73
|
||||
* enabled WebRTC
|
||||
* drop clear HTTP cache patch
|
||||
|
||||
# 68.0.3440.126
|
||||
* add option to disallow custom tab intents (fixes https://github.com/bromite/bromite/issues/117)
|
||||
* add option to keep local data until browser exit (fixes https://github.com/bromite/bromite/issues/56)
|
||||
* remember preference for tabs persistence option
|
||||
* extend anti-AMP to all search results
|
||||
|
||||
# 68.0.3440.121
|
||||
* add option to not persist tabs across sessions (fixes https://github.com/bromite/bromite/issues/106)
|
||||
* always incognito mode (fixes https://github.com/bromite/bromite/issues/18)
|
||||
* disable domain reliability (ungoogled-chromium)
|
||||
* more efficient adblock interception by using proper handler
|
||||
* fix log message about default maximum connections
|
||||
* improvement for exit menu patch
|
||||
|
||||
# 68.0.3440.110
|
||||
* add import action to Bookmarks activity page
|
||||
* use different user-agent version based on Android OS version
|
||||
|
||||
# 68.0.3440.90
|
||||
* reduce rects randomisation by factor of 100
|
||||
* use a fixed user-agent (fixes https://github.com/bromite/bromite/issues/103)
|
||||
|
||||
# 68.0.3440.87
|
||||
* add export action to Bookmarks activity page
|
||||
|
||||
# 68.0.3440.81
|
||||
* fix issue with filters with an excluded domain option
|
||||
|
||||
# 68.0.3440.72
|
||||
* fix crash during some canvas rendering (fixes https://github.com/bromite/bromite/issues/95)
|
||||
* new approach to adblock filtering (fixes https://github.com/bromite/bromite/issues/90)
|
||||
* add a flag to enable higher maximum connections per host limit (fixes https://github.com/bromite/bromite/issues/61)
|
||||
* add a flag to disable custom tab intents (fixes https://github.com/bromite/bromite/issues/81)
|
||||
* add a flag to have an always-empty new tab page (fixes https://github.com/bromite/bromite/issues/82)
|
||||
* reduced randomization of TextMetrics and ClientRects results
|
||||
* disable ads metrics by default
|
||||
* disable all field trials (fixes https://github.com/bromite/bromite/issues/83)
|
||||
* re-introduced own battery API patch (fixes https://github.com/bromite/bromite/issues/80)
|
||||
|
||||
# 67.0.3396.107
|
||||
* removed patch to use Android Media Player for URLs (fixes https://github.com/bromite/bromite/issues/71)
|
||||
|
||||
# 67.0.3396.101
|
||||
* set home page to new tab page
|
||||
* adjust order of new menu entries, remove help menu item (fixes https://github.com/bromite/bromite/issues/76)
|
||||
* remove some Play Services integrations: Auth, Vision, GCM
|
||||
* remove TOS/metrics and translate
|
||||
* net/cert: increase default key length for newly-generated RSA keys
|
||||
* dns: send IPv6 connectivity probes to RIPE DNS rather than Google
|
||||
* profile-resetter: do not tick send-settings by default
|
||||
* autofill: disable autofill download manager
|
||||
* first_run: deactivate autoupdate globally
|
||||
* safe_browsing: disable incident reporting
|
||||
* safe_browsing: disable reporting of safebrowsing override
|
||||
* safe_browsing: disable cookie transmission
|
||||
* extensions: always show component extensions in the ext list
|
||||
* translate: disable fetching of translate languages from server
|
||||
|
||||
# 67.0.3396.95
|
||||
* reduce headers sent in DoH requests (fixes https://github.com/bromite/bromite/issues/70)
|
||||
* serve DoH requests with maximum priority
|
||||
* `CloudFlare` -> `Cloudflare` (fixes https://github.com/bromite/bromite/issues/73)
|
||||
* fingerprint mitigations: cover also `ConvertToArrayBufferContents`
|
||||
* removed redundant own patch for battery API
|
||||
|
||||
# 67.0.3396.92
|
||||
* improve randomization for each retrieved Canvas data (fixes https://github.com/bromite/bromite/issues/69)
|
||||
|
||||
# 67.0.3396.88
|
||||
* add flag for DNS-over-HTTPS (Google experimental DNS) (fixes https://github.com/bromite/bromite/issues/68)
|
||||
* disable signin, translate and data saver UI/internal components (fixes https://github.com/bromite/bromite/issues/67)
|
||||
* rename `GoogleEN` -> `Google In English` (fixes https://github.com/bromite/bromite/issues/66)
|
||||
* re-enabled text metrics and ToDataURL, ToBlob with randomization of color data (fixes https://github.com/bromite/bromite/issues/52)
|
||||
* open YouTube links in Bromite
|
||||
* use Android Media Player for URLs
|
||||
* add exit menu item
|
||||
* hide "send reports to Google" menu item
|
||||
|
||||
# 67.0.3396.82
|
||||
|
||||
# 67.0.3396.76
|
||||
|
||||
# 67.0.3396.72
|
||||
* add global toggle for adblock engine (https://github.com/bromite/bromite/issues/53)
|
||||
|
||||
# 67.0.3396.67
|
||||
|
||||
# 66.0.3359.202
|
||||
* fix DevTools integration (https://github.com/bromite/bromite/issues/23)
|
||||
* allow toggling of Javascript from New Tab Page (fixes https://github.com/bromite/bromite/issues/60)
|
||||
|
||||
# 66.0.3359.200
|
||||
|
||||
# 66.0.3359.196
|
||||
|
||||
# 66.0.3359.188
|
||||
* increase max (persistent) connections per server from 6 to 15
|
||||
* preliminary work for better canvas fingerprinting mitigations
|
||||
|
||||
# 66.0.3359.161
|
||||
|
||||
# 66.0.3359.148
|
||||
* disable permanently all custom tab intents (https://github.com/bromite/bromite/issues/17)
|
||||
* reduce randomization for client rects from 5% to 3%
|
||||
|
||||
# 65.0.3325.230
|
||||
* fixed permission to access Google account issue (https://github.com/bromite/bromite/issues/11)
|
||||
|
||||
# 65.0.3325.218
|
||||
* always set WideVine version
|
||||
|
||||
# 65.0.3325.204
|
||||
* add menu option to toggle global Javascript preferences setting (https://github.com/bromite/bromite/issues/37)
|
||||
* add fingeprinting mitigation for getClientRects, getBoundingClientRect
|
||||
* set audio latency to fixed number
|
||||
|
||||
# 65.0.3325.198
|
||||
* re-landed support for third-party AdBlock filters
|
||||
* completed patches cleanup
|
||||
|
||||
# 65.0.3325.190
|
||||
* block some Canvas and AudioBuffer APIs mostly used for fingerprinting (https://github.com/bromite/bromite/issues/15)
|
||||
|
||||
# 65.0.3325.176
|
||||
* block plugins enumeration API
|
||||
* block battery API
|
||||
* remove device name and build id from User Agent
|
||||
* added Qwant search engine
|
||||
* disable non-working 3rd-party filters support
|
||||
|
||||
# 64.0.3282.204
|
||||
* use H264 NEON optimizations also for arm64
|
||||
* fix build of Stable channel
|
||||
* started building vanilla Chromium releases as well
|
||||
|
||||
# 64.0.3282.193
|
||||
* disable reporting
|
||||
|
||||
# 64.0.3282.182
|
||||
* add support for domain-based adblock filters
|
||||
* optimized memory allocation for filters
|
||||
|
||||
# 64.0.3282.168
|
||||
* extension: allow playing youtube/vimeo videos in background (https://github.com/bromite/bromite/issues/16)
|
||||
* never fetch most popular sites for new tab initialization, disable logo on new tab page
|
||||
* some improvements to adblock filters
|
||||
* disabled signin (ungoogled-chromium) (https://github.com/bromite/bromite/issues/31 and https://github.com/bromite/bromite/issues/11)
|
||||
* disabled webRTC and crash uploaders (ungoogled-chromium)
|
||||
* disabled translate (ungoogled-chromium)
|
||||
* disabled Gaia & GCM (ungoogled-chromium)
|
||||
* added clear HTTP cache menu item (ungoogled-chromium)
|
||||
* disabled Google host detection (ungoogled-chromium)
|
||||
* disabled profile avatar downloading (ungoogled-chromium)
|
||||
* disabled intranet redirect detector (ungoogled-chromium)
|
||||
* disabled plugin untraceable URLs (ungoogled-chromium)
|
||||
|
||||
# 64.0.3282.149
|
||||
|
||||
# 63.0.3239.150
|
||||
* fixed crash when clicking on address bar lock (page info) or opening site settings (https://github.com/bromite/bromite/issues/28)
|
||||
* build H264 with NEON optimizations for ARMv7
|
||||
* more builds for arm64 architecture
|
||||
|
||||
# 63.0.3239.144
|
||||
* fixed invalid AdBlock filter rule blocking all connections (https://github.com/bromite/bromite/issues/26)
|
||||
|
||||
# 63.0.3239.129
|
||||
|
||||
# 63.0.3239.122
|
||||
* disable webRTC completely (https://github.com/bromite/bromite/issues/9)
|
||||
* hyperlinks sanitization fixed and now accessible from Google logo click
|
||||
* now building and publishing SystemWebView apks
|
||||
|
||||
# 63.0.3239.118
|
||||
* limit impact of AMP-removal to not break tabs (https://github.com/bromite/bromite/issues/20)
|
||||
* fix DuckDuckGo and StartPage suggestions (https://github.com/bromite/bromite/issues/19)
|
||||
* revert /deep/ and ::shadow feature drop to attempt fixing DevTools support (https://github.com/bromite/bromite/issues/23)
|
||||
* remove also ads from search results
|
||||
* add Google search engine with English-only results, no RLZ and field trials
|
||||
* fix build of x86 version (was broken in previous version)
|
||||
|
||||
# 63.0.3239.85
|
||||
* no suggest URL for DuckDuckGo (https://github.com/bromite/bromite/issues/19)
|
||||
* fixed 4chan blocking rule
|
||||
* limit AMP links cleanup to search results only (fixes broken images/news result tabs)
|
||||
|
||||
# 63.0.3239.78
|
||||
* correctly set version and build numbers
|
||||
|
||||
# 63.0.3239.73
|
||||
|
||||
# 63.0.3239.64
|
||||
* fixed an issue with incognito new tab
|
||||
* permanent disable for ToS/metrics and unused auto-updates check
|
||||
|
||||
# 63.0.3239.46
|
||||
* removed search engine geolocation default patch
|
||||
|
||||
# 63.0.3239.38
|
||||
|
||||
# 63.0.3239.27
|
||||
|
||||
# 63.0.3239.24
|
||||
* convert AMP search results to regular search results
|
||||
|
||||
# 63.0.3239.15
|
||||
* remove URL tracking from Google search results
|
||||
* disable webRTC by default (https://github.com/bromite/bromite/issues/9, still not working proper)
|
||||
* do not enable search engine geolocation by default
|
||||
* use own package name (closes https://github.com/bromite/bromite/issues/1)
|
||||
* use 64bit WebView process
|
||||
|
||||
# 63.0.3239.10
|
||||
* attempt enabling API keys (didn't work)
|
||||
* added StartPage search engine (closes https://github.com/bromite/bromite/issues/3)
|
||||
|
||||
# 63.0.3239.6
|
||||
* added Bromite patch for Google search results click-tracking removal
|
||||
* added x86 target CPU
|
||||
* fixed red blink frame
|
||||
|
||||
# 63.0.3235.2
|
||||
* first release with NoChromo adblocking patch
|
||||
* Bromite patch: disable NTP remote suggestions
|
||||
* added some Inox/Iridium/Ungoogled-Chromium patches, namely:
|
||||
* DuckDuckGo search engine
|
||||
* disable battery status service
|
||||
* disable formatting in OmniBox
|
||||
* disable GCM status checks
|
||||
* use local fonts instead of fonts from Google servers
|
||||
* disable updater pings
|
||||
* do not enable Google integrations by default (translation, lookup, etc)
|
||||
* disable the ad promo system
|
||||
* do not store passwords by default
|
||||
* do not fetch Google promotions
|
||||
* restore classic NTP
|
||||
* only keep cookies until exit
|
||||
* block third-party cookies
|
||||
@@ -0,0 +1,82 @@
|
||||
# Frequently Asked Questions
|
||||
|
||||
## Does Google Sync/Translate/Data saver work?
|
||||
No.
|
||||
This is not a limitation of Bromite but of all Chromium-based projects in general, as general public is not allowed to use Google's APIs for free unless when using Chrome.
|
||||
|
||||
Additionally, these features would not be privacy-friendly.
|
||||
|
||||
## Does Bromite require root?
|
||||
No.
|
||||
|
||||
## Is Bromite de-googled?
|
||||
|
||||
Yes, although this has not been verified (and hardly can be) under all situations; if you were to find connections to cloud-based services please report them via the issue tracker.
|
||||
Bromite uses [ungoogled-chromium's python script](https://github.com/Eloston/ungoogled-chromium/blob/master/utils/domain_substitution.py) to disable URLs in the codebase since version `78.0.3904.93`.
|
||||
|
||||
Projects which follow a strict approach on this are [Iridium](https://iridiumbrowser.de/) and [Inox patchset](https://github.com/gcarq/inox-patchset).
|
||||
|
||||
## Does Bromite support DRM media?
|
||||
|
||||
Yes, in order to play protected/encrypted media content the browser will use Android's DRM media framework to automatically negotiate access (same as Chromium).
|
||||
This means for example that requests to Android license servers will be performed (`www.googleapis.com`), see https://w3c.github.io/encrypted-media/#direct-individualization
|
||||
To disable this functionality you should disable protected content playback from Site settings -> Multimedia.
|
||||
|
||||
## What is the SystemWebView?
|
||||
It is the core component of Android for all web page visualizations. For example when you access a new wifi network and need to activate it, that is using the SystemWebView. If you do not know what it is then you do not need to install it.
|
||||
|
||||
See also [the wiki page](https://github.com/bromite/bromite/wiki/Installing-SystemWebView) for community-contributed installation instructions.
|
||||
|
||||
Ad-blocking was present and always enabled in the SystemWebView from version `72.0.3626.120` till version `77.0.3865.104`, when it stopped working due to [upstream NetworkService changes](https://docs.google.com/document/d/1TZEuPvr2KAbP4_TZpuuwtEEArQsyAkc2HDu68l66YwU/edit?ts=598244df#heading=h.ougoi5i6508y).
|
||||
|
||||
## How to enable DNS-over-HTTPS?
|
||||
|
||||
See [this wiki page](https://github.com/bromite/bromite/wiki/Enabling-DNS-over-HTTPS).
|
||||
|
||||
## Can you add HTTPS everywhere?
|
||||
No.
|
||||
We cannot add add-ons to Bromite (merely some features).
|
||||
|
||||
## Is Bromite on Play Store?
|
||||
No, and this is unlikely to change. Many limitations apply for submissions there, including which ads are allowed to be blocked.
|
||||
|
||||
Bromite favors user freedom in software choice: the device is yours so you get to choose which software to run on it, end of the story.
|
||||
|
||||
## Is Bromite on F-Droid?
|
||||
It is not on the official F-Droid repository and there are no (more) plans to submit it.
|
||||
|
||||
You can use F-Droid client to install and receive updates via [the official Bromite F-Droid repository](https://www.bromite.org/fdroid).
|
||||
|
||||
## Does Bromite support WebRTC?
|
||||
Yes, since version 69. While the desktop version of Chromium has an option to disable it (video/audio site settings), the Android version cannot.
|
||||
|
||||
The WebRTC functionality has always been using safe defaults to prevent leaks (disabled multiple routes and non-proxied UDP).
|
||||
|
||||
## Using Bromite will favour the monopoly of the Chromium/Blink engine, why do you develop and maintain Bromite?
|
||||
In short, to show what a Chromium-based engine could do **for the user** if the user experience and needs were the main focus of modern browser design.
|
||||
|
||||
For an Android browser using an alternative engine see [Fennec F-Droid](https://f-droid.org/en/packages/org.mozilla.fennec_fdroid/).
|
||||
|
||||
## Does Bromite support extensions?
|
||||
No; Bromite will support extensions only if upstream (Chromium) does, or similarly another project maintains the patch and functionality.
|
||||
|
||||
## Why do push notifications not work on this website?
|
||||
|
||||
The [Chromium Blink engine](https://www.chromium.org/blink) uses [GCM](https://en.wikipedia.org/wiki/Google_Cloud_Messaging) to deliver messages
|
||||
when websites use the [Push API](https://w3c.github.io/push-api/); this will not work in Bromite because cloud integrations are disabled (GCM in this case).
|
||||
|
||||
[ServiceWorker notifications](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification) do work instead since they use
|
||||
[android.app.Notification](https://developer.android.com/guide/topics/ui/notifiers/notifications).
|
||||
|
||||
## Can PWAs be installed?
|
||||
|
||||
PWAs are only supported as home shortcuts; WebAPKs will not work because they are generated server-side on googleapis.com (which is not allowed in Bromite).
|
||||
|
||||
## Does Bromite support the Android autofill framework?
|
||||
|
||||
No; the only autofill available in Chromium browsers requires integration with the Play Store binary blobs.
|
||||
Some apps use accessibility services as a workaround.
|
||||
|
||||
## Does Bromite support casting media content?
|
||||
|
||||
No; this would require Play Store binary blobs.
|
||||
@@ -1,164 +1,185 @@
|
||||
<a href="https://github.com/uazo/cromite/releases/latest">
|
||||
<img src="https://img.shields.io/github/v/release/uazo/cromite" alt="current Cromite release" title="current Cromite release" />
|
||||
</a>
|
||||
<br>
|
||||
# Bromite - Take back your browser
|
||||
|
||||
[](https://github.com/uazo/cromite/actions/workflows/build_cromite.yaml)
|
||||
<img src="https://www.bromite.org/release.svg" alt="current Bromite release" title="current Bromite release" /> <img src="https://www.bromite.org/license.svg" alt="GNU GPL v3" title="GNU VPL v3" />
|
||||
|
||||
# Cromite (a Bromite fork) - Take back your browser
|
||||
<img title="Bromite - take back your browser!" src="https://www.bromite.org/android-icon-192x192.png" width="96" alt="Bromite" />
|
||||
|
||||
<a href="https://www.cromite.org">
|
||||
<img title="Cromite - take back your browser!" src="https://www.cromite.org/app_icon.png" width="96" alt="Bromite" />
|
||||
</a>
|
||||
<br>
|
||||
Bromite is a [Chromium](https://www.chromium.org/Home) fork with support for ad blocking and enhanced privacy.
|
||||
|
||||
Cromite is a [Chromium](https://www.chromium.org/Home) fork based on [Bromite](https://github.com/bromite/bromite) with built-in support for ad blocking and an eye for privacy.
|
||||
Bromite is only available for Android Lollipop (v5.0, API level 21) and above.
|
||||
|
||||
Cromite is available for Android arm64-v8a, arm32-v7a and x86_64, Oreo and above (Minimum v8.0, API level 26), Windows and Linux 64bit.
|
||||
<img src="https://fdroid.bromite.org/fdroid/bromite_bromite_gh_downloads.svg" alt="Downloads on Github" title="Downloads on Github" />
|
||||
|
||||
For the Frequently Asked Questions see [F.A.Q.](./FAQ.md).
|
||||
|
||||
For documentation see the [wiki](https://github.com/bromite/bromite/wiki).
|
||||
|
||||
# Goals
|
||||
|
||||
Cromite's goal is to
|
||||
- limit the features built into the browser that can be used as a platform for tracking users' habits, and, if it is not technically possible, disable them and leave it up to the user to choose whether to re-enable them
|
||||
- limit the close integration between the browser and its manufacturer
|
||||
- not let the excellent research work done by csagan5 with Bromite be lost
|
||||
Bromite aims at providing a no-clutter browsing experience without privacy-invasive features and with the addition of a fast ad-blocking engine.
|
||||
Minimal UI changes are applied to help curbing the idea of "browser as an advertisement platform".
|
||||
|
||||
In addition, Cromite would like to promote greater integration with other non-profit, open source browsers, encouraging closer collaboration with others, and attempt to integrate them directly into Chromium once they have reached an appropriate level of maturity.
|
||||
# Donate
|
||||
|
||||
Please donate to support development of Bromite and the costs for the build system.
|
||||
|
||||
[→ Support development with a donation](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JP3XTQPVRNET2): [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JP3XTQPVRNET2)
|
||||
|
||||
<a href="bitcoin:bc1qmpyuqsvs3tz3uaysplmwjr33gg4rzu6cqweaq834ehc25vduxppqkrszel">BTC donations address</a>: `bc1qmpyuqsvs3tz3uaysplmwjr33gg4rzu6cqweaq834ehc25vduxppqkrszel`
|
||||
|
||||
ETH donations address: `0xf47ff39223d828f99fec5ab53bd068c5c0522042`
|
||||
|
||||
# Features
|
||||
|
||||
* customizable adblock filters via user-provided URL (see https://www.bromite.org/custom-filters)
|
||||
* remove click-tracking and AMP from search results
|
||||
* DNS-over-HTTPS support with any valid IETF DoH endpoint
|
||||
* always-incognito mode
|
||||
* disable all field trials permanently
|
||||
* disable smart search by default, allow web search from incognito mode
|
||||
* always-visible cookies, javascript and ads site settings
|
||||
* remove Play integration binary blobs
|
||||
* use [CFI](https://en.wikipedia.org/wiki/Control-flow_integrity) on all architectures except x86
|
||||
* disable media router and remoting by default
|
||||
* disable dynamic module loading
|
||||
* show warnings for TLSv1.0/TLSv1.1 pages
|
||||
* enable site-per-process isolation for all devices with memory > 1GB
|
||||
* completely remove safe browsing and other privacy-unfriendly features
|
||||
* [proxy configuration page](https://github.com/bromite/bromite/wiki/ProxyConfiguration) with PAC and custom proxy lists support
|
||||
* settings to disable custom intents and clear session on exit
|
||||
* flags to toggle anti-fingerprinting mitigations for canvas, audio, client rects, webGL and sensor APIs (see full list below for all the new flags)
|
||||
* use frozen User-Agent to conceal real model and browser version
|
||||
* privacy enhancement patches from [Iridium](https://iridiumbrowser.de/), [Inox patchset](https://github.com/gcarq/inox-patchset), [Brave](https://brave.com/) and [ungoogled-chromium](https://github.com/Eloston/ungoogled-chromium) projects
|
||||
* security enhancement patches from [GrapheneOS](https://github.com/GrapheneOS) project
|
||||
* disable scroll-to-text-fragment
|
||||
* reduced referer granularity
|
||||
* block gateway attacks via websockets
|
||||
* use 64-bit ABI for webview processes
|
||||
* make all favicon requests on-demand ([supercookie](https://supercookie.me/) mitigation)
|
||||
* enable all network isolation features (`PartitionConnectionsByNetworkIsolationKey`, `PartitionHttpServerPropertiesByNetworkIsolationKey`, `SplitHostCacheByNetworkIsolationKey`, `AppendFrameOriginToNetworkIsolationKey`, `SplitCacheByNetworkIsolationKey`, `UseRegistrableDomainInNetworkIsolationKey`, `PartitionSSLSessionsByNetworkIsolationKey`, `PartitionExpectCTStateByNetworkIsolationKey`, `PartitionDomainReliabilityByNetworkIsolationKey`)
|
||||
* ignore enterprise policies that disallow secure DNS
|
||||
* ask permission to play protected media
|
||||
* disable the DIAL repeating discovery
|
||||
* disable RTCGetCurrentBrowsingContextMedia by default
|
||||
* disable FLoC by default
|
||||
* disable feeds
|
||||
* disable reporting of certificate errors
|
||||
* use pre-defined phone model for client hints and Javascript
|
||||
* site settings to disable images
|
||||
* allow forcing external links to open in incognito
|
||||
* disable AGSA by default
|
||||
* allow disabling JIT
|
||||
|
||||
## Features not related to privacy
|
||||
* import/export bookmarks
|
||||
* bookmark all tabs from tabs regroup menu
|
||||
* flag to allow screenshots of incognito tabs
|
||||
* allow playing videos in background tabs and disable pause on switching tabs
|
||||
* all codecs included (proprietary, open H.264 etc.)
|
||||
* [AV1 codec support](https://github.com/bromite/bromite/wiki/AV1-support)
|
||||
* [dav1d](https://code.videolan.org/videolan/dav1d) decoder enabled by default
|
||||
* built with official speed optimizations
|
||||
* increase number of autocomplete matches from 5 to 10
|
||||
* allow changing default download storage location
|
||||
* do not ignore save prompt for users without SD cards
|
||||
* disable articles and increase number of icons on new tab page
|
||||
* adding an URL as bookmark will clear its blocked status for the NTP tiles
|
||||
* history support in incognito mode
|
||||
* view source of pages
|
||||
* timezone customization
|
||||
* sticky desktop mode setting
|
||||
* disable video autoplay by default, reintroduce site settings
|
||||
* mobile/desktop user agent customization
|
||||
* accessibility preference to force tablet UI
|
||||
* use Alt+D to focus address bar
|
||||
* allow sharing to Bromite
|
||||
* browser automatic updates
|
||||
* UI for crash information collection
|
||||
|
||||
You can inspect all functionality/privacy changes by reading the [patches](https://github.com/bromite/bromite/tree/master/build/patches) and/or the [CHANGELOG](./CHANGELOG.md).
|
||||
|
||||
### Flags
|
||||
|
||||
Flags which have been retired from upstream Chromium but are still available in Bromite.
|
||||
|
||||
* `#pull-to-refresh`
|
||||
* `#enable-search-ready-omnibox`
|
||||
* `#darken-websites-checkbox-in-themes-setting`
|
||||
* `#simplified-ntp`, enabled by default
|
||||
* `#enable-text-fragment-anchor`, disabled by default
|
||||
* `#num-raster-threads`
|
||||
* `#enable-image-reader`, enabled by default
|
||||
* `#enable-tab-groups` and `#enable-tab-groups-ui-improvements`
|
||||
|
||||
New flags:
|
||||
|
||||
* `#fingerprinting-canvas-image-data-noise`, `#fingerprinting-client-rects-noise` and `#fingerprinting-canvas-measuretext-noise`, enabled by default
|
||||
* `#enable-incognito-snapshots-in-android-recents`, disabled by default
|
||||
* `#max-connections-per-host`
|
||||
* `#resume-background-video`
|
||||
* `#ipv6-probing`
|
||||
* `#disable-webgl`
|
||||
* `#enable-device-motion` and `#enable-device-orientation`
|
||||
* `#show-legacy-tls-warnings`
|
||||
* `#save-data-header`, disabled by default
|
||||
* `#export-bookmarks-use-saf`, disabled by default
|
||||
* `#allow-user-certificates`, disabled by default
|
||||
* `#cleartext-permitted`, enabled by default, can be used to disable all cleartext-HTTP traffic
|
||||
* `#omnibox-autocomplete-filtering`, can be used to restrict omnibox autocomplete results
|
||||
* `#disable-external-intent-requests`
|
||||
|
||||
# Privacy limitations
|
||||
|
||||
Cromite's privacy features, including anti-fingerprinting mitigations (which are not comprehensive), **are not to be considered useful for journalists and people living in countries with freedom limitations**, please look at [Tor Browser](https://www.torproject.org/download/) in such cases (better to use the desktop version).
|
||||
Please note that this project is not free of bugs and that changing the behaviour of a browser can be risky and not without problems.
|
||||
|
||||
# Docs
|
||||
- [Privacy Policy](https://github.com/uazo/cromite/blob/master/docs/PRIVACY_POLICY.md)
|
||||
- [Features](https://github.com/uazo/cromite/blob/master/docs/FEATURES.md)
|
||||
- [Faqs](https://github.com/uazo/cromite/blob/master/docs/FAQ.md)
|
||||
- [How to build](https://github.com/uazo/cromite/blob/master/docs/HOW_TO_BUILD.md)
|
||||
- [Patch list](https://github.com/uazo/cromite/blob/master/docs/PATCHES.md)
|
||||
Bromite's privacy features, including anti-fingerprinting mitigations (which are not comprehensive), **are not to be considered useful for journalists and people living in countries with freedom limitations**, please look at [Tor Browser](https://www.torproject.org/download/) in such cases.
|
||||
|
||||
# Releases
|
||||
|
||||
All built versions are available as [releases](https://github.com/uazo/cromite/releases).
|
||||
All built versions are available as [releases](https://github.com/bromite/bromite/releases); the [official website](https://www.bromite.org/) points to those releases and - when browsing via Android - it will automatically highlight the one apt for your device (or none otherwise).
|
||||
|
||||
Cromite is currently built for ARM, ARM64, Android x86, Windows x64 and Linux.
|
||||
Each tag corresponds to a Chromium Stable release tag.
|
||||
|
||||
The following files will be present for each release:
|
||||
Bromite is currently built for ARM, ARM64 and x86 and for the Android SDK versions 19 and 21; [Bromite SystemWebView](https://www.bromite.org/system_web_view) is provided as well (SDK21+).
|
||||
For every Bromite build you can always find a matching [vanilla Chromium](https://www.bromite.org/chromium) build which is used for example to verify which issues are specific to Bromite or not.
|
||||
|
||||
#### Cromite apk for android:
|
||||
- [arm64_ChromePublic.apk](https://github.com/uazo/cromite/releases/latest/download/arm64_ChromePublic.apk)
|
||||
- [arm_ChromePublic.apk](https://github.com/uazo/cromite/releases/latest/download/arm_ChromePublic.apk)
|
||||
- [x64_ChromePublic.apk](https://github.com/uazo/cromite/releases/latest/download/x64_ChromePublic.apk)
|
||||
You can automatically receive notifications about new updates (and install them) by enabling the auto updater functionality, see [related wiki page](https://github.com/bromite/bromite/wiki/AutomaticUpdates).
|
||||
|
||||
#### Linux package:
|
||||
- [chrome-lin64.tar.gz](https://github.com/uazo/cromite/releases/latest/download/chrome-lin64.tar.gz)
|
||||
All official releases are also available through the [official third-party F-Droid repository](https://www.bromite.org/fdroid).
|
||||
|
||||
#### Windows package:
|
||||
- [chrome-win.zip](https://github.com/uazo/cromite/releases/latest/download/chrome-win.zip)
|
||||
|
||||
#### Debugging symbols and proguard file for java stacktrace deobfuscation
|
||||
- x64_ChromePublic.apk.mapping
|
||||
- arm64_ChromePublic.apk.mapping
|
||||
- arm64_symbols.zip
|
||||
|
||||
#### Build time analysis file:
|
||||
- arm64_ninja_log_trace.html
|
||||
|
||||
#### Chrlauncher autoupdate file:
|
||||
- updateurl.txt
|
||||
|
||||
Additional files are also available: please note that these files are created by an [additional build](https://github.com/uazo/cromite/actions/workflows/build_additional_targets.yaml) separate from the release process, and therefore may not be immediately available.
|
||||
|
||||
#### Cromite System WebView apk for android:
|
||||
- arm64_SystemWebView.apk
|
||||
- x64_SystemWebView.apk
|
||||
|
||||
#### Vanilla Chromium for android (used for tests):
|
||||
- arm64_VanillaChromium.apk
|
||||
- arm_VanillaChromium.apk
|
||||
- x64_VanillaChromium.apk
|
||||
|
||||
#### SystemWebView Shell (used for tests)
|
||||
- arm64_SystemWebViewShell.apk
|
||||
- x64_SystemWebViewShell.apk
|
||||
|
||||
### F-droid
|
||||
|
||||
Official F-droid repo url:
|
||||
https://www.cromite.org/fdroid/repo/?fingerprint=49F37E74DEE483DCA2B991334FB5A0200787430D0B5F9A783DD5F13695E9517B
|
||||
|
||||
### Auto-update in Android
|
||||
|
||||
You will automatically receive notifications about new updates (and be able to install them) via the auto updater functionality.
|
||||
You will be asked whether you want to activate the functionality during the first start-up.
|
||||
|
||||
### Auto-update setup for Windows
|
||||
|
||||
1. Download https://github.com/henrypp/chrlauncher/releases
|
||||
2. Create a `chrlauncher.ini`
|
||||
## Integrity and authenticity
|
||||
|
||||
You can verify the integrity of a downloaded APK file from this project with any `sha256sum`-compatible tool by downloading the corresponding `brm_X.Y.Z.sha256.txt` or `chr_X.Y.Z.sha256.txt` file, where X.Y.Z is the release version number. Example:
|
||||
```
|
||||
[chrlauncher]
|
||||
|
||||
# Custom Chromium update URL (string):
|
||||
ChromiumUpdateUrl=https://github.com/uazo/cromite/releases/latest/download/updateurl.txt
|
||||
|
||||
# Command line for Chromium (string):
|
||||
# note --user-data-dir= works better if path is absolute
|
||||
# See here: http://peter.sh/experiments/chromium-command-line-switches/
|
||||
ChromiumCommandLine=--user-data-dir="C:\Users\<my user>\AppData\Local\Cromite\User Data" --no-default-browser-check
|
||||
|
||||
# to enable full logging in c:\temp\log.txt (daily rotate, no automatic deletion)
|
||||
# ChromiumCommandLine=--enable-logging --v=0 --log-file=C:\temp\log.txt --user-data-dir=".\User Data" --no-default-browser-check
|
||||
|
||||
# Chromium executable file name (string):
|
||||
ChromiumBinary=chrome.exe
|
||||
|
||||
# Chromium binaries directory (string):
|
||||
# Relative (to chrlauncher directory) or full path (env. variables supported).
|
||||
ChromiumDirectory=.\bin
|
||||
```
|
||||
To prevent deletion by Microsoft Defender each time the browser is updated, check the `user-data-dir` folder by modifying it accordingly.
|
||||
|
||||
### Enable network process sandbox in windows
|
||||
I don't include any setups because I don't like the experience of not knowing what they do, so you must manually run this command on first installation:
|
||||
```
|
||||
cd <where_is_the_exe>
|
||||
icacls . /grant "*S-1-15-2-2:(OI)(CI)(RX)"
|
||||
```
|
||||
see https://github.com/uazo/bromite-buildtools/issues/51
|
||||
|
||||
### Enable AppContainer for renderer process in windows
|
||||
you can activate (highly recommended) the 'RendererAppContainer' flag from the command line with
|
||||
```
|
||||
--enable-features=RendererAppContainer
|
||||
$ sha256sum --check brm_68.0.3440.54.sha256.txt
|
||||
arm64_SystemWebView.apk: OK
|
||||
arm64_ChromePublic.apk: OK
|
||||
arm64_ChromeModernPublic.apk: OK
|
||||
```
|
||||
|
||||
### Auto-update setup for linux
|
||||
working in progress in https://github.com/uazo/cromite/issues/771
|
||||
|
||||
### Making Cromite work in Ubuntu 24.04 and its derivatives (kubuntu, etc)
|
||||
This happens because, starting with Ubuntu 24.04, Apparmor
|
||||
restricts the use of unprivileged user namespaces. To fix this, you have several options:
|
||||
#### 1. Creating an apparmor profile for cromite
|
||||
Create `/etc/apparmor.d/chrome`, and write:
|
||||
You can verify authenticity, e.g. that the author ([csagan5](https://github.com/csagan5)) released the file, by using gpg2:
|
||||
```
|
||||
abi <abi/4.0>,
|
||||
include <tunables/global>
|
||||
|
||||
profile cromite /home/user/cromite/chrome-lin/chrome flags=(unconfined) {
|
||||
userns,
|
||||
|
||||
include if exists <local/chrome>
|
||||
}
|
||||
$ gpg2 --quiet --verify brm_68.0.3440.54.sha256.txt.asc
|
||||
gpg: assuming signed data in 'brm_68.0.3440.54.sha256.txt'
|
||||
gpg: Signature made Sun 08 Jul 2018 04:22:52 PM CEST using RSA key ID D85DC0C5
|
||||
gpg: Good signature from "csagan5 <32685696+csagan5@users.noreply.github.com>"
|
||||
```
|
||||
replacing the cromite binary path with where you have placed cromite.
|
||||
|
||||
Now, run `sudo apparmor_parser -r /etc/apparmor.d/cromite` to apply the changes.
|
||||
#### 2. Disabling the restriction until next reboot
|
||||
`sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0`
|
||||
#### 3. Disabling the restriction permanently
|
||||
Add `kernel.apparmor_restrict_unprivileged_userns=0` to the file `/etc/sysctl.d/60-apparmor-namespace.conf`. Create the file if not exists.
|
||||
You can download csagan5's public GnuPG key from here: [csagan5.asc](./csagan5.asc).
|
||||
|
||||
# How to build
|
||||
|
||||
The [Bromite main repository](https://github.com/bromite/bromite) contains tags for each corresponding Chromium release (see https://chromium.googlesource.com/chromium/src.git).
|
||||
|
||||
Please refer to [official Chromium build documentation](https://www.chromium.org/developers/how-tos/get-the-code) to get started on how to build Chromium; if you can build Chromium for Android, you can build Bromite.
|
||||
|
||||
The Chromium version tag used as base for the patches is available here: [RELEASE](./build/RELEASE); this is always corresponding to the git tag for every release.
|
||||
The GN args used to build Bromite are available here: [GN_ARGS](./build/GN_ARGS).
|
||||
The patches are to be applied second the order specified in the `bromite_patches_list.txt` file (you can use `git am`).
|
||||
|
||||
## How to build the filters
|
||||
|
||||
See upstream documentation: https://github.com/chromium/chromium/blob/master/components/subresource_filter/FILTER_LIST_GENERATION.md
|
||||
|
||||
Bromite uses an unindexed filter file, which is periodically published at https://github.com/bromite/filters
|
||||
|
||||
# Contributing
|
||||
|
||||
@@ -166,36 +187,32 @@ Please submit issues following the issue template; beware that GitHub does not d
|
||||
|
||||
Patches are welcome and accepted if they match the project goals.
|
||||
|
||||
If you want to help me, [here](https://github.com/uazo/cromite/blob/master/docs/HELP_ME_PLEASE.md) is the list of things I would need.
|
||||
|
||||
For any usage or development discussion please use GitHub Discussions: https://github.com/uazo/cromite/discussions
|
||||
For any usage or development discussion please use GitHub Discussions: https://github.com/bromite/bromite/discussions
|
||||
|
||||
# Credits
|
||||
|
||||
* [Chromium project](https://www.chromium.org/Home) and developers
|
||||
* [Bromite](https://github.com/bromite/bromite)
|
||||
* [Iridium project](https://github.com/iridium-browser) for some patches
|
||||
* [ungoogled-chromium](https://github.com/Eloston/ungoogled-chromium) for some patches
|
||||
* [ungoogled-chromium-android](https://github.com/ungoogled-software/ungoogled-chromium-android) for some patches
|
||||
* [GrapheneOS](https://github.com/GrapheneOS) for some security patches
|
||||
* [Inox patchset](https://github.com/gcarq/inox-patchset) for some patches (via ungoogled-chromium)
|
||||
* [Brave Browser](https://github.com/brave/brave-core) for some patches
|
||||
* [Iridium project](https://github.com/iridium-browser) for some patches
|
||||
* [ungoogled-chromium](https://github.com/Eloston/ungoogled-chromium) for some patches
|
||||
* [ungoogled-chromium-android](https://github.com/ungoogled-software/ungoogled-chromium-android) for some patches
|
||||
* [GrapheneOS](https://github.com/GrapheneOS) for some security patches
|
||||
* [Inox patchset](https://github.com/gcarq/inox-patchset) for some patches (via ungoogled-chromium)
|
||||
* [Brave Browser](https://github.com/brave/brave-core) for some patches
|
||||
* [Vadim Pleshkov](http://vadimpleshkov.me/) for Bromite's logo
|
||||
|
||||
thanks to [austinhuang0131](https://github.com/austinhuang0131) for the svg icon
|
||||
# Filters credits
|
||||
* [EasyList](https://easylist.to/#easylist)
|
||||
* [EasyPrivacy](https://easylist.to/#easyprivacy)
|
||||
* [uBlock Origin](https://github.com/uBlockOrigin)
|
||||
* [Peter Lowe's Ad and tracking server list](https://pgl.yoyo.org/adservers/)
|
||||
|
||||
# Donate
|
||||
|
||||
If you want, you can donate to support cromite development through [paypal](https://www.paypal.com/pools/c/9e5lO2OIzb).
|
||||
|
||||
Current link:
|
||||
- https://www.paypal.com/pools/c/9e5lO2OIzb
|
||||
|
||||
Historical fundraisings links:
|
||||
- https://www.paypal.com/pools/c/9cwNgAQhRL
|
||||
The URLs of the lists used are available at: https://github.com/bromite/filters/blob/master/lists.txt
|
||||
|
||||
# License
|
||||
|
||||
Cromite is published under [GNU GPL v3](./LICENSE).
|
||||
The patches published as part of the Bromite project are released under GNU GPL v3 only.
|
||||
Cromite specific patches are under the GNU GPL-2+ licence.
|
||||
Each individual patch contains specific information on the licence used.
|
||||
The patches published as part of the Bromite project are released under [GNU GPL v3](./LICENSE).
|
||||
|
||||
[version-image]: https://img.shields.io/github/release/bromite/bromite.svg?style=flat-square
|
||||
[version-url]: https://github.com/bromite/bromite/releases/latest
|
||||
[license-image]: https://img.shields.io/github/license/bromite/bromite.svg
|
||||
[license-url]: https://github.com/bromite/bromite/blob/master/LICENSE
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
android_channel="stable"
|
||||
blink_symbol_level=1
|
||||
chrome_pgo_phase=0
|
||||
dcheck_always_on=false
|
||||
debuggable_apks=false
|
||||
dfmify_dev_ui=false
|
||||
disable_android_lint=true
|
||||
disable_autofill_assistant_dfm=true
|
||||
disable_fieldtrial_testing_config=true
|
||||
disable_tab_ui_dfm=true
|
||||
enable_av1_decoder=true
|
||||
enable_dav1d_decoder=true
|
||||
enable_gvr_services=false
|
||||
enable_hangout_services_extension=false
|
||||
enable_iterator_debugging=false
|
||||
enable_mdns=false
|
||||
enable_mse_mpeg2ts_stream_parser=true
|
||||
enable_nacl=false
|
||||
enable_nacl_nonsfi=false
|
||||
enable_platform_dolby_vision=true
|
||||
enable_platform_hevc=true
|
||||
enable_remoting=false
|
||||
enable_reporting=false
|
||||
enable_vr=false
|
||||
exclude_unwind_tables=false
|
||||
ffmpeg_branding="Chrome"
|
||||
icu_use_data_file=true
|
||||
is_component_build=false
|
||||
is_debug=false
|
||||
is_official_build=true
|
||||
proprietary_codecs=true
|
||||
rtc_build_examples=false
|
||||
safe_browsing_mode=0
|
||||
symbol_level=1
|
||||
target_os="android"
|
||||
use_debug_fission=true
|
||||
use_errorprone_java_compiler=false
|
||||
use_gnome_keyring=false
|
||||
use_official_google_api_keys=false
|
||||
use_rtti=false
|
||||
use_sysroot=false
|
||||
webview_includes_weblayer=false
|
||||
+1
-1
@@ -1 +1 @@
|
||||
138.0.7204.184
|
||||
94.0.4606.102
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
Disable-third-party-cookies-by-default.patch
|
||||
AV1-codec-support.patch
|
||||
Switch-to-fstack-protector-strong.patch
|
||||
Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
|
||||
Restore-classic-new-tab-page.patch
|
||||
Always-use-new-tab-page-for-default-home-page.patch
|
||||
Always-allow-partner-customisation.patch
|
||||
battery_status_service-disable-more-privacy-nightmares.patch
|
||||
Battery-API-return-nothing.patch
|
||||
updater-disable-updater-pings.patch
|
||||
Remove-EV-certificates.patch
|
||||
promo-disable-Google-promotion-fetching.patch
|
||||
Disable-omission-of-URL-elements-in-Omnibox.patch
|
||||
Modify-default-preferences.patch
|
||||
Do-not-hide-component-extensions.patch
|
||||
Do-not-store-passwords-by-default.patch
|
||||
Disable-NTP-remote-suggestions-by-default.patch
|
||||
Disable-references-to-fonts.googleapis.com.patch
|
||||
Change-default-webRTC-policy-to-not-use-any-address.patch
|
||||
Never-send-any-crash-upload-data.patch
|
||||
Hide-send-reports-checkbox.patch
|
||||
Never-fetch-popular-sites.patch
|
||||
ungoogled-chromium-Disable-webRTC-log-uploader.patch
|
||||
ungoogled-chromium-Disable-untraceable-URLs.patch
|
||||
ungoogled-chromium-Disable-translate-integration.patch
|
||||
ungoogled-chromium-Disable-profile-avatar.patch
|
||||
ungoogled-chromium-Disable-intranet-redirect-detector.patch
|
||||
ungoogled-chromium-Disable-Google-host-detection.patch
|
||||
ungoogled-chromium-Disable-Gaia.patch
|
||||
ungoogled-chromium-Disable-domain-reliability.patch
|
||||
ungoogled-chromium-Disable-Network-Time-Tracker.patch
|
||||
Disable-safe-browsing.patch
|
||||
Skip-the-first-run-and-metrics.patch
|
||||
Disable-all-promo-dialogs.patch
|
||||
Remove-signin-and-data-saver-integrations.patch
|
||||
Hide-passwords-manager-link.patch
|
||||
Disable-update-scheduler.patch
|
||||
Add-English-only-search-engine.patch
|
||||
Add-DuckDuckGo-Lite-search-engine.patch
|
||||
openH264-enable-ARM-ARM64-optimizations.patch
|
||||
build-remove-calling-untrusted-hooks.patch
|
||||
Inject-scripts-for-AMP-tracking-ads-and-video.patch
|
||||
Allow-playing-audio-in-background.patch
|
||||
Add-flag-to-control-video-playback-resume-feature.patch
|
||||
Open-YouTube-links-in-Bromite.patch
|
||||
Add-exit-menu-item.patch
|
||||
Remove-help-menu-item.patch
|
||||
AudioBuffer-AnalyserNode-fp-mitigations.patch
|
||||
Multiple-fingerprinting-mitigations.patch
|
||||
Disable-metrics-on-all-I-O-threads.patch
|
||||
Always-respect-async-dns-flag-regardless-of-SDK-version.patch
|
||||
Add-flag-to-configure-maximum-connections-per-host.patch
|
||||
Do-not-ignore-download-location-prompt-setting.patch
|
||||
Add-bookmark-import-export-actions.patch
|
||||
Add-an-always-incognito-mode.patch
|
||||
Add-option-to-not-persist-tabs-across-sessions.patch
|
||||
Disable-fetching-of-all-field-trials.patch
|
||||
Disable-seed-based-field-trials.patch
|
||||
Disable-plugins-enumeration.patch
|
||||
net-cert-increase-default-key-length-for-newly-generated-RSA-keys.patch
|
||||
dns-send-IPv6-connectivity-probes-to-RIPE-DNS.patch
|
||||
profile-resetter-do-not-tick-send-settings-by-default.patch
|
||||
Do-not-build-API-keys-infobar.patch
|
||||
autofill-disable-autofill-download-manager.patch
|
||||
first_run-deactivate-autoupdate-globally.patch
|
||||
translate-disable-fetching-of-translate-languages-from-server.patch
|
||||
kill-TOS-and-metrics-opt-out.patch
|
||||
kill-Vision.patch
|
||||
kill-Location-fall-back-to-system.patch
|
||||
kill-Auth.patch
|
||||
Remove-binary-blob-integrations.patch
|
||||
Remove-SMS-integration.patch
|
||||
Do-not-compile-QR-code-sharing.patch
|
||||
Allow-website-sign-in-without-account-sign-in.patch
|
||||
Offer-builtin-autocomplete-for-chrome-flags.patch
|
||||
Disable-search-engine-DSE-automatic-permission.patch
|
||||
Add-flag-to-disable-IPv6-probes.patch
|
||||
Add-a-proxy-configuration-page.patch
|
||||
Use-4-tile-rows-never-show-logo.patch
|
||||
Disable-metrics-collection-for-NTP-tiles.patch
|
||||
Enable-SPPI-for-devices-with-enough-memory.patch
|
||||
Use-64-bit-WebView-processes.patch
|
||||
prefs-disable-signinallowed-by-default.patch
|
||||
prefs-always-prompt-for-download-directory-by-default.patch
|
||||
Disable-offline-pages-in-the-downloads-home-to-be-opened-in-CCT-by-default.patch
|
||||
disable-payment-support-by-default.patch
|
||||
disable-background-sync-by-default.patch
|
||||
disable-sensors-access-site-setting-by-default.patch
|
||||
Disable-media-router-and-remoting-by-default.patch
|
||||
Restore-Search-Ready-Omnibox-flag.patch
|
||||
disable-AdsBlockedInfoBar.patch
|
||||
Bromite-AdBlockUpdaterService.patch
|
||||
Replace-DoH-probe-domain-with-RIPE-domain.patch
|
||||
Increase-number-of-autocomplete-matches-from-5-to-10.patch
|
||||
Disable-HEAD-requests-for-single-word-Omnibar-searches.patch
|
||||
Disable-some-signed-exchange-features.patch
|
||||
Add-flag-to-disable-WebGL.patch
|
||||
DoH-secure-mode-by-default.patch
|
||||
Reduce-HTTP-headers-in-DoH-requests-to-bare-minimum.patch
|
||||
Revert-flags-remove-disable-pull-to-refresh-effect.patch
|
||||
Use-dummy-DFM-installer.patch
|
||||
Disable-feeds-support-by-default.patch
|
||||
Disable-autofill-assistant-by-default.patch
|
||||
Show-site-settings-for-cookies-javascript-and-ads.patch
|
||||
Disable-DRM-media-origin-IDs-preprovisioning.patch
|
||||
Disable-smart-selection-by-default.patch
|
||||
Enable-user-agent-freeze-by-default.patch
|
||||
disable-browser-autologin-by-default.patch
|
||||
AImageReader-CFI-crash-mitigations.patch
|
||||
Update-i18n-zh_CN-support.patch
|
||||
Add-a-flag-to-allow-screenshots-in-Incognito-mode.patch
|
||||
Add-menu-item-to-view-source.patch
|
||||
Block-gateway-attacks-via-websockets.patch
|
||||
Enable-prefetch-privacy-changes-by-default.patch
|
||||
Disable-support-for-RAR-files-inspection.patch
|
||||
Add-history-support-in-incognito-mode.patch
|
||||
Enable-darken-websites-checkbox-in-themes.patch
|
||||
Remove-blocklisted-URLs-upon-bookmark-creation.patch
|
||||
Disable-the-DIAL-repeating-discovery.patch
|
||||
Block-qjz9zk-or-trk-requests.patch
|
||||
Hardening-against-incognito-mode-detection.patch
|
||||
Remove-weblayer-dependency-on-Play-Services.patch
|
||||
Timezone-customization.patch
|
||||
Move-some-account-settings-back-to-privacy-settings.patch
|
||||
Restore-Simplified-NTP-launch.patch
|
||||
Revert-the-removal-of-an-option-to-block-autoplay.patch
|
||||
Disable-text-fragments-by-default.patch
|
||||
disable-WebView-variations-support.patch
|
||||
disable-autofill-server-communication-by-default.patch
|
||||
ask-permission-to-play-protected-media-by-default.patch
|
||||
Enable-network-isolation-features.patch
|
||||
Disable-unified-autoplay-feature.patch
|
||||
Revert-flags-remove-num-raster-threads.patch
|
||||
webview-Hard-no-to-persistent-histograms.patch
|
||||
Ignore-enterprise-policies-for-secure-DNS.patch
|
||||
Add-menu-item-to-bookmark-all-tabs.patch
|
||||
Add-flag-for-save-data-header.patch
|
||||
Add-option-to-force-tablet-UI.patch
|
||||
Make-all-favicon-requests-on-demand.patch
|
||||
Add-Alt-D-hotkey-to-focus-address-bar.patch
|
||||
Remove-offline-measurement-background-task.patch
|
||||
User-agent-customization.patch
|
||||
Add-AllowUserCertificates-flag.patch
|
||||
Add-IsCleartextPermitted-flag.patch
|
||||
Unexpire-tab-groups-flags.patch
|
||||
Add-flag-for-omnibox-autocomplete-filtering.patch
|
||||
Enable-IntentBlockExternalFormRedirectsNoGesture-by-default.patch
|
||||
Add-flag-to-disable-external-intent-requests.patch
|
||||
Logcat-crash-reports-UI.patch
|
||||
Add-support-for-ISupportHelpAndFeedback.patch
|
||||
JIT-less-toggle.patch
|
||||
API-level-21-prevent-crash-on-download.patch
|
||||
Add-flag-to-disable-vibration.patch
|
||||
mime_util-force-text-x-suse-ymp-to-be-downloaded.patch
|
||||
Override-UA-client-hint-for-model.patch
|
||||
Disable-AGSA-by-default.patch
|
||||
Allow-building-without-enable_reporting.patch
|
||||
Disable-lock-icon-in-address-bar-by-default.patch
|
||||
Add-custom-tab-intents-privacy-option.patch
|
||||
Enable-share-intent.patch
|
||||
Site-setting-for-images.patch
|
||||
Bromite-auto-updater.patch
|
||||
Add-flag-to-disable-pull-to-refresh-effect.patch
|
||||
Automated-domain-substitution.patch
|
||||
@@ -1,9 +0,0 @@
|
||||
# infra/config/generated/builders/ci/android-official/gn-args.json
|
||||
debuggable_apks = false
|
||||
is_official_build = true
|
||||
|
||||
# the official instructions use symbol_level=2 but I do not need the debug symbols
|
||||
symbol_level = 0
|
||||
|
||||
# do not make the second build of v8
|
||||
include_both_v8_snapshots = false
|
||||
@@ -0,0 +1,4 @@
|
||||
AV1-codec-support.patch
|
||||
Switch-to-fstack-protector-strong.patch
|
||||
Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
|
||||
Disable-feeds-support-by-default.patch
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,36 +0,0 @@
|
||||
)]}'
|
||||
{
|
||||
"response": {
|
||||
"server": "prod",
|
||||
"protocol": "3.1",
|
||||
"app": [
|
||||
{
|
||||
"appid": "gcmjkmgdlgnkkcocmoeiminaijmmjnii",
|
||||
"status": "ok",
|
||||
"updatecheck": {
|
||||
"status": "ok",
|
||||
"urls": {
|
||||
"url": [
|
||||
{
|
||||
"codebase": "https://www.cromite.org/components/"
|
||||
}
|
||||
]
|
||||
},
|
||||
"manifest": {
|
||||
"version": "1.0.0",
|
||||
"packages": {
|
||||
"package": [
|
||||
{
|
||||
"hash_sha256": "22639FA1B21D9D95E6343A6A58028B224903D23BA404537584A22236FCFC3482",
|
||||
"name": "fonts_component.zip",
|
||||
"fp": "1.22639FA1B21D9D95E6343A6A58028B224903D23BA404537584A22236FCFC3482",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
)]}' {
|
||||
"response": {
|
||||
"server": "prod",
|
||||
"protocol": "4.0",
|
||||
"apps": [
|
||||
{
|
||||
"appid": "gcmjkmgdlgnkkcocmoeiminaijmmjnii",
|
||||
"status": "ok",
|
||||
"updatecheck": {
|
||||
"status": "ok",
|
||||
"nextversion": "1.0.0",
|
||||
"pipelines": [
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"type": "download",
|
||||
"urls": [ { "url": "https://www.cromite.org/components/fonts_component.zip" } ],
|
||||
"out": { "sha256": "22639FA1B21D9D95E6343A6A58028B224903D23BA404537584A22236FCFC3482" },
|
||||
"size": 60716451
|
||||
},
|
||||
{
|
||||
"type": "crx3",
|
||||
"in": { "sha256": "22639FA1B21D9D95E6343A6A58028B224903D23BA404537584A22236FCFC3482" }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,186 +0,0 @@
|
||||
android_channel="stable"
|
||||
blink_symbol_level=1
|
||||
build_contextual_search=false
|
||||
build_with_tflite_lib=false
|
||||
chrome_pgo_phase=0
|
||||
dcheck_always_on=false
|
||||
disable_android_lint=true
|
||||
disable_fieldtrial_testing_config=true
|
||||
enable_hangout_services_extension=false
|
||||
enable_iterator_debugging=false
|
||||
enable_mdns=false
|
||||
enable_nacl=false
|
||||
enable_remoting=false
|
||||
enable_reporting=false
|
||||
enable_vr=false
|
||||
exclude_unwind_tables=false
|
||||
icu_use_data_file=true
|
||||
is_component_build=false
|
||||
is_debug=false
|
||||
is_official_build=true
|
||||
rtc_build_examples=false
|
||||
symbol_level=1
|
||||
treat_warnings_as_errors=true
|
||||
use_debug_fission=true
|
||||
use_errorprone_java_compiler=false
|
||||
use_official_google_api_keys=false
|
||||
use_rtti=false
|
||||
use_sysroot=false
|
||||
webview_includes_weblayer=false
|
||||
enable_arcore=false
|
||||
enable_openxr=false
|
||||
enable_cardboard=false
|
||||
is_high_end_android=true
|
||||
|
||||
# media section
|
||||
proprietary_codecs=true
|
||||
ffmpeg_branding="Chrome"
|
||||
enable_av1_decoder=true
|
||||
enable_dav1d_decoder=true
|
||||
|
||||
# disable cisco OpenH264
|
||||
media_use_openh264 = false
|
||||
|
||||
# decoder flags
|
||||
if (target_os == "android" || target_os == "win") {
|
||||
# codec supported by default
|
||||
# android: https://developer.android.com/media/platform/supported-formats
|
||||
# windows: https://learn.microsoft.com/en-us/windows/win32/medfound/codecobjects
|
||||
|
||||
# enable aac and h264 hw decoder only
|
||||
enable_platform_aac_audio = true
|
||||
enable_platform_h264_video = true
|
||||
|
||||
# enable hw decoder for h265 (hevc)
|
||||
enable_platform_hevc = true
|
||||
|
||||
# disable dolby vision
|
||||
enable_platform_dolby_vision = false
|
||||
enable_platform_encrypted_dolby_vision = false
|
||||
|
||||
if (target_os == "win") {
|
||||
# enable ac3/eac codec
|
||||
enable_platform_ac3_eac3_audio = true
|
||||
}
|
||||
}
|
||||
|
||||
# disable passthrough audio codecs
|
||||
enable_platform_dts_audio = false
|
||||
enable_passthrough_audio_codecs = false
|
||||
|
||||
# Do not compile libmonochrome.so with RELR relocations
|
||||
# since supported only on API 28+
|
||||
use_relr_relocations=false
|
||||
|
||||
# disabled the use of the context snapshot
|
||||
# see https://github.com/uazo/cromite/pull/317 for context
|
||||
use_v8_context_snapshot = false
|
||||
|
||||
# enable libjxl support by default
|
||||
enable_jxl_decoder = false
|
||||
|
||||
# disable minikin engine
|
||||
# see https://github.com/uazo/cromite/issues/697
|
||||
use_minikin_hyphenation = false
|
||||
|
||||
# disable automatic update of sync-related cookies
|
||||
# initial commit: https://source.chromium.org/chromium/chromium/src/+/fd9a841f7a63b9f5510f6b713d9c833d259c63ad
|
||||
enable_bound_session_credentials = false
|
||||
|
||||
# Use LogErrorNotReached() for NOTREACHED_IN_MIGRATION()
|
||||
enable_log_error_not_reached = true
|
||||
|
||||
# Allows building without //third_party/unrar included, for license reasons
|
||||
safe_browsing_use_unrar = false
|
||||
|
||||
# Keep disabled Google Request Header Integrity
|
||||
# see https://chromium-review.googlesource.com/c/chromium/src/+/5778493
|
||||
enable_request_header_integrity = false
|
||||
|
||||
# Disable precompiled headers because they are incompatible with the unsafe_buffers configuration
|
||||
enable_precompiled_headers = false
|
||||
|
||||
declare_args() {
|
||||
_is_debug_build = ""
|
||||
build_webview = false
|
||||
}
|
||||
|
||||
not_needed(["_target_build", "_is_debug_build"])
|
||||
|
||||
if (target_os == "android") {
|
||||
target_os = "android" # fix traffic annotation auditor
|
||||
#enable_kythe_annotations = true
|
||||
|
||||
chrome_public_manifest_package = "org.cromite.cromite"
|
||||
system_webview_package_name="org.cromite.webview" #"com.android.webview"
|
||||
system_webview_shell_package_name="org.cromite.webview_shell"
|
||||
|
||||
chrome_pgo_phase = 2 # enable pgo
|
||||
|
||||
# do not split Developer UI split into a separate Dynamic Feature Module
|
||||
dfmify_dev_ui = false
|
||||
|
||||
if (getenv("USE_KEYSTORE") != "") {
|
||||
android_keystore_path = "/home/lg/working_dir/cromite.keystore"
|
||||
android_keystore_name = "cromite"
|
||||
android_keystore_password = getenv("KEYSTORE_PASSWORD")
|
||||
}
|
||||
|
||||
cromite_pref_hash_seed_bin = getenv("CROMITE_PREF_HASH_SEED_BIN")
|
||||
|
||||
_is_debug_build = getenv("TARGET_ISDEBUG")
|
||||
if (_is_debug_build == "true") {
|
||||
# print("Debug build on")
|
||||
is_debug = true
|
||||
is_official_build = false
|
||||
dcheck_always_on = true
|
||||
symbol_level = 1
|
||||
strip_debug_info = false
|
||||
generate_linker_map = false
|
||||
|
||||
# Disable static analysis
|
||||
android_static_analysis = "off"
|
||||
|
||||
# Turns off all V8 debug features. Disables running V8 in a pseudo debug mode
|
||||
# bypass build error -5 in clang_x64/mksnapshot
|
||||
v8_enable_debugging_features = false
|
||||
} else {
|
||||
generate_linker_map = true
|
||||
}
|
||||
|
||||
if (build_webview) {
|
||||
# 32 and 64bit
|
||||
skip_secondary_abi_for_cq = false
|
||||
}
|
||||
}
|
||||
|
||||
if (target_os == "win") {
|
||||
target_os = "win" # fix traffic annotation auditor
|
||||
target_cpu = "x64"
|
||||
symbol_level = 0
|
||||
use_large_pdbs = true
|
||||
|
||||
enable_pdf = true
|
||||
pdf_is_complete_lib = true
|
||||
enable_plugins = true
|
||||
enable_ppapi = false
|
||||
|
||||
chrome_pgo_phase = 2 # enable pgo
|
||||
|
||||
is_cfi = false # disable it
|
||||
use_cfi_cast = false # disable it
|
||||
}
|
||||
|
||||
if (target_os == "linux") {
|
||||
target_os = "linux" # fix traffic annotation auditor
|
||||
target_cpu = "x64"
|
||||
symbol_level = 0
|
||||
|
||||
enable_pdf = true
|
||||
pdf_is_complete_lib = true
|
||||
enable_plugins = true
|
||||
enable_ppapi = false
|
||||
|
||||
use_sysroot = true
|
||||
chrome_pgo_phase = 2 # enable pgo
|
||||
}
|
||||
@@ -1,327 +0,0 @@
|
||||
Do-not-link-with-libatomic.patch
|
||||
Do-not-check-for-the-presence-of-use-remoteexec.patch
|
||||
bromite-build-utils.patch
|
||||
Add-cromite-flags-support.patch
|
||||
Force-use-vpython3-for-some-scripts.patch
|
||||
Permit-PGO-for-debug-builds.patch
|
||||
Fix-chromium-vanilla.patch
|
||||
Final-patch-for-chromium-vanilla.patch
|
||||
|
||||
Remove-EV-certificates.patch
|
||||
do-not-hide-.orig-files.patch
|
||||
do-not-add-suffix-to-package-name.patch
|
||||
exit-on-failure-of-inclusion.patch
|
||||
Move-some-account-settings-back-to-privacy-settings.patch
|
||||
kill-Vision.patch
|
||||
kill-Location-fall-back-to-system.patch
|
||||
kill-Auth.patch
|
||||
Remove-binary-blob-integrations.patch
|
||||
Remove-SMS-integration.patch
|
||||
Remove-voice-recognition-integration.patch
|
||||
Do-not-compile-QR-code-sharing.patch
|
||||
Add-support-for-ISupportHelpAndFeedback.patch
|
||||
Switch-to-fstack-protector-strong.patch
|
||||
Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
|
||||
Bromite-package-name.patch
|
||||
Restore-classic-new-tab-page.patch
|
||||
Always-use-new-tab-page-for-default-home-page.patch
|
||||
disable-battery-status-updater.patch
|
||||
Battery-API-return-nothing.patch
|
||||
Disable-omission-of-URL-elements.patch
|
||||
Modify-default-preferences.patch
|
||||
Do-not-store-passwords-by-default.patch
|
||||
Disable-NTP-remote-suggestions-by-default.patch
|
||||
Disable-references-to-fonts.googleapis.com.patch
|
||||
webRTC-do-not-expose-local-IP-addresses.patch
|
||||
Never-fetch-popular-sites.patch
|
||||
ungoogled-chromium-Disable-webRTC-log-uploader.patch
|
||||
ungoogled-chromium-Disable-untraceable-URLs.patch
|
||||
ungoogled-chromium-Disable-translate-integration.patch
|
||||
ungoogled-chromium-Disable-profile-avatar.patch
|
||||
ungoogled-chromium-Disable-intranet-detector.patch
|
||||
ungoogled-chromium-no-special-hosts-domains.patch
|
||||
ungoogled-chromium-Disable-Network-Time-Tracker.patch
|
||||
Disable-all-promo-dialogs.patch
|
||||
Disable-update-scheduler.patch
|
||||
Add-search-engine.patch
|
||||
Allow-playing-audio-in-background.patch
|
||||
Add-flag-to-control-video-playback-resume-feature.patch
|
||||
Add-exit-menu-item.patch
|
||||
Remove-help-menu-item.patch
|
||||
Multiple-fingerprinting-mitigations.patch
|
||||
Add-flag-to-configure-maximum-connections-per-host.patch
|
||||
Do-not-ignore-download-location-prompt-setting.patch
|
||||
Add-support-for-writing-URIs.patch
|
||||
Restore-BookmarkToolbar-setCurrentFolder.patch
|
||||
Add-bookmark-import-export-actions.patch
|
||||
Bookmarks-select-all-menu-entry.patch
|
||||
Add-an-always-incognito-mode.patch
|
||||
Keep-flag-to-allow-screenshots-in-Incognito-mode.patch
|
||||
Add-option-to-not-persist-tabs-across-sessions.patch
|
||||
Add-a-proxy-configuration-page.patch
|
||||
Add-custom-tab-intents-privacy-option.patch
|
||||
Disable-privacy-sandbox.patch
|
||||
History-number-of-days-privacy-setting.patch
|
||||
Disable-fetching-of-all-field-trials.patch
|
||||
Disable-plugins-enumeration.patch
|
||||
dns-send-IPv6-connectivity-probes-to-RIPE-DNS.patch
|
||||
Add-flag-to-disable-IPv6-probes.patch
|
||||
profile-resetter-disable-send-settings.patch
|
||||
Do-not-build-API-keys-infobar.patch
|
||||
autofill-miscellaneous.patch
|
||||
Enable-native-Android-autofill.patch
|
||||
translate-disable-fetching-of-languages-from-server.patch
|
||||
Disable-various-metrics.patch
|
||||
Enable-StrictOriginIsolation-and-SitePerProcess.patch
|
||||
Use-64-bit-WebView-processes.patch
|
||||
prefs-always-prompt-for-download-directory.patch
|
||||
Disable-offline-pages-in-CCT.patch
|
||||
Disable-media-router-and-remoting-by-default.patch
|
||||
Restore-Search-Ready-Omnibox-flag.patch
|
||||
disable-AdsBlockedInfoBar.patch
|
||||
Bromite-subresource-adblocker.patch
|
||||
Bromite-auto-updater.patch
|
||||
Replace-DoH-probe-domain-with-RIPE-domain.patch
|
||||
Increase-number-of-autocomplete-matches-to-10.patch
|
||||
Disable-requests-for-single-word-Omnibar-searches.patch
|
||||
Disable-some-signed-exchange-features.patch
|
||||
DoH-improvements.patch
|
||||
Reduce-HTTP-headers-in-DoH-requests-to-bare-minimum.patch
|
||||
Revert-flags-remove-disable-pull-to-refresh-effect.patch
|
||||
Use-dummy-DFM-installer.patch
|
||||
Disable-feeds-support-by-default.patch
|
||||
Disable-DRM-media-origin-IDs-preprovisioning.patch
|
||||
Disable-smart-selection-by-default.patch
|
||||
Guard-for-user-agent-reduction.patch
|
||||
AImageReader-CFI-crash-mitigations.patch
|
||||
Add-menu-item-to-view-source.patch
|
||||
Revert-removal-of-execution-context-address-space.patch
|
||||
Block-gateway-attacks-via-websockets.patch
|
||||
Enable-prefetch-privacy-changes-by-default.patch
|
||||
Enable-darken-websites-checkbox-in-themes.patch
|
||||
Remove-blocklisted-URLs-upon-bookmark-creation.patch
|
||||
Disable-the-DIAL-repeating-discovery.patch
|
||||
Block-qjz9zk-or-trk-requests.patch
|
||||
Hardening-against-incognito-mode-detection.patch
|
||||
Restore-Simplified-NTP-launch.patch
|
||||
Add-option-to-use-home-page-as-NTP.patch
|
||||
Disable-text-fragments-by-default.patch
|
||||
disable-WebView-variations-support.patch
|
||||
Enable-network-isolation-features.patch
|
||||
Revert-flags-remove-num-raster-threads.patch
|
||||
webview-Hard-no-to-persistent-histograms.patch
|
||||
Ignore-enterprise-policies-for-secure-DNS.patch
|
||||
Add-menu-item-to-bookmark-all-tabs.patch
|
||||
Re-introduce-modal-dialog-flag-to-close-all-tabs.patch
|
||||
Add-option-to-force-tablet-UI.patch
|
||||
Add-Alt-D-hotkey-to-focus-address-bar.patch
|
||||
User-agent-customization.patch
|
||||
Add-AllowUserCertificates-flag.patch
|
||||
Add-IsCleartextPermitted-flag.patch
|
||||
Add-flag-for-omnibox-autocomplete-filtering.patch
|
||||
Add-flag-to-disable-external-intent-requests.patch
|
||||
Enable-share-intent.patch
|
||||
Logcat-crash-reports-UI.patch
|
||||
Add-flag-to-disable-vibration.patch
|
||||
mime_util-force-text-x-suse-ymp-to-be-downloaded.patch
|
||||
Client-hints-overrides.patch
|
||||
Allow-building-without-enable_reporting.patch
|
||||
Experimental-user-scripts-support.patch
|
||||
Keep-empty-tabs-between-sessions.patch
|
||||
Disable-third-party-origin-trials.patch
|
||||
Never-use-HTTP-probes-for-connection-detection.patch
|
||||
Disable-Accessibility-service-by-default.patch
|
||||
Disable-conversion-measurement-api.patch
|
||||
Restore-offline-indicator-v2-flag.patch
|
||||
Re-introduce-override_build_timestamp.patch
|
||||
enable-ftrivial-auto-var-init-zero.patch
|
||||
disable-appending-variations-header.patch
|
||||
Disable-idle-detection.patch
|
||||
Disable-minidump-upload-scheduling.patch
|
||||
Revert-Permit-blocking-of-view-source.patch
|
||||
Disable-safety-check.patch
|
||||
Disable-all-predictors-code.patch
|
||||
OpenSearch-miscellaneous.patch
|
||||
Add-flag-for-save-data-header.patch
|
||||
Disable-UA-full-version.patch
|
||||
Dictionary-suggestions-for-the-Omnibox.patch
|
||||
Disable-AsyncDNS-by-default.patch
|
||||
Restore-LastTabStandingTracker.patch
|
||||
Add-lifetime-options-for-permissions.patch
|
||||
Disable-crash-reporting.patch
|
||||
Samsung-Note-9-SDK27-crazylinker-workaround.patch
|
||||
Disable-TLS-resumption.patch
|
||||
Move-navigation-bar-to-bottom.patch
|
||||
Welcome-screen.patch
|
||||
Add-site-engagement-flag.patch
|
||||
Enable-Certificate-Transparency.patch
|
||||
Invalidate-components-public-key.patch
|
||||
Improve-plain-text-rendering-on-mobile.patch
|
||||
Remove-segmentation-platform.patch
|
||||
Follow-only-system-dark-mode.patch
|
||||
Remove-window-name-on-cross-origin-navigation.patch
|
||||
Remove-preload-of-com.google.android.gms.fonts.patch
|
||||
Partition-Blink-memory-cache.patch
|
||||
Remove-navigator.connection-info.patch
|
||||
Disable-PrivacyGuide.patch
|
||||
sharing-hub-always-use-visible-URL.patch
|
||||
Enable-HEVC-by-default.patch
|
||||
Partition-blobs-by-top-frame-URL.patch
|
||||
Override-Navigator-Language.patch
|
||||
Remove-HTTP-referrals-in-cross-origin-navigation.patch
|
||||
Enable-third-party-storage-partitioning.patch
|
||||
Restore-adaptive-button-in-top-toolbar-customization.patch
|
||||
Add-kill-switch-for-unsupported-clangd-flags.patch
|
||||
|
||||
WIN-enable-pdf-plugin.patch
|
||||
WIN-disable-annotate-downloads.patch
|
||||
Enable-HighEfficiencyMode-by-default.patch
|
||||
WIN-Disable-TabHoverCard-images.patch
|
||||
WIN-Fix-log-to-file.patch
|
||||
WIN-Disable-updater.patch
|
||||
WIN-Disable-first-run.patch
|
||||
WIN-Add-some-prefs-to-secure-preferences.patch
|
||||
WIN-Disable-search-for-image.patch
|
||||
|
||||
AudioBuffer-AnalyserNode-fp-mitigations.patch
|
||||
add-browser-policy.patch
|
||||
Always-open-browser-controls-in-new-tab.patch
|
||||
Partitioning-all-cookies-by-top-frame-domain.patch
|
||||
Disable-FedCm.patch
|
||||
Disable-BackForwardCache.patch
|
||||
Disable-visited-pseudo-class.patch
|
||||
Add-setting-to-clear-data-on-exit.patch
|
||||
Improve-the-browser-sandbox.patch
|
||||
Disable-csp-reports.patch
|
||||
Fonts-fingerprinting-mitigation.patch
|
||||
Keyboard-protection-flag.patch
|
||||
Disable-privacy-issues-in-password-manager.patch
|
||||
Partition-HSTS-cache-by-NAK.patch
|
||||
Warning-message-for-unsupported-hardware-aes.patch
|
||||
Enable-Document-Open-Inheritance-Removal.patch
|
||||
Add-setting-to-invert-tap-and-long-tap.patch
|
||||
Remove-ChromiumNetworkAdapter.patch
|
||||
Internal-firewall.patch
|
||||
Disable-devtools-remote-and-custom-protocols.patch
|
||||
Remove-detection-of-captive-portals.patch
|
||||
Remove-auth-header-upon-cross-origin-redirect.patch
|
||||
Clear-CORS-Preflight-Cache-on-clearing-data.patch
|
||||
Multi-Screen-Window-Placement-API-fix.patch
|
||||
Add-a-flag-to-disable-GamePad-API.patch
|
||||
Disable-WebGPU.patch
|
||||
Disable-GetInstalledRelatedApps-API.patch
|
||||
Disable-GSA-by-default.patch
|
||||
Disallowing-MIDI-permission-by-default.patch
|
||||
Disable-Compression-Dictionary-Transport.patch
|
||||
Disallow-Android-App-Scheme-as-referrer.patch
|
||||
Content-settings-infrastructure.patch
|
||||
Add-autoplay-site-setting.patch
|
||||
Site-setting-for-images.patch
|
||||
JIT-site-settings.patch
|
||||
Add-webGL-site-setting.patch
|
||||
Add-webRTC-site-settings.patch
|
||||
Show-site-settings-for-cookies-javascript-and-ads.patch
|
||||
Viewport-Protection-flag.patch
|
||||
Revert-remove-allowscript-content-setting-secondary-url.patch
|
||||
Timezone-customization.patch
|
||||
Change-popup-site-setting.patch
|
||||
Disable-speechSynthesis-getVoices-API.patch
|
||||
Remove-support-for-device-memory-and-cpu-recovery.patch
|
||||
Log-dangling-attributes-in-some-html-elements.patch
|
||||
Keep-Side-Panel-Companion-disabled.patch
|
||||
Lock-Profile-Cookie-Database.patch
|
||||
Compress-libchrome-to-free-up-some-space.patch
|
||||
Cromite-Branding.patch
|
||||
Disable-Feeback-Collector.patch
|
||||
Disable-remote-altsvc-for-h3-connections.patch
|
||||
do-not-block-build-incompatible-profiles.patch
|
||||
Allow-DocumentPiP-if-PopupsAndRedirects-are-active.patch
|
||||
allow-the-download-of-clang-for-windows-crossbuild.patch
|
||||
Add-option-to-disable-snapshots.patch
|
||||
Enable-Android-Dynamic-Performance-Framework.patch
|
||||
Fix-crash-on-customize-profile-ui.patch
|
||||
Enable-ImprovedBookmarks-by-default.patch
|
||||
Partition-MediaDeviceId-by-default.patch
|
||||
Keep-disabled-FetchLaterAPI.patch
|
||||
Disable-ranker-url-fetcher.patch
|
||||
Disable-prefers-reduced-transparency-media-query.patch
|
||||
libjxl-0-8-2.patch
|
||||
Add-support-to-jxl.patch
|
||||
Block-Intents-While-Locked.patch
|
||||
Keep-Manta-Service-Disabled.patch
|
||||
Disable-Service-and-Shared-workers-on-3P-iframe.patch
|
||||
Disable-Real-Box.patch
|
||||
Always-allow-inspect-fallback.patch
|
||||
Add-PartialLowEndModeOnMidRangeDevices-flag.patch
|
||||
Use-list-mode-for-tab-switcher.patch
|
||||
Chrome-web-store-protection.patch
|
||||
Enable-search-engine-settings-desktop-ui.patch
|
||||
Disable-Android-AppRestrictions.patch
|
||||
Customize-selection-popup.patch
|
||||
Enables-deactivation-of-the-js-debugger-statement.patch
|
||||
Enable-gwp-asan-on-Android.patch
|
||||
Disable-Read-Aloud-by-default.patch
|
||||
Disable-Compose-feature.patch
|
||||
Disable-offline-autofetch-flag.patch
|
||||
Show-NTP-at-startup.patch
|
||||
Enable-platform-aac-audio-and-h264-video.patch
|
||||
Disable-Paint-Preview-by-default.patch
|
||||
Do-not-use-Windows-ClearType-Text-Tuner-setting.patch
|
||||
Private-network-access-content-settings.patch
|
||||
Allow-building-without-supervised-users.patch
|
||||
Keep-ComputePressure-disabled.patch
|
||||
Android-Toolbar-Scroll-Ablation-setting.patch
|
||||
Keep-disabled-WebViewMediaIntegrityApi.patch
|
||||
Enable-menu-on-reload-button.patch
|
||||
Enable-Global-Privacy-Control.patch
|
||||
Enable-Do-Not-Track-by-default.patch
|
||||
Media-fingerprinting-mitigations.patch
|
||||
Use-BoringSSL-for-RandBytes.patch
|
||||
Restore-chrome-password-store.patch
|
||||
Disable-support-for-pointer-device-id.patch
|
||||
Disable-CSS-blink-feature-support.patch
|
||||
Close-Sessions-On-Ip-Change.patch
|
||||
Ask-for-restart-on-connection-change.patch
|
||||
Bubble-Locking-on-UI-DevTools.patch
|
||||
Add-a-GN-flag-to-disable-trybot-verification.patch
|
||||
Override-the-MV2-deprecation.patch
|
||||
Remove-sideloading-of-version-dll.patch
|
||||
Use-browser-navigation-handler.patch
|
||||
Cromite-Branding--improve-settings-ui.patch
|
||||
Disable-Posture-API.patch
|
||||
PublicKeyCredential-fingerprinting-mitigations.patch
|
||||
Disable-Web-Bluetooth-by-default-in-desktop-platforms.patch
|
||||
Enable-Cert-Management-UI.patch
|
||||
Enable-ProcessBoundStringEncryption-by-default.patch
|
||||
Prevent-mouse-wheel-fingerprinting-on-Windows.patch
|
||||
Enable-component-updater.patch
|
||||
Android-fonts-fingerprinting-mitigation.patch
|
||||
Disable-Android-Tab-Declutter.patch
|
||||
Disable-CSSDynamicRangeLimit.patch
|
||||
Android-Import-Passwords.patch
|
||||
Disable-prefers-reduced-motion.patch
|
||||
Disable-css-preferred-text-scale.patch
|
||||
Disable-Viewport-Segments.patch
|
||||
Keep-disabled-cache-sharing-for-pervasive-scripts.patch
|
||||
High-Resolution-Timing-Mitigation.patch
|
||||
Temp-disable-UseContextSnapshot.patch
|
||||
|
||||
# temporary or wip patches
|
||||
Temp-PerformanceNavigationTiming-privacy-fix.patch
|
||||
Temp-disable-predictive-back-gesture.patch
|
||||
TEMP-Add-a-log-to-track-strange-behavior.patch
|
||||
Temp-guard-FileSystemAccessPersistentPermissions.patch
|
||||
Never-treat-Proguard-warnings-as-errors.patch
|
||||
Temp-disable-experimental-web-platform-features.patch
|
||||
Block-leakage-of-urls-in-sandbox-iframes.patch
|
||||
Temporarily-disable-Tab-Group-Sync-Android.patch
|
||||
Fix-chromium-build-bugs.patch
|
||||
Try-to-fix-2082.patch
|
||||
|
||||
# adblock patches
|
||||
eyeo-133.0.6943.49-base.patch
|
||||
eyeo-133.0.6943.49-chrome_integration.patch
|
||||
eyeo-133.0.6943.49-android_api.patch
|
||||
eyeo-133.0.6943.49-android_settings.patch
|
||||
eyeo-133.0.6943.49-extension_api.patch
|
||||
Eyeo-Adblock-for-Cromite.patch
|
||||
@@ -1 +0,0 @@
|
||||
zz-patch-list.txt
|
||||
@@ -17,110 +17,85 @@ See discussions at:
|
||||
* https://github.com/bromite/bromite/issues/445
|
||||
* https://github.com/bromite/bromite/issues/814
|
||||
* https://github.com/bromite/bromite/issues/1005
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
base/android/android_image_reader_compat.cc | 16 ++++++++++++++++
|
||||
base/android/android_image_reader_compat.h | 14 ++++++++++++++
|
||||
chrome/browser/flag-metadata.json | 4 ++++
|
||||
.../AImageReader-CFI-crash-mitigations.inc | 4 ++++
|
||||
.../AImageReader-CFI-crash-mitigations.inc | 1 +
|
||||
gpu/config/gpu_driver_bug_list.json | 16 ++++++++++++++++
|
||||
gpu/config/gpu_finch_features.cc | 5 +++++
|
||||
gpu/config/gpu_finch_features.h | 1 +
|
||||
gpu/config/gpu_util.cc | 8 ++++++++
|
||||
gpu/config/gpu_workaround_list.txt | 1 +
|
||||
gpu/ipc/service/gpu_init.cc | 8 ++++++++
|
||||
media/gpu/android/video_frame_factory_impl.cc | 4 +++-
|
||||
12 files changed, 81 insertions(+), 1 deletion(-)
|
||||
create mode 100644 cromite_flags/media/base/media_switches_cc/AImageReader-CFI-crash-mitigations.inc
|
||||
create mode 100644 cromite_flags/media/base/media_switches_h/AImageReader-CFI-crash-mitigations.inc
|
||||
base/android/android_image_reader_compat.cc | 8 +++++++-
|
||||
base/android/android_image_reader_compat.h | 4 ++++
|
||||
chrome/browser/flag-metadata.json | 2 +-
|
||||
gpu/config/gpu_driver_bug_list.json | 16 ++++++++++++++++
|
||||
gpu/config/gpu_finch_features.cc | 5 +++++
|
||||
gpu/config/gpu_finch_features.h | 1 +
|
||||
gpu/config/gpu_util.cc | 8 ++++++++
|
||||
gpu/config/gpu_workaround_list.txt | 1 +
|
||||
gpu/ipc/service/gpu_init.cc | 5 +++++
|
||||
gpu/ipc/service/stream_texture_android.cc | 11 ++++++++++-
|
||||
media/base/media_switches.cc | 4 ++++
|
||||
media/base/media_switches.h | 1 +
|
||||
12 files changed, 63 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/base/android/android_image_reader_compat.cc b/base/android/android_image_reader_compat.cc
|
||||
--- a/base/android/android_image_reader_compat.cc
|
||||
+++ b/base/android/android_image_reader_compat.cc
|
||||
@@ -7,7 +7,23 @@
|
||||
@@ -23,6 +23,8 @@
|
||||
namespace base {
|
||||
namespace android {
|
||||
|
||||
+AndroidImageReader& AndroidImageReader::GetInstance() {
|
||||
+ // C++11 static local variable initialization is
|
||||
+ // thread-safe.
|
||||
+ static AndroidImageReader instance;
|
||||
+ return instance;
|
||||
+}
|
||||
+bool AndroidImageReader::disable_support_ = false;
|
||||
+
|
||||
AndroidImageReader& AndroidImageReader::GetInstance() {
|
||||
// C++11 static local variable initialization is
|
||||
// thread-safe.
|
||||
@@ -30,8 +32,12 @@ AndroidImageReader& AndroidImageReader::GetInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
+void AndroidImageReader::DisableSupport() {
|
||||
+ disable_support_ = true;
|
||||
+}
|
||||
+
|
||||
+bool AndroidImageReader::IsSupported() {
|
||||
+ return !disable_support_;
|
||||
+}
|
||||
+
|
||||
bool EnableAndroidImageReader() {
|
||||
+ if (!AndroidImageReader::GetInstance().IsSupported()) return false;
|
||||
// Currently we want to enable AImageReader only for android P+ devices.
|
||||
if (__builtin_available(android 28, *)) {
|
||||
return true;
|
||||
bool AndroidImageReader::IsSupported() {
|
||||
- return is_supported_;
|
||||
+ return !disable_support_ && is_supported_;
|
||||
}
|
||||
|
||||
AndroidImageReader::AndroidImageReader() : is_supported_(LoadFunctions()) {}
|
||||
diff --git a/base/android/android_image_reader_compat.h b/base/android/android_image_reader_compat.h
|
||||
--- a/base/android/android_image_reader_compat.h
|
||||
+++ b/base/android/android_image_reader_compat.h
|
||||
@@ -10,6 +10,20 @@
|
||||
namespace base {
|
||||
namespace android {
|
||||
@@ -22,6 +22,9 @@ class BASE_EXPORT AndroidImageReader {
|
||||
// Thread safe GetInstance.
|
||||
static AndroidImageReader& GetInstance();
|
||||
|
||||
+class BASE_EXPORT AndroidImageReader {
|
||||
+ public:
|
||||
+ // Thread safe GetInstance.
|
||||
+ static AndroidImageReader& GetInstance();
|
||||
+
|
||||
+ bool IsSupported();
|
||||
+
|
||||
+ // Disable image reader support.
|
||||
+ void DisableSupport();
|
||||
+ static void DisableSupport();
|
||||
+
|
||||
+ private:
|
||||
+ bool disable_support_ = false;
|
||||
+};
|
||||
+
|
||||
// Check if the image reader usage is supported.
|
||||
BASE_EXPORT bool EnableAndroidImageReader();
|
||||
// Check if the image reader usage is supported. This function returns TRUE
|
||||
// if android version is >=OREO, image reader support is not disabled and all
|
||||
// the required functions are loaded.
|
||||
@@ -59,6 +62,7 @@ class BASE_EXPORT AndroidImageReader {
|
||||
jobject ANativeWindow_toSurface(JNIEnv* env, ANativeWindow* window);
|
||||
|
||||
private:
|
||||
+ static bool disable_support_;
|
||||
friend class base::NoDestructor<AndroidImageReader>;
|
||||
|
||||
AndroidImageReader();
|
||||
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
|
||||
--- a/chrome/browser/flag-metadata.json
|
||||
+++ b/chrome/browser/flag-metadata.json
|
||||
@@ -3514,6 +3514,10 @@
|
||||
"chrome-signin-team@google.com"
|
||||
],
|
||||
"expiry_milestone": 138
|
||||
+ },{
|
||||
+ "name": "enable-image-reader", // Bromite: do not expire
|
||||
+ "owners": [ "vikassoni@chromium.org", "liberato@chromium.org" ], // flag
|
||||
@@ -2017,7 +2017,7 @@
|
||||
{
|
||||
"name": "enable-image-reader",
|
||||
"owners": [ "vikassoni", "liberato" ],
|
||||
- "expiry_milestone": 95
|
||||
+ "expiry_milestone": -1
|
||||
},
|
||||
{
|
||||
"name": "enable-immersive-fullscreen-toolbar",
|
||||
diff --git a/cromite_flags/media/base/media_switches_cc/AImageReader-CFI-crash-mitigations.inc b/cromite_flags/media/base/media_switches_cc/AImageReader-CFI-crash-mitigations.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/media/base/media_switches_cc/AImageReader-CFI-crash-mitigations.inc
|
||||
@@ -0,0 +1,4 @@
|
||||
+// Enables the Android Image Reader path for Video decoding(for AVDA and MCVD)
|
||||
+CROMITE_FEATURE(kAImageReaderVideoOutput,
|
||||
+ "AImageReaderVideoOutput",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
diff --git a/cromite_flags/media/base/media_switches_h/AImageReader-CFI-crash-mitigations.inc b/cromite_flags/media/base/media_switches_h/AImageReader-CFI-crash-mitigations.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/media/base/media_switches_h/AImageReader-CFI-crash-mitigations.inc
|
||||
@@ -0,0 +1 @@
|
||||
+MEDIA_EXPORT BASE_DECLARE_FEATURE(kAImageReaderVideoOutput);
|
||||
diff --git a/gpu/config/gpu_driver_bug_list.json b/gpu/config/gpu_driver_bug_list.json
|
||||
--- a/gpu/config/gpu_driver_bug_list.json
|
||||
+++ b/gpu/config/gpu_driver_bug_list.json
|
||||
@@ -2613,6 +2613,22 @@
|
||||
"no_downscaled_overlay_promotion"
|
||||
@@ -3191,6 +3191,22 @@
|
||||
"dont_delete_source_texture_for_egl_image"
|
||||
]
|
||||
},
|
||||
+ {
|
||||
@@ -140,39 +115,39 @@ diff --git a/gpu/config/gpu_driver_bug_list.json b/gpu/config/gpu_driver_bug_lis
|
||||
+ ]
|
||||
+ },
|
||||
{
|
||||
"id": 381,
|
||||
"cr_bugs": [
|
||||
"id": 336,
|
||||
"cr_bugs": [625785],
|
||||
diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc
|
||||
--- a/gpu/config/gpu_finch_features.cc
|
||||
+++ b/gpu/config/gpu_finch_features.cc
|
||||
@@ -58,6 +58,11 @@ BASE_FEATURE(kAggressiveShaderCacheLimits,
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
@@ -51,6 +51,11 @@ bool IsDeviceBlocked(const char* field, const std::string& block_list) {
|
||||
} // namespace
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
+// Use android AImageReader when playing videos with MediaPlayer.
|
||||
+CROMITE_FEATURE(kAImageReaderMediaPlayer,
|
||||
+ "AImageReaderMediaPlayer",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
#if defined(OS_ANDROID)
|
||||
+
|
||||
// Use android SurfaceControl API for managing display compositor's buffer queue
|
||||
// and using overlays on Android. Also used by webview to disable surface
|
||||
// SurfaceControl.
|
||||
+// Use android AImageReader when playing videos with MediaPlayer.
|
||||
+const base::Feature kAImageReaderMediaPlayer{"AImageReaderMediaPlayer",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+
|
||||
// Used to limit GL version to 2.0 for skia raster on Android.
|
||||
const base::Feature kUseGles2ForOopR{"UseGles2ForOopR",
|
||||
base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
diff --git a/gpu/config/gpu_finch_features.h b/gpu/config/gpu_finch_features.h
|
||||
--- a/gpu/config/gpu_finch_features.h
|
||||
+++ b/gpu/config/gpu_finch_features.h
|
||||
@@ -26,6 +26,7 @@ GPU_EXPORT BASE_DECLARE_FEATURE(kUseGles2ForOopR);
|
||||
GPU_EXPORT BASE_DECLARE_FEATURE(kAggressiveShaderCacheLimits);
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
+GPU_EXPORT BASE_DECLARE_FEATURE(kAImageReaderMediaPlayer);
|
||||
GPU_EXPORT BASE_DECLARE_FEATURE(kAndroidSurfaceControl);
|
||||
GPU_EXPORT BASE_DECLARE_FEATURE(kWebViewSurfaceControl);
|
||||
GPU_EXPORT BASE_DECLARE_FEATURE(kWebViewSurfaceControlForTV);
|
||||
@@ -17,6 +17,7 @@ namespace features {
|
||||
// All features in alphabetical order. The features should be documented
|
||||
// alongside the definition of their values in the .cc file.
|
||||
#if defined(OS_ANDROID)
|
||||
+GPU_EXPORT extern const base::Feature kAImageReaderMediaPlayer;
|
||||
GPU_EXPORT extern const base::Feature kUseGles2ForOopR;
|
||||
GPU_EXPORT extern const base::Feature kAndroidSurfaceControl;
|
||||
GPU_EXPORT extern const base::Feature kWebViewSurfaceControl;
|
||||
diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
|
||||
--- a/gpu/config/gpu_util.cc
|
||||
+++ b/gpu/config/gpu_util.cc
|
||||
@@ -127,6 +127,9 @@ GpuFeatureStatus GetAndroidSurfaceControlFeatureStatus(
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
@@ -114,6 +114,9 @@ GpuFeatureStatus GetAndroidSurfaceControlFeatureStatus(
|
||||
#if !defined(OS_ANDROID)
|
||||
return kGpuFeatureStatusDisabled;
|
||||
#else
|
||||
+ if (blocklisted_features.count(GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL))
|
||||
@@ -181,9 +156,9 @@ diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
|
||||
if (!gpu_preferences.enable_android_surface_control)
|
||||
return kGpuFeatureStatusDisabled;
|
||||
|
||||
@@ -348,6 +351,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info,
|
||||
kGpuFeatureStatusSoftware;
|
||||
}
|
||||
@@ -319,6 +322,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info) {
|
||||
gpu_feature_info->status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL2] =
|
||||
kGpuFeatureStatusBlocklisted;
|
||||
}
|
||||
+
|
||||
+ if (gpu_feature_info->IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) {
|
||||
@@ -196,54 +171,82 @@ diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
|
||||
diff --git a/gpu/config/gpu_workaround_list.txt b/gpu/config/gpu_workaround_list.txt
|
||||
--- a/gpu/config/gpu_workaround_list.txt
|
||||
+++ b/gpu/config/gpu_workaround_list.txt
|
||||
@@ -6,6 +6,7 @@ check_egl_fence_before_wait
|
||||
check_ycbcr_studio_g22_left_p709_for_nv12_support
|
||||
@@ -13,6 +13,7 @@ decode_encode_srgb_for_generatemipmap
|
||||
depth_stencil_renderbuffer_resize_emulation
|
||||
disable_2d_canvas_auto_flush
|
||||
disable_accelerated_av1_decode
|
||||
+disable_aimagereader
|
||||
disable_accelerated_av1_encode
|
||||
disable_accelerated_h264_decode
|
||||
disable_accelerated_av1_decode_d3d11
|
||||
disable_accelerated_h264_encode
|
||||
disable_accelerated_vp8_decode
|
||||
diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc
|
||||
--- a/gpu/ipc/service/gpu_init.cc
|
||||
+++ b/gpu/ipc/service/gpu_init.cc
|
||||
@@ -70,6 +70,7 @@
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
#include "ui/gfx/android/android_surface_control_compat.h"
|
||||
+#include "base/android/android_image_reader_compat.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_VULKAN)
|
||||
@@ -687,6 +688,13 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
|
||||
@@ -517,6 +517,11 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
|
||||
}
|
||||
}
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
+#if BUILDFLAG(IS_ANDROID)
|
||||
+ // Disable AImageReader if the workaround is enabled.
|
||||
+ if (gpu_feature_info_.IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) {
|
||||
+ base::android::AndroidImageReader::GetInstance().DisableSupport();
|
||||
+ base::android::AndroidImageReader::DisableSupport();
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
if (gpu_feature_info_.status_values[GPU_FEATURE_TYPE_VULKAN] !=
|
||||
kGpuFeatureStatusEnabled ||
|
||||
!InitializeVulkan()) {
|
||||
diff --git a/media/gpu/android/video_frame_factory_impl.cc b/media/gpu/android/video_frame_factory_impl.cc
|
||||
--- a/media/gpu/android/video_frame_factory_impl.cc
|
||||
+++ b/media/gpu/android/video_frame_factory_impl.cc
|
||||
@@ -35,10 +35,12 @@ namespace {
|
||||
diff --git a/gpu/ipc/service/stream_texture_android.cc b/gpu/ipc/service/stream_texture_android.cc
|
||||
--- a/gpu/ipc/service/stream_texture_android.cc
|
||||
+++ b/gpu/ipc/service/stream_texture_android.cc
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
gpu::TextureOwner::Mode GetTextureOwnerMode(
|
||||
VideoFrameFactory::OverlayMode overlay_mode) {
|
||||
+ const bool enabled = base::android::EnableAndroidImageReader() &&
|
||||
+ base::FeatureList::IsEnabled(features::kAImageReaderMediaPlayer);
|
||||
switch (overlay_mode) {
|
||||
case VideoFrameFactory::OverlayMode::kDontRequestPromotionHints:
|
||||
case VideoFrameFactory::OverlayMode::kRequestPromotionHints:
|
||||
- return base::android::EnableAndroidImageReader()
|
||||
+ return enabled
|
||||
? gpu::TextureOwner::Mode::kAImageReaderInsecure
|
||||
: gpu::TextureOwner::Mode::kSurfaceTextureInsecure;
|
||||
case VideoFrameFactory::OverlayMode::kSurfaceControlSecure:
|
||||
--
|
||||
#include <string.h>
|
||||
|
||||
+#include "base/android/android_image_reader_compat.h"
|
||||
#include "base/android/scoped_hardware_buffer_fence_sync.h"
|
||||
#include "base/bind.h"
|
||||
#include "base/feature_list.h"
|
||||
@@ -50,7 +51,15 @@ std::unique_ptr<ui::ScopedMakeCurrent> MakeCurrent(
|
||||
}
|
||||
|
||||
TextureOwner::Mode GetTextureOwnerMode() {
|
||||
- return features::IsAImageReaderEnabled()
|
||||
+ const bool a_image_reader_supported =
|
||||
+ base::android::AndroidImageReader::GetInstance().IsSupported();
|
||||
+
|
||||
+ // TODO(vikassoni) : Currently we have 2 different flags to enable/disable
|
||||
+ // AImageReader - one for MCVD and other for MediaPlayer here. Merge those 2
|
||||
+ // flags into a single flag. Keeping the 2 flags separate for now since finch
|
||||
+ // experiment using this flag is in progress.
|
||||
+ return a_image_reader_supported && features::IsAImageReaderEnabled() &&
|
||||
+ base::FeatureList::IsEnabled(features::kAImageReaderMediaPlayer)
|
||||
? TextureOwner::Mode::kAImageReaderInsecure
|
||||
: TextureOwner::Mode::kSurfaceTextureInsecure;
|
||||
}
|
||||
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
|
||||
--- a/media/base/media_switches.cc
|
||||
+++ b/media/base/media_switches.cc
|
||||
@@ -668,6 +668,10 @@ const base::Feature kMediaDrmPreprovisioning{"MediaDrmPreprovisioning",
|
||||
// Note: Has no effect if kMediaDrmPreprovisioning feature is disabled.
|
||||
const base::Feature kMediaDrmPreprovisioningAtStartup{
|
||||
"MediaDrmPreprovisioningAtStartup", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+// Enables the Android Image Reader path for Video decoding(for AVDA and MCVD)
|
||||
+const base::Feature kAImageReaderVideoOutput{"AImageReaderVideoOutput",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+
|
||||
|
||||
// Enable picture in picture web api for android.
|
||||
const base::Feature kPictureInPictureAPI{"PictureInPictureAPI",
|
||||
diff --git a/media/base/media_switches.h b/media/base/media_switches.h
|
||||
--- a/media/base/media_switches.h
|
||||
+++ b/media/base/media_switches.h
|
||||
@@ -219,6 +219,7 @@ MEDIA_EXPORT extern const base::Feature kForceHardwareAudioDecoders;
|
||||
MEDIA_EXPORT extern const base::Feature kAllowNonSecureOverlays;
|
||||
MEDIA_EXPORT extern const base::Feature kMediaControlsExpandGesture;
|
||||
MEDIA_EXPORT extern const base::Feature kMediaDrmPersistentLicense;
|
||||
+MEDIA_EXPORT extern const base::Feature kAImageReaderVideoOutput;
|
||||
MEDIA_EXPORT extern const base::Feature kMediaDrmPreprovisioning;
|
||||
MEDIA_EXPORT extern const base::Feature kMediaDrmPreprovisioningAtStartup;
|
||||
MEDIA_EXPORT extern const base::Feature kCanPlayHls;
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 27 Jun 2021 16:53:48 +0200
|
||||
Subject: API level 21: prevent crash on download
|
||||
|
||||
On Lollipop 5.0.x it is not possible to use the system persistent bundle.
|
||||
This patch ignores boolean settings for them and prevents the crash.
|
||||
|
||||
See also: https://github.com/bromite/bromite/issues/1184
|
||||
---
|
||||
.../internal/BundleToPersistableBundleConverter.java | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
|
||||
--- a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
|
||||
+++ b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
|
||||
@@ -85,9 +85,17 @@ class BundleToPersistableBundleConverter {
|
||||
if (obj == null) {
|
||||
persistableBundle.putString(key, null);
|
||||
} else if (obj instanceof Boolean) {
|
||||
- persistableBundle.putBoolean(key, (Boolean) obj);
|
||||
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
|
||||
+ failedKeys.add(key);
|
||||
+ } else {
|
||||
+ persistableBundle.putBoolean(key, (Boolean) obj);
|
||||
+ }
|
||||
} else if (obj instanceof boolean[]) {
|
||||
- persistableBundle.putBooleanArray(key, (boolean[]) obj);
|
||||
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
|
||||
+ failedKeys.add(key);
|
||||
+ } else {
|
||||
+ persistableBundle.putBooleanArray(key, (boolean[]) obj);
|
||||
+ }
|
||||
} else if (obj instanceof Double) {
|
||||
persistableBundle.putDouble(key, (Double) obj);
|
||||
} else if (obj instanceof double[]) {
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 16 Dec 2018 15:24:19 +0100
|
||||
Subject: AV1 codec support
|
||||
|
||||
libaom build fixes (requires -fPIC)
|
||||
Report AV1 as playable on Android
|
||||
---
|
||||
third_party/libaom/BUILD.gn | 6 ++++--
|
||||
third_party/libaom/libaom_srcs.gni | 5 +++++
|
||||
.../config/linux/arm-neon-cpu-detect/config/aom_config.asm | 2 +-
|
||||
.../config/linux/arm-neon-cpu-detect/config/aom_config.h | 2 +-
|
||||
.../source/config/linux/arm-neon/config/aom_config.asm | 2 +-
|
||||
.../libaom/source/config/linux/arm-neon/config/aom_config.h | 2 +-
|
||||
.../libaom/source/config/linux/arm/config/aom_config.asm | 2 +-
|
||||
.../libaom/source/config/linux/arm/config/aom_config.h | 2 +-
|
||||
.../libaom/source/config/linux/arm64/config/aom_config.asm | 2 +-
|
||||
.../libaom/source/config/linux/arm64/config/aom_config.h | 2 +-
|
||||
.../source/config/linux/generic/config/aom_config.asm | 2 +-
|
||||
.../libaom/source/config/linux/generic/config/aom_config.h | 2 +-
|
||||
.../libaom/source/config/linux/x64/config/aom_config.asm | 2 +-
|
||||
.../libaom/source/config/linux/x64/config/aom_config.h | 2 +-
|
||||
14 files changed, 21 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/third_party/libaom/BUILD.gn b/third_party/libaom/BUILD.gn
|
||||
--- a/third_party/libaom/BUILD.gn
|
||||
+++ b/third_party/libaom/BUILD.gn
|
||||
@@ -82,7 +82,7 @@ if (enable_libaom) {
|
||||
sources += aom_dsp_encoder_asm_sse2_x86_64
|
||||
sources += aom_dsp_encoder_asm_ssse3_x86_64
|
||||
}
|
||||
- defines = [ "CHROMIUM" ]
|
||||
+ defines = [ "CHROMIUM", "PIC" ]
|
||||
include_dirs = libaom_include_dirs
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ if (enable_libaom) {
|
||||
configs += [ "//build/config/compiler:no_chromium_code" ]
|
||||
if (current_cpu == "arm") {
|
||||
configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
|
||||
- cflags = [ "-mfpu=neon" ]
|
||||
+ cflags = [ "-mfpu=neon", "-fPIC" ]
|
||||
}
|
||||
configs += [ ":libaom_config" ]
|
||||
|
||||
@@ -256,6 +256,8 @@ if (enable_libaom) {
|
||||
if (current_cpu == "arm64" || cpu_arch_full == "arm-neon" ||
|
||||
cpu_arch_full == "arm-neon-cpu-detect") {
|
||||
deps += [ ":libaom_intrinsics_neon" ]
|
||||
+ # will detect CPU
|
||||
+ sources += aom_ports_arm_sources
|
||||
}
|
||||
if (is_android) {
|
||||
deps += [ "//third_party/android_ndk:cpu_features" ]
|
||||
diff --git a/third_party/libaom/libaom_srcs.gni b/third_party/libaom/libaom_srcs.gni
|
||||
--- a/third_party/libaom/libaom_srcs.gni
|
||||
+++ b/third_party/libaom/libaom_srcs.gni
|
||||
@@ -634,6 +634,11 @@ aom_mem_sources = [
|
||||
|
||||
aom_ports_asm_x86 = [ "//third_party/libaom/source/libaom/aom_ports/float.asm" ]
|
||||
|
||||
+aom_ports_arm_sources = [
|
||||
+ "//third_party/libaom/source/libaom/aom_ports/arm_cpudetect.c",
|
||||
+ "//third_party/libaom/source/libaom/aom_ports/arm.h",
|
||||
+ ]
|
||||
+
|
||||
aom_rtcd_sources = [
|
||||
"//third_party/libaom/source/libaom/aom_dsp/aom_dsp_rtcd.c",
|
||||
"//third_party/libaom/source/libaom/aom_scale/aom_scale_rtcd.c",
|
||||
diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
|
||||
--- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
|
||||
+++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
|
||||
@@ -48,7 +48,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
|
||||
CONFIG_OPTICAL_FLOW_API equ 0
|
||||
CONFIG_OS_SUPPORT equ 1
|
||||
CONFIG_PARTITION_SEARCH_ORDER equ 0
|
||||
-CONFIG_PIC equ 0
|
||||
+CONFIG_PIC equ 1
|
||||
CONFIG_RD_COMMAND equ 0
|
||||
CONFIG_RD_DEBUG equ 0
|
||||
CONFIG_REALTIME_ONLY equ 1
|
||||
diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
|
||||
--- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
|
||||
+++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
|
||||
@@ -50,7 +50,7 @@
|
||||
#define CONFIG_OPTICAL_FLOW_API 0
|
||||
#define CONFIG_OS_SUPPORT 1
|
||||
#define CONFIG_PARTITION_SEARCH_ORDER 0
|
||||
-#define CONFIG_PIC 0
|
||||
+#define CONFIG_PIC 1
|
||||
#define CONFIG_RD_COMMAND 0
|
||||
#define CONFIG_RD_DEBUG 0
|
||||
#define CONFIG_REALTIME_ONLY 1
|
||||
diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
|
||||
--- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
|
||||
+++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
|
||||
@@ -48,7 +48,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
|
||||
CONFIG_OPTICAL_FLOW_API equ 0
|
||||
CONFIG_OS_SUPPORT equ 1
|
||||
CONFIG_PARTITION_SEARCH_ORDER equ 0
|
||||
-CONFIG_PIC equ 0
|
||||
+CONFIG_PIC equ 1
|
||||
CONFIG_RD_COMMAND equ 0
|
||||
CONFIG_RD_DEBUG equ 0
|
||||
CONFIG_REALTIME_ONLY equ 1
|
||||
diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
|
||||
--- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
|
||||
+++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
|
||||
@@ -50,7 +50,7 @@
|
||||
#define CONFIG_OPTICAL_FLOW_API 0
|
||||
#define CONFIG_OS_SUPPORT 1
|
||||
#define CONFIG_PARTITION_SEARCH_ORDER 0
|
||||
-#define CONFIG_PIC 0
|
||||
+#define CONFIG_PIC 1
|
||||
#define CONFIG_RD_COMMAND 0
|
||||
#define CONFIG_RD_DEBUG 0
|
||||
#define CONFIG_REALTIME_ONLY 1
|
||||
diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.asm b/third_party/libaom/source/config/linux/arm/config/aom_config.asm
|
||||
--- a/third_party/libaom/source/config/linux/arm/config/aom_config.asm
|
||||
+++ b/third_party/libaom/source/config/linux/arm/config/aom_config.asm
|
||||
@@ -48,7 +48,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
|
||||
CONFIG_OPTICAL_FLOW_API equ 0
|
||||
CONFIG_OS_SUPPORT equ 1
|
||||
CONFIG_PARTITION_SEARCH_ORDER equ 0
|
||||
-CONFIG_PIC equ 0
|
||||
+CONFIG_PIC equ 1
|
||||
CONFIG_RD_COMMAND equ 0
|
||||
CONFIG_RD_DEBUG equ 0
|
||||
CONFIG_REALTIME_ONLY equ 1
|
||||
diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.h b/third_party/libaom/source/config/linux/arm/config/aom_config.h
|
||||
--- a/third_party/libaom/source/config/linux/arm/config/aom_config.h
|
||||
+++ b/third_party/libaom/source/config/linux/arm/config/aom_config.h
|
||||
@@ -50,7 +50,7 @@
|
||||
#define CONFIG_OPTICAL_FLOW_API 0
|
||||
#define CONFIG_OS_SUPPORT 1
|
||||
#define CONFIG_PARTITION_SEARCH_ORDER 0
|
||||
-#define CONFIG_PIC 0
|
||||
+#define CONFIG_PIC 1
|
||||
#define CONFIG_RD_COMMAND 0
|
||||
#define CONFIG_RD_DEBUG 0
|
||||
#define CONFIG_REALTIME_ONLY 1
|
||||
diff --git a/third_party/libaom/source/config/linux/arm64/config/aom_config.asm b/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
|
||||
--- a/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
|
||||
+++ b/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
|
||||
@@ -48,7 +48,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
|
||||
CONFIG_OPTICAL_FLOW_API equ 0
|
||||
CONFIG_OS_SUPPORT equ 1
|
||||
CONFIG_PARTITION_SEARCH_ORDER equ 0
|
||||
-CONFIG_PIC equ 0
|
||||
+CONFIG_PIC equ 1
|
||||
CONFIG_RD_COMMAND equ 0
|
||||
CONFIG_RD_DEBUG equ 0
|
||||
CONFIG_REALTIME_ONLY equ 1
|
||||
diff --git a/third_party/libaom/source/config/linux/arm64/config/aom_config.h b/third_party/libaom/source/config/linux/arm64/config/aom_config.h
|
||||
--- a/third_party/libaom/source/config/linux/arm64/config/aom_config.h
|
||||
+++ b/third_party/libaom/source/config/linux/arm64/config/aom_config.h
|
||||
@@ -50,7 +50,7 @@
|
||||
#define CONFIG_OPTICAL_FLOW_API 0
|
||||
#define CONFIG_OS_SUPPORT 1
|
||||
#define CONFIG_PARTITION_SEARCH_ORDER 0
|
||||
-#define CONFIG_PIC 0
|
||||
+#define CONFIG_PIC 1
|
||||
#define CONFIG_RD_COMMAND 0
|
||||
#define CONFIG_RD_DEBUG 0
|
||||
#define CONFIG_REALTIME_ONLY 1
|
||||
diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.asm b/third_party/libaom/source/config/linux/generic/config/aom_config.asm
|
||||
--- a/third_party/libaom/source/config/linux/generic/config/aom_config.asm
|
||||
+++ b/third_party/libaom/source/config/linux/generic/config/aom_config.asm
|
||||
@@ -48,7 +48,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
|
||||
CONFIG_OPTICAL_FLOW_API equ 0
|
||||
CONFIG_OS_SUPPORT equ 1
|
||||
CONFIG_PARTITION_SEARCH_ORDER equ 0
|
||||
-CONFIG_PIC equ 0
|
||||
+CONFIG_PIC equ 1
|
||||
CONFIG_RD_COMMAND equ 0
|
||||
CONFIG_RD_DEBUG equ 0
|
||||
CONFIG_REALTIME_ONLY equ 1
|
||||
diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.h b/third_party/libaom/source/config/linux/generic/config/aom_config.h
|
||||
--- a/third_party/libaom/source/config/linux/generic/config/aom_config.h
|
||||
+++ b/third_party/libaom/source/config/linux/generic/config/aom_config.h
|
||||
@@ -50,7 +50,7 @@
|
||||
#define CONFIG_OPTICAL_FLOW_API 0
|
||||
#define CONFIG_OS_SUPPORT 1
|
||||
#define CONFIG_PARTITION_SEARCH_ORDER 0
|
||||
-#define CONFIG_PIC 0
|
||||
+#define CONFIG_PIC 1
|
||||
#define CONFIG_RD_COMMAND 0
|
||||
#define CONFIG_RD_DEBUG 0
|
||||
#define CONFIG_REALTIME_ONLY 1
|
||||
diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.asm b/third_party/libaom/source/config/linux/x64/config/aom_config.asm
|
||||
--- a/third_party/libaom/source/config/linux/x64/config/aom_config.asm
|
||||
+++ b/third_party/libaom/source/config/linux/x64/config/aom_config.asm
|
||||
@@ -38,7 +38,7 @@
|
||||
%define CONFIG_OPTICAL_FLOW_API 0
|
||||
%define CONFIG_OS_SUPPORT 1
|
||||
%define CONFIG_PARTITION_SEARCH_ORDER 0
|
||||
-%define CONFIG_PIC 0
|
||||
+%define CONFIG_PIC 1
|
||||
%define CONFIG_RD_COMMAND 0
|
||||
%define CONFIG_RD_DEBUG 0
|
||||
%define CONFIG_REALTIME_ONLY 1
|
||||
diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.h b/third_party/libaom/source/config/linux/x64/config/aom_config.h
|
||||
--- a/third_party/libaom/source/config/linux/x64/config/aom_config.h
|
||||
+++ b/third_party/libaom/source/config/linux/x64/config/aom_config.h
|
||||
@@ -50,7 +50,7 @@
|
||||
#define CONFIG_OPTICAL_FLOW_API 0
|
||||
#define CONFIG_OS_SUPPORT 1
|
||||
#define CONFIG_PARTITION_SEARCH_ORDER 0
|
||||
-#define CONFIG_PIC 0
|
||||
+#define CONFIG_PIC 1
|
||||
#define CONFIG_RD_COMMAND 0
|
||||
#define CONFIG_RD_DEBUG 0
|
||||
#define CONFIG_REALTIME_ONLY 1
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -2,25 +2,23 @@ From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 26 Apr 2021 13:28:24 +0000
|
||||
Subject: Add AllowUserCertificates flag
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../chromium/chrome/browser/app/ChromeActivity.java | 3 +++
|
||||
chrome/browser/flags/android/chrome_feature_list.cc | 1 +
|
||||
.../chrome/browser/flags/ChromeFeatureList.java | 4 ++++
|
||||
.../Add-AllowUserCertificates-flag.inc | 13 +++++++++++++
|
||||
.../Add-AllowUserCertificates-flag.inc | 3 +++
|
||||
.../Add-AllowUserCertificates-flag.inc | 1 +
|
||||
net/android/java/src/org/chromium/net/X509Util.java | 5 +++++
|
||||
7 files changed, 30 insertions(+)
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-AllowUserCertificates-flag.inc
|
||||
create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Add-AllowUserCertificates-flag.inc
|
||||
create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/Add-AllowUserCertificates-flag.inc
|
||||
.../src/org/chromium/chrome/browser/app/ChromeActivity.java | 3 +++
|
||||
.../chromium/chrome/browser/app/flags/ChromeCachedFlags.java | 1 +
|
||||
chrome/browser/about_flags.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.cc | 5 +++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
chrome/browser/flags/android/chrome_feature_list.cc | 4 ++++
|
||||
chrome/browser/flags/android/chrome_feature_list.h | 1 +
|
||||
.../chromium/chrome/browser/flags/CachedFeatureFlags.java | 1 +
|
||||
.../org/chromium/chrome/browser/flags/ChromeFeatureList.java | 1 +
|
||||
net/android/java/src/org/chromium/net/X509Util.java | 5 +++++
|
||||
10 files changed, 28 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
@@ -233,6 +233,7 @@ import org.chromium.content_public.browser.LoadUrlParams;
|
||||
@@ -223,6 +223,7 @@ import org.chromium.content_public.browser.ScreenOrientationProvider;
|
||||
import org.chromium.content_public.browser.SelectionPopupController;
|
||||
import org.chromium.content_public.browser.WebContents;
|
||||
import org.chromium.content_public.common.ContentSwitches;
|
||||
@@ -28,106 +26,144 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv
|
||||
import org.chromium.printing.PrintManagerDelegateImpl;
|
||||
import org.chromium.printing.PrintingController;
|
||||
import org.chromium.printing.PrintingControllerImpl;
|
||||
@@ -981,6 +982,8 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
super.onStartWithNative();
|
||||
|
||||
ChromeActivitySessionTracker.getInstance().onStartWithNative(getProfileProviderSupplier());
|
||||
@@ -976,6 +977,8 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
UpdateMenuItemHelper.getInstance().onStart();
|
||||
ChromeActivitySessionTracker.getInstance().onStartWithNative();
|
||||
ChromeCachedFlags.getInstance().cacheNativeFlags();
|
||||
+ X509Util.AllowUserCertificates = ChromeFeatureList.isEnabled(
|
||||
+ ChromeFeatureList.ALLOW_USER_CERTIFICATES);
|
||||
OfflineIndicatorController.initialize();
|
||||
|
||||
// postDeferredStartupIfNeeded() is called in TabModelSelectorTabObsever#onLoadStopped(),
|
||||
// #onPageLoadFinished() and #onCrash(). If we are not actively loading a tab (e.g.
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java b/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java
|
||||
@@ -88,6 +88,7 @@ public class ChromeCachedFlags {
|
||||
add(ChromeFeatureList.EARLY_LIBRARY_LOAD);
|
||||
add(ChromeFeatureList.ELASTIC_OVERSCROLL);
|
||||
add(ChromeFeatureList.IMMERSIVE_UI_MODE);
|
||||
+ add(ChromeFeatureList.ALLOW_USER_CERTIFICATES);
|
||||
add(ChromeFeatureList.INSTANT_START);
|
||||
add(ChromeFeatureList.INSTANCE_SWITCHER);
|
||||
add(ChromeFeatureList.INTEREST_FEED_V2);
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -2781,6 +2781,10 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
flag_descriptions::kCSSContainerQueriesDescription, kOsAll,
|
||||
FEATURE_VALUE_TYPE(blink::features::kCSSContainerQueries)},
|
||||
#if defined(OS_ANDROID)
|
||||
+ {"allow-user-certificates",
|
||||
+ flag_descriptions::kAllowUserCertificatesName,
|
||||
+ flag_descriptions::kAllowUserCertificatesDescription, kOsAndroid,
|
||||
+ FEATURE_VALUE_TYPE(chrome::android::kAllowUserCertificates)},
|
||||
{"contextual-search-debug", flag_descriptions::kContextualSearchDebugName,
|
||||
flag_descriptions::kContextualSearchDebugDescription, kOsAndroid,
|
||||
FEATURE_VALUE_TYPE(chrome::android::kContextualSearchDebug)},
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -11,6 +11,11 @@
|
||||
|
||||
namespace flag_descriptions {
|
||||
|
||||
+const char kAllowUserCertificatesName[] = "Allow user certificates";
|
||||
+const char kAllowUserCertificatesDescription[] =
|
||||
+ "Allow user CA certificates during "
|
||||
+ "validation of the certificate chain";
|
||||
+
|
||||
const char kAccelerated2dCanvasName[] = "Accelerated 2D canvas";
|
||||
const char kAccelerated2dCanvasDescription[] =
|
||||
"Enables the use of the GPU to perform 2d canvas rendering instead of "
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -46,6 +46,9 @@ namespace flag_descriptions {
|
||||
|
||||
// Cross-platform -------------------------------------------------------------
|
||||
|
||||
+extern const char kAllowUserCertificatesName[];
|
||||
+extern const char kAllowUserCertificatesDescription[];
|
||||
+
|
||||
extern const char kAccelerated2dCanvasName[];
|
||||
extern const char kAccelerated2dCanvasDescription[];
|
||||
|
||||
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
--- a/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
@@ -169,6 +169,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
|
||||
&feed::kFeedPerformanceStudy,
|
||||
&feed::kFeedShowSignInCommand,
|
||||
&feed::kFeedSignedOutViewDemotion,
|
||||
@@ -139,6 +139,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
|
||||
&feed::kFeedInteractiveRefresh,
|
||||
&feed::kInterestFeedContentSuggestions,
|
||||
&feed::kInterestFeedSpinnerAlwaysAnimate,
|
||||
+ &kAllowUserCertificates,
|
||||
&feed::kFeedRecyclerBinderUnmountOnDetach,
|
||||
&feed::kInterestFeedV1ClicksAndViewsConditionalUpload,
|
||||
&feed::kInterestFeedV2,
|
||||
&feed::kWebFeedAwareness,
|
||||
&feed::kInterestFeedV2Autoplay,
|
||||
@@ -373,6 +374,9 @@ const base::Feature kAdaptiveButtonInTopToolbarCustomizationV2{
|
||||
"AdaptiveButtonInTopToolbarCustomizationV2",
|
||||
base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
+const base::Feature kAllowUserCertificates = {
|
||||
+ "AllowUserCertificates", base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+
|
||||
const base::Feature kAddToHomescreenIPH{"AddToHomescreenIPH",
|
||||
base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h
|
||||
--- a/chrome/browser/flags/android/chrome_feature_list.h
|
||||
+++ b/chrome/browser/flags/android/chrome_feature_list.h
|
||||
@@ -12,6 +12,7 @@
|
||||
namespace chrome {
|
||||
namespace android {
|
||||
|
||||
+extern const base::Feature kAllowUserCertificates;
|
||||
// Alphabetical:
|
||||
extern const base::Feature kAdaptiveButtonInTopToolbar;
|
||||
extern const base::Feature kAdaptiveButtonInTopToolbarCustomizationV2;
|
||||
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
|
||||
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
|
||||
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
|
||||
@@ -48,6 +48,7 @@ public class CachedFeatureFlags {
|
||||
*/
|
||||
private static Map<String, Boolean> sDefaults =
|
||||
ImmutableMap.<String, Boolean>builder()
|
||||
+ .put(ChromeFeatureList.ALLOW_USER_CERTIFICATES, false)
|
||||
.put(ChromeFeatureList.ANDROID_PARTNER_CUSTOMIZATION_PHENOTYPE, true)
|
||||
.put(ChromeFeatureList.BOOKMARK_BOTTOM_SHEET, false)
|
||||
.put(ChromeFeatureList.CONDITIONAL_TAB_STRIP_ANDROID, false)
|
||||
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
|
||||
--- 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
|
||||
@@ -162,6 +162,7 @@ public abstract class ChromeFeatureList {
|
||||
"AccountForSuppressedKeyboardInsets";
|
||||
@@ -211,6 +211,7 @@ public abstract class ChromeFeatureList {
|
||||
}
|
||||
|
||||
/* Alphabetical: */
|
||||
+ public static final String ALLOW_USER_CERTIFICATES = "AllowUserCertificates";
|
||||
public static final String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR = "AdaptiveButtonInTopToolbar";
|
||||
public static final String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR_CUSTOMIZATION_V2 =
|
||||
"AdaptiveButtonInTopToolbarCustomizationV2";
|
||||
+ public static final String ALLOW_USER_CERTIFICATES = "AllowUserCertificates";
|
||||
public static final String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR_PAGE_SUMMARY =
|
||||
"AdaptiveButtonInTopToolbarPageSummary";
|
||||
public static final String ALLOW_TAB_CLOSING_UPON_MINIMIZATION =
|
||||
@@ -680,6 +681,8 @@ public abstract class ChromeFeatureList {
|
||||
public static final CachedFlag sAndroidWindowPopupLargeScreen =
|
||||
newCachedFlag(ANDROID_WINDOW_POPUP_LARGE_SCREEN, false);
|
||||
public static final CachedFlag sAppSpecificHistory = newCachedFlag(APP_SPECIFIC_HISTORY, true);
|
||||
+ public static final CachedFlag sAllowUserCertificates =
|
||||
+ newCachedFlag(ALLOW_USER_CERTIFICATES, false);
|
||||
public static final CachedFlag sAsyncNotificationManager =
|
||||
newCachedFlag(ASYNC_NOTIFICATION_MANAGER, false, true);
|
||||
public static final CachedFlag sAsyncNotificationManagerForDownload =
|
||||
@@ -941,6 +944,7 @@ public abstract class ChromeFeatureList {
|
||||
sAccountForSuppressedKeyboardInsets,
|
||||
sAllowTabClosingUponMinimization,
|
||||
sAndroidAppIntegration,
|
||||
+ sAllowUserCertificates,
|
||||
sAndroidAppIntegrationModule,
|
||||
sAndroidAppIntegrationMultiDataSource,
|
||||
sAndroidAppIntegrationV2,
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-AllowUserCertificates-flag.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-AllowUserCertificates-flag.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/Add-AllowUserCertificates-flag.inc
|
||||
@@ -0,0 +1,13 @@
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
+#if BUILDFLAG(IS_ANDROID)
|
||||
+
|
||||
+ {"allow-user-certificates",
|
||||
+ "Allow user certificates",
|
||||
+ "Allow user CA certificates during "
|
||||
+ "validation of the certificate chain", kOsAndroid,
|
||||
+ FEATURE_VALUE_TYPE(chrome::android::kAllowUserCertificates)},
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+#endif
|
||||
diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Add-AllowUserCertificates-flag.inc b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Add-AllowUserCertificates-flag.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Add-AllowUserCertificates-flag.inc
|
||||
@@ -0,0 +1,3 @@
|
||||
+CROMITE_FEATURE(kAllowUserCertificates,
|
||||
+ "AllowUserCertificates",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/Add-AllowUserCertificates-flag.inc b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/Add-AllowUserCertificates-flag.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/Add-AllowUserCertificates-flag.inc
|
||||
@@ -0,0 +1 @@
|
||||
+BASE_DECLARE_FEATURE(kAllowUserCertificates);
|
||||
diff --git a/net/android/java/src/org/chromium/net/X509Util.java b/net/android/java/src/org/chromium/net/X509Util.java
|
||||
--- a/net/android/java/src/org/chromium/net/X509Util.java
|
||||
+++ b/net/android/java/src/org/chromium/net/X509Util.java
|
||||
@@ -537,6 +537,8 @@ public class X509Util {
|
||||
return userRootBytes.toArray(new byte[0][]);
|
||||
@@ -488,6 +488,8 @@ public class X509Util {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ public static boolean AllowUserCertificates = false;
|
||||
+
|
||||
public static AndroidCertVerifyResult verifyServerCertificates(
|
||||
byte[][] certChain,
|
||||
String authType,
|
||||
@@ -637,6 +639,9 @@ public class X509Util {
|
||||
X509Certificate root = verifiedChain.get(verifiedChain.size() - 1);
|
||||
public static AndroidCertVerifyResult verifyServerCertificates(byte[][] certChain,
|
||||
String authType,
|
||||
String host)
|
||||
@@ -568,6 +570,9 @@ public class X509Util {
|
||||
isIssuedByKnownRoot = isKnownRoot(root);
|
||||
}
|
||||
|
||||
+ if (AllowUserCertificates == false && isIssuedByKnownRoot == false)
|
||||
+ return new AndroidCertVerifyResult(CertVerifyStatusAndroid.NO_TRUSTED_ROOT);
|
||||
+
|
||||
return new AndroidCertVerifyResult(
|
||||
CertVerifyStatusAndroid.OK, isIssuedByKnownRoot, verifiedChain);
|
||||
return new AndroidCertVerifyResult(CertVerifyStatusAndroid.OK,
|
||||
isIssuedByKnownRoot, verifiedChain);
|
||||
}
|
||||
--
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -2,24 +2,22 @@ From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 9 Mar 2021 19:43:00 +0100
|
||||
Subject: Add Alt+D hotkey to focus address bar
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../src/org/chromium/chrome/browser/KeyboardShortcuts.java | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
.../java/src/org/chromium/chrome/browser/KeyboardShortcuts.java | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java b/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
|
||||
@@ -839,6 +839,11 @@ public class KeyboardShortcuts {
|
||||
KeyEvent.KEYCODE_B,
|
||||
(KeyEvent.META_CTRL_ON | KeyEvent.META_SHIFT_ON));
|
||||
}
|
||||
+ addShortcut(context,
|
||||
+ shortcutGroupsById.get(R.string.keyboard_shortcut_chrome_feature_group_header),
|
||||
+ R.string.keyboard_shortcut_address_bar,
|
||||
+ KeyEvent.KEYCODE_D,
|
||||
+ KeyEvent.META_ALT_ON);
|
||||
return new ArrayList<>(shortcutGroupsById.values());
|
||||
}
|
||||
@@ -156,6 +156,8 @@ public class KeyboardShortcuts {
|
||||
KeyEvent.KEYCODE_F, KeyEvent.META_CTRL_ON);
|
||||
addShortcut(context, chromeFeatureShortcutGroup, R.string.keyboard_shortcut_address_bar,
|
||||
KeyEvent.KEYCODE_L, KeyEvent.META_CTRL_ON);
|
||||
+ addShortcut(context, chromeFeatureShortcutGroup, R.string.keyboard_shortcut_address_bar,
|
||||
+ KeyEvent.KEYCODE_D, KeyEvent.META_ALT_ON);
|
||||
shortcutGroups.add(chromeFeatureShortcutGroup);
|
||||
|
||||
--
|
||||
KeyboardShortcutGroup webpageShortcutGroup = new KeyboardShortcutGroup(
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -0,0 +1,926 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Thu, 12 Oct 2017 11:06:18 +0200
|
||||
Subject: Add DuckDuckGo Lite search engine
|
||||
|
||||
---
|
||||
.../search_engines/prepopulated_engines.json | 10 +
|
||||
.../search_engines/search_engine_type.h | 1 +
|
||||
.../template_url_prepopulate_data.cc | 196 +++++++++---------
|
||||
3 files changed, 109 insertions(+), 98 deletions(-)
|
||||
|
||||
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
|
||||
--- a/components/search_engines/prepopulated_engines.json
|
||||
+++ b/components/search_engines/prepopulated_engines.json
|
||||
@@ -102,6 +102,16 @@
|
||||
"id": 92
|
||||
},
|
||||
|
||||
+ "duckduckgo_light": {
|
||||
+ "name": "DuckDuckGo Light",
|
||||
+ "keyword": "duckduckgo.com/lite",
|
||||
+ "favicon_url": "https://duckduckgo.com/favicon.ico",
|
||||
+ "search_url": "https://duckduckgo.com/lite/?q={searchTerms}",
|
||||
+ "suggest_url": "https://duckduckgo.com/ac/?q={searchTerms}&type=list",
|
||||
+ "type": "SEARCH_ENGINE_DUCKDUCKGOLIGHT",
|
||||
+ "id": 12
|
||||
+ },
|
||||
+
|
||||
"ecosia": {
|
||||
"name": "Ecosia",
|
||||
"keyword": "ecosia.org",
|
||||
diff --git a/components/search_engines/search_engine_type.h b/components/search_engines/search_engine_type.h
|
||||
--- a/components/search_engines/search_engine_type.h
|
||||
+++ b/components/search_engines/search_engine_type.h
|
||||
@@ -65,6 +65,7 @@ enum SearchEngineType {
|
||||
SEARCH_ENGINE_360 = 48,
|
||||
SEARCH_ENGINE_COCCOC = 49,
|
||||
SEARCH_ENGINE_DUCKDUCKGO = 50,
|
||||
+ SEARCH_ENGINE_DUCKDUCKGOLIGHT,
|
||||
SEARCH_ENGINE_PARSIJOO = 51,
|
||||
SEARCH_ENGINE_QWANT = 52,
|
||||
SEARCH_ENGINE_GIVERO = 53,
|
||||
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc
|
||||
--- a/components/search_engines/template_url_prepopulate_data.cc
|
||||
+++ b/components/search_engines/template_url_prepopulate_data.cc
|
||||
@@ -41,7 +41,7 @@ const PrepopulatedEngine* const engines_AE[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -50,7 +50,7 @@ const PrepopulatedEngine* const engines_AL[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_com,
|
||||
};
|
||||
|
||||
@@ -59,7 +59,7 @@ const PrepopulatedEngine* const engines_AR[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_ar,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -67,7 +67,7 @@ const PrepopulatedEngine* const engines_AR[] = {
|
||||
const PrepopulatedEngine* const engines_AT[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo_at,
|
||||
&ecosia,
|
||||
};
|
||||
@@ -77,7 +77,7 @@ const PrepopulatedEngine* const engines_AU[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_au,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -86,7 +86,7 @@ const PrepopulatedEngine* const engines_BA[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Belgium
|
||||
@@ -95,7 +95,7 @@ const PrepopulatedEngine* const engines_BE[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&ecosia,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Bulgaria
|
||||
@@ -103,7 +103,7 @@ const PrepopulatedEngine* const engines_BG[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -112,7 +112,7 @@ const PrepopulatedEngine* const engines_BH[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -121,7 +121,7 @@ const PrepopulatedEngine* const engines_BI[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -130,7 +130,7 @@ const PrepopulatedEngine* const engines_BN[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -139,7 +139,7 @@ const PrepopulatedEngine* const engines_BO[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -148,7 +148,7 @@ const PrepopulatedEngine* const engines_BR[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_br,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -158,7 +158,7 @@ const PrepopulatedEngine* const engines_BY[] = {
|
||||
&yandex_by,
|
||||
&mail_ru,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Belize
|
||||
@@ -166,7 +166,7 @@ const PrepopulatedEngine* const engines_BZ[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ask,
|
||||
};
|
||||
|
||||
@@ -175,7 +175,7 @@ const PrepopulatedEngine* const engines_CA[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_ca,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -183,7 +183,7 @@ const PrepopulatedEngine* const engines_CA[] = {
|
||||
const PrepopulatedEngine* const engines_CH[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
&yahoo_ch,
|
||||
};
|
||||
@@ -193,7 +193,7 @@ const PrepopulatedEngine* const engines_CL[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_es,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -212,7 +212,7 @@ const PrepopulatedEngine* const engines_CO[] = {
|
||||
&bing,
|
||||
&yahoo_es,
|
||||
&ecosia,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Costa Rica
|
||||
@@ -220,7 +220,7 @@ const PrepopulatedEngine* const engines_CR[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -230,14 +230,14 @@ const PrepopulatedEngine* const engines_CZ[] = {
|
||||
&seznam_cz,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Germany
|
||||
const PrepopulatedEngine* const engines_DE[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
&yahoo_de,
|
||||
};
|
||||
@@ -247,7 +247,7 @@ const PrepopulatedEngine* const engines_DK[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_dk,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -256,7 +256,7 @@ const PrepopulatedEngine* const engines_DO[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -266,7 +266,7 @@ const PrepopulatedEngine* const engines_DZ[] = {
|
||||
&yahoo_uk,
|
||||
&bing,
|
||||
&yandex_ru,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Ecuador
|
||||
@@ -274,7 +274,7 @@ const PrepopulatedEngine* const engines_EC[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -293,7 +293,7 @@ const PrepopulatedEngine* const engines_EG[] = {
|
||||
&yahoo,
|
||||
&bing,
|
||||
&yandex_com,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Spain
|
||||
@@ -301,7 +301,7 @@ const PrepopulatedEngine* const engines_ES[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_es,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -310,7 +310,7 @@ const PrepopulatedEngine* const engines_FI[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_fi,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -319,7 +319,7 @@ const PrepopulatedEngine* const engines_FO[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_dk,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -337,7 +337,7 @@ const PrepopulatedEngine* const engines_GB[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_uk,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -346,7 +346,7 @@ const PrepopulatedEngine* const engines_GR[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_com,
|
||||
};
|
||||
|
||||
@@ -355,7 +355,7 @@ const PrepopulatedEngine* const engines_GT[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -365,7 +365,7 @@ const PrepopulatedEngine* const engines_HK[] = {
|
||||
&yahoo_hk,
|
||||
&bing,
|
||||
&baidu,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Honduras
|
||||
@@ -373,7 +373,7 @@ const PrepopulatedEngine* const engines_HN[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -382,7 +382,7 @@ const PrepopulatedEngine* const engines_HR[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -391,7 +391,7 @@ const PrepopulatedEngine* const engines_HU[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -400,7 +400,7 @@ const PrepopulatedEngine* const engines_ID[] = {
|
||||
&googleen, &google,
|
||||
&yahoo_id,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_com,
|
||||
};
|
||||
|
||||
@@ -409,7 +409,7 @@ const PrepopulatedEngine* const engines_IE[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -419,7 +419,7 @@ const PrepopulatedEngine* const engines_IL[] = {
|
||||
&bing,
|
||||
&yandex_ru,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// India
|
||||
@@ -427,7 +427,7 @@ const PrepopulatedEngine* const engines_IN[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_in,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -437,7 +437,7 @@ const PrepopulatedEngine* const engines_IQ[] = {
|
||||
&bing,
|
||||
&yahoo_uk,
|
||||
&yandex_com,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Iran
|
||||
@@ -454,7 +454,7 @@ const PrepopulatedEngine* const engines_IS[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -463,7 +463,7 @@ const PrepopulatedEngine* const engines_IT[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -472,7 +472,7 @@ const PrepopulatedEngine* const engines_JM[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -481,7 +481,7 @@ const PrepopulatedEngine* const engines_JO[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_com,
|
||||
};
|
||||
|
||||
@@ -491,7 +491,7 @@ const PrepopulatedEngine* const engines_JP[] = {
|
||||
&yahoo_jp,
|
||||
&bing,
|
||||
&baidu,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Kenya
|
||||
@@ -499,7 +499,7 @@ const PrepopulatedEngine* const engines_KE[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -517,7 +517,7 @@ const PrepopulatedEngine* const engines_KW[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_com,
|
||||
};
|
||||
|
||||
@@ -535,7 +535,7 @@ const PrepopulatedEngine* const engines_LB[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -543,7 +543,7 @@ const PrepopulatedEngine* const engines_LB[] = {
|
||||
const PrepopulatedEngine* const engines_LI[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo,
|
||||
&ecosia,
|
||||
};
|
||||
@@ -554,14 +554,14 @@ const PrepopulatedEngine* const engines_LT[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&yandex_ru,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Luxembourg
|
||||
const PrepopulatedEngine* const engines_LU[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo,
|
||||
&ecosia,
|
||||
};
|
||||
@@ -572,7 +572,7 @@ const PrepopulatedEngine* const engines_LV[] = {
|
||||
&bing,
|
||||
&yandex_ru,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Libya
|
||||
@@ -581,7 +581,7 @@ const PrepopulatedEngine* const engines_LY[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&yandex_com,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Morocco
|
||||
@@ -590,7 +590,7 @@ const PrepopulatedEngine* const engines_MA[] = {
|
||||
&yahoo_fr,
|
||||
&bing,
|
||||
&yandex_com,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Monaco
|
||||
@@ -598,7 +598,7 @@ const PrepopulatedEngine* const engines_MC[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&qwant,
|
||||
};
|
||||
|
||||
@@ -617,7 +617,7 @@ const PrepopulatedEngine* const engines_ME[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&yandex_ru,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Macedonia
|
||||
@@ -625,7 +625,7 @@ const PrepopulatedEngine* const engines_MK[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&baidu,
|
||||
};
|
||||
|
||||
@@ -634,7 +634,7 @@ const PrepopulatedEngine* const engines_MX[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_mx,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -643,7 +643,7 @@ const PrepopulatedEngine* const engines_MY[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_my,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&baidu,
|
||||
};
|
||||
|
||||
@@ -652,7 +652,7 @@ const PrepopulatedEngine* const engines_NI[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -660,7 +660,7 @@ const PrepopulatedEngine* const engines_NI[] = {
|
||||
const PrepopulatedEngine* const engines_NL[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo_nl,
|
||||
&ecosia,
|
||||
};
|
||||
@@ -670,7 +670,7 @@ const PrepopulatedEngine* const engines_NO[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -679,7 +679,7 @@ const PrepopulatedEngine* const engines_NZ[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_nz,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -688,7 +688,7 @@ const PrepopulatedEngine* const engines_OM[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ask,
|
||||
};
|
||||
|
||||
@@ -697,7 +697,7 @@ const PrepopulatedEngine* const engines_PA[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -707,7 +707,7 @@ const PrepopulatedEngine* const engines_PE[] = {
|
||||
&bing,
|
||||
&yahoo_es,
|
||||
&ecosia,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Philippines
|
||||
@@ -716,7 +716,7 @@ const PrepopulatedEngine* const engines_PH[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&ecosia,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Pakistan
|
||||
@@ -724,7 +724,7 @@ const PrepopulatedEngine* const engines_PK[] = {
|
||||
&googleen, &google,
|
||||
&yahoo,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_com,
|
||||
};
|
||||
|
||||
@@ -733,7 +733,7 @@ const PrepopulatedEngine* const engines_PL[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Puerto Rico
|
||||
@@ -741,7 +741,7 @@ const PrepopulatedEngine* const engines_PR[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -750,7 +750,7 @@ const PrepopulatedEngine* const engines_PT[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -759,7 +759,7 @@ const PrepopulatedEngine* const engines_PY[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -768,7 +768,7 @@ const PrepopulatedEngine* const engines_QA[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -777,7 +777,7 @@ const PrepopulatedEngine* const engines_RO[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -786,7 +786,7 @@ const PrepopulatedEngine* const engines_RS[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -796,7 +796,7 @@ const PrepopulatedEngine* const engines_RU[] = {
|
||||
&yandex_ru,
|
||||
&mail_ru,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Rwanda
|
||||
@@ -804,7 +804,7 @@ const PrepopulatedEngine* const engines_RW[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -814,7 +814,7 @@ const PrepopulatedEngine* const engines_SA[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&yandex_com,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Sweden
|
||||
@@ -822,7 +822,7 @@ const PrepopulatedEngine* const engines_SE[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo_se,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -832,14 +832,14 @@ const PrepopulatedEngine* const engines_SG[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&baidu,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Slovenia
|
||||
const PrepopulatedEngine* const engines_SI[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo,
|
||||
};
|
||||
|
||||
@@ -848,7 +848,7 @@ const PrepopulatedEngine* const engines_SK[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&seznam_cz,
|
||||
};
|
||||
|
||||
@@ -857,7 +857,7 @@ const PrepopulatedEngine* const engines_SV[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -867,7 +867,7 @@ const PrepopulatedEngine* const engines_SY[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&yandex_ru,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Thailand
|
||||
@@ -875,7 +875,7 @@ const PrepopulatedEngine* const engines_TH[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&baidu,
|
||||
};
|
||||
|
||||
@@ -884,7 +884,7 @@ const PrepopulatedEngine* const engines_TN[] = {
|
||||
&googleen, &google,
|
||||
&yahoo_fr,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yandex_ru,
|
||||
};
|
||||
|
||||
@@ -894,7 +894,7 @@ const PrepopulatedEngine* const engines_TR[] = {
|
||||
&yandex_tr,
|
||||
&yahoo_tr,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// Trinidad and Tobago
|
||||
@@ -902,7 +902,7 @@ const PrepopulatedEngine* const engines_TT[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -920,7 +920,7 @@ const PrepopulatedEngine* const engines_TZ[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -929,7 +929,7 @@ const PrepopulatedEngine* const engines_UA[] = {
|
||||
&googleen, &google,
|
||||
&yandex_ua,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&yahoo,
|
||||
};
|
||||
|
||||
@@ -938,7 +938,7 @@ const PrepopulatedEngine* const engines_US[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -947,7 +947,7 @@ const PrepopulatedEngine* const engines_UY[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -956,7 +956,7 @@ const PrepopulatedEngine* const engines_VE[] = {
|
||||
&googleen, &google,
|
||||
&yahoo_ve,
|
||||
&bing,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -975,7 +975,7 @@ const PrepopulatedEngine* const engines_YE[] = {
|
||||
&bing,
|
||||
&yahoo,
|
||||
&yandex_ru,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
};
|
||||
|
||||
// South Africa
|
||||
@@ -983,7 +983,7 @@ const PrepopulatedEngine* const engines_ZA[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ecosia,
|
||||
};
|
||||
|
||||
@@ -992,7 +992,7 @@ const PrepopulatedEngine* const engines_ZW[] = {
|
||||
&googleen, &google,
|
||||
&bing,
|
||||
&yahoo,
|
||||
- &duckduckgo,
|
||||
+ &duckduckgo, &duckduckgo_light,
|
||||
&ask,
|
||||
};
|
||||
// ----------------------------------------------------------------------------
|
||||
--
|
||||
2.17.1
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,58 +2,96 @@ From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 26 Apr 2021 15:04:11 +0000
|
||||
Subject: Add IsCleartextPermitted flag
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../about_flags_cc/Add-IsCleartextPermitted-flag.inc | 8 ++++++++
|
||||
.../base/features_cc/Add-IsCleartextPermitted-flag.inc | 3 +++
|
||||
.../net/base/features_h/Add-IsCleartextPermitted-flag.inc | 1 +
|
||||
net/url_request/url_request_http_job.cc | 5 +++++
|
||||
4 files changed, 17 insertions(+)
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-IsCleartextPermitted-flag.inc
|
||||
create mode 100644 cromite_flags/net/base/features_cc/Add-IsCleartextPermitted-flag.inc
|
||||
create mode 100644 cromite_flags/net/base/features_h/Add-IsCleartextPermitted-flag.inc
|
||||
chrome/browser/about_flags.cc | 5 +++++
|
||||
chrome/browser/flag_descriptions.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
net/base/features.cc | 3 +++
|
||||
net/base/features.h | 2 ++
|
||||
net/url_request/url_request_http_job.cc | 4 ++++
|
||||
6 files changed, 21 insertions(+)
|
||||
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-IsCleartextPermitted-flag.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-IsCleartextPermitted-flag.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/Add-IsCleartextPermitted-flag.inc
|
||||
@@ -0,0 +1,8 @@
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -7617,6 +7617,11 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
FEATURE_VALUE_TYPE(
|
||||
chrome::android::kBookmarksExportUseSaf)},
|
||||
|
||||
+ {"cleartext-permitted",
|
||||
+ "Allow cleartext traffic",
|
||||
+ "Allow insecure connections over HTTP", kOsAll,
|
||||
+ flag_descriptions::kIsCleartextPermittedName,
|
||||
+ flag_descriptions::kIsCleartextPermittedDescription, kOsAndroid,
|
||||
+ FEATURE_VALUE_TYPE(net::features::kIsCleartextPermitted)},
|
||||
+
|
||||
+#endif
|
||||
diff --git a/cromite_flags/net/base/features_cc/Add-IsCleartextPermitted-flag.inc b/cromite_flags/net/base/features_cc/Add-IsCleartextPermitted-flag.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/net/base/features_cc/Add-IsCleartextPermitted-flag.inc
|
||||
@@ -0,0 +1,3 @@
|
||||
+CROMITE_FEATURE(kIsCleartextPermitted,
|
||||
+ "IsCleartextPermitted",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
diff --git a/cromite_flags/net/base/features_h/Add-IsCleartextPermitted-flag.inc b/cromite_flags/net/base/features_h/Add-IsCleartextPermitted-flag.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/net/base/features_h/Add-IsCleartextPermitted-flag.inc
|
||||
@@ -0,0 +1 @@
|
||||
+NET_EXPORT BASE_DECLARE_FEATURE(kIsCleartextPermitted);
|
||||
// NOTE: Adding a new flag requires adding a corresponding entry to enum
|
||||
// "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag
|
||||
// Histograms" in tools/metrics/histograms/README.md (run the
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -1407,6 +1407,10 @@ const char kHttpsOnlyModeDescription[] =
|
||||
"Adds a setting under chrome://settings/security to opt-in to HTTPS-First "
|
||||
"Mode.";
|
||||
|
||||
+const char kIsCleartextPermittedName[] = "Allow cleartext traffic";
|
||||
+const char kIsCleartextPermittedDescription[] =
|
||||
+ "Allow insecure connections over HTTP";
|
||||
+
|
||||
const char kIgnoreGpuBlocklistName[] = "Override software rendering list";
|
||||
const char kIgnoreGpuBlocklistDescription[] =
|
||||
"Overrides the built-in software rendering list and enables "
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -814,6 +814,9 @@ extern const char kHostedAppShimCreationDescription[];
|
||||
extern const char kHttpsOnlyModeName[];
|
||||
extern const char kHttpsOnlyModeDescription[];
|
||||
|
||||
+extern const char kIsCleartextPermittedName[];
|
||||
+extern const char kIsCleartextPermittedDescription[];
|
||||
+
|
||||
extern const char kIgnoreGpuBlocklistName[];
|
||||
extern const char kIgnoreGpuBlocklistDescription[];
|
||||
|
||||
diff --git a/net/base/features.cc b/net/base/features.cc
|
||||
--- a/net/base/features.cc
|
||||
+++ b/net/base/features.cc
|
||||
@@ -89,6 +89,9 @@ const base::FeatureParam<int> kUseDnsHttpsSvcbExtraTimePercent{
|
||||
const base::Feature kEnableTLS13EarlyData{"EnableTLS13EarlyData",
|
||||
base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
+const base::Feature kIsCleartextPermitted{"IsCleartextPermitted",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+
|
||||
const base::Feature kNetworkQualityEstimator{"NetworkQualityEstimator",
|
||||
base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
diff --git a/net/base/features.h b/net/base/features.h
|
||||
--- a/net/base/features.h
|
||||
+++ b/net/base/features.h
|
||||
@@ -37,6 +37,8 @@ NET_EXPORT extern const base::Feature kCapReferrerToOriginOnCrossOrigin;
|
||||
// Enables TLS 1.3 early data.
|
||||
NET_EXPORT extern const base::Feature kEnableTLS13EarlyData;
|
||||
|
||||
+NET_EXPORT extern const base::Feature kIsCleartextPermitted;
|
||||
+
|
||||
// Support for altering the parameters used for DNS transaction timeout. See
|
||||
// ResolveContext::SecureTransactionTimeout().
|
||||
NET_EXPORT extern const base::Feature kDnsTransactionDynamicTimeouts;
|
||||
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
|
||||
--- a/net/url_request/url_request_http_job.cc
|
||||
+++ b/net/url_request/url_request_http_job.cc
|
||||
@@ -387,6 +387,11 @@ std::unique_ptr<URLRequestJob> URLRequestHttpJob::Create(URLRequest* request) {
|
||||
}
|
||||
@@ -214,6 +214,10 @@ std::unique_ptr<URLRequestJob> URLRequestHttpJob::Create(URLRequest* request) {
|
||||
}
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
+ if (base::FeatureList::IsEnabled(net::features::kIsCleartextPermitted) == false) {
|
||||
+ return std::make_unique<URLRequestErrorJob>(request,
|
||||
+ ERR_CLEARTEXT_NOT_PERMITTED);
|
||||
+ }
|
||||
+
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Check whether the app allows cleartext traffic to this host, and return
|
||||
// ERR_CLEARTEXT_NOT_PERMITTED if not.
|
||||
--
|
||||
if (request->context()->check_cleartext_permitted() &&
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Wed, 6 Dec 2023 10:21:45 +0000
|
||||
Subject: Add PartialLowEndModeOnMidRangeDevices flag
|
||||
|
||||
adds a new flag in chrome://flags to re-enable the experiment
|
||||
|
||||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
---
|
||||
base/features.cc | 4 ++++
|
||||
.../Add-PartialLowEndModeOnMidRangeDevices-flag.inc | 12 ++++++++++++
|
||||
2 files changed, 16 insertions(+)
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-PartialLowEndModeOnMidRangeDevices-flag.inc
|
||||
|
||||
diff --git a/base/features.cc b/base/features.cc
|
||||
--- a/base/features.cc
|
||||
+++ b/base/features.cc
|
||||
@@ -126,6 +126,10 @@ BASE_FEATURE(kUseSharedRebindServiceConnection,
|
||||
FEATURE_DISABLED_BY_DEFAULT);
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
+#if BUILDFLAG(IS_ANDROID)
|
||||
+SET_CROMITE_FEATURE_DISABLED(kPartialLowEndModeOnMidRangeDevices);
|
||||
+#endif
|
||||
+
|
||||
void Init(EmitThreadControllerProfilerMetadata
|
||||
emit_thread_controller_profiler_metadata) {
|
||||
sequence_manager::internal::SequenceManagerImpl::InitializeFeatures();
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-PartialLowEndModeOnMidRangeDevices-flag.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-PartialLowEndModeOnMidRangeDevices-flag.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/Add-PartialLowEndModeOnMidRangeDevices-flag.inc
|
||||
@@ -0,0 +1,12 @@
|
||||
+#if BUILDFLAG(IS_ANDROID)
|
||||
+
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
+ {"partial-lowendmode-on-midrange-devices",
|
||||
+ "Partial Low End Mode On Mid Range Devices",
|
||||
+ "Enables the LowEndDeviceMode experiment in devices with 4-6 gb of ram.",
|
||||
+ kOsAndroid, FEATURE_VALUE_TYPE(base::features::kPartialLowEndModeOnMidRangeDevices)},
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+#endif
|
||||
--
|
||||
@@ -1,39 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 2 Sep 2024 07:03:38 +0000
|
||||
Subject: Add a GN flag to disable trybot verification
|
||||
|
||||
Adds flag in GN to deactivate the check performed by some google build bots.
|
||||
The flag is deactivated when generating the system webview with
|
||||
skip_secondary_abi_for_cq=true in arm64.
|
||||
|
||||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
---
|
||||
chrome/android/expectations/expectations.gni | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/expectations/expectations.gni b/chrome/android/expectations/expectations.gni
|
||||
--- a/chrome/android/expectations/expectations.gni
|
||||
+++ b/chrome/android/expectations/expectations.gni
|
||||
@@ -5,8 +5,12 @@
|
||||
import("//build/config/android/config.gni")
|
||||
import("//build/config/coverage/coverage.gni")
|
||||
|
||||
+declare_args() {
|
||||
+ enable_trybot_verification = true
|
||||
+}
|
||||
+
|
||||
# Chosen to match android-binary-size trybot.
|
||||
-enable_libs_and_assets_verification =
|
||||
+enable_libs_and_assets_verification = enable_trybot_verification &&
|
||||
!enable_chrome_android_internal && !is_component_build &&
|
||||
!use_jacoco_coverage && is_official_build &&
|
||||
(target_cpu == "arm64" && android_channel == "stable")
|
||||
@@ -15,6 +19,6 @@ enable_libs_and_assets_verification =
|
||||
# use_jacoco_coverage: Adds proguard flags.
|
||||
# android_channel: Manifest entries vary based on channel.
|
||||
# target_cpu: android:versionCode varies.
|
||||
-enable_manifest_verification =
|
||||
+enable_manifest_verification = enable_trybot_verification &&
|
||||
!is_java_debug && !enable_chrome_android_internal && !use_jacoco_coverage &&
|
||||
(target_cpu == "arm64" && android_channel == "stable")
|
||||
--
|
||||
@@ -0,0 +1,101 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 9 May 2020 08:33:15 +0200
|
||||
Subject: Add a flag to allow screenshots in Incognito mode
|
||||
|
||||
See also:
|
||||
* https://github.com/bromite/bromite/issues/551
|
||||
* https://bugs.chromium.org/p/chromium/issues/detail?id=920762
|
||||
---
|
||||
chrome/browser/about_flags.cc | 6 ++++++
|
||||
chrome/browser/flag_descriptions.cc | 5 +++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
.../flags/android/java_templates/ChromeSwitches.java.tmpl | 4 ----
|
||||
chrome/common/chrome_switches.cc | 3 +++
|
||||
chrome/common/chrome_switches.h | 1 +
|
||||
6 files changed, 18 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -7518,6 +7518,12 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
"AndroidDynamicColor")},
|
||||
#endif // defined(OS_ANDROID)
|
||||
|
||||
+#if defined(OS_ANDROID)
|
||||
+ {switches::kEnableIncognitoSnapshotsInAndroidRecents, flag_descriptions::kEnableIncognitoSnapshotsInAndroidRecentsName,
|
||||
+ flag_descriptions::kEnableIncognitoSnapshotsInAndroidRecentsDescription, kOsAndroid,
|
||||
+ SINGLE_VALUE_TYPE(switches::kEnableIncognitoSnapshotsInAndroidRecents)},
|
||||
+#endif
|
||||
+
|
||||
#if defined(OS_WIN)
|
||||
{"win-10-tab-search-caption-button",
|
||||
flag_descriptions::kWin10TabSearchCaptionButtonName,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -635,6 +635,11 @@ const char kEnableAutofillCreditCardAuthenticationDescription[] =
|
||||
"authenticator (if available) to verify card ownership when retrieving "
|
||||
"credit cards from Google Payments.";
|
||||
|
||||
+const char kEnableIncognitoSnapshotsInAndroidRecentsName[] =
|
||||
+ "Enable Incognito snapshots in Android Recents";
|
||||
+const char kEnableIncognitoSnapshotsInAndroidRecentsDescription[] =
|
||||
+ "Enable the secure flag for Incognito tabs which prevent taking screenshots and seeing snapshots in Android Recents.";
|
||||
+
|
||||
const char
|
||||
kEnableAutofillInfoBarAccountIndicationFooterForSingleAccountUsersName[] =
|
||||
"Display InfoBar footers with account indication information for "
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -404,6 +404,9 @@ extern const char kEnableAutofillSaveCardInfoBarAccountIndicationFooterName[];
|
||||
extern const char
|
||||
kEnableAutofillSaveCardInfoBarAccountIndicationFooterDescription[];
|
||||
|
||||
+extern const char kEnableIncognitoSnapshotsInAndroidRecentsName[];
|
||||
+extern const char kEnableIncognitoSnapshotsInAndroidRecentsDescription[];
|
||||
+
|
||||
extern const char kEnableExperimentalCookieFeaturesName[];
|
||||
extern const char kEnableExperimentalCookieFeaturesDescription[];
|
||||
|
||||
diff --git a/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl b/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl
|
||||
--- a/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl
|
||||
+++ b/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmpl
|
||||
@@ -129,10 +129,6 @@ public abstract class ChromeSwitches {{
|
||||
/** Switch for enabling the Chrome Survey. Only works when UMA is accepted. */
|
||||
public static final String CHROME_FORCE_ENABLE_SURVEY = "force-enable-chrome-survey";
|
||||
|
||||
- /** Switch to enable incognito tabs to be seen in Android Recents. */
|
||||
- public static final String ENABLE_INCOGNITO_SNAPSHOTS_IN_ANDROID_RECENTS =
|
||||
- "enable-incognito-snapshots-in-android-recents";
|
||||
-
|
||||
/** Open all custom tabs in a new task. Used only for experimental purposes. */
|
||||
public static final String OPEN_CUSTOM_TABS_IN_NEW_TASK = "open-custom-tabs-in-new-task";
|
||||
|
||||
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
|
||||
--- a/chrome/common/chrome_switches.cc
|
||||
+++ b/chrome/common/chrome_switches.cc
|
||||
@@ -344,6 +344,9 @@ const char kHomePage[] = "homepage";
|
||||
// Causes the browser to launch directly in incognito mode.
|
||||
const char kIncognito[] = "incognito";
|
||||
|
||||
+// Allows incognito tabs to be seen in Android Recents and thus user screenshots.
|
||||
+const char kEnableIncognitoSnapshotsInAndroidRecents[] = "enable-incognito-snapshots-in-android-recents";
|
||||
+
|
||||
// Installs an autogenerated theme based on the given RGB value.
|
||||
// The format is "r,g,b", where r, g, b are a numeric values from 0 to 255.
|
||||
const char kInstallAutogeneratedTheme[] = "install-autogenerated-theme";
|
||||
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
|
||||
--- a/chrome/common/chrome_switches.h
|
||||
+++ b/chrome/common/chrome_switches.h
|
||||
@@ -114,6 +114,7 @@ extern const char kForceStackedTabStripLayout[];
|
||||
extern const char kHideCrashRestoreBubble[];
|
||||
extern const char kHomePage[];
|
||||
extern const char kIncognito[];
|
||||
+extern const char kEnableIncognitoSnapshotsInAndroidRecents[];
|
||||
extern const char kInstallAutogeneratedTheme[];
|
||||
extern const char kInstallChromeApp[];
|
||||
extern const char kInstantProcess[];
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Fri, 21 Apr 2023 13:10:20 +0000
|
||||
Subject: Add a flag to disable GamePad API
|
||||
|
||||
Adds restrict-gamepad-access flag (default active) to disable GamePad API.
|
||||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
---
|
||||
chrome/browser/flag-metadata.json | 4 ++--
|
||||
content/child/runtime_features.cc | 2 ++
|
||||
.../about_flags_cc/Add-a-flag-to-disable-GamePad-API.inc | 7 +++++++
|
||||
device/gamepad/public/cpp/gamepad_features.cc | 8 ++++++++
|
||||
device/gamepad/public/cpp/gamepad_features.h | 2 ++
|
||||
.../blink/renderer/modules/gamepad/navigator_gamepad.cc | 6 ++++++
|
||||
6 files changed, 27 insertions(+), 2 deletions(-)
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-a-flag-to-disable-GamePad-API.inc
|
||||
|
||||
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
|
||||
--- a/chrome/browser/flag-metadata.json
|
||||
+++ b/chrome/browser/flag-metadata.json
|
||||
@@ -8364,9 +8364,9 @@
|
||||
"expiry_milestone": 140
|
||||
},
|
||||
{
|
||||
- "name": "restrict-gamepad-access",
|
||||
+ "name": "restrict-gamepad-access", // restrict-gamepad-access"
|
||||
"owners": [ "//device/gamepad/OWNERS", "jameshollyer@chromium.org" ],
|
||||
- "expiry_milestone": 96
|
||||
+ "expiry_milestone": -1
|
||||
},
|
||||
{
|
||||
"name": "retain-omnibox-on-focus",
|
||||
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
|
||||
--- a/content/child/runtime_features.cc
|
||||
+++ b/content/child/runtime_features.cc
|
||||
@@ -253,6 +253,8 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
|
||||
{wf::EnablePaymentApp, raw_ref(features::kServiceWorkerPaymentApps)},
|
||||
{wf::EnablePeriodicBackgroundSync,
|
||||
raw_ref(features::kPeriodicBackgroundSync)},
|
||||
+ {wf::EnableRestrictGamepadAccess,
|
||||
+ raw_ref(features::kRestrictGamepadAccess)},
|
||||
{wf::EnableSecurePaymentConfirmation,
|
||||
raw_ref(features::kSecurePaymentConfirmation)},
|
||||
{wf::EnableSecurePaymentConfirmationDebug,
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-a-flag-to-disable-GamePad-API.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-a-flag-to-disable-GamePad-API.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/Add-a-flag-to-disable-GamePad-API.inc
|
||||
@@ -0,0 +1,7 @@
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
+ {"restrict-gamepad-access", "Restrict gamepad access",
|
||||
+ "Disable the Gamepad API", kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(features::kRestrictGamepadAccess)},
|
||||
+
|
||||
+#endif
|
||||
diff --git a/device/gamepad/public/cpp/gamepad_features.cc b/device/gamepad/public/cpp/gamepad_features.cc
|
||||
--- a/device/gamepad/public/cpp/gamepad_features.cc
|
||||
+++ b/device/gamepad/public/cpp/gamepad_features.cc
|
||||
@@ -36,4 +36,12 @@ bool IsGamepadMultitouchEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
+CROMITE_FEATURE(kRestrictGamepadAccess,
|
||||
+ "RestrictGamepadAccess",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+
|
||||
+bool IsRestrictGamepadAccessEnabled() {
|
||||
+ return base::FeatureList::IsEnabled(kRestrictGamepadAccess);
|
||||
+}
|
||||
+
|
||||
} // namespace features
|
||||
diff --git a/device/gamepad/public/cpp/gamepad_features.h b/device/gamepad/public/cpp/gamepad_features.h
|
||||
--- a/device/gamepad/public/cpp/gamepad_features.h
|
||||
+++ b/device/gamepad/public/cpp/gamepad_features.h
|
||||
@@ -13,8 +13,10 @@ namespace features {
|
||||
GAMEPAD_FEATURES_EXPORT BASE_DECLARE_FEATURE(
|
||||
kEnableWindowsGamingInputDataFetcher);
|
||||
GAMEPAD_FEATURES_EXPORT BASE_DECLARE_FEATURE(kEnableGamepadMultitouch);
|
||||
+GAMEPAD_FEATURES_EXPORT BASE_DECLARE_FEATURE(kRestrictGamepadAccess);
|
||||
|
||||
GAMEPAD_FEATURES_EXPORT bool IsGamepadMultitouchEnabled();
|
||||
+GAMEPAD_FEATURES_EXPORT bool IsRestrictGamepadAccessEnabled();
|
||||
|
||||
} // namespace features
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/gamepad/navigator_gamepad.cc b/third_party/blink/renderer/modules/gamepad/navigator_gamepad.cc
|
||||
--- a/third_party/blink/renderer/modules/gamepad/navigator_gamepad.cc
|
||||
+++ b/third_party/blink/renderer/modules/gamepad/navigator_gamepad.cc
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "base/auto_reset.h"
|
||||
#include "device/gamepad/public/cpp/gamepads.h"
|
||||
+#include "device/gamepad/public/cpp/gamepad_features.h"
|
||||
#include "third_party/blink/public/common/privacy_budget/identifiability_metric_builder.h"
|
||||
#include "third_party/blink/public/common/privacy_budget/identifiability_study_settings.h"
|
||||
#include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-blink.h"
|
||||
@@ -114,6 +115,9 @@ void RecordGamepadsForIdentifiabilityStudy(
|
||||
HeapVector<Member<Gamepad>> NavigatorGamepad::getGamepads(
|
||||
Navigator& navigator,
|
||||
ExceptionState& exception_state) {
|
||||
+ if (::features::IsRestrictGamepadAccessEnabled()) {
|
||||
+ return HeapVector<Member<Gamepad>>();
|
||||
+ }
|
||||
if (!navigator.DomWindow()) {
|
||||
// Using an existing NavigatorGamepad if one exists, but don't create one
|
||||
// for a detached window, as its subclasses depend on a non-null window.
|
||||
@@ -420,6 +424,8 @@ void NavigatorGamepad::SampleAndCompareGamepadState() {
|
||||
|
||||
void NavigatorGamepad::DispatchGamepadEvent(const AtomicString& event_name,
|
||||
Gamepad* gamepad) {
|
||||
+ if (::features::IsRestrictGamepadAccessEnabled())
|
||||
+ return;
|
||||
// Ensure that we're blocking re-entrancy.
|
||||
DCHECK(processing_events_);
|
||||
DCHECK(has_connection_event_listener_);
|
||||
--
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,343 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Sat, 7 Nov 2020 21:59:18 +0000
|
||||
Subject: Add autoplay site setting
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
Require: Content-settings-infrastructure.patch
|
||||
---
|
||||
.../res/drawable-hdpi/settings_autoplay.png | Bin 0 -> 456 bytes
|
||||
.../res/drawable-mdpi/settings_autoplay.png | Bin 0 -> 296 bytes
|
||||
.../res/drawable-xhdpi/settings_autoplay.png | Bin 0 -> 551 bytes
|
||||
.../res/drawable-xxhdpi/settings_autoplay.png | Bin 0 -> 792 bytes
|
||||
.../drawable-xxxhdpi/settings_autoplay.png | Bin 0 -> 1064 bytes
|
||||
.../impl/BromiteAutoplayContentSetting.java | 93 ++++++++++++++++++
|
||||
.../bromite_content_settings/autoplay.grdp | 21 ++++
|
||||
.../bromite_content_settings/autoplay.inc | 12 +++
|
||||
.../core/browser/content_settings_registry.cc | 2 +-
|
||||
.../core/html/media/autoplay_policy.cc | 14 +++
|
||||
.../core/html/media/autoplay_policy.h | 4 +
|
||||
11 files changed, 145 insertions(+), 1 deletion(-)
|
||||
create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-hdpi/settings_autoplay.png
|
||||
create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-mdpi/settings_autoplay.png
|
||||
create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-xhdpi/settings_autoplay.png
|
||||
create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-xxhdpi/settings_autoplay.png
|
||||
create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-xxxhdpi/settings_autoplay.png
|
||||
create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteAutoplayContentSetting.java
|
||||
create mode 100644 components/browser_ui/strings/bromite_content_settings/autoplay.grdp
|
||||
create mode 100644 components/content_settings/core/browser/bromite_content_settings/autoplay.inc
|
||||
|
||||
diff --git a/components/browser_ui/site_settings/android/java/res/drawable-hdpi/settings_autoplay.png b/components/browser_ui/site_settings/android/java/res/drawable-hdpi/settings_autoplay.png
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..a8a9265f14cd8445ad1f55845099e60dc3c4edf1
|
||||
GIT binary patch
|
||||
literal 456
|
||||
zcmV;(0XP1MP)<h;3K|Lk000e1NJLTq001Na001Ni1ONa4O9@aD0004xNkl<Zcmd^>
|
||||
zv2MaJ5QYmZs7m@68Tt%)0T}7#GcJmh4B69}fh}W`x!sUhd4N1chpY%8u@-es;cQTy
|
||||
zGbWY1VQ**q%l&uuT^{am%=;qbIaI7>hvTfF;<*Ut{eMAbL!QB&HFUzBXR~2P41Zx8
|
||||
z)>!6-O>RP(9xN_j-$FSZiy-wPUj)-Jl(4<5Et;Mc!<K5}jwP!>dwn%v3G5VXX+fR6
|
||||
zfpz3x+Y|Y)K6`aNHVw{qdv4}^DAdl0F;g<cu%;M_QeJHg8RVIajV_AK%qV!0vEmv1
|
||||
z#vVbjZa-Q+lSd;emiMaVzX)Z*+nGY^7d%tYY9KFz2z6mO9x2+}RepX<5}`zKxo)iR
|
||||
zz{m)~NhMClXs`4GHM$vG2T_S4KzpqpIGl{BX8{q3sfX5s0TlVSK=Ataj-&0{v9#{N
|
||||
z{;&j_q`#yfB8jBm<%OhAge7edm84b@`b2QRo9WRKN#xNwD<h5zoBL8ri$BDs;tw$`
|
||||
y{$1Kp0i#npN<C~x1#L&}8>IV|-Tf!x{>CqV{oZM{Igf1s0000<MNUMnLSTY>m&@A#
|
||||
|
||||
literal 0
|
||||
HcmV?d00001
|
||||
|
||||
diff --git a/components/browser_ui/site_settings/android/java/res/drawable-mdpi/settings_autoplay.png b/components/browser_ui/site_settings/android/java/res/drawable-mdpi/settings_autoplay.png
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..49fa10d44f4007532d0d03d15fdcb1a715857e96
|
||||
GIT binary patch
|
||||
literal 296
|
||||
zcmV+@0oVSCP)<h;3K|Lk000e1NJLTq000;O000;W1ONa4N`Cco0002*Nkl<Zc-p;F
|
||||
zu?>ST5R5=Hk+X;yg9#|y{3AI^L4jN_0yR^lp<y0UAY}`bhK9U}6x+c{;s$?XpYHT`
|
||||
z_WQ8+DiaXc!3Y!8NIOv`U+9>_9hQ%}W9}t45w<H~z#4hQDkf8`VbB=1O|%hcI?jda
|
||||
zV;k+`LgB0>TQfw*%xg4TCAk}wycg<C;jW}mI*Sz_g!XRC-~-OCu{Db@O*?8?8^Rj&
|
||||
zS{^N1H6fiLjCAC#fRLNPkP|W*!URjjT!AiQtzvYZ{t%#iA(xXD1Xz-(u@oBGf2}Be
|
||||
u*BbnAfuj*Re80yVxjo)NA1L&T?!2C$I@?4>V>|Ky0000<MNUMnLSTX*1bI&Y
|
||||
|
||||
literal 0
|
||||
HcmV?d00001
|
||||
|
||||
diff --git a/components/browser_ui/site_settings/android/java/res/drawable-xhdpi/settings_autoplay.png b/components/browser_ui/site_settings/android/java/res/drawable-xhdpi/settings_autoplay.png
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..5a4128a5e02949de754f9cab2635824eda8c539c
|
||||
GIT binary patch
|
||||
literal 551
|
||||
zcmV+?0@(eDP)<h;3K|Lk000e1NJLTq001xm001xu1ONa4{R=S+0005*Nkl<Zc-rk(
|
||||
zy>fy;5RRo0wX?Hwh9Zw(#Vgp}9uO@kj!GT?W_XdLp-A4qiidDg@B~=L$xN`2Fo6Ry
|
||||
zoC`9!!WnNX*>%6WZ+~v@;l6HTnG5Pb03nIUF_Q>F2&iK&{=v0ABR=d&Dwa&+>$CpO
|
||||
zN8o1rO<Uv$u0HDF9##;Ow3|Q-tE-%+18~W?=HLW7u&HLKOxcVLm1<yTUrsfUGq~xX
|
||||
zqx<cUyx0DE0A@`^cGeUaIn=iCwjFlbea(GBJf>jQOd%dgDu@oJ0JqvZU3NJ!T~_A+
|
||||
zw>7k!d)Tk%U1PSM!@i8g3Qx?K@4o3Chv27xSRb|1lL*LZCn{;7NuQNv<q5!Ftw$V!
|
||||
zc)av3R5$TCJ)+DZDSW^ao>676eW3vl6flwYSMx=l(G+1kL4+N%tlEhfAQy}(nDFWr
|
||||
zbXw{Z4tCiO1OTTBcDW68nyP>kgahDIfn8VxO;uQ6Yd8Q-71auD*mMx(DnrEqaH<To
|
||||
z&_)dhyat$p1K?CKh1bGGfX(<C05JbrZN`P>Q#wV`gM2wnZ5*JY22WGzg(js{SktOi
|
||||
z^lWxu_H1_Y+jaYe^U~wOk$z>$zx3sgE%FC1e02PlFgl8cUvcTd1Q~vNjPEQT-<g7p
|
||||
p?=l}ClAlmgAAvHTvG;Wo>j%AMEx!+_@2>y=002ovPDHLkV1fY;_gnw~
|
||||
|
||||
literal 0
|
||||
HcmV?d00001
|
||||
|
||||
diff --git a/components/browser_ui/site_settings/android/java/res/drawable-xxhdpi/settings_autoplay.png b/components/browser_ui/site_settings/android/java/res/drawable-xxhdpi/settings_autoplay.png
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..7fceb8c2b546970a3720e8ab225799aa03895b7f
|
||||
GIT binary patch
|
||||
literal 792
|
||||
zcmV+z1LypSP)<h;3K|Lk000e1NJLTq002k;002k`1ONa4|Kxkj0008tNkl<ZcmeHN
|
||||
zv2Nl_5Kd(&P^2J2k<wEAFOV*wK{6%nd}~AH7AGB@E1m)cC{TL;PY?@4L47q{DkQ2)
|
||||
zgu;oFPN%!E!Ny}lw9<LD9oFB@H#0js!$l#56r!s*CDlL=Bg|=u6>VsP6)iEx2tCzs
|
||||
zN?!=Ys;Vvm+R!dxZSbnPR`u*)=$?G~q+QDONj}}54UDQIpq+dnupUkhrgMXd90~(9
|
||||
z>D-*sHYV1z%eSyr=BeO3;m5&Ge2@<pO;xiip5YmGMb*%ROFljhg4(L5++aL|o)4Xt
|
||||
z#%NjP*f=bsMdO23efEqzx#k+Py)EC-cdk<X`U-t|-#g6Ixz21IO!tgFux}-M*tcpx
|
||||
z+bE=rR*I5^H|s7_BE7>~l(<Z;9NA<MwvEhAv<UAec5h`y4E^$WnI||NFX<&hz9~zC
|
||||
z>oA;)6G#{m)`C=tNtmpB)?rp!gtK?*J1gwU@xCMXrLcRedOG_Aoa>~>!hiCJ<GzU?
|
||||
zU4g;RFi3>{ojT&^9q|2A6eswfXXRwNew}jUlw`DpvbTS<8sy~{`pMeAwZ6%yL!Xy$
|
||||
zN2*G=JTQ;lS${M|)Hzo?si<yxhaM+sazIk*Xq?iqof0qI(UJg?P=^+O4kR2zHF)`D
|
||||
zl|_IA)LCU-!l_0)@}9u|IUq50<g;J&;sK4Ankxn*pe__Vqj<GBGo&d7B%n^2OnV;x
|
||||
zfh7Y}69W=Zr)o@h8E>K0Up2cT1|*=)t}wk-{0CUjdxjX0fI83Mf&Ybo(3S(znzB<m
|
||||
z^)SCv%fntq6%#ah*z2DdwY@s>U#@89zg#sfKk^r7!;A&m>sd-zwDXs+niu)Z|Ao(>
|
||||
z;TfMn@`obY`5%hfKBYBiHdqh(w`25gSn1i))3E8OQ(Krf&Sz(7oX<QX`)FaR!DvC-
|
||||
z;R|!`ZTxsjnS4B@Ou=|cg8`miBTkKmz^eW)jLCUb2{*+b2?DrQRj0pNXexyiQpitx
|
||||
WnED%yq_MdG0000<MNUMnLSTZmtagO}
|
||||
|
||||
literal 0
|
||||
HcmV?d00001
|
||||
|
||||
diff --git a/components/browser_ui/site_settings/android/java/res/drawable-xxxhdpi/settings_autoplay.png b/components/browser_ui/site_settings/android/java/res/drawable-xxxhdpi/settings_autoplay.png
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..92a315bb00ac1f4dc675e894bf4af3ba7c68bf39
|
||||
GIT binary patch
|
||||
literal 1064
|
||||
zcmV+@1lRkCP)<h;3K|Lk000e1NJLTq003YB003YJ1ONa4NRhv@000B;Nkl<Zc-rk-
|
||||
zF-Rjp6x}q5UMCS0#3Pl(5mH&l%1Q;{uKI6w6G2RqfI_g2*e8Om;Gwl(ZGDB6<Z@mY
|
||||
z41!h)DtJW--GhTGoY}a$GqZ^U^QZnZ|INPr^Z%bejuk6btXQ$4Pc|mmBCFCqouNZL
|
||||
z+*6<WxThXEbVmEE$`&^!KcwMX<5*@*wCR=nknxH(Yhrn8{DYY8r>Mvd@I-#RfhTrA
|
||||
zML#uC<7*jKp)UCfqsuC_%t(wck71K;$=5J$u~{A)viWQYSLEv(xME8~Gk$Frr{wD&
|
||||
zI9;0^#@?^uf&63!9@uK4#y8Tm7iz{GPOt-V=gT=S+ekOkUbdWb=Rw%P3EhS2?={j1
|
||||
znNJh=@$S+WRQC#g>V2o{6{t=Z?|z3LG~wtMZ-y=hF8Pd>n~yV_n@0=J13_GRGrG;6
|
||||
z!}Wm09<l3XrRL0HmmUXf$+b79b@vCEkE8V|m6_M4a5NCYj5h8ElLt5Mf{yv!1>6J^
|
||||
zi6*pop5R{>=jCZ_r}{L`gMViY9x2#y;<%R48&%;r*r_TXTLH$uVB1MRu#FdSHKn7?
|
||||
z`-}(CeD>8zNbpUBfCq&DBPizKc3=Bf2#S%UBhDc1I|)nBzrdE{;{7Yp^VBj!$TQBx
|
||||
zU|S+zz^3T;B^;-eQx(qzY{qtLVzw3S*uwXXPwGdTn6<_H_N*cX4be2o$8UU5g&+nP
|
||||
ztP-!%(B(t6s4>q!uz#qm24H<k2=lrzDi~B0_J233?tcwcDq&ZkQ87A!4)}QA%f<zu
|
||||
zN+mDL=L_s0dX?>oQ*Am<Tmb4+LW?hjMXctzD}w*YO8`)&lA9OoSdl_b7mgzXK%Gi_
|
||||
z?u=G6wV#{`bvXd)RH8aJPdie9oUbr@1vvofRPqXZWjjJ~o-Oiq9zP`qK%Gi{imxNF
|
||||
z#ZV>GxMfcqM;3rOm2koVsD>M`&n>zm4?vwt*x~f|!wop&79@E9>Qn-8+GpV^zc}AJ
|
||||
zFAqSSO71+T*$FqG_g1BxlLw$qrE-qb>xHV|o^zsEc>wBE^0J)HeYgSrw<?XaJOFhn
|
||||
zHPW0;|APTQNjCuVDP;an+!=-&MJXXSYW_iHekj4JNd|K$X%6Ph52wvfXhcC<e@cl`
|
||||
zVkxC4tod=0da3dbmbI2u4)v8)uq;{FLQA%=g_7RFmf@vE<BPjPEU%+9qVl@=7aZzW
|
||||
zOoyYnVlw}dPjsfExn`|pg0EQ(zvwo+)xh{>55wDS3~zX{EoY-``m=49hBUsaw;r=*
|
||||
z+}2~(e82VBHh+(@{oX!+2n#ThdxByg0maD|^ghF~58(`dil|N~cLlAek3rFLSGLCO
|
||||
ib6hJ{tXQ#P#rX?0El=KlH_u1_0000<MNUMnLSTX(y!wd%
|
||||
|
||||
literal 0
|
||||
HcmV?d00001
|
||||
|
||||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteAutoplayContentSetting.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteAutoplayContentSetting.java
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteAutoplayContentSetting.java
|
||||
@@ -0,0 +1,93 @@
|
||||
+/*
|
||||
+ This file is part of Bromite.
|
||||
+
|
||||
+ Bromite 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.
|
||||
+
|
||||
+ Bromite 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 Bromite. If not, see <https://www.gnu.org/licenses/>.
|
||||
+*/
|
||||
+
|
||||
+package org.chromium.components.browser_ui.site_settings.impl;
|
||||
+
|
||||
+import org.chromium.components.browser_ui.site_settings.R;
|
||||
+
|
||||
+import org.chromium.components.browser_ui.site_settings.BromiteCustomContentSetting;
|
||||
+import org.chromium.components.browser_ui.site_settings.ContentSettingsResources;
|
||||
+import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory;
|
||||
+import org.chromium.components.content_settings.ContentSettingValues;
|
||||
+import org.chromium.components.content_settings.ContentSettingsType;
|
||||
+import org.chromium.content_public.browser.BrowserContextHandle;
|
||||
+
|
||||
+import androidx.annotation.Nullable;
|
||||
+import androidx.preference.Preference;
|
||||
+import androidx.preference.PreferenceScreen;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
+
|
||||
+public class BromiteAutoplayContentSetting extends BromiteCustomContentSetting {
|
||||
+ public BromiteAutoplayContentSetting() {
|
||||
+ super(/*contentSettingsType*/ ContentSettingsType.AUTOPLAY,
|
||||
+ /*defaultEnabledValue*/ ContentSettingValues.ALLOW,
|
||||
+ /*defaultDisabledValue*/ ContentSettingValues.BLOCK,
|
||||
+ /*allowException*/ true,
|
||||
+ /*preferenceKey*/ "autoplay",
|
||||
+ /*profilePrefKey*/ "autoplay");
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public ContentSettingsResources.ResourceItem getResourceItem() {
|
||||
+ return new ContentSettingsResources.ResourceItem(
|
||||
+ /*icon*/ R.drawable.settings_autoplay,
|
||||
+ /*title*/ R.string.autoplay_permission_title,
|
||||
+ /*defaultEnabledValue*/ getDefaultEnabledValue(),
|
||||
+ /*defaultDisabledValue*/ getDefaultDisabledValue(),
|
||||
+ /*enabledSummary*/ R.string.website_settings_category_autoplay_enabled,
|
||||
+ /*disabledSummary*/ R.string.website_settings_category_autoplay_disabled,
|
||||
+ /*summaryOverrideForScreenReader*/ 0);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getCategorySummary(@Nullable @ContentSettingValues int value) {
|
||||
+ switch (value) {
|
||||
+ case ContentSettingValues.ALLOW:
|
||||
+ return R.string.website_settings_category_autoplay_enabled;
|
||||
+ case ContentSettingValues.BLOCK:
|
||||
+ return R.string.website_settings_category_autoplay_disabled;
|
||||
+ default:
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getCategoryDescription() {
|
||||
+ return R.string.website_settings_add_site_description_autoplay;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean requiresTriStateContentSetting() {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean showOnlyDescriptions() {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getAddExceptionDialogMessage() {
|
||||
+ return R.string.website_settings_category_autoplay_enabled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @Nullable Boolean considerException(SiteSettingsCategory category, @ContentSettingValues int value) {
|
||||
+ return value != ContentSettingValues.BLOCK;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/components/browser_ui/strings/bromite_content_settings/autoplay.grdp b/components/browser_ui/strings/bromite_content_settings/autoplay.grdp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/browser_ui/strings/bromite_content_settings/autoplay.grdp
|
||||
@@ -0,0 +1,21 @@
|
||||
+<?xml version="1.0" encoding="utf-8"?>
|
||||
+<grit-part>
|
||||
+ <message name="IDS_AUTOPLAY_PERMISSION_TITLE" desc='Title for the Autoplay settings screen [CHAR-LIMIT=32]' formatter_data="android_java">
|
||||
+ Autoplay
|
||||
+ </message>
|
||||
+ <message name="IDS_WEBSITE_SETTINGS_ADD_SITE_DESCRIPTION_AUTOPLAY" desc="The description for the allow autoplay of muted videos for website dialog." formatter_data="android_java">
|
||||
+ Allow autoplay for a specific site.
|
||||
+ </message>
|
||||
+ <message name="IDS_WEBSITE_SETTINGS_CATEGORY_AUTOPLAY_ENABLED" desc="Summary text explaining that sites are allowed to compile JavaScript in JIT mode." formatter_data="android_java">
|
||||
+ Allow sites to automatically play muted videos
|
||||
+ </message>
|
||||
+ <message name="IDS_WEBSITE_SETTINGS_CATEGORY_AUTOPLAY_DISABLED" desc="Summary text explaining that sites are running JavaScript in JITless mode." formatter_data="android_java">
|
||||
+ Autoplay disabled
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_SITE_SETTINGS_AUTOPLAY_ALLOWED_EXCEPTIONS" desc="Label for the allowed exceptions site list of the autoplay setting.">
|
||||
+ Allowed to autoplay
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_SITE_SETTINGS_AUTOPLAY_BLOCKED_EXCEPTIONS" desc="Label for the blocked exceptions site list of the autoplay setting.">
|
||||
+ Not allowed to autoplay
|
||||
+ </message>
|
||||
+</grit-part>
|
||||
diff --git a/components/content_settings/core/browser/bromite_content_settings/autoplay.inc b/components/content_settings/core/browser/bromite_content_settings/autoplay.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/content_settings/core/browser/bromite_content_settings/autoplay.inc
|
||||
@@ -0,0 +1,12 @@
|
||||
+ content_settings::WebsiteSettingsRegistry::GetInstance()
|
||||
+ ->GetMutable(ContentSettingsType::AUTOPLAY)
|
||||
+ ->set_show_into_info_page()
|
||||
+ .set_desktop_ui()
|
||||
+ .set_is_renderer_content_setting()
|
||||
+ .set_title_ui(IDS_AUTOPLAY_PERMISSION_TITLE)
|
||||
+ .set_description_ui(IDS_WEBSITE_SETTINGS_ADD_SITE_DESCRIPTION_AUTOPLAY)
|
||||
+ .set_allowed_ui(IDS_WEBSITE_SETTINGS_CATEGORY_AUTOPLAY_ENABLED)
|
||||
+ .set_blocked_ui(IDS_WEBSITE_SETTINGS_CATEGORY_AUTOPLAY_DISABLED)
|
||||
+ .set_allowed_exceptions_ui(IDS_SETTINGS_SITE_SETTINGS_AUTOPLAY_ALLOWED_EXCEPTIONS)
|
||||
+ .set_blocked_exceptions_ui(IDS_SETTINGS_SITE_SETTINGS_AUTOPLAY_BLOCKED_EXCEPTIONS)
|
||||
+ .set_mid_sentence_ui(IDS_AUTOPLAY_PERMISSION_TITLE);
|
||||
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
--- a/components/content_settings/core/browser/content_settings_registry.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
@@ -249,7 +249,7 @@ void ContentSettingsRegistry::Init() {
|
||||
ContentSettingsInfo::INHERIT_IN_INCOGNITO,
|
||||
ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY);
|
||||
|
||||
- Register(ContentSettingsType::AUTOPLAY, "autoplay", CONTENT_SETTING_ALLOW,
|
||||
+ Register(ContentSettingsType::AUTOPLAY, "autoplay", CONTENT_SETTING_BLOCK,
|
||||
WebsiteSettingsInfo::UNSYNCABLE, /*allowlisted_primary_schemes=*/{},
|
||||
/*valid_settings=*/{CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK},
|
||||
WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE,
|
||||
diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.cc b/third_party/blink/renderer/core/html/media/autoplay_policy.cc
|
||||
--- a/third_party/blink/renderer/core/html/media/autoplay_policy.cc
|
||||
+++ b/third_party/blink/renderer/core/html/media/autoplay_policy.cc
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "third_party/blink/public/mojom/autoplay/autoplay.mojom-blink.h"
|
||||
#include "third_party/blink/public/mojom/frame/lifecycle.mojom-blink.h"
|
||||
#include "third_party/blink/public/mojom/webpreferences/web_preferences.mojom-blink.h"
|
||||
+#include "third_party/blink/public/platform/web_content_settings_client.h"
|
||||
#include "third_party/blink/public/platform/web_media_player.h"
|
||||
#include "third_party/blink/public/web/web_local_frame.h"
|
||||
#include "third_party/blink/public/web/web_local_frame_client.h"
|
||||
@@ -346,6 +347,8 @@ void AutoplayPolicy::TryUnlockingUserGesture() {
|
||||
}
|
||||
|
||||
bool AutoplayPolicy::IsGestureNeededForPlayback() const {
|
||||
+ if (!IsAutoplayAllowedPerSettings())
|
||||
+ return true;
|
||||
if (!IsLockedPendingUserGesture())
|
||||
return false;
|
||||
|
||||
@@ -458,6 +461,17 @@ void AutoplayPolicy::MaybeSetAutoplayInitiated() {
|
||||
}
|
||||
}
|
||||
|
||||
+bool AutoplayPolicy::IsAutoplayAllowedPerSettings() const {
|
||||
+ LocalFrame* frame = element_->GetDocument().GetFrame();
|
||||
+ if (!frame)
|
||||
+ return false;
|
||||
+ if (auto* settings_client = frame->GetContentSettingsClient()) {
|
||||
+ return settings_client->AllowContentSetting(
|
||||
+ ContentSettingsType::AUTOPLAY, /*default_value*/ false);
|
||||
+ }
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
bool AutoplayPolicy::ShouldAutoplay() {
|
||||
if (!element_->GetExecutionContext() ||
|
||||
element_->GetExecutionContext()->IsSandboxed(
|
||||
diff --git a/third_party/blink/renderer/core/html/media/autoplay_policy.h b/third_party/blink/renderer/core/html/media/autoplay_policy.h
|
||||
--- a/third_party/blink/renderer/core/html/media/autoplay_policy.h
|
||||
+++ b/third_party/blink/renderer/core/html/media/autoplay_policy.h
|
||||
@@ -151,6 +151,10 @@ class CORE_EXPORT AutoplayPolicy final
|
||||
// should use, if checking to see if an action is allowed.
|
||||
bool IsLockedPendingUserGesture() const;
|
||||
|
||||
+ // Return true if and only if the settings allow autoplay of media on this
|
||||
+ // frame.
|
||||
+ bool IsAutoplayAllowedPerSettings() const;
|
||||
+
|
||||
bool IsAutoplayingMutedInternal(bool muted) const;
|
||||
bool IsOrWillBeAutoplayingMutedInternal(bool muted) const;
|
||||
|
||||
--
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -4,91 +4,63 @@ Subject: Add custom tab intents privacy option
|
||||
|
||||
Add custom tab intents privacy option and force
|
||||
open external links in incognito flag.
|
||||
Use the CCT ephemeral mode.
|
||||
|
||||
Flags are mutually exclusive.
|
||||
|
||||
See also: https://github.com/bromite/bromite/issues/1474
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../java/res/xml/privacy_preferences.xml | 15 ++++++
|
||||
.../browser/LaunchIntentDispatcher.java | 21 ++++++++
|
||||
.../CustomTabIntentDataProvider.java | 4 +-
|
||||
.../customtabs/CustomTabsConnection.java | 1 +
|
||||
.../IncognitoCustomTabIntentDataProvider.java | 14 ++++++
|
||||
.../privacy/settings/PrivacySettings.java | 50 +++++++++++++++++++
|
||||
.../flags/android/chrome_feature_list.cc | 2 +-
|
||||
.../browser/flags/ChromeFeatureList.java | 3 ++
|
||||
.../chrome/browser/tab/TabAssociatedApp.java | 6 ++-
|
||||
...Add-custom-tab-intents-privacy-option.grdp | 25 ++++++++++
|
||||
.../OriginVerifier.java | 5 ++
|
||||
.../core/common/language_experiments.cc | 1 +
|
||||
.../add-custom-tab-intents-privacy-option.inc | 1 +
|
||||
13 files changed, 145 insertions(+), 3 deletions(-)
|
||||
create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-custom-tab-intents-privacy-option.grdp
|
||||
create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/add-custom-tab-intents-privacy-option.inc
|
||||
.../java/res/xml/privacy_preferences.xml | 10 ++++++
|
||||
.../browser/LaunchIntentDispatcher.java | 19 ++++++++++
|
||||
.../privacy/settings/PrivacySettings.java | 36 +++++++++++++++++++
|
||||
.../strings/android_chrome_strings.grd | 15 ++++++++
|
||||
4 files changed, 80 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
@@ -52,6 +52,21 @@ found in the LICENSE file.
|
||||
android:key="cromite_flags"
|
||||
android:title="@string/cromite_flags_title"
|
||||
app:url="@string/cromite_flags_url" />
|
||||
@@ -56,6 +56,16 @@
|
||||
android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings"
|
||||
android:key="do_not_track"
|
||||
android:title="@string/do_not_track_title"/>
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
+ android:key="allow_custom_tab_intents"
|
||||
+ android:title="@string/allow_custom_tab_intents_title"
|
||||
+ android:summary="@string/allow_custom_tab_intents_summary"
|
||||
+ android:defaultValue="false" />
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
+ android:title="@string/uses_separate_storagepartition_for_cct_title"
|
||||
+ android:summary="@string/uses_separate_storagepartition_for_cct_summary"
|
||||
+ app:featureName="maylaunchurl-uses-separate-storage-partition"
|
||||
+ app:needRestart="true" />
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
+ android:key="open_external_links_incognito"
|
||||
+ android:title="@string/open_external_links_incognito_title"
|
||||
+ android:summary="@string/open_external_links_incognito_summary"
|
||||
+ android:defaultValue="false" />
|
||||
<Preference
|
||||
android:key="preload_pages"
|
||||
android:title="@string/preload_pages_title"
|
||||
android:key="privacy_sandbox"
|
||||
android:title="@string/prefs_privacy_sandbox"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java
|
||||
@@ -61,6 +61,9 @@ import java.lang.annotation.Retention;
|
||||
@@ -59,6 +59,8 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.Set;
|
||||
|
||||
+import org.chromium.chrome.browser.privacy.settings.PrivacySettings;
|
||||
+import org.chromium.chrome.browser.tab.TabLaunchType;
|
||||
+
|
||||
/**
|
||||
* Dispatches incoming intents to the appropriate activity based on the current configuration and
|
||||
* Intent fired.
|
||||
@@ -263,6 +266,9 @@ public class LaunchIntentDispatcher {
|
||||
@@ -279,6 +281,12 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
|
||||
*/
|
||||
public static boolean isCustomTabIntent(Intent intent) {
|
||||
if (intent == null) return false;
|
||||
+ if (ContextUtils.getAppSharedPreferences()
|
||||
+ .getBoolean(PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false))
|
||||
+ return false;
|
||||
+ if (!ContextUtils.getAppSharedPreferences()
|
||||
+ .getBoolean(PrivacySettings.PREF_ALLOW_CUSTOM_TAB_INTENTS, false))
|
||||
+ return false;
|
||||
Log.w(
|
||||
TAG,
|
||||
"CustomTabsIntent#shouldAlwaysUseBrowserUI() = "
|
||||
@@ -291,6 +297,10 @@ public class LaunchIntentDispatcher {
|
||||
// Make sure the result of the CustomTabActivity is forwarded to the client.
|
||||
newIntent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
|
||||
|
||||
+ if (ContextUtils.getAppSharedPreferences()
|
||||
+ .getBoolean(PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false))
|
||||
+ newIntent.putExtra(IntentHandler.EXTRA_OPEN_NEW_INCOGNITO_TAB, true);
|
||||
+
|
||||
// Since configureIntentForResizableCustomTab() might change the componenet/class
|
||||
// associated with the passed intent, it needs to be called after #setClassName(context,
|
||||
// CustomTabActivity.class.getName());
|
||||
@@ -483,6 +493,17 @@ public class LaunchIntentDispatcher {
|
||||
if (CustomTabsIntent.shouldAlwaysUseBrowserUI(intent)
|
||||
|| !intent.hasExtra(CustomTabsIntent.EXTRA_SESSION)) {
|
||||
return false;
|
||||
@@ -417,6 +425,17 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega
|
||||
|
||||
if (Intent.ACTION_VIEW.equals(newIntent.getAction())
|
||||
&& !IntentHandler.wasIntentSenderChrome(newIntent)) {
|
||||
@@ -100,113 +72,27 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDis
|
||||
+ /*incognito*/true);
|
||||
+ newIntent.setData(mIntent.getData());
|
||||
+ newIntent.setPackage(applicationContext.getPackageName());
|
||||
+ IntentHandler.setTabLaunchType(newIntent, TabLaunchType.FROM_EXTERNAL_APP);
|
||||
+ newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
+ }
|
||||
+
|
||||
long time = SystemClock.elapsedRealtime();
|
||||
if (!chromeTabbedTaskExists()) {
|
||||
newIntent.putExtra(IntentHandler.EXTRA_STARTED_TABBED_CHROME_TASK, true);
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
|
||||
@@ -1257,7 +1257,9 @@ public class CustomTabIntentDataProvider extends BrowserServicesIntentDataProvid
|
||||
public @CustomTabProfileType int getCustomTabMode() {
|
||||
return AlwaysIncognitoLinkInterceptor.isAlwaysIncognito()
|
||||
? CustomTabProfileType.INCOGNITO
|
||||
- : CustomTabProfileType.REGULAR;
|
||||
+ : (ChromeFeatureList.sMayLaunchurlUsesSeparateStoragePartition.isEnabled()
|
||||
+ ? CustomTabProfileType.EPHEMERAL
|
||||
+ : CustomTabProfileType.REGULAR);
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
|
||||
@@ -968,6 +968,7 @@ public class CustomTabsConnection {
|
||||
PostTask.postTask(
|
||||
TaskTraits.UI_DEFAULT,
|
||||
() -> {
|
||||
+ if ((true)) return; // Disable CCTPostMessageAPI
|
||||
// Attempt to verify origin synchronously. If successful directly initialize
|
||||
// postMessage channel for session.
|
||||
Uri verifiedOrigin = verifyOriginForSession(session, uid, postMessageOrigin);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java
|
||||
@@ -40,6 +40,9 @@ import org.chromium.components.browser_ui.widget.TintedDrawable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
+import org.chromium.base.ContextUtils;
|
||||
+import org.chromium.chrome.browser.privacy.settings.PrivacySettings;
|
||||
+
|
||||
/**
|
||||
* A model class that parses the incoming intent for incognito Custom Tabs specific customization
|
||||
* data.
|
||||
@@ -121,6 +124,9 @@ public class IncognitoCustomTabIntentDataProvider extends BrowserServicesIntentD
|
||||
}
|
||||
|
||||
private static boolean isIntentFromThirdPartyAllowed() {
|
||||
+ if (ContextUtils.getAppSharedPreferences()
|
||||
+ .getBoolean(PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false))
|
||||
+ return true;
|
||||
return ChromeFeatureList.sCctIncognitoAvailableToThirdParty.isEnabled();
|
||||
}
|
||||
|
||||
@@ -220,6 +226,10 @@ public class IncognitoCustomTabIntentDataProvider extends BrowserServicesIntentD
|
||||
}
|
||||
|
||||
public static boolean isValidIncognitoIntent(Intent intent, boolean recordMetrics) {
|
||||
+ if (ContextUtils.getAppSharedPreferences()
|
||||
+ .getBoolean(PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false)) {
|
||||
+ return true;
|
||||
+ }
|
||||
if (!isIncognitoRequested(intent)) return false;
|
||||
var session = SessionHolder.getSessionHolderFromIntent(intent);
|
||||
if (isIntentFromThirdPartyAllowed()
|
||||
@@ -329,6 +339,10 @@ public class IncognitoCustomTabIntentDataProvider extends BrowserServicesIntentD
|
||||
|
||||
@Override
|
||||
public @CustomTabProfileType int getCustomTabMode() {
|
||||
+ if (ContextUtils.getAppSharedPreferences()
|
||||
+ .getBoolean(PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false)) {
|
||||
+ return CustomTabProfileType.EPHEMERAL;
|
||||
+ }
|
||||
return CustomTabProfileType.INCOGNITO;
|
||||
}
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
@@ -80,6 +80,15 @@ import org.chromium.ui.text.SpanApplier;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Consumer;
|
||||
@@ -90,6 +90,9 @@ public class PrivacySettings
|
||||
|
||||
+import android.app.role.RoleManager;
|
||||
+import android.content.Context;
|
||||
+import android.content.Intent;
|
||||
+import android.content.pm.ResolveInfo;
|
||||
+import android.provider.Settings;
|
||||
+import android.text.TextUtils;
|
||||
+import org.chromium.base.IntentUtils;
|
||||
+import org.chromium.base.PackageManagerUtils;
|
||||
+
|
||||
import androidx.preference.PreferenceCategory;
|
||||
import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager;
|
||||
import org.chromium.base.shared_preferences.SharedPreferencesManager;
|
||||
@@ -149,6 +158,9 @@ public class PrivacySettings extends ChromeBaseSettingsFragment
|
||||
startTag, endTag, new ChromeClickableSpan(context, onClickCallback));
|
||||
}
|
||||
private ManagedPreferenceDelegate mManagedPreferenceDelegate;
|
||||
|
||||
+ private ChromeSwitchPreference allowCustomTabIntentsPref;
|
||||
+ private ChromeSwitchPreference openExternalLinksPref;
|
||||
+
|
||||
@Override
|
||||
public void onCreatePreferencesCromite(@Nullable Bundle savedInstanceState, @Nullable String rootKey) {
|
||||
mPageTitle.set(getString(R.string.prefs_privacy_security));
|
||||
@@ -376,6 +388,9 @@ public class PrivacySettings extends ChromeBaseSettingsFragment
|
||||
new SpanApplier.SpanInfo("<link2>", "</link2>", servicesLink));
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
PrivacyPreferencesManagerImpl privacyPrefManager =
|
||||
@@ -191,6 +194,9 @@ public class PrivacySettings
|
||||
updateSummaries();
|
||||
}
|
||||
|
||||
+ public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
|
||||
@@ -215,40 +101,35 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
String key = preference.getKey();
|
||||
@@ -396,6 +411,31 @@ public class PrivacySettings extends ChromeBaseSettingsFragment
|
||||
} else if (PREF_SEARCH_SUGGESTIONS.equals(key)) {
|
||||
UserPrefs.get(getProfile())
|
||||
.setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) newValue);
|
||||
@@ -222,6 +228,26 @@ public class PrivacySettings
|
||||
} else if (PREF_INCOGNITO_TAB_HISTORY_ENABLED.equals(key)) {
|
||||
UserPrefs.get(Profile.getLastUsedRegularProfile())
|
||||
.setBoolean(Pref.INCOGNITO_TAB_HISTORY_ENABLED, (boolean) newValue);
|
||||
+ } else if (PREF_ALLOW_CUSTOM_TAB_INTENTS.equals(key)) {
|
||||
+ SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
|
||||
+ sharedPreferencesEditor.putBoolean(PREF_ALLOW_CUSTOM_TAB_INTENTS, (boolean)newValue);
|
||||
+ sharedPreferencesEditor.apply();
|
||||
+ // check default browser
|
||||
+ if ((boolean)newValue) {
|
||||
+ ResolveInfo info = PackageManagerUtils.resolveDefaultWebBrowserActivity();
|
||||
+ if (info == null || info.match == 0 ||
|
||||
+ !TextUtils.equals(ContextUtils.getApplicationContext().getPackageName(),
|
||||
+ info.activityInfo.packageName)) {
|
||||
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
+ RoleManager roleManager = (RoleManager) getContext().getSystemService(Context.ROLE_SERVICE);
|
||||
+ Intent intent = roleManager.createRequestRoleIntent(RoleManager.ROLE_BROWSER);
|
||||
+ startActivityForResult(intent, 0);
|
||||
+ } else {
|
||||
+ Intent intent = new Intent(Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS);
|
||||
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
+ IntentUtils.safeStartActivity(getContext(), intent);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // PREF_ALLOW_CUSTOM_TAB_INTENTS and PREF_OPEN_EXTERNAL_LINKS_INCOGNITO
|
||||
+ // are mutually exclusive
|
||||
+ if((boolean)newValue && ContextUtils.getAppSharedPreferences()
|
||||
+ .getBoolean(PrivacySettings.PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, false))
|
||||
+ openExternalLinksPref.setChecked(!(boolean)newValue);
|
||||
+ } else if (PREF_OPEN_EXTERNAL_LINKS_INCOGNITO.equals(key)) {
|
||||
+ SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
|
||||
+ sharedPreferencesEditor.putBoolean(PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, (boolean)newValue);
|
||||
+ sharedPreferencesEditor.apply();
|
||||
+
|
||||
+ // PREF_ALLOW_CUSTOM_TAB_INTENTS and PREF_OPEN_EXTERNAL_LINKS_INCOGNITO
|
||||
+ // are mutually exclusive
|
||||
+ if((boolean)newValue && ContextUtils.getAppSharedPreferences()
|
||||
+ .getBoolean(PrivacySettings.PREF_ALLOW_CUSTOM_TAB_INTENTS, false))
|
||||
+ allowCustomTabIntentsPref.setChecked(false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -428,6 +468,16 @@ public class PrivacySettings extends ChromeBaseSettingsFragment
|
||||
UserPrefs.get(getProfile()).getBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED));
|
||||
@@ -257,6 +283,16 @@ public class PrivacySettings
|
||||
canMakePaymentPref.setChecked(prefService.getBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED));
|
||||
}
|
||||
|
||||
+ allowCustomTabIntentsPref =
|
||||
@@ -263,113 +144,32 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
|
||||
+
|
||||
Preference doNotTrackPref = findPreference(PREF_DO_NOT_TRACK);
|
||||
if (doNotTrackPref != null) {
|
||||
doNotTrackPref.setSummary(
|
||||
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
--- a/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
@@ -1020,7 +1020,7 @@ BASE_FEATURE(kMagicStackAndroid,
|
||||
// Enables an experimental feature which forces mayLaunchUrl to use a different
|
||||
// storage partition. This may reduce performance. This should not be enabled by
|
||||
// default.
|
||||
-BASE_FEATURE(kMayLaunchUrlUsesSeparateStoragePartition,
|
||||
+CROMITE_FEATURE(kMayLaunchUrlUsesSeparateStoragePartition,
|
||||
"MayLaunchUrlUsesSeparateStoragePartition",
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
|
||||
--- 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
|
||||
@@ -825,6 +825,8 @@ public abstract class ChromeFeatureList {
|
||||
public static final CachedFlag sMiniOriginBar = newCachedFlag(MINI_ORIGIN_BAR, false, true);
|
||||
public static final CachedFlag sMostVisitedTilesCustomization =
|
||||
newCachedFlag(MOST_VISITED_TILES_CUSTOMIZATION, false);
|
||||
+ public static final CachedFlag sMayLaunchurlUsesSeparateStoragePartition =
|
||||
+ newCachedFlag(MAYLAUNCHURL_USES_SEPARATE_STORAGE_PARTITION, false);
|
||||
public static final CachedFlag sMostVisitedTilesReselect =
|
||||
newCachedFlag(MOST_VISITED_TILES_RESELECT, false);
|
||||
public static final CachedFlag sMultiInstanceApplicationStatusCleanup =
|
||||
@@ -1013,6 +1015,7 @@ public abstract class ChromeFeatureList {
|
||||
sMagicStackAndroid,
|
||||
sMiniOriginBar,
|
||||
sMostVisitedTilesCustomization,
|
||||
+ sMayLaunchurlUsesSeparateStoragePartition,
|
||||
sMostVisitedTilesReselect,
|
||||
sMultiInstanceApplicationStatusCleanup,
|
||||
sMvcUpdateViewWhenModelChanged,
|
||||
diff --git a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAssociatedApp.java b/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAssociatedApp.java
|
||||
--- a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAssociatedApp.java
|
||||
+++ b/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAssociatedApp.java
|
||||
@@ -88,7 +88,11 @@ public final class TabAssociatedApp extends TabWebContentsUserData implements Im
|
||||
public static boolean isOpenedFromExternalApp(Tab tab) {
|
||||
TabAssociatedApp app = get(tab);
|
||||
if (app == null) return false;
|
||||
-
|
||||
+ if (ContextUtils.getAppSharedPreferences()
|
||||
+ .getBoolean("open_external_links_incognito", false) &&
|
||||
+ tab.isIncognito() &&
|
||||
+ tab.getLaunchType() == TabLaunchType.FROM_EXTERNAL_APP)
|
||||
+ return true;
|
||||
String packageName = ContextUtils.getApplicationContext().getPackageName();
|
||||
return tab.getLaunchType() == TabLaunchType.FROM_EXTERNAL_APP
|
||||
&& !TextUtils.equals(app.getAppId(), packageName);
|
||||
diff --git a/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-custom-tab-intents-privacy-option.grdp b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-custom-tab-intents-privacy-option.grdp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-custom-tab-intents-privacy-option.grdp
|
||||
@@ -0,0 +1,25 @@
|
||||
+<?xml version="1.0" encoding="utf-8"?>
|
||||
+<grit-part>
|
||||
+ <!-- Allow custom tab intents -->
|
||||
+ <message name="IDS_ALLOW_CUSTOM_TAB_INTENTS_TITLE" desc="Text for 'Allow custom tab intents' settings-privacy option.">
|
||||
+ Allow custom tab intents.
|
||||
+ </message>
|
||||
+ <message name="IDS_ALLOW_CUSTOM_TAB_INTENTS_SUMMARY" desc="Summary text for 'Allow custom tab intents' settings-privacy option.">
|
||||
+ Allow applications to open custom tab intents, similar to webview. To work, Cromite must be set as the default browser.
|
||||
+ </message>
|
||||
doNotTrackPref.setSummary(prefService.getBoolean(Pref.ENABLE_DO_NOT_TRACK)
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -4496,6 +4496,21 @@ To change this setting, <ph name="BEGIN_LINK"><resetlink></ph>reset sync<p
|
||||
<message name="IDS_NEAR_OOM_REDUCTION_DECLINE" desc="The text of the button letting the user decline the browser's intervention, so that the page can be reloaded.">
|
||||
Show original
|
||||
</message>
|
||||
+ <!-- Allow custom tab intents -->
|
||||
+ <message name="IDS_ALLOW_CUSTOM_TAB_INTENTS_TITLE" desc="Text for 'Allow custom tab intents' settings-privacy option.">
|
||||
+ Allow custom tab intents
|
||||
+ </message>
|
||||
+ <message name="IDS_ALLOW_CUSTOM_TAB_INTENTS_SUMMARY" desc="Summary text for 'Allow custom tab intents' settings-privacy option.">
|
||||
+ Allow applications to open custom tab intents, similar to webview.
|
||||
+ </message>
|
||||
+
|
||||
+ <message name="IDS_USES_SEPARATE_STORAGEPARTITION_FOR_CCT_TITLE" desc="Text for 'Use ephemeral mode for CCT' settings-privacy option.">
|
||||
+ Use ephemeral mode for CCT
|
||||
+ </message>
|
||||
+ <message name="IDS_USES_SEPARATE_STORAGEPARTITION_FOR_CCT_SUMMARY" desc="Summary text for 'Use ephemeral mode for CCT' settings-privacy option.">
|
||||
+ Use a separate storage partition when opening custom tab intents
|
||||
+ </message>
|
||||
+
|
||||
+ <!-- Open External Links in Incognito -->
|
||||
+ <message name="IDS_OPEN_EXTERNAL_LINKS_INCOGNITO_TITLE" desc="Text for 'Open external links in incognito' settings-privacy option.">
|
||||
+ <!-- Open External Links in Incognito -->
|
||||
+ <message name="IDS_OPEN_EXTERNAL_LINKS_INCOGNITO_TITLE" desc="Text for 'Open external links in incognito' settings-privacy option.">
|
||||
+ Open external links in incognito
|
||||
+ </message>
|
||||
+ <message name="IDS_OPEN_EXTERNAL_LINKS_INCOGNITO_SUMMARY" desc="Summary text for 'Open external links in incognito' settings-privacy option.">
|
||||
+ Force the opening of all external links in incognito mode and uses the CCT ephemeral mode. Caution: there is only one incognito profile.
|
||||
+ </message>
|
||||
+</grit-part>
|
||||
diff --git a/components/content_relationship_verification/android/java/src/org/chromium/components/content_relationship_verification/OriginVerifier.java b/components/content_relationship_verification/android/java/src/org/chromium/components/content_relationship_verification/OriginVerifier.java
|
||||
--- a/components/content_relationship_verification/android/java/src/org/chromium/components/content_relationship_verification/OriginVerifier.java
|
||||
+++ b/components/content_relationship_verification/android/java/src/org/chromium/components/content_relationship_verification/OriginVerifier.java
|
||||
@@ -180,6 +180,11 @@ public abstract class OriginVerifier {
|
||||
assert mNativeOriginVerifier != 0
|
||||
: "Either provide a browserContextHandle to "
|
||||
+ "OriginVerifier#ctor or call initNativeOriginVerifier.";
|
||||
+ if ((true)) {
|
||||
+ PostTask.runOrPostTask(
|
||||
+ TaskTraits.UI_DEFAULT, new VerifiedCallback(origin, false, null));
|
||||
+ return;
|
||||
+ }
|
||||
+ </message>
|
||||
+ <message name="IDS_OPEN_EXTERNAL_LINKS_INCOGNITO_SUMMARY" desc="Summary text for 'Open external links in incognito' settings-privacy option.">
|
||||
+ Force the opening of all external links in incognito mode
|
||||
+ </message>
|
||||
|
||||
String scheme = origin.uri().getScheme();
|
||||
String host = assumeNonNull(origin.uri().getHost());
|
||||
diff --git a/components/language/core/common/language_experiments.cc b/components/language/core/common/language_experiments.cc
|
||||
--- a/components/language/core/common/language_experiments.cc
|
||||
+++ b/components/language/core/common/language_experiments.cc
|
||||
@@ -32,4 +32,5 @@ BASE_FEATURE(kDisableGeoLanguageModel,
|
||||
// Params:
|
||||
const char kContentLanguagesDisableObserversParam[] = "disable_observers";
|
||||
|
||||
+SET_CROMITE_FEATURE_DISABLED(kCctAutoTranslate);
|
||||
} // namespace language
|
||||
diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/add-custom-tab-intents-privacy-option.inc b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/add-custom-tab-intents-privacy-option.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/add-custom-tab-intents-privacy-option.inc
|
||||
@@ -0,0 +1 @@
|
||||
+SET_CROMITE_FEATURE_DISABLED(kCCTIntentFeatureOverrides);
|
||||
--
|
||||
<!-- Autofill Assistant preferences -->
|
||||
<!-- TODO(b/168178344): Move to Assistant settings strings section below. -->
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -3,30 +3,28 @@ Date: Tue, 31 Jan 2017 22:12:27 -0500
|
||||
Subject: Add exit menu item
|
||||
|
||||
Corrected Exit functionality
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/android/java/res/menu/main_menu.xml | 6 ++++++
|
||||
.../org/chromium/chrome/browser/ChromeTabbedActivity.java | 4 ++++
|
||||
.../src/org/chromium/chrome/browser/app/ChromeActivity.java | 6 ++++++
|
||||
.../chrome/browser/init/ChromeLifetimeController.java | 2 ++
|
||||
.../chrome/browser/init/ChromeLifetimeController.java | 6 +++++-
|
||||
.../browser/ui/android/strings/android_chrome_strings.grd | 3 +++
|
||||
5 files changed, 21 insertions(+)
|
||||
5 files changed, 24 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
|
||||
--- a/chrome/android/java/res/menu/main_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/main_menu.xml
|
||||
@@ -181,6 +181,9 @@ found in the LICENSE file.
|
||||
@@ -124,6 +124,9 @@
|
||||
android:icon="@drawable/gm_filled_cardboard_24" />
|
||||
<item android:id="@+id/managed_by_menu_id"
|
||||
android:title="@string/managed_browser"
|
||||
android:icon="@drawable/ic_business" />
|
||||
android:title="@string/managed" />
|
||||
+ <item android:id="@+id/exit_id"
|
||||
+ android:title="@string/menu_exit"
|
||||
+ android:icon="@drawable/ic_exit_to_app_white_24dp" />
|
||||
</group>
|
||||
|
||||
<!-- Items shown only in the tab switcher -->
|
||||
@@ -213,6 +216,9 @@ found in the LICENSE file.
|
||||
@@ -150,6 +153,9 @@
|
||||
<item android:id="@id/preferences_id"
|
||||
android:title="@string/menu_settings"
|
||||
android:icon="@drawable/settings_cog" />
|
||||
@@ -35,40 +33,40 @@ diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/re
|
||||
+ android:icon="@drawable/ic_exit_to_app_white_24dp" />
|
||||
</group>
|
||||
|
||||
<!-- Items shown only when the tablet has no visible tabs -->
|
||||
<!-- Items shown only in the tab switcher when start surface is enabled -->
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
@@ -326,6 +326,8 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
@@ -206,6 +206,8 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
+import org.chromium.chrome.browser.lifetime.ApplicationLifetime;
|
||||
+import org.chromium.chrome.browser.ApplicationLifetime;
|
||||
+
|
||||
/**
|
||||
* This is the main activity for ChromeMobile when not running in document mode. All the tabs are
|
||||
* accessible via a chrome specific tab switching UI.
|
||||
@@ -3361,6 +3363,8 @@ public class ChromeTabbedActivity extends ChromeActivity {
|
||||
.closeTabs(
|
||||
TabClosureParams.closeTab(currentTab).build(), /* allowDialog= */ true);
|
||||
* This is the main activity for ChromeMobile when not running in document mode. All the tabs
|
||||
* are accessible via a chrome specific tab switching UI.
|
||||
@@ -2008,6 +2010,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
|
||||
} else if (id == R.id.close_tab) {
|
||||
getCurrentTabModel().closeTab(currentTab, true, false, true);
|
||||
RecordUserAction.record("MobileTabClosed");
|
||||
+ } else if (id == R.id.exit_id) {
|
||||
+ ApplicationLifetime.terminate(false);
|
||||
} else if (id == R.id.close_all_tabs_menu_id) {
|
||||
boolean allowUndo = TabClosureParamsUtils.shouldAllowUndo(triggeringMotion);
|
||||
|
||||
// Close both incognito and normal tabs
|
||||
getTabModelSelector().closeAllTabs();
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
@@ -60,6 +60,7 @@ import org.chromium.base.supplier.UnownedUserDataSupplier;
|
||||
import org.chromium.chrome.R;
|
||||
@@ -66,6 +66,7 @@ import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.ActivityTabProvider;
|
||||
import org.chromium.chrome.browser.ActivityUtils;
|
||||
+import org.chromium.chrome.browser.lifetime.ApplicationLifetime;
|
||||
import org.chromium.chrome.browser.AppHooks;
|
||||
+import org.chromium.chrome.browser.ApplicationLifetime;
|
||||
import org.chromium.chrome.browser.ChromeActivitySessionTracker;
|
||||
import org.chromium.chrome.browser.ChromeApplicationImpl;
|
||||
import org.chromium.chrome.browser.ChromeKeyboardVisibilityDelegate;
|
||||
@@ -2419,6 +2420,11 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
@@ -2303,6 +2304,11 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -78,33 +76,30 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv
|
||||
+ }
|
||||
+
|
||||
if (id == R.id.update_menu_id) {
|
||||
UpdateMenuItemHelper.getInstance(
|
||||
getProfileProviderSupplier().get().getOriginalProfile())
|
||||
UpdateMenuItemHelper.getInstance().onMenuItemClicked(this);
|
||||
return true;
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
|
||||
@@ -18,6 +18,7 @@ import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.ThreadUtils;
|
||||
import org.chromium.chrome.browser.BrowserRestartActivity;
|
||||
import org.chromium.chrome.browser.lifetime.ApplicationLifetime;
|
||||
+import org.chromium.chrome.browser.incognito.IncognitoNotificationManager;
|
||||
@@ -82,7 +82,11 @@ class ChromeLifetimeController implements ApplicationLifetime.Observer,
|
||||
|
||||
/**
|
||||
* Answers requests to kill and (potentially) restart Chrome's main browser process.
|
||||
@@ -73,6 +74,7 @@ class ChromeLifetimeController
|
||||
// Kick off a timer to kill the process after a delay, which fires only if the Activities
|
||||
// take too long to be finished.
|
||||
- mHandler.postDelayed(mRestartRunnable, WATCHDOG_DELAY_MS);
|
||||
+ if (restart) {
|
||||
+ mHandler.postDelayed(mRestartRunnable, WATCHDOG_DELAY_MS);
|
||||
+ } else {
|
||||
+ fireBrowserRestartActivityIntent();
|
||||
+ }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTerminate(boolean restart) {
|
||||
+ IncognitoNotificationManager.dismissIncognitoNotification();
|
||||
mRestartChromeOnDestroy = restart;
|
||||
|
||||
// Tell all Chrome Activities to finish themselves.
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -4436,6 +4436,9 @@ To change this setting, <ph name="BEGIN_LINK">BEGIN_LINK</ph>delete the Chrome d
|
||||
<message name="IDS_MENU_AUTO_DARK_WEB_CONTENTS" desc="Menu item in Chrome's overflow/options menu. When Chrome's browser UI is set to dark theme and this option is checked, sites will have a dark theme automatically applied as well. [CHAR_LIMIT=24]">
|
||||
Dark theme
|
||||
@@ -3144,6 +3144,9 @@ To change this setting, <ph name="BEGIN_LINK"><resetlink></ph>reset sync<p
|
||||
<message name="IDS_MENU_REQUEST_DESKTOP_SITE_OFF" desc="Accessibility description for when Request Desktop Site is disabled.">
|
||||
Turn on Request desktop site
|
||||
</message>
|
||||
+ <message name="IDS_MENU_EXIT" desc="Menu item for exit browser. [CHAR-LIMIT=27]">
|
||||
+ Exit
|
||||
@@ -112,4 +107,6 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro
|
||||
<message name="IDS_MENU_READER_MODE_PREFS" desc="Menu item to show reader mode preferences pane, which allows users to change the appearance (font size, theme, etc.) of the page. [CHAR_LIMIT=27]">
|
||||
Appearance
|
||||
</message>
|
||||
--
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -4,108 +4,21 @@ Subject: Add flag for omnibox autocomplete filtering
|
||||
|
||||
Adds a flag that restricts whether search history, clipboard, bookmarks
|
||||
and internal chrome:// pages will be used for the autocomplete results.
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../browser/autocomplete_controller.cc | 10 ++++++
|
||||
.../omnibox/browser/history_url_provider.cc | 3 ++
|
||||
components/omnibox/browser/search_provider.cc | 4 +++
|
||||
components/url_formatter/url_fixer.cc | 4 +++
|
||||
...lag-for-omnibox-autocomplete-filtering.inc | 32 +++++++++++++++++++
|
||||
5 files changed, 53 insertions(+)
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-flag-for-omnibox-autocomplete-filtering.inc
|
||||
chrome/browser/about_flags.cc | 21 +++++++++++++++++++
|
||||
.../browser/autocomplete_controller.cc | 11 ++++++++++
|
||||
.../omnibox/browser/history_url_provider.cc | 3 +++
|
||||
components/omnibox/browser/search_provider.cc | 4 ++++
|
||||
components/url_formatter/url_fixer.cc | 4 ++++
|
||||
5 files changed, 43 insertions(+)
|
||||
|
||||
diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc
|
||||
--- a/components/omnibox/browser/autocomplete_controller.cc
|
||||
+++ b/components/omnibox/browser/autocomplete_controller.cc
|
||||
@@ -22,6 +22,7 @@
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -449,6 +449,22 @@ const FeatureEntry::FeatureVariation kReaderModeDiscoverabilityVariations[] = {
|
||||
base::size(kReaderModeOfferInSettings), nullptr}};
|
||||
#endif // OS_ANDROID
|
||||
|
||||
#include "base/check_op.h"
|
||||
#include "base/containers/contains.h"
|
||||
+#include "base/command_line.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/format_macros.h"
|
||||
#include "base/functional/bind.h"
|
||||
@@ -567,6 +568,15 @@ AutocompleteController::AutocompleteController(
|
||||
provider_client_->GetOmniboxTriggeredFeatureService()),
|
||||
steady_state_omnibox_position_(
|
||||
metrics::OmniboxEventProto::UNKNOWN_POSITION) {
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering")) {
|
||||
+ const std::string flag_value = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("omnibox-autocomplete-filtering");
|
||||
+ provider_types &= AutocompleteProvider::TYPE_KEYWORD | AutocompleteProvider::TYPE_SEARCH |
|
||||
+ AutocompleteProvider::TYPE_HISTORY_URL | AutocompleteProvider::TYPE_BOOKMARK | AutocompleteProvider::TYPE_BUILTIN;
|
||||
+ if (!base::Contains(flag_value, "bookmarks"))
|
||||
+ provider_types &= ~AutocompleteProvider::TYPE_BOOKMARK;
|
||||
+ if (!base::Contains(flag_value, "chrome"))
|
||||
+ provider_types &= ~AutocompleteProvider::TYPE_BUILTIN;
|
||||
+ }
|
||||
provider_types &= ~OmniboxFieldTrial::GetDisabledProviderTypes();
|
||||
|
||||
// Providers run in the order they're added. Async providers should run first
|
||||
diff --git a/components/omnibox/browser/history_url_provider.cc b/components/omnibox/browser/history_url_provider.cc
|
||||
--- a/components/omnibox/browser/history_url_provider.cc
|
||||
+++ b/components/omnibox/browser/history_url_provider.cc
|
||||
@@ -488,6 +488,9 @@ void HistoryURLProvider::Start(const AutocompleteInput& input,
|
||||
if (fixed_up_input.type() != metrics::OmniboxInputType::QUERY)
|
||||
matches_.push_back(what_you_typed_match);
|
||||
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering"))
|
||||
+ return;
|
||||
+
|
||||
// We'll need the history service to run both passes, so try to obtain it.
|
||||
history::HistoryService* const history_service =
|
||||
client()->GetHistoryService();
|
||||
diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/browser/search_provider.cc
|
||||
--- a/components/omnibox/browser/search_provider.cc
|
||||
+++ b/components/omnibox/browser/search_provider.cc
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "base/base64.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/functional/bind.h"
|
||||
+#include "base/command_line.h"
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/i18n/break_iterator.h"
|
||||
#include "base/i18n/case_conversion.h"
|
||||
@@ -628,6 +629,9 @@ void SearchProvider::Run(bool query_is_private) {
|
||||
}
|
||||
|
||||
void SearchProvider::DoHistoryQuery(bool minimal_changes) {
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering"))
|
||||
+ return;
|
||||
+
|
||||
// The history query results are synchronous, so if minimal_changes is true,
|
||||
// we still have the last results and don't need to do anything.
|
||||
if (minimal_changes)
|
||||
diff --git a/components/url_formatter/url_fixer.cc b/components/url_formatter/url_fixer.cc
|
||||
--- a/components/url_formatter/url_fixer.cc
|
||||
+++ b/components/url_formatter/url_fixer.cc
|
||||
@@ -15,6 +15,8 @@
|
||||
#include <string_view>
|
||||
|
||||
#include "base/check_op.h"
|
||||
+#include "base/containers/contains.h"
|
||||
+#include "base/command_line.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/i18n/char_iterator.h"
|
||||
@@ -655,6 +657,8 @@ GURL FixupURLInternal(const std::string& text,
|
||||
|
||||
FixupHost(trimmed, parts.host, parts.scheme.is_valid(), desired_tld, &url);
|
||||
if (chrome_url && !parts.host.is_valid()) {
|
||||
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering") ||
|
||||
+ base::Contains(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("omnibox-autocomplete-filtering"), "chrome"))
|
||||
url.append(kChromeUIDefaultHost);
|
||||
}
|
||||
FixupPort(trimmed, parts.port, &url);
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-flag-for-omnibox-autocomplete-filtering.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-flag-for-omnibox-autocomplete-filtering.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/Add-flag-for-omnibox-autocomplete-filtering.inc
|
||||
@@ -0,0 +1,32 @@
|
||||
+#if BUILDFLAG(IS_ANDROID)
|
||||
+
|
||||
+#ifdef FEATURE_PARAM_SECTION
|
||||
+
|
||||
+const FeatureEntry::Choice kOmniboxAutocompleteFiltering[] = {
|
||||
+ {flags_ui::kGenericExperimentChoiceDefault, "", ""},
|
||||
+ {"Search suggestions only",
|
||||
@@ -122,16 +35,104 @@ new file mode 100644
|
||||
+ "search-bookmarks-chrome"},
|
||||
+};
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
#if defined(OS_ANDROID)
|
||||
const FeatureEntry::FeatureParam kAdaptiveButton_AlwaysNone[] = {
|
||||
{"mode", "always-none"}};
|
||||
@@ -4766,6 +4782,11 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
FEATURE_VALUE_TYPE(chrome::android::kReaderModeInCCT)},
|
||||
#endif // !defined(OS_ANDROID)
|
||||
|
||||
+ {"omnibox-autocomplete-filtering",
|
||||
+ "Omnibox Autocomplete Filtering",
|
||||
+ "Restrict omnibox autocomplete results to a combination of search suggestions (if enabled), bookmarks, and internal chrome pages.",
|
||||
+ "Restrict omnibox autocomplete results to a combination of search suggestions (if enabled), bookmarks, and internal chrome pages. ungoogled-chromium flag.",
|
||||
+ kOsAll, MULTI_VALUE_TYPE(kOmniboxAutocompleteFiltering)},
|
||||
+
|
||||
+#endif
|
||||
#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \
|
||||
defined(OS_CHROMEOS)
|
||||
{"webui-feedback", flag_descriptions::kWebuiFeedbackName,
|
||||
diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc
|
||||
--- a/components/omnibox/browser/autocomplete_controller.cc
|
||||
+++ b/components/omnibox/browser/autocomplete_controller.cc
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/check_op.h"
|
||||
+#include "base/containers/contains.h"
|
||||
+#include "base/command_line.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/format_macros.h"
|
||||
#include "base/metrics/histogram.h"
|
||||
@@ -276,6 +278,15 @@ AutocompleteController::AutocompleteController(
|
||||
search_service_worker_signal_sent_(false),
|
||||
template_url_service_(provider_client_->GetTemplateURLService()) {
|
||||
provider_types &= ~OmniboxFieldTrial::GetDisabledProviderTypes();
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering")) {
|
||||
+ const std::string flag_value = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("omnibox-autocomplete-filtering");
|
||||
+ provider_types &= AutocompleteProvider::TYPE_KEYWORD | AutocompleteProvider::TYPE_SEARCH |
|
||||
+ AutocompleteProvider::TYPE_HISTORY_URL | AutocompleteProvider::TYPE_BOOKMARK | AutocompleteProvider::TYPE_BUILTIN;
|
||||
+ if (!base::Contains(flag_value, "bookmarks"))
|
||||
+ provider_types &= ~AutocompleteProvider::TYPE_BOOKMARK;
|
||||
+ if (!base::Contains(flag_value, "chrome"))
|
||||
+ provider_types &= ~AutocompleteProvider::TYPE_BUILTIN;
|
||||
+ }
|
||||
if (provider_types & AutocompleteProvider::TYPE_BOOKMARK)
|
||||
providers_.push_back(new BookmarkProvider(provider_client_.get()));
|
||||
if (provider_types & AutocompleteProvider::TYPE_BUILTIN)
|
||||
diff --git a/components/omnibox/browser/history_url_provider.cc b/components/omnibox/browser/history_url_provider.cc
|
||||
--- a/components/omnibox/browser/history_url_provider.cc
|
||||
+++ b/components/omnibox/browser/history_url_provider.cc
|
||||
@@ -553,6 +553,9 @@ void HistoryURLProvider::Start(const AutocompleteInput& input,
|
||||
if (fixed_up_input.type() != metrics::OmniboxInputType::QUERY)
|
||||
matches_.push_back(what_you_typed_match);
|
||||
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering"))
|
||||
+ return;
|
||||
+
|
||||
+#endif
|
||||
--
|
||||
// We'll need the history service to run both passes, so try to obtain it.
|
||||
history::HistoryService* const history_service =
|
||||
client()->GetHistoryService();
|
||||
diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/browser/search_provider.cc
|
||||
--- a/components/omnibox/browser/search_provider.cc
|
||||
+++ b/components/omnibox/browser/search_provider.cc
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "base/base64.h"
|
||||
#include "base/bind.h"
|
||||
#include "base/callback.h"
|
||||
+#include "base/command_line.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/i18n/break_iterator.h"
|
||||
#include "base/i18n/case_conversion.h"
|
||||
@@ -647,6 +648,9 @@ void SearchProvider::Run(bool query_is_private) {
|
||||
}
|
||||
|
||||
void SearchProvider::DoHistoryQuery(bool minimal_changes) {
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering"))
|
||||
+ return;
|
||||
+
|
||||
// The history query results are synchronous, so if minimal_changes is true,
|
||||
// we still have the last results and don't need to do anything.
|
||||
if (minimal_changes)
|
||||
diff --git a/components/url_formatter/url_fixer.cc b/components/url_formatter/url_fixer.cc
|
||||
--- a/components/url_formatter/url_fixer.cc
|
||||
+++ b/components/url_formatter/url_fixer.cc
|
||||
@@ -9,6 +9,8 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include "base/check_op.h"
|
||||
+#include "base/containers/contains.h"
|
||||
+#include "base/command_line.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/ranges/algorithm.h"
|
||||
@@ -607,6 +609,8 @@ GURL FixupURL(const std::string& text, const std::string& desired_tld) {
|
||||
|
||||
FixupHost(trimmed, parts.host, parts.scheme.is_valid(), desired_tld, &url);
|
||||
if (chrome_url && !parts.host.is_valid())
|
||||
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch("omnibox-autocomplete-filtering") ||
|
||||
+ base::Contains(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("omnibox-autocomplete-filtering"), "chrome"))
|
||||
url.append(kChromeUIDefaultHost);
|
||||
FixupPort(trimmed, parts.port, &url);
|
||||
FixupPath(trimmed, parts.path, &url);
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -2,72 +2,97 @@ From: Wengling Chen <feiyu2817@gmail.com>
|
||||
Date: Mon, 1 Feb 2021 19:18:55 +0200
|
||||
Subject: Add flag for save-data-header
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../loader/browser_initiated_resource_request.cc | 8 ++++++++
|
||||
.../about_flags_cc/Add-flag-for-save-data-header.inc | 10 ++++++++++
|
||||
.../cpp/features_cc/Add-flag-for-save-data-header.inc | 4 ++++
|
||||
.../cpp/features_h/Add-flag-for-save-data-header.inc | 1 +
|
||||
4 files changed, 23 insertions(+)
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-flag-for-save-data-header.inc
|
||||
create mode 100644 cromite_flags/services/network/public/cpp/features_cc/Add-flag-for-save-data-header.inc
|
||||
create mode 100644 cromite_flags/services/network/public/cpp/features_h/Add-flag-for-save-data-header.inc
|
||||
chrome/browser/about_flags.cc | 3 +++
|
||||
chrome/browser/flag_descriptions.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
content/browser/loader/browser_initiated_resource_request.cc | 5 +++--
|
||||
services/network/public/cpp/features.cc | 4 ++++
|
||||
services/network/public/cpp/features.h | 2 ++
|
||||
6 files changed, 19 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -4500,6 +4500,9 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
+ {"enable-save-data-header", flag_descriptions::kEnableSaveDataHeaderName,
|
||||
+ flag_descriptions::kEnableSaveDataHeaderDescription, kOsAndroid,
|
||||
+ FEATURE_VALUE_TYPE(network::features::kEnableSaveDataHeader)},
|
||||
{"enable-command-line-on-non-rooted-devices",
|
||||
flag_descriptions::kEnableCommandLineOnNonRootedName,
|
||||
flag_descriptions::kEnableCommandLineOnNoRootedDescription, kOsAndroid,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -1035,6 +1035,10 @@ const char kDisableKeepaliveFetchDescription[] =
|
||||
"Disable fetch with keepalive set "
|
||||
"(https://fetch.spec.whatwg.org/#request-keepalive-flag).";
|
||||
|
||||
+const char kEnableSaveDataHeaderName[] = "Enable save-data header";
|
||||
+const char kEnableSaveDataHeaderDescription[] =
|
||||
+ "Enable save-data header without enabling Data Saver.";
|
||||
+
|
||||
const char kExperimentalAccessibilityLanguageDetectionName[] =
|
||||
"Experimental accessibility language detection";
|
||||
const char kExperimentalAccessibilityLanguageDetectionDescription[] =
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -564,6 +564,9 @@ extern const char kDiagnosticsAppNavigationDescription[];
|
||||
extern const char kDisableKeepaliveFetchName[];
|
||||
extern const char kDisableKeepaliveFetchDescription[];
|
||||
|
||||
+extern const char kEnableSaveDataHeaderName[];
|
||||
+extern const char kEnableSaveDataHeaderDescription[];
|
||||
+
|
||||
extern const char kMemlogName[];
|
||||
extern const char kMemlogDescription[];
|
||||
extern const char kMemlogModeMinimal[];
|
||||
diff --git a/content/browser/loader/browser_initiated_resource_request.cc b/content/browser/loader/browser_initiated_resource_request.cc
|
||||
--- a/content/browser/loader/browser_initiated_resource_request.cc
|
||||
+++ b/content/browser/loader/browser_initiated_resource_request.cc
|
||||
@@ -4,6 +4,9 @@
|
||||
@@ -40,9 +40,10 @@ void UpdateAdditionalHeadersForBrowserInitiatedRequest(
|
||||
|
||||
#include "content/browser/loader/browser_initiated_resource_request.h"
|
||||
|
||||
+#include "base/feature_list.h"
|
||||
+#include "services/network/public/cpp/features.h"
|
||||
+
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/content_browser_client.h"
|
||||
@@ -37,8 +40,13 @@ void UpdateAdditionalHeadersForBrowserInitiatedRequest(
|
||||
// Save-Data was previously included in hints for workers, thus we cannot
|
||||
// remove it for the time being. If you're reading this, consider building
|
||||
// permissions policies for workers and/or deprecating this inclusion.
|
||||
+ bool setHeader = false;
|
||||
if (is_for_worker_script &&
|
||||
GetContentClient()->browser()->IsDataSaverEnabled(browser_context)) {
|
||||
+ setHeader = true;
|
||||
+ }
|
||||
+ setHeader |= base::FeatureList::IsEnabled(network::features::kEnableSaveDataHeader);
|
||||
+ if (setHeader) {
|
||||
// Set the Save-Data header if appropriate.
|
||||
// https://tools.ietf.org/html/draft-grigorik-http-client-hints-03#section-7
|
||||
- if (GetContentClient()->browser()->IsDataSaverEnabled(browser_context) &&
|
||||
+ if ((GetContentClient()->browser()->IsDataSaverEnabled(browser_context) &&
|
||||
!base::GetFieldTrialParamByFeatureAsBool(features::kDataSaverHoldback,
|
||||
- "holdback_web", false)) {
|
||||
+ "holdback_web", false)) ||
|
||||
+ base::FeatureList::IsEnabled(network::features::kEnableSaveDataHeader)) {
|
||||
if (should_update_existing_headers) {
|
||||
headers->RemoveHeader("Save-Data");
|
||||
}
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-flag-for-save-data-header.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-flag-for-save-data-header.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/Add-flag-for-save-data-header.inc
|
||||
@@ -0,0 +1,10 @@
|
||||
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
|
||||
--- a/services/network/public/cpp/features.cc
|
||||
+++ b/services/network/public/cpp/features.cc
|
||||
@@ -156,6 +156,10 @@ const base::FeatureParam<std::string>
|
||||
"DisabledProviders", ""};
|
||||
|
||||
// Disable special treatment on requests with keepalive set (see
|
||||
+// Enable save-data header seprately, without enabled data reduction service
|
||||
+const base::Feature kEnableSaveDataHeader{"EnableSaveDataHeader",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
+
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
+ // Bromite save data header
|
||||
+ {"enable-save-data-header",
|
||||
+ "Enable save-data header",
|
||||
+ "Enable save-data header without enabling Data Saver.", kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(network::features::kEnableSaveDataHeader)},
|
||||
+
|
||||
+#endif
|
||||
diff --git a/cromite_flags/services/network/public/cpp/features_cc/Add-flag-for-save-data-header.inc b/cromite_flags/services/network/public/cpp/features_cc/Add-flag-for-save-data-header.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/services/network/public/cpp/features_cc/Add-flag-for-save-data-header.inc
|
||||
@@ -0,0 +1,4 @@
|
||||
+// Enable save-data header separately (without enabled data reduction service).
|
||||
+CROMITE_FEATURE(kEnableSaveDataHeader,
|
||||
+ "EnableSaveDataHeader",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
diff --git a/cromite_flags/services/network/public/cpp/features_h/Add-flag-for-save-data-header.inc b/cromite_flags/services/network/public/cpp/features_h/Add-flag-for-save-data-header.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/services/network/public/cpp/features_h/Add-flag-for-save-data-header.inc
|
||||
@@ -0,0 +1 @@
|
||||
+COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kEnableSaveDataHeader);
|
||||
--
|
||||
// https://fetch.spec.whatwg.org/#request-keepalive-flag). This is introduced
|
||||
// for investigation on the memory usage, and should not be enabled widely.
|
||||
const base::Feature kDisableKeepaliveFetch{"DisableKeepaliveFetch",
|
||||
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
|
||||
--- a/services/network/public/cpp/features.h
|
||||
+++ b/services/network/public/cpp/features.h
|
||||
@@ -60,6 +60,8 @@ extern const base::FeatureParam<std::string>
|
||||
COMPONENT_EXPORT(NETWORK_CPP)
|
||||
extern const base::Feature kDisableKeepaliveFetch;
|
||||
|
||||
+extern const base::Feature kEnableSaveDataHeader;
|
||||
+COMPONENT_EXPORT(NETWORK_CPP)
|
||||
COMPONENT_EXPORT(NETWORK_CPP)
|
||||
extern const base::Feature kTrustTokens;
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -5,18 +5,69 @@ Subject: Add flag to configure maximum connections per host
|
||||
With the introduction of this flag it is possible to increase the maximum
|
||||
allowed connections per host; this can however be detrimental to devices
|
||||
with limited CPU/memory resources and it is disabled by default.
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/browser/about_flags.cc | 8 ++++++++
|
||||
chrome/browser/flag_descriptions.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
.../common/network_features.cc | 3 +++
|
||||
.../common/network_features.h | 4 ++++
|
||||
.../common/network_switch_list.h | 4 ++++
|
||||
.../spoof_checks/top_domains/BUILD.gn | 1 +
|
||||
...o-configure-maximum-connections-per-host.inc | 17 +++++++++++++++++
|
||||
net/socket/client_socket_pool_manager.cc | 17 +++++++++++++++++
|
||||
6 files changed, 46 insertions(+)
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/add-flag-to-configure-maximum-connections-per-host.inc
|
||||
8 files changed, 44 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -837,6 +837,11 @@ const FeatureEntry::Choice kForceEffectiveConnectionTypeChoices[] = {
|
||||
net::kEffectiveConnectionType4G},
|
||||
};
|
||||
|
||||
+const FeatureEntry::Choice kMaxConnectionsPerHostChoices[] = {
|
||||
+ {features::kMaxConnectionsPerHostChoiceDefault, "", ""},
|
||||
+ {features::kMaxConnectionsPerHostChoice15, switches::kMaxConnectionsPerHost, "15"},
|
||||
+};
|
||||
+
|
||||
// Ensure that all effective connection types returned by Network Quality
|
||||
// Estimator (NQE) are also exposed via flags.
|
||||
static_assert(net::EFFECTIVE_CONNECTION_TYPE_LAST + 2 ==
|
||||
@@ -3792,6 +3797,9 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
flag_descriptions::kAndroidPictureInPictureAPIName,
|
||||
flag_descriptions::kAndroidPictureInPictureAPIDescription, kOsAndroid,
|
||||
FEATURE_VALUE_TYPE(media::kPictureInPictureAPI)},
|
||||
+ {"max-connections-per-host", flag_descriptions::kMaxConnectionsPerHostName,
|
||||
+ flag_descriptions::kMaxConnectionsPerHostDescription, kOsAll,
|
||||
+ MULTI_VALUE_TYPE(kMaxConnectionsPerHostChoices)},
|
||||
{"reengagement-notification",
|
||||
flag_descriptions::kReengagementNotificationName,
|
||||
flag_descriptions::kReengagementNotificationDescription, kOsAndroid,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -1524,6 +1524,10 @@ const char kMediaHistoryDescription[] =
|
||||
"Enables Media History which records data around media playbacks on "
|
||||
"websites.";
|
||||
|
||||
+const char kMaxConnectionsPerHostName[] = "Maximum connections per host";
|
||||
+const char kMaxConnectionsPerHostDescription[] =
|
||||
+ "Customize maximum allowed connections per host.";
|
||||
+
|
||||
const char kMediaRouterCastAllowAllIPsName[] =
|
||||
"Connect to Cast devices on all IP addresses";
|
||||
const char kMediaRouterCastAllowAllIPsDescription[] =
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -877,6 +877,9 @@ extern const char kLogJsConsoleMessagesDescription[];
|
||||
extern const char kMediaHistoryName[];
|
||||
extern const char kMediaHistoryDescription[];
|
||||
|
||||
+extern const char kMaxConnectionsPerHostName[];
|
||||
+extern const char kMaxConnectionsPerHostDescription[];
|
||||
+
|
||||
extern const char kMediaRouterCastAllowAllIPsName[];
|
||||
extern const char kMediaRouterCastAllowAllIPsDescription[];
|
||||
|
||||
diff --git a/components/network_session_configurator/common/network_features.cc b/components/network_session_configurator/common/network_features.cc
|
||||
--- a/components/network_session_configurator/common/network_features.cc
|
||||
+++ b/components/network_session_configurator/common/network_features.cc
|
||||
@@ -59,7 +110,7 @@ diff --git a/components/network_session_configurator/common/network_switch_list.
|
||||
diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
--- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
+++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
@@ -90,6 +90,7 @@ executable("make_top_domain_list_variables") {
|
||||
@@ -73,6 +73,7 @@ executable("make_top_domain_list_variables") {
|
||||
"//base:i18n",
|
||||
"//components/url_formatter/spoof_checks/common_words:common",
|
||||
"//third_party/icu",
|
||||
@@ -67,32 +118,10 @@ diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/compon
|
||||
]
|
||||
if (is_ios) {
|
||||
frameworks = [ "UIKit.framework" ]
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/add-flag-to-configure-maximum-connections-per-host.inc b/cromite_flags/chrome/browser/about_flags_cc/add-flag-to-configure-maximum-connections-per-host.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/add-flag-to-configure-maximum-connections-per-host.inc
|
||||
@@ -0,0 +1,17 @@
|
||||
+#ifdef FEATURE_PARAM_SECTION
|
||||
+
|
||||
+const FeatureEntry::Choice kMaxConnectionsPerHostChoices[] = {
|
||||
+ {features::kMaxConnectionsPerHostChoiceDefault, "", ""},
|
||||
+ {features::kMaxConnectionsPerHostChoice15, switches::kMaxConnectionsPerHost, "15"},
|
||||
+};
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
+ {"max-connections-per-host",
|
||||
+ "Maximum connections per host",
|
||||
+ "Customize maximum allowed connections per host.", kOsAll,
|
||||
+ MULTI_VALUE_TYPE(kMaxConnectionsPerHostChoices)},
|
||||
+
|
||||
+#endif
|
||||
diff --git a/net/socket/client_socket_pool_manager.cc b/net/socket/client_socket_pool_manager.cc
|
||||
--- a/net/socket/client_socket_pool_manager.cc
|
||||
+++ b/net/socket/client_socket_pool_manager.cc
|
||||
@@ -22,6 +22,10 @@
|
||||
@@ -20,6 +20,10 @@
|
||||
#include "net/socket/client_socket_handle.h"
|
||||
#include "net/socket/client_socket_pool.h"
|
||||
#include "net/socket/connect_job.h"
|
||||
@@ -101,9 +130,9 @@ diff --git a/net/socket/client_socket_pool_manager.cc b/net/socket/client_socket
|
||||
+#include "base/command_line.h"
|
||||
+#include "base/strings/string_number_conversions.h"
|
||||
#include "net/ssl/ssl_config.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/scheme_host_port.h"
|
||||
@@ -164,6 +168,19 @@ void ClientSocketPoolManager::set_max_sockets_per_pool(
|
||||
@@ -173,6 +177,19 @@ void ClientSocketPoolManager::set_max_sockets_per_pool(
|
||||
int ClientSocketPoolManager::max_sockets_per_group(
|
||||
HttpNetworkSession::SocketPoolType pool_type) {
|
||||
DCHECK_LT(pool_type, HttpNetworkSession::NUM_SOCKET_POOL_TYPES);
|
||||
@@ -123,4 +152,6 @@ diff --git a/net/socket/client_socket_pool_manager.cc b/net/socket/client_socket
|
||||
return g_max_sockets_per_group[pool_type];
|
||||
}
|
||||
|
||||
--
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -3,37 +3,71 @@ Date: Thu, 25 Oct 2018 23:13:34 +0200
|
||||
Subject: Add flag to control video playback resume feature
|
||||
|
||||
Disable it by default on Android as it is everywhere else
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
...lag-to-control-video-playback-resume-feature.inc | 13 +++++++++++++
|
||||
...lag-to-control-video-playback-resume-feature.inc | 1 +
|
||||
2 files changed, 14 insertions(+)
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/add-flag-to-control-video-playback-resume-feature.inc
|
||||
create mode 100644 cromite_flags/media/base/media_switches_cc/add-flag-to-control-video-playback-resume-feature.inc
|
||||
chrome/browser/about_flags.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.cc | 5 +++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
media/base/media_switches.cc | 6 +-----
|
||||
4 files changed, 13 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/add-flag-to-control-video-playback-resume-feature.inc b/cromite_flags/chrome/browser/about_flags_cc/add-flag-to-control-video-playback-resume-feature.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/add-flag-to-control-video-playback-resume-feature.inc
|
||||
@@ -0,0 +1,13 @@
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
+#if BUILDFLAG(IS_ANDROID)
|
||||
+
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -2708,6 +2708,10 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
flag_descriptions::kWebRtcRemoteEventLogName,
|
||||
flag_descriptions::kWebRtcRemoteEventLogDescription, kOsDesktop,
|
||||
FEATURE_VALUE_TYPE(features::kWebRtcRemoteEventLog)},
|
||||
+ {"resume-background-video",
|
||||
+ "Resume background video.",
|
||||
+ "Resume background video playback when tab re-gains focus; additionally, "
|
||||
+ "it will pause video playback every single time you switch tabs.", kOsAll,
|
||||
+ flag_descriptions::kResumeBackgroundVideoName,
|
||||
+ flag_descriptions::kResumeBackgroundVideoDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(media::kResumeBackgroundVideo)},
|
||||
#endif
|
||||
{"enable-webrtc-srtp-aes-gcm", flag_descriptions::kWebrtcSrtpAesGcmName,
|
||||
flag_descriptions::kWebrtcSrtpAesGcmDescription, kOsAll,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -1120,6 +1120,11 @@ const char kEnablePenetratingImageSelectionDescription[] =
|
||||
"Enables image options to be surfaced in the context menu for nodes "
|
||||
"covered by transparent overlays.";
|
||||
|
||||
+const char kResumeBackgroundVideoName[] = "Resume background video.";
|
||||
+const char kResumeBackgroundVideoDescription[] =
|
||||
+ "Resume background video playback when tab re-gains focus; additionally, "
|
||||
+ "it will pause video playback every single time you switch tabs.";
|
||||
+
|
||||
+#endif // BUILDFLAG(IS_ANDROID)
|
||||
const char kEnablePixelCanvasRecordingName[] = "Enable pixel canvas recording";
|
||||
const char kEnablePixelCanvasRecordingDescription[] =
|
||||
"Pixel canvas recording allows the compositor to raster contents aligned "
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -632,6 +632,9 @@ extern const char kEnablePortalsDescription[];
|
||||
extern const char kEnablePortalsCrossOriginName[];
|
||||
extern const char kEnablePortalsCrossOriginDescription[];
|
||||
|
||||
+extern const char kResumeBackgroundVideoName[];
|
||||
+extern const char kResumeBackgroundVideoDescription[];
|
||||
+
|
||||
+#endif // ifdef FLAG_SECTION
|
||||
diff --git a/cromite_flags/media/base/media_switches_cc/add-flag-to-control-video-playback-resume-feature.inc b/cromite_flags/media/base/media_switches_cc/add-flag-to-control-video-playback-resume-feature.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/media/base/media_switches_cc/add-flag-to-control-video-playback-resume-feature.inc
|
||||
@@ -0,0 +1 @@
|
||||
+SET_CROMITE_FEATURE_DISABLED(kResumeBackgroundVideo);
|
||||
--
|
||||
extern const char kEnablePixelCanvasRecordingName[];
|
||||
extern const char kEnablePixelCanvasRecordingDescription[];
|
||||
|
||||
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
|
||||
--- a/media/base/media_switches.cc
|
||||
+++ b/media/base/media_switches.cc
|
||||
@@ -276,11 +276,7 @@ const base::Feature kPreloadMetadataLazyLoad{"PreloadMetadataLazyLoad",
|
||||
// when in background.
|
||||
const base::Feature kResumeBackgroundVideo {
|
||||
"resume-background-video",
|
||||
-#if defined(OS_ANDROID)
|
||||
- base::FEATURE_ENABLED_BY_DEFAULT
|
||||
-#else
|
||||
- base::FEATURE_DISABLED_BY_DEFAULT
|
||||
-#endif
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT
|
||||
};
|
||||
|
||||
// When enabled, MediaCapabilities will check with GPU Video Accelerator
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -2,80 +2,155 @@ From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 18 Nov 2018 13:06:49 +0100
|
||||
Subject: Add flag to disable IPv6 probes
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../about_flags_cc/add-flag-to-disable-IPv6-probes.inc | 8 ++++++++
|
||||
.../base/features_cc/add-flag-to-disable-IPv6-probes.inc | 3 +++
|
||||
.../base/features_h/add-flag-to-disable-IPv6-probes.inc | 2 ++
|
||||
net/BUILD.gn | 1 +
|
||||
net/dns/host_resolver_manager.cc | 8 ++++++++
|
||||
5 files changed, 22 insertions(+)
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/add-flag-to-disable-IPv6-probes.inc
|
||||
create mode 100644 cromite_flags/net/base/features_cc/add-flag-to-disable-IPv6-probes.inc
|
||||
create mode 100644 cromite_flags/net/base/features_h/add-flag-to-disable-IPv6-probes.inc
|
||||
chrome/browser/about_flags.cc | 5 +++++
|
||||
chrome/browser/flag_descriptions.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
components/subresource_filter/tools/BUILD.gn | 6 ++++++
|
||||
.../url_formatter/spoof_checks/top_domains/BUILD.gn | 3 ++-
|
||||
net/dns/host_resolver_manager.cc | 9 ++++++++-
|
||||
services/network/public/cpp/features.cc | 4 ++++
|
||||
services/network/public/cpp/features.h | 2 ++
|
||||
8 files changed, 34 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/add-flag-to-disable-IPv6-probes.inc b/cromite_flags/chrome/browser/about_flags_cc/add-flag-to-disable-IPv6-probes.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/add-flag-to-disable-IPv6-probes.inc
|
||||
@@ -0,0 +1,8 @@
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -4742,6 +4742,11 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
#endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) ||
|
||||
// defined(OS_CHROMEOS)
|
||||
|
||||
+ {"ipv6-probing",
|
||||
+ "Enable IPv6 probing.",
|
||||
+ "Send IPv6 probes to a RIPE DNS address to verify IPv6 connectivity.", kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(net::features::kIPv6Probing)},
|
||||
+ flag_descriptions::kIPv6ProbingName,
|
||||
+ flag_descriptions::kIPv6ProbingDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(network::features::kIPv6Probing)},
|
||||
+
|
||||
+#endif // ifdef FLAG_SECTION
|
||||
diff --git a/cromite_flags/net/base/features_cc/add-flag-to-disable-IPv6-probes.inc b/cromite_flags/net/base/features_cc/add-flag-to-disable-IPv6-probes.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/net/base/features_cc/add-flag-to-disable-IPv6-probes.inc
|
||||
@@ -0,0 +1,3 @@
|
||||
+CROMITE_FEATURE(kIPv6Probing,
|
||||
+ "IPv6Probing",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
diff --git a/cromite_flags/net/base/features_h/add-flag-to-disable-IPv6-probes.inc b/cromite_flags/net/base/features_h/add-flag-to-disable-IPv6-probes.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/net/base/features_h/add-flag-to-disable-IPv6-probes.inc
|
||||
@@ -0,0 +1,2 @@
|
||||
+// Enable IPv6 ping probes to RIPE DNS.
|
||||
+NET_EXPORT BASE_DECLARE_FEATURE(kIPv6Probing);
|
||||
diff --git a/net/BUILD.gn b/net/BUILD.gn
|
||||
--- a/net/BUILD.gn
|
||||
+++ b/net/BUILD.gn
|
||||
@@ -1145,6 +1145,7 @@ component("net") {
|
||||
":net_deps",
|
||||
"//components/miracle_parameter/common",
|
||||
"//components/network_time/time_tracker",
|
||||
#if !defined(OS_ANDROID)
|
||||
{"ntp-cache-one-google-bar", flag_descriptions::kNtpCacheOneGoogleBarName,
|
||||
flag_descriptions::kNtpCacheOneGoogleBarDescription, kOsDesktop,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -3015,6 +3015,10 @@ const char kContextualSearchRankerQueryDescription[] =
|
||||
|
||||
const char kContextualSearchSecondTapName[] =
|
||||
"Contextual Search second tap triggering";
|
||||
+const char kIPv6ProbingName[] = "Enable IPv6 probing.";
|
||||
+const char kIPv6ProbingDescription[] =
|
||||
+ "Send IPv6 probes to a RIPE DNS address to verify IPv6 connectivity.";
|
||||
+
|
||||
const char kContextualSearchSecondTapDescription[] =
|
||||
"Enables triggering on a second tap gesture even when Ranker would "
|
||||
"normally suppress that tap.";
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -689,6 +689,9 @@ extern const char kEnableWasmLazyCompilationName[];
|
||||
extern const char kEnableWasmLazyCompilationDescription[];
|
||||
|
||||
extern const char kEnableWasmTieringName[];
|
||||
+extern const char kIPv6ProbingName[];
|
||||
+extern const char kIPv6ProbingDescription[];
|
||||
+
|
||||
extern const char kEnableWasmTieringDescription[];
|
||||
|
||||
extern const char kEvDetailsInPageInfoName[];
|
||||
diff --git a/components/subresource_filter/tools/BUILD.gn b/components/subresource_filter/tools/BUILD.gn
|
||||
--- a/components/subresource_filter/tools/BUILD.gn
|
||||
+++ b/components/subresource_filter/tools/BUILD.gn
|
||||
@@ -50,6 +50,8 @@ if (!is_ios) {
|
||||
deps = [
|
||||
":tools_lib",
|
||||
"//base",
|
||||
+ "//components/network_session_configurator/common",
|
||||
+ "//services/network/public/cpp"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -61,6 +63,8 @@ if (!is_ios) {
|
||||
":tools_lib",
|
||||
"../core/common",
|
||||
"//base",
|
||||
+ "//components/network_session_configurator/common",
|
||||
+ "//services/network/public/cpp",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -70,6 +74,8 @@ if (!is_ios) {
|
||||
"ruleset_converter:support",
|
||||
"//base",
|
||||
"//third_party/protobuf:protobuf_lite",
|
||||
+ "//components/network_session_configurator/common",
|
||||
+ "//services/network/public/cpp"
|
||||
]
|
||||
}
|
||||
|
||||
diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
--- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
+++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
|
||||
@@ -73,7 +73,8 @@ executable("make_top_domain_list_variables") {
|
||||
"//base:i18n",
|
||||
"//components/url_formatter/spoof_checks/common_words:common",
|
||||
"//third_party/icu",
|
||||
- "//components/network_session_configurator/common"
|
||||
+ "//components/network_session_configurator/common",
|
||||
"//net/http:transport_security_state_generated_files",
|
||||
"//third_party/simdutf:simdutf",
|
||||
+ "//services/network/public/cpp",
|
||||
]
|
||||
if (is_ios) {
|
||||
frameworks = [ "UIKit.framework" ]
|
||||
diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
|
||||
--- a/net/dns/host_resolver_manager.cc
|
||||
+++ b/net/dns/host_resolver_manager.cc
|
||||
@@ -115,6 +115,7 @@
|
||||
@@ -86,6 +86,7 @@
|
||||
#include "net/log/net_log_event_type.h"
|
||||
#include "net/log/net_log_source.h"
|
||||
#include "net/log/net_log_source_type.h"
|
||||
+#include "services/network/public/cpp/features.h"
|
||||
#include "net/log/net_log_with_source.h"
|
||||
#include "net/socket/client_socket_factory.h"
|
||||
#include "net/url_request/url_request_context.h"
|
||||
@@ -1489,6 +1490,13 @@ int HostResolverManager::StartIPv6ReachabilityCheck(
|
||||
return OK;
|
||||
}
|
||||
|
||||
+ if (!base::FeatureList::IsEnabled(net::features::kIPv6Probing)) {
|
||||
+ probing_ipv6_ = false;
|
||||
+ last_ipv6_probe_result_ = false;
|
||||
+ last_ipv6_probe_time_ = base::TimeTicks();
|
||||
+ return OK;
|
||||
+ }
|
||||
#include "net/socket/datagram_client_socket.h"
|
||||
@@ -3512,8 +3513,14 @@ bool HostResolverManager::IsIPv6Reachable(const NetLogWithSource& net_log) {
|
||||
if (last_ipv6_probe_time_.is_null() ||
|
||||
(tick_clock_->NowTicks() - last_ipv6_probe_time_).InMilliseconds() >
|
||||
kIPv6ProbePeriodMs) {
|
||||
- SetLastIPv6ProbeResult(
|
||||
+
|
||||
if (probing_ipv6_) {
|
||||
ipv6_request_callbacks_.push_back(std::move(callback));
|
||||
return ERR_IO_PENDING;
|
||||
--
|
||||
+ if (!base::FeatureList::IsEnabled(network::features::kIPv6Probing)) {
|
||||
+ // pretend IPv6 connectivy probe is successful when probing is disabled
|
||||
+ SetLastIPv6ProbeResult(true);
|
||||
+ } else {
|
||||
+ SetLastIPv6ProbeResult(
|
||||
IsGloballyReachable(IPAddress(kIPv6ProbeAddress), net_log));
|
||||
+ }
|
||||
cached = false;
|
||||
}
|
||||
net_log.AddEvent(
|
||||
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
|
||||
--- a/services/network/public/cpp/features.cc
|
||||
+++ b/services/network/public/cpp/features.cc
|
||||
@@ -42,6 +42,10 @@ const base::Feature kReporting{"Reporting", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
const base::Feature kThrottleDelayable{"ThrottleDelayable",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
|
||||
+// Enable IPv6 ping probes to RIPE DNS.
|
||||
+const base::Feature kIPv6Probing{"IPv6Probing",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
+
|
||||
// When kPriorityRequestsDelayableOnSlowConnections is enabled, HTTP
|
||||
// requests fetched from a SPDY/QUIC/H2 proxies can be delayed by the
|
||||
// ResourceScheduler just as HTTP/1.1 resources are. However, requests from such
|
||||
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
|
||||
--- a/services/network/public/cpp/features.h
|
||||
+++ b/services/network/public/cpp/features.h
|
||||
@@ -19,6 +19,8 @@ extern const base::Feature kNetworkErrorLogging;
|
||||
COMPONENT_EXPORT(NETWORK_CPP)
|
||||
extern const base::Feature kNetworkService;
|
||||
COMPONENT_EXPORT(NETWORK_CPP)
|
||||
+extern const base::Feature kIPv6Probing;
|
||||
+COMPONENT_EXPORT(NETWORK_CPP)
|
||||
extern const base::Feature kReporting;
|
||||
COMPONENT_EXPORT(NETWORK_CPP)
|
||||
extern const base::Feature kThrottleDelayable;
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 16 Nov 2019 11:18:09 +0100
|
||||
Subject: Add flag to disable WebGL
|
||||
|
||||
---
|
||||
chrome/browser/about_flags.cc | 3 +++
|
||||
chrome/browser/flag_descriptions.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
3 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -2643,6 +2643,9 @@ const FeatureEntry::FeatureVariation kReadLaterVariations[] = {
|
||||
// When adding a new choice, add it to the end of the list.
|
||||
const FeatureEntry kFeatureEntries[] = {
|
||||
// Include generated flags for flag unexpiry; see //docs/flag_expiry.md and
|
||||
+ {switches::kDisableWebGL, flag_descriptions::kDisableWebGLName,
|
||||
+ flag_descriptions::kDisableWebGLDescription, kOsAll,
|
||||
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebGL)},
|
||||
// //tools/flags/generate_unexpire_flags.py.
|
||||
#include "build/chromeos_buildflags.h"
|
||||
#include "chrome/browser/unexpire_flags_gen.inc"
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -613,6 +613,10 @@ const char kEnableAudioFocusEnforcementName[] = "Audio Focus Enforcement";
|
||||
const char kEnableAudioFocusEnforcementDescription[] =
|
||||
"Enables enforcement of a single media session having audio focus at "
|
||||
"any one time. Requires #enable-media-session-service to be enabled too.";
|
||||
+const char kDisableWebGLName[] = "WebGL";
|
||||
+
|
||||
+const char kDisableWebGLDescription[] = "Enable or disable all versions of WebGL";
|
||||
+
|
||||
|
||||
const char kEnableAutofillAccountWalletStorageName[] =
|
||||
"Enable the account data storage for autofill";
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -341,6 +341,9 @@ extern const char kForceColorProfileSRGB[];
|
||||
extern const char kForceColorProfileP3[];
|
||||
extern const char kForceColorProfileColorSpin[];
|
||||
extern const char kForceColorProfileSCRGBLinear[];
|
||||
+extern const char kDisableWebGLName[];
|
||||
+extern const char kDisableWebGLDescription[];
|
||||
+
|
||||
extern const char kForceColorProfileHDR10[];
|
||||
|
||||
extern const char kForceColorProfileName[];
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -2,276 +2,54 @@ From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 25 May 2021 19:46:14 +0200
|
||||
Subject: Add flag to disable external intent requests
|
||||
|
||||
Adds a new flag that allows to control the switch with same name;
|
||||
when flag is disabled no external intent will ever be allowed,
|
||||
for any URL except for the tel: schema.
|
||||
This also reverts commit b710cefb53b558a8bcd884f6baf0229ba4225721 and
|
||||
enables IntentBlockExternalFormRedirectsNoGesture.
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../java/res/xml/privacy_preferences.xml | 7 +++-
|
||||
.../customtabs/CustomTabDelegateFactory.java | 2 ++
|
||||
.../ExternalNavigationDelegateImpl.java | 4 ++-
|
||||
.../cromite/sAllowExternalIntentRequests.java | 33 +++++++++++++++++++
|
||||
...g-to-disable-external-intent-requests.grdp | 9 +++++
|
||||
.../android/external_intents_features.cc | 7 +++-
|
||||
.../android/external_intents_features.h | 1 +
|
||||
.../ExternalIntentsFeatures.java | 6 ++++
|
||||
.../ExternalNavigationHandler.java | 21 ++++++++++++
|
||||
...ag-to-disable-external-intent-requests.inc | 13 ++++++++
|
||||
...t-Delete-block-external-form-redirects.inc | 15 +++++++++
|
||||
...ag-to-disable-external-intent-requests.inc | 3 ++
|
||||
12 files changed, 118 insertions(+), 3 deletions(-)
|
||||
create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sAllowExternalIntentRequests.java
|
||||
create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-flag-to-disable-external-intent-requests.grdp
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-flag-to-disable-external-intent-requests.inc
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Revert-Delete-block-external-form-redirects.inc
|
||||
create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Add-flag-to-disable-external-intent-requests.inc
|
||||
chrome/browser/about_flags.cc | 3 +++
|
||||
chrome/browser/flag_descriptions.cc | 6 ++++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
3 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
@@ -77,7 +77,12 @@ found in the LICENSE file.
|
||||
android:title="@string/settings_incognito_tab_lock_title"
|
||||
android:summary="@string/settings_incognito_tab_lock_summary_android_setting_off"
|
||||
android:persistent="false" />
|
||||
-
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
+ android:key="allow_external_intent_requests"
|
||||
+ android:title="@string/allow_external_intent_requests_title"
|
||||
+ android:summary="@string/allow_external_intent_requests_summary"
|
||||
+ app:featureName="AllowExternalIntentRequests"
|
||||
+ app:needRestart="false" />
|
||||
<PreferenceCategory
|
||||
android:key="security_section"
|
||||
android:title="@string/security_section_title" />
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
|
||||
@@ -35,6 +35,7 @@ import org.chromium.chrome.browser.ephemeraltab.EphemeralTabCoordinator;
|
||||
import org.chromium.chrome.browser.externalnav.ExternalNavigationDelegateImpl;
|
||||
import org.chromium.chrome.browser.flags.ActivityType;
|
||||
import org.chromium.chrome.browser.flags.ChromeFeatureList;
|
||||
+import org.chromium.chrome.browser.flags.cromite.sAllowExternalIntentRequests;
|
||||
import org.chromium.chrome.browser.fullscreen.BrowserControlsManager;
|
||||
import org.chromium.chrome.browser.fullscreen.FullscreenManager;
|
||||
import org.chromium.chrome.browser.init.ChromeActivityNativeDelegate;
|
||||
@@ -126,6 +127,7 @@ public class CustomTabDelegateFactory implements TabDelegateFactory {
|
||||
|
||||
@Override
|
||||
public boolean shouldDisableAllExternalIntents() {
|
||||
+ if (!sAllowExternalIntentRequests.getInstance().isEnabled()) return true;
|
||||
return mActivityType == ActivityType.AUTH_TAB
|
||||
&& ChromeFeatureList.sCctAuthTabDisableAllExternalIntents.isEnabled();
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java
|
||||
@@ -20,6 +20,7 @@ import org.chromium.base.IntentUtils;
|
||||
import org.chromium.base.PackageManagerUtils;
|
||||
import org.chromium.base.supplier.Supplier;
|
||||
import org.chromium.chrome.browser.ChromeTabbedActivity2;
|
||||
+import org.chromium.chrome.browser.flags.cromite.sAllowExternalIntentRequests;
|
||||
import org.chromium.chrome.browser.IntentHandler;
|
||||
import org.chromium.chrome.browser.password_manager.CctPasswordSavingMetricsRecorderBridge;
|
||||
import org.chromium.chrome.browser.safe_browsing.SafeBrowsingBridge;
|
||||
@@ -107,7 +108,8 @@ public class ExternalNavigationDelegateImpl implements ExternalNavigationDelegat
|
||||
|
||||
@Override
|
||||
public boolean shouldDisableExternalIntentRequestsForUrl(GURL url) {
|
||||
- return false;
|
||||
+ if ("tel".equals(url.getScheme())) return false;
|
||||
+ return !sAllowExternalIntentRequests.getInstance().isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sAllowExternalIntentRequests.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sAllowExternalIntentRequests.java
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sAllowExternalIntentRequests.java
|
||||
@@ -0,0 +1,33 @@
|
||||
+/*
|
||||
+ This file is part of Cromite.
|
||||
+
|
||||
+ Cromite 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.
|
||||
+
|
||||
+ Cromite 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 Cromite. If not, see <https://www.gnu.org/licenses/>.
|
||||
+*/
|
||||
+
|
||||
+package org.chromium.chrome.browser.flags.cromite;
|
||||
+
|
||||
+import org.chromium.components.cached_flags.CachedFlag;
|
||||
+import org.chromium.chrome.browser.flags.ChromeFeatureMap;
|
||||
+
|
||||
+public class sAllowExternalIntentRequests {
|
||||
+ private static final CachedFlag sInstance =
|
||||
+ new CachedFlag(ChromeFeatureMap.getInstance(),
|
||||
+ "AllowExternalIntentRequests", false);
|
||||
+
|
||||
+ private sAllowExternalIntentRequests() {}
|
||||
+
|
||||
+ public static CachedFlag getInstance() {
|
||||
+ return sInstance;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-flag-to-disable-external-intent-requests.grdp b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-flag-to-disable-external-intent-requests.grdp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-flag-to-disable-external-intent-requests.grdp
|
||||
@@ -0,0 +1,9 @@
|
||||
+<?xml version="1.0" encoding="utf-8"?>
|
||||
+<grit-part>
|
||||
+ <message name="IDS_ALLOW_EXTERNAL_INTENT_REQUESTS_TITLE" desc="">
|
||||
+ Allow forward URL requests to external intents
|
||||
+ </message>
|
||||
+ <message name="IDS_ALLOW_EXTERNAL_INTENT_REQUESTS_SUMMARY" desc="">
|
||||
+ If disabled, URL requests will never allow redirection to an external intent, such as open application. Caution: since no verification is possible on the information, allows linkage between browser browsing and activity on the application.
|
||||
+ </message>
|
||||
+</grit-part>
|
||||
diff --git a/components/external_intents/android/external_intents_features.cc b/components/external_intents/android/external_intents_features.cc
|
||||
--- a/components/external_intents/android/external_intents_features.cc
|
||||
+++ b/components/external_intents/android/external_intents_features.cc
|
||||
@@ -28,7 +28,6 @@ const base::Feature* const kFeaturesExposedToJava[] = {
|
||||
&kExternalNavigationDebugLogs, &kBlockIntentsToSelf,
|
||||
&kNavigationCaptureRefactorAndroid, &kAuxiliaryNavigationStaysInBrowser,
|
||||
&kReparentTopLevelNavigationFromPWA, &kReparentAuxiliaryNavigationFromPWA};
|
||||
-
|
||||
} // namespace
|
||||
|
||||
// Alphabetical:
|
||||
@@ -57,7 +56,13 @@ BASE_FEATURE(kReparentAuxiliaryNavigationFromPWA,
|
||||
"ReparentAuxiliaryNavigationFromPWA",
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
+CROMITE_FEATURE(kIntentBlockExternalFormRedirectsNoGesture,
|
||||
+ "IntentBlockExternalFormRedirectsNoGesture",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
+
|
||||
static jlong JNI_ExternalIntentsFeatures_GetFeature(JNIEnv* env, jint ordinal) {
|
||||
+ if (ordinal == -1)
|
||||
+ return reinterpret_cast<jlong>(&kIntentBlockExternalFormRedirectsNoGesture);
|
||||
return reinterpret_cast<jlong>(kFeaturesExposedToJava[ordinal]);
|
||||
}
|
||||
|
||||
diff --git a/components/external_intents/android/external_intents_features.h b/components/external_intents/android/external_intents_features.h
|
||||
--- a/components/external_intents/android/external_intents_features.h
|
||||
+++ b/components/external_intents/android/external_intents_features.h
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
namespace external_intents {
|
||||
|
||||
+BASE_DECLARE_FEATURE(kIntentBlockExternalFormRedirectsNoGesture);
|
||||
BASE_DECLARE_FEATURE(kExternalNavigationDebugLogs);
|
||||
BASE_DECLARE_FEATURE(kBlockFrameRenavigations);
|
||||
BASE_DECLARE_FEATURE(kBlockIntentsToSelf);
|
||||
diff --git a/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalIntentsFeatures.java b/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalIntentsFeatures.java
|
||||
--- a/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalIntentsFeatures.java
|
||||
+++ b/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalIntentsFeatures.java
|
||||
@@ -19,6 +19,12 @@ import org.chromium.build.annotations.NullMarked;
|
||||
@JNINamespace("external_intents")
|
||||
@NullMarked
|
||||
public class ExternalIntentsFeatures {
|
||||
+ public static final String INTENT_BLOCK_EXTERNAL_FORM_REDIRECT_NO_GESTURE_NAME =
|
||||
+ "IntentBlockExternalFormRedirectsNoGesture";
|
||||
+
|
||||
+ public static final ExternalIntentsFeature INTENT_BLOCK_EXTERNAL_FORM_REDIRECT_NO_GESTURE =
|
||||
+ new ExternalIntentsFeature(-1, INTENT_BLOCK_EXTERNAL_FORM_REDIRECT_NO_GESTURE_NAME);
|
||||
+
|
||||
public static final String EXTERNAL_NAVIGATION_DEBUG_LOGS_NAME = "ExternalNavigationDebugLogs";
|
||||
public static final String BLOCK_INTENTS_TO_SELF_NAME = "BlockIntentsToSelf";
|
||||
public static final String NAVIGATION_CAPTURE_REFACTOR_ANDROID_NAME =
|
||||
diff --git a/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java b/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java
|
||||
--- a/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java
|
||||
+++ b/components/external_intents/android/java/src/org/chromium/components/external_intents/ExternalNavigationHandler.java
|
||||
@@ -1560,6 +1560,12 @@ public class ExternalNavigationHandler {
|
||||
|| ignoreBackForwardNav(params);
|
||||
}
|
||||
|
||||
+ /** Wrapper of check against the feature to support overriding for testing. */
|
||||
+ @VisibleForTesting
|
||||
+ boolean blockExternalFormRedirectsWithoutGesture() {
|
||||
+ return ExternalIntentsFeatures.INTENT_BLOCK_EXTERNAL_FORM_REDIRECT_NO_GESTURE.isEnabled();
|
||||
+ }
|
||||
+
|
||||
private OverrideUrlLoadingResult shouldOverrideUrlLoadingInternal(
|
||||
ExternalNavigationParams params,
|
||||
Intent targetIntent,
|
||||
@@ -1617,6 +1623,21 @@ public class ExternalNavigationHandler {
|
||||
return OverrideUrlLoadingResult.forNoOverride();
|
||||
}
|
||||
|
||||
+ // http://crbug.com/839751: Require user gestures for form submits to external
|
||||
+ // protocols.
|
||||
+ // TODO(tedchoc): Turn this on by default once we verify this change does
|
||||
+ // not break the world.
|
||||
+ int pageTransitionCore = params.getPageTransition() & PageTransition.CORE_MASK;
|
||||
+ boolean isFormSubmit = pageTransitionCore == PageTransition.FORM_SUBMIT;
|
||||
+ boolean isRedirectFromFormSubmit = isFormSubmit && params.isRedirect();
|
||||
+ if (isRedirectFromFormSubmit && !incomingIntentRedirect && !params.hasUserGesture()
|
||||
+ && blockExternalFormRedirectsWithoutGesture()) {
|
||||
+ if (debug()) {
|
||||
+ Log.i(TAG, "Incoming form intent attempting to redirect without user gesture");
|
||||
+ }
|
||||
+ return OverrideUrlLoadingResult.forNoOverride();
|
||||
+ }
|
||||
+
|
||||
if (hasInternalScheme(params.getUrl(), targetIntent)
|
||||
|| hasContentScheme(params.getUrl(), targetIntent)
|
||||
|| hasFileSchemeInIntentURI(params.getUrl(), targetIntent)
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-flag-to-disable-external-intent-requests.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-flag-to-disable-external-intent-requests.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/Add-flag-to-disable-external-intent-requests.inc
|
||||
@@ -0,0 +1,13 @@
|
||||
+#if BUILDFLAG(IS_ANDROID)
|
||||
+
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
+ {"allow-external-intent-requests",
|
||||
+ "Allow forward URL requests to external intents",
|
||||
+ "If disabled, URL requests will never"
|
||||
+ "allow for redirecting to an external intent.", kOsAndroid,
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -2697,6 +2697,9 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
flag_descriptions::kWebrtcCaptureMultiChannelApmName,
|
||||
flag_descriptions::kWebrtcCaptureMultiChannelApmDescription, kOsAll,
|
||||
FEATURE_VALUE_TYPE(features::kWebRtcEnableCaptureMultiChannelApm)},
|
||||
+ {"disable-external-intent-requests", flag_descriptions::kDisableExternalIntentRequestsName,
|
||||
+ flag_descriptions::kDisableExternalIntentRequestsDescription, kOsAll,
|
||||
+ SINGLE_DISABLE_VALUE_TYPE("disable-external-intent-requests")},
|
||||
{"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName,
|
||||
flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS,
|
||||
SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)},
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -3272,6 +3272,12 @@ const char kProcessSharingWithStrictSiteInstancesDescription[] =
|
||||
"separated like strict site isolation, but process selection puts multiple "
|
||||
"site instances in a single process.";
|
||||
|
||||
+const char kDisableExternalIntentRequestsName[] =
|
||||
+ "Never forward URL requests to external intents";
|
||||
+const char kDisableExternalIntentRequestsDescription[] =
|
||||
+ "URL requests will never"
|
||||
+ "allow for redirecting to an external intent.";
|
||||
+
|
||||
+#endif
|
||||
const char kQueryTilesName[] = "Show query tiles";
|
||||
const char kQueryTilesDescription[] = "Shows query tiles in Chrome";
|
||||
const char kQueryTilesNTPName[] = "Show query tiles in NTP";
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -1883,6 +1883,9 @@ extern const char kQueryTilesNTPDescription[];
|
||||
extern const char kQueryTilesOmniboxName[];
|
||||
extern const char kQueryTilesOmniboxDescription[];
|
||||
extern const char kQueryTilesSingleTierName[];
|
||||
+extern const char kDisableExternalIntentRequestsName[];
|
||||
+extern const char kDisableExternalIntentRequestsDescription[];
|
||||
+
|
||||
+#endif
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Revert-Delete-block-external-form-redirects.inc b/cromite_flags/chrome/browser/about_flags_cc/Revert-Delete-block-external-form-redirects.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/Revert-Delete-block-external-form-redirects.inc
|
||||
@@ -0,0 +1,15 @@
|
||||
+#if BUILDFLAG(IS_ANDROID)
|
||||
+
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
+ {"block-external-form-redirects-no-gesture",
|
||||
+ "Block intents from form submissions without user gesture",
|
||||
+ "Require a user gesture that triggered a form submission in order to "
|
||||
+ "allow for redirecting to an external intent.",
|
||||
+ kOsAndroid,
|
||||
+ FEATURE_VALUE_TYPE(
|
||||
+ external_intents::kIntentBlockExternalFormRedirectsNoGesture)},
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+#endif
|
||||
diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Add-flag-to-disable-external-intent-requests.inc b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Add-flag-to-disable-external-intent-requests.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Add-flag-to-disable-external-intent-requests.inc
|
||||
@@ -0,0 +1,3 @@
|
||||
+CROMITE_FEATURE(kAllowExternalIntentRequests,
|
||||
+ "AllowExternalIntentRequests",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
--
|
||||
extern const char kQueryTilesSingleTierDescription[];
|
||||
extern const char kQueryTilesEnableQueryEditingName[];
|
||||
extern const char kQueryTilesEnableQueryEditingDescription[];
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 18 Oct 2021 20:50:48 +0200
|
||||
Subject: Add flag to disable pull to refresh effect
|
||||
|
||||
---
|
||||
chrome/browser/about_flags.cc | 6 ++++++
|
||||
chrome/browser/flag_descriptions.cc | 6 ++++++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
3 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -7477,6 +7477,12 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
flag_descriptions::kPrivacyReviewDescription, kOsDesktop | kOsAndroid,
|
||||
FEATURE_VALUE_TYPE(features::kPrivacyReview)},
|
||||
|
||||
+#if defined(OS_ANDROID)
|
||||
+ {switches::kDisablePullToRefreshEffect, flag_descriptions::kDisablePullToRefreshEffectName,
|
||||
+ flag_descriptions::kDisablePullToRefreshEffectDescription, kOsAndroid,
|
||||
+ SINGLE_VALUE_TYPE(switches::kDisablePullToRefreshEffect)},
|
||||
+#endif
|
||||
+
|
||||
#if defined(OS_ANDROID)
|
||||
{"google-mobile-services-passwords",
|
||||
flag_descriptions::kUnifiedPasswordManagerAndroidName,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -1451,6 +1451,12 @@ const char kIncognitoClearBrowsingDataDialogForDesktopDescription[] =
|
||||
"When enabled, clear browsing data option would be enabled in Incognito "
|
||||
"which upon clicking would show a dialog to close all Incognito windows.";
|
||||
|
||||
+const char kDisablePullToRefreshEffectName[] =
|
||||
+ "Disable the pull-to-refresh effect when vertically overscrolling content.";
|
||||
+const char kDisablePullToRefreshEffectDescription[] =
|
||||
+ "Disable the pull-to-refresh effect with the elastic overscroll feature "
|
||||
+ "used to indicate that the user is scrolling beyond the range of the scrollable area.";
|
||||
+
|
||||
const char kUpdateHistoryEntryPointsInIncognitoName[] =
|
||||
"Update history entry points in Incognito.";
|
||||
const char kUpdateHistoryEntryPointsInIncognitoDescription[] =
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -564,6 +564,9 @@ extern const char kDiagnosticsAppDescription[];
|
||||
extern const char kDiagnosticsAppNavigationName[];
|
||||
extern const char kDiagnosticsAppNavigationDescription[];
|
||||
|
||||
+extern const char kDisablePullToRefreshEffectName[];
|
||||
+extern const char kDisablePullToRefreshEffectDescription[];
|
||||
+
|
||||
extern const char kDisableKeepaliveFetchName[];
|
||||
extern const char kDisableKeepaliveFetchDescription[];
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -2,83 +2,118 @@ From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sun, 27 Jun 2021 17:35:39 +0200
|
||||
Subject: Add flag to disable vibration
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
content/child/runtime_features.cc | 1 +
|
||||
.../about_flags_cc/Add-flag-to-disable-vibration.inc | 8 ++++++++
|
||||
.../content_features_cc/Add-flag-to-disable-vibration.inc | 4 ++++
|
||||
.../content_features_h/Add-flag-to-disable-vibration.inc | 1 +
|
||||
third_party/blink/public/platform/web_runtime_features.h | 1 +
|
||||
.../renderer/modules/vibration/vibration_controller.cc | 3 +++
|
||||
.../renderer/platform/exported/web_runtime_features.cc | 4 ++++
|
||||
.../renderer/platform/runtime_enabled_features.json5 | 4 ++++
|
||||
8 files changed, 26 insertions(+)
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-flag-to-disable-vibration.inc
|
||||
create mode 100644 cromite_flags/content/public/common/content_features_cc/Add-flag-to-disable-vibration.inc
|
||||
create mode 100644 cromite_flags/content/public/common/content_features_h/Add-flag-to-disable-vibration.inc
|
||||
chrome/browser/about_flags.cc | 4 ++++
|
||||
chrome/browser/flag_descriptions.cc | 3 +++
|
||||
chrome/browser/flag_descriptions.h | 3 +++
|
||||
content/child/runtime_features.cc | 1 +
|
||||
content/public/common/content_features.cc | 3 +++
|
||||
content/public/common/content_features.h | 2 ++
|
||||
third_party/blink/public/platform/web_runtime_features.h | 1 +
|
||||
.../blink/renderer/modules/vibration/vibration_controller.cc | 3 +++
|
||||
.../blink/renderer/platform/exported/web_runtime_features.cc | 4 ++++
|
||||
.../blink/renderer/platform/runtime_enabled_features.json5 | 4 ++++
|
||||
10 files changed, 28 insertions(+)
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -6207,6 +6207,10 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
FEATURE_VALUE_TYPE(features::kNewMacNotificationAPI)},
|
||||
#endif
|
||||
|
||||
+ {"enable-vibration", flag_descriptions::kEnableVibrationName,
|
||||
+ flag_descriptions::kEnableVibrationDescription, kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(features::kVibration)},
|
||||
+
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
{"exo-gamepad-vibration", flag_descriptions::kExoGamepadVibrationName,
|
||||
flag_descriptions::kExoGamepadVibrationDescription, kOsCrOS,
|
||||
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -5127,6 +5127,9 @@ const char kDefaultMeetWebAppDescription[] =
|
||||
"Enables the Meet web app to be installed by default.";
|
||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
|
||||
|
||||
+const char kEnableVibrationName[] = "Vibration";
|
||||
+const char kEnableVibrationDescription[] = "Enable vibration API; an user gesture will still be needed.";
|
||||
+
|
||||
#if defined(OS_CHROMEOS)
|
||||
const char kDeprecateLowUsageCodecsName[] = "Deprecates low usage media codecs";
|
||||
const char kDeprecateLowUsageCodecsDescription[] =
|
||||
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -2968,6 +2968,9 @@ extern const char kDefaultMeetWebAppName[];
|
||||
extern const char kDefaultMeetWebAppDescription[];
|
||||
#endif // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
|
||||
|
||||
+extern const char kEnableVibrationName[];
|
||||
+extern const char kEnableVibrationDescription[];
|
||||
+
|
||||
#if defined(OS_CHROMEOS)
|
||||
extern const char kDeprecateLowUsageCodecsName[];
|
||||
extern const char kDeprecateLowUsageCodecsDescription[];
|
||||
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
|
||||
--- a/content/child/runtime_features.cc
|
||||
+++ b/content/child/runtime_features.cc
|
||||
@@ -104,6 +104,7 @@ void SetRuntimeFeatureDefaultsForPlatform(
|
||||
if (command_line.HasSwitch(switches::kDisableMediaSessionAPI)) {
|
||||
@@ -102,6 +102,7 @@ void SetRuntimeFeatureDefaultsForPlatform(
|
||||
#if defined(OS_ANDROID)
|
||||
if (command_line.HasSwitch(switches::kDisableMediaSessionAPI))
|
||||
WebRuntimeFeatures::EnableMediaSession(false);
|
||||
}
|
||||
+ WebRuntimeFeatures::EnableVibration(base::FeatureList::IsEnabled(features::kVibration));
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-flag-to-disable-vibration.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-flag-to-disable-vibration.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/Add-flag-to-disable-vibration.inc
|
||||
@@ -0,0 +1,8 @@
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
+ {"enable-vibration",
|
||||
+ "Vibration",
|
||||
+ "Enable vibration API; an user gesture will still be needed.", kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(features::kVibration)},
|
||||
+
|
||||
+#endif
|
||||
diff --git a/cromite_flags/content/public/common/content_features_cc/Add-flag-to-disable-vibration.inc b/cromite_flags/content/public/common/content_features_cc/Add-flag-to-disable-vibration.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/content/public/common/content_features_cc/Add-flag-to-disable-vibration.inc
|
||||
@@ -0,0 +1,4 @@
|
||||
#if defined(OS_ANDROID)
|
||||
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
|
||||
--- a/content/public/common/content_features.cc
|
||||
+++ b/content/public/common/content_features.cc
|
||||
@@ -103,6 +103,9 @@ const base::Feature kBackForwardCacheSameSiteForBots{
|
||||
// BackForwardCacheMemoryControls is enabled only on Android to disable
|
||||
// BackForwardCache for lower memory devices due to memory limiations.
|
||||
#if defined(OS_ANDROID)
|
||||
+// Enables vibration; an user gesture will still be required if enabled.
|
||||
+CROMITE_FEATURE(kVibration,
|
||||
+ "VibrationEnabled",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
diff --git a/cromite_flags/content/public/common/content_features_h/Add-flag-to-disable-vibration.inc b/cromite_flags/content/public/common/content_features_h/Add-flag-to-disable-vibration.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/content/public/common/content_features_h/Add-flag-to-disable-vibration.inc
|
||||
@@ -0,0 +1 @@
|
||||
+CONTENT_EXPORT BASE_DECLARE_FEATURE(kVibration);
|
||||
+const base::Feature kVibration{"Vibration",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
const base::Feature kBackForwardCacheMemoryControls{
|
||||
"BackForwardCacheMemoryControls", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
#else
|
||||
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h
|
||||
--- a/content/public/common/content_features.h
|
||||
+++ b/content/public/common/content_features.h
|
||||
@@ -266,6 +266,8 @@ CONTENT_EXPORT extern const base::Feature kWarmUpNetworkProcess;
|
||||
CONTENT_EXPORT extern const base::Feature kWebNfc;
|
||||
#endif // defined(OS_ANDROID)
|
||||
|
||||
+CONTENT_EXPORT extern const base::Feature kVibration;
|
||||
+
|
||||
#if defined(OS_MAC)
|
||||
CONTENT_EXPORT extern const base::Feature kDeviceMonitorMac;
|
||||
CONTENT_EXPORT extern const base::Feature kIOSurfaceCapturer;
|
||||
diff --git a/third_party/blink/public/platform/web_runtime_features.h b/third_party/blink/public/platform/web_runtime_features.h
|
||||
--- a/third_party/blink/public/platform/web_runtime_features.h
|
||||
+++ b/third_party/blink/public/platform/web_runtime_features.h
|
||||
@@ -71,6 +71,7 @@ class BLINK_PLATFORM_EXPORT WebRuntimeFeatures : public WebRuntimeFeaturesBase {
|
||||
static void EnableFingerprintingCanvasImageDataNoise(bool);
|
||||
static void EnableFluentScrollbars(bool);
|
||||
static void EnableFluentOverlayScrollbars(bool);
|
||||
+ static void EnableVibration(bool);
|
||||
|
||||
WebRuntimeFeatures() = delete;
|
||||
};
|
||||
@@ -90,6 +90,7 @@ class WebRuntimeFeatures {
|
||||
BLINK_PLATFORM_EXPORT static void EnableBlockingFocusWithoutUserActivation(
|
||||
bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableCacheInlineScriptCode(bool);
|
||||
+ BLINK_PLATFORM_EXPORT static void EnableVibration(bool);
|
||||
BLINK_PLATFORM_EXPORT static void EnableCapabilityDelegationPaymentRequest(
|
||||
bool enable);
|
||||
BLINK_PLATFORM_EXPORT static void EnableClickPointerEvent(bool enable);
|
||||
diff --git a/third_party/blink/renderer/modules/vibration/vibration_controller.cc b/third_party/blink/renderer/modules/vibration/vibration_controller.cc
|
||||
--- a/third_party/blink/renderer/modules/vibration/vibration_controller.cc
|
||||
+++ b/third_party/blink/renderer/modules/vibration/vibration_controller.cc
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "third_party/blink/renderer/core/frame/local_frame.h"
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "third_party/blink/renderer/core/frame/navigator.h"
|
||||
#include "third_party/blink/renderer/core/page/page.h"
|
||||
#include "third_party/blink/renderer/platform/mojo/mojo_helper.h"
|
||||
+#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
|
||||
|
||||
// Maximum number of entries in a vibration pattern.
|
||||
const unsigned kVibrationPatternLengthMax = 99;
|
||||
@@ -108,6 +109,8 @@ bool VibrationController::vibrate(Navigator& navigator,
|
||||
@@ -149,6 +150,8 @@ bool VibrationController::vibrate(Navigator& navigator,
|
||||
// reference to |window| or |navigator| was retained in another window.
|
||||
if (!navigator.DomWindow())
|
||||
return false;
|
||||
@@ -90,29 +125,31 @@ diff --git a/third_party/blink/renderer/modules/vibration/vibration_controller.c
|
||||
diff --git a/third_party/blink/renderer/platform/exported/web_runtime_features.cc b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
|
||||
--- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc
|
||||
+++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
|
||||
@@ -52,6 +52,10 @@ void WebRuntimeFeatures::EnableTestOnlyFeatures(bool enable) {
|
||||
RuntimeEnabledFeatures::SetTestFeaturesEnabled(enable);
|
||||
@@ -182,6 +182,10 @@ void WebRuntimeFeatures::EnableScrollTopLeftInterop(bool enable) {
|
||||
RuntimeEnabledFeatures::SetScrollTopLeftInteropEnabled(enable);
|
||||
}
|
||||
|
||||
+void WebRuntimeFeatures::EnableVibration(bool enable) {
|
||||
+ RuntimeEnabledFeatures::SetVibrationEnabled(enable);
|
||||
+}
|
||||
+
|
||||
void WebRuntimeFeatures::EnableOriginTrialControlledFeatures(bool enable) {
|
||||
RuntimeEnabledFeatures::SetOriginTrialControlledFeaturesEnabled(enable);
|
||||
void WebRuntimeFeatures::EnableKeyboardAccessibleTooltip(bool enable) {
|
||||
RuntimeEnabledFeatures::SetKeyboardAccessibleTooltipEnabled(enable);
|
||||
}
|
||||
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
@@ -987,6 +987,10 @@
|
||||
{
|
||||
name: "CompositingDecisionAtAnimationPhaseBoundaries"
|
||||
@@ -1537,6 +1537,10 @@
|
||||
name: "OrientationEvent",
|
||||
status: {"Android": "stable"},
|
||||
},
|
||||
+ {
|
||||
+ name: "Vibration",
|
||||
+ status: "stable",
|
||||
+ },
|
||||
{
|
||||
name: "CompositionForegroundMarkers",
|
||||
status: {
|
||||
--
|
||||
name: "OriginIsolationHeader",
|
||||
status: "stable",
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,72 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Thu, 20 Oct 2022 09:34:48 +0000
|
||||
Subject: Add kill switch for unsupported clangd flags
|
||||
|
||||
Allows build with clangd by suppressing unsupported parameters
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
build/config/compiler/BUILD.gn | 14 +++++++++++---
|
||||
build_overrides/build.gni | 3 +++
|
||||
2 files changed, 14 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
|
||||
--- a/build/config/compiler/BUILD.gn
|
||||
+++ b/build/config/compiler/BUILD.gn
|
||||
@@ -640,7 +640,7 @@ config("compiler") {
|
||||
# Enable ELF CREL (see crbug.com/357878242) for all platforms that use ELF
|
||||
# (excluding toolchains that use an older version of LLVM).
|
||||
# TODO(crbug.com/376278218): This causes segfault on Linux ARM builds.
|
||||
- if (is_linux && use_lld && !llvm_android_mainline && current_cpu != "arm" &&
|
||||
+ if (is_linux && !skip_clangd_unsupported_options && use_lld && !llvm_android_mainline && current_cpu != "arm" &&
|
||||
default_toolchain != "//build/toolchain/cros:target") {
|
||||
cflags += [ "-Wa,--crel,--allow-experimental-crel" ]
|
||||
}
|
||||
@@ -1784,7 +1784,7 @@ config("clang_revision") {
|
||||
config("clang_warning_suppression") {
|
||||
# Some build configs use older versions of clang that don't support WSMs
|
||||
if (!is_nacl && default_toolchain != "//build/toolchain/cros:target" &&
|
||||
- !llvm_android_mainline && is_clang &&
|
||||
+ !llvm_android_mainline && is_clang && !skip_clangd_unsupported_options &&
|
||||
clang_warning_suppression_file != "") {
|
||||
from_build_root =
|
||||
rebase_path(clang_warning_suppression_file, root_build_dir)
|
||||
@@ -2146,7 +2146,6 @@ config("default_warnings") {
|
||||
# TODO(crbug.com/376641662): Fix and re-enable.
|
||||
"-Wno-nontrivial-memcall",
|
||||
]
|
||||
-
|
||||
cflags_cc += [
|
||||
# TODO(crbug.com/328490295): Fix and re-enable for C flags.
|
||||
"-Wenum-compare-conditional",
|
||||
@@ -2187,6 +2186,15 @@ config("default_warnings") {
|
||||
]
|
||||
}
|
||||
|
||||
+ if (skip_clangd_unsupported_options) {
|
||||
+ cflags -= [
|
||||
+ "-Wno-thread-safety-reference-return",
|
||||
+ "-Wno-nontrivial-memcall",
|
||||
+ ]
|
||||
+ cflags_cc -= [
|
||||
+ ]
|
||||
+ }
|
||||
+
|
||||
# Disable the GNU line marker warning when building a target with Icecc,
|
||||
# ccache, or both. This warning appears frequently when compiling
|
||||
# files that use GNU-style line markers with Clang and Icecc. It can
|
||||
diff --git a/build_overrides/build.gni b/build_overrides/build.gni
|
||||
--- a/build_overrides/build.gni
|
||||
+++ b/build_overrides/build.gni
|
||||
@@ -62,6 +62,9 @@ declare_args() {
|
||||
# to lack of toolchain support.
|
||||
gtest_enable_absl_printers = !is_nacl
|
||||
|
||||
+ # Allows clangd builds by suppressing unsupported parameters
|
||||
+ skip_clangd_unsupported_options = false
|
||||
+
|
||||
# Allow projects that wish to stay on C++17 to override Chromium's default.
|
||||
# TODO(crbug.com/40251117): evaluate removing this end of 2023
|
||||
use_cxx17 = false
|
||||
--
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -2,23 +2,21 @@ From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 13 Jul 2020 00:37:06 +0200
|
||||
Subject: Add menu item to view source
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../android/java/res/menu/custom_tabs_menu.xml | 3 +++
|
||||
chrome/android/java/res/menu/main_menu.xml | 3 +++
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 2 ++
|
||||
.../chrome/browser/app/ChromeActivity.java | 5 +++++
|
||||
.../appmenu/AppMenuPropertiesDelegateImpl.java | 17 +++++++++++++++++
|
||||
.../CustomTabAppMenuPropertiesDelegate.java | 2 +-
|
||||
.../TabbedAppMenuPropertiesDelegate.java | 6 +++---
|
||||
.../android/strings/android_chrome_strings.grd | 4 ++++
|
||||
8 files changed, 38 insertions(+), 4 deletions(-)
|
||||
chrome/android/java/res/menu/custom_tabs_menu.xml | 3 +++
|
||||
chrome/android/java/res/menu/main_menu.xml | 3 +++
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 2 ++
|
||||
.../chrome/browser/app/ChromeActivity.java | 5 +++++
|
||||
.../app/appmenu/AppMenuPropertiesDelegateImpl.java | 14 ++++++++++++++
|
||||
.../CustomTabAppMenuPropertiesDelegate.java | 1 +
|
||||
.../ui/android/strings/android_chrome_strings.grd | 4 ++++
|
||||
7 files changed, 32 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/custom_tabs_menu.xml b/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
--- a/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/custom_tabs_menu.xml
|
||||
@@ -73,6 +73,9 @@ found in the LICENSE file.
|
||||
<item android:id="@+id/universal_install"
|
||||
@@ -46,6 +46,9 @@
|
||||
<item android:id="@+id/add_to_homescreen_id"
|
||||
android:title="@string/menu_add_to_homescreen"
|
||||
android:orderInCategory="2" />
|
||||
+ <item android:id="@+id/view_source_id"
|
||||
@@ -30,8 +28,8 @@ diff --git a/chrome/android/java/res/menu/custom_tabs_menu.xml b/chrome/android/
|
||||
diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml
|
||||
--- a/chrome/android/java/res/menu/main_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/main_menu.xml
|
||||
@@ -131,6 +131,9 @@ found in the LICENSE file.
|
||||
<item android:id="@+id/universal_install"
|
||||
@@ -88,6 +88,9 @@
|
||||
<item android:id="@+id/add_to_homescreen_id"
|
||||
android:title="@string/menu_add_to_homescreen"
|
||||
android:icon="@drawable/ic_add_to_home_screen" />
|
||||
+ <item android:id="@+id/view_source_id"
|
||||
@@ -39,11 +37,11 @@ diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/re
|
||||
+ android:icon="@drawable/ic_drive_document_24dp" />
|
||||
<item android:id="@+id/open_webapk_id"
|
||||
android:title="@string/menu_open_webapk"
|
||||
android:icon="@drawable/ic_open_webapk" />
|
||||
android:icon="@drawable/ic_add_to_home_screen" />
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
@@ -3434,6 +3434,8 @@ public class ChromeTabbedActivity extends ChromeActivity {
|
||||
@@ -2043,6 +2043,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
|
||||
NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_DOWNLOADS_MANAGER);
|
||||
}
|
||||
RecordUserAction.record("MobileMenuDownloadManager");
|
||||
@@ -51,12 +49,12 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct
|
||||
+ currentTab.getWebContents().getNavigationController().loadUrl(new LoadUrlParams("view-source:"+currentTab.getUrl().getSpec()));
|
||||
} else if (id == R.id.open_recently_closed_tab) {
|
||||
TabModel currentModel = mTabModelSelector.getCurrentModel();
|
||||
if (!currentModel.isIncognito()) currentModel.openMostRecentlyClosedEntry();
|
||||
if (!currentModel.isIncognito()) currentModel.openMostRecentlyClosedTab();
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
@@ -2576,6 +2576,11 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
return doOpenWebApk(currentTab);
|
||||
@@ -2429,6 +2429,11 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
|
||||
return true;
|
||||
}
|
||||
|
||||
+ if (id == R.id.view_source_id) {
|
||||
@@ -70,7 +68,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
|
||||
@@ -864,6 +864,23 @@ public abstract class AppMenuPropertiesDelegateImpl implements AppMenuProperties
|
||||
@@ -355,6 +355,7 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
|
||||
isChromeScheme, isFileScheme, isContentScheme, isIncognito, url));
|
||||
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */);
|
||||
+ updateViewSourceMenuItem(menu, currentTab);
|
||||
|
||||
// Only display reader mode settings menu option if the current page is in reader mode.
|
||||
menu.findItem(R.id.reader_mode_prefs_id).setVisible(shouldShowReaderModePrefs(currentTab));
|
||||
@@ -845,6 +846,19 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,12 +89,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App
|
||||
+ protected void updateViewSourceMenuItem(
|
||||
+ Menu menu, Tab currentTab) {
|
||||
+ MenuItem viewSourceMenuItem = menu.findItem(R.id.view_source_id);
|
||||
+ boolean visible = false;
|
||||
+ if (currentTab != null) {
|
||||
+ String url = currentTab.getUrl().getSpec();
|
||||
+ visible = !url.isEmpty() && !url.startsWith("view-source:");
|
||||
+ }
|
||||
+ viewSourceMenuItem.setVisible(visible);
|
||||
+ String url = currentTab.getUrl().getSpec();
|
||||
+ viewSourceMenuItem.setVisible(!url.isEmpty() && !url.startsWith("view-source:"));
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
@@ -97,57 +99,28 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
|
||||
@@ -331,7 +331,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
|
||||
// --- Request Desktop Site ---
|
||||
updateRequestDesktopSiteMenuItem(
|
||||
menu, currentTab, requestDesktopSiteVisible, isNativePage);
|
||||
-
|
||||
@@ -214,6 +214,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
|
||||
}
|
||||
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, requestDesktopSiteVisible);
|
||||
+ updateViewSourceMenuItem(menu, currentTab);
|
||||
// --- Translate ---
|
||||
prepareTranslateMenuItem(menu, currentTab);
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedAppMenuPropertiesDelegate.java
|
||||
@@ -173,7 +173,7 @@ public class TabbedAppMenuPropertiesDelegate extends AppMenuPropertiesDelegateIm
|
||||
if (menuGroup == MenuGroup.PAGE_MENU) {
|
||||
preparePageMenu(menu, currentTab, handler, isIncognito);
|
||||
prepareAddToHomescreenMenuItem(menu, currentTab, addToHomeScreenVisible);
|
||||
}
|
||||
- prepareCommonMenuItems(menu, menuGroup, isIncognito);
|
||||
+ prepareCommonMenuItems(menu, menuGroup, isIncognito, currentTab);
|
||||
}
|
||||
|
||||
private void setMenuGroupVisibility(@MenuGroup int menuGroup, Menu menu) {
|
||||
@@ -338,7 +338,7 @@ public class TabbedAppMenuPropertiesDelegate extends AppMenuPropertiesDelegateIm
|
||||
isNativePage, isFileScheme, isContentScheme, isIncognito, url));
|
||||
|
||||
updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */, isNativePage);
|
||||
-
|
||||
+ updateViewSourceMenuItem(menu, currentTab);
|
||||
updateAutoDarkMenuItem(menu, currentTab, isNativePage);
|
||||
|
||||
// Only display reader mode settings menu option if the current page is in reader mode.
|
||||
@@ -371,7 +371,7 @@ public class TabbedAppMenuPropertiesDelegate extends AppMenuPropertiesDelegateIm
|
||||
&& UrlUtilities.isNtpUrl(currentTab.getUrl());
|
||||
}
|
||||
|
||||
- private void prepareCommonMenuItems(Menu menu, @MenuGroup int menuGroup, boolean isIncognito) {
|
||||
+ private void prepareCommonMenuItems(Menu menu, @MenuGroup int menuGroup, boolean isIncognito, Tab currentTab) {
|
||||
boolean always_incognito = AlwaysIncognitoLinkInterceptor.isAlwaysIncognito();
|
||||
if (always_incognito) {
|
||||
final MenuItem newTabOption = menu.findItem(R.id.new_tab_menu_id);
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -321,6 +321,10 @@ CHAR_LIMIT guidelines:
|
||||
Collaboration
|
||||
@@ -299,6 +299,10 @@ CHAR_LIMIT guidelines:
|
||||
Sign-in verifications
|
||||
</message>
|
||||
|
||||
+ <message name="IDS_VIEW_SOURCE" desc="Title for the menu command to view the source of the current page. [CHAR-LIMIT=40]">
|
||||
+ View source
|
||||
+ </message>
|
||||
+
|
||||
<!-- Sign-in, sync and personalization preferences -->
|
||||
<message name="IDS_PREFS_SECTION_ACCOUNT_AND_GOOGLE_SERVICES" desc="Title for the group of account-related entries and google services in Settings. [CHAR_LIMIT=32]">
|
||||
You and Google
|
||||
--
|
||||
<message name="IDS_UNSUPPORTED" desc="Message displayed to the user when an attempted action is not supported.">
|
||||
Unsupported
|
||||
</message>
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -1,217 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 21 Aug 2023 14:03:25 +0000
|
||||
Subject: Add option to disable snapshots
|
||||
|
||||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
---
|
||||
.../tab_management/TabGridViewBinder.java | 8 +++-
|
||||
.../tasks/tab_management/TabProperties.java | 5 +++
|
||||
.../java/res/xml/privacy_preferences.xml | 5 +++
|
||||
.../chrome/browser/app/ChromeActivity.java | 4 +-
|
||||
.../privacy/settings/PrivacySettings.java | 44 ++++++++++++++++++-
|
||||
.../strings/android_chrome_strings.grd | 8 ++++
|
||||
6 files changed, 71 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridViewBinder.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridViewBinder.java
|
||||
--- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridViewBinder.java
|
||||
+++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridViewBinder.java
|
||||
@@ -457,7 +457,12 @@ class TabGridViewBinder {
|
||||
if (result != null) {
|
||||
TabUtils.setDrawableAndUpdateImageMatrix(thumbnail, result, thumbnailSize);
|
||||
} else {
|
||||
- thumbnail.setImageDrawable(null);
|
||||
+ TabListFaviconProvider.TabFavicon tabFavicon = model.get(TabProperties.FAVICON);
|
||||
+ if (tabFavicon != null) {
|
||||
+ thumbnail.setScaleType(ImageView.ScaleType.CENTER);
|
||||
+ thumbnail.setImageDrawable(
|
||||
+ isSelected ? tabFavicon.getSelectedDrawable() : tabFavicon.getDefaultDrawable());
|
||||
+ }
|
||||
}
|
||||
};
|
||||
if (sThumbnailFetcherForTesting != null) {
|
||||
@@ -498,6 +503,7 @@ class TabGridViewBinder {
|
||||
*/
|
||||
private static void setFavicon(
|
||||
ImageView faviconView, PropertyModel model, TabListFaviconProvider.TabFavicon favicon) {
|
||||
+ model.set(TabProperties.FAVICON, favicon);
|
||||
if (favicon == null) {
|
||||
faviconView.setImageDrawable(null);
|
||||
return;
|
||||
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabProperties.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabProperties.java
|
||||
--- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabProperties.java
|
||||
+++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabProperties.java
|
||||
@@ -85,6 +85,9 @@ public class TabProperties {
|
||||
public static final WritableBooleanPropertyKey FAVICON_FETCHED =
|
||||
new WritableBooleanPropertyKey();
|
||||
|
||||
+ public static final WritableObjectPropertyKey<TabListFaviconProvider.TabFavicon> FAVICON =
|
||||
+ new WritableObjectPropertyKey<>();
|
||||
+
|
||||
/** Property for lazily fetching favicons when required by an item in a UI. */
|
||||
public static final WritableObjectPropertyKey<TabListFaviconProvider.TabFaviconFetcher>
|
||||
FAVICON_FETCHER = new WritableObjectPropertyKey<>();
|
||||
@@ -174,6 +177,7 @@ public class TabProperties {
|
||||
CARD_TYPE,
|
||||
CONTENT_DESCRIPTION_TEXT_RESOLVER,
|
||||
ACTION_BUTTON_DESCRIPTION_TEXT_RESOLVER,
|
||||
+ FAVICON,
|
||||
QUICK_DELETE_ANIMATION_STATUS,
|
||||
TAB_GROUP_COLOR_VIEW_PROVIDER,
|
||||
VISIBILITY,
|
||||
@@ -210,6 +214,7 @@ public class TabProperties {
|
||||
TAB_ACTION_BUTTON_DATA,
|
||||
FAVICON_FETCHED,
|
||||
FAVICON_FETCHER,
|
||||
+ FAVICON,
|
||||
IS_SELECTED,
|
||||
TITLE,
|
||||
HAS_NOTIFICATION_BUBBLE
|
||||
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
@@ -73,6 +73,11 @@ found in the LICENSE file.
|
||||
android:title="@string/open_external_links_incognito_title"
|
||||
android:summary="@string/open_external_links_incognito_summary"
|
||||
android:defaultValue="false" />
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
+ android:key="tabgrid_use_icons"
|
||||
+ android:title="@string/tabgrid_use_icons_title"
|
||||
+ android:summary="@string/tabgrid_use_icons_summary"
|
||||
+ android:defaultValue="false" />
|
||||
<Preference
|
||||
android:key="preload_pages"
|
||||
android:title="@string/preload_pages_title"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
@@ -145,6 +145,7 @@ import org.chromium.chrome.browser.preferences.ChromeSharedPreferences;
|
||||
import org.chromium.chrome.browser.preferences.Pref;
|
||||
import org.chromium.chrome.browser.price_tracking.PriceDropNotificationManagerFactory;
|
||||
import org.chromium.chrome.browser.printing.TabPrinter;
|
||||
+import org.chromium.chrome.browser.privacy.settings.PrivacySettings;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
import org.chromium.chrome.browser.profiles.ProfileManager;
|
||||
import org.chromium.chrome.browser.profiles.ProfileProvider;
|
||||
@@ -637,7 +638,8 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
new TabContentManager(
|
||||
this,
|
||||
mBrowserControlsManagerSupplier.get(),
|
||||
- !TabUiFeatureUtilities.shouldUseListMode(),
|
||||
+ !TabUiFeatureUtilities.shouldUseListMode()
|
||||
+ && !ContextUtils.getAppSharedPreferences().getBoolean(PrivacySettings.PREF_TABGRID_USE_ICONS, false),
|
||||
tabModelSelector != null ? tabModelSelector::getTabById : null,
|
||||
TabWindowManagerSingleton.getInstance()));
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
@@ -28,6 +28,7 @@ import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.IntentUtils;
|
||||
import org.chromium.base.metrics.RecordHistogram;
|
||||
import org.chromium.base.metrics.RecordUserAction;
|
||||
+import org.chromium.base.supplier.Supplier;
|
||||
import org.chromium.base.supplier.ObservableSupplier;
|
||||
import org.chromium.base.supplier.ObservableSupplierImpl;
|
||||
import org.chromium.build.annotations.Nullable;
|
||||
@@ -98,12 +99,26 @@ import org.chromium.chrome.browser.preferences.ChromeSharedPreferences;
|
||||
import org.chromium.components.browser_ui.settings.ChromeSwitchPreference;
|
||||
import org.chromium.components.browser_ui.settings.ManagedPreferenceDelegate;
|
||||
|
||||
+import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
|
||||
+import org.chromium.chrome.browser.ui.messages.snackbar.INeedSnackbarManager;
|
||||
+import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar;
|
||||
+import org.chromium.chrome.browser.lifetime.ApplicationLifetime;
|
||||
+
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/** Fragment to keep track of the all the privacy related preferences. */
|
||||
public class PrivacySettings extends ChromeBaseSettingsFragment
|
||||
- implements Preference.OnPreferenceChangeListener {
|
||||
+ implements Preference.OnPreferenceChangeListener, INeedSnackbarManager {
|
||||
+
|
||||
+ private Supplier<SnackbarManager> mSnackbarManagerSupplier;
|
||||
+ private Snackbar mSnackbar;
|
||||
+
|
||||
+ @Override
|
||||
+ public void setSnackbarManagerSupplier(Supplier<SnackbarManager> manager) {
|
||||
+ mSnackbarManagerSupplier = manager;
|
||||
+ }
|
||||
+
|
||||
private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
|
||||
private static final String PREF_PRELOAD_PAGES = "preload_pages";
|
||||
private static final String PREF_HTTPS_FIRST_MODE = "https_first_mode";
|
||||
@@ -206,6 +221,21 @@ public class PrivacySettings extends ChromeBaseSettingsFragment
|
||||
}
|
||||
}
|
||||
|
||||
+ mSnackbar = Snackbar.make(getActivity().getString(R.string.ui_relaunch_notice),
|
||||
+ new SnackbarManager.SnackbarController() {
|
||||
+ @Override
|
||||
+ public void onDismissNoAction(Object actionData) { }
|
||||
+
|
||||
+ @Override
|
||||
+ public void onAction(Object actionData) {
|
||||
+ ApplicationLifetime.terminate(true);
|
||||
+ }
|
||||
+ }, Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_UNKNOWN)
|
||||
+ .setSingleLine(false)
|
||||
+ .setAction(getActivity().getString(R.string.relaunch),
|
||||
+ /*actionData*/null)
|
||||
+ .setDuration(/*durationMs*/70000);
|
||||
+
|
||||
Preference privacyGuidePreference = findPreference(PREF_PRIVACY_GUIDE);
|
||||
// Record the launch of PG from the S&P link-row entry point
|
||||
privacyGuidePreference.setOnPreferenceClickListener(
|
||||
@@ -432,6 +462,7 @@ public class PrivacySettings extends ChromeBaseSettingsFragment
|
||||
|
||||
public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
|
||||
public static final String PREF_OPEN_EXTERNAL_LINKS_INCOGNITO = "open_external_links_incognito";
|
||||
+ public static final String PREF_TABGRID_USE_ICONS = "tabgrid_use_icons";
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
@@ -478,6 +509,13 @@ public class PrivacySettings extends ChromeBaseSettingsFragment
|
||||
SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
|
||||
sharedPreferencesEditor.putBoolean(PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, (boolean)newValue);
|
||||
sharedPreferencesEditor.apply();
|
||||
+ } else if (PREF_TABGRID_USE_ICONS.equals(key)) {
|
||||
+ SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
|
||||
+ sharedPreferencesEditor.putBoolean(PREF_TABGRID_USE_ICONS, (boolean)newValue);
|
||||
+ sharedPreferencesEditor.apply();
|
||||
+ if (!mSnackbarManagerSupplier.get().isShowing()) {
|
||||
+ mSnackbarManagerSupplier.get().showSnackbar(mSnackbar);
|
||||
+ }
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -528,6 +566,10 @@ public class PrivacySettings extends ChromeBaseSettingsFragment
|
||||
: R.string.text_off);
|
||||
}
|
||||
|
||||
+ Preference tabGridUseIcons =
|
||||
+ (ChromeSwitchPreference) findPreference(PREF_TABGRID_USE_ICONS);
|
||||
+ tabGridUseIcons.setOnPreferenceChangeListener(this);
|
||||
+
|
||||
Preference refererPolicyPref = findPreference(PREF_REFERER_POLICY);
|
||||
refererPolicyPref.setSummary(
|
||||
RefererSettingsFragment.getRefererSummaryString(getContext()));
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -6198,6 +6198,14 @@ To change this setting, <ph name="BEGIN_LINK">BEGIN_LINK</ph>delete the Chrome d
|
||||
Your <ph name="FQDN">%1$s<ex>www.amazon.com</ex></ph> timer ran out. It'll start again tomorrow.
|
||||
</message>
|
||||
|
||||
+ <!-- Tab Broup Disable Thumbnail -->
|
||||
+ <message name="IDS_TABGRID_USE_ICONS_TITLE" desc="Text for 'Use icons in the tab grid' settings-privacy option.">
|
||||
+ Use only icons in the tab grid
|
||||
+ </message>
|
||||
+ <message name="IDS_TABGRID_USE_ICONS_SUMMARY" desc="Summary text for 'Use icons in the tab grid' settings-privacy option.">
|
||||
+ Disable saving snapshots to disk (even for incognito sessions)
|
||||
+ </message>
|
||||
+
|
||||
<!-- Tab Group Tab Switcher strings -->
|
||||
<message name="IDS_TAB_MANAGEMENT_MODULE_TITLE" desc="Text shown when the Tab Management module is referenced in install start, success, failure UI (e.g. in IDS_MODULE_INSTALL_START_TEXT, which will expand to 'Installing Tab management for Chrome…').">
|
||||
Tab management
|
||||
--
|
||||
@@ -1,749 +1,186 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Sun, 5 May 2024 09:34:39 +0000
|
||||
From: Wengling Chen <feiyu2817@gmail.com>
|
||||
Date: Mon, 1 Feb 2021 19:18:55 +0200
|
||||
Subject: Add option to force tablet UI
|
||||
|
||||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
---
|
||||
.../layout/custom_tabs_control_container.xml | 2 +-
|
||||
.../java/res/layout/recent_tabs_page.xml | 2 +-
|
||||
.../java/res/values-sw600dp/dimens.xml | 4 ++--
|
||||
chrome/android/java/res/values/dimens.xml | 6 +++++-
|
||||
.../browser/ChromeBaseAppCompatActivity.java | 3 +++
|
||||
.../chrome/browser/WarmupManager.java | 5 ++++-
|
||||
.../ChromeAccessibilitySettingsDelegate.java | 19 ++++++++++++++++++
|
||||
.../chrome/browser/app/ChromeActivity.java | 4 +++-
|
||||
.../overlays/strip/StripLayoutHelper.java | 10 ++++++++--
|
||||
.../strip/StripLayoutHelperManager.java | 6 +++++-
|
||||
.../scene_layer/TabStripSceneLayer.java | 8 ++++++++
|
||||
.../init/ChromeBrowserInitializer.java | 2 ++
|
||||
.../tabbed_mode/TabbedRootUiCoordinator.java | 4 +++-
|
||||
.../chrome/browser/ui/RootUiCoordinator.java | 6 +++++-
|
||||
chrome/browser/preferences/BUILD.gn | 1 +
|
||||
.../preferences/ChromePreferenceKeys.java | 1 +
|
||||
.../preferences/ChromeSharedPreferences.java | 12 +++++++++++
|
||||
.../LegacyChromePreferenceKeys.java | 1 +
|
||||
.../AppHeaderCoordinator.java | 2 ++
|
||||
.../omnibox/LocationBarCoordinator.java | 2 +-
|
||||
.../strings/android_chrome_strings.grd | 7 +++++++
|
||||
.../java/res/layout/control_container.xml | 8 ++++----
|
||||
.../java/res/layout/toolbar_tablet.xml | 2 +-
|
||||
.../java/res/values-sw600dp/dimens.xml | 5 +++--
|
||||
.../toolbar/java/res/values/dimens.xml | 6 ++++--
|
||||
.../browser/toolbar/ControlContainer.java | 2 +-
|
||||
.../toolbar/top/ToolbarControlContainer.java | 20 ++++++++++++++++++-
|
||||
.../browser/toolbar/top/ToolbarLayout.java | 5 ++++-
|
||||
.../tab_strip/HeightTransitionHandler.java | 2 ++
|
||||
.../TabStripTransitionCoordinator.java | 6 +++++-
|
||||
.../res/xml/accessibility_preferences.xml | 5 +++++
|
||||
.../accessibility/AccessibilitySettings.java | 13 ++++++++++++
|
||||
.../AccessibilitySettingsDelegate.java | 2 ++
|
||||
.../chromium/ui/base/DeviceFormFactor.java | 14 +++++++++++++
|
||||
34 files changed, 171 insertions(+), 26 deletions(-)
|
||||
.../android/java/res/xml/accessibility_preferences.xml | 5 +++++
|
||||
.../accessibility/settings/AccessibilitySettings.java | 10 ++++++++++
|
||||
.../browser/preferences/ChromePreferenceKeys.java | 1 +
|
||||
.../preferences/LegacyChromePreferenceKeys.java | 1 +
|
||||
.../chrome/browser/omnibox/LocationBarCoordinator.java | 2 +-
|
||||
.../ui/android/strings/android_chrome_strings.grd | 6 ++++++
|
||||
.../browser/toolbar/top/ToolbarControlContainer.java | 2 +-
|
||||
components/BUILD.gn | 4 ++--
|
||||
ui/android/BUILD.gn | 2 ++
|
||||
.../src/org/chromium/ui/base/DeviceFormFactor.java | 5 +++++
|
||||
10 files changed, 34 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/layout/custom_tabs_control_container.xml b/chrome/android/java/res/layout/custom_tabs_control_container.xml
|
||||
--- a/chrome/android/java/res/layout/custom_tabs_control_container.xml
|
||||
+++ b/chrome/android/java/res/layout/custom_tabs_control_container.xml
|
||||
@@ -32,7 +32,7 @@ found in the LICENSE file.
|
||||
android:id="@+id/find_toolbar_stub"
|
||||
android:inflatedId="@+id/find_toolbar"
|
||||
android:visibility="gone"
|
||||
- android:layout_marginTop="@dimen/tab_strip_height"
|
||||
+ android:layout_marginTop="@dimen/tab_strip_height_cromite"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/custom_tabs_control_container_height"
|
||||
android:layout="@layout/find_toolbar" />
|
||||
diff --git a/chrome/android/java/res/layout/recent_tabs_page.xml b/chrome/android/java/res/layout/recent_tabs_page.xml
|
||||
--- a/chrome/android/java/res/layout/recent_tabs_page.xml
|
||||
+++ b/chrome/android/java/res/layout/recent_tabs_page.xml
|
||||
@@ -11,7 +11,7 @@ found in the LICENSE file.
|
||||
android:id="@+id/history_navigation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
- android:paddingTop="@dimen/tab_strip_height" >
|
||||
+ android:paddingTop="@dimen/tab_strip_height_cromite" >
|
||||
diff --git a/chrome/android/java/res/xml/accessibility_preferences.xml b/chrome/android/java/res/xml/accessibility_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/accessibility_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/accessibility_preferences.xml
|
||||
@@ -29,6 +29,11 @@
|
||||
android:key="captions"
|
||||
android:title="@string/accessibility_captions_title"/>
|
||||
|
||||
<org.chromium.chrome.browser.ntp.NativePageRootFrameLayout
|
||||
android:id="@+id/recent_tabs_root"
|
||||
diff --git a/chrome/android/java/res/values-sw600dp/dimens.xml b/chrome/android/java/res/values-sw600dp/dimens.xml
|
||||
--- a/chrome/android/java/res/values-sw600dp/dimens.xml
|
||||
+++ b/chrome/android/java/res/values-sw600dp/dimens.xml
|
||||
@@ -14,8 +14,8 @@ found in the LICENSE file.
|
||||
<dimen name="compositor_tab_title_text_size">14sp</dimen>
|
||||
|
||||
<!-- Full Screen Dimensions -->
|
||||
- <dimen name="control_container_height">96dp</dimen>
|
||||
- <dimen name="custom_tabs_control_container_height">64dp</dimen>
|
||||
+ <dimen name="control_container_height_cromite">96dp</dimen>
|
||||
+ <dimen name="control_container_height_tabletui">96dp</dimen>
|
||||
|
||||
<!-- NTP dimensions -->
|
||||
<dimen name="ntp_search_box_transition_start_offset">60dp</dimen>
|
||||
diff --git a/chrome/android/java/res/values/dimens.xml b/chrome/android/java/res/values/dimens.xml
|
||||
--- a/chrome/android/java/res/values/dimens.xml
|
||||
+++ b/chrome/android/java/res/values/dimens.xml
|
||||
@@ -117,9 +117,13 @@ found in the LICENSE file.
|
||||
<dimen name="tab_modal_scrim_vertical_margin">16dp</dimen>
|
||||
|
||||
<!-- Should match toolbar_height_no_shadow -->
|
||||
- <dimen name="control_container_height">@dimen/default_action_bar_height</dimen>
|
||||
+ <dimen name="control_container_height_cromite">@dimen/default_action_bar_height</dimen>
|
||||
+ <dimen name="control_container_height_tabletui">96dp</dimen>
|
||||
<dimen name="custom_tabs_control_container_height">@dimen/default_action_bar_height</dimen>
|
||||
|
||||
+ <!-- The combined height of the tab strip and toolbar. -->
|
||||
+ <dimen name="tab_strip_and_toolbar_height_cromite">56dp</dimen>
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeBaseCheckBoxPreference
|
||||
+ android:key="force_tablet_ui"
|
||||
+ android:summary="@string/force_tablet_ui_summary"
|
||||
+ android:title="@string/force_tablet_ui_title" />
|
||||
+
|
||||
<!-- Find in Page dimensions -->
|
||||
<dimen name="find_in_page_popup_width">375dp</dimen>
|
||||
<dimen name="find_in_page_popup_height">64dp</dimen>
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeBaseAppCompatActivity.java
|
||||
@@ -58,6 +58,7 @@ import org.chromium.chrome.browser.metrics.UmaSessionStats;
|
||||
import org.chromium.chrome.browser.night_mode.GlobalNightModeStateProviderHolder;
|
||||
import org.chromium.chrome.browser.night_mode.NightModeStateProvider;
|
||||
import org.chromium.chrome.browser.night_mode.NightModeUtils;
|
||||
+import org.chromium.chrome.browser.preferences.ChromeSharedPreferences;
|
||||
import org.chromium.chrome.browser.ui.edge_to_edge.EdgeToEdgeUtils;
|
||||
import org.chromium.components.browser_ui.edge_to_edge.EdgeToEdgeManager;
|
||||
import org.chromium.components.browser_ui.edge_to_edge.EdgeToEdgeStateProvider;
|
||||
@@ -133,6 +134,8 @@ public class ChromeBaseAppCompatActivity extends AppCompatActivity
|
||||
protected void attachBaseContext(Context newBase) {
|
||||
super.attachBaseContext(newBase);
|
||||
<Preference
|
||||
android:fragment="org.chromium.chrome.browser.image_descriptions.ImageDescriptionsSettings"
|
||||
android:key="image_descriptions"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/AccessibilitySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/AccessibilitySettings.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/AccessibilitySettings.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/AccessibilitySettings.java
|
||||
@@ -37,6 +37,7 @@ public class AccessibilitySettings
|
||||
static final String PREF_IMAGE_DESCRIPTIONS = "image_descriptions";
|
||||
static final String PREF_ACCESSIBILITY_PAGE_ZOOM = "accessibility_page_zoom";
|
||||
|
||||
+ ChromeSharedPreferences.warmUp();
|
||||
+ static final String PREF_FORCE_TABLET_UI = "force_tablet_ui";
|
||||
private TextScalePreference mTextScalePref;
|
||||
private ChromeBaseCheckBoxPreference mForceEnableZoomPref;
|
||||
private boolean mRecordFontSizeChangeOnStop;
|
||||
@@ -82,6 +83,12 @@ public class AccessibilitySettings
|
||||
.getBoolean(Pref.READER_FOR_ACCESSIBILITY));
|
||||
readerForAccessibilityPref.setOnPreferenceChangeListener(this);
|
||||
|
||||
+ ChromeBaseCheckBoxPreference forceTabletUiPref =
|
||||
+ (ChromeBaseCheckBoxPreference) findPreference(PREF_FORCE_TABLET_UI);
|
||||
+ forceTabletUiPref.setChecked(SharedPreferencesManager.getInstance().readBoolean(
|
||||
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, false));
|
||||
+ forceTabletUiPref.setOnPreferenceChangeListener(this);
|
||||
+
|
||||
// Make sure the "chrome" split is loaded before checking if ClassLoaders are equal.
|
||||
SplitChromeApplication.finishPreload(CHROME_SPLIT_NAME);
|
||||
ClassLoader chromeModuleClassLoader = ChromeBaseAppCompatActivity.class.getClassLoader();
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java b/chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/WarmupManager.java
|
||||
@@ -66,6 +66,7 @@ import org.chromium.content_public.browser.WebContents;
|
||||
import org.chromium.content_public.browser.WebContentsObserver;
|
||||
import org.chromium.net.NetId;
|
||||
import org.chromium.ui.LayoutInflaterUtils;
|
||||
+import org.chromium.ui.base.DeviceFormFactor;
|
||||
import org.chromium.ui.base.WindowAndroid;
|
||||
import org.chromium.ui.display.DisplayUtil;
|
||||
import org.chromium.url.GURL;
|
||||
@@ -481,7 +482,9 @@ public class WarmupManager {
|
||||
ControlContainer controlContainer = mainView.findViewById(R.id.control_container);
|
||||
|
||||
if (toolbarId != ActivityUtils.NO_RESOURCE_ID && controlContainer != null) {
|
||||
- controlContainer.initWithToolbar(toolbarId);
|
||||
+ controlContainer.initWithToolbar(toolbarId,
|
||||
+ DeviceFormFactor.isForceTabletUI()
|
||||
+ ? R.dimen.control_container_height_tabletui : 0);
|
||||
}
|
||||
return mainView;
|
||||
} catch (InflateException e) {
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java
|
||||
@@ -65,6 +65,25 @@ public class ChromeAccessibilitySettingsDelegate implements AccessibilitySetting
|
||||
}
|
||||
}
|
||||
|
||||
+ private static class ForceTabletUIDelegate implements BooleanPreferenceDelegate {
|
||||
+ @Override
|
||||
+ public boolean getValue() {
|
||||
+ return ChromeSharedPreferences.getInstance().readBoolean(
|
||||
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, false);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setValue(boolean value) {
|
||||
+ ChromeSharedPreferences.getInstance().writeBoolean(
|
||||
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, value);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public BooleanPreferenceDelegate getForceTabletUIDelegate() {
|
||||
+ return new ForceTabletUIDelegate();
|
||||
+ }
|
||||
+
|
||||
private final Profile mProfile;
|
||||
|
||||
/**
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
|
||||
@@ -787,7 +787,9 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
||||
// Inflate the correct toolbar layout for the device.
|
||||
int toolbarLayoutId = getToolbarLayoutId();
|
||||
if (toolbarLayoutId != ActivityUtils.NO_RESOURCE_ID && controlContainer != null) {
|
||||
- controlContainer.initWithToolbar(toolbarLayoutId);
|
||||
+ controlContainer.initWithToolbar(toolbarLayoutId,
|
||||
+ DeviceFormFactor.isForceTabletUI()
|
||||
+ ? R.dimen.control_container_height_tabletui : 0);
|
||||
}
|
||||
onInitialLayoutInflationComplete();
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java
|
||||
@@ -120,6 +120,7 @@ import org.chromium.components.tab_group_sync.TabGroupSyncService;
|
||||
import org.chromium.components.tab_group_sync.TriggerSource;
|
||||
import org.chromium.components.tab_groups.TabGroupColorId;
|
||||
import org.chromium.ui.accessibility.AccessibilityState;
|
||||
+import org.chromium.ui.base.DeviceFormFactor;
|
||||
import org.chromium.ui.base.LocalizationUtils;
|
||||
import org.chromium.ui.base.WindowAndroid;
|
||||
import org.chromium.ui.util.ColorUtils;
|
||||
@@ -4472,8 +4473,13 @@ public class StripLayoutHelper
|
||||
mCloseButtonMenu.setAnchorView(tabView);
|
||||
// 3. Set the vertical offset to align the close button menu with bottom of the tab strip
|
||||
int tabHeight = mManagerHost.getHeight();
|
||||
- int verticalOffset =
|
||||
- -(tabHeight - (int) mContext.getResources().getDimension(R.dimen.tab_strip_height));
|
||||
+ int tab_strip_height =
|
||||
+ (int) mContext.getResources().getDimension(R.dimen.tab_strip_height_cromite);
|
||||
+ if (DeviceFormFactor.isForceTabletUI()) {
|
||||
+ tab_strip_height =
|
||||
+ (int) mContext.getResources().getDimension(R.dimen.tab_strip_height_tabletui);
|
||||
+ }
|
||||
+ int verticalOffset = -(tabHeight - tab_strip_height);
|
||||
mCloseButtonMenu.setVerticalOffset(verticalOffset);
|
||||
|
||||
// 4. Set the horizontal offset to align the close button menu with the right side of the
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelperManager.java
|
||||
@@ -98,6 +98,7 @@ import org.chromium.components.browser_ui.desktop_windowing.DesktopWindowStateMa
|
||||
import org.chromium.components.browser_ui.styles.SemanticColorUtils;
|
||||
import org.chromium.components.browser_ui.widget.scrim.ScrimProperties;
|
||||
import org.chromium.content_public.browser.LoadUrlParams;
|
||||
+import org.chromium.ui.base.DeviceFormFactor;
|
||||
import org.chromium.ui.base.LocalizationUtils;
|
||||
import org.chromium.ui.base.PageTransition;
|
||||
import org.chromium.ui.base.WindowAndroid;
|
||||
@@ -467,7 +468,10 @@ public class StripLayoutHelperManager
|
||||
mIsLayoutOptimizationsEnabled =
|
||||
ToolbarFeatures.isTabStripWindowLayoutOptimizationEnabled(
|
||||
/* isTablet= */ true, DisplayUtil.isContextInDefaultDisplay(mContext));
|
||||
- mScrollableStripHeight = res.getDimension(R.dimen.tab_strip_height) / mDensity;
|
||||
+ mScrollableStripHeight =
|
||||
+ (DeviceFormFactor.isForceTabletUI()
|
||||
+ ? res.getDimension(R.dimen.tab_strip_height_tabletui)
|
||||
+ : res.getDimension(R.dimen.tab_strip_height_cromite)) / mDensity;
|
||||
mHeight =
|
||||
mIsLayoutOptimizationsEnabled
|
||||
? toolbarManager.getTabStripHeightSupplier().get() / mDensity
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/scene_layer/TabStripSceneLayer.java
|
||||
@@ -111,6 +111,14 @@ public class TabStripSceneLayer extends SceneOverlayLayer {
|
||||
if (mNativePtr == 0) return;
|
||||
final boolean visible = yOffset > -layoutHelper.getHeight();
|
||||
|
||||
+ if (DeviceFormFactor.isNonMultiDisplayContextOnTablet(ContextUtils.getApplicationContext())) {
|
||||
+ TintedCompositorButton newTabButton = layoutHelper.getNewTabButton();
|
||||
+ if (newTabButton.isVisible()) {
|
||||
+ rightPaddingDp += newTabButton.getWidth() + layoutHelper.getNewTabBtnVisualOffset()
|
||||
+ + StripLayoutGroupTitle.REORDER_BACKGROUND_PADDING_END;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
// This will hide the tab strips if necessary.
|
||||
TabStripSceneLayerJni.get()
|
||||
.beginBuildingFrame(mNativePtr, TabStripSceneLayer.this, visible);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java
|
||||
@@ -17,6 +17,7 @@ import org.chromium.base.library_loader.LibraryProcessType;
|
||||
import org.chromium.base.task.ChainedTasks;
|
||||
import org.chromium.base.task.TaskTraits;
|
||||
import org.chromium.chrome.browser.flags.ChromeSwitches;
|
||||
+import org.chromium.chrome.browser.preferences.ChromeSharedPreferences;
|
||||
import org.chromium.chrome.browser.profiles.ProfileManager;
|
||||
import org.chromium.chrome.browser.signin.SigninCheckerProvider;
|
||||
import org.chromium.components.background_task_scheduler.BackgroundTaskSchedulerFactory;
|
||||
@@ -107,6 +108,7 @@ public class ChromeBrowserInitializer {
|
||||
public void handlePreNativeStartupAndLoadLibraries(final BrowserParts parts) {
|
||||
ThreadUtils.checkUiThread();
|
||||
if (parts.isActivityFinishingOrDestroyed()) return;
|
||||
+ ChromeSharedPreferences.warmUp();
|
||||
ProcessInitializationHandler.getInstance().initializePreNative();
|
||||
ProcessInitializationHandler.getInstance().initializePreNativeLibraryLoad();
|
||||
try (TraceEvent e = TraceEvent.scoped("ChromeBrowserInitializer.preInflationStartup")) {
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
|
||||
@@ -725,7 +725,9 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator {
|
||||
|
||||
@Override
|
||||
public int getControlContainerHeightResource() {
|
||||
- return R.dimen.control_container_height;
|
||||
+ if (DeviceFormFactor.isForceTabletUI())
|
||||
+ return R.dimen.control_container_height_tabletui;
|
||||
+ return R.dimen.control_container_height_cromite;
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java
|
||||
@@ -104,6 +104,8 @@ import org.chromium.chrome.browser.paint_preview.DemoPaintPreview;
|
||||
import org.chromium.chrome.browser.password_manager.ManagePasswordsReferrer;
|
||||
import org.chromium.chrome.browser.password_manager.PasswordManagerLauncher;
|
||||
import org.chromium.chrome.browser.pdf.PdfPage;
|
||||
+import org.chromium.chrome.browser.preferences.ChromePreferenceKeys;
|
||||
+import org.chromium.chrome.browser.preferences.ChromeSharedPreferences;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
import org.chromium.chrome.browser.quick_delete.QuickDeleteController;
|
||||
import org.chromium.chrome.browser.quick_delete.QuickDeleteDelegateImpl;
|
||||
@@ -1645,7 +1647,9 @@ public class RootUiCoordinator
|
||||
if (!mSupportsFindInPageSupplier.getAsBoolean()) return;
|
||||
|
||||
int stubId = R.id.find_toolbar_stub;
|
||||
- if (DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity)) {
|
||||
+ if (DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity) &&
|
||||
+ !ChromeSharedPreferences.getInstance().readBoolean(
|
||||
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, false)) {
|
||||
stubId = R.id.find_toolbar_tablet_stub;
|
||||
}
|
||||
mFindToolbarManager =
|
||||
diff --git a/chrome/browser/preferences/BUILD.gn b/chrome/browser/preferences/BUILD.gn
|
||||
--- a/chrome/browser/preferences/BUILD.gn
|
||||
+++ b/chrome/browser/preferences/BUILD.gn
|
||||
@@ -25,6 +25,7 @@ android_library("java") {
|
||||
"//components/cached_flags:java",
|
||||
"//third_party/androidx:androidx_annotation_annotation_java",
|
||||
"//third_party/jni_zero:jni_zero_java",
|
||||
+ "//ui/android:ui_java",
|
||||
]
|
||||
|
||||
srcjar_deps = [
|
||||
ChromeBaseCheckBoxPreference mAccessibilityTabSwitcherPref =
|
||||
(ChromeBaseCheckBoxPreference) findPreference(
|
||||
ChromePreferenceKeys.ACCESSIBILITY_TAB_SWITCHER);
|
||||
@@ -137,6 +144,9 @@ public class AccessibilitySettings
|
||||
mFontSizePrefs.setUserFontScaleFactor((Float) newValue);
|
||||
} else if (PREF_FORCE_ENABLE_ZOOM.equals(preference.getKey())) {
|
||||
mFontSizePrefs.setForceEnableZoomFromUser((Boolean) newValue);
|
||||
+ } else if (PREF_FORCE_TABLET_UI.equals(preference.getKey())) {
|
||||
+ SharedPreferencesManager.getInstance().writeBoolean(
|
||||
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, (Boolean) newValue);
|
||||
} else if (PREF_READER_FOR_ACCESSIBILITY.equals(preference.getKey())) {
|
||||
UserPrefs.get(Profile.getLastUsedRegularProfile())
|
||||
.setBoolean(Pref.READER_FOR_ACCESSIBILITY, (Boolean) newValue);
|
||||
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
|
||||
--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
|
||||
+++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
|
||||
@@ -313,6 +313,7 @@ public final class ChromePreferenceKeys {
|
||||
/** Whether the app-specific history info text was already seen by users. */
|
||||
public static final String HISTORY_APP_SPECIFIC_INFO_SEEN =
|
||||
"Chrome.History.AppSpecificInfoSeen";
|
||||
@@ -536,6 +536,7 @@ public final class ChromePreferenceKeys {
|
||||
public static final String FONT_USER_SET_FORCE_ENABLE_ZOOM = "user_set_force_enable_zoom";
|
||||
|
||||
public static final String HISTORY_SHOW_HISTORY_INFO = "history_home_show_info";
|
||||
+ public static final String FLAGS_FORCE_TABLET_UI_ENABLED = "force_tablet_ui_enabled";
|
||||
|
||||
/** Keys used to save settings related to homepage. */
|
||||
public static final String DEPRECATED_HOMEPAGE_CUSTOM_URI = "homepage_custom_uri";
|
||||
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromeSharedPreferences.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromeSharedPreferences.java
|
||||
--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromeSharedPreferences.java
|
||||
+++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromeSharedPreferences.java
|
||||
@@ -14,6 +14,8 @@ import org.chromium.build.annotations.NullMarked;
|
||||
import org.chromium.build.annotations.Nullable;
|
||||
import org.chromium.build.annotations.OptimizeAsNonNull;
|
||||
|
||||
+import org.chromium.ui.base.DeviceFormFactor;
|
||||
+
|
||||
@JNINamespace("android::shared_preferences")
|
||||
@NullMarked
|
||||
public class ChromeSharedPreferences {
|
||||
@@ -26,6 +28,16 @@ public class ChromeSharedPreferences {
|
||||
LegacyChromePreferenceKeys.getPrefixesInUse())
|
||||
: null);
|
||||
|
||||
+ static {
|
||||
+ DeviceFormFactor.setForceTabletUI(
|
||||
+ ChromeSharedPreferences.getInstance().readBoolean(
|
||||
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, false));
|
||||
+ }
|
||||
+
|
||||
+ public static void warmUp() {
|
||||
+ // intentionally empty
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* @return The //base SharedPreferencesManager singleton.
|
||||
*/
|
||||
public static final String HOMEPAGE_CUSTOM_URI = "homepage_custom_uri";
|
||||
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
|
||||
--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
|
||||
+++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
|
||||
@@ -56,6 +56,7 @@ public class LegacyChromePreferenceKeys {
|
||||
ChromePreferenceKeys.FIRST_RUN_FLOW_COMPLETE,
|
||||
ChromePreferenceKeys.FIRST_RUN_FLOW_SIGNIN_SETUP,
|
||||
ChromePreferenceKeys.FIRST_RUN_LIGHTWEIGHT_FLOW_COMPLETE,
|
||||
@@ -99,6 +99,7 @@ public class LegacyChromePreferenceKeys {
|
||||
ChromePreferenceKeys.FLAGS_CACHED_SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT,
|
||||
ChromePreferenceKeys.FLAGS_CACHED_TAB_GROUPS_ANDROID_ENABLED,
|
||||
ChromePreferenceKeys.FONT_USER_FONT_SCALE_FACTOR,
|
||||
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED,
|
||||
ChromePreferenceKeys.FIRST_RUN_SKIP_WELCOME_PAGE,
|
||||
ChromePreferenceKeys.FONT_USER_SET_FORCE_ENABLE_ZOOM,
|
||||
ChromePreferenceKeys.HISTORY_SHOW_HISTORY_INFO,
|
||||
ChromePreferenceKeys.HOMEPAGE_ENABLED,
|
||||
diff --git a/chrome/browser/ui/android/desktop_windowing/java/src/org/chromium/chrome/browser/ui/desktop_windowing/AppHeaderCoordinator.java b/chrome/browser/ui/android/desktop_windowing/java/src/org/chromium/chrome/browser/ui/desktop_windowing/AppHeaderCoordinator.java
|
||||
--- a/chrome/browser/ui/android/desktop_windowing/java/src/org/chromium/chrome/browser/ui/desktop_windowing/AppHeaderCoordinator.java
|
||||
+++ b/chrome/browser/ui/android/desktop_windowing/java/src/org/chromium/chrome/browser/ui/desktop_windowing/AppHeaderCoordinator.java
|
||||
@@ -39,6 +39,7 @@ import org.chromium.components.browser_ui.desktop_windowing.AppHeaderState;
|
||||
import org.chromium.components.browser_ui.desktop_windowing.DesktopWindowStateManager;
|
||||
import org.chromium.components.browser_ui.edge_to_edge.EdgeToEdgeStateProvider;
|
||||
import org.chromium.ui.CaptionBarInsetsRectProvider;
|
||||
+import org.chromium.ui.base.DeviceFormFactor;
|
||||
import org.chromium.ui.InsetObserver;
|
||||
import org.chromium.ui.InsetObserver.WindowInsetsConsumer;
|
||||
import org.chromium.ui.InsetsRectProvider;
|
||||
@@ -267,6 +268,7 @@ public class AppHeaderCoordinator
|
||||
InsetsRectProvider insetsRectProvider,
|
||||
@DesktopWindowHeuristicResult int currentResult,
|
||||
boolean isOnExternalDisplay) {
|
||||
+ if (DeviceFormFactor.isForceTabletUI()) return DesktopWindowHeuristicResult.IN_DESKTOP_WINDOW;
|
||||
@DesktopWindowHeuristicResult int newResult;
|
||||
|
||||
Insets captionBarInset = insetsRectProvider.getCachedInset();
|
||||
ChromePreferenceKeys.HOMEPAGE_CUSTOM_URI,
|
||||
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
|
||||
--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
|
||||
+++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
|
||||
@@ -857,7 +857,7 @@ public class LocationBarCoordinator
|
||||
}
|
||||
|
||||
private boolean isTabletWindow() {
|
||||
@@ -348,7 +348,7 @@ public final class LocationBarCoordinator implements LocationBar, NativeInitObse
|
||||
// OmniboxSuggestionsDropdownEmbedder implementation
|
||||
@Override
|
||||
public boolean isTablet() {
|
||||
- return DeviceFormFactor.isWindowOnTablet(mWindowAndroid);
|
||||
+ return DeviceFormFactor.isWindowOnTablet(mWindowAndroid) || isTabletLayout();
|
||||
}
|
||||
|
||||
/* package */ LocationBarMediator getMediatorForTesting() {
|
||||
@Override
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -1654,6 +1654,13 @@ Your Google account may have other forms of browsing history like searches and a
|
||||
Privacy guide explanation closed
|
||||
@@ -1200,6 +1200,12 @@ Your Google account may have other forms of browsing history like searches and a
|
||||
<message name="IDS_SAFE_BROWSING_NO_PROTECTION_CONFIRMATION_DIALOG_CONFIRM" desc="Message for Safe Browsing no protection confirmation button.">
|
||||
Turn off
|
||||
</message>
|
||||
|
||||
+ <message name="IDS_FORCE_TABLET_UI_SUMMARY" desc="Summary of the preference that allows the user to force chromium to use tablet UI.">
|
||||
+ Open chromium in Tablet Mode
|
||||
+ </message>
|
||||
+ <message name="IDS_FORCE_TABLET_UI_TITLE" desc="Title of the preference that allows the user to update force tablet UI settings.">
|
||||
+ Force Tablet Mode
|
||||
+ </message>
|
||||
+
|
||||
<!-- Safety check -->
|
||||
<message name="IDS_PREFS_SAFETY_CHECK" desc="Title of the Safety check element in settings, allowing the user to check multiple areas of browser safety. [CHAR_LIMIT=32]">
|
||||
Safety check
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/res/layout/control_container.xml b/chrome/browser/ui/android/toolbar/java/res/layout/control_container.xml
|
||||
--- a/chrome/browser/ui/android/toolbar/java/res/layout/control_container.xml
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/res/layout/control_container.xml
|
||||
@@ -9,7 +9,7 @@ found in the LICENSE file.
|
||||
android:id="@+id/control_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
- android:minHeight="@dimen/control_container_height" >
|
||||
+ android:minHeight="@dimen/control_container_height_cromite" >
|
||||
|
||||
<view
|
||||
class="org.chromium.chrome.browser.toolbar.top.ToolbarControlContainer$ToolbarViewResourceFrameLayout"
|
||||
@@ -20,7 +20,7 @@ found in the LICENSE file.
|
||||
<ViewStub
|
||||
android:id="@+id/toolbar_stub"
|
||||
android:layout_width="match_parent"
|
||||
- android:layout_marginTop="@dimen/tab_strip_height"
|
||||
+ android:layout_marginTop="@dimen/tab_strip_height_cromite"
|
||||
android:layout_height="@dimen/toolbar_height_no_shadow" />
|
||||
|
||||
<ImageView
|
||||
@@ -28,7 +28,7 @@ found in the LICENSE file.
|
||||
android:src="@drawable/toolbar_hairline"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
- android:layout_marginTop="@dimen/control_container_height"
|
||||
+ android:layout_marginTop="@dimen/control_container_height_cromite"
|
||||
android:scaleType="fitXY"
|
||||
android:importantForAccessibility="no" />
|
||||
|
||||
@@ -36,7 +36,7 @@ found in the LICENSE file.
|
||||
android:id="@+id/find_toolbar_stub"
|
||||
android:inflatedId="@+id/find_toolbar"
|
||||
android:visibility="gone"
|
||||
- android:layout_marginTop="@dimen/tab_strip_height"
|
||||
+ android:layout_marginTop="@dimen/tab_strip_height_cromite"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/toolbar_height_no_shadow"
|
||||
android:layout="@layout/find_toolbar" />
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml b/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml
|
||||
--- a/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/res/layout/toolbar_tablet.xml
|
||||
@@ -15,7 +15,7 @@ found in the LICENSE file.
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/toolbar_height_no_shadow"
|
||||
- android:layout_marginTop="@dimen/tab_strip_height"
|
||||
+ android:layout_marginTop="@dimen/tab_strip_height_tabletui"
|
||||
android:background="@macro/default_bg_color"
|
||||
>
|
||||
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/res/values-sw600dp/dimens.xml b/chrome/browser/ui/android/toolbar/java/res/values-sw600dp/dimens.xml
|
||||
--- a/chrome/browser/ui/android/toolbar/java/res/values-sw600dp/dimens.xml
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/res/values-sw600dp/dimens.xml
|
||||
@@ -7,6 +7,7 @@ found in the LICENSE file.
|
||||
|
||||
<resources>
|
||||
<!-- Tab Strip Dimensions -->
|
||||
- <dimen name="tab_strip_height">40dp</dimen>
|
||||
- <dimen name="tab_strip_reserved_top_padding">2dp</dimen>
|
||||
+ <dimen name="tab_strip_height_cromite">40dp</dimen>
|
||||
+ <dimen name="tab_strip_height_tabletui">40dp</dimen>
|
||||
+ <dimen name="tab_strip_reserved_top_padding_cromite">2dp</dimen>
|
||||
</resources>
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/res/values/dimens.xml b/chrome/browser/ui/android/toolbar/java/res/values/dimens.xml
|
||||
--- a/chrome/browser/ui/android/toolbar/java/res/values/dimens.xml
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/res/values/dimens.xml
|
||||
@@ -10,8 +10,10 @@ found in the LICENSE file.
|
||||
<dimen name="toolbar_tab_count_text_size_2_digit">9dp</dimen>
|
||||
|
||||
<!-- Tab Strip Dimensions -->
|
||||
- <dimen name="tab_strip_height">0dp</dimen>
|
||||
- <dimen name="tab_strip_reserved_top_padding">0dp</dimen>
|
||||
+ <dimen name="tab_strip_height_cromite">0dp</dimen>
|
||||
+ <dimen name="tab_strip_height_tabletui">40dp</dimen>
|
||||
+ <dimen name="tab_strip_reserved_top_padding_cromite">0dp</dimen>
|
||||
+ <dimen name="tab_strip_reserved_top_padding_tabletui">2dp</dimen>
|
||||
|
||||
<dimen name="ntp_search_box_height">64dp</dimen>
|
||||
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/ControlContainer.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/ControlContainer.java
|
||||
--- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/ControlContainer.java
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/ControlContainer.java
|
||||
@@ -27,7 +27,7 @@ public interface ControlContainer {
|
||||
*
|
||||
* @param toolbarLayoutId The ID of the toolbar layout to use.
|
||||
*/
|
||||
- void initWithToolbar(int toolbarLayoutId);
|
||||
+ void initWithToolbar(int toolbarLayoutId, int controlContainerHeightOverrideId);
|
||||
|
||||
/**
|
||||
* @return The {@link ViewResourceAdapter} that exposes this {@link View} as a CC resource.
|
||||
<!-- Accessibility preferences -->
|
||||
<message name="IDS_PREFS_ACCESSIBILITY" desc="Title of Accessibility settings, which allows the user to change webpage font sizes. [CHAR_LIMIT=32]">
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
|
||||
--- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
|
||||
@@ -7,6 +7,7 @@ package org.chromium.chrome.browser.toolbar.top;
|
||||
import static org.chromium.build.NullUtil.assumeNonNull;
|
||||
|
||||
import android.content.Context;
|
||||
+import android.content.res.Resources;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PorterDuff;
|
||||
@@ -157,8 +158,25 @@ public class ToolbarControlContainer extends OptimizedFrameLayout
|
||||
|
||||
@Override
|
||||
@Initializer
|
||||
- public void initWithToolbar(int toolbarLayoutId) {
|
||||
+ public void initWithToolbar(int toolbarLayoutId, int controlContainerHeightOverrideId) {
|
||||
try (TraceEvent te = TraceEvent.scoped("ToolbarControlContainer.initWithToolbar")) {
|
||||
+ if (controlContainerHeightOverrideId != 0) {
|
||||
+ Resources res = getContext().getResources();
|
||||
+ setMinimumHeight((int) res.getDimension(controlContainerHeightOverrideId));
|
||||
+ int tab_strip_height =
|
||||
+ (int) res.getDimension(R.dimen.tab_strip_height_tabletui);
|
||||
+
|
||||
+ View view = findViewById(R.id.toolbar_stub);
|
||||
+ if (view != null)
|
||||
+ ((MarginLayoutParams)view.getLayoutParams()).topMargin = tab_strip_height;
|
||||
+
|
||||
+ view = findViewById(R.id.toolbar_hairline);
|
||||
+ if (view != null) view.setVisibility(View.GONE);
|
||||
+
|
||||
+ view = findViewById(R.id.find_toolbar_stub);
|
||||
+ if (view != null)
|
||||
+ ((MarginLayoutParams)view.getLayoutParams()).topMargin = tab_strip_height;
|
||||
+ }
|
||||
mToolbarContainer = findViewById(R.id.toolbar_container);
|
||||
ViewStub toolbarStub = findViewById(R.id.toolbar_stub);
|
||||
toolbarStub.setLayoutResource(toolbarLayoutId);
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarLayout.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarLayout.java
|
||||
--- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarLayout.java
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarLayout.java
|
||||
@@ -68,6 +68,7 @@ import org.chromium.chrome.browser.util.BrowserUiUtils.ModuleTypeOnStartAndNtp;
|
||||
import org.chromium.components.feature_engagement.Tracker;
|
||||
import org.chromium.ui.base.ViewUtils;
|
||||
import org.chromium.ui.util.MotionEventUtils;
|
||||
+import org.chromium.ui.base.DeviceFormFactor;
|
||||
import org.chromium.ui.util.TokenHolder;
|
||||
import org.chromium.url.GURL;
|
||||
|
||||
@@ -586,7 +587,9 @@ public abstract class ToolbarLayout extends FrameLayout
|
||||
* not have a tab strip.
|
||||
*/
|
||||
protected int getTabStripHeightFromResource() {
|
||||
- return getResources().getDimensionPixelSize(R.dimen.tab_strip_height);
|
||||
+ if (DeviceFormFactor.isForceTabletUI())
|
||||
+ return getResources().getDimensionPixelSize(R.dimen.tab_strip_height_tabletui);
|
||||
+ return getResources().getDimensionPixelSize(R.dimen.tab_strip_height_cromite);
|
||||
}
|
||||
|
||||
/** Triggered when the content view for the specified tab has changed. */
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/tab_strip/HeightTransitionHandler.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/tab_strip/HeightTransitionHandler.java
|
||||
--- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/tab_strip/HeightTransitionHandler.java
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/tab_strip/HeightTransitionHandler.java
|
||||
@@ -29,6 +29,7 @@ import org.chromium.chrome.browser.toolbar.top.ToolbarLayout;
|
||||
import org.chromium.chrome.browser.toolbar.top.tab_strip.TabStripTransitionCoordinator.TabStripHeightObserver;
|
||||
import org.chromium.chrome.browser.toolbar.top.tab_strip.TabStripTransitionCoordinator.TabStripTransitionDelegate;
|
||||
import org.chromium.ui.base.ViewUtils;
|
||||
+import org.chromium.ui.base.DeviceFormFactor;
|
||||
import org.chromium.ui.resources.dynamics.DynamicResourceReadyOnceCallback;
|
||||
import org.chromium.ui.util.TokenHolder;
|
||||
|
||||
@@ -559,6 +560,7 @@ class HeightTransitionHandler {
|
||||
if (TabStripTransitionCoordinator.sHeightTransitionThresholdForTesting != null) {
|
||||
return TabStripTransitionCoordinator.sHeightTransitionThresholdForTesting;
|
||||
@@ -109,7 +109,7 @@ public class ToolbarControlContainer extends OptimizedFrameLayout implements Con
|
||||
// On tablet, draw a fake tab strip and toolbar until the compositor is
|
||||
// ready to draw the real tab strip. (On phone, the toolbar is made entirely
|
||||
// of Android views, which are already initialized.)
|
||||
- setBackgroundResource(R.drawable.toolbar_background);
|
||||
+// setBackgroundResource(R.drawable.toolbar_background);
|
||||
}
|
||||
+ if (DeviceFormFactor.isForceTabletUI()) return 0;
|
||||
return TRANSITION_THRESHOLD_DP;
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/tab_strip/TabStripTransitionCoordinator.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/tab_strip/TabStripTransitionCoordinator.java
|
||||
--- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/tab_strip/TabStripTransitionCoordinator.java
|
||||
+++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/tab_strip/TabStripTransitionCoordinator.java
|
||||
@@ -28,6 +28,7 @@ import org.chromium.chrome.browser.ui.desktop_windowing.AppHeaderUtils;
|
||||
import org.chromium.components.browser_ui.desktop_windowing.AppHeaderState;
|
||||
import org.chromium.components.browser_ui.desktop_windowing.DesktopWindowStateManager;
|
||||
import org.chromium.components.browser_ui.desktop_windowing.DesktopWindowStateManager.AppHeaderObserver;
|
||||
+import org.chromium.ui.base.DeviceFormFactor;
|
||||
diff --git a/components/BUILD.gn b/components/BUILD.gn
|
||||
--- a/components/BUILD.gn
|
||||
+++ b/components/BUILD.gn
|
||||
@@ -542,7 +542,7 @@ test("components_unittests") {
|
||||
|
||||
/** Class used to manage tab strip visibility and height updates. */
|
||||
@NullMarked
|
||||
@@ -153,7 +154,10 @@ public class TabStripTransitionCoordinator implements ComponentCallbacks, AppHea
|
||||
mTabStripReservedTopPadding =
|
||||
controlContainerView()
|
||||
.getResources()
|
||||
- .getDimensionPixelSize(R.dimen.tab_strip_reserved_top_padding);
|
||||
+ .getDimensionPixelSize(
|
||||
+ DeviceFormFactor.isForceTabletUI()
|
||||
+ ? R.dimen.tab_strip_reserved_top_padding_tabletui
|
||||
+ : R.dimen.tab_strip_reserved_top_padding_cromite);
|
||||
# On LaCrOS, tests use ash - chrome as a window manager, thus the dependency.
|
||||
# On other platforms, no components should depend on Chrome.
|
||||
- if (!is_chromeos_lacros) {
|
||||
+ if (!is_chromeos_lacros && !is_android) {
|
||||
assert_no_deps = [ "//chrome/*" ]
|
||||
}
|
||||
|
||||
mOnLayoutChangedListener =
|
||||
(view, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
|
||||
diff --git a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml
|
||||
--- a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml
|
||||
+++ b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml
|
||||
@@ -41,6 +41,11 @@ found in the LICENSE file.
|
||||
android:summary="@string/jump_start_omnibox_summary"
|
||||
android:title="@string/jump_start_omnibox_title" />
|
||||
@@ -789,7 +789,7 @@ if (!is_ios) {
|
||||
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
+ android:key="force_tablet_ui"
|
||||
+ android:summary="@string/force_tablet_ui_summary"
|
||||
+ android:title="@string/force_tablet_ui_title" />
|
||||
+
|
||||
<Preference
|
||||
android:key="captions"
|
||||
android:title="@string/accessibility_captions_title"/>
|
||||
diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java
|
||||
--- a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java
|
||||
+++ b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java
|
||||
@@ -29,6 +29,7 @@ import org.chromium.content_public.browser.ContentFeatureList;
|
||||
import org.chromium.content_public.browser.ContentFeatureMap;
|
||||
|
||||
import org.chromium.chrome.browser.settings.ChromeBaseSettingsFragment;
|
||||
+import org.chromium.components.browser_ui.accessibility.AccessibilitySettingsDelegate.BooleanPreferenceDelegate;
|
||||
|
||||
/** Fragment to keep track of all the accessibility related preferences. */
|
||||
@NullMarked
|
||||
@@ -44,6 +45,9 @@ public class AccessibilitySettings extends ChromeBaseSettingsFragment
|
||||
public static final String PREF_ZOOM_INFO = "zoom_info";
|
||||
public static final String PREF_IMAGE_DESCRIPTIONS = "image_descriptions";
|
||||
|
||||
+ private BooleanPreferenceDelegate mForceTabletUIDelegate;
|
||||
+ static final String PREF_FORCE_TABLET_UI = "force_tablet_ui";
|
||||
+
|
||||
private PageZoomPreference mPageZoomDefaultZoomPref;
|
||||
private ChromeSwitchPreference mPageZoomIncludeOSAdjustment;
|
||||
private ChromeSwitchPreference mPageZoomAlwaysShowPref;
|
||||
@@ -108,6 +112,12 @@ public class AccessibilitySettings extends ChromeBaseSettingsFragment
|
||||
mDelegate.getReaderAccessibilityDelegate().getValue());
|
||||
readerForAccessibilityPref.setOnPreferenceChangeListener(this);
|
||||
|
||||
+ ChromeSwitchPreference forceTabletUiPref =
|
||||
+ (ChromeSwitchPreference) findPreference(PREF_FORCE_TABLET_UI);
|
||||
+ mForceTabletUIDelegate = mDelegate.getForceTabletUIDelegate();
|
||||
+ forceTabletUiPref.setChecked(mForceTabletUIDelegate.getValue());
|
||||
+ forceTabletUiPref.setOnPreferenceChangeListener(this);
|
||||
+
|
||||
Preference captions = findPreference(PREF_CAPTIONS);
|
||||
captions.setOnPreferenceClickListener(
|
||||
preference -> {
|
||||
@@ -167,6 +177,9 @@ public class AccessibilitySettings extends ChromeBaseSettingsFragment
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
if (PREF_FORCE_ENABLE_ZOOM.equals(preference.getKey())) {
|
||||
mDelegate.getForceEnableZoomAccessibilityDelegate().setValue((Boolean) newValue);
|
||||
+ } else if (PREF_FORCE_TABLET_UI.equals(preference.getKey())) {
|
||||
+ mForceTabletUIDelegate.setValue((Boolean) newValue);
|
||||
+ mDelegate.requestRestart(getActivity());
|
||||
} else if (PREF_READER_FOR_ACCESSIBILITY.equals(preference.getKey())) {
|
||||
boolean readerModeEnabled = (Boolean) newValue;
|
||||
mDelegate.getReaderAccessibilityDelegate().setValue(readerModeEnabled);
|
||||
diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java
|
||||
--- a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java
|
||||
+++ b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java
|
||||
@@ -41,6 +41,8 @@ public interface AccessibilitySettingsDelegate {
|
||||
*/
|
||||
BrowserContextHandle getBrowserContextHandle();
|
||||
|
||||
+ BooleanPreferenceDelegate getForceTabletUIDelegate();
|
||||
+
|
||||
/**
|
||||
* @return boolean value specifying if the Image Descriptions user setting should be shown.
|
||||
*/
|
||||
# On LaCrOS, tests use ash - chrome as a window manager, thus the dependency.
|
||||
# On other platforms, no components should depend on Chrome.
|
||||
- if (!is_chromeos_lacros) {
|
||||
+ if (!is_chromeos_lacros && !is_android) {
|
||||
assert_no_deps = [ "//chrome/*" ]
|
||||
}
|
||||
}
|
||||
diff --git a/ui/android/BUILD.gn b/ui/android/BUILD.gn
|
||||
--- a/ui/android/BUILD.gn
|
||||
+++ b/ui/android/BUILD.gn
|
||||
@@ -370,6 +370,8 @@ android_library("ui_no_recycler_view_java") {
|
||||
":ui_java_resources",
|
||||
":ui_utils_java",
|
||||
"//base:base_java",
|
||||
+ # dependency for ui_no_recycler_view_java
|
||||
+ "//chrome/browser/preferences:java",
|
||||
"//components/url_formatter/android:url_formatter_java",
|
||||
"//third_party/androidx:androidx_annotation_annotation_java",
|
||||
"//third_party/androidx:androidx_appcompat_appcompat_java",
|
||||
diff --git a/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java b/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java
|
||||
--- a/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java
|
||||
+++ b/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java
|
||||
@@ -83,6 +83,14 @@ public class DeviceFormFactor {
|
||||
return BuildConfig.IS_DESKTOP_ANDROID;
|
||||
}
|
||||
|
||||
+ private static boolean mForceTabletUI = false;
|
||||
+ public static void setForceTabletUI(boolean forceTabletUI) {
|
||||
+ mForceTabletUI = forceTabletUI;
|
||||
+ }
|
||||
+ public static boolean isForceTabletUI() {
|
||||
+ return mForceTabletUI;
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Each activity could be on a different display, and this will just tell you whether the
|
||||
* display associated with the application context is "tablet sized". Use {@link
|
||||
@@ -91,6 +99,7 @@ public class DeviceFormFactor {
|
||||
@CalledByNative
|
||||
@Deprecated
|
||||
public static boolean isTablet() {
|
||||
+ if (mForceTabletUI) return true;
|
||||
if (sIsTabletForTesting != null) {
|
||||
return sIsTabletForTesting;
|
||||
}
|
||||
@@ -121,6 +130,7 @@ public class DeviceFormFactor {
|
||||
* E.g. http://developer.samsung.com/samsung-dex/testing
|
||||
@@ -11,6 +11,8 @@ import androidx.annotation.UiThread;
|
||||
import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.ThreadUtils;
|
||||
import org.chromium.base.annotations.CalledByNative;
|
||||
+import org.chromium.chrome.browser.preferences.ChromePreferenceKeys;
|
||||
+import org.chromium.chrome.browser.preferences.SharedPreferencesManager;
|
||||
import org.chromium.ui.R;
|
||||
import org.chromium.ui.display.DisplayAndroid;
|
||||
import org.chromium.ui.display.DisplayUtil;
|
||||
@@ -60,6 +62,9 @@ public class DeviceFormFactor {
|
||||
* E.g. http://developer.samsung.com/samsung-dex/testing
|
||||
*/
|
||||
public static boolean isNonMultiDisplayContextOnTablet(Context context) {
|
||||
+ if (mForceTabletUI) return true;
|
||||
+ if (SharedPreferencesManager.getInstance().readBoolean(
|
||||
+ ChromePreferenceKeys.FLAGS_FORCE_TABLET_UI_ENABLED, false))
|
||||
+ return true;
|
||||
return detectScreenWidthBucket(context) >= SCREEN_BUCKET_TABLET;
|
||||
}
|
||||
|
||||
@@ -156,6 +166,7 @@ public class DeviceFormFactor {
|
||||
* @return The screen width bucket the device is in (see constants at the top of this class).
|
||||
*/
|
||||
private static int detectScreenWidthBucket(Context context) {
|
||||
+ if (mForceTabletUI) return SCREEN_BUCKET_TABLET;
|
||||
return context.getResources().getInteger(R.integer.min_screen_width_bucket);
|
||||
}
|
||||
|
||||
@@ -163,6 +174,7 @@ public class DeviceFormFactor {
|
||||
ThreadUtils.assertOnUiThread();
|
||||
Context context = windowAndroid.getContext().get();
|
||||
if (context == null) return 0;
|
||||
+ if (mForceTabletUI) return SCREEN_BUCKET_TABLET;
|
||||
return context.getResources().getInteger(R.integer.min_screen_width_bucket);
|
||||
}
|
||||
|
||||
@@ -172,6 +184,7 @@ public class DeviceFormFactor {
|
||||
*/
|
||||
@UiThread
|
||||
public static int getNonMultiDisplayMinimumTabletWidthPx(Context context) {
|
||||
+ if (mForceTabletUI) return 0;
|
||||
return getMinimumTabletWidthPx(DisplayAndroid.getNonMultiDisplay(context));
|
||||
}
|
||||
|
||||
@@ -180,6 +193,7 @@ public class DeviceFormFactor {
|
||||
* layout.
|
||||
*/
|
||||
public static int getMinimumTabletWidthPx(DisplayAndroid display) {
|
||||
+ if (mForceTabletUI) return 0;
|
||||
return DisplayUtil.dpToPx(display, DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP);
|
||||
}
|
||||
}
|
||||
--
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -2,83 +2,73 @@ From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 7 Sep 2019 15:07:42 +0200
|
||||
Subject: Add option to not persist tabs across sessions
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../android/java/res/xml/privacy_preferences.xml | 5 +++++
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 5 ++++-
|
||||
.../chrome/browser/ChromeTabbedActivity.java | 4 +++-
|
||||
.../privacy/settings/PrivacySettings.java | 16 +++++++++++++++-
|
||||
.../android/strings/android_chrome_strings.grd | 6 ++++++
|
||||
4 files changed, 30 insertions(+), 2 deletions(-)
|
||||
4 files changed, 29 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
|
||||
@@ -95,6 +95,11 @@ found in the LICENSE file.
|
||||
android:title="@string/incognito_settings_title"
|
||||
android:summary="@string/incognito_settings_summary"
|
||||
android:fragment="org.chromium.chrome.browser.privacy.settings.IncognitoSettings"/>
|
||||
@@ -33,6 +33,11 @@
|
||||
android:title="@string/always_incognito_title"
|
||||
android:summary="@string/always_incognito_summary"
|
||||
android:defaultValue="false" />
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
+ android:key="close_tabs_on_exit"
|
||||
+ android:title="@string/close_tabs_on_exit_title"
|
||||
+ android:summary="@string/close_tabs_on_exit_summary"
|
||||
+ android:defaultValue="false" />
|
||||
<PreferenceCategory
|
||||
android:key="services_category"
|
||||
android:title="@string/services_category_title">
|
||||
<Preference
|
||||
android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings"
|
||||
android:key="do_not_track"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
|
||||
@@ -47,6 +47,7 @@ import org.chromium.base.Callback;
|
||||
import org.chromium.base.CallbackController;
|
||||
import org.chromium.base.CallbackUtils;
|
||||
import org.chromium.base.CommandLine;
|
||||
+import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.IntentUtils;
|
||||
import org.chromium.base.Log;
|
||||
import org.chromium.base.MemoryPressureListener;
|
||||
@@ -1849,8 +1850,10 @@ public class ChromeTabbedActivity extends ChromeActivity {
|
||||
@@ -1188,8 +1188,10 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
|
||||
boolean hadCipherData =
|
||||
CipherLazyHolder.sCipherInstance.restoreFromBundle(getSavedInstanceState());
|
||||
CipherFactory.getInstance().restoreFromBundle(getSavedInstanceState());
|
||||
|
||||
+ String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
|
||||
boolean noRestoreState =
|
||||
- CommandLine.getInstance().hasSwitch(ChromeSwitches.NO_RESTORE_STATE);
|
||||
+ CommandLine.getInstance().hasSwitch(ChromeSwitches.NO_RESTORE_STATE) ||
|
||||
+ ContextUtils.getAppSharedPreferences().getBoolean(PREF_CLOSE_TABS_ON_EXIT, false);
|
||||
boolean shouldShowNtpAsHomeSurfaceAtStartup = false;
|
||||
final AtomicBoolean isActiveUrlNtp = new AtomicBoolean(false);
|
||||
if (noRestoreState) {
|
||||
// Clear the state files because they are inconsistent and useless from now on.
|
||||
mTabModelOrchestrator.clearState();
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
|
||||
@@ -8,6 +8,7 @@ import static org.chromium.components.content_settings.PrefNames.COOKIE_CONTROLS
|
||||
@@ -5,6 +5,7 @@
|
||||
package org.chromium.chrome.browser.privacy.settings;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
+import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
+import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
@@ -21,7 +22,9 @@ import android.view.View;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.preference.Preference;
|
||||
import android.text.SpannableString;
|
||||
import android.view.Menu;
|
||||
@@ -15,6 +16,8 @@ import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
|
||||
|
||||
+import org.chromium.base.BuildInfo;
|
||||
import org.chromium.base.Callback;
|
||||
+import org.chromium.base.ContextUtils;
|
||||
import org.chromium.base.IntentUtils;
|
||||
import org.chromium.base.metrics.RecordHistogram;
|
||||
import org.chromium.base.metrics.RecordUserAction;
|
||||
@@ -113,6 +116,8 @@ public class PrivacySettings extends ChromeBaseSettingsFragment
|
||||
private final SharedPreferencesManager mSharedPreferencesManager =
|
||||
ChromeSharedPreferences.getInstance();
|
||||
+import org.chromium.base.BuildInfo;
|
||||
import org.chromium.chrome.R;
|
||||
import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncherImpl;
|
||||
import org.chromium.chrome.browser.flags.ChromeFeatureList;
|
||||
@@ -59,6 +62,8 @@ public class PrivacySettings
|
||||
private static final String PREF_CLEAR_BROWSING_DATA = "clear_browsing_data";
|
||||
private static final String PREF_PRIVACY_SANDBOX = "privacy_sandbox";
|
||||
|
||||
+ private static final String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
|
||||
+
|
||||
private ManagedPreferenceDelegate mManagedPreferenceDelegate;
|
||||
@VisibleForTesting static final String PREF_THIRD_PARTY_COOKIES = "third_party_cookies";
|
||||
@VisibleForTesting static final String PREF_TRACKING_PROTECTION = "tracking_protection";
|
||||
@@ -373,7 +378,11 @@ public class PrivacySettings extends ChromeBaseSettingsFragment
|
||||
|
||||
@Override
|
||||
@@ -137,7 +142,11 @@ public class PrivacySettings
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
String key = preference.getKey();
|
||||
@@ -88,25 +78,25 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
|
||||
+ sharedPreferencesEditor.putBoolean(PREF_CLOSE_TABS_ON_EXIT, (boolean)newValue);
|
||||
+ sharedPreferencesEditor.apply();
|
||||
+ } else if (PREF_CAN_MAKE_PAYMENT.equals(key)) {
|
||||
UserPrefs.get(getProfile())
|
||||
UserPrefs.get(Profile.getLastUsedRegularProfile())
|
||||
.setBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
|
||||
} else if (PREF_HTTPS_FIRST_MODE_LEGACY.equals(key)) {
|
||||
@@ -433,6 +442,11 @@ public class PrivacySettings extends ChromeBaseSettingsFragment
|
||||
getContext(), getProfile()));
|
||||
} else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
|
||||
@@ -189,6 +198,11 @@ public class PrivacySettings
|
||||
privacySandboxPreference.setSummary(
|
||||
PrivacySandboxSettingsFragment.getStatusString(getContext()));
|
||||
}
|
||||
|
||||
+
|
||||
+ ChromeSwitchPreference closeTabsOnExitPref =
|
||||
+ (ChromeSwitchPreference) findPreference(PREF_CLOSE_TABS_ON_EXIT);
|
||||
+ closeTabsOnExitPref.setOnPreferenceChangeListener(this);
|
||||
+ closeTabsOnExitPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
|
||||
+
|
||||
Preference secureDnsPref = findPreference(PREF_SECURE_DNS);
|
||||
if (secureDnsPref != null && secureDnsPref.isVisible()) {
|
||||
secureDnsPref.setSummary(SecureDnsSettings.getSummary(getContext()));
|
||||
}
|
||||
|
||||
private ChromeManagedPreferenceDelegate createManagedPreferenceDelegate() {
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -5714,6 +5714,12 @@ To change this setting, <ph name="BEGIN_LINK">BEGIN_LINK</ph>delete the Chrome d
|
||||
@@ -4032,6 +4032,12 @@ To change this setting, <ph name="BEGIN_LINK"><resetlink></ph>reset sync<p
|
||||
<message name="IDS_CONTEXTMENU_IMAGE_TITLE" desc="The title of a context menu tab when the item pressed contains more than one type. This indicates that all the actions are related to the image.">
|
||||
IMAGE
|
||||
</message>
|
||||
@@ -114,9 +104,11 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro
|
||||
+ Close all open tabs on exit
|
||||
+ </message>
|
||||
+ <message name="IDS_CLOSE_TABS_ON_EXIT_SUMMARY" desc="Summary text for 'Close tabs on exit' settings-privacy option.">
|
||||
+ Don't persist tabs between browsing sessions. Caution: parameters in urls allow linking between different sessions.
|
||||
+ Don't persist tabs between browsing sessions
|
||||
+ </message>
|
||||
<message name="IDS_CONTEXTMENU_LINK_TITLE" desc="The title of a context menu tab when the item pressed contains more than one type. This indicates that all the actions are related to the link.">
|
||||
LINK
|
||||
</message>
|
||||
--
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -1,286 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Sat, 20 Nov 2021 15:36:54 +0000
|
||||
Subject: Add option to use home page as NTP
|
||||
|
||||
And allow use about:blank as default homepage
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../tab_management/TabGridDialogMediator.java | 11 ++++++++++-
|
||||
.../tasks/tab_management/TabGroupUiMediator.java | 8 +++++++-
|
||||
.../java/res/xml/homepage_preferences.xml | 5 +++++
|
||||
.../strip/TabGroupContextMenuCoordinator.java | 11 ++++++++++-
|
||||
.../chrome/browser/homepage/HomepageManager.java | 16 ++++++++++++++++
|
||||
.../homepage/settings/HomepageSettings.java | 12 ++++++++++++
|
||||
.../chrome/browser/metrics/LaunchMetrics.java | 1 -
|
||||
.../browser/tabmodel/ChromeTabCreator.java | 8 ++++++++
|
||||
.../preferences/ChromePreferenceKeys.java | 1 +
|
||||
.../preferences/LegacyChromePreferenceKeys.java | 1 +
|
||||
.../android/strings/android_chrome_strings.grd | 3 +++
|
||||
chrome/browser/ui/browser_ui_prefs.cc | 2 ++
|
||||
chrome/common/pref_names.h | 4 ++++
|
||||
13 files changed, 79 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediator.java
|
||||
--- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediator.java
|
||||
+++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridDialogMediator.java
|
||||
@@ -114,6 +114,9 @@ import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
+import org.chromium.chrome.browser.homepage.HomepageManager;
|
||||
+import org.chromium.url.GURL;
|
||||
+
|
||||
/**
|
||||
* A mediator for the TabGridDialog component, responsible for communicating with the components'
|
||||
* coordinator as well as managing the business logic for dialog show/hide.
|
||||
@@ -1028,9 +1031,15 @@ public class TabGridDialogMediator
|
||||
return;
|
||||
}
|
||||
|
||||
+ String url = UrlConstants.NTP_URL;
|
||||
+ if (UrlConstants.NTP_URL.equals(url)
|
||||
+ && HomepageManager.getInstance().getPrefNTPIsHomepageEnabled()) {
|
||||
+ GURL gurl = HomepageManager.getInstance().getHomepageGurl();
|
||||
+ url = gurl != null ? gurl.getSpec() : url;
|
||||
+ }
|
||||
TabGroupUtils.openUrlInGroup(
|
||||
mCurrentTabGroupModelFilterSupplier.get(),
|
||||
- UrlConstants.NTP_URL,
|
||||
+ url,
|
||||
currentTab.getId(),
|
||||
TabLaunchType.FROM_TAB_GROUP_UI);
|
||||
RecordUserAction.record("MobileNewTabOpened." + mComponentName);
|
||||
diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiMediator.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiMediator.java
|
||||
--- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiMediator.java
|
||||
+++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGroupUiMediator.java
|
||||
@@ -35,6 +35,7 @@ import org.chromium.chrome.browser.data_sharing.DataSharingServiceFactory;
|
||||
import org.chromium.chrome.browser.data_sharing.ui.shared_image_tiles.SharedImageTilesConfig;
|
||||
import org.chromium.chrome.browser.data_sharing.ui.shared_image_tiles.SharedImageTilesCoordinator;
|
||||
import org.chromium.chrome.browser.layouts.LayoutStateProvider;
|
||||
+import org.chromium.chrome.browser.homepage.HomepageManager;
|
||||
import org.chromium.chrome.browser.layouts.LayoutStateProvider.LayoutStateObserver;
|
||||
import org.chromium.chrome.browser.layouts.LayoutType;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
@@ -415,10 +416,15 @@ public class TabGroupUiMediator implements BackPressHandler {
|
||||
assert relatedTabs.size() > 0;
|
||||
|
||||
Tab parentTabToAttach = relatedTabs.get(relatedTabs.size() - 1);
|
||||
+ String url = UrlConstants.NTP_URL;
|
||||
+ if (HomepageManager.getInstance().getPrefNTPIsHomepageEnabled()) {
|
||||
+ GURL gurl = HomepageManager.getInstance().getHomepageGurl();
|
||||
+ url = gurl != null ? gurl.getSpec() : url;
|
||||
+ }
|
||||
mTabCreatorManager
|
||||
.getTabCreator(currentTab.isIncognito())
|
||||
.createNewTab(
|
||||
- new LoadUrlParams(UrlConstants.NTP_URL),
|
||||
+ new LoadUrlParams(url),
|
||||
TabLaunchType.FROM_TAB_GROUP_UI,
|
||||
parentTabToAttach);
|
||||
RecordUserAction.record(
|
||||
diff --git a/chrome/android/java/res/xml/homepage_preferences.xml b/chrome/android/java/res/xml/homepage_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/homepage_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/homepage_preferences.xml
|
||||
@@ -14,6 +14,11 @@ found in the LICENSE file.
|
||||
android:summaryOn="@string/text_on"
|
||||
android:summaryOff="@string/text_off" />
|
||||
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
+ android:key="ntp_is_homepage_switch"
|
||||
+ android:summaryOn="@string/options_ntp_is_homepage_label"
|
||||
+ android:summaryOff="@string/options_ntp_is_homepage_label" />
|
||||
+
|
||||
<org.chromium.chrome.browser.homepage.settings.RadioButtonGroupHomepagePreference
|
||||
android:key="homepage_radio_group"
|
||||
android:selectable="false"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/TabGroupContextMenuCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/TabGroupContextMenuCoordinator.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/TabGroupContextMenuCoordinator.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/TabGroupContextMenuCoordinator.java
|
||||
@@ -71,6 +71,9 @@ import org.chromium.ui.text.EmptyTextWatcher;
|
||||
import org.chromium.ui.widget.AnchoredPopupWindow.HorizontalOrientation;
|
||||
import org.chromium.ui.widget.RectProvider;
|
||||
|
||||
+import org.chromium.chrome.browser.homepage.HomepageManager;
|
||||
+import org.chromium.url.GURL;
|
||||
+
|
||||
/**
|
||||
* A coordinator for the context menu on the tab strip by long-pressing on the group titles. It is
|
||||
* responsible for creating a list of menu items, setting up the menu and displaying the menu.
|
||||
@@ -208,9 +211,15 @@ public class TabGroupContextMenuCoordinator extends TabGroupOverflowMenuCoordina
|
||||
/* didCloseCallback= */ null);
|
||||
RecordUserAction.record("MobileToolbarTabGroupMenu.DeleteGroup");
|
||||
} else if (menuId == org.chromium.chrome.R.id.open_new_tab_in_group) {
|
||||
+ String url = UrlConstants.NTP_URL;
|
||||
+ if (UrlConstants.NTP_URL.equals(url)
|
||||
+ && HomepageManager.getInstance().getPrefNTPIsHomepageEnabled()) {
|
||||
+ GURL gurl = HomepageManager.getInstance().getHomepageGurl();
|
||||
+ url = gurl != null ? gurl.getSpec() : url;
|
||||
+ }
|
||||
TabGroupUtils.openUrlInGroup(
|
||||
tabGroupModelFilter,
|
||||
- UrlConstants.NTP_URL,
|
||||
+ url,
|
||||
tabId,
|
||||
TabLaunchType.FROM_TAB_GROUP_UI);
|
||||
RecordUserAction.record("MobileToolbarTabGroupMenu.NewTabInGroup");
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java b/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
|
||||
@@ -231,6 +231,22 @@ public class HomepageManager
|
||||
notifyHomepageUpdated();
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Returns the user preference for whether the New Tab Page is the homepage or not.
|
||||
+ *
|
||||
+ */
|
||||
+ public boolean getPrefNTPIsHomepageEnabled() {
|
||||
+ return mSharedPreferencesManager.readBoolean(ChromePreferenceKeys.HOMEPAGE_NTP_IS_HOMEPAGE, false);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the user preference for whether the new tab page is the homepage or not.
|
||||
+ */
|
||||
+ public void setPrefNTPIsHomepageEnabled(boolean enabled) {
|
||||
+ mSharedPreferencesManager.writeBoolean(ChromePreferenceKeys.HOMEPAGE_NTP_IS_HOMEPAGE, enabled);
|
||||
+ notifyHomepageUpdated();
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* @return User specified homepage custom GURL.
|
||||
*/
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java
|
||||
@@ -25,6 +25,7 @@ import org.chromium.components.browser_ui.settings.SettingsUtils;
|
||||
import org.chromium.components.embedder_support.util.UrlUtilities;
|
||||
import org.chromium.components.url_formatter.UrlFormatter;
|
||||
import org.chromium.url.GURL;
|
||||
+import org.chromium.components.embedder_support.util.UrlConstants;
|
||||
|
||||
/** Fragment that allows the user to configure homepage related preferences. */
|
||||
public class HomepageSettings extends ChromeBaseSettingsFragment {
|
||||
@@ -33,6 +34,8 @@ public class HomepageSettings extends ChromeBaseSettingsFragment {
|
||||
@VisibleForTesting
|
||||
public static final String PREF_HOMEPAGE_RADIO_GROUP = "homepage_radio_group";
|
||||
|
||||
+ private static final String PREF_NTP_HOMEPAGE_SWITCH = "ntp_is_homepage_switch";
|
||||
+
|
||||
private HomepageManager mHomepageManager;
|
||||
private RadioButtonGroupHomepagePreference mRadioButtons;
|
||||
private final ObservableSupplierImpl<String> mPageTitle = new ObservableSupplierImpl<>();
|
||||
@@ -69,6 +72,15 @@ public class HomepageSettings extends ChromeBaseSettingsFragment {
|
||||
});
|
||||
mRadioButtons.setupPreferenceValues(createPreferenceValuesForRadioGroup());
|
||||
|
||||
+ ChromeSwitchPreference mNTPIsHomepageSwitch =
|
||||
+ (ChromeSwitchPreference) findPreference(PREF_NTP_HOMEPAGE_SWITCH);
|
||||
+ boolean isHomepageNTPEnabled = mHomepageManager.getPrefNTPIsHomepageEnabled();
|
||||
+ mNTPIsHomepageSwitch.setChecked(isHomepageNTPEnabled);
|
||||
+ mNTPIsHomepageSwitch.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
+ mHomepageManager.setPrefNTPIsHomepageEnabled((boolean) newValue);
|
||||
+ return true;
|
||||
+ });
|
||||
+
|
||||
RecordUserAction.record("Settings.Homepage.Opened");
|
||||
}
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
|
||||
@@ -113,7 +113,6 @@ public class LaunchMetrics {
|
||||
public static void recordHomePageLaunchMetrics(
|
||||
boolean showHomeButton, boolean homepageIsNtp, GURL homepageGurl) {
|
||||
if (homepageGurl.isEmpty()) {
|
||||
- assert !showHomeButton : "Homepage should be disabled for an empty GURL";
|
||||
}
|
||||
LaunchMetricsJni.get()
|
||||
.recordHomePageLaunchMetrics(showHomeButton, homepageIsNtp, homepageGurl);
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
|
||||
@@ -23,6 +23,7 @@ import org.chromium.chrome.browser.app.tab_activity_glue.ReparentingDelegateFact
|
||||
import org.chromium.chrome.browser.app.tab_activity_glue.ReparentingTask;
|
||||
import org.chromium.chrome.browser.compositor.CompositorViewHolder;
|
||||
import org.chromium.chrome.browser.flags.ChromeFeatureList;
|
||||
+import org.chromium.chrome.browser.homepage.HomepageManager;
|
||||
import org.chromium.chrome.browser.prefetch.settings.PreloadPagesSettingsBridge;
|
||||
import org.chromium.chrome.browser.prefetch.settings.PreloadPagesState;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
@@ -530,6 +531,13 @@ public class ChromeTabCreator extends TabCreator
|
||||
* @return the created tab.
|
||||
*/
|
||||
public Tab launchUrl(String url, @TabLaunchType int type, Intent intent, long intentTimestamp) {
|
||||
+ if (!mIncognito && url.equals(UrlConstants.NTP_URL)) {
|
||||
+ if (HomepageManager.getInstance().getPrefNTPIsHomepageEnabled()) {
|
||||
+ GURL gurl = HomepageManager.getInstance().getHomepageGurl();
|
||||
+ url = gurl != null ? gurl.getSpec() : url;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
LoadUrlParams loadUrlParams = new LoadUrlParams(url);
|
||||
loadUrlParams.setIntentReceivedTimestamp(intentTimestamp);
|
||||
return createNewTab(loadUrlParams, type, null, intent);
|
||||
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
|
||||
--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
|
||||
+++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
|
||||
@@ -326,6 +326,7 @@ public final class ChromePreferenceKeys {
|
||||
public static final String HOMEPAGE_USE_CHROME_NTP = "Chrome.Homepage.UseNTP";
|
||||
public static final String HOMEPAGE_USE_DEFAULT_URI = "homepage_partner_enabled";
|
||||
|
||||
+ public static final String HOMEPAGE_NTP_IS_HOMEPAGE = "newtabpage_is_homepage";
|
||||
/** Key used to save homepage location set by enterprise policy */
|
||||
public static final String DEPRECATED_HOMEPAGE_LOCATION_POLICY =
|
||||
"Chrome.Policy.HomepageLocation";
|
||||
diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
|
||||
--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
|
||||
+++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
|
||||
@@ -60,6 +60,7 @@ public class LegacyChromePreferenceKeys {
|
||||
ChromePreferenceKeys.HISTORY_SHOW_HISTORY_INFO,
|
||||
ChromePreferenceKeys.HOMEPAGE_ENABLED,
|
||||
ChromePreferenceKeys.HOMEPAGE_USE_DEFAULT_URI,
|
||||
+ ChromePreferenceKeys.HOMEPAGE_NTP_IS_HOMEPAGE,
|
||||
ChromePreferenceKeys.INCOGNITO_SHORTCUT_ADDED,
|
||||
ChromePreferenceKeys.LATEST_UNSUPPORTED_VERSION,
|
||||
ChromePreferenceKeys.LOCALE_MANAGER_AUTO_SWITCH,
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -1480,6 +1480,9 @@ Your Google account may have other forms of browsing history like searches and a
|
||||
<message name="IDS_CLEAR_BROWSING_DATA_TAB_PERIOD_HOUR" desc="The option to delete browsing data from the last hour.">
|
||||
Last hour
|
||||
</message>
|
||||
+ <message name="IDS_OPTIONS_NTP_IS_HOMEPAGE_LABEL" desc="The label for switch that allows the user to toggle whether opening a new tab leads to the new tab page or the home page.">
|
||||
+ Use for new tabs
|
||||
+ </message>
|
||||
<message name="IDS_CLEAR_BROWSING_DATA_TAB_PERIOD_24_HOURS" desc="The option to delete browsing data from the last 24 hours.">
|
||||
Last 24 hours
|
||||
</message>
|
||||
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -107,6 +107,8 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
|
||||
registry->RegisterBooleanPref(prefs::kPinSplitTabButton, false,
|
||||
pref_registration_flags);
|
||||
+ registry->RegisterBooleanPref(prefs::kNewTabPageIsHomePage, false,
|
||||
+ PrefRegistry::NO_REGISTRATION_FLAGS);
|
||||
|
||||
registry->RegisterInt64Pref(prefs::kDefaultBrowserLastDeclined, 0);
|
||||
registry->RegisterBooleanPref(prefs::kWebAppCreateOnDesktop, true);
|
||||
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -1328,6 +1328,10 @@ inline constexpr char kPinSplitTabButton[] = "browser.pin_split_tab_button";
|
||||
// by enterprise policy.
|
||||
inline constexpr char kGeminiSettings[] = "browser.gemini_settings";
|
||||
|
||||
+// A boolean specifying whether opening a new tab should open the Home page
|
||||
+// instead of the New Tab page.
|
||||
+inline constexpr char kNewTabPageIsHomePage[] = "newtabpage_is_homepage";
|
||||
+
|
||||
// Comma separated list of domain names (e.g. "google.com,school.edu").
|
||||
// When this pref is set, the user will be able to access Google Apps
|
||||
// only using an account that belongs to one of the domains from this pref.
|
||||
--
|
||||
@@ -1,417 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 11 Dec 2017 22:42:11 +0100
|
||||
Subject: Add search engine
|
||||
|
||||
Add a Google search engine that forces languages to English,
|
||||
disable from all its searches RLZ and field experiments querystring parameters.
|
||||
Add DuckDuckGo Lite
|
||||
|
||||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
---
|
||||
.../search_engine_choice/default_favicon.png | Bin 0 -> 903 bytes
|
||||
components/search_engines/BUILD.gn | 3 ++
|
||||
components/search_engines/cromite/BUILD.gn | 12 ++++++
|
||||
.../cromite/cromite_prepopulated_engines.json | 37 ++++++++++++++++++
|
||||
.../search_engine_choice_utils.cc | 5 +--
|
||||
.../search_engines/search_engine_type.h | 5 +++
|
||||
.../template_url_prepopulate_data.cc | 21 +++++++++-
|
||||
.../template_url_prepopulate_data.h | 9 -----
|
||||
tools/json_to_struct/json_to_struct.gni | 9 +++++
|
||||
tools/json_to_struct/json_to_struct.py | 26 ++++++++----
|
||||
tools/json_to_struct/struct_generator.py | 10 +++--
|
||||
tools/variations/fieldtrial_to_struct.py | 4 +-
|
||||
12 files changed, 113 insertions(+), 28 deletions(-)
|
||||
create mode 100644 components/resources/default_100_percent/search_engine_choice/default_favicon.png
|
||||
create mode 100644 components/search_engines/cromite/BUILD.gn
|
||||
create mode 100644 components/search_engines/cromite/cromite_prepopulated_engines.json
|
||||
|
||||
diff --git a/components/resources/default_100_percent/search_engine_choice/default_favicon.png b/components/resources/default_100_percent/search_engine_choice/default_favicon.png
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..6533419f2d6b40f7735054dec62c51ddf1ee1201
|
||||
GIT binary patch
|
||||
literal 903
|
||||
zcmV;219<$2P)<h;3K|Lk000e1NJLTq001xm001xu1^@s6R|5Hm0009{Nkl<Zc-rk*
|
||||
zHI&>u5dJaD%uTpU6K1Ny)MmAo?2~ki?Li;rI(@haGcz+YGo$8ZtH|rstmUBf-W*z<
|
||||
z`LqMyjQ;vbR=naxn4FxTa$SOo%Y^Yq3CiCp`IM5k@HhA$JOj`EJVrBqK*>90<Y$Z!
|
||||
zD&E1~9|C4N=Y0}PoKKzZ=aBLV-UaWB-0*4BX4X}1up41G3JAO#bVTDWd3iku6Hh={
|
||||
zlma?HmsR5(hfh(b^FD*}4@!0sS4zV2hPiHTHz{QUr=p@EW3ne<xuXf?=gfeJ_n_0B
|
||||
z@lJY|QARx>G)Ly==Qj#^Pm*zg`6NIm=nm~RX-}Ss_k_usva+)JncnmH^XI=4jNih$
|
||||
zlz0y|WF4^Se4bG8m@v`L_#mWg6DB6I3T(&-X<X(aWBDC2?f1MT|2uB(BxS%X1$a%k
|
||||
z;1;{ldEPHo!pWN$|21g&X`3k)RVSdZ`1-to+dxbxpx11tSFj1eY4p>FfHecpOCzcg
|
||||
zpNwb+@DsmO2`6iI0DN;)MGkB;0q{--kR#0r9={VIfOiJ&qgPlcQV0O=qNN%EZUkK2
|
||||
zXVWfZ`h5{40I)Gg`DG2UD<uwqtRPHQ`3e=w!vhePgFgO88URJiY>`5mlRG3V0I)IO
|
||||
z^!VFvHvp@&1;F!4TUc<Tw?P23{124aYG2{<#pZ1%U*J~{i~%4NJtI_HQU19p>56LN
|
||||
z%3gt$n(-Z(idK@zIi#qli66~IxloAGzuNPP+NSLfTs{_pT7f^J06kI9KUZ>A$&#d(
|
||||
z+ZUd3gy@cNAuWhQ3vePzWtVK-4H5_<h_y6oOLkRNRsEA)yhw>iqgo-eCg3jF08o2(
|
||||
zV+xr@B`n6nQmpYnUx3CSsDwu5Yyvoe1poxnZ<>do)Aj_?EW-9wQ^cQO=(N_*SpEcF
|
||||
zA!n{N_=ZMrDQ)uj`{u@re$c++TFQW?-c&%T<H_NEl62(&6TL7nfTD(I>Jej=5G2dk
|
||||
zc*-y0$13Q-mVE%=HZZcm54P~5#qa<$Vkc|B{qUnj<Z#y}04P$B=OI-_I^4yL*CEaE
|
||||
zjS0pJfK7T{VJFY4st5f9G(|wnQru>jUSTzPpE5qa;Lv>bM_w_-mwYy_S=Aoxnl--Y
|
||||
d#;<tA>kFnu^?NN9uE_uZ002ovPDHLkV1m60sc!%P
|
||||
|
||||
literal 0
|
||||
HcmV?d00001
|
||||
|
||||
diff --git a/components/search_engines/BUILD.gn b/components/search_engines/BUILD.gn
|
||||
--- a/components/search_engines/BUILD.gn
|
||||
+++ b/components/search_engines/BUILD.gn
|
||||
@@ -72,6 +72,7 @@ static_library("search_engines") {
|
||||
"//third_party/metrics_proto",
|
||||
"//third_party/omnibox_proto",
|
||||
"//third_party/search_engines_data:prepopulated_engines",
|
||||
+ "cromite:cromite_prepopulated_engines",
|
||||
]
|
||||
|
||||
deps = [
|
||||
@@ -163,6 +164,7 @@ source_set("search_engine_utils") {
|
||||
":search_engine_type",
|
||||
"//components/google/core/common",
|
||||
"//third_party/search_engines_data:prepopulated_engines",
|
||||
+ "cromite:cromite_prepopulated_engines",
|
||||
]
|
||||
|
||||
deps = [ "//url" ]
|
||||
@@ -252,6 +254,7 @@ source_set("unit_tests") {
|
||||
"//testing/gmock",
|
||||
"//testing/gtest",
|
||||
"//third_party/search_engines_data:prepopulated_engines",
|
||||
+ "cromite:cromite_prepopulated_engines",
|
||||
"//ui/base",
|
||||
"//url",
|
||||
]
|
||||
diff --git a/components/search_engines/cromite/BUILD.gn b/components/search_engines/cromite/BUILD.gn
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/search_engines/cromite/BUILD.gn
|
||||
@@ -0,0 +1,12 @@
|
||||
+import("//tools/json_to_struct/json_to_struct.gni")
|
||||
+
|
||||
+json_to_struct("cromite_prepopulated_engines") {
|
||||
+ visibility = [ "//components/search_engines:*" ]
|
||||
+
|
||||
+ source = "cromite_prepopulated_engines.json"
|
||||
+ schema_file = "//third_party/search_engines_data/prepopulated_engines_schema.json"
|
||||
+ namespace = "TemplateURLPrepopulateData"
|
||||
+ excludetype = true
|
||||
+
|
||||
+ deps = [ "//base" ]
|
||||
+}
|
||||
diff --git a/components/search_engines/cromite/cromite_prepopulated_engines.json b/components/search_engines/cromite/cromite_prepopulated_engines.json
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/search_engines/cromite/cromite_prepopulated_engines.json
|
||||
@@ -0,0 +1,37 @@
|
||||
+{
|
||||
+ "additionals_includes": {
|
||||
+ "third_party/search_engines_data/resources/definitions/prepopulated_engines.h": ""
|
||||
+ },
|
||||
+ "elements": {
|
||||
+ "duckduckgo_light": {
|
||||
+ "name": "DuckDuckGo Light",
|
||||
+ "keyword": "duckduckgo.com/lite",
|
||||
+ "favicon_url": "https://duckduckgo.com/favicon.ico",
|
||||
+ "search_url": "https://duckduckgo.com/lite/?q={searchTerms}",
|
||||
+ "suggest_url": "https://duckduckgo.com/ac/?q={searchTerms}&type=list",
|
||||
+ "type": "SEARCH_ENGINE_DUCKDUCKGOLIGHT",
|
||||
+ "id": 12
|
||||
+ },
|
||||
+
|
||||
+ "googleen": {
|
||||
+ "name": "Google in English",
|
||||
+ "keyword": "googleen",
|
||||
+ "favicon_url": "https://www.google.com/favicon.ico",
|
||||
+ "search_url": "{google:baseURL}search?q={searchTerms}&ie={inputEncoding}&hl=en",
|
||||
+ "suggest_url": "{google:baseSuggestURL}search?client={google:suggestClient}&q={searchTerms}&hl=en",
|
||||
+ "image_url": "{google:baseURL}searchbyimage/upload?hl=en",
|
||||
+ "new_tab_url": "{google:baseURL}_/chrome/newtab?hl=en&ie={inputEncoding}",
|
||||
+ "contextual_search_url": "{google:baseURL}_/contextualsearch?{google:contextualSearchVersion}{google:contextualSearchContextData}&hl=en",
|
||||
+ "image_url_post_params": "encoded_image={google:imageThumbnail},image_url={google:imageURL},sbisrc={google:imageSearchSource},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight}",
|
||||
+ "alternate_urls": [
|
||||
+ "{google:baseURL}?hl=en#q={searchTerms}",
|
||||
+ "{google:baseURL}search?hl=en#q={searchTerms}",
|
||||
+ "{google:baseURL}webhp?hl=en#q={searchTerms}",
|
||||
+ "{google:baseURL}s?hl=en#q={searchTerms}",
|
||||
+ "{google:baseURL}s?hl=en&q={searchTerms}"
|
||||
+ ],
|
||||
+ "type": "SEARCH_ENGINE_GOOGLE_EN",
|
||||
+ "id": 13
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/components/search_engines/search_engine_choice/search_engine_choice_utils.cc b/components/search_engines/search_engine_choice/search_engine_choice_utils.cc
|
||||
--- a/components/search_engines/search_engine_choice/search_engine_choice_utils.cc
|
||||
+++ b/components/search_engines/search_engine_choice/search_engine_choice_utils.cc
|
||||
@@ -182,10 +182,7 @@ void RecordChoiceScreenDefaultSearchProviderType(
|
||||
}
|
||||
|
||||
void RecordChoiceScreenSelectedIndex(int selected_engine_index) {
|
||||
- base::UmaHistogramExactLinear(
|
||||
- kSearchEngineChoiceScreenSelectedEngineIndexHistogram,
|
||||
- selected_engine_index,
|
||||
- TemplateURLPrepopulateData::kMaxEeaPrepopulatedEngines);
|
||||
+ // do nothing in Cromite
|
||||
}
|
||||
|
||||
void RecordChoiceScreenPositionsCountryMismatch(bool has_mismatch) {
|
||||
diff --git a/components/search_engines/search_engine_type.h b/components/search_engines/search_engine_type.h
|
||||
--- a/components/search_engines/search_engine_type.h
|
||||
+++ b/components/search_engines/search_engine_type.h
|
||||
@@ -97,11 +97,16 @@ enum SearchEngineType {
|
||||
SEARCH_ENGINE_MCAFEE = 77,
|
||||
SEARCH_ENGINE_FREESPOKE = 78,
|
||||
SEARCH_ENGINE_KAGI = 79,
|
||||
+ SEARCH_ENGINE_GOOGLE_EN = 80,
|
||||
+ SEARCH_ENGINE_DUCKDUCKGOLIGHT = 81,
|
||||
|
||||
SEARCH_ENGINE_MAX // Bounding value needed for UMA histogram macro.
|
||||
};
|
||||
// LINT.ThenChange(//tools/metrics/histograms/enums.xml:OmniboxSearchEngineType)
|
||||
|
||||
+static_assert(SEARCH_ENGINE_DUCKDUCKGOLIGHT == (SEARCH_ENGINE_MAX - 1),
|
||||
+ "Please check this patch");
|
||||
+
|
||||
// Enum to record the type of search engine a user used in keyword mode. This
|
||||
// should be kept aligned with the `OmniboxBuiltinEngineType` enum in enums.xml.
|
||||
// Entries should not be renumbered and numeric values should never be reused.
|
||||
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc
|
||||
--- a/components/search_engines/template_url_prepopulate_data.cc
|
||||
+++ b/components/search_engines/template_url_prepopulate_data.cc
|
||||
@@ -28,6 +28,8 @@
|
||||
#include "components/search_engines/template_url_data_util.h"
|
||||
#include "third_party/search_engines_data/resources/definitions/prepopulated_engines.h"
|
||||
|
||||
+#include "components/search_engines/cromite/cromite_prepopulated_engines.h"
|
||||
+
|
||||
namespace TemplateURLPrepopulateData {
|
||||
|
||||
// Helpers --------------------------------------------------------------------
|
||||
@@ -123,7 +125,7 @@ int GetDataVersion(PrefService* prefs) {
|
||||
kCurrentDataVersion;
|
||||
}
|
||||
|
||||
-std::vector<std::unique_ptr<TemplateURLData>> GetPrepopulatedEngines(
|
||||
+std::vector<std::unique_ptr<TemplateURLData>> GetPrepopulatedEnginesChromium(
|
||||
PrefService& prefs,
|
||||
std::vector<const TemplateURLPrepopulateData::PrepopulatedEngine*>
|
||||
regional_prepopulated_engines) {
|
||||
@@ -139,6 +141,17 @@ std::vector<std::unique_ptr<TemplateURLData>> GetPrepopulatedEngines(
|
||||
&PrepopulatedEngineToTemplateURLData);
|
||||
}
|
||||
|
||||
+std::vector<std::unique_ptr<TemplateURLData>> GetPrepopulatedEngines(
|
||||
+ PrefService& prefs,
|
||||
+ std::vector<const TemplateURLPrepopulateData::PrepopulatedEngine*>
|
||||
+ regional_prepopulated_engines) {
|
||||
+ std::vector<std::unique_ptr<TemplateURLData>> t_urls =
|
||||
+ GetPrepopulatedEnginesChromium(prefs, regional_prepopulated_engines);
|
||||
+ t_urls.push_back(TemplateURLDataFromPrepopulatedEngine(googleen));
|
||||
+ t_urls.push_back(TemplateURLDataFromPrepopulatedEngine(duckduckgo_light));
|
||||
+ return t_urls;
|
||||
+}
|
||||
+
|
||||
std::unique_ptr<TemplateURLData> GetPrepopulatedEngine(
|
||||
PrefService& prefs,
|
||||
std::vector<const TemplateURLPrepopulateData::PrepopulatedEngine*>
|
||||
@@ -160,9 +173,13 @@ std::vector<std::unique_ptr<TemplateURLData>> GetLocalPrepopulatedEngines(
|
||||
return std::vector<std::unique_ptr<TemplateURLData>>();
|
||||
}
|
||||
|
||||
- return base::ToVector(
|
||||
+ std::vector<std::unique_ptr<TemplateURLData>> t_urls =
|
||||
+ base::ToVector(
|
||||
regional_capabilities::GetPrepopulatedEngines(country_id, prefs),
|
||||
&PrepopulatedEngineToTemplateURLData);
|
||||
+ t_urls.push_back(TemplateURLDataFromPrepopulatedEngine(googleen));
|
||||
+ t_urls.push_back(TemplateURLDataFromPrepopulatedEngine(duckduckgo_light));
|
||||
+ return t_urls;
|
||||
}
|
||||
|
||||
#endif
|
||||
diff --git a/components/search_engines/template_url_prepopulate_data.h b/components/search_engines/template_url_prepopulate_data.h
|
||||
--- a/components/search_engines/template_url_prepopulate_data.h
|
||||
+++ b/components/search_engines/template_url_prepopulate_data.h
|
||||
@@ -27,15 +27,6 @@ struct PrepopulatedEngine;
|
||||
|
||||
extern const int kMaxPrepopulatedEngineID;
|
||||
|
||||
-// The maximum number of prepopulated search engines that can be returned in
|
||||
-// any of the EEA countries by `GetPrepopulatedEngines()`.
|
||||
-//
|
||||
-// Note: If this is increased, please also increase the declared variant count
|
||||
-// for the `Search.ChoiceScreenShowedEngineAt.Index{Index}` histogram.
|
||||
-// TODO(crbug.com/408932087): Investigate moving it to the file that actually
|
||||
-// populates these, `//c/regional_capabilities/r*c*_util.cc`.
|
||||
-inline constexpr size_t kMaxEeaPrepopulatedEngines = 8;
|
||||
-
|
||||
// The maximum number of prepopulated search engines that can be returned in
|
||||
// in the rest of the world by `GetPrepopulatedEngines()`.
|
||||
// TODO(crbug.com/408932087): Investigate deduping it with the constant
|
||||
diff --git a/tools/json_to_struct/json_to_struct.gni b/tools/json_to_struct/json_to_struct.gni
|
||||
--- a/tools/json_to_struct/json_to_struct.gni
|
||||
+++ b/tools/json_to_struct/json_to_struct.gni
|
||||
@@ -39,6 +39,11 @@ template("json_to_struct") {
|
||||
action_name = target_name + "_action"
|
||||
source_set_name = target_name
|
||||
|
||||
+ excludetype = false
|
||||
+ if (defined(invoker.excludetype)) {
|
||||
+ excludetype = invoker.excludetype
|
||||
+ }
|
||||
+
|
||||
action(action_name) {
|
||||
visibility = [ ":$source_set_name" ]
|
||||
script = "//build/gn_run_binary.py"
|
||||
@@ -63,6 +68,10 @@ template("json_to_struct") {
|
||||
"--namespace=" + invoker.namespace,
|
||||
"--schema=" + rebase_path(invoker.schema_file, root_build_dir),
|
||||
]
|
||||
+
|
||||
+ if (excludetype) {
|
||||
+ args += [ "--excludetype=yes" ]
|
||||
+ }
|
||||
}
|
||||
|
||||
source_set(source_set_name) {
|
||||
diff --git a/tools/json_to_struct/json_to_struct.py b/tools/json_to_struct/json_to_struct.py
|
||||
--- a/tools/json_to_struct/json_to_struct.py
|
||||
+++ b/tools/json_to_struct/json_to_struct.py
|
||||
@@ -103,7 +103,7 @@ def _GenerateHeaderGuard(h_filename):
|
||||
return re.sub(u'^_*', '', result) + u'_' # Remove leading underscores.
|
||||
|
||||
|
||||
-def _GenerateH(basepath, fileroot, head, namespace, schema, description):
|
||||
+def _GenerateH(basepath, fileroot, head, namespace, schema, description, excludetype):
|
||||
"""Generates the .h file containing the definition of the structure specified
|
||||
by the schema.
|
||||
|
||||
@@ -147,11 +147,15 @@ def _GenerateH(basepath, fileroot, head, namespace, schema, description):
|
||||
f.write(u'#include "%s"\n' % header)
|
||||
f.write(u'\n')
|
||||
|
||||
+ for header in description.get(u'additionals_includes', []):
|
||||
+ f.write(u'#include "%s"\n' % header)
|
||||
+ f.write(u'\n')
|
||||
+
|
||||
if namespace:
|
||||
f.write(u'namespace %s {\n' % namespace)
|
||||
f.write(u'\n')
|
||||
|
||||
- f.write(struct_generator.GenerateStruct(
|
||||
+ f.write(struct_generator.GenerateStruct(excludetype,
|
||||
schema['type_name'], schema['schema']))
|
||||
f.write(u'\n')
|
||||
|
||||
@@ -176,7 +180,7 @@ def _GenerateH(basepath, fileroot, head, namespace, schema, description):
|
||||
f.write(u'#endif // %s\n' % header_guard)
|
||||
|
||||
|
||||
-def _GenerateCC(basepath, fileroot, head, namespace, schema, description):
|
||||
+def _GenerateCC(basepath, fileroot, head, namespace, schema, description, excludetype):
|
||||
"""Generates the .cc file containing the static initializers for the
|
||||
of the elements specified in the description.
|
||||
|
||||
@@ -211,7 +215,7 @@ def _GenerateCC(basepath, fileroot, head, namespace, schema, description):
|
||||
f.write(element_generator.GenerateElements(schema['type_name'],
|
||||
schema['schema'], description))
|
||||
|
||||
- if not aggregation.export_items:
|
||||
+ if excludetype == False and not aggregation.export_items:
|
||||
f.write('\n} // anonymous namespace \n\n')
|
||||
|
||||
aggregated = GenerateCCAggregation(schema['type_name'], aggregation)
|
||||
@@ -298,7 +302,7 @@ def GenerateClass(basepath,
|
||||
|
||||
|
||||
def GenerateStruct(basepath, output_root, namespace, schema, description,
|
||||
- description_filename, schema_filename, year=None):
|
||||
+ description_filename, schema_filename, excludetype, year):
|
||||
"""Generates a C++ struct from a JSON description.
|
||||
|
||||
Args:
|
||||
@@ -317,8 +321,8 @@ def GenerateStruct(basepath, output_root, namespace, schema, description,
|
||||
"""
|
||||
year = int(year) if year else datetime.now().year
|
||||
head = HEAD % (year, schema_filename, description_filename)
|
||||
- _GenerateH(basepath, output_root, head, namespace, schema, description)
|
||||
- _GenerateCC(basepath, output_root, head, namespace, schema, description)
|
||||
+ _GenerateH(basepath, output_root, head, namespace, schema, description, excludetype)
|
||||
+ _GenerateCC(basepath, output_root, head, namespace, schema, description, excludetype)
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = optparse.OptionParser(
|
||||
@@ -333,11 +337,17 @@ if __name__ == '__main__':
|
||||
parser.add_option('-s', '--schema', help='path to the schema file, '
|
||||
'mandatory.')
|
||||
parser.add_option('-o', '--output', help='output filename, ')
|
||||
+ parser.add_option('-x', '--excludetype', help='exclude type generator, ')
|
||||
(opts, args) = parser.parse_args()
|
||||
|
||||
if not opts.schema:
|
||||
parser.error('You must specify a --schema.')
|
||||
|
||||
+ if not opts.excludetype:
|
||||
+ opts.excludetype = False
|
||||
+ else:
|
||||
+ opts.excludetype = True
|
||||
+
|
||||
description_filename = os.path.normpath(args[0])
|
||||
root, ext = os.path.splitext(description_filename)
|
||||
shortroot = opts.output if opts.output else os.path.split(root)[1]
|
||||
@@ -354,4 +364,4 @@ if __name__ == '__main__':
|
||||
schema = _Load(opts.schema)
|
||||
description = _Load(description_filename)
|
||||
GenerateStruct(basepath, output_root, opts.namespace, schema, description,
|
||||
- description_filename, opts.schema)
|
||||
+ description_filename, opts.schema, opts.excludetype, datetime.now().year)
|
||||
diff --git a/tools/json_to_struct/struct_generator.py b/tools/json_to_struct/struct_generator.py
|
||||
--- a/tools/json_to_struct/struct_generator.py
|
||||
+++ b/tools/json_to_struct/struct_generator.py
|
||||
@@ -30,20 +30,24 @@ def GenerateField(field_info):
|
||||
else:
|
||||
raise RuntimeError('Unknown field type "%s"' % type)
|
||||
|
||||
-def GenerateStruct(type_name, schema):
|
||||
+def GenerateStruct(excludetype, type_name, schema):
|
||||
"""Generate a string defining a structure containing the fields specified in
|
||||
the schema list.
|
||||
"""
|
||||
lines = []
|
||||
+ if excludetype:
|
||||
+ lines.append('struct %s;' % type_name)
|
||||
+ return '\n'.join(lines) + '\n'
|
||||
+
|
||||
lines.append('struct %s {' % type_name)
|
||||
for field_info in schema:
|
||||
if field_info['type'] == 'struct':
|
||||
- lines.insert(0, GenerateStruct(field_info['type_name'],
|
||||
+ lines.insert(0, GenerateStruct(excludetype, field_info['type_name'],
|
||||
field_info['fields']))
|
||||
elif (field_info['type'] == 'array'
|
||||
and field_info['contents']['type'] == 'struct'):
|
||||
contents = field_info['contents']
|
||||
- lines.insert(0, GenerateStruct(contents['type_name'],
|
||||
+ lines.insert(0, GenerateStruct(excludetype, contents['type_name'],
|
||||
contents['fields']))
|
||||
lines.append(' ' + GenerateField(field_info) + ';')
|
||||
lines.append('};')
|
||||
diff --git a/tools/variations/fieldtrial_to_struct.py b/tools/variations/fieldtrial_to_struct.py
|
||||
--- a/tools/variations/fieldtrial_to_struct.py
|
||||
+++ b/tools/variations/fieldtrial_to_struct.py
|
||||
@@ -235,14 +235,14 @@ def main(arguments):
|
||||
json_to_struct.GenerateStruct(
|
||||
basepath, output_root, opts.namespace, schema, description,
|
||||
os.path.split(description_filename)[1], os.path.split(opts.schema)[1],
|
||||
- opts.year)
|
||||
+ False, opts.year)
|
||||
|
||||
# TODO(peilinwang) filter the schema by platform, form_factor, etc.
|
||||
if opts.java:
|
||||
json_to_struct.GenerateClass(basepath, output_root, opts.namespace, schema,
|
||||
description,
|
||||
os.path.split(description_filename)[1],
|
||||
- os.path.split(opts.schema)[1], opts.year)
|
||||
+ os.path.split(opts.schema)[1], False, opts.year)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
--
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,595 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Wed, 12 Apr 2023 08:22:00 +0000
|
||||
Subject: Add setting to invert tap and long tap
|
||||
|
||||
Reverses single tap to long tap in android for accessibility reasons.
|
||||
The feature can be activated from the accessibility settings.
|
||||
|
||||
Need: bromite-build-utils.patch
|
||||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
---
|
||||
.../AwContextMenuItemDelegate.java | 4 +++
|
||||
chrome/android/java/res/values/ids.xml | 1 +
|
||||
.../ChromeAccessibilitySettingsDelegate.java | 18 ++++++++++
|
||||
.../contextmenu/ChromeContextMenuItem.java | 5 ++-
|
||||
.../ChromeContextMenuPopulator.java | 5 +++
|
||||
.../tab/TabContextMenuItemDelegate.java | 8 +++++
|
||||
.../flags/android/chrome_feature_list.cc | 1 +
|
||||
.../browser/flags/ChromeFeatureList.java | 5 +++
|
||||
.../strings/android_chrome_strings.grd | 9 +++++
|
||||
.../res/xml/accessibility_preferences.xml | 5 +++
|
||||
.../accessibility/AccessibilitySettings.java | 12 +++++++
|
||||
.../AccessibilitySettingsDelegate.java | 2 ++
|
||||
.../contextmenu/ContextMenuItemDelegate.java | 3 ++
|
||||
...Add-setting-to-invert-tap-and-long-tap.inc | 8 +++++
|
||||
...Add-setting-to-invert-tap-and-long-tap.inc | 3 ++
|
||||
...Add-setting-to-invert-tap-and-long-tap.inc | 1 +
|
||||
.../renderer/core/html/html_anchor_element.cc | 36 +++++++++++++++----
|
||||
.../renderer/core/html/html_anchor_element.h | 7 +++-
|
||||
.../renderer/core/html/html_image_element.cc | 17 +++++++++
|
||||
.../renderer/core/html/html_image_element.h | 2 ++
|
||||
.../core/page/context_menu_controller.cc | 33 ++++++++++++-----
|
||||
.../core/page/context_menu_controller.h | 5 +--
|
||||
22 files changed, 170 insertions(+), 20 deletions(-)
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-setting-to-invert-tap-and-long-tap.inc
|
||||
create mode 100644 cromite_flags/third_party/blink/common/features_cc/Add-setting-to-invert-tap-and-long-tap.inc
|
||||
create mode 100644 cromite_flags/third_party/blink/common/features_h/Add-setting-to-invert-tap-and-long-tap.inc
|
||||
|
||||
diff --git a/android_webview/java/src/org/chromium/android_webview/contextmenu/AwContextMenuItemDelegate.java b/android_webview/java/src/org/chromium/android_webview/contextmenu/AwContextMenuItemDelegate.java
|
||||
--- a/android_webview/java/src/org/chromium/android_webview/contextmenu/AwContextMenuItemDelegate.java
|
||||
+++ b/android_webview/java/src/org/chromium/android_webview/contextmenu/AwContextMenuItemDelegate.java
|
||||
@@ -12,6 +12,7 @@ import org.chromium.base.IntentUtils;
|
||||
import org.chromium.build.annotations.NullMarked;
|
||||
import org.chromium.components.embedder_support.contextmenu.ContextMenuItemDelegate;
|
||||
import org.chromium.components.embedder_support.contextmenu.ContextMenuParams;
|
||||
+import org.chromium.content_public.common.Referrer;
|
||||
import org.chromium.content_public.browser.WebContents;
|
||||
import org.chromium.ui.base.Clipboard;
|
||||
import org.chromium.url.GURL;
|
||||
@@ -54,6 +55,9 @@ public class AwContextMenuItemDelegate implements ContextMenuItemDelegate {
|
||||
IntentUtils.safeStartActivity(mActivity, intent);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void onOpenUrl(GURL url, Referrer referrer) { }
|
||||
+
|
||||
@Override
|
||||
public GURL getPageUrl() {
|
||||
return mWebContents.getVisibleUrl();
|
||||
diff --git a/chrome/android/java/res/values/ids.xml b/chrome/android/java/res/values/ids.xml
|
||||
--- a/chrome/android/java/res/values/ids.xml
|
||||
+++ b/chrome/android/java/res/values/ids.xml
|
||||
@@ -104,6 +104,7 @@ found in the LICENSE file.
|
||||
|
||||
<!-- Menu item IDs for FullscreenActivities -->
|
||||
<item type="id" name="contextmenu_open_in_chrome" />
|
||||
+ <item type="id" name="contextmenu_open_in_tab" />
|
||||
|
||||
<!-- Tags -->
|
||||
<item type="id" name="highlight_color" />
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/ChromeAccessibilitySettingsDelegate.java
|
||||
@@ -165,6 +165,24 @@ public class ChromeAccessibilitySettingsDelegate implements AccessibilitySetting
|
||||
mSnackbarManagerSupplier.get().showSnackbar(mSnackbar);
|
||||
}
|
||||
|
||||
+ private static class ShowAlwaysContextMenuOnLinksDelegate implements BooleanPreferenceDelegate {
|
||||
+ @Override
|
||||
+ public boolean getValue() {
|
||||
+ return ChromeFeatureList.sShowAlwaysContextMenuOnLinks.isEnabled();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setValue(boolean value) {
|
||||
+ CromiteNativeUtils.setFlagEnabled(ChromeFeatureList.SHOW_ALWAYS_CONTEXT_MENU_ON_LINKS,
|
||||
+ "show-always-context-menu-on-links", value);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public BooleanPreferenceDelegate getShowAlwaysContextMenuOnLinksDelegate() {
|
||||
+ return new ShowAlwaysContextMenuOnLinksDelegate();
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public BrowserContextHandle getBrowserContextHandle() {
|
||||
return mProfile;
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItem.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItem.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItem.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuItem.java
|
||||
@@ -123,8 +123,9 @@ class ChromeContextMenuItem {
|
||||
int PRINT_PAGE = 38;
|
||||
// Developer Group
|
||||
int INSPECT_ELEMENT = 39;
|
||||
+ int FOLLOW_LINK = 40;
|
||||
// ALWAYS UPDATE!
|
||||
- int NUM_ENTRIES = 40;
|
||||
+ int NUM_ENTRIES = 41;
|
||||
}
|
||||
|
||||
/** Mapping from {@link Item} to the ID found in the ids.xml. */
|
||||
@@ -169,6 +170,7 @@ class ChromeContextMenuItem {
|
||||
R.id.contextmenu_share_page, // Item.SHARE_PAGE
|
||||
R.id.contextmenu_print_page, // Item.PRINT_PAGE
|
||||
R.id.contextmenu_inspect_element, // Item.INSPECT_ELEMENT
|
||||
+ R.id.contextmenu_open_in_tab, // Item.OPEN_IN_NEW_CHROME_TAB
|
||||
};
|
||||
|
||||
/** Mapping from {@link Item} to the ID of the string that describes the action of the item. */
|
||||
@@ -213,6 +215,7 @@ class ChromeContextMenuItem {
|
||||
R.string.contextmenu_share_page, // Item.SHARE_PAGE
|
||||
R.string.contextmenu_print_page, // Item.PRINT_PAGE
|
||||
R.string.contextmenu_inspect_element, // Item.INSPECT_ELEMENT
|
||||
+ R.string.contextmenu_open_in_tab, // Item.OPEN_IN_NEW_CHROME_TAB
|
||||
};
|
||||
|
||||
/**
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
|
||||
@@ -369,6 +369,9 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
|
||||
}
|
||||
if (mParams.isAnchor()) {
|
||||
ModelList linkGroup = new ModelList();
|
||||
+ if (ChromeFeatureList.sShowAlwaysContextMenuOnLinks.isEnabled()) {
|
||||
+ linkGroup.add(createListItem(Item.FOLLOW_LINK));
|
||||
+ }
|
||||
if (FirstRunStatus.getFirstRunFlowComplete()
|
||||
&& !isEmptyUrl(mParams.getUrl())
|
||||
&& UrlUtilities.isAcceptedScheme(mParams.getUrl())) {
|
||||
@@ -834,6 +837,8 @@ public class ChromeContextMenuPopulator implements ContextMenuPopulator {
|
||||
getProfile(),
|
||||
false);
|
||||
});
|
||||
+ } else if (itemId == R.id.contextmenu_open_in_tab) {
|
||||
+ mItemDelegate.onOpenUrl(mParams.getUrl(), mParams.getReferrer());
|
||||
} else if (itemId == R.id.contextmenu_open_in_chrome) {
|
||||
recordContextMenuSelection(ContextMenuUma.Action.OPEN_IN_CHROME);
|
||||
mItemDelegate.onOpenInChrome(mParams.getUrl(), mParams.getPageUrl());
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
|
||||
@@ -356,6 +356,14 @@ public class TabContextMenuItemDelegate implements ContextMenuItemDelegate {
|
||||
mTab.loadUrl(loadUrlParams);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void onOpenUrl(GURL url, Referrer referrer) {
|
||||
+ LoadUrlParams loadUrlParams = new LoadUrlParams(url.getSpec());
|
||||
+ loadUrlParams.setTransitionType(PageTransition.LINK);
|
||||
+ loadUrlParams.setReferrer(referrer);
|
||||
+ mTab.loadUrl(loadUrlParams);
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Called when the {@code url} is of an image and should be opened in a new page.
|
||||
*
|
||||
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
--- a/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
|
||||
@@ -382,6 +382,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
|
||||
&kTabGroupParityBottomSheetAndroid,
|
||||
&kTabletTabStripAnimation,
|
||||
&kToolbarPhoneCleanup,
|
||||
+ &blink::features::kShowAlwaysContextMenuOnLinks,
|
||||
&kTabStateFlatBuffer,
|
||||
&kTabStripContextMenuAndroid,
|
||||
&kTabStripDensityChangeAndroid,
|
||||
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
|
||||
--- 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
|
||||
@@ -455,6 +455,8 @@ public abstract class ChromeFeatureList {
|
||||
"DisableToolbarSwipeUp";
|
||||
public static final String MOVE_TOP_TOOLBAR_TO_BOTTOM =
|
||||
"MoveTopToolbarToBottom";
|
||||
+ public static final String SHOW_ALWAYS_CONTEXT_MENU_ON_LINKS =
|
||||
+ "ShowAlwaysContextMenuOnLinks";
|
||||
public static final String NEW_TAB_PAGE_CUSTOMIZATION_TOOLBAR_BUTTON =
|
||||
"NewTabPageCustomizationToolbarButton";
|
||||
public static final String NOTIFICATION_ONE_TAP_UNSUBSCRIBE = "NotificationOneTapUnsubscribe";
|
||||
@@ -868,6 +870,8 @@ public abstract class ChromeFeatureList {
|
||||
newCachedFlag(DISABLE_TOOLBAR_SWIPE_UP, false);
|
||||
public static final CachedFlag sMoveTopToolbarToBottom =
|
||||
newCachedFlag(MOVE_TOP_TOOLBAR_TO_BOTTOM, false);
|
||||
+ public static final CachedFlag sShowAlwaysContextMenuOnLinks =
|
||||
+ newCachedFlag(SHOW_ALWAYS_CONTEXT_MENU_ON_LINKS, false);
|
||||
public static final CachedFlag sPaintPreviewDemo = newCachedFlag(PAINT_PREVIEW_DEMO, false);
|
||||
public static final CachedFlag sPostGetMyMemoryStateToBackground =
|
||||
newCachedFlag(POST_GET_MEMORY_PRESSURE_TO_BACKGROUND, true);
|
||||
@@ -1072,6 +1076,7 @@ public abstract class ChromeFeatureList {
|
||||
sTabWindowManagerReportIndicesMismatch,
|
||||
sTopControlsRefactor,
|
||||
sTraceBinderIpc,
|
||||
+ sShowAlwaysContextMenuOnLinks,
|
||||
sUseChimeAndroidSdk,
|
||||
sUseActivityManagerForTabActivation,
|
||||
sUseLibunwindstackNativeUnwinderAndroid,
|
||||
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
|
||||
@@ -1719,6 +1719,12 @@ Your Google account may have other forms of browsing history like searches and a
|
||||
<message name="IDS_DISABLE_TOOLBAR_SWIPE_UP" desc="Summary of the preference that allows the user to disable toolbar swipeup.">
|
||||
Disable toolbar swipe up
|
||||
</message>
|
||||
+ <message name="IDS_ALWAYS_SHOW_CONTEXTMENU_ON_LINKS_TITLE" desc="Title of the preference that open the context menu in links.">
|
||||
+ Always open the context menu in the links
|
||||
+ </message>
|
||||
+ <message name="IDS_ALWAYS_SHOW_CONTEXTMENU_ON_LINKS_SUMMARY" desc="Summary of the preference that open the context menu in links.">
|
||||
+ Allows the context menu to be opened with a tap and follow the link with long press
|
||||
+ </message>
|
||||
|
||||
<!-- Safety check -->
|
||||
<message name="IDS_PREFS_SAFETY_CHECK" desc="Title of the Safety check element in settings, allowing the user to check multiple areas of browser safety. [CHAR_LIMIT=32]">
|
||||
@@ -3330,6 +3336,9 @@ To change this setting, <ph name="BEGIN_LINK">BEGIN_LINK</ph>delete the Chrome d
|
||||
<message name="IDS_CONTEXTMENU_OPEN_IN_NEW_CHROME_TAB" desc="Context sensitive menu item to open the selected link in a new Chrome tab from Chrome Custom Tab. [CHAR_LIMIT=30]">
|
||||
Open in new Chrome tab
|
||||
</message>
|
||||
+ <message name="IDS_CONTEXTMENU_OPEN_IN_TAB" desc="Context sensitive menu item to open the selected link in tab. [CHAR_LIMIT=30]">
|
||||
+ Open in current tab
|
||||
+ </message>
|
||||
<message name="IDS_CONTEXTMENU_OPEN_IN_CHROME_INCOGNITO_TAB" desc="Context sensitive menu item to open the selected link in a Chrome Incognito tab from Chrome Custom Tab. [CHAR_LIMIT=30]">
|
||||
Open in Incognito tab
|
||||
</message>
|
||||
diff --git a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml
|
||||
--- a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml
|
||||
+++ b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml
|
||||
@@ -31,6 +31,11 @@ found in the LICENSE file.
|
||||
android:summary="@string/page_zoom_always_show_preference_summary"
|
||||
android:title="@string/page_zoom_always_show_preference_title" />
|
||||
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
+ android:key="always_show_contextmenu_on_links"
|
||||
+ android:summary="@string/always_show_contextmenu_on_links_summary"
|
||||
+ android:title="@string/always_show_contextmenu_on_links_title" />
|
||||
+
|
||||
<org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
android:key="force_enable_zoom"
|
||||
android:summary="@string/force_enable_zoom_summary"
|
||||
diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java
|
||||
--- a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java
|
||||
+++ b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettings.java
|
||||
@@ -53,6 +53,9 @@ public class AccessibilitySettings extends ChromeBaseSettingsFragment
|
||||
private BooleanPreferenceDelegate mMoveTopToolbarToBottomDelegate;
|
||||
private BooleanPreferenceDelegate mDisableToolbarSwipeUpDelegate;
|
||||
|
||||
+ static final String PREF_ALWAYS_SHOW_CONTEXTMENU_ON_LINKS = "always_show_contextmenu_on_links";
|
||||
+ private BooleanPreferenceDelegate mShowAlwaysContextMenuOnLinksDelegate;
|
||||
+
|
||||
private PageZoomPreference mPageZoomDefaultZoomPref;
|
||||
private ChromeSwitchPreference mPageZoomIncludeOSAdjustment;
|
||||
private ChromeSwitchPreference mPageZoomAlwaysShowPref;
|
||||
@@ -139,6 +142,12 @@ public class AccessibilitySettings extends ChromeBaseSettingsFragment
|
||||
mDisableToolbarSwipeUpPref.setChecked(mDisableToolbarSwipeUpDelegate.getValue());
|
||||
mDisableToolbarSwipeUpPref.setOnPreferenceChangeListener(this);
|
||||
|
||||
+ ChromeSwitchPreference mShowAlwaysContextMenuOnLinksPref =
|
||||
+ (ChromeSwitchPreference) findPreference(PREF_ALWAYS_SHOW_CONTEXTMENU_ON_LINKS);
|
||||
+ mShowAlwaysContextMenuOnLinksDelegate = mDelegate.getShowAlwaysContextMenuOnLinksDelegate();
|
||||
+ mShowAlwaysContextMenuOnLinksPref.setChecked(mShowAlwaysContextMenuOnLinksDelegate.getValue());
|
||||
+ mShowAlwaysContextMenuOnLinksPref.setOnPreferenceChangeListener(this);
|
||||
+
|
||||
Preference captions = findPreference(PREF_CAPTIONS);
|
||||
captions.setOnPreferenceClickListener(
|
||||
preference -> {
|
||||
@@ -220,6 +229,9 @@ public class AccessibilitySettings extends ChromeBaseSettingsFragment
|
||||
} else if (PREF_DISABLE_TOOLBAR_SWIPE_UP.equals(preference.getKey())) {
|
||||
mDisableToolbarSwipeUpDelegate.setValue((Boolean) newValue);
|
||||
mDelegate.requestRestart(getActivity());
|
||||
+ } else if (PREF_ALWAYS_SHOW_CONTEXTMENU_ON_LINKS.equals(preference.getKey())) {
|
||||
+ mShowAlwaysContextMenuOnLinksDelegate.setValue((Boolean) newValue);
|
||||
+ mDelegate.requestRestart(getActivity());
|
||||
} else if (PREF_PAGE_ZOOM_INCLUDE_OS_ADJUSTMENT.equals(preference.getKey())) {
|
||||
// TODO(mschillaci): Implement the override behavior for OS level.
|
||||
} else if (OmniboxFeatures.KEY_JUMP_START_OMNIBOX.equals(preference.getKey())) {
|
||||
diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java
|
||||
--- a/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java
|
||||
+++ b/components/browser_ui/accessibility/android/java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java
|
||||
@@ -45,6 +45,8 @@ public interface AccessibilitySettingsDelegate {
|
||||
BooleanPreferenceDelegate getMoveTopToolbarToBottomDelegate();
|
||||
BooleanPreferenceDelegate getDisableToolbarSwipeUpDelegate();
|
||||
|
||||
+ BooleanPreferenceDelegate getShowAlwaysContextMenuOnLinksDelegate();
|
||||
+
|
||||
/**
|
||||
* @return The BrowserContextHandle that should be used to read and update settings.
|
||||
*/
|
||||
diff --git a/components/embedder_support/android/java/src/org/chromium/components/embedder_support/contextmenu/ContextMenuItemDelegate.java b/components/embedder_support/android/java/src/org/chromium/components/embedder_support/contextmenu/ContextMenuItemDelegate.java
|
||||
--- a/components/embedder_support/android/java/src/org/chromium/components/embedder_support/contextmenu/ContextMenuItemDelegate.java
|
||||
+++ b/components/embedder_support/android/java/src/org/chromium/components/embedder_support/contextmenu/ContextMenuItemDelegate.java
|
||||
@@ -10,6 +10,7 @@ import androidx.annotation.IntDef;
|
||||
|
||||
import org.chromium.build.annotations.NullMarked;
|
||||
import org.chromium.content_public.browser.WebContents;
|
||||
+import org.chromium.content_public.common.Referrer;
|
||||
import org.chromium.url.GURL;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
@@ -150,6 +151,8 @@ public interface ContextMenuItemDelegate {
|
||||
*/
|
||||
GURL getPageUrl();
|
||||
|
||||
+ void onOpenUrl(GURL url, Referrer referrer);
|
||||
+
|
||||
/**
|
||||
* Called when the current embedder app is not the default to handle a View Intent.
|
||||
*
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-setting-to-invert-tap-and-long-tap.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-setting-to-invert-tap-and-long-tap.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/Add-setting-to-invert-tap-and-long-tap.inc
|
||||
@@ -0,0 +1,8 @@
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
+ {"show-always-context-menu-on-links",
|
||||
+ "Always show contextmenu on links",
|
||||
+ "Use accessibility settings to set it.", kOsAndroid,
|
||||
+ FEATURE_VALUE_TYPE(blink::features::kShowAlwaysContextMenuOnLinks)},
|
||||
+
|
||||
+#endif
|
||||
diff --git a/cromite_flags/third_party/blink/common/features_cc/Add-setting-to-invert-tap-and-long-tap.inc b/cromite_flags/third_party/blink/common/features_cc/Add-setting-to-invert-tap-and-long-tap.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/third_party/blink/common/features_cc/Add-setting-to-invert-tap-and-long-tap.inc
|
||||
@@ -0,0 +1,3 @@
|
||||
+CROMITE_FEATURE(kShowAlwaysContextMenuOnLinks,
|
||||
+ "ShowAlwaysContextMenuOnLinks",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
diff --git a/cromite_flags/third_party/blink/common/features_h/Add-setting-to-invert-tap-and-long-tap.inc b/cromite_flags/third_party/blink/common/features_h/Add-setting-to-invert-tap-and-long-tap.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/third_party/blink/common/features_h/Add-setting-to-invert-tap-and-long-tap.inc
|
||||
@@ -0,0 +1 @@
|
||||
+BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kShowAlwaysContextMenuOnLinks);
|
||||
diff --git a/third_party/blink/renderer/core/html/html_anchor_element.cc b/third_party/blink/renderer/core/html/html_anchor_element.cc
|
||||
--- a/third_party/blink/renderer/core/html/html_anchor_element.cc
|
||||
+++ b/third_party/blink/renderer/core/html/html_anchor_element.cc
|
||||
@@ -66,6 +66,7 @@
|
||||
#include "third_party/blink/renderer/core/loader/render_blocking_resource_manager.h"
|
||||
#include "third_party/blink/renderer/core/navigation_api/navigation_api.h"
|
||||
#include "third_party/blink/renderer/core/page/chrome_client.h"
|
||||
+#include "third_party/blink/renderer/core/page/context_menu_controller.h"
|
||||
#include "third_party/blink/renderer/core/page/page.h"
|
||||
#include "third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h"
|
||||
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
|
||||
@@ -500,6 +501,17 @@ void HTMLAnchorElementBase::NavigateToHyperlink(
|
||||
bool is_trusted,
|
||||
base::TimeTicks platform_time_stamp,
|
||||
KURL completed_url) {
|
||||
+ UIEvent& event = *UIEvent::Create();
|
||||
+ NavigateToHyperlink2(std::move(request), navigation_policy, is_trusted, platform_time_stamp,
|
||||
+ std::move(completed_url), event, true);
|
||||
+}
|
||||
+
|
||||
+void HTMLAnchorElementBase::NavigateToHyperlink2(ResourceRequest request,
|
||||
+ NavigationPolicy navigation_policy,
|
||||
+ bool is_trusted,
|
||||
+ base::TimeTicks platform_time_stamp,
|
||||
+ KURL completed_url,
|
||||
+ Event& event, bool do_not_show_context_menu) {
|
||||
LocalDOMWindow* window = GetDocument().domWindow();
|
||||
if (!window) {
|
||||
return;
|
||||
@@ -590,6 +602,15 @@ void HTMLAnchorElementBase::NavigateToHyperlink(
|
||||
frame_request.SetImpression(impression);
|
||||
}
|
||||
|
||||
+ if (!do_not_show_context_menu &&
|
||||
+ base::FeatureList::IsEnabled(features::kShowAlwaysContextMenuOnLinks)) {
|
||||
+ if (Page* page = GetDocument().GetPage()) {
|
||||
+ page->GetContextMenuController().HandleContextMenuEvent(
|
||||
+ To<MouseEvent>(&event), /*do_not_show_context_menu*/true);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
Frame* target_frame =
|
||||
frame->Tree().FindOrCreateFrameForNavigation(frame_request, target).frame;
|
||||
|
||||
@@ -633,7 +654,7 @@ Element* HTMLAnchorElementBase::InterestTargetElement() const {
|
||||
html_names::kInteresttargetAttr);
|
||||
}
|
||||
|
||||
-void HTMLAnchorElementBase::HandleClick(MouseEvent& event) {
|
||||
+void HTMLAnchorElementBase::HandleClick(MouseEvent& event, bool do_not_show_context_menu) {
|
||||
event.SetDefaultHandled();
|
||||
|
||||
LocalDOMWindow* window = GetDocument().domWindow();
|
||||
@@ -729,13 +750,12 @@ void HTMLAnchorElementBase::HandleClick(MouseEvent& event) {
|
||||
return;
|
||||
}
|
||||
|
||||
- base::OnceClosure navigate_closure = WTF::BindOnce(
|
||||
- &HTMLAnchorElementBase::NavigateToHyperlink, WrapWeakPersistent(this),
|
||||
- std::move(request), navigation_policy, event.isTrusted(),
|
||||
- event.PlatformTimeStamp(), std::move(completed_url));
|
||||
-
|
||||
if (navigation_policy == kNavigationPolicyDownload ||
|
||||
navigation_policy == kNavigationPolicyLinkPreview) {
|
||||
+ base::OnceClosure navigate_closure = WTF::BindOnce(
|
||||
+ &HTMLAnchorElementBase::NavigateToHyperlink, WrapWeakPersistent(this),
|
||||
+ std::move(request), navigation_policy, event.isTrusted(),
|
||||
+ event.PlatformTimeStamp(), std::move(completed_url));
|
||||
// We distinguish single/double click with some modifiers.
|
||||
// See the comment of `EventHandler.delayed_navigation_task_handle_`.
|
||||
auto task_handle = PostDelayedCancellableTask(
|
||||
@@ -745,7 +765,9 @@ void HTMLAnchorElementBase::HandleClick(MouseEvent& event) {
|
||||
frame->GetEventHandler().SetDelayedNavigationTaskHandle(
|
||||
std::move(task_handle));
|
||||
} else {
|
||||
- std::move(navigate_closure).Run();
|
||||
+ HTMLAnchorElementBase::NavigateToHyperlink2(std::move(request), navigation_policy,
|
||||
+ event.isTrusted(), event.PlatformTimeStamp(), std::move(completed_url),
|
||||
+ event, do_not_show_context_menu);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/html/html_anchor_element.h b/third_party/blink/renderer/core/html/html_anchor_element.h
|
||||
--- a/third_party/blink/renderer/core/html/html_anchor_element.h
|
||||
+++ b/third_party/blink/renderer/core/html/html_anchor_element.h
|
||||
@@ -112,6 +112,7 @@ class CORE_EXPORT HTMLAnchorElementBase : public HTMLElement,
|
||||
Element* InterestTargetElement() const override;
|
||||
|
||||
void Trace(Visitor*) const override;
|
||||
+ void HandleClick(MouseEvent&, bool do_not_show_context_menu = false);
|
||||
|
||||
protected:
|
||||
HTMLAnchorElementBase(const QualifiedName& tag_name, Document&);
|
||||
@@ -143,7 +144,11 @@ class CORE_EXPORT HTMLAnchorElementBase : public HTMLElement,
|
||||
bool is_trusted,
|
||||
base::TimeTicks platform_time_stamp,
|
||||
KURL);
|
||||
- void HandleClick(MouseEvent&);
|
||||
+ void NavigateToHyperlink2(ResourceRequest,
|
||||
+ NavigationPolicy,
|
||||
+ bool is_trusted,
|
||||
+ base::TimeTicks platform_time_stamp,
|
||||
+ KURL, Event&, bool do_not_show_context_menu);
|
||||
|
||||
unsigned link_relations_ : 31;
|
||||
mutable LinkHash cached_visited_link_hash_;
|
||||
diff --git a/third_party/blink/renderer/core/html/html_image_element.cc b/third_party/blink/renderer/core/html/html_image_element.cc
|
||||
--- a/third_party/blink/renderer/core/html/html_image_element.cc
|
||||
+++ b/third_party/blink/renderer/core/html/html_image_element.cc
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "third_party/blink/renderer/core/dom/events/event_dispatch_forbidden_scope.h"
|
||||
#include "third_party/blink/renderer/core/dom/node_traversal.h"
|
||||
#include "third_party/blink/renderer/core/dom/shadow_root.h"
|
||||
+#include "third_party/blink/renderer/core/events/mouse_event.h"
|
||||
#include "third_party/blink/renderer/core/frame/attribution_src_loader.h"
|
||||
#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h"
|
||||
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
|
||||
@@ -64,6 +65,7 @@
|
||||
#include "third_party/blink/renderer/core/media_type_names.h"
|
||||
#include "third_party/blink/renderer/core/page/chrome_client.h"
|
||||
#include "third_party/blink/renderer/core/page/page.h"
|
||||
+#include "third_party/blink/renderer/core/page/context_menu_controller.h"
|
||||
#include "third_party/blink/renderer/core/paint/timing/paint_timing.h"
|
||||
#include "third_party/blink/renderer/core/probe/core_probes.h"
|
||||
#include "third_party/blink/renderer/core/resize_observer/resize_observer_entry.h"
|
||||
@@ -815,6 +817,21 @@ void HTMLImageElement::DidFinishLifecycleUpdate(
|
||||
}
|
||||
}
|
||||
|
||||
+void HTMLImageElement::DefaultEventHandler(Event& event) {
|
||||
+ if (base::FeatureList::IsEnabled(features::kShowAlwaysContextMenuOnLinks)) {
|
||||
+ auto* mouse_event = DynamicTo<MouseEvent>(&event);
|
||||
+ if (mouse_event && mouse_event->type() == event_type_names::kClick) {
|
||||
+ if (Page* page = GetDocument().GetPage()) {
|
||||
+ page->GetContextMenuController().HandleContextMenuEvent(
|
||||
+ mouse_event, /*do_not_show_context_menu*/true);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ HTMLElement::DefaultEventHandler(event);
|
||||
+}
|
||||
+
|
||||
bool HTMLImageElement::draggable() const {
|
||||
// Image elements are draggable by default.
|
||||
return !EqualIgnoringASCIICase(FastGetAttribute(html_names::kDraggableAttr),
|
||||
diff --git a/third_party/blink/renderer/core/html/html_image_element.h b/third_party/blink/renderer/core/html/html_image_element.h
|
||||
--- a/third_party/blink/renderer/core/html/html_image_element.h
|
||||
+++ b/third_party/blink/renderer/core/html/html_image_element.h
|
||||
@@ -217,6 +217,8 @@ class CORE_EXPORT HTMLImageElement
|
||||
void DidAddUserAgentShadowRoot(ShadowRoot&) override;
|
||||
void AdjustStyle(ComputedStyleBuilder&) override;
|
||||
|
||||
+ void DefaultEventHandler(Event&) override;
|
||||
+
|
||||
private:
|
||||
bool AreAuthorShadowsAllowed() const override { return false; }
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/page/context_menu_controller.cc b/third_party/blink/renderer/core/page/context_menu_controller.cc
|
||||
--- a/third_party/blink/renderer/core/page/context_menu_controller.cc
|
||||
+++ b/third_party/blink/renderer/core/page/context_menu_controller.cc
|
||||
@@ -200,14 +200,16 @@ void ContextMenuController::DocumentDetached(Document* document) {
|
||||
}
|
||||
}
|
||||
|
||||
-void ContextMenuController::HandleContextMenuEvent(MouseEvent* mouse_event) {
|
||||
- DCHECK(mouse_event->type() == event_type_names::kContextmenu);
|
||||
+void ContextMenuController::HandleContextMenuEvent(MouseEvent* mouse_event, bool do_not_show_context_menu) {
|
||||
+ if (!base::FeatureList::IsEnabled(features::kShowAlwaysContextMenuOnLinks)) {
|
||||
+ DCHECK(mouse_event->type() == event_type_names::kContextmenu);
|
||||
+ }
|
||||
LocalFrame* frame = mouse_event->target()->ToNode()->GetDocument().GetFrame();
|
||||
PhysicalOffset location =
|
||||
PhysicalOffset::FromPointFRound(mouse_event->AbsoluteLocation());
|
||||
|
||||
if (ShowContextMenu(frame, location, mouse_event->GetMenuSourceType(),
|
||||
- mouse_event))
|
||||
+ mouse_event, do_not_show_context_menu))
|
||||
mouse_event->SetDefaultHandled();
|
||||
}
|
||||
|
||||
@@ -432,7 +434,8 @@ bool ContextMenuController::ShouldShowContextMenuFromTouch(
|
||||
bool ContextMenuController::ShowContextMenu(LocalFrame* frame,
|
||||
const PhysicalOffset& point,
|
||||
WebMenuSourceType source_type,
|
||||
- const MouseEvent* mouse_event) {
|
||||
+ const MouseEvent* mouse_event,
|
||||
+ bool do_not_show_context_menu) {
|
||||
// Displaying the context menu in this function is a big hack as we don't
|
||||
// have context, i.e. whether this is being invoked via a script or in
|
||||
// response to user input (Mouse event WM_RBUTTONDOWN,
|
||||
@@ -455,6 +458,16 @@ bool ContextMenuController::ShowContextMenu(LocalFrame* frame,
|
||||
if (!result.InnerNodeOrImageMapImage())
|
||||
return false;
|
||||
|
||||
+ if (!do_not_show_context_menu &&
|
||||
+ base::FeatureList::IsEnabled(features::kShowAlwaysContextMenuOnLinks)) {
|
||||
+ if (auto* anchor_element = DynamicTo<HTMLAnchorElement>(result.URLElement())) {
|
||||
+ MouseEvent& event = *MouseEvent::Create();
|
||||
+ event.SetTarget(mouse_event->target());
|
||||
+ anchor_element->HandleClick(event, /*do_not_show_context_menu*/true);
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
// Clear any previously set cached results if we are resetting the hit test
|
||||
// result.
|
||||
image_selection_cached_result_ = nullptr;
|
||||
@@ -830,11 +843,13 @@ bool ContextMenuController::ShowContextMenu(LocalFrame* frame,
|
||||
|
||||
SetAutofillData(result.InnerNode(), data);
|
||||
|
||||
- const bool from_touch = source_type == kMenuSourceTouch ||
|
||||
- source_type == kMenuSourceLongPress ||
|
||||
- source_type == kMenuSourceLongTap;
|
||||
- if (from_touch && !ShouldShowContextMenuFromTouch(data))
|
||||
- return false;
|
||||
+ if (!base::FeatureList::IsEnabled(features::kShowAlwaysContextMenuOnLinks)) {
|
||||
+ const bool from_touch = source_type == kMenuSourceTouch ||
|
||||
+ source_type == kMenuSourceLongPress ||
|
||||
+ source_type == kMenuSourceLongTap;
|
||||
+ if (from_touch && !ShouldShowContextMenuFromTouch(data))
|
||||
+ return false;
|
||||
+ }
|
||||
|
||||
WebLocalFrameImpl* selected_web_frame =
|
||||
WebLocalFrameImpl::FromFrame(selected_frame);
|
||||
diff --git a/third_party/blink/renderer/core/page/context_menu_controller.h b/third_party/blink/renderer/core/page/context_menu_controller.h
|
||||
--- a/third_party/blink/renderer/core/page/context_menu_controller.h
|
||||
+++ b/third_party/blink/renderer/core/page/context_menu_controller.h
|
||||
@@ -58,7 +58,7 @@ class CORE_EXPORT ContextMenuController final
|
||||
|
||||
void DocumentDetached(Document*);
|
||||
|
||||
- void HandleContextMenuEvent(MouseEvent*);
|
||||
+ void HandleContextMenuEvent(MouseEvent*, bool do_not_show_context_menu = false);
|
||||
void ShowContextMenuAtPoint(LocalFrame*,
|
||||
float x,
|
||||
float y,
|
||||
@@ -125,7 +125,8 @@ class CORE_EXPORT ContextMenuController final
|
||||
bool ShowContextMenu(LocalFrame*,
|
||||
const PhysicalOffset&,
|
||||
WebMenuSourceType,
|
||||
- const MouseEvent* mouse_event = nullptr);
|
||||
+ const MouseEvent* mouse_event = nullptr,
|
||||
+ bool do_not_show_context_menu = false);
|
||||
|
||||
bool ShouldShowContextMenuFromTouch(const ContextMenuData&);
|
||||
|
||||
--
|
||||
@@ -1,241 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 2 May 2022 11:48:03 +0000
|
||||
Subject: Add site engagement flag
|
||||
|
||||
Disabled by default.
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/browser/about_flags.cc | 1 +
|
||||
.../engagement/important_sites_util.cc | 9 +++++
|
||||
.../internal/tracker_impl.cc | 3 ++
|
||||
.../public/feature_configurations.cc | 7 ++++
|
||||
.../content/site_engagement_score.cc | 5 +++
|
||||
components/site_engagement/core/BUILD.gn | 6 ++++
|
||||
components/site_engagement/core/features.cc | 30 ++++++++++++++++
|
||||
components/site_engagement/core/features.h | 34 +++++++++++++++++++
|
||||
.../Add-site-engagement-flag.inc | 10 ++++++
|
||||
9 files changed, 105 insertions(+)
|
||||
create mode 100644 components/site_engagement/core/features.cc
|
||||
create mode 100644 components/site_engagement/core/features.h
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-site-engagement-flag.inc
|
||||
|
||||
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -164,6 +164,7 @@
|
||||
#include "components/sensitive_content/features.h"
|
||||
#include "components/services/heap_profiling/public/cpp/switches.h"
|
||||
#include "components/services/storage/public/cpp/buckets/bucket_info.h"
|
||||
+#include "components/site_engagement/core/features.h"
|
||||
#include "components/shared_highlighting/core/common/shared_highlighting_features.h"
|
||||
#include "components/sharing_message/features.h"
|
||||
#include "components/signin/core/browser/dice_account_reconcilor_delegate.h"
|
||||
diff --git a/chrome/browser/engagement/important_sites_util.cc b/chrome/browser/engagement/important_sites_util.cc
|
||||
--- a/chrome/browser/engagement/important_sites_util.cc
|
||||
+++ b/chrome/browser/engagement/important_sites_util.cc
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "components/prefs/scoped_user_pref_update.h"
|
||||
#include "components/site_engagement/content/site_engagement_score.h"
|
||||
#include "components/site_engagement/content/site_engagement_service.h"
|
||||
+#include "components/site_engagement/core/features.h"
|
||||
#include "components/site_engagement/core/mojom/site_engagement_details.mojom.h"
|
||||
#include "components/webapps/browser/banners/app_banner_settings_helper.h"
|
||||
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
|
||||
@@ -344,6 +345,10 @@ void ImportantSitesUtil::RegisterProfilePrefs(
|
||||
// static
|
||||
std::set<std::string> ImportantSitesUtil::GetInstalledRegisterableDomains(
|
||||
Profile* profile) {
|
||||
+ if (!base::FeatureList::IsEnabled(site_engagement::features::kSiteEngagement)) {
|
||||
+ std::set<std::string> empty_list;
|
||||
+ return empty_list;
|
||||
+ }
|
||||
std::set<GURL> installed_origins = GetOriginsWithInstalledWebApps(profile);
|
||||
std::set<std::string> registerable_domains;
|
||||
|
||||
@@ -358,6 +363,10 @@ std::vector<ImportantDomainInfo>
|
||||
ImportantSitesUtil::GetImportantRegisterableDomains(Profile* profile,
|
||||
size_t max_results) {
|
||||
SCOPED_UMA_HISTOGRAM_TIMER("Storage.ImportantSites.GenerationTime");
|
||||
+ if (!base::FeatureList::IsEnabled(site_engagement::features::kSiteEngagement)) {
|
||||
+ std::vector<ImportantDomainInfo> empty_list;
|
||||
+ return empty_list;
|
||||
+ }
|
||||
std::map<std::string, ImportantDomainInfo> important_info;
|
||||
std::map<GURL, double> engagement_map;
|
||||
|
||||
diff --git a/components/feature_engagement/internal/tracker_impl.cc b/components/feature_engagement/internal/tracker_impl.cc
|
||||
--- a/components/feature_engagement/internal/tracker_impl.cc
|
||||
+++ b/components/feature_engagement/internal/tracker_impl.cc
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
#include "base/time/clock.h"
|
||||
#include "build/build_config.h"
|
||||
+#include "components/site_engagement/core/features.h"
|
||||
#include "components/feature_engagement/internal/availability_model_impl.h"
|
||||
#include "components/feature_engagement/internal/blocked_iph_features.h"
|
||||
#include "components/feature_engagement/internal/chrome_variations_configuration.h"
|
||||
@@ -236,6 +237,8 @@ TrackerImpl::TrackerImpl(
|
||||
TrackerImpl::~TrackerImpl() = default;
|
||||
|
||||
void TrackerImpl::NotifyEvent(const std::string& event) {
|
||||
+ if (!base::FeatureList::IsEnabled(site_engagement::features::kSiteEngagement))
|
||||
+ return;
|
||||
event_model_->IncrementEvent(event, time_provider_->GetCurrentDay());
|
||||
stats::RecordNotifyEvent(event, configuration_.get(),
|
||||
event_model_->IsReady());
|
||||
diff --git a/components/feature_engagement/public/feature_configurations.cc b/components/feature_engagement/public/feature_configurations.cc
|
||||
--- a/components/feature_engagement/public/feature_configurations.cc
|
||||
+++ b/components/feature_engagement/public/feature_configurations.cc
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include "base/strings/string_util.h"
|
||||
#include "build/build_config.h"
|
||||
+#include "components/site_engagement/core/features.h"
|
||||
#include "components/feature_engagement/public/configuration.h"
|
||||
#include "components/feature_engagement/public/event_constants.h"
|
||||
#include "components/feature_engagement/public/feature_constants.h"
|
||||
@@ -118,6 +119,12 @@ std::optional<FeatureConfig> GetClientSideFeatureConfig(
|
||||
}
|
||||
|
||||
#endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
|
||||
+ if (!base::FeatureList::IsEnabled(site_engagement::features::kSiteEngagement)) {
|
||||
+ std::optional<FeatureConfig> config = FeatureConfig();
|
||||
+ config->valid = false;
|
||||
+ return config;
|
||||
+ }
|
||||
+
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
|
||||
BUILDFLAG(IS_CHROMEOS)
|
||||
if (kIPHPasswordsManagementBubbleAfterSaveFeature.name == feature->name) {
|
||||
diff --git a/components/site_engagement/content/site_engagement_score.cc b/components/site_engagement/content/site_engagement_score.cc
|
||||
--- a/components/site_engagement/content/site_engagement_score.cc
|
||||
+++ b/components/site_engagement/content/site_engagement_score.cc
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "components/content_settings/core/common/content_settings.h"
|
||||
#include "components/content_settings/core/common/content_settings_types.h"
|
||||
#include "components/content_settings/core/common/content_settings_utils.h"
|
||||
+#include "components/site_engagement/core/features.h"
|
||||
#include "components/site_engagement/content/engagement_type.h"
|
||||
#include "components/site_engagement/content/site_engagement_metrics.h"
|
||||
#include "third_party/blink/public/mojom/site_engagement/site_engagement.mojom.h"
|
||||
@@ -276,6 +277,10 @@ void SiteEngagementScore::Commit() {
|
||||
if (!UpdateScoreDict(*score_dict_))
|
||||
return;
|
||||
|
||||
+ if (!base::FeatureList::IsEnabled(features::kSiteEngagement)) {
|
||||
+ score_dict_.reset();
|
||||
+ return;
|
||||
+ }
|
||||
settings_map_->SetWebsiteSettingDefaultScope(
|
||||
origin_, GURL(), ContentSettingsType::SITE_ENGAGEMENT,
|
||||
base::Value(std::move(*score_dict_)));
|
||||
diff --git a/components/site_engagement/core/BUILD.gn b/components/site_engagement/core/BUILD.gn
|
||||
--- a/components/site_engagement/core/BUILD.gn
|
||||
+++ b/components/site_engagement/core/BUILD.gn
|
||||
@@ -4,8 +4,14 @@
|
||||
|
||||
static_library("core") {
|
||||
sources = [
|
||||
+ "features.cc",
|
||||
+ "features.h",
|
||||
"pref_names.cc",
|
||||
"pref_names.h",
|
||||
"site_engagement_score_provider.h",
|
||||
]
|
||||
+
|
||||
+ deps = [
|
||||
+ "//base",
|
||||
+ ]
|
||||
}
|
||||
diff --git a/components/site_engagement/core/features.cc b/components/site_engagement/core/features.cc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/site_engagement/core/features.cc
|
||||
@@ -0,0 +1,30 @@
|
||||
+/*
|
||||
+ This file is part of Bromite.
|
||||
+
|
||||
+ Bromite 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.
|
||||
+
|
||||
+ Bromite 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 Bromite. If not, see <https://www.gnu.org/licenses/>.
|
||||
+*/
|
||||
+
|
||||
+#include "components/site_engagement/core/features.h"
|
||||
+
|
||||
+#include "base/feature_list.h"
|
||||
+
|
||||
+namespace site_engagement {
|
||||
+namespace features {
|
||||
+
|
||||
+CROMITE_FEATURE(kSiteEngagement,
|
||||
+ "SiteEngagement",
|
||||
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+
|
||||
+} // namespace features
|
||||
+} // namespace site_engagement
|
||||
diff --git a/components/site_engagement/core/features.h b/components/site_engagement/core/features.h
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/site_engagement/core/features.h
|
||||
@@ -0,0 +1,34 @@
|
||||
+/*
|
||||
+ This file is part of Bromite.
|
||||
+
|
||||
+ Bromite 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.
|
||||
+
|
||||
+ Bromite 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 Bromite. If not, see <https://www.gnu.org/licenses/>.
|
||||
+*/
|
||||
+
|
||||
+#ifndef SITE_ENGAGEMENT_CORE_FEATURES_H_
|
||||
+#define SITE_ENGAGEMENT_CORE_FEATURES_H_
|
||||
+
|
||||
+#include <string>
|
||||
+
|
||||
+#include "base/feature_list.h"
|
||||
+
|
||||
+namespace site_engagement {
|
||||
+namespace features {
|
||||
+
|
||||
+// Enable site engagement
|
||||
+BASE_DECLARE_FEATURE(kSiteEngagement);
|
||||
+
|
||||
+} // namespace features
|
||||
+} // namespace site_engagement
|
||||
+
|
||||
+#endif // SITE_ENGAGEMENT_CORE_FEATURES_H_
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-site-engagement-flag.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-site-engagement-flag.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/Add-site-engagement-flag.inc
|
||||
@@ -0,0 +1,10 @@
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
+ {"site-engagement",
|
||||
+ "Enable site engagement feature",
|
||||
+ "Site Engagement Service provides information about how "
|
||||
+ "engaged a user is with a origin; this affects which NTP "
|
||||
+ "tiles are automatically created.", kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(site_engagement::features::kSiteEngagement)},
|
||||
+
|
||||
+#endif
|
||||
--
|
||||
@@ -2,35 +2,35 @@ From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 17 May 2021 12:30:12 +0000
|
||||
Subject: Add support for ISupportHelpAndFeedback
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../chrome/browser/settings/SettingsActivity.java | 9 +++++++--
|
||||
.../components/browser_ui/settings/SettingsUtils.java | 4 ++++
|
||||
2 files changed, 11 insertions(+), 2 deletions(-)
|
||||
.../chrome/browser/settings/SettingsActivity.java | 11 ++++++++---
|
||||
.../components/browser_ui/settings/SettingsUtils.java | 4 ++++
|
||||
2 files changed, 12 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
|
||||
@@ -56,6 +56,7 @@ import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar;
|
||||
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;
|
||||
import org.chromium.components.browser_ui.bottomsheet.BottomSheetControllerFactory;
|
||||
import org.chromium.components.browser_ui.bottomsheet.ManagedBottomSheetController;
|
||||
@@ -56,6 +56,7 @@ import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
|
||||
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarManageable;
|
||||
import org.chromium.components.browser_ui.settings.FragmentSettingsLauncher;
|
||||
import org.chromium.components.browser_ui.settings.SettingsLauncher;
|
||||
+import org.chromium.components.browser_ui.settings.SettingsUtils;
|
||||
import org.chromium.components.browser_ui.modaldialog.AppModalPresenter;
|
||||
import org.chromium.components.browser_ui.settings.EmbeddableSettingsPage;
|
||||
import org.chromium.components.browser_ui.settings.SettingsFragment;
|
||||
@@ -466,8 +467,12 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity
|
||||
finishCurrentSettings(mainFragment);
|
||||
import org.chromium.components.browser_ui.site_settings.SiteSettingsPreferenceFragment;
|
||||
import org.chromium.ui.UiUtils;
|
||||
|
||||
@@ -252,9 +253,13 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity
|
||||
finish();
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.menu_id_general_help) {
|
||||
- HelpAndFeedbackLauncherImpl.getForProfile(mProfile)
|
||||
- .show(this, getString(R.string.help_context_settings), null);
|
||||
- HelpAndFeedbackLauncherImpl.getInstance().show(this,
|
||||
- getString(R.string.help_context_settings), Profile.getLastUsedRegularProfile(),
|
||||
- null);
|
||||
+ if (mainFragment instanceof SettingsUtils.ISupportHelpAndFeedback) {
|
||||
+ ((SettingsUtils.ISupportHelpAndFeedback)mainFragment).onHelpAndFeebackPressed();
|
||||
+ } else {
|
||||
+ HelpAndFeedbackLauncherImpl.getForProfile(mProfile)
|
||||
+ .show(this, getString(R.string.help_context_settings), null);
|
||||
+ HelpAndFeedbackLauncherImpl.getInstance().show(this,
|
||||
+ getString(R.string.help_context_settings), Profile.getLastUsedRegularProfile(),
|
||||
+ null);
|
||||
+ }
|
||||
return true;
|
||||
}
|
||||
@@ -38,15 +38,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Settin
|
||||
diff --git a/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java b/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java
|
||||
--- a/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java
|
||||
+++ b/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/SettingsUtils.java
|
||||
@@ -28,6 +28,10 @@ import org.chromium.ui.drawable.StateListDrawableBuilder;
|
||||
/** A helper class for Settings. */
|
||||
@NullMarked
|
||||
public class SettingsUtils {
|
||||
@@ -126,4 +126,8 @@ public class SettingsUtils {
|
||||
ImageView imageButton = (ImageView) button;
|
||||
return imageButton.getDrawable() == parentMenu.getOverflowIcon();
|
||||
}
|
||||
+
|
||||
+ public interface ISupportHelpAndFeedback {
|
||||
+ void onHelpAndFeebackPressed();
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* A helper that is used to load preferences from XML resources without causing a
|
||||
* StrictModeViolation. See http://crbug.com/692125.
|
||||
--
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Tue, 12 Apr 2022 15:58:01 +0000
|
||||
Subject: Add support for writing URIs
|
||||
|
||||
Allows native-side URI file writing
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
base/android/content_uri_utils.cc | 10 ++++++
|
||||
base/android/content_uri_utils.h | 4 +++
|
||||
.../org/chromium/base/ContentUriUtils.java | 33 +++++++++++++++++++
|
||||
3 files changed, 47 insertions(+)
|
||||
|
||||
diff --git a/base/android/content_uri_utils.cc b/base/android/content_uri_utils.cc
|
||||
--- a/base/android/content_uri_utils.cc
|
||||
+++ b/base/android/content_uri_utils.cc
|
||||
@@ -134,6 +134,16 @@ void JNI_ContentUriUtils_AddFileInfoToVector(JNIEnv* env,
|
||||
Time::FromMillisecondsSinceUnixEpoch(last_modified));
|
||||
}
|
||||
|
||||
+File OpenContentUriForWrite(const FilePath& content_uri) {
|
||||
+ JNIEnv* env = base::android::AttachCurrentThread();
|
||||
+ ScopedJavaLocalRef<jstring> j_uri =
|
||||
+ ConvertUTF8ToJavaString(env, content_uri.value());
|
||||
+ jint fd = Java_ContentUriUtils_openContentUriForWrite(env, j_uri);
|
||||
+ if (fd < 0)
|
||||
+ return File();
|
||||
+ return File(fd);
|
||||
+}
|
||||
+
|
||||
std::string GetContentUriMimeType(const FilePath& content_uri) {
|
||||
JNIEnv* env = android::AttachCurrentThread();
|
||||
return Java_ContentUriUtils_getMimeType(env, content_uri.value());
|
||||
diff --git a/base/android/content_uri_utils.h b/base/android/content_uri_utils.h
|
||||
--- a/base/android/content_uri_utils.h
|
||||
+++ b/base/android/content_uri_utils.h
|
||||
@@ -46,6 +46,10 @@ int ContentUriGetFd(
|
||||
void ContentUriClose(
|
||||
const base::android::JavaRef<jobject>& java_parcel_file_descriptor);
|
||||
|
||||
+// Opens a content URI for write and returns the file descriptor to the caller.
|
||||
+// Returns -1 if the URI is invalid.
|
||||
+BASE_EXPORT File OpenContentUriForWrite(const FilePath& content_uri);
|
||||
+
|
||||
// Returns true if file exists and results are populated, else returns false.
|
||||
bool ContentUriGetFileInfo(const FilePath& content_uri,
|
||||
FileEnumerator::FileInfo* results);
|
||||
diff --git a/base/android/java/src/org/chromium/base/ContentUriUtils.java b/base/android/java/src/org/chromium/base/ContentUriUtils.java
|
||||
--- a/base/android/java/src/org/chromium/base/ContentUriUtils.java
|
||||
+++ b/base/android/java/src/org/chromium/base/ContentUriUtils.java
|
||||
@@ -31,6 +31,9 @@ import org.chromium.build.annotations.Nullable;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
+import android.system.Os;
|
||||
+import android.content.ContentProviderClient;
|
||||
+
|
||||
/** This class provides methods to access content URI schemes. */
|
||||
@JNINamespace("base")
|
||||
@NullMarked
|
||||
@@ -72,6 +75,36 @@ public abstract class ContentUriUtils {
|
||||
StreamUtil.closeQuietly(parcelFileDescriptor);
|
||||
}
|
||||
|
||||
+ @CalledByNative
|
||||
+ public static int openContentUriForWrite(String uriString) {
|
||||
+ try {
|
||||
+ Uri uri = Uri.parse(uriString);
|
||||
+ ContentResolver resolver = ContextUtils.getApplicationContext().getContentResolver();
|
||||
+ ContentProviderClient client = resolver.acquireContentProviderClient(
|
||||
+ uri.getAuthority());
|
||||
+ ParcelFileDescriptor pfd = client.openFile(uri, "wt");
|
||||
+ int fd = pfd.detachFd();
|
||||
+ client.close();
|
||||
+ return fd;
|
||||
+ } catch (Exception e) {
|
||||
+ Log.e(TAG, "Cannot open intermediate URI", e);
|
||||
+ }
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ public static String getFilePathFromContentUri(Uri uri) {
|
||||
+ String path = null;
|
||||
+ try {
|
||||
+ ContentResolver resolver = ContextUtils.getApplicationContext().getContentResolver();
|
||||
+ ParcelFileDescriptor pfd = resolver.openFileDescriptor(uri, "r");
|
||||
+ path = Os.readlink("/proc/self/fd/" + pfd.getFd());
|
||||
+ pfd.close();
|
||||
+ } catch (Exception e) {
|
||||
+ Log.e(TAG, "Cannot get file path from content URI", e);
|
||||
+ }
|
||||
+ return path;
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Check whether a content URI exists.
|
||||
*
|
||||
--
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,286 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Tue, 3 May 2022 14:44:11 +0000
|
||||
Subject: Add webGL site setting
|
||||
|
||||
Do not provide any device information when serving context creation errors.
|
||||
|
||||
Requires patch: Content-settings-infrastructure.patch
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../impl/BromiteWebGLContentSetting.java | 93 +++++++++++++++++++
|
||||
.../bromite_content_settings/webgl.grdp | 27 ++++++
|
||||
.../bromite_content_settings/webgl.inc | 22 +++++
|
||||
.../common/bromite_content_settings/WEBGL.inc | 1 +
|
||||
.../execution_context/execution_context.cc | 7 ++
|
||||
.../execution_context/execution_context.h | 2 +
|
||||
.../webgl/webgl_rendering_context_base.cc | 32 +++----
|
||||
.../webgl/webgl_rendering_context_base.h | 2 +
|
||||
8 files changed, 167 insertions(+), 19 deletions(-)
|
||||
create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebGLContentSetting.java
|
||||
create mode 100644 components/browser_ui/strings/bromite_content_settings/webgl.grdp
|
||||
create mode 100644 components/content_settings/core/browser/bromite_content_settings/webgl.inc
|
||||
create mode 100644 components/content_settings/core/common/bromite_content_settings/WEBGL.inc
|
||||
|
||||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebGLContentSetting.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebGLContentSetting.java
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebGLContentSetting.java
|
||||
@@ -0,0 +1,93 @@
|
||||
+/*
|
||||
+ This file is part of Bromite.
|
||||
+
|
||||
+ Bromite 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.
|
||||
+
|
||||
+ Bromite 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 Bromite. If not, see <https://www.gnu.org/licenses/>.
|
||||
+*/
|
||||
+
|
||||
+package org.chromium.components.browser_ui.site_settings.impl;
|
||||
+
|
||||
+import org.chromium.components.browser_ui.site_settings.R;
|
||||
+
|
||||
+import org.chromium.components.browser_ui.site_settings.BromiteCustomContentSetting;
|
||||
+import org.chromium.components.browser_ui.site_settings.ContentSettingsResources;
|
||||
+import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory;
|
||||
+import org.chromium.components.content_settings.ContentSettingValues;
|
||||
+import org.chromium.components.content_settings.ContentSettingsType;
|
||||
+import org.chromium.content_public.browser.BrowserContextHandle;
|
||||
+
|
||||
+import androidx.annotation.Nullable;
|
||||
+import androidx.preference.Preference;
|
||||
+import androidx.preference.PreferenceScreen;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
+
|
||||
+public class BromiteWebGLContentSetting extends BromiteCustomContentSetting {
|
||||
+ public BromiteWebGLContentSetting() {
|
||||
+ super(/*contentSettingsType*/ ContentSettingsType.WEBGL,
|
||||
+ /*defaultEnabledValue*/ ContentSettingValues.ALLOW,
|
||||
+ /*defaultDisabledValue*/ ContentSettingValues.BLOCK,
|
||||
+ /*allowException*/ true,
|
||||
+ /*preferenceKey*/ "webgl",
|
||||
+ /*profilePrefKey*/ "webgl");
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public ContentSettingsResources.ResourceItem getResourceItem() {
|
||||
+ return new ContentSettingsResources.ResourceItem(
|
||||
+ /*icon*/ R.drawable.web_asset,
|
||||
+ /*title*/ R.string.webgl_permission_title,
|
||||
+ /*defaultEnabledValue*/ getDefaultEnabledValue(),
|
||||
+ /*defaultDisabledValue*/ getDefaultDisabledValue(),
|
||||
+ /*enabledSummary*/ R.string.website_settings_category_webgl_enabled,
|
||||
+ /*disabledSummary*/ R.string.website_settings_category_webgl_disabled,
|
||||
+ /*summaryOverrideForScreenReader*/ 0);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getCategorySummary(@Nullable @ContentSettingValues int value) {
|
||||
+ switch (value) {
|
||||
+ case ContentSettingValues.ALLOW:
|
||||
+ return R.string.website_settings_category_webgl_enabled;
|
||||
+ case ContentSettingValues.BLOCK:
|
||||
+ return R.string.website_settings_category_webgl_disabled;
|
||||
+ default:
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getCategoryDescription() {
|
||||
+ return R.string.settings_site_settings_webgl_description;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean requiresTriStateContentSetting() {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean showOnlyDescriptions() {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getAddExceptionDialogMessage() {
|
||||
+ return R.string.website_settings_category_webgl_enabled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @Nullable Boolean considerException(SiteSettingsCategory category, @ContentSettingValues int value) {
|
||||
+ return value != ContentSettingValues.BLOCK;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/components/browser_ui/strings/bromite_content_settings/webgl.grdp b/components/browser_ui/strings/bromite_content_settings/webgl.grdp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/browser_ui/strings/bromite_content_settings/webgl.grdp
|
||||
@@ -0,0 +1,27 @@
|
||||
+<?xml version="1.0" encoding="utf-8"?>
|
||||
+<grit-part>
|
||||
+ <message name="IDS_SITE_SETTINGS_TYPE_WEBGL" desc="The label used for webgl site settings controls." formatter_data="android_java">
|
||||
+ Webgl
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_SITE_SETTINGS_WEBGL_DESCRIPTION" desc="Description of the webgl content setting." formatter_data="android_java">
|
||||
+ Enable Webgl, a JavaScript API for rendering high-performance interactive 3D and 2D graphics
|
||||
+ </message>
|
||||
+ <message name="IDS_SITE_SETTINGS_TYPE_WEBGL_MID_SENTENCE" desc="The label used for webgl site settings controls when used mid-sentence." formatter_data="android_java">
|
||||
+ webgl
|
||||
+ </message>
|
||||
+ <message name="IDS_WEBGL_PERMISSION_TITLE" desc="Title of the permission to use webgl [CHAR-LIMIT=32]" formatter_data="android_java">
|
||||
+ Webgl
|
||||
+ </message>
|
||||
+ <message name="IDS_WEBSITE_SETTINGS_CATEGORY_WEBGL_ENABLED" desc="Summary text explaining that webgl is full enabled." formatter_data="android_java">
|
||||
+ Enabled
|
||||
+ </message>
|
||||
+ <message name="IDS_WEBSITE_SETTINGS_CATEGORY_WEBGL_DISABLED" desc="Summary text explaining that webgl is full disabled." formatter_data="android_java">
|
||||
+ Disabled
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_SITE_SETTINGS_WEBGL_ALLOWED_EXCEPTIONS" desc="Label for the allowed exceptions site list of the webgl setting.">
|
||||
+ Allowed to use webgl
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_SITE_SETTINGS_WEBGL_BLOCKED_EXCEPTIONS" desc="Label for the blocked exceptions site list of the webgl setting.">
|
||||
+ Not allowed to use webgl
|
||||
+ </message>
|
||||
+</grit-part>
|
||||
diff --git a/components/content_settings/core/browser/bromite_content_settings/webgl.inc b/components/content_settings/core/browser/bromite_content_settings/webgl.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/content_settings/core/browser/bromite_content_settings/webgl.inc
|
||||
@@ -0,0 +1,22 @@
|
||||
+ Register(ContentSettingsType::WEBGL, "webgl", CONTENT_SETTING_BLOCK,
|
||||
+ WebsiteSettingsInfo::SYNCABLE,
|
||||
+ /*allowlisted_schemes=*/{},
|
||||
+ /*valid_settings=*/{CONTENT_SETTING_ALLOW,
|
||||
+ CONTENT_SETTING_BLOCK},
|
||||
+ WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE,
|
||||
+ WebsiteSettingsRegistry::ALL_PLATFORMS,
|
||||
+ ContentSettingsInfo::INHERIT_IN_INCOGNITO,
|
||||
+ ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS);
|
||||
+
|
||||
+ content_settings::WebsiteSettingsRegistry::GetInstance()
|
||||
+ ->GetMutable(ContentSettingsType::WEBGL)
|
||||
+ ->set_show_into_info_page()
|
||||
+ .set_desktop_ui()
|
||||
+ .set_is_renderer_content_setting()
|
||||
+ .set_title_ui(IDS_SITE_SETTINGS_TYPE_WEBGL)
|
||||
+ .set_description_ui(IDS_SETTINGS_SITE_SETTINGS_WEBGL_DESCRIPTION)
|
||||
+ .set_allowed_ui(IDS_WEBSITE_SETTINGS_CATEGORY_WEBGL_ENABLED)
|
||||
+ .set_blocked_ui(IDS_WEBSITE_SETTINGS_CATEGORY_WEBGL_DISABLED)
|
||||
+ .set_allowed_exceptions_ui(IDS_SETTINGS_SITE_SETTINGS_WEBGL_ALLOWED_EXCEPTIONS)
|
||||
+ .set_blocked_exceptions_ui(IDS_SETTINGS_SITE_SETTINGS_WEBGL_BLOCKED_EXCEPTIONS)
|
||||
+ .set_mid_sentence_ui(IDS_SITE_SETTINGS_TYPE_WEBGL);
|
||||
diff --git a/components/content_settings/core/common/bromite_content_settings/WEBGL.inc b/components/content_settings/core/common/bromite_content_settings/WEBGL.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/content_settings/core/common/bromite_content_settings/WEBGL.inc
|
||||
@@ -0,0 +1 @@
|
||||
+ WEBGL,
|
||||
diff --git a/third_party/blink/renderer/core/execution_context/execution_context.cc b/third_party/blink/renderer/core/execution_context/execution_context.cc
|
||||
--- a/third_party/blink/renderer/core/execution_context/execution_context.cc
|
||||
+++ b/third_party/blink/renderer/core/execution_context/execution_context.cc
|
||||
@@ -86,6 +86,13 @@ blink::WebContentSettingsClient* GetContentSettingsClientFor(
|
||||
return settings;
|
||||
}
|
||||
|
||||
+bool AllowWebgl(ExecutionContext* context) {
|
||||
+ blink::WebContentSettingsClient* settings = GetContentSettingsClientFor(context);
|
||||
+ if (settings)
|
||||
+ return settings->AllowContentSetting(ContentSettingsType::WEBGL, false);
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
ExecutionContext::ExecutionContext(v8::Isolate* isolate,
|
||||
Agent* agent,
|
||||
bool is_window)
|
||||
diff --git a/third_party/blink/renderer/core/execution_context/execution_context.h b/third_party/blink/renderer/core/execution_context/execution_context.h
|
||||
--- a/third_party/blink/renderer/core/execution_context/execution_context.h
|
||||
+++ b/third_party/blink/renderer/core/execution_context/execution_context.h
|
||||
@@ -115,6 +115,8 @@ enum ReasonForCallingCanExecuteScripts {
|
||||
|
||||
enum ReferrerPolicySource { kPolicySourceHttpHeader, kPolicySourceMetaTag };
|
||||
|
||||
+CORE_EXPORT bool AllowWebgl(ExecutionContext* context);
|
||||
+
|
||||
// An environment in which script can execute. This class exposes the common
|
||||
// properties of script execution environments on the web (i.e, common between
|
||||
// script executing in a window and script executing in a worker), such as:
|
||||
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
|
||||
--- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
|
||||
+++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
|
||||
@@ -339,6 +339,13 @@ void WebGLRenderingContextBase::InitializeWebGLContextLimits(
|
||||
}
|
||||
}
|
||||
|
||||
+bool WebGLRenderingContextBase::AllowWebglForHost(blink::CanvasRenderingContextHost* host) {
|
||||
+ if (!host)
|
||||
+ return false;
|
||||
+ blink::ExecutionContext* context = host->GetTopExecutionContext();
|
||||
+ return blink::AllowWebgl(context);
|
||||
+}
|
||||
+
|
||||
unsigned WebGLRenderingContextBase::CurrentMaxGLContexts() {
|
||||
base::AutoLock locker(WebGLContextLimitLock());
|
||||
DCHECK(webgl_context_limits_initialized_);
|
||||
@@ -608,25 +615,6 @@ static String ExtractWebGLContextCreationError(
|
||||
const Platform::GraphicsInfo& info) {
|
||||
StringBuilder builder;
|
||||
builder.Append("Could not create a WebGL context");
|
||||
- FormatWebGLStatusString(
|
||||
- "VENDOR",
|
||||
- info.vendor_id ? String::Format("0x%04x", info.vendor_id) : "0xffff",
|
||||
- builder);
|
||||
- FormatWebGLStatusString(
|
||||
- "DEVICE",
|
||||
- info.device_id ? String::Format("0x%04x", info.device_id) : "0xffff",
|
||||
- builder);
|
||||
- FormatWebGLStatusString("GL_VENDOR", info.vendor_info, builder);
|
||||
- FormatWebGLStatusString("GL_RENDERER", info.renderer_info, builder);
|
||||
- FormatWebGLStatusString("GL_VERSION", info.driver_version, builder);
|
||||
- FormatWebGLStatusString("Sandboxed", info.sandboxed ? "yes" : "no", builder);
|
||||
- FormatWebGLStatusString("Optimus", info.optimus ? "yes" : "no", builder);
|
||||
- FormatWebGLStatusString("AMD switchable", info.amd_switchable ? "yes" : "no",
|
||||
- builder);
|
||||
- FormatWebGLStatusString(
|
||||
- "Reset notification strategy",
|
||||
- String::Format("0x%04x", info.reset_notification_strategy).Utf8().c_str(),
|
||||
- builder);
|
||||
FormatWebGLStatusString("ErrorMessage", info.error_message.Utf8().c_str(),
|
||||
builder);
|
||||
builder.Append('.');
|
||||
@@ -686,6 +674,12 @@ WebGLRenderingContextBase::CreateWebGraphicsContext3DProvider(
|
||||
const CanvasContextCreationAttributesCore& attributes,
|
||||
Platform::ContextType context_type,
|
||||
Platform::GraphicsInfo* graphics_info) {
|
||||
+ if (!AllowWebglForHost(host)) {
|
||||
+ host->HostDispatchEvent(WebGLContextEvent::Create(
|
||||
+ event_type_names::kWebglcontextcreationerror,
|
||||
+ "disabled by site settings policy."));
|
||||
+ return nullptr;
|
||||
+ }
|
||||
if ((context_type == Platform::kWebGL1ContextType &&
|
||||
!host->IsWebGL1Enabled()) ||
|
||||
(context_type == Platform::kWebGL2ContextType &&
|
||||
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
|
||||
--- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
|
||||
+++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
|
||||
@@ -1932,6 +1932,8 @@ class MODULES_EXPORT WebGLRenderingContextBase
|
||||
DOMArrayBufferView* pixels,
|
||||
int64_t offset);
|
||||
|
||||
+ static bool AllowWebglForHost(blink::CanvasRenderingContextHost* host);
|
||||
+
|
||||
void RecordANGLEImplementation();
|
||||
|
||||
private:
|
||||
--
|
||||
@@ -1,264 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Fri, 6 May 2022 14:27:17 +0000
|
||||
Subject: Add webRTC site settings
|
||||
|
||||
Requires patch: Content-settings-infrastructure.patch
|
||||
|
||||
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../impl/BromiteWebRTCContentSetting.java | 94 +++++++++++++++++++
|
||||
.../bromite_content_settings/webrtc.grdp | 27 ++++++
|
||||
.../bromite_content_settings/webrtc.inc | 22 +++++
|
||||
.../bromite_content_settings/WEBRTC.inc | 1 +
|
||||
.../peer_connection_dependency_factory.cc | 6 ++
|
||||
.../peerconnection/rtc_rtp_receiver.cc | 10 ++
|
||||
.../modules/peerconnection/rtc_rtp_sender.cc | 10 ++
|
||||
7 files changed, 170 insertions(+)
|
||||
create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebRTCContentSetting.java
|
||||
create mode 100644 components/browser_ui/strings/bromite_content_settings/webrtc.grdp
|
||||
create mode 100644 components/content_settings/core/browser/bromite_content_settings/webrtc.inc
|
||||
create mode 100644 components/content_settings/core/common/bromite_content_settings/WEBRTC.inc
|
||||
|
||||
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebRTCContentSetting.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebRTCContentSetting.java
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/impl/BromiteWebRTCContentSetting.java
|
||||
@@ -0,0 +1,94 @@
|
||||
+/*
|
||||
+ This file is part of Bromite.
|
||||
+
|
||||
+ Bromite 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.
|
||||
+
|
||||
+ Bromite 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 Bromite. If not, see <https://www.gnu.org/licenses/>.
|
||||
+*/
|
||||
+
|
||||
+package org.chromium.components.browser_ui.site_settings.impl;
|
||||
+
|
||||
+import org.chromium.components.browser_ui.site_settings.R;
|
||||
+
|
||||
+import org.chromium.components.browser_ui.site_settings.BromiteCustomContentSetting;
|
||||
+import org.chromium.components.browser_ui.site_settings.ContentSettingsResources;
|
||||
+import org.chromium.components.browser_ui.site_settings.SiteSettingsCategory;
|
||||
+import org.chromium.components.content_settings.ContentSettingValues;
|
||||
+import org.chromium.components.content_settings.ContentSettingsType;
|
||||
+import org.chromium.content_public.browser.BrowserContextHandle;
|
||||
+
|
||||
+import androidx.annotation.Nullable;
|
||||
+import androidx.preference.Preference;
|
||||
+import androidx.preference.PreferenceScreen;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
+
|
||||
+public class BromiteWebRTCContentSetting extends BromiteCustomContentSetting {
|
||||
+ public BromiteWebRTCContentSetting() {
|
||||
+ super(/*contentSettingsType*/ ContentSettingsType.WEBRTC,
|
||||
+ /*defaultEnabledValue*/ ContentSettingValues.ALLOW,
|
||||
+ /*defaultDisabledValue*/ ContentSettingValues.BLOCK,
|
||||
+ /*allowException*/ true,
|
||||
+ /*preferenceKey*/ "webrtc",
|
||||
+ /*profilePrefKey*/ "webrtc");
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public ContentSettingsResources.ResourceItem getResourceItem() {
|
||||
+ return new ContentSettingsResources.ResourceItem(
|
||||
+ /*icon*/ R.drawable.web_asset,
|
||||
+ /*title*/ R.string.webrtc_permission_title,
|
||||
+ /*defaultEnabledValue*/ getDefaultEnabledValue(),
|
||||
+ /*defaultDisabledValue*/ getDefaultDisabledValue(),
|
||||
+ /*enabledSummary*/ R.string.website_settings_category_webrtc_enabled,
|
||||
+ /*disabledSummary*/ R.string.website_settings_category_webrtc_disabled,
|
||||
+ /*summaryOverrideForScreenReader*/ 0);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getCategorySummary(@Nullable @ContentSettingValues int value) {
|
||||
+ switch (value) {
|
||||
+ case ContentSettingValues.ALLOW:
|
||||
+ return R.string.website_settings_category_webrtc_enabled;
|
||||
+ case ContentSettingValues.BLOCK:
|
||||
+ return R.string.website_settings_category_webrtc_disabled;
|
||||
+ default:
|
||||
+ // this will cause a runtime exception
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getCategoryDescription() {
|
||||
+ return R.string.settings_site_settings_webrtc_description;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean requiresTriStateContentSetting() {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean showOnlyDescriptions() {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getAddExceptionDialogMessage() {
|
||||
+ return R.string.website_settings_category_webrtc_enabled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @Nullable Boolean considerException(SiteSettingsCategory category, @ContentSettingValues int value) {
|
||||
+ return value != ContentSettingValues.BLOCK;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/components/browser_ui/strings/bromite_content_settings/webrtc.grdp b/components/browser_ui/strings/bromite_content_settings/webrtc.grdp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/browser_ui/strings/bromite_content_settings/webrtc.grdp
|
||||
@@ -0,0 +1,27 @@
|
||||
+<?xml version="1.0" encoding="utf-8"?>
|
||||
+<grit-part>
|
||||
+ <message name="IDS_SITE_SETTINGS_TYPE_WEBRTC" desc="The label used for webrtc site settings controls." formatter_data="android_java">
|
||||
+ WebRTC
|
||||
+ </message>
|
||||
+ <message name="IDS_SITE_SETTINGS_TYPE_WEBRTC_MID_SENTENCE" desc="The label used for webrtc site settings controls when used mid-sentence." formatter_data="android_java">
|
||||
+ webRTC
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_SITE_SETTINGS_WEBRTC_DESCRIPTION" desc="Description of the WebRTC content setting." formatter_data="android_java">
|
||||
+ Enable WebRTC, a JavaScript API for real-time communication and direct peer-to-peer communication
|
||||
+ </message>
|
||||
+ <message name="IDS_WEBRTC_PERMISSION_TITLE" desc="Title of the permission to use webrtc [CHAR-LIMIT=32]" formatter_data="android_java">
|
||||
+ WebRTC
|
||||
+ </message>
|
||||
+ <message name="IDS_WEBSITE_SETTINGS_CATEGORY_WEBRTC_ENABLED" desc="Summary text explaining that webrtc is full enabled." formatter_data="android_java">
|
||||
+ Enabled
|
||||
+ </message>
|
||||
+ <message name="IDS_WEBSITE_SETTINGS_CATEGORY_WEBRTC_DISABLED" desc="Summary text explaining that webrtc is full disabled." formatter_data="android_java">
|
||||
+ Disabled
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_SITE_SETTINGS_WEBRTC_ALLOWED_EXCEPTIONS" desc="Label for the allowed exceptions site list of the WebRTC setting.">
|
||||
+ Allowed to use WebRTC
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_SITE_SETTINGS_WEBRTC_BLOCKED_EXCEPTIONS" desc="Label for the blocked exceptions site list of the WebRTC setting.">
|
||||
+ Not allowed to use WebRTC
|
||||
+ </message>
|
||||
+</grit-part>
|
||||
diff --git a/components/content_settings/core/browser/bromite_content_settings/webrtc.inc b/components/content_settings/core/browser/bromite_content_settings/webrtc.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/content_settings/core/browser/bromite_content_settings/webrtc.inc
|
||||
@@ -0,0 +1,22 @@
|
||||
+ Register(ContentSettingsType::WEBRTC, "webrtc", CONTENT_SETTING_BLOCK,
|
||||
+ WebsiteSettingsInfo::SYNCABLE,
|
||||
+ /*allowlisted_schemes=*/{},
|
||||
+ /*valid_settings=*/{CONTENT_SETTING_ALLOW,
|
||||
+ CONTENT_SETTING_BLOCK},
|
||||
+ WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE,
|
||||
+ WebsiteSettingsRegistry::ALL_PLATFORMS,
|
||||
+ ContentSettingsInfo::INHERIT_IN_INCOGNITO,
|
||||
+ ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS);
|
||||
+
|
||||
+ content_settings::WebsiteSettingsRegistry::GetInstance()
|
||||
+ ->GetMutable(ContentSettingsType::WEBRTC)
|
||||
+ ->set_show_into_info_page()
|
||||
+ .set_desktop_ui()
|
||||
+ .set_is_renderer_content_setting()
|
||||
+ .set_title_ui(IDS_SITE_SETTINGS_TYPE_WEBRTC)
|
||||
+ .set_description_ui(IDS_SETTINGS_SITE_SETTINGS_WEBRTC_DESCRIPTION)
|
||||
+ .set_allowed_ui(IDS_WEBSITE_SETTINGS_CATEGORY_WEBRTC_ENABLED)
|
||||
+ .set_blocked_ui(IDS_WEBSITE_SETTINGS_CATEGORY_WEBRTC_DISABLED)
|
||||
+ .set_allowed_exceptions_ui(IDS_SETTINGS_SITE_SETTINGS_WEBRTC_ALLOWED_EXCEPTIONS)
|
||||
+ .set_blocked_exceptions_ui(IDS_SETTINGS_SITE_SETTINGS_WEBRTC_BLOCKED_EXCEPTIONS)
|
||||
+ .set_mid_sentence_ui(IDS_SITE_SETTINGS_TYPE_WEBRTC_MID_SENTENCE);
|
||||
diff --git a/components/content_settings/core/common/bromite_content_settings/WEBRTC.inc b/components/content_settings/core/common/bromite_content_settings/WEBRTC.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/components/content_settings/core/common/bromite_content_settings/WEBRTC.inc
|
||||
@@ -0,0 +1 @@
|
||||
+ WEBRTC,
|
||||
diff --git a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
|
||||
--- a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
|
||||
+++ b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "third_party/blink/public/platform/modules/webrtc/webrtc_logging.h"
|
||||
#include "third_party/blink/public/platform/platform.h"
|
||||
#include "third_party/blink/public/platform/task_type.h"
|
||||
+#include "third_party/blink/public/platform/web_content_settings_client.h"
|
||||
#include "third_party/blink/public/platform/web_url.h"
|
||||
#include "third_party/blink/public/web/modules/mediastream/media_stream_video_source.h"
|
||||
#include "third_party/blink/public/web/web_document.h"
|
||||
@@ -936,6 +937,11 @@ PeerConnectionDependencyFactory::CreatePortAllocator(
|
||||
// |request_multiple_routes|. Whether local IP addresses could be
|
||||
// collected depends on if mic/camera permission is granted for this
|
||||
// origin.
|
||||
+ blink::WebContentSettingsClient* settings = web_frame->GetContentSettingsClient();
|
||||
+ if (settings && settings->AllowContentSetting(ContentSettingsType::WEBRTC, false)) {
|
||||
+ webrtc_ip_handling_policy = mojom::blink::WebRtcIpHandlingPolicy::kDefault;
|
||||
+ }
|
||||
+
|
||||
switch (webrtc_ip_handling_policy) {
|
||||
// TODO(guoweis): specify the flag of disabling local candidate
|
||||
// collection when webrtc is updated.
|
||||
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc
|
||||
--- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc
|
||||
+++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "third_party/blink/public/common/privacy_budget/identifiable_surface.h"
|
||||
#include "third_party/blink/public/common/privacy_budget/identifiable_token_builder.h"
|
||||
#include "third_party/blink/public/platform/modules/webrtc/webrtc_logging.h"
|
||||
+#include "third_party/blink/public/platform/web_content_settings_client.h"
|
||||
+#include "third_party/blink/public/web/web_local_frame.h"
|
||||
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
|
||||
#include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_insertable_streams.h"
|
||||
#include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_rtcp_parameters.h"
|
||||
@@ -288,6 +290,14 @@ RTCRtpCapabilities* RTCRtpReceiver::getCapabilities(ScriptState* state,
|
||||
if (kind != "audio" && kind != "video")
|
||||
return nullptr;
|
||||
|
||||
+ LocalDOMWindow* window = To<LocalDOMWindow>(ExecutionContext::From(state));
|
||||
+ auto* web_frame =
|
||||
+ static_cast<WebLocalFrame*>(WebFrame::FromCoreFrame(window->GetFrame()));
|
||||
+ blink::WebContentSettingsClient* settings = web_frame->GetContentSettingsClient();
|
||||
+ if (settings && !settings->AllowContentSetting(ContentSettingsType::WEBRTC, false)) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
RTCRtpCapabilities* capabilities = RTCRtpCapabilities::Create();
|
||||
capabilities->setCodecs(HeapVector<Member<RTCRtpCodecCapability>>());
|
||||
capabilities->setHeaderExtensions(
|
||||
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc
|
||||
--- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc
|
||||
+++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "third_party/blink/public/common/privacy_budget/identifiable_surface.h"
|
||||
#include "third_party/blink/public/common/privacy_budget/identifiable_token_builder.h"
|
||||
#include "third_party/blink/public/platform/modules/webrtc/webrtc_logging.h"
|
||||
+#include "third_party/blink/public/platform/web_content_settings_client.h"
|
||||
+#include "third_party/blink/public/web/web_local_frame.h"
|
||||
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
|
||||
#include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_encoding_options.h"
|
||||
#include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_insertable_streams.h"
|
||||
@@ -1035,6 +1037,14 @@ RTCRtpCapabilities* RTCRtpSender::getCapabilities(ScriptState* state,
|
||||
if (kind != "audio" && kind != "video")
|
||||
return nullptr;
|
||||
|
||||
+ LocalDOMWindow* window = To<LocalDOMWindow>(ExecutionContext::From(state));
|
||||
+ auto* web_frame =
|
||||
+ static_cast<WebLocalFrame*>(WebFrame::FromCoreFrame(window->GetFrame()));
|
||||
+ blink::WebContentSettingsClient* settings = web_frame->GetContentSettingsClient();
|
||||
+ if (settings && !settings->AllowContentSetting(ContentSettingsType::WEBRTC, false)) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
RTCRtpCapabilities* capabilities = RTCRtpCapabilities::Create();
|
||||
capabilities->setCodecs(HeapVector<Member<RTCRtpCodecCapability>>());
|
||||
capabilities->setHeaderExtensions(
|
||||
--
|
||||
@@ -1,50 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 7 Aug 2023 11:02:18 +0000
|
||||
Subject: Allow DocumentPiP if PopupsAndRedirects are active
|
||||
|
||||
Allow documentPiP api use only with content setting popup allowed
|
||||
and disables the possibility of verifying the activation of PIP
|
||||
in the device with document.pictureInPictureEnabled
|
||||
|
||||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
---
|
||||
.../chromium/chrome/browser/media/PictureInPicture.java | 1 +
|
||||
.../picture_in_picture_controller_impl.cc | 7 +++++++
|
||||
2 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/PictureInPicture.java b/chrome/android/java/src/org/chromium/chrome/browser/media/PictureInPicture.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/media/PictureInPicture.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/media/PictureInPicture.java
|
||||
@@ -27,6 +27,7 @@ public abstract class PictureInPicture {
|
||||
* @return boolean true if Picture-In-Picture is enabled, otherwise false.
|
||||
*/
|
||||
public static boolean isEnabled(Context context) {
|
||||
+ if ((true)) return true;
|
||||
// Some versions of Android crash when the activity enters Picture-in-Picture
|
||||
// immediately after it exits Picture-in-Picture. See b/143784148
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
|
||||
diff --git a/third_party/blink/renderer/modules/document_picture_in_picture/picture_in_picture_controller_impl.cc b/third_party/blink/renderer/modules/document_picture_in_picture/picture_in_picture_controller_impl.cc
|
||||
--- a/third_party/blink/renderer/modules/document_picture_in_picture/picture_in_picture_controller_impl.cc
|
||||
+++ b/third_party/blink/renderer/modules/document_picture_in_picture/picture_in_picture_controller_impl.cc
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "third_party/blink/renderer/core/html/media/html_media_element.h"
|
||||
#include "third_party/blink/renderer/core/html/media/html_video_element.h"
|
||||
#include "third_party/blink/renderer/core/layout/layout_video.h"
|
||||
+#include "third_party/blink/renderer/core/loader/document_loader.h"
|
||||
#include "third_party/blink/renderer/modules/picture_in_picture/picture_in_picture_event.h"
|
||||
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
|
||||
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
|
||||
@@ -392,6 +393,12 @@ void PictureInPictureControllerImpl::CreateDocumentPictureInPictureWindow(
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (!opener.GetFrame()->Loader().GetDocumentLoader()->GetContentSettings()->allow_popup) {
|
||||
+ resolver->RejectWithDOMException(DOMExceptionCode::kNotAllowedError,
|
||||
+ "Document PiP requires user popup permission");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
WebPictureInPictureWindowOptions web_options;
|
||||
web_options.width = options->width();
|
||||
web_options.height = options->height();
|
||||
--
|
||||
@@ -2,268 +2,44 @@ From: Zoraver Kang <Zoraver@users.noreply.github.com>
|
||||
Date: Fri, 22 May 2020 22:43:27 -0400
|
||||
Subject: Allow building without enable_reporting
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/browser/net/chrome_report_sender.cc | 1 +
|
||||
.../browser/devtools/protocol/network_handler.cc | 2 ++
|
||||
.../cross_origin_embedder_policy_reporter.cc | 7 +++++--
|
||||
.../browser/network/reporting_service_proxy.cc | 3 +++
|
||||
.../renderer_host/render_frame_host_impl.cc | 6 ------
|
||||
.../coop/cross_origin_opener_policy_reporter.cc | 16 +++++++---------
|
||||
.../dip/document_isolation_policy_reporter.cc | 3 +++
|
||||
.../web_package/signed_exchange_reporter.cc | 2 ++
|
||||
...content_switch_dependent_feature_overrides.cc | 1 +
|
||||
.../Allow-building-without-enable_reporting.inc | 2 ++
|
||||
net/reporting/reporting_header_parser.cc | 1 +
|
||||
net/reporting/reporting_service.cc | 6 ++++++
|
||||
services/network/network_context.h | 6 +++---
|
||||
services/network/public/cpp/parsed_headers.cc | 1 +
|
||||
services/network/public/mojom/BUILD.gn | 1 -
|
||||
.../network/public/mojom/network_context.mojom | 3 +++
|
||||
.../core/frame/csp/content_security_policy.cc | 3 +++
|
||||
.../blink/renderer/core/frame/local_frame.cc | 3 +++
|
||||
.../blink/renderer/core/frame/local_frame.h | 3 +++
|
||||
.../renderer/core/frame/reporting_context.cc | 9 +++++++++
|
||||
.../renderer/core/frame/reporting_context.h | 7 +++++--
|
||||
.../renderer/core/frame/reporting_observer.cc | 3 +--
|
||||
22 files changed, 64 insertions(+), 25 deletions(-)
|
||||
create mode 100644 cromite_flags/services/network/public/cpp/features_cc/Allow-building-without-enable_reporting.inc
|
||||
content/browser/BUILD.gn | 8 ++++----
|
||||
.../common/content_switch_dependent_feature_overrides.cc | 3 +++
|
||||
third_party/blink/renderer/core/frame/local_frame.cc | 3 +++
|
||||
third_party/blink/renderer/core/frame/local_frame.h | 6 +++---
|
||||
.../blink/renderer/core/frame/reporting_context.cc | 9 +++++++++
|
||||
.../blink/renderer/core/frame/reporting_context.h | 7 +++++--
|
||||
6 files changed, 27 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/net/chrome_report_sender.cc b/chrome/browser/net/chrome_report_sender.cc
|
||||
--- a/chrome/browser/net/chrome_report_sender.cc
|
||||
+++ b/chrome/browser/net/chrome_report_sender.cc
|
||||
@@ -85,6 +85,7 @@ void SendReport(
|
||||
const std::string& report,
|
||||
base::OnceClosure success_callback,
|
||||
ErrorCallback error_callback) {
|
||||
+ if ((true)) return;
|
||||
auto resource_request = std::make_unique<network::ResourceRequest>();
|
||||
resource_request->url = report_uri;
|
||||
resource_request->method = "POST";
|
||||
diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/browser/devtools/protocol/network_handler.cc
|
||||
--- a/content/browser/devtools/protocol/network_handler.cc
|
||||
+++ b/content/browser/devtools/protocol/network_handler.cc
|
||||
@@ -1484,6 +1484,7 @@ String BuildReportStatus(const net::ReportingReport::Status status) {
|
||||
}
|
||||
}
|
||||
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
|
||||
--- a/content/browser/BUILD.gn
|
||||
+++ b/content/browser/BUILD.gn
|
||||
@@ -1240,6 +1240,10 @@ source_set("browser") {
|
||||
"net/browser_online_state_observer.cc",
|
||||
"net/browser_online_state_observer.h",
|
||||
"net/cookie_store_factory.cc",
|
||||
+ "net/cross_origin_embedder_policy_reporter.cc",
|
||||
+ "net/cross_origin_embedder_policy_reporter.h",
|
||||
+ "net/cross_origin_opener_policy_reporter.cc",
|
||||
+ "net/cross_origin_opener_policy_reporter.h",
|
||||
"net/network_errors_listing_ui.cc",
|
||||
"net/network_errors_listing_ui.h",
|
||||
"net/network_quality_observer_impl.cc",
|
||||
@@ -2989,10 +2993,6 @@ source_set("browser") {
|
||||
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
std::vector<GURL> ComputeReportingURLs(RenderFrameHostImpl* frame_host) {
|
||||
std::vector<GURL> urls;
|
||||
frame_host->ForEachRenderFrameHostImplWithAction(
|
||||
@@ -1497,6 +1498,7 @@ std::vector<GURL> ComputeReportingURLs(RenderFrameHostImpl* frame_host) {
|
||||
});
|
||||
return urls;
|
||||
}
|
||||
+#endif // BUILDFLAG(ENABLE_REPORTING)
|
||||
|
||||
} // namespace
|
||||
|
||||
diff --git a/content/browser/network/cross_origin_embedder_policy_reporter.cc b/content/browser/network/cross_origin_embedder_policy_reporter.cc
|
||||
--- a/content/browser/network/cross_origin_embedder_policy_reporter.cc
|
||||
+++ b/content/browser/network/cross_origin_embedder_policy_reporter.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "content/browser/network/cross_origin_embedder_policy_reporter.h"
|
||||
|
||||
+#include "net/base/features.h"
|
||||
#include <string_view>
|
||||
|
||||
#include "base/values.h"
|
||||
@@ -96,8 +97,6 @@ void CrossOriginEmbedderPolicyReporter::Clone(
|
||||
void CrossOriginEmbedderPolicyReporter::QueueAndNotify(
|
||||
std::initializer_list<std::pair<std::string_view, std::string_view>> body,
|
||||
bool report_only) {
|
||||
- const std::optional<std::string>& endpoint =
|
||||
- report_only ? report_only_endpoint_ : endpoint_;
|
||||
const char* const disposition = report_only ? "reporting" : "enforce";
|
||||
if (observer_) {
|
||||
std::vector<blink::mojom::ReportBodyElementPtr> list;
|
||||
@@ -112,6 +111,9 @@ void CrossOriginEmbedderPolicyReporter::QueueAndNotify(
|
||||
observer_->Notify(blink::mojom::Report::New(
|
||||
kType, context_url_, blink::mojom::ReportBody::New(std::move(list))));
|
||||
}
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
+ const std::optional<std::string>& endpoint =
|
||||
+ report_only ? report_only_endpoint_ : endpoint_;
|
||||
if (endpoint) {
|
||||
base::Value::Dict body_to_pass;
|
||||
for (const auto& pair : body) {
|
||||
@@ -125,6 +127,7 @@ void CrossOriginEmbedderPolicyReporter::QueueAndNotify(
|
||||
network_anonymization_key_, std::move(body_to_pass));
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
diff --git a/content/browser/network/reporting_service_proxy.cc b/content/browser/network/reporting_service_proxy.cc
|
||||
--- a/content/browser/network/reporting_service_proxy.cc
|
||||
+++ b/content/browser/network/reporting_service_proxy.cc
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/unguessable_token.h"
|
||||
#include "base/values.h"
|
||||
+#include "net/base/features.h"
|
||||
#include "content/browser/service_worker/service_worker_host.h"
|
||||
#include "content/browser/worker_host/dedicated_worker_host.h"
|
||||
#include "content/browser/worker_host/shared_worker_host.h"
|
||||
@@ -240,12 +241,14 @@ class ReportingServiceProxyImpl : public blink::mojom::ReportingServiceProxy {
|
||||
const std::string& group,
|
||||
const std::string& type,
|
||||
base::Value::Dict body) {
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
auto* rph = RenderProcessHost::FromID(render_process_id_);
|
||||
if (!rph)
|
||||
return;
|
||||
rph->GetStoragePartition()->GetNetworkContext()->QueueReport(
|
||||
type, group, url, reporting_source_, network_anonymization_key_,
|
||||
std::move(body));
|
||||
+#endif
|
||||
}
|
||||
|
||||
const int render_process_id_;
|
||||
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -15928,12 +15928,6 @@ void RenderFrameHostImpl::MaybeGenerateCrashReport(
|
||||
}
|
||||
}
|
||||
}
|
||||
-
|
||||
- // Send the crash report to the Reporting API.
|
||||
- GetProcess()->GetStoragePartition()->GetNetworkContext()->QueueReport(
|
||||
- /*type=*/"crash", crash_reporting_group_, last_committed_url_,
|
||||
- GetReportingSource(), isolation_info_.network_anonymization_key(),
|
||||
- std::move(body));
|
||||
}
|
||||
|
||||
void RenderFrameHostImpl::UpdateOrDisableCompositorMetricRecorder() const {
|
||||
diff --git a/content/browser/security/coop/cross_origin_opener_policy_reporter.cc b/content/browser/security/coop/cross_origin_opener_policy_reporter.cc
|
||||
--- a/content/browser/security/coop/cross_origin_opener_policy_reporter.cc
|
||||
+++ b/content/browser/security/coop/cross_origin_opener_policy_reporter.cc
|
||||
@@ -18,25 +18,17 @@
|
||||
#include "services/network/public/mojom/network_context.mojom.h"
|
||||
#include "services/network/public/mojom/source_location.mojom.h"
|
||||
#include "url/origin.h"
|
||||
+#include "build/build_config.h"
|
||||
|
||||
namespace content {
|
||||
|
||||
namespace {
|
||||
|
||||
// Report attribute names (camelCase):
|
||||
-constexpr char kColumnNumber[] = "columnNumber";
|
||||
constexpr char kDisposition[] = "disposition";
|
||||
-constexpr char kEffectivePolicy[] = "effectivePolicy";
|
||||
-constexpr char kInitialPopupURL[] = "initialPopupURL";
|
||||
-constexpr char kLineNumber[] = "lineNumber";
|
||||
constexpr char kNextURL[] = "nextResponseURL";
|
||||
-constexpr char kOpeneeURL[] = "openeeURL";
|
||||
-constexpr char kOpenerURL[] = "openerURL";
|
||||
-constexpr char kOtherDocumentURL[] = "otherDocumentURL";
|
||||
constexpr char kPreviousURL[] = "previousResponseURL";
|
||||
-constexpr char kProperty[] = "property";
|
||||
constexpr char kReferrer[] = "referrer";
|
||||
-constexpr char kSourceFile[] = "sourceFile";
|
||||
constexpr char kType[] = "type";
|
||||
|
||||
// Report attribute values:
|
||||
@@ -45,6 +37,7 @@ constexpr char kDispositionReporting[] = "reporting";
|
||||
constexpr char kTypeFromResponse[] = "navigation-from-response";
|
||||
constexpr char kTypeToResponse[] = "navigation-to-response";
|
||||
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
std::string ToString(network::mojom::CrossOriginOpenerPolicyValue coop_value) {
|
||||
switch (coop_value) {
|
||||
case network::mojom::CrossOriginOpenerPolicyValue::kUnsafeNone:
|
||||
@@ -59,6 +52,7 @@ std::string ToString(network::mojom::CrossOriginOpenerPolicyValue coop_value) {
|
||||
return "noopener-allow-popups";
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
FrameTreeNode* TopLevelOpener(FrameTreeNode* frame) {
|
||||
FrameTreeNode* opener =
|
||||
@@ -230,6 +224,7 @@ void CrossOriginOpenerPolicyReporter::QueueAccessReport(
|
||||
network::mojom::SourceLocationPtr source_location,
|
||||
const std::string& reported_window_url,
|
||||
const std::string& initial_popup_url) const {
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
// Cross-Origin-Opener-Policy-Report-Only is not required to provide
|
||||
// endpoints.
|
||||
if (!coop_.report_only_reporting_endpoint)
|
||||
@@ -277,12 +272,14 @@ void CrossOriginOpenerPolicyReporter::QueueAccessReport(
|
||||
storage_partition_->GetNetworkContext()->QueueReport(
|
||||
"coop", endpoint, context_url_, reporting_source_,
|
||||
network_anonymization_key_, std::move(body));
|
||||
+#endif
|
||||
}
|
||||
|
||||
void CrossOriginOpenerPolicyReporter::QueueNavigationReport(
|
||||
base::Value::Dict body,
|
||||
const std::string& endpoint,
|
||||
bool is_report_only) {
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
body.Set(kDisposition,
|
||||
is_report_only ? kDispositionReporting : kDispositionEnforce);
|
||||
body.Set(kEffectivePolicy,
|
||||
@@ -290,6 +287,7 @@ void CrossOriginOpenerPolicyReporter::QueueNavigationReport(
|
||||
storage_partition_->GetNetworkContext()->QueueReport(
|
||||
"coop", endpoint, context_url_, reporting_source_,
|
||||
network_anonymization_key_, std::move(body));
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace content
|
||||
diff --git a/content/browser/security/dip/document_isolation_policy_reporter.cc b/content/browser/security/dip/document_isolation_policy_reporter.cc
|
||||
--- a/content/browser/security/dip/document_isolation_policy_reporter.cc
|
||||
+++ b/content/browser/security/dip/document_isolation_policy_reporter.cc
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <string_view>
|
||||
|
||||
#include "base/values.h"
|
||||
+#include "net/net_buildflags.h"
|
||||
#include "content/public/browser/storage_partition.h"
|
||||
#include "services/network/public/cpp/request_destination.h"
|
||||
#include "services/network/public/mojom/network_context.mojom.h"
|
||||
@@ -94,11 +95,13 @@ void DocumentIsolationPolicyReporter::QueueAndNotify(
|
||||
}
|
||||
body_to_pass.Set("disposition", disposition);
|
||||
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
if (auto* storage_partition = storage_partition_.get()) {
|
||||
storage_partition->GetNetworkContext()->QueueReport(
|
||||
kType, *endpoint, context_url_, reporting_source_,
|
||||
network_anonymization_key_, std::move(body_to_pass));
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/content/browser/web_package/signed_exchange_reporter.cc b/content/browser/web_package/signed_exchange_reporter.cc
|
||||
--- a/content/browser/web_package/signed_exchange_reporter.cc
|
||||
+++ b/content/browser/web_package/signed_exchange_reporter.cc
|
||||
@@ -127,6 +127,7 @@ void ReportResult(
|
||||
FrameTreeNodeId frame_tree_node_id,
|
||||
network::mojom::SignedExchangeReportPtr report,
|
||||
const net::NetworkAnonymizationKey& network_anonymization_key) {
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
FrameTreeNode* frame_tree_node =
|
||||
FrameTreeNode::GloballyFindByID(frame_tree_node_id);
|
||||
if (!frame_tree_node)
|
||||
@@ -141,6 +142,7 @@ void ReportResult(
|
||||
DCHECK(partition);
|
||||
partition->GetNetworkContext()->QueueSignedExchangeReport(
|
||||
std::move(report), network_anonymization_key);
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
if (enable_reporting) {
|
||||
sources += [
|
||||
- "net/cross_origin_embedder_policy_reporter.cc",
|
||||
- "net/cross_origin_embedder_policy_reporter.h",
|
||||
- "net/cross_origin_opener_policy_reporter.cc",
|
||||
- "net/cross_origin_opener_policy_reporter.h",
|
||||
"net/reporting_service_proxy.cc",
|
||||
"net/reporting_service_proxy.h",
|
||||
]
|
||||
diff --git a/content/public/common/content_switch_dependent_feature_overrides.cc b/content/public/common/content_switch_dependent_feature_overrides.cc
|
||||
--- a/content/public/common/content_switch_dependent_feature_overrides.cc
|
||||
+++ b/content/public/common/content_switch_dependent_feature_overrides.cc
|
||||
@@ -9,6 +9,7 @@
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "content/public/common/content_features.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "net/base/features.h"
|
||||
@@ -271,150 +47,31 @@ diff --git a/content/public/common/content_switch_dependent_feature_overrides.cc
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "services/network/public/cpp/network_switches.h"
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
diff --git a/cromite_flags/services/network/public/cpp/features_cc/Allow-building-without-enable_reporting.inc b/cromite_flags/services/network/public/cpp/features_cc/Allow-building-without-enable_reporting.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/services/network/public/cpp/features_cc/Allow-building-without-enable_reporting.inc
|
||||
@@ -0,0 +1,2 @@
|
||||
+SET_CROMITE_FEATURE_DISABLED(kNetworkErrorLogging);
|
||||
+SET_CROMITE_FEATURE_DISABLED(kReporting);
|
||||
diff --git a/net/reporting/reporting_header_parser.cc b/net/reporting/reporting_header_parser.cc
|
||||
--- a/net/reporting/reporting_header_parser.cc
|
||||
+++ b/net/reporting/reporting_header_parser.cc
|
||||
@@ -337,6 +337,7 @@ void ReportingHeaderParser::ProcessParsedReportingEndpointsHeader(
|
||||
const NetworkAnonymizationKey& network_anonymization_key,
|
||||
const url::Origin& origin,
|
||||
base::flat_map<std::string, std::string> header) {
|
||||
+ CHECK(false);
|
||||
DCHECK(GURL::SchemeIsCryptographic(origin.scheme()));
|
||||
DCHECK(!reporting_source.is_empty());
|
||||
DCHECK(network_anonymization_key.IsEmpty() ||
|
||||
diff --git a/net/reporting/reporting_service.cc b/net/reporting/reporting_service.cc
|
||||
--- a/net/reporting/reporting_service.cc
|
||||
+++ b/net/reporting/reporting_service.cc
|
||||
@@ -236,6 +236,12 @@ class ReportingServiceImpl : public ReportingService {
|
||||
int depth,
|
||||
base::TimeTicks queued_ticks,
|
||||
ReportingTargetType target_type) {
|
||||
@@ -46,9 +47,11 @@ GetSwitchDependentFeatureOverrides(const base::CommandLine& command_line) {
|
||||
{switches::kEnableExperimentalWebPlatformFeatures,
|
||||
std::cref(features::kDocumentPolicyNegotiation),
|
||||
base::FeatureList::OVERRIDE_ENABLE_FEATURE},
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
+ if ((true))
|
||||
+ return;
|
||||
+#else
|
||||
+#error Attempting to build with enable_reporting
|
||||
{switches::kEnableExperimentalWebPlatformFeatures,
|
||||
std::cref(net::features::kDocumentReporting),
|
||||
base::FeatureList::OVERRIDE_ENABLE_FEATURE},
|
||||
+#endif
|
||||
DCHECK(initialized_);
|
||||
context_->cache()->AddReport(
|
||||
reporting_source, network_anonymization_key, sanitized_url, user_agent,
|
||||
diff --git a/services/network/network_context.h b/services/network/network_context.h
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -486,14 +486,14 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
const GURL& url,
|
||||
const std::optional<base::UnguessableToken>& reporting_source,
|
||||
const net::NetworkAnonymizationKey& network_anonymization_key,
|
||||
- base::Value::Dict body) override;
|
||||
+ base::Value::Dict body);
|
||||
void QueueEnterpriseReport(const std::string& type,
|
||||
const std::string& group,
|
||||
const GURL& url,
|
||||
- base::Value::Dict body) override;
|
||||
+ base::Value::Dict body);
|
||||
void QueueSignedExchangeReport(
|
||||
mojom::SignedExchangeReportPtr report,
|
||||
- const net::NetworkAnonymizationKey& network_anonymization_key) override;
|
||||
+ const net::NetworkAnonymizationKey& network_anonymization_key);
|
||||
void AddDomainReliabilityContextForTesting(
|
||||
const url::Origin& origin,
|
||||
const GURL& upload_url,
|
||||
diff --git a/services/network/public/cpp/parsed_headers.cc b/services/network/public/cpp/parsed_headers.cc
|
||||
--- a/services/network/public/cpp/parsed_headers.cc
|
||||
+++ b/services/network/public/cpp/parsed_headers.cc
|
||||
@@ -125,6 +125,7 @@ mojom::ParsedHeadersPtr PopulateParsedHeaders(
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_REPORTING)
|
||||
+#error Attempting to build with enable_reporting
|
||||
if (std::optional<std::string> reporting_endpoints =
|
||||
headers->GetNormalizedHeader("Reporting-Endpoints")) {
|
||||
parsed_headers->reporting_endpoints =
|
||||
diff --git a/services/network/public/mojom/BUILD.gn b/services/network/public/mojom/BUILD.gn
|
||||
--- a/services/network/public/mojom/BUILD.gn
|
||||
+++ b/services/network/public/mojom/BUILD.gn
|
||||
@@ -1791,7 +1791,6 @@ mojom("mojom") {
|
||||
export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
|
||||
export_header_blink = "third_party/blink/public/platform/web_common.h"
|
||||
if (enable_reporting) {
|
||||
- enabled_features += [ "enable_reporting" ]
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
|
||||
--- a/services/network/public/mojom/network_context.mojom
|
||||
+++ b/services/network/public/mojom/network_context.mojom
|
||||
@@ -1234,6 +1234,7 @@ interface NetworkContext {
|
||||
// provided `network_anonymization_key`.
|
||||
//
|
||||
// Spec: https://w3c.github.io/reporting/#concept-reports
|
||||
+ [EnableIf=enable_reporting]
|
||||
QueueReport(string type,
|
||||
string group,
|
||||
url.mojom.Url url,
|
||||
@@ -1241,6 +1242,7 @@ interface NetworkContext {
|
||||
NetworkAnonymizationKey network_anonymization_key,
|
||||
mojo_base.mojom.DictionaryValue body);
|
||||
|
||||
+ [EnableIf=enable_reporting]
|
||||
QueueEnterpriseReport(string type,
|
||||
string group,
|
||||
url.mojom.Url url,
|
||||
@@ -1251,6 +1253,7 @@ interface NetworkContext {
|
||||
// Note that this queued report will never be delivered if no reporting
|
||||
// endpoint matching is registered for with the provided
|
||||
// `network_anonymization_key`.
|
||||
+ [EnableIf=enable_reporting]
|
||||
QueueSignedExchangeReport(SignedExchangeReport report,
|
||||
NetworkAnonymizationKey network_anonymization_key);
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/csp/content_security_policy.cc b/third_party/blink/renderer/core/frame/csp/content_security_policy.cc
|
||||
--- a/third_party/blink/renderer/core/frame/csp/content_security_policy.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/csp/content_security_policy.cc
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <set>
|
||||
#include <utility>
|
||||
|
||||
+#include "net/net_buildflags.h"
|
||||
#include "base/containers/contains.h"
|
||||
#include "base/debug/dump_without_crashing.h"
|
||||
#include "base/feature_list.h"
|
||||
@@ -1260,6 +1261,7 @@ void ContentSecurityPolicy::ReportViolation(
|
||||
return;
|
||||
}
|
||||
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
PostViolationReport(violation_data, context_frame, report_endpoints,
|
||||
use_reporting_api);
|
||||
|
||||
@@ -1267,6 +1269,7 @@ void ContentSecurityPolicy::ReportViolation(
|
||||
// `context_frame` (i.e. we're not processing 'frame-ancestors').
|
||||
if (delegate_ && !context_frame)
|
||||
delegate_->DispatchViolationEvent(*violation_data, element);
|
||||
+#endif
|
||||
|
||||
AuditsIssue audits_issue = AuditsIssue::CreateContentSecurityPolicyIssue(
|
||||
*violation_data, header_type == ContentSecurityPolicyType::kReport,
|
||||
{switches::kEnableExperimentalWebPlatformFeatures,
|
||||
std::cref(features::kExperimentalContentSecurityPolicyFeatures),
|
||||
base::FeatureList::OVERRIDE_ENABLE_FEATURE},
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "build/build_config.h"
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "base/values.h"
|
||||
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
|
||||
#include "mojo/public/cpp/system/message_pipe.h"
|
||||
+#include "net/net_buildflags.h"
|
||||
#include "services/data_decoder/public/mojom/resource_snapshot_for_web_bundle.mojom-blink.h"
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "services/network/public/mojom/content_security_policy.mojom-blink.h"
|
||||
#include "services/network/public/mojom/source_location.mojom-blink.h"
|
||||
@@ -2740,9 +2741,11 @@ DocumentResourceCoordinator* LocalFrame::GetDocumentResourceCoordinator() {
|
||||
return CHECK_DEREF(GetDocument()).GetResourceCoordinator();
|
||||
@@ -2282,9 +2283,11 @@ const base::UnguessableToken& LocalFrame::GetAgentClusterId() const {
|
||||
return base::UnguessableToken::Null();
|
||||
}
|
||||
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
@@ -423,29 +80,34 @@ diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/
|
||||
}
|
||||
+#endif
|
||||
|
||||
mojom::blink::DevicePostureProvider* LocalFrame::GetDevicePostureProvider() {
|
||||
return mojo_handler_->DevicePostureProvider();
|
||||
// static
|
||||
void LocalFrame::NotifyUserActivation(
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.h
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "base/time/time.h"
|
||||
@@ -33,9 +33,9 @@
|
||||
|
||||
#include "base/time/default_tick_clock.h"
|
||||
#include "base/unguessable_token.h"
|
||||
#include "build/build_config.h"
|
||||
+#include "net/net_buildflags.h"
|
||||
-#include "build/build_config.h"
|
||||
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
|
||||
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
||||
#include "net/storage_access_api/status.h"
|
||||
@@ -667,7 +668,9 @@ class CORE_EXPORT LocalFrame final
|
||||
return client_hints_preferences_;
|
||||
+#include "net/net_buildflags.h"
|
||||
#include "services/device/public/mojom/device_posture_provider.mojom-blink-forward.h"
|
||||
#include "services/network/public/mojom/fetch_api.mojom-blink-forward.h"
|
||||
#include "third_party/blink/public/common/frame/frame_ad_evidence.h"
|
||||
@@ -543,9 +543,9 @@ class CORE_EXPORT LocalFrame final : public Frame,
|
||||
}
|
||||
|
||||
SmoothScrollSequencer& GetSmoothScrollSequencer();
|
||||
-
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
mojom::blink::ReportingServiceProxy* GetReportingService();
|
||||
-
|
||||
+#endif
|
||||
mojom::blink::DevicePostureProvider* GetDevicePostureProvider();
|
||||
|
||||
// Returns the frame host ptr. The interface returned is backed by an
|
||||
// associated interface with the legacy Chrome IPC channel.
|
||||
mojom::blink::LocalFrameHost& GetLocalFrameHostRemote() const;
|
||||
diff --git a/third_party/blink/renderer/core/frame/reporting_context.cc b/third_party/blink/renderer/core/frame/reporting_context.cc
|
||||
--- a/third_party/blink/renderer/core/frame/reporting_context.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/reporting_context.cc
|
||||
@@ -454,30 +116,30 @@ diff --git a/third_party/blink/renderer/core/frame/reporting_context.cc b/third_
|
||||
#include "third_party/blink/renderer/core/frame/reporting_context.h"
|
||||
|
||||
+#include "net/net_buildflags.h"
|
||||
#include "third_party/blink/public/platform/browser_interface_broker_proxy.h"
|
||||
#include "third_party/blink/public/common/browser_interface_broker_proxy.h"
|
||||
#include "third_party/blink/public/platform/platform.h"
|
||||
#include "third_party/blink/public/platform/task_type.h"
|
||||
@@ -59,7 +60,9 @@ const char ReportingContext::kSupplementName[] = "ReportingContext";
|
||||
@@ -54,7 +55,9 @@ const char ReportingContext::kSupplementName[] = "ReportingContext";
|
||||
ReportingContext::ReportingContext(ExecutionContext& context)
|
||||
: Supplement<ExecutionContext>(context),
|
||||
execution_context_(context),
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
reporting_service_(&context),
|
||||
+#endif
|
||||
receivers_(this, &context) {}
|
||||
receiver_(this, &context) {}
|
||||
|
||||
// static
|
||||
@@ -126,7 +129,9 @@ void ReportingContext::Trace(Visitor* visitor) const {
|
||||
@@ -118,7 +121,9 @@ void ReportingContext::Trace(Visitor* visitor) const {
|
||||
visitor->Trace(observers_);
|
||||
visitor->Trace(report_buffer_);
|
||||
visitor->Trace(execution_context_);
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
visitor->Trace(reporting_service_);
|
||||
+#endif
|
||||
visitor->Trace(receivers_);
|
||||
visitor->Trace(receiver_);
|
||||
Supplement<ExecutionContext>::Trace(visitor);
|
||||
}
|
||||
@@ -149,6 +154,7 @@ void ReportingContext::CountReport(Report* report) {
|
||||
@@ -140,6 +145,7 @@ void ReportingContext::CountReport(Report* report) {
|
||||
UseCounter::Count(execution_context_, feature);
|
||||
}
|
||||
|
||||
@@ -485,23 +147,23 @@ diff --git a/third_party/blink/renderer/core/frame/reporting_context.cc b/third_
|
||||
const HeapMojoRemote<mojom::blink::ReportingServiceProxy>&
|
||||
ReportingContext::GetReportingService() const {
|
||||
if (!reporting_service_.is_bound()) {
|
||||
@@ -158,6 +164,7 @@ ReportingContext::GetReportingService() const {
|
||||
@@ -149,6 +155,7 @@ ReportingContext::GetReportingService() const {
|
||||
}
|
||||
return reporting_service_;
|
||||
}
|
||||
+#endif
|
||||
|
||||
void ReportingContext::NotifyInternal(Report* report) {
|
||||
if (!ShouldReportBeVisibleToObservers(report)) {
|
||||
@@ -184,6 +191,7 @@ void ReportingContext::NotifyInternal(Report* report) {
|
||||
// Buffer the report.
|
||||
@@ -171,6 +178,7 @@ void ReportingContext::NotifyInternal(Report* report) {
|
||||
|
||||
void ReportingContext::SendToReportingAPI(Report* report,
|
||||
const String& endpoint) const {
|
||||
+#if BUILDFLAG(ENABLE_REPORTING)
|
||||
const String& type = report->type();
|
||||
if (!(type == ReportType::kCSPViolation || type == ReportType::kCSPHash ||
|
||||
type == ReportType::kDeprecation ||
|
||||
@@ -263,6 +271,7 @@ void ReportingContext::SendToReportingAPI(Report* report,
|
||||
if (!(type == ReportType::kCSPViolation || type == ReportType::kDeprecation ||
|
||||
type == ReportType::kPermissionsPolicyViolation ||
|
||||
@@ -226,6 +234,7 @@ void ReportingContext::SendToReportingAPI(Report* report,
|
||||
url, endpoint, body->featureId(), body->disposition(), body->message(),
|
||||
body->sourceFile(), line_number, column_number);
|
||||
}
|
||||
@@ -520,7 +182,7 @@ diff --git a/third_party/blink/renderer/core/frame/reporting_context.h b/third_p
|
||||
#include "third_party/blink/public/mojom/frame/reporting_observer.mojom-blink.h"
|
||||
#include "third_party/blink/public/mojom/reporting/reporting.mojom-blink.h"
|
||||
#include "third_party/blink/renderer/core/core_export.h"
|
||||
@@ -56,10 +57,10 @@ class CORE_EXPORT ReportingContext : public GarbageCollected<ReportingContext>,
|
||||
@@ -53,10 +54,10 @@ class CORE_EXPORT ReportingContext : public GarbageCollected<ReportingContext>,
|
||||
private:
|
||||
// Counts the use of a report type via UseCounter.
|
||||
void CountReport(Report*);
|
||||
@@ -533,7 +195,7 @@ diff --git a/third_party/blink/renderer/core/frame/reporting_context.h b/third_p
|
||||
void NotifyInternal(Report* report);
|
||||
// Send |report| via the Reporting API to |endpoint|.
|
||||
void SendToReportingAPI(Report* report, const String& endpoint) const;
|
||||
@@ -71,8 +72,10 @@ class CORE_EXPORT ReportingContext : public GarbageCollected<ReportingContext>,
|
||||
@@ -67,8 +68,10 @@ class CORE_EXPORT ReportingContext : public GarbageCollected<ReportingContext>,
|
||||
|
||||
// This is declared mutable so that the service endpoint can be cached by
|
||||
// const methods.
|
||||
@@ -542,19 +204,8 @@ diff --git a/third_party/blink/renderer/core/frame/reporting_context.h b/third_p
|
||||
reporting_service_;
|
||||
+#endif
|
||||
|
||||
// There might be up to two ReportingObservers stored here: one that is called
|
||||
// from the CrossOriginEmbedderPolicyReporter and one that is called from the
|
||||
diff --git a/third_party/blink/renderer/core/frame/reporting_observer.cc b/third_party/blink/renderer/core/frame/reporting_observer.cc
|
||||
--- a/third_party/blink/renderer/core/frame/reporting_observer.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/reporting_observer.cc
|
||||
@@ -62,8 +62,7 @@ void ReportingObserver::QueueReport(Report* report) {
|
||||
}
|
||||
|
||||
bool ReportingObserver::ObservedType(const String& type) {
|
||||
- return !options_->hasTypesNonNull() || options_->typesNonNull().empty() ||
|
||||
- options_->typesNonNull().Find(type) != kNotFound;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
bool ReportingObserver::Buffered() {
|
||||
--
|
||||
HeapMojoReceiver<mojom::blink::ReportingObserver, ReportingContext> receiver_;
|
||||
};
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -1,247 +0,0 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Mon, 21 Feb 2022 01:24:11 +0100
|
||||
Subject: Allow building without supervised users
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
chrome/android/BUILD.gn | 1 -
|
||||
.../chrome/browser/feedback/ChromeFeedbackCollector.java | 1 -
|
||||
chrome/browser/feedback/android/BUILD.gn | 2 --
|
||||
chrome/browser/prefs/chrome_pref_service_factory.cc | 2 +-
|
||||
chrome/browser/profiles/profile_attributes_entry.cc | 2 +-
|
||||
chrome/browser/profiles/profile_impl.cc | 5 +----
|
||||
chrome/browser/profiles/profile_manager.cc | 7 -------
|
||||
.../supervised_user/supervised_user_browser_utils.cc | 1 +
|
||||
chrome/browser/ui/webui/managed_ui_handler.cc | 4 ----
|
||||
.../browser/ui/webui/management/management_ui_handler.cc | 4 ----
|
||||
.../core/browser/supervised_user_pref_store.cc | 1 +
|
||||
.../core/browser/supervised_user_preferences.cc | 6 +++++-
|
||||
.../core/browser/supervised_user_service.cc | 1 +
|
||||
components/supervised_user/core/common/features.cc | 2 +-
|
||||
extensions/browser/api/management/management_api.cc | 1 +
|
||||
15 files changed, 13 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
|
||||
--- a/chrome/android/BUILD.gn
|
||||
+++ b/chrome/android/BUILD.gn
|
||||
@@ -805,7 +805,6 @@ if (_is_default_toolchain) {
|
||||
"//components/offline_pages/core:offline_page_model_enums_java",
|
||||
"//components/sharing_message:sharing_dialog_type_generated_enum",
|
||||
"//components/sharing_message:sharing_send_message_result_generated_enum",
|
||||
- "//components/supervised_user/core/browser:supervised_user_utils_enum_javagen",
|
||||
]
|
||||
|
||||
# From java_sources.gni.
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/feedback/ChromeFeedbackCollector.java b/chrome/android/java/src/org/chromium/chrome/browser/feedback/ChromeFeedbackCollector.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/feedback/ChromeFeedbackCollector.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/feedback/ChromeFeedbackCollector.java
|
||||
@@ -93,7 +93,6 @@ public class ChromeFeedbackCollector extends FeedbackCollector<ChromeFeedbackCol
|
||||
// FamilyInfoFeedbackSource relies on IdentityManager which is not available for the
|
||||
// incognito profile.
|
||||
if (!initParams.profile.isOffTheRecord()) {
|
||||
- sources.add(new FamilyInfoFeedbackSource(initParams.profile));
|
||||
}
|
||||
|
||||
return sources;
|
||||
diff --git a/chrome/browser/feedback/android/BUILD.gn b/chrome/browser/feedback/android/BUILD.gn
|
||||
--- a/chrome/browser/feedback/android/BUILD.gn
|
||||
+++ b/chrome/browser/feedback/android/BUILD.gn
|
||||
@@ -8,7 +8,6 @@ import("//third_party/jni_zero/jni_zero.gni")
|
||||
|
||||
generate_jni("jni_headers") {
|
||||
sources = [
|
||||
- "java/src/org/chromium/chrome/browser/feedback/FamilyInfoFeedbackSource.java",
|
||||
"java/src/org/chromium/chrome/browser/feedback/ProcessIdFeedbackSource.java",
|
||||
"java/src/org/chromium/chrome/browser/feedback/SystemInfoFeedbackSource.java",
|
||||
]
|
||||
@@ -56,7 +55,6 @@ android_library("java") {
|
||||
"java/src/org/chromium/chrome/browser/feedback/AsyncFeedbackSourceAdapter.java",
|
||||
"java/src/org/chromium/chrome/browser/feedback/DeviceInfoFeedbackSource.java",
|
||||
"java/src/org/chromium/chrome/browser/feedback/FallbackHelpAndFeedbackLauncherDelegate.java",
|
||||
- "java/src/org/chromium/chrome/browser/feedback/FamilyInfoFeedbackSource.java",
|
||||
"java/src/org/chromium/chrome/browser/feedback/FeedbackContextFeedbackSource.java",
|
||||
"java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncher.java",
|
||||
"java/src/org/chromium/chrome/browser/feedback/HelpAndFeedbackLauncherDelegate.java",
|
||||
diff --git a/chrome/browser/prefs/chrome_pref_service_factory.cc b/chrome/browser/prefs/chrome_pref_service_factory.cc
|
||||
--- a/chrome/browser/prefs/chrome_pref_service_factory.cc
|
||||
+++ b/chrome/browser/prefs/chrome_pref_service_factory.cc
|
||||
@@ -328,7 +328,7 @@ void PrepareFactory(
|
||||
policy::BrowserPolicyConnector* policy_connector) {
|
||||
factory->SetManagedPolicies(policy_service, policy_connector);
|
||||
factory->SetRecommendedPolicies(policy_service, policy_connector);
|
||||
- if (supervised_user_settings) {
|
||||
+ if (((false)) && supervised_user_settings) {
|
||||
scoped_refptr<PrefStore> supervised_user_prefs =
|
||||
base::MakeRefCounted<SupervisedUserPrefStore>(supervised_user_settings);
|
||||
DCHECK(async || supervised_user_prefs->IsInitializationComplete());
|
||||
diff --git a/chrome/browser/profiles/profile_attributes_entry.cc b/chrome/browser/profiles/profile_attributes_entry.cc
|
||||
--- a/chrome/browser/profiles/profile_attributes_entry.cc
|
||||
+++ b/chrome/browser/profiles/profile_attributes_entry.cc
|
||||
@@ -467,7 +467,7 @@ bool ProfileAttributesEntry::IsSigninRequired() const {
|
||||
}
|
||||
|
||||
std::string ProfileAttributesEntry::GetSupervisedUserId() const {
|
||||
- return GetString(kSupervisedUserId);
|
||||
+ return "";
|
||||
}
|
||||
|
||||
bool ProfileAttributesEntry::IsEphemeral() const {
|
||||
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
|
||||
--- a/chrome/browser/profiles/profile_impl.cc
|
||||
+++ b/chrome/browser/profiles/profile_impl.cc
|
||||
@@ -674,10 +674,6 @@ void ProfileImpl::DoFinalInit(CreateMode create_mode) {
|
||||
prefs->SetTime(prefs::kProfileCreationTime, path_creation_time_);
|
||||
|
||||
pref_change_registrar_.Init(prefs);
|
||||
- pref_change_registrar_.Add(
|
||||
- prefs::kSupervisedUserId,
|
||||
- base::BindRepeating(&ProfileImpl::UpdateSupervisedUserIdInStorage,
|
||||
- base::Unretained(this)));
|
||||
|
||||
// Changes in the profile avatar.
|
||||
pref_change_registrar_.Add(
|
||||
@@ -1619,6 +1615,7 @@ GURL ProfileImpl::GetHomePage() {
|
||||
}
|
||||
|
||||
void ProfileImpl::UpdateSupervisedUserIdInStorage() {
|
||||
+ if ((true)) return;
|
||||
ProfileManager* profile_manager = g_browser_process->profile_manager();
|
||||
ProfileAttributesEntry* entry = profile_manager->GetProfileAttributesStorage()
|
||||
.GetProfileAttributesWithPath(GetPath());
|
||||
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
|
||||
--- a/chrome/browser/profiles/profile_manager.cc
|
||||
+++ b/chrome/browser/profiles/profile_manager.cc
|
||||
@@ -1192,10 +1192,6 @@ void ProfileManager::InitProfileUserPrefs(Profile* profile) {
|
||||
profile->GetPrefs()->SetString(prefs::kProfileName, profile_name);
|
||||
}
|
||||
|
||||
- if (!profile->GetPrefs()->HasPrefPath(prefs::kSupervisedUserId)) {
|
||||
- profile->GetPrefs()->SetString(prefs::kSupervisedUserId,
|
||||
- supervised_user_id);
|
||||
- }
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
if (profile->IsNewProfile()) {
|
||||
profile->GetPrefs()->SetBoolean(prefs::kHasSeenWelcomePage, false);
|
||||
@@ -1978,9 +1974,6 @@ void ProfileManager::AddProfileToStorage(Profile* profile) {
|
||||
init_params.icon_index =
|
||||
profile->GetPrefs()->GetInteger(prefs::kProfileAvatarIndex);
|
||||
|
||||
- init_params.supervised_user_id =
|
||||
- profile->GetPrefs()->GetString(prefs::kSupervisedUserId);
|
||||
-
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
user_manager::User* user =
|
||||
ash::ProfileHelper::Get()->GetUserByProfile(profile);
|
||||
diff --git a/chrome/browser/supervised_user/supervised_user_browser_utils.cc b/chrome/browser/supervised_user/supervised_user_browser_utils.cc
|
||||
--- a/chrome/browser/supervised_user/supervised_user_browser_utils.cc
|
||||
+++ b/chrome/browser/supervised_user/supervised_user_browser_utils.cc
|
||||
@@ -99,6 +99,7 @@ bool SupervisedUserCanSkipExtensionParentApprovals(const Profile* profile) {
|
||||
}
|
||||
|
||||
bool AreExtensionsPermissionsEnabled(Profile* profile) {
|
||||
+ if ((true)) return false;
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
return profile->IsChild();
|
||||
#else
|
||||
diff --git a/chrome/browser/ui/webui/managed_ui_handler.cc b/chrome/browser/ui/webui/managed_ui_handler.cc
|
||||
--- a/chrome/browser/ui/webui/managed_ui_handler.cc
|
||||
+++ b/chrome/browser/ui/webui/managed_ui_handler.cc
|
||||
@@ -89,10 +89,6 @@ void ManagedUIHandler::AddObservers() {
|
||||
auto domain = static_cast<policy::PolicyDomain>(i);
|
||||
policy_service->AddObserver(domain, this);
|
||||
}
|
||||
-
|
||||
- pref_registrar_.Add(prefs::kSupervisedUserId,
|
||||
- base::BindRepeating(&ManagedUIHandler::NotifyIfChanged,
|
||||
- base::Unretained(this)));
|
||||
}
|
||||
|
||||
void ManagedUIHandler::RemoveObservers() {
|
||||
diff --git a/chrome/browser/ui/webui/management/management_ui_handler.cc b/chrome/browser/ui/webui/management/management_ui_handler.cc
|
||||
--- a/chrome/browser/ui/webui/management/management_ui_handler.cc
|
||||
+++ b/chrome/browser/ui/webui/management/management_ui_handler.cc
|
||||
@@ -595,10 +595,6 @@ bool ManagementUIHandler::managed() const {
|
||||
|
||||
void ManagementUIHandler::RegisterPrefChange(
|
||||
PrefChangeRegistrar& pref_registrar) {
|
||||
- pref_registrar_.Add(
|
||||
- prefs::kSupervisedUserId,
|
||||
- base::BindRepeating(&ManagementUIHandler::UpdateManagedState,
|
||||
- base::Unretained(this)));
|
||||
}
|
||||
|
||||
void ManagementUIHandler::UpdateManagedState() {
|
||||
diff --git a/components/supervised_user/core/browser/supervised_user_pref_store.cc b/components/supervised_user/core/browser/supervised_user_pref_store.cc
|
||||
--- a/components/supervised_user/core/browser/supervised_user_pref_store.cc
|
||||
+++ b/components/supervised_user/core/browser/supervised_user_pref_store.cc
|
||||
@@ -142,6 +142,7 @@ SupervisedUserPrefStore::~SupervisedUserPrefStore() = default;
|
||||
|
||||
void SupervisedUserPrefStore::OnNewSettingsAvailable(
|
||||
const base::Value::Dict& settings) {
|
||||
+ if ((true)) return;
|
||||
std::unique_ptr<PrefValueMap> old_prefs = std::move(prefs_);
|
||||
prefs_ = std::make_unique<PrefValueMap>();
|
||||
if (!settings.empty()) {
|
||||
diff --git a/components/supervised_user/core/browser/supervised_user_preferences.cc b/components/supervised_user/core/browser/supervised_user_preferences.cc
|
||||
--- a/components/supervised_user/core/browser/supervised_user_preferences.cc
|
||||
+++ b/components/supervised_user/core/browser/supervised_user_preferences.cc
|
||||
@@ -164,6 +164,10 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
|
||||
}
|
||||
|
||||
void EnableParentalControls(PrefService& pref_service) {
|
||||
+ if ((true)) {
|
||||
+ DisableParentalControls(pref_service);
|
||||
+ return;
|
||||
+ }
|
||||
pref_service.SetString(prefs::kSupervisedUserId,
|
||||
supervised_user::kChildAccountSUID);
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
@@ -197,7 +201,7 @@ bool IsSafeSitesEnabled(const PrefService& pref_service) {
|
||||
}
|
||||
|
||||
bool IsSubjectToParentalControls(const PrefService& pref_service) {
|
||||
- return pref_service.GetString(prefs::kSupervisedUserId) == kChildAccountSUID;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
bool IsGoogleSafeSearchEnforced(const PrefService& pref_service) {
|
||||
diff --git a/components/supervised_user/core/browser/supervised_user_service.cc b/components/supervised_user/core/browser/supervised_user_service.cc
|
||||
--- a/components/supervised_user/core/browser/supervised_user_service.cc
|
||||
+++ b/components/supervised_user/core/browser/supervised_user_service.cc
|
||||
@@ -168,6 +168,7 @@ SupervisedUserService::SupervisedUserService(
|
||||
}
|
||||
|
||||
void SupervisedUserService::SetSettingsServiceActive(bool active) {
|
||||
+ active = false;
|
||||
settings_service_->SetActive(active);
|
||||
|
||||
// Trigger a sync reconfig to enable/disable the right SU data types.
|
||||
diff --git a/components/supervised_user/core/common/features.cc b/components/supervised_user/core/common/features.cc
|
||||
--- a/components/supervised_user/core/common/features.cc
|
||||
+++ b/components/supervised_user/core/common/features.cc
|
||||
@@ -35,7 +35,6 @@ BASE_FEATURE(kAllowSubframeLocalWebApprovals,
|
||||
#else
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
#endif
|
||||
-
|
||||
#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
|
||||
BUILDFLAG(IS_WIN)
|
||||
const int kLocalWebApprovalBottomSheetLoadTimeoutDefaultValueMs = 5000;
|
||||
@@ -148,4 +147,5 @@ BASE_FEATURE(kDecoupleSafeSitesFromMainSwitch,
|
||||
"DecoupleSafeSitesFromMainSwitch",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
+SET_CROMITE_FEATURE_DISABLED(kLocalWebApprovals);
|
||||
} // namespace supervised_user
|
||||
diff --git a/extensions/browser/api/management/management_api.cc b/extensions/browser/api/management/management_api.cc
|
||||
--- a/extensions/browser/api/management/management_api.cc
|
||||
+++ b/extensions/browser/api/management/management_api.cc
|
||||
@@ -310,6 +310,7 @@ void AddExtensionInfo(const Extension* source_extension,
|
||||
}
|
||||
|
||||
bool PlatformSupportsApprovalFlowForExtensions() {
|
||||
+ if ((true)) return false;
|
||||
#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
|
||||
BUILDFLAG(IS_WIN)
|
||||
return true;
|
||||
--
|
||||
@@ -2,17 +2,29 @@ From: AlexeyBarabash <alexey@brave.com>
|
||||
Date: Thu, 2 Nov 2017 18:21:16 +0200
|
||||
Subject: Allow playing audio in background
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../renderer/platform/media/web_media_player_impl.cc | 11 ++++++++++-
|
||||
.../renderer/platform/media/web_media_player_impl.h | 3 +++
|
||||
2 files changed, 13 insertions(+), 1 deletion(-)
|
||||
.../public/platform/media/web_media_player_impl.h | 3 +++
|
||||
.../renderer/platform/media/web_media_player_impl.cc | 12 +++++++++++-
|
||||
2 files changed, 14 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/third_party/blink/public/platform/media/web_media_player_impl.h b/third_party/blink/public/platform/media/web_media_player_impl.h
|
||||
--- a/third_party/blink/public/platform/media/web_media_player_impl.h
|
||||
+++ b/third_party/blink/public/platform/media/web_media_player_impl.h
|
||||
@@ -159,6 +159,9 @@ class BLINK_PLATFORM_EXPORT WebMediaPlayerImpl
|
||||
bool HasVideo() const override;
|
||||
bool HasAudio() const override;
|
||||
|
||||
+ // True is has video and it's frame size is not zero
|
||||
+ bool HasVideoNonEmptySize() const;
|
||||
+
|
||||
void EnabledAudioTracksChanged(
|
||||
const WebVector<WebMediaPlayer::TrackId>& enabledTrackIds) override;
|
||||
void SelectedVideoTrackChanged(
|
||||
diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.cc b/third_party/blink/renderer/platform/media/web_media_player_impl.cc
|
||||
--- a/third_party/blink/renderer/platform/media/web_media_player_impl.cc
|
||||
+++ b/third_party/blink/renderer/platform/media/web_media_player_impl.cc
|
||||
@@ -1340,6 +1340,12 @@ void WebMediaPlayerImpl::OnSelectedVideoTrackChanged(
|
||||
pipeline_controller_->OnSelectedVideoTrackChanged(selected);
|
||||
@@ -1118,6 +1118,12 @@ bool WebMediaPlayerImpl::HasAudio() const {
|
||||
return pipeline_metadata_.has_audio;
|
||||
}
|
||||
|
||||
+bool WebMediaPlayerImpl::HasVideoNonEmptySize() const {
|
||||
@@ -22,31 +34,21 @@ diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.cc
|
||||
+}
|
||||
+
|
||||
void WebMediaPlayerImpl::EnabledAudioTracksChanged(
|
||||
const std::vector<WebMediaPlayer::TrackId>& enabled_track_ids) {
|
||||
const WebVector<WebMediaPlayer::TrackId>& enabledTrackIds) {
|
||||
DCHECK(main_task_runner_->BelongsToCurrentThread());
|
||||
@@ -3710,7 +3716,10 @@ bool WebMediaPlayerImpl::ShouldPausePlaybackWhenHidden() const {
|
||||
: HasAudio();
|
||||
|
||||
@@ -3490,7 +3496,11 @@ bool WebMediaPlayerImpl::ShouldPausePlaybackWhenHidden() const {
|
||||
// Audio only stream is allowed to play when in background.
|
||||
- if (!HasVideo() && preserve_audio)
|
||||
// TODO: We should check IsBackgroundOptimizationCandidate here. But we need
|
||||
// to move the logic of checking video frames out of that function.
|
||||
- if (!HasVideo())
|
||||
+
|
||||
+ //pipeline_metadata_.has_video is true for MediaPlayerRenderer,
|
||||
+ //see media/base/pipeline_metadata.h. This is a workaround to allow audio
|
||||
+ //streams be played in background.
|
||||
+ if (!HasVideoNonEmptySize() && preserve_audio)
|
||||
+ if (!HasVideoNonEmptySize())
|
||||
return false;
|
||||
|
||||
// Video PiP is the only exception when background video playback is disabled.
|
||||
diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.h b/third_party/blink/renderer/platform/media/web_media_player_impl.h
|
||||
--- a/third_party/blink/renderer/platform/media/web_media_player_impl.h
|
||||
+++ b/third_party/blink/renderer/platform/media/web_media_player_impl.h
|
||||
@@ -212,6 +212,9 @@ class PLATFORM_EXPORT WebMediaPlayerImpl
|
||||
bool HasVideo() const override;
|
||||
bool HasAudio() const override;
|
||||
|
||||
+ // True is has video and it's frame size is not zero
|
||||
+ bool HasVideoNonEmptySize() const;
|
||||
+
|
||||
void EnabledAudioTracksChanged(
|
||||
const std::vector<WebMediaPlayer::TrackId>& enabled_track_ids) override;
|
||||
void SelectedVideoTrackChanged(
|
||||
--
|
||||
if (using_media_player_renderer_ &&
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
From: xsmile <xsmile@users.noreply.github.com>
|
||||
Date: Thu, 11 Oct 2018 21:29:35 +0200
|
||||
Subject: Allow website sign-in without account sign-in
|
||||
|
||||
Disable prefs::kSigninAllowedOnNextStartup by default. The setting can be found in chrome://settings
|
||||
---
|
||||
chrome/browser/signin/account_consistency_mode_manager.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/browser/signin/account_consistency_mode_manager.cc b/chrome/browser/signin/account_consistency_mode_manager.cc
|
||||
--- a/chrome/browser/signin/account_consistency_mode_manager.cc
|
||||
+++ b/chrome/browser/signin/account_consistency_mode_manager.cc
|
||||
@@ -127,7 +127,7 @@ void AccountConsistencyModeManager::RegisterProfilePrefs(
|
||||
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
|
||||
registry->RegisterBooleanPref(kDiceMigrationCompletePref, false);
|
||||
#endif
|
||||
- registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, false);
|
||||
}
|
||||
|
||||
// static
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 13 Nov 2023 14:26:00 +0000
|
||||
Subject: Always allow inspect fallback
|
||||
|
||||
Always enable 'inspect fallback' in 'chrome://inspect/#devices'
|
||||
|
||||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
---
|
||||
chrome/browser/resources/inspect/inspect.js | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/chrome/browser/resources/inspect/inspect.js b/chrome/browser/resources/inspect/inspect.js
|
||||
--- a/chrome/browser/resources/inspect/inspect.js
|
||||
+++ b/chrome/browser/resources/inspect/inspect.js
|
||||
@@ -45,6 +45,7 @@ if ('browser-inspector' in queryParamsObject) {
|
||||
})();
|
||||
|
||||
function isVersionNewerThanHost(version) {
|
||||
+ if ((true)) return true;
|
||||
if (!HOST_CHROME_VERSION) {
|
||||
return false;
|
||||
}
|
||||
@@ -566,7 +567,7 @@ function formatValue(data, property) {
|
||||
function addFavicon(row, data) {
|
||||
const favicon = document.createElement('img');
|
||||
if (data['faviconUrl']) {
|
||||
- favicon.src = data['faviconUrl'];
|
||||
+ //favicon.src = data['faviconUrl'];
|
||||
}
|
||||
const propertiesBox = row.querySelector('.properties-box');
|
||||
propertiesBox.insertBefore(favicon, propertiesBox.firstChild);
|
||||
--
|
||||
@@ -0,0 +1,37 @@
|
||||
From: samartnik <artem@brave.com>
|
||||
Date: Thu, 14 Dec 2017 16:19:50 +0200
|
||||
Subject: Always allow partner customisation
|
||||
|
||||
---
|
||||
.../PartnerBrowserCustomizations.java | 16 ++++++++--------
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
|
||||
@@ -324,14 +324,14 @@ public class PartnerBrowserCustomizations {
|
||||
@Override
|
||||
protected Void doInBackground() {
|
||||
try {
|
||||
- boolean systemOrPreStable =
|
||||
- (context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) == 1
|
||||
- || !ChromeVersionInfo.isStableBuild();
|
||||
- if (!systemOrPreStable) {
|
||||
- // Only allow partner customization if this browser is a system package, or
|
||||
- // is in pre-stable channels.
|
||||
- return null;
|
||||
- }
|
||||
+ //boolean systemOrPreStable =
|
||||
+ // (context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) == 1
|
||||
+ // || !ChromeVersionInfo.isStableBuild();
|
||||
+ //if (!systemOrPreStable) {
|
||||
+ // // Only allow partner customization if this browser is a system package, or
|
||||
+ // // is in pre-stable channels.
|
||||
+ // return null;
|
||||
+ //}
|
||||
|
||||
if (isCancelled()) return null;
|
||||
Provider provider = AppHooks.get().getCustomizationProvider();
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Wed, 28 Dec 2022 07:19:58 +0000
|
||||
Subject: Always open browser controls in new tab
|
||||
|
||||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
---
|
||||
.../chrome/browser/tab/TabContextMenuItemDelegate.java | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextMenuItemDelegate.java
|
||||
@@ -21,6 +21,7 @@ import org.chromium.base.IntentUtils;
|
||||
import org.chromium.base.PackageManagerUtils;
|
||||
import org.chromium.base.metrics.RecordUserAction;
|
||||
import org.chromium.base.supplier.Supplier;
|
||||
+import org.chromium.cc.input.BrowserControlsState;
|
||||
import org.chromium.chrome.browser.DefaultBrowserInfo;
|
||||
import org.chromium.chrome.browser.IntentHandler;
|
||||
import org.chromium.chrome.browser.bookmarks.BookmarkManagerOpenerImpl;
|
||||
@@ -38,6 +39,7 @@ import org.chromium.chrome.browser.preferences.Pref;
|
||||
import org.chromium.chrome.browser.price_tracking.PriceDropNotificationManagerFactory;
|
||||
import org.chromium.chrome.browser.printing.TabPrinter;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
+import org.chromium.chrome.browser.tab.TabBrowserControlsConstraintsHelper;
|
||||
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
|
||||
import org.chromium.chrome.browser.tabmodel.document.ChromeAsyncTabLauncher;
|
||||
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
|
||||
@@ -290,6 +292,7 @@ public class TabContextMenuItemDelegate implements ContextMenuItemDelegate {
|
||||
Referrer referrer,
|
||||
boolean navigateToTab,
|
||||
@Nullable AdditionalNavigationParams additionalNavigationParams) {
|
||||
+ TabBrowserControlsConstraintsHelper.get(mTab).update(BrowserControlsState.SHOWN, true);
|
||||
RecordUserAction.record("MobileNewTabOpened");
|
||||
RecordUserAction.record("LinkOpenedInNewTab");
|
||||
LoadUrlParams loadUrlParams = new LoadUrlParams(url.getSpec());
|
||||
@@ -310,6 +313,7 @@ public class TabContextMenuItemDelegate implements ContextMenuItemDelegate {
|
||||
* @param url The URL to open.
|
||||
*/
|
||||
public void onOpenInNewTabInGroup(GURL url, Referrer referrer) {
|
||||
+ TabBrowserControlsConstraintsHelper.get(mTab).update(BrowserControlsState.SHOWN, true);
|
||||
RecordUserAction.record("MobileNewTabOpened");
|
||||
RecordUserAction.record("LinkOpenedInNewTab");
|
||||
LoadUrlParams loadUrlParams = new LoadUrlParams(url.getSpec());
|
||||
--
|
||||
@@ -0,0 +1,38 @@
|
||||
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
||||
Date: Tue, 5 Jun 2018 13:46:40 +0200
|
||||
Subject: Always respect async dns flag (regardless of SDK version)
|
||||
|
||||
Do not read experiment value for cronet async DNS configuration
|
||||
---
|
||||
chrome/browser/net/system_network_context_manager.cc | 2 +-
|
||||
components/cronet/url_request_context_config.cc | 3 ++-
|
||||
2 files changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc
|
||||
--- a/chrome/browser/net/system_network_context_manager.cc
|
||||
+++ b/chrome/browser/net/system_network_context_manager.cc
|
||||
@@ -157,7 +157,7 @@ network::mojom::HttpAuthDynamicParamsPtr CreateHttpAuthDynamicParams(
|
||||
local_state->GetBoolean(prefs::kNtlmV2Enabled);
|
||||
#endif // defined(OS_POSIX)
|
||||
|
||||
-#if defined(OS_ANDROID)
|
||||
+#if 0
|
||||
auth_dynamic_params->android_negotiate_account_type =
|
||||
local_state->GetString(prefs::kAuthAndroidNegotiateAccountType);
|
||||
#endif // defined(OS_ANDROID)
|
||||
diff --git a/components/cronet/url_request_context_config.cc b/components/cronet/url_request_context_config.cc
|
||||
--- a/components/cronet/url_request_context_config.cc
|
||||
+++ b/components/cronet/url_request_context_config.cc
|
||||
@@ -592,7 +592,8 @@ void URLRequestContextConfig::ParseAndSetExperimentalOptions(
|
||||
effective_experimental_options->RemoveKey(it.key());
|
||||
continue;
|
||||
}
|
||||
- async_dns_args->GetBoolean(kAsyncDnsEnable, &async_dns_enable);
|
||||
+ bool ignored;
|
||||
+ async_dns_args->GetBoolean(kAsyncDnsEnable, &ignored);
|
||||
} else if (it.key() == kStaleDnsFieldTrialName) {
|
||||
const base::DictionaryValue* stale_dns_args = nullptr;
|
||||
if (!it.value().GetAsDictionary(&stale_dns_args)) {
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -3,93 +3,23 @@ Date: Wed, 27 Jun 2018 11:02:38 +0200
|
||||
Subject: Always use new tab page for default home page
|
||||
|
||||
Ignore any partner-provided home page.
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../org/chromium/chrome/browser/homepage/HomepageManager.java | 4 ----
|
||||
.../chrome/browser/new_tab_url/DseNewTabUrlManager.java | 1 +
|
||||
.../partnerbookmarks/PartnerBookmarksProviderIterator.java | 1 +
|
||||
.../partnercustomizations/PartnerBrowserCustomizations.java | 2 +-
|
||||
.../org/chromium/components/search_engines/TemplateUrl.java | 1 +
|
||||
.../search_engines/android/template_url_service_android.cc | 1 +
|
||||
.../always-use-new-tab-page-for-default-home-page.inc | 1 +
|
||||
7 files changed, 6 insertions(+), 5 deletions(-)
|
||||
create mode 100755 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/always-use-new-tab-page-for-default-home-page.inc
|
||||
.../org/chromium/chrome/browser/homepage/HomepageManager.java | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java b/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
|
||||
@@ -148,10 +148,6 @@ public class HomepageManager
|
||||
* tab page if the homepage button is force enabled via flag.
|
||||
@@ -146,9 +146,6 @@ public class HomepageManager implements HomepagePolicyManager.HomepagePolicyStat
|
||||
* if the homepage button is force enabled via flag.
|
||||
*/
|
||||
public GURL getDefaultHomepageGurl() {
|
||||
public static String getDefaultHomepageUri() {
|
||||
- if (PartnerBrowserCustomizations.getInstance().isHomepageProviderAvailableAndEnabled()) {
|
||||
- return PartnerBrowserCustomizations.getInstance().getHomePageUrl();
|
||||
- }
|
||||
-
|
||||
String homepagePartnerDefaultGurlSerialized =
|
||||
ChromeSharedPreferences.getInstance()
|
||||
.readString(
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/new_tab_url/DseNewTabUrlManager.java b/chrome/android/java/src/org/chromium/chrome/browser/new_tab_url/DseNewTabUrlManager.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/new_tab_url/DseNewTabUrlManager.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/new_tab_url/DseNewTabUrlManager.java
|
||||
@@ -54,6 +54,7 @@ public class DseNewTabUrlManager {
|
||||
|
||||
/** Returns whether the feature NewTabSearchEngineUrlAndroid is enabled. */
|
||||
public static boolean isNewTabSearchEngineUrlAndroidEnabled() {
|
||||
+ if ((true)) return false;
|
||||
return ChromeSharedPreferences.getInstance()
|
||||
.readBoolean(ChromePreferenceKeys.IS_EEA_CHOICE_COUNTRY, false)
|
||||
|| (OmniboxFeatures.sOmniboxMobileParityUpdate.isEnabled()
|
||||
diff --git a/chrome/browser/partnerbookmarks/android/java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksProviderIterator.java b/chrome/browser/partnerbookmarks/android/java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksProviderIterator.java
|
||||
--- a/chrome/browser/partnerbookmarks/android/java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksProviderIterator.java
|
||||
+++ b/chrome/browser/partnerbookmarks/android/java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksProviderIterator.java
|
||||
@@ -70,6 +70,7 @@ public class PartnerBookmarksProviderIterator implements PartnerBookmark.Bookmar
|
||||
new AsyncTask<@Nullable Cursor>() {
|
||||
@Override
|
||||
protected @Nullable Cursor doInBackground() {
|
||||
+ if ((true)) return null;
|
||||
try {
|
||||
return ContextUtils.getApplicationContext()
|
||||
.getContentResolver()
|
||||
diff --git a/chrome/browser/partnercustomizations/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java b/chrome/browser/partnercustomizations/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
|
||||
--- a/chrome/browser/partnercustomizations/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
|
||||
+++ b/chrome/browser/partnercustomizations/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
|
||||
@@ -213,7 +213,7 @@ public class PartnerBrowserCustomizations {
|
||||
& ApplicationInfo.FLAG_SYSTEM)
|
||||
== 1
|
||||
|| !VersionInfo.isStableBuild();
|
||||
- if (!systemOrPreStable) {
|
||||
+ if ((true)) {
|
||||
// Only allow partner customization if this browser is a system
|
||||
// package, or is in pre-stable channels.
|
||||
return null;
|
||||
diff --git a/components/search_engines/android/java/src/org/chromium/components/search_engines/TemplateUrl.java b/components/search_engines/android/java/src/org/chromium/components/search_engines/TemplateUrl.java
|
||||
--- a/components/search_engines/android/java/src/org/chromium/components/search_engines/TemplateUrl.java
|
||||
+++ b/components/search_engines/android/java/src/org/chromium/components/search_engines/TemplateUrl.java
|
||||
@@ -85,6 +85,7 @@ public class TemplateUrl {
|
||||
* prepopulated_engines.json.
|
||||
*/
|
||||
public String getNewTabURL() {
|
||||
+ if ((true)) return null;
|
||||
return TemplateUrlJni.get().getNewTabURL(mTemplateUrlPtr);
|
||||
return UrlConstants.NTP_NON_NATIVE_URL;
|
||||
}
|
||||
|
||||
diff --git a/components/search_engines/android/template_url_service_android.cc b/components/search_engines/android/template_url_service_android.cc
|
||||
--- a/components/search_engines/android/template_url_service_android.cc
|
||||
+++ b/components/search_engines/android/template_url_service_android.cc
|
||||
@@ -403,6 +403,7 @@ jboolean TemplateUrlServiceAndroid::SetPlayAPISearchEngine(
|
||||
jimage_translate_source_language_param_key,
|
||||
const base::android::JavaParamRef<jstring>&
|
||||
jimage_translate_target_language_param_key) {
|
||||
+ if ((true)) return false;
|
||||
// The function is scheduled to run only when the service is loaded, see
|
||||
// `TemplateUrlService#runWhenLoaded()`.
|
||||
CHECK(template_url_service_->loaded());
|
||||
diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/always-use-new-tab-page-for-default-home-page.inc b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/always-use-new-tab-page-for-default-home-page.inc
|
||||
new file mode 100755
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/always-use-new-tab-page-for-default-home-page.inc
|
||||
@@ -0,0 +1 @@
|
||||
+SET_CROMITE_FEATURE_DISABLED(kPartnerCustomizationsUma);
|
||||
--
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
@@ -1,353 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Mon, 26 May 2025 12:17:48 +0000
|
||||
Subject: Android Import Passwords
|
||||
|
||||
Adds the possibility of importing a csv file containing the list of passwords,
|
||||
with the same functionality available on desktops.
|
||||
|
||||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
---
|
||||
...e_password_preferences_action_bar_menu.xml | 6 ++
|
||||
.../settings/PasswordSettings.java | 34 +++++++++
|
||||
.../settings/PasswordManagerHandler.java | 3 +
|
||||
.../settings/PasswordUiView.java | 8 +++
|
||||
.../android/password_ui_view_android.cc | 71 +++++++++++++++++++
|
||||
.../android/password_ui_view_android.h | 20 +++++-
|
||||
.../Import-Password-Android.grdp | 9 +++
|
||||
.../core/browser/import/password_importer.cc | 11 +++
|
||||
8 files changed, 161 insertions(+), 1 deletion(-)
|
||||
create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Import-Password-Android.grdp
|
||||
|
||||
diff --git a/chrome/android/java/res/menu/save_password_preferences_action_bar_menu.xml b/chrome/android/java/res/menu/save_password_preferences_action_bar_menu.xml
|
||||
--- a/chrome/android/java/res/menu/save_password_preferences_action_bar_menu.xml
|
||||
+++ b/chrome/android/java/res/menu/save_password_preferences_action_bar_menu.xml
|
||||
@@ -22,6 +22,12 @@ found in the LICENSE file.
|
||||
android:visibility="gone"
|
||||
app:showAsAction="ifRoom"/>
|
||||
|
||||
+ <item
|
||||
+ android:id="@+id/import_passwords"
|
||||
+ android:title="@string/password_settings_import_action_title"
|
||||
+ android:contentDescription="@string/password_settings_import_action_description"
|
||||
+ app:showAsAction="never"/>
|
||||
+
|
||||
<item
|
||||
android:id="@+id/export_passwords"
|
||||
android:title="@string/password_settings_export_action_title"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java
|
||||
@@ -57,6 +57,9 @@ import org.chromium.components.sync.PassphraseType;
|
||||
import org.chromium.components.sync.SyncService;
|
||||
import org.chromium.components.user_prefs.UserPrefs;
|
||||
import org.chromium.ui.text.SpanApplier;
|
||||
+import org.chromium.ui.base.ActivityWindowAndroid;
|
||||
+import org.chromium.ui.base.ActivityIntentRequestTrackerDelegate;
|
||||
+import org.chromium.ui.base.IntentRequestTracker;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
@@ -151,6 +154,8 @@ public class PasswordSettings extends ChromeBaseSettingsFragment
|
||||
|
||||
/** For controlling the UX flow of exporting passwords. */
|
||||
private final ExportFlow mExportFlow = new ExportFlow(PasswordAccessLossWarningType.NONE);
|
||||
+ private ActivityWindowAndroid mWindowAndroid;
|
||||
+ private IntentRequestTracker mIntentRequestTracker;
|
||||
|
||||
public ExportFlow getExportFlowForTesting() {
|
||||
return mExportFlow;
|
||||
@@ -199,6 +204,19 @@ public class PasswordSettings extends ChromeBaseSettingsFragment
|
||||
|
||||
mManagePasswordsReferrer = getReferrerFromInstanceStateOrLaunchBundle(savedInstanceState);
|
||||
|
||||
+ mIntentRequestTracker = IntentRequestTracker.createFromDelegate(
|
||||
+ new ActivityIntentRequestTrackerDelegate(getActivity()) {
|
||||
+ @Override
|
||||
+ public boolean startActivityForResult(@Nullable Intent intent, int requestCode) {
|
||||
+ PasswordSettings.this.startActivityForResult(intent, requestCode);
|
||||
+ return true;
|
||||
+ }
|
||||
+ });
|
||||
+ mWindowAndroid = new ActivityWindowAndroid(
|
||||
+ getActivity(), /* listenToActivityState */ true,
|
||||
+ mIntentRequestTracker, /*InsetObserver*/ null,
|
||||
+ /* trackOcclusion= */ true);
|
||||
+
|
||||
if (savedInstanceState == null) return;
|
||||
|
||||
if (savedInstanceState.containsKey(SAVED_STATE_SEARCH_QUERY)) {
|
||||
@@ -263,6 +281,12 @@ public class PasswordSettings extends ChromeBaseSettingsFragment
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
+ if (id == R.id.import_passwords) {
|
||||
+ PasswordManagerHandlerProvider.getForProfile(getProfile())
|
||||
+ .getPasswordManagerHandler()
|
||||
+ .startImporting(mWindowAndroid);
|
||||
+ return true;
|
||||
+ }
|
||||
if (id == R.id.export_passwords) {
|
||||
RecordHistogram.recordEnumeratedHistogram(
|
||||
mExportFlow.getExportEventHistogramName(),
|
||||
@@ -506,6 +530,7 @@ public class PasswordSettings extends ChromeBaseSettingsFragment
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
||||
super.onActivityResult(requestCode, resultCode, intent);
|
||||
+ mWindowAndroid.getIntentRequestTracker().onActivityResult(requestCode, resultCode, intent);
|
||||
if (requestCode != PASSWORD_EXPORT_INTENT_REQUEST_CODE) return;
|
||||
if (resultCode != Activity.RESULT_OK) return;
|
||||
if (intent == null || intent.getData() == null) return;
|
||||
@@ -517,12 +542,21 @@ public class PasswordSettings extends ChromeBaseSettingsFragment
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
mExportFlow.onSaveInstanceState(outState);
|
||||
+ mWindowAndroid.getIntentRequestTracker().saveInstanceState(outState);
|
||||
if (mSearchQuery != null) {
|
||||
outState.putString(SAVED_STATE_SEARCH_QUERY, mSearchQuery);
|
||||
}
|
||||
outState.putInt(PasswordManagerHelper.MANAGE_PASSWORDS_REFERRER, mManagePasswordsReferrer);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void onRequestPermissionsResult(
|
||||
+ int requestCode, String[] permissions, int[] grantResults) {
|
||||
+ if (mWindowAndroid.handlePermissionResult(requestCode, permissions, grantResults))
|
||||
+ return;
|
||||
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
diff --git a/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordManagerHandler.java b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordManagerHandler.java
|
||||
--- a/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordManagerHandler.java
|
||||
+++ b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordManagerHandler.java
|
||||
@@ -9,6 +9,7 @@ import android.content.Context;
|
||||
import org.chromium.base.Callback;
|
||||
import org.chromium.base.IntStringCallback;
|
||||
import org.chromium.build.annotations.NullMarked;
|
||||
+import org.chromium.ui.base.WindowAndroid;
|
||||
|
||||
/**
|
||||
* Interface for retrieving passwords and password exceptions (websites for which Chrome should not
|
||||
@@ -80,4 +81,6 @@ public interface PasswordManagerHandler {
|
||||
* @return Returns true if the request to fetch the passwords is still pending.
|
||||
*/
|
||||
boolean isWaitingForPasswordStore();
|
||||
+
|
||||
+ boolean startImporting(WindowAndroid window);
|
||||
}
|
||||
diff --git a/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordUiView.java b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordUiView.java
|
||||
--- a/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordUiView.java
|
||||
+++ b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordUiView.java
|
||||
@@ -12,6 +12,7 @@ import org.jni_zero.NativeMethods;
|
||||
|
||||
import org.chromium.base.Callback;
|
||||
import org.chromium.base.IntStringCallback;
|
||||
+import org.chromium.ui.base.WindowAndroid;
|
||||
import org.chromium.build.annotations.NullMarked;
|
||||
import org.chromium.chrome.browser.profiles.Profile;
|
||||
|
||||
@@ -158,6 +159,12 @@ public final class PasswordUiView implements PasswordManagerHandler {
|
||||
}
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public boolean startImporting(WindowAndroid window) {
|
||||
+ return PasswordUiViewJni.get()
|
||||
+ .startImporting(mNativePasswordUiViewAndroid, PasswordUiView.this, window);
|
||||
+ }
|
||||
+
|
||||
@NativeMethods
|
||||
interface Natives {
|
||||
long init(PasswordUiView caller, @JniType("Profile*") Profile profile);
|
||||
@@ -190,6 +197,7 @@ public final class PasswordUiView implements PasswordManagerHandler {
|
||||
String getTrustedVaultLearnMoreURL();
|
||||
|
||||
boolean isWaitingForPasswordStore(long nativePasswordUiViewAndroid, PasswordUiView caller);
|
||||
+ boolean startImporting(long nativePasswordUiViewAndroid, PasswordUiView caller, WindowAndroid window);
|
||||
|
||||
void destroy(long nativePasswordUiViewAndroid, PasswordUiView caller);
|
||||
|
||||
diff --git a/chrome/browser/password_manager/android/password_ui_view_android.cc b/chrome/browser/password_manager/android/password_ui_view_android.cc
|
||||
--- a/chrome/browser/password_manager/android/password_ui_view_android.cc
|
||||
+++ b/chrome/browser/password_manager/android/password_ui_view_android.cc
|
||||
@@ -41,6 +41,11 @@
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
+#include "chrome/browser/ui/chrome_select_file_policy.h"
|
||||
+#include "ui/shell_dialogs/selected_file_info.h"
|
||||
+#include "ui/shell_dialogs/select_file_dialog.h"
|
||||
+#include "ui/android/window_android.h"
|
||||
+
|
||||
// Must come after other includes, because FromJniType() uses Profile.
|
||||
#include "chrome/browser/password_manager/android/jni_headers/PasswordUiView_jni.h"
|
||||
|
||||
@@ -123,6 +128,8 @@ PasswordUiViewAndroid::PasswordUiViewAndroid(
|
||||
|
||||
PasswordUiViewAndroid::~PasswordUiViewAndroid() {
|
||||
saved_passwords_presenter_.RemoveObserver(this);
|
||||
+ if (select_file_dialog_)
|
||||
+ select_file_dialog_->ListenerDestroyed();
|
||||
}
|
||||
|
||||
void PasswordUiViewAndroid::Destroy(JNIEnv*, const JavaRef<jobject>&) {
|
||||
@@ -314,6 +321,70 @@ jboolean PasswordUiViewAndroid::IsWaitingForPasswordStore(
|
||||
return saved_passwords_presenter_.IsWaitingForPasswordStore();
|
||||
}
|
||||
|
||||
+void PasswordUiViewAndroid::ImportFinished(
|
||||
+ const password_manager::ImportResults& results) {
|
||||
+ std::string error;
|
||||
+ if (results.status == password_manager::ImportResults::Status::SUCCESS)
|
||||
+ error = "Success.";
|
||||
+ else if (results.status == password_manager::ImportResults::Status::IO_ERROR)
|
||||
+ error = "Failed to read provided file.";
|
||||
+ else if (results.status == password_manager::ImportResults::Status::BAD_FORMAT)
|
||||
+ error = "Header is missing, invalid or could not be read.";
|
||||
+ else if (results.status == password_manager::ImportResults::Status::NUM_PASSWORDS_EXCEEDED)
|
||||
+ error = "Too many passwords.";
|
||||
+ else
|
||||
+ error = "UNKNOWN ERROR.";
|
||||
+
|
||||
+ std::stringstream message;
|
||||
+ message << error << " Imported " << results.number_imported << " passwords.";
|
||||
+ auto result = message.str();
|
||||
+
|
||||
+ select_file_dialog_->ShowToast(result);
|
||||
+
|
||||
+ importer_.reset();
|
||||
+}
|
||||
+
|
||||
+jboolean PasswordUiViewAndroid::StartImporting(
|
||||
+ JNIEnv* env,
|
||||
+ const base::android::JavaRef<jobject>& obj,
|
||||
+ const JavaParamRef<jobject>& java_window) {
|
||||
+ ui::WindowAndroid* window =
|
||||
+ ui::WindowAndroid::FromJavaWindowAndroid(java_window);
|
||||
+ CHECK(window);
|
||||
+
|
||||
+ select_file_dialog_ = ui::SelectFileDialog::Create(
|
||||
+ this, std::make_unique<ChromeSelectFilePolicy>(nullptr));
|
||||
+
|
||||
+ ui::SelectFileDialog::FileTypeInfo file_type_info;
|
||||
+
|
||||
+ const std::vector<std::u16string> v_accept_types = { u"application/octet-stream" };
|
||||
+ select_file_dialog_->SetAcceptTypes(v_accept_types);
|
||||
+
|
||||
+ select_file_dialog_->SelectFile(
|
||||
+ ui::SelectFileDialog::SELECT_OPEN_FILE,
|
||||
+ std::u16string(),
|
||||
+ base::FilePath(),
|
||||
+ &file_type_info,
|
||||
+ 0,
|
||||
+ base::FilePath::StringType(),
|
||||
+ window);
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+void PasswordUiViewAndroid::FileSelectionCanceled() {}
|
||||
+
|
||||
+void PasswordUiViewAndroid::FileSelected(const ui::SelectedFileInfo& file, int index) {
|
||||
+ base::FilePath path = file.path();
|
||||
+
|
||||
+ importer_ =
|
||||
+ std::make_unique<password_manager::PasswordImporter>(&saved_passwords_presenter_);
|
||||
+ importer_->Import(path,
|
||||
+ password_manager::PasswordForm::Store::kProfileStore,
|
||||
+ base::BindOnce(&PasswordUiViewAndroid::ImportFinished,
|
||||
+ base::Unretained(this)));
|
||||
+}
|
||||
+
|
||||
// static
|
||||
static jlong JNI_PasswordUiView_Init(JNIEnv* env,
|
||||
const JavaParamRef<jobject>& obj,
|
||||
diff --git a/chrome/browser/password_manager/android/password_ui_view_android.h b/chrome/browser/password_manager/android/password_ui_view_android.h
|
||||
--- a/chrome/browser/password_manager/android/password_ui_view_android.h
|
||||
+++ b/chrome/browser/password_manager/android/password_ui_view_android.h
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "chrome/browser/signin/identity_manager_factory.h"
|
||||
#include "components/password_manager/core/browser/password_store/password_store_consumer.h"
|
||||
#include "components/password_manager/core/browser/ui/saved_passwords_presenter.h"
|
||||
+#include "components/password_manager/core/browser/import/password_importer.h"
|
||||
+#include "ui/shell_dialogs/select_file_dialog.h"
|
||||
|
||||
class Profile;
|
||||
|
||||
@@ -31,7 +33,8 @@ class CredentialProviderInterface;
|
||||
// PasswordUIView for Android, contains jni hooks that allows Android UI to
|
||||
// display passwords and route UI commands back to SavedPasswordsPresenter.
|
||||
class PasswordUiViewAndroid
|
||||
- : public password_manager::SavedPasswordsPresenter::Observer {
|
||||
+ : public password_manager::SavedPasswordsPresenter::Observer,
|
||||
+ public ui::SelectFileDialog::Listener {
|
||||
public:
|
||||
// Result of transforming a vector of PasswordForms into their CSV
|
||||
// description and writing that to disk.
|
||||
@@ -95,6 +98,18 @@ class PasswordUiViewAndroid
|
||||
const base::android::JavaParamRef<jobject>& obj);
|
||||
jboolean IsWaitingForPasswordStore(JNIEnv* env,
|
||||
const base::android::JavaRef<jobject>&);
|
||||
+
|
||||
+ void FileSelected(const ui::SelectedFileInfo& file,
|
||||
+ int index) override;
|
||||
+ void FileSelectionCanceled() override;
|
||||
+
|
||||
+ void ImportFinished(
|
||||
+ const password_manager::ImportResults& results);
|
||||
+
|
||||
+ jboolean StartImporting(JNIEnv* env,
|
||||
+ const base::android::JavaRef<jobject>& obj,
|
||||
+ const base::android::JavaParamRef<jobject>& java_window);
|
||||
+
|
||||
// Destroy the native implementation.
|
||||
void Destroy(JNIEnv*, const base::android::JavaRef<jobject>&);
|
||||
|
||||
@@ -162,6 +177,9 @@ class PasswordUiViewAndroid
|
||||
std::vector<password_manager::CredentialUIEntry> passwords_;
|
||||
std::vector<password_manager::CredentialUIEntry> blocked_sites_;
|
||||
|
||||
+ scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
|
||||
+ std::unique_ptr<password_manager::PasswordImporter> importer_;
|
||||
+
|
||||
// If not null, passwords for exporting will be obtained from
|
||||
// |*credential_provider_for_testing_|, otherwise from
|
||||
// |saved_passwords_presenter_|. This must remain null in production code.
|
||||
diff --git a/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Import-Password-Android.grdp b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Import-Password-Android.grdp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Import-Password-Android.grdp
|
||||
@@ -0,0 +1,9 @@
|
||||
+<?xml version="1.0" encoding="utf-8"?>
|
||||
+<grit-part>
|
||||
+ <message name="IDS_PASSWORD_SETTINGS_IMPORT_ACTION_TITLE" desc="The title of a menu item to trigger importing passwords from the password settings.">
|
||||
+ Import passwords…
|
||||
+ </message>
|
||||
+ <message name="IDS_PASSWORD_SETTINGS_IMPORT_ACTION_DESCRIPTION" desc="The description of a menu item to trigger importing passwords from the password settings.">
|
||||
+ Import passwords stored with Chrome
|
||||
+ </message>
|
||||
+</grit-part>
|
||||
diff --git a/components/password_manager/core/browser/import/password_importer.cc b/components/password_manager/core/browser/import/password_importer.cc
|
||||
--- a/components/password_manager/core/browser/import/password_importer.cc
|
||||
+++ b/components/password_manager/core/browser/import/password_importer.cc
|
||||
@@ -75,6 +75,17 @@ const int32_t kMaxFileSizeBytes = 150 * 1024;
|
||||
// optional string. The string will be present if the status is SUCCESS.
|
||||
base::expected<std::string, ImportResults::Status> ReadFileToString(
|
||||
const base::FilePath& path) {
|
||||
+#if BUILDFLAG(IS_ANDROID)
|
||||
+ if (path.IsContentUri()) {
|
||||
+ base::File file(path, base::File::FLAG_OPEN | base::File::FLAG_READ);
|
||||
+ auto fileLength = file.GetLength();
|
||||
+ std::vector<char> buffer(fileLength);
|
||||
+ file.ReadAtCurrentPos(base::as_writable_byte_span(buffer));
|
||||
+
|
||||
+ std::string file_contents(buffer.begin(), buffer.end());
|
||||
+ return std::move(file_contents);
|
||||
+ }
|
||||
+#endif
|
||||
std::optional<int64_t> file_size = base::GetFileSize(path);
|
||||
|
||||
if (file_size.has_value()) {
|
||||
--
|
||||
@@ -1,86 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Wed, 22 May 2024 07:41:34 +0000
|
||||
Subject: Android Toolbar Scroll Ablation setting
|
||||
|
||||
Adds a setting for blocking the toolbar hiding
|
||||
|
||||
need: Add-cromite-flags-support.patch
|
||||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
---
|
||||
...rowserStateBrowserControlsVisibilityDelegate.java | 4 +++-
|
||||
.../Toolbar-Scroll-Ablation-flag.grdp | 9 +++++++++
|
||||
.../java/res/xml/accessibility_preferences.xml | 6 ++++++
|
||||
.../about_flags_cc/Toolbar-Scroll-Ablation-flag.inc | 12 ++++++++++++
|
||||
4 files changed, 30 insertions(+), 1 deletion(-)
|
||||
create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Toolbar-Scroll-Ablation-flag.grdp
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Toolbar-Scroll-Ablation-flag.inc
|
||||
|
||||
diff --git a/chrome/browser/browser_controls/android/java/src/org/chromium/chrome/browser/browser_controls/BrowserStateBrowserControlsVisibilityDelegate.java b/chrome/browser/browser_controls/android/java/src/org/chromium/chrome/browser/browser_controls/BrowserStateBrowserControlsVisibilityDelegate.java
|
||||
--- a/chrome/browser/browser_controls/android/java/src/org/chromium/chrome/browser/browser_controls/BrowserStateBrowserControlsVisibilityDelegate.java
|
||||
+++ b/chrome/browser/browser_controls/android/java/src/org/chromium/chrome/browser/browser_controls/BrowserStateBrowserControlsVisibilityDelegate.java
|
||||
@@ -40,6 +40,7 @@ public class BrowserStateBrowserControlsVisibilityDelegate extends BrowserContro
|
||||
private final Supplier<Boolean> mPersistentFullscreenMode;
|
||||
|
||||
private long mCurrentShowingStartTime;
|
||||
+ private int temporaryToken;
|
||||
|
||||
/**
|
||||
* Constructs a BrowserControlsVisibilityDelegate designed to deal with overrides driven by
|
||||
@@ -65,7 +66,8 @@ public class BrowserStateBrowserControlsVisibilityDelegate extends BrowserContro
|
||||
long currentShowingTime = SystemClock.uptimeMillis() - mCurrentShowingStartTime;
|
||||
if (currentShowingTime >= MINIMUM_SHOW_DURATION_MS) return;
|
||||
|
||||
- final int temporaryToken = mTokenHolder.acquireToken();
|
||||
+ mTokenHolder.releaseToken(temporaryToken);
|
||||
+ temporaryToken = mTokenHolder.acquireToken();
|
||||
mHandler.postDelayed(
|
||||
() -> mTokenHolder.releaseToken(temporaryToken),
|
||||
MINIMUM_SHOW_DURATION_MS - currentShowingTime);
|
||||
diff --git a/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Toolbar-Scroll-Ablation-flag.grdp b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Toolbar-Scroll-Ablation-flag.grdp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Toolbar-Scroll-Ablation-flag.grdp
|
||||
@@ -0,0 +1,9 @@
|
||||
+<?xml version="1.0" encoding="utf-8"?>
|
||||
+<grit-part>
|
||||
+ <message name="IDS_LOCK_TOOLBAR_TITLE" desc="Text for 'Always show toolbar' settings option.">
|
||||
+ Always show toolbar
|
||||
+ </message>
|
||||
+ <message name="IDS_LOCK_TOOLBAR_SUMMARY" desc="Summary text for 'Always show toolbar' settings option.">
|
||||
+ Blocks the toolbar's hiding
|
||||
+ </message>
|
||||
+</grit-part>
|
||||
diff --git a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml
|
||||
--- a/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml
|
||||
+++ b/components/browser_ui/accessibility/android/java/res/xml/accessibility_preferences.xml
|
||||
@@ -79,6 +79,12 @@ found in the LICENSE file.
|
||||
android:key="disable_toolbar_swipeup"
|
||||
android:title="@string/disable_toolbar_swipe_up" />
|
||||
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
+ android:title="@string/lock_toolbar_title"
|
||||
+ android:summary="@string/lock_toolbar_summary"
|
||||
+ app:featureName="android-toolbar-scroll-ablation"
|
||||
+ app:needRestart="true" />
|
||||
+
|
||||
<PreferenceCategory
|
||||
android:key="customize_selecton_popup_section"
|
||||
android:title="@string/customize_selecton_popup_title" />
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Toolbar-Scroll-Ablation-flag.inc b/cromite_flags/chrome/browser/about_flags_cc/Toolbar-Scroll-Ablation-flag.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/Toolbar-Scroll-Ablation-flag.inc
|
||||
@@ -0,0 +1,12 @@
|
||||
+#if BUILDFLAG(IS_ANDROID)
|
||||
+
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
+ {"android-toolbar-scroll-ablation",
|
||||
+ "Android Toolbar Scroll Ablation",
|
||||
+ "Always shows the toolbar", kOsAndroid,
|
||||
+ FEATURE_VALUE_TYPE(chrome::android::kAndroidToolbarScrollAblation)},
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+#endif
|
||||
--
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,804 +0,0 @@
|
||||
From: uazo <uazo@users.noreply.github.com>
|
||||
Date: Tue, 18 Jun 2024 15:31:12 +0000
|
||||
Subject: Ask to restart on connection change
|
||||
|
||||
Experimental use of the OfflineDetector to identify network change, disabled by default.
|
||||
If it is active, when the network change is detected by the android API,
|
||||
the user is warned and asked to restart the browser.
|
||||
Technically, blink's freeze mode is exploited, which allows javascript
|
||||
execution and network calls to be blocked.
|
||||
A preventive shutdown of all service workers is carried out, to inhibit the sending
|
||||
of messages over the new ip, since the service workers have access
|
||||
to the background fetch api.
|
||||
The freeze and resume event of javascript is deliberately left, since the
|
||||
page could deduct it in any case. In any case during the execution of
|
||||
the javascript events, the page can only access the FetchLater api,
|
||||
which is disabled by another patch.
|
||||
The patch also changes the standard behaviour of the browser, allowing visible pages to freeze.
|
||||
This could lead to the failure of some DCHECKS related to the handling of UI messages at unfreeze,
|
||||
but since the goal is a reboot, this should not be the case.
|
||||
|
||||
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
|
||||
---
|
||||
.../java/res/xml/homepage_preferences.xml | 6 +
|
||||
.../ConnectivityDetector.java | 1 -
|
||||
.../indicator/OfflineDetector.java | 111 +++++++++++++++++-
|
||||
.../OfflineIndicatorControllerV2.java | 15 ++-
|
||||
.../tabbed_mode/TabbedRootUiCoordinator.java | 5 +-
|
||||
.../tabmodel/TabModelSelectorBase.java | 7 ++
|
||||
.../sAskForRestartOnConnectionChange.java | 32 +++++
|
||||
.../browser/tabmodel/TabModelSelector.java | 2 +
|
||||
.../browser/tabmodel/TabModelUtils.java | 18 +++
|
||||
.../browser/tabwindow/TabWindowManager.java | 2 +
|
||||
.../tabwindow/TabWindowManagerImpl.java | 10 ++
|
||||
.../Ask-for-restart-on-connection-change.grdp | 15 +++
|
||||
.../java/res/layout/floating_snackbar.xml | 10 ++
|
||||
.../android/java/res/layout/snackbar.xml | 10 ++
|
||||
.../ui/messages/snackbar/Snackbar.java | 16 +++
|
||||
.../ui/messages/snackbar/SnackbarManager.java | 6 +
|
||||
.../ui/messages/snackbar/SnackbarView.java | 13 +-
|
||||
.../web_contents/web_contents_android.cc | 16 +++
|
||||
.../web_contents/web_contents_android.h | 1 +
|
||||
.../browser/web_contents/web_contents_impl.cc | 2 +
|
||||
.../browser/webcontents/WebContentsImpl.java | 8 ++
|
||||
.../content_public/browser/WebContents.java | 2 +
|
||||
.../browser/test/mock/MockWebContents.java | 3 +
|
||||
.../Ask-for-restart-on-connection-change.inc | 13 ++
|
||||
.../Ask-for-restart-on-connection-change.inc | 3 +
|
||||
.../Ask-for-restart-on-connection-change.inc | 1 +
|
||||
.../blink/renderer/core/dom/document.cc | 1 +
|
||||
.../blink/renderer/core/frame/local_frame.cc | 2 +
|
||||
.../main_thread/frame_scheduler_impl.cc | 2 +
|
||||
.../main_thread/page_scheduler_impl.cc | 9 +-
|
||||
30 files changed, 332 insertions(+), 10 deletions(-)
|
||||
create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sAskForRestartOnConnectionChange.java
|
||||
create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Ask-for-restart-on-connection-change.grdp
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Ask-for-restart-on-connection-change.inc
|
||||
create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Ask-for-restart-on-connection-change.inc
|
||||
create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/Ask-for-restart-on-connection-change.inc
|
||||
|
||||
diff --git a/chrome/android/java/res/xml/homepage_preferences.xml b/chrome/android/java/res/xml/homepage_preferences.xml
|
||||
--- a/chrome/android/java/res/xml/homepage_preferences.xml
|
||||
+++ b/chrome/android/java/res/xml/homepage_preferences.xml
|
||||
@@ -25,6 +25,12 @@ found in the LICENSE file.
|
||||
app:featureName="enable-show-ntp-at-startup"
|
||||
app:needRestart="true" />
|
||||
|
||||
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
|
||||
+ android:title="@string/ask_to_restart_on_connection_change_title"
|
||||
+ android:summary="@string/ask_to_restart_on_connection_change_summary"
|
||||
+ app:featureName="ask-for-restart-on-connection-change"
|
||||
+ app:needRestart="true" />
|
||||
+
|
||||
<org.chromium.chrome.browser.homepage.settings.RadioButtonGroupHomepagePreference
|
||||
android:key="homepage_radio_group"
|
||||
android:selectable="false"
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/net/connectivitydetector/ConnectivityDetector.java b/chrome/android/java/src/org/chromium/chrome/browser/net/connectivitydetector/ConnectivityDetector.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/net/connectivitydetector/ConnectivityDetector.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/net/connectivitydetector/ConnectivityDetector.java
|
||||
@@ -468,7 +468,6 @@ public class ConnectivityDetector implements NetworkChangeNotifier.ConnectionTyp
|
||||
@VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
|
||||
public void setConnectionState(@ConnectionState int connectionState) {
|
||||
Log.i(TAG, "setConnectionState connectionState=" + connectionState);
|
||||
- if (mConnectionState == connectionState) return;
|
||||
mConnectionState = connectionState;
|
||||
if (mObserver != null) mObserver.onConnectionStateChanged(mConnectionState);
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/indicator/OfflineDetector.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/indicator/OfflineDetector.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/indicator/OfflineDetector.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/indicator/OfflineDetector.java
|
||||
@@ -21,16 +21,38 @@ import org.chromium.base.version_info.VersionInfo;
|
||||
import org.chromium.chrome.browser.flags.ChromeFeatureList;
|
||||
import org.chromium.chrome.browser.net.connectivitydetector.ConnectivityDetector;
|
||||
import org.chromium.chrome.browser.net.connectivitydetector.ConnectivityDetector.ConnectionState;
|
||||
-import org.chromium.chrome.browser.net.connectivitydetector.ConnectivityDetector;
|
||||
-import org.chromium.chrome.browser.net.connectivitydetector.ConnectivityDetector.ConnectionState;
|
||||
import org.chromium.components.variations.VariationsAssociatedData;
|
||||
|
||||
+import android.app.Activity;
|
||||
+import org.chromium.base.supplier.ObservableSupplier;
|
||||
+import org.chromium.url.GURL;
|
||||
+import org.chromium.chrome.R;
|
||||
+import org.chromium.chrome.browser.app.tabwindow.TabWindowManagerSingleton;
|
||||
+import org.chromium.chrome.browser.layouts.LayoutManager;
|
||||
+import org.chromium.chrome.browser.compositor.layouts.Layout;
|
||||
+import org.chromium.chrome.browser.compositor.layouts.LayoutManagerImpl;
|
||||
+import org.chromium.chrome.browser.compositor.layouts.SceneChangeObserver;
|
||||
+import org.chromium.chrome.browser.flags.cromite.sAskForRestartOnConnectionChange;
|
||||
+import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
|
||||
+import org.chromium.chrome.browser.ui.messages.snackbar.INeedSnackbarManager;
|
||||
+import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar;
|
||||
+import org.chromium.chrome.browser.hub.HubLayout;
|
||||
+import org.chromium.chrome.browser.tab.Tab;
|
||||
+import org.chromium.chrome.browser.tabmodel.TabModelUtils;
|
||||
+import org.chromium.chrome.browser.tabmodel.TabModelSelector;
|
||||
+import org.chromium.chrome.browser.tabwindow.TabWindowManager;
|
||||
+import org.chromium.chrome.browser.lifetime.ApplicationLifetime;
|
||||
+import org.chromium.content_public.browser.WebContentsObserver;
|
||||
+import org.chromium.content_public.browser.WebContents;
|
||||
+import org.chromium.net.NetworkChangeNotifier;
|
||||
+
|
||||
/**
|
||||
* Class that detects if the network is offline. Waits for the network to stablize before notifying
|
||||
* the observer.
|
||||
*/
|
||||
class OfflineDetector
|
||||
- implements ConnectivityDetector.Observer, ApplicationStatus.ApplicationStateListener {
|
||||
+ implements ConnectivityDetector.Observer, ApplicationStatus.ApplicationStateListener,
|
||||
+ SnackbarManager.SnackbarController, SceneChangeObserver {
|
||||
// If the connection is online, then we report that immediately via |mIsOfflineCallback|.
|
||||
// |STATUS_INDICATOR_WAIT_ON_OFFLINE_DURATION_MS| and
|
||||
// |mStatusIndicatorWaitOnSwitchOnlineToOfflineDurationMs| control the duration before
|
||||
@@ -116,6 +138,11 @@ class OfflineDetector
|
||||
|
||||
private static final String TAG = "OfflineDetector";
|
||||
|
||||
+ private long mLastNetworkId = 0;
|
||||
+ private ObservableSupplier<TabModelSelector> mTabModelSelectorSupplier;
|
||||
+ private ObservableSupplier<LayoutManager> mLayoutManager;
|
||||
+ private Supplier<SnackbarManager> mSnackbarManagerSupplier;
|
||||
+
|
||||
/**
|
||||
* Constructs the offline indicator.
|
||||
* @param isOfflineCallback The {@link Callback} is invoked when the connectivity status is
|
||||
@@ -127,7 +154,13 @@ class OfflineDetector
|
||||
OfflineDetector(
|
||||
Callback<Boolean> isOfflineCallback,
|
||||
Callback<Boolean> isForegroundCallback,
|
||||
- Context context) {
|
||||
+ Context context,
|
||||
+ ObservableSupplier<TabModelSelector> tabModelSelectorSupplier,
|
||||
+ ObservableSupplier<LayoutManager> layoutManager,
|
||||
+ Supplier<SnackbarManager> snackbarManagerSupplier) {
|
||||
+ mTabModelSelectorSupplier = tabModelSelectorSupplier;
|
||||
+ mSnackbarManagerSupplier = snackbarManagerSupplier;
|
||||
+ mLayoutManager = layoutManager;
|
||||
mIsOfflineCallback = isOfflineCallback;
|
||||
mIsForegroundCallback = isForegroundCallback;
|
||||
mContext = context;
|
||||
@@ -231,6 +264,75 @@ class OfflineDetector
|
||||
updateState();
|
||||
}
|
||||
|
||||
+ private void checkLastNetworkId() {
|
||||
+ if (!sAskForRestartOnConnectionChange.getInstance().isEnabled())
|
||||
+ return;
|
||||
+
|
||||
+ long currentNetworkId = NetworkChangeNotifier.getInstance().getCurrentDefaultNetId();
|
||||
+ Log.i(TAG, "onConnectionTypeChanged: currentNetworkId=" + currentNetworkId);
|
||||
+
|
||||
+ if (currentNetworkId != -1 && mLastNetworkId != 0
|
||||
+ && mLastNetworkId != currentNetworkId) {
|
||||
+ // close snackbar with scene change
|
||||
+ LayoutManagerImpl layoutManager = (LayoutManagerImpl)mLayoutManager.get();
|
||||
+ if (layoutManager != null) layoutManager.addSceneChangeObserver(this);
|
||||
+
|
||||
+ // close snackbar with reload
|
||||
+ Tab currentTab = TabModelUtils.getCurrentTab(mTabModelSelectorSupplier.get().getCurrentModel());
|
||||
+ if (currentTab != null) {
|
||||
+ WebContents webContents = currentTab.getWebContents();
|
||||
+ SnackbarManager.SnackbarController controller = this;
|
||||
+ if (webContents != null) {
|
||||
+ new WebContentsObserver(webContents) {
|
||||
+ @Override
|
||||
+ public void didStartLoading(GURL url) {
|
||||
+ observe(null);
|
||||
+ SnackbarManager snackbarManager = mSnackbarManagerSupplier.get();
|
||||
+ snackbarManager.dismissSnackbars(controller);
|
||||
+ }
|
||||
+ };
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // freeze all pages
|
||||
+ TabWindowManagerSingleton.getInstance().setPagesFrozen(true);
|
||||
+
|
||||
+ // show snackbar
|
||||
+ Snackbar snackbar = Snackbar.make(
|
||||
+ mContext.getString(R.string.ask_to_restart_on_connection_change_restart),
|
||||
+ /* snackbarController */ this, Snackbar.TYPE_PERSISTENT, Snackbar.UMA_UNKNOWN)
|
||||
+ .setSingleLine(false)
|
||||
+ .setAction(mContext.getString(R.string.relaunch), /*actionData*/0)
|
||||
+ .setDismissAction(mContext.getString(R.string.ask_to_restart_on_connection_change_close_notification), /*actionData*/1);
|
||||
+ SnackbarManager snackbarManager = mSnackbarManagerSupplier.get();
|
||||
+ if (!snackbarManager.isShowing())
|
||||
+ snackbarManager.showSnackbar(snackbar);
|
||||
+ }
|
||||
+ mLastNetworkId = currentNetworkId;
|
||||
+ }
|
||||
+
|
||||
+ // SnackbarManager.SnackbarController
|
||||
+ @Override
|
||||
+ public void onDismissNoAction(Object actionData) {
|
||||
+ ((LayoutManagerImpl)mLayoutManager.get()).removeSceneChangeObserver(this);
|
||||
+ TabWindowManagerSingleton.getInstance().setPagesFrozen(false);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void onAction(Object actionData) {
|
||||
+ if ((int)actionData == 0)
|
||||
+ ApplicationLifetime.terminate(true);
|
||||
+ }
|
||||
+
|
||||
+ // TabWindowManager.Observer
|
||||
+ @Override
|
||||
+ public void onSceneChange(Layout layout) {
|
||||
+ if (!(layout instanceof HubLayout)) {
|
||||
+ SnackbarManager snackbarManager = mSnackbarManagerSupplier.get();
|
||||
+ snackbarManager.dismissSnackbars(this);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
private void logToAdbConsoleNow(String prefix) {
|
||||
Log.i(
|
||||
TAG,
|
||||
@@ -316,6 +418,7 @@ class OfflineDetector
|
||||
** Calls |mUpdateOfflineStatusIndicatorDelayedRunnable| to update the connection state.
|
||||
*/
|
||||
private void updateState() {
|
||||
+ checkLastNetworkId();
|
||||
mHandler.removeCallbacks(mUpdateOfflineStatusIndicatorDelayedRunnable);
|
||||
|
||||
// Do not update state while the app is in background.
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/indicator/OfflineIndicatorControllerV2.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/indicator/OfflineIndicatorControllerV2.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/indicator/OfflineIndicatorControllerV2.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/indicator/OfflineIndicatorControllerV2.java
|
||||
@@ -28,6 +28,11 @@ import org.chromium.content_public.common.ContentSwitches;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
+import org.chromium.base.supplier.ObservableSupplierImpl;
|
||||
+import org.chromium.chrome.browser.layouts.LayoutManager;
|
||||
+import org.chromium.chrome.browser.tabmodel.TabModelSelector;
|
||||
+import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
|
||||
+
|
||||
/**
|
||||
* Class that controls visibility and content of {@link StatusIndicatorCoordinator} to relay
|
||||
* connectivity information.
|
||||
@@ -101,7 +106,10 @@ public class OfflineIndicatorControllerV2 {
|
||||
Context context,
|
||||
StatusIndicatorCoordinator statusIndicator,
|
||||
ObservableSupplier<Boolean> isUrlBarFocusedSupplier,
|
||||
- Supplier<Boolean> canAnimateNativeBrowserControls) {
|
||||
+ Supplier<Boolean> canAnimateNativeBrowserControls,
|
||||
+ ObservableSupplier<TabModelSelector> tabModelSelectorSupplier,
|
||||
+ ObservableSupplierImpl<LayoutManager> layoutManager,
|
||||
+ Supplier<SnackbarManager> snackbarManagerSupplier) {
|
||||
if (CommandLine.getInstance()
|
||||
.hasSwitch(ContentSwitches.FORCE_ONLINE_CONNECTION_STATE_FOR_INDICATOR)) {
|
||||
// If "force online connection state" switch is set, the offline indicator should never
|
||||
@@ -129,7 +137,10 @@ public class OfflineIndicatorControllerV2 {
|
||||
new OfflineDetector(
|
||||
(Boolean offline) -> onConnectionStateChanged(offline),
|
||||
(Boolean isForeground) -> onApplicationStateChanged(isForeground),
|
||||
- mContext);
|
||||
+ mContext,
|
||||
+ tabModelSelectorSupplier,
|
||||
+ layoutManager,
|
||||
+ snackbarManagerSupplier);
|
||||
}
|
||||
|
||||
// Initializes the application state.
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
|
||||
@@ -1373,7 +1373,10 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator {
|
||||
mActivity,
|
||||
mStatusIndicatorCoordinator,
|
||||
isUrlBarFocusedSupplier,
|
||||
- mCanAnimateBrowserControls);
|
||||
+ mCanAnimateBrowserControls,
|
||||
+ mTabModelSelectorSupplier,
|
||||
+ mLayoutManagerSupplier,
|
||||
+ mSnackbarManagerSupplier);
|
||||
if (mToolbarManager.getOmniboxStub() != null) {
|
||||
mToolbarManager.getOmniboxStub().addUrlFocusChangeListener(mUrlFocusChangeListener);
|
||||
}
|
||||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorBase.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorBase.java
|
||||
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorBase.java
|
||||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelectorBase.java
|
||||
@@ -195,6 +195,13 @@ public abstract class TabModelSelectorBase
|
||||
return null;
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void setPagesFrozen(boolean frozen) {
|
||||
+ for (int i = 0; i < getModels().size(); i++) {
|
||||
+ TabModelUtils.setPagesFrozen(mTabModels.get(i), frozen);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public @NonNull TabModel getCurrentModel() {
|
||||
if (mTabModelInternals.size() == 0) return EmptyTabModel.getInstance(false);
|
||||
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sAskForRestartOnConnectionChange.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sAskForRestartOnConnectionChange.java
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sAskForRestartOnConnectionChange.java
|
||||
@@ -0,0 +1,32 @@
|
||||
+/*
|
||||
+ This file is part of Cromite.
|
||||
+
|
||||
+ Cromite 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.
|
||||
+
|
||||
+ Cromite 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 Cromite. If not, see <https://www.gnu.org/licenses/>.
|
||||
+*/
|
||||
+
|
||||
+package org.chromium.chrome.browser.flags.cromite;
|
||||
+
|
||||
+import org.chromium.components.cached_flags.CachedFlag;
|
||||
+import org.chromium.chrome.browser.flags.ChromeFeatureMap;
|
||||
+
|
||||
+public class sAskForRestartOnConnectionChange {
|
||||
+ private static final CachedFlag sInstance =
|
||||
+ new CachedFlag(ChromeFeatureMap.getInstance(), "AskForRestartOnConnectionChange", false);
|
||||
+
|
||||
+ private sAskForRestartOnConnectionChange() {}
|
||||
+
|
||||
+ public static CachedFlag getInstance() {
|
||||
+ return sInstance;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelector.java b/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelector.java
|
||||
--- a/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelector.java
|
||||
+++ b/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelSelector.java
|
||||
@@ -146,6 +146,8 @@ public interface TabModelSelector {
|
||||
/** Get total tab count across all tab models */
|
||||
int getTotalTabCount();
|
||||
|
||||
+ void setPagesFrozen(boolean frozen);
|
||||
+
|
||||
/**
|
||||
* Search all TabModels for a tab with the specified id.
|
||||
*
|
||||
diff --git a/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelUtils.java b/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelUtils.java
|
||||
--- a/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelUtils.java
|
||||
+++ b/chrome/browser/tabmodel/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelUtils.java
|
||||
@@ -16,12 +16,16 @@ import org.chromium.build.annotations.Nullable;
|
||||
import org.chromium.chrome.browser.tab.Tab;
|
||||
import org.chromium.chrome.browser.tab.TabSelectionType;
|
||||
import org.chromium.content_public.browser.WebContents;
|
||||
+import org.chromium.content_public.browser.Visibility;
|
||||
import org.chromium.ui.base.WindowAndroid;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
+import java.util.Collections;
|
||||
+import java.util.stream.IntStream;
|
||||
+import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* A set of convenience methods used for interacting with {@link TabList}s and {@link TabModel}s.
|
||||
@@ -55,6 +59,20 @@ public class TabModelUtils {
|
||||
return TabModel.INVALID_TAB_INDEX;
|
||||
}
|
||||
|
||||
+ public static void setPagesFrozen(TabList model, boolean frozen) {
|
||||
+ List<Integer> loop = IntStream.range(0, model.getCount())
|
||||
+ .boxed()
|
||||
+ .collect(Collectors.toList());
|
||||
+ Collections.shuffle(loop);
|
||||
+ loop.forEach(tabId -> {
|
||||
+ Tab tab = model.getTabAt(tabId);
|
||||
+ WebContents webContents = tab.getWebContents();
|
||||
+ if (webContents != null) {
|
||||
+ webContents.setPageFrozen(frozen);
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Find the {@link Tab} index whose URL matches the specified URL.
|
||||
*
|
||||
diff --git a/chrome/browser/tabwindow/android/java/src/org/chromium/chrome/browser/tabwindow/TabWindowManager.java b/chrome/browser/tabwindow/android/java/src/org/chromium/chrome/browser/tabwindow/TabWindowManager.java
|
||||
--- a/chrome/browser/tabwindow/android/java/src/org/chromium/chrome/browser/tabwindow/TabWindowManager.java
|
||||
+++ b/chrome/browser/tabwindow/android/java/src/org/chromium/chrome/browser/tabwindow/TabWindowManager.java
|
||||
@@ -138,6 +138,8 @@ public interface TabWindowManager {
|
||||
/** Returns the total number of incognito tabs across all tab model selectors. */
|
||||
int getIncognitoTabCount();
|
||||
|
||||
+ void setPagesFrozen(boolean frozen);
|
||||
+
|
||||
/**
|
||||
* @param tab The tab to look for in each model.
|
||||
* @return The TabModel containing the given Tab or null if one doesn't exist.
|
||||
diff --git a/chrome/browser/tabwindow/internal/android/java/src/org/chromium/chrome/browser/tabwindow/TabWindowManagerImpl.java b/chrome/browser/tabwindow/internal/android/java/src/org/chromium/chrome/browser/tabwindow/TabWindowManagerImpl.java
|
||||
--- a/chrome/browser/tabwindow/internal/android/java/src/org/chromium/chrome/browser/tabwindow/TabWindowManagerImpl.java
|
||||
+++ b/chrome/browser/tabwindow/internal/android/java/src/org/chromium/chrome/browser/tabwindow/TabWindowManagerImpl.java
|
||||
@@ -555,6 +555,16 @@ public class TabWindowManagerImpl implements TabWindowManager {
|
||||
return tabGroupModelFilter.getTabsInGroup(tabGroupId);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void setPagesFrozen(boolean frozen) {
|
||||
+ for (int i : mWindowIdToSelectors.keySet()) {
|
||||
+ TabModelSelector selector = mWindowIdToSelectors.get(i);
|
||||
+ if (selector != null) {
|
||||
+ selector.setPagesFrozen(frozen);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public @Nullable TabModelSelector getTabModelSelectorById(@WindowId int windowId) {
|
||||
return mWindowIdToSelectors.get(windowId);
|
||||
diff --git a/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Ask-for-restart-on-connection-change.grdp b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Ask-for-restart-on-connection-change.grdp
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Ask-for-restart-on-connection-change.grdp
|
||||
@@ -0,0 +1,15 @@
|
||||
+<?xml version="1.0" encoding="utf-8"?>
|
||||
+<grit-part>
|
||||
+ <message name="IDS_ASK_TO_RESTART_ON_CONNECTION_CHANGE_TITLE" desc="Text for 'Ask to restart on connection change' settings option.">
|
||||
+ Ask to restart on connection change
|
||||
+ </message>
|
||||
+ <message name="IDS_ASK_TO_RESTART_ON_CONNECTION_CHANGE_SUMMARY" desc="Summary text for 'Ask to restart on connection change' settings option.">
|
||||
+ If the IP of the connection changes, access to the network is blocked and a browser restart is requested
|
||||
+ </message>
|
||||
+ <message name="IDS_ASK_TO_RESTART_ON_CONNECTION_CHANGE_RESTART" desc="">
|
||||
+ Connection to internet has changed, execution is paused. Restart Cromite?
|
||||
+ </message>
|
||||
+ <message name="IDS_ASK_TO_RESTART_ON_CONNECTION_CHANGE_CLOSE_NOTIFICATION" desc="">
|
||||
+ Not now
|
||||
+ </message>
|
||||
+</grit-part>
|
||||
diff --git a/chrome/browser/ui/messages/android/java/res/layout/floating_snackbar.xml b/chrome/browser/ui/messages/android/java/res/layout/floating_snackbar.xml
|
||||
--- a/chrome/browser/ui/messages/android/java/res/layout/floating_snackbar.xml
|
||||
+++ b/chrome/browser/ui/messages/android/java/res/layout/floating_snackbar.xml
|
||||
@@ -50,5 +50,15 @@ found in the LICENSE file.
|
||||
android:paddingEnd="@dimen/snackbar_button_padding"
|
||||
android:paddingStart="@dimen/snackbar_button_padding"
|
||||
style="@style/TextButton" />
|
||||
+
|
||||
+ <org.chromium.ui.widget.ButtonCompat
|
||||
+ android:id="@+id/snackbar_dismiss"
|
||||
+ android:layout_width="wrap_content"
|
||||
+ android:layout_height="wrap_content"
|
||||
+ android:layout_gravity="center_vertical"
|
||||
+ android:paddingEnd="24dp"
|
||||
+ android:paddingStart="24dp"
|
||||
+ android:visibility="gone"
|
||||
+ style="@style/TextButton" />
|
||||
</LinearLayout>
|
||||
|
||||
diff --git a/chrome/browser/ui/messages/android/java/res/layout/snackbar.xml b/chrome/browser/ui/messages/android/java/res/layout/snackbar.xml
|
||||
--- a/chrome/browser/ui/messages/android/java/res/layout/snackbar.xml
|
||||
+++ b/chrome/browser/ui/messages/android/java/res/layout/snackbar.xml
|
||||
@@ -82,5 +82,15 @@ found in the LICENSE file.
|
||||
android:paddingEnd="@dimen/snackbar_button_padding"
|
||||
android:paddingStart="@dimen/snackbar_button_padding"
|
||||
style="@style/TextButton" />
|
||||
+
|
||||
+ <org.chromium.ui.widget.ButtonCompat
|
||||
+ android:id="@+id/snackbar_dismiss"
|
||||
+ android:layout_width="wrap_content"
|
||||
+ android:layout_height="wrap_content"
|
||||
+ android:layout_gravity="center_vertical"
|
||||
+ android:paddingEnd="24dp"
|
||||
+ android:paddingStart="24dp"
|
||||
+ android:visibility="gone"
|
||||
+ style="@style/TextButton" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
diff --git a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/Snackbar.java b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/Snackbar.java
|
||||
--- a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/Snackbar.java
|
||||
+++ b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/Snackbar.java
|
||||
@@ -136,6 +136,8 @@ public class Snackbar {
|
||||
private @Nullable String mTemplateText;
|
||||
private @Nullable String mActionText;
|
||||
private @Nullable Object mActionData;
|
||||
+ private String mDismissActionText;
|
||||
+ private Object mDismissActionData;
|
||||
private int mBackgroundColor;
|
||||
private int mTextApperanceResId;
|
||||
private boolean mSingleLine = true;
|
||||
@@ -241,6 +243,20 @@ public class Snackbar {
|
||||
return this;
|
||||
}
|
||||
|
||||
+ public Snackbar setDismissAction(String actionText, Object actionData) {
|
||||
+ mDismissActionText = actionText;
|
||||
+ mDismissActionData = actionData;
|
||||
+ return this;
|
||||
+ }
|
||||
+
|
||||
+ public String getDismissActionText() {
|
||||
+ return mDismissActionText;
|
||||
+ }
|
||||
+
|
||||
+ Object getDismissActionData() {
|
||||
+ return mDismissActionData;
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* Sets the text appearance for the snackbar. If 0, the snackbar will use default text
|
||||
* appearance.
|
||||
diff --git a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarManager.java b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarManager.java
|
||||
--- a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarManager.java
|
||||
+++ b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarManager.java
|
||||
@@ -326,6 +326,12 @@ public class SnackbarManager
|
||||
new SnackbarView(
|
||||
mActivity,
|
||||
this,
|
||||
+ new View.OnClickListener() {
|
||||
+ @Override
|
||||
+ public void onClick(View v) {
|
||||
+ dismissSnackbars(currentSnackbar.getController());
|
||||
+ }
|
||||
+ },
|
||||
currentSnackbar,
|
||||
mOriginalParentView,
|
||||
mWindowAndroid,
|
||||
diff --git a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarView.java b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarView.java
|
||||
--- a/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarView.java
|
||||
+++ b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarView.java
|
||||
@@ -55,6 +55,7 @@ public class SnackbarView implements InsetObserver.WindowInsetObserver {
|
||||
protected final ViewGroup mSnackbarView;
|
||||
protected final TemplatePreservingTextView mMessageView;
|
||||
private final TextView mActionButtonView;
|
||||
+ private final TextView mDismissButtonView;
|
||||
private final ImageView mProfileImageView;
|
||||
private final int mAnimationDuration;
|
||||
private final boolean mIsTablet;
|
||||
@@ -101,11 +102,12 @@ public class SnackbarView implements InsetObserver.WindowInsetObserver {
|
||||
public SnackbarView(
|
||||
Activity activity,
|
||||
OnClickListener listener,
|
||||
+ OnClickListener dismissListener,
|
||||
Snackbar snackbar,
|
||||
ViewGroup parentView,
|
||||
@Nullable WindowAndroid windowAndroid,
|
||||
boolean isTablet) {
|
||||
- this(activity, listener, snackbar, parentView, windowAndroid, null, isTablet);
|
||||
+ this(activity, listener, dismissListener, snackbar, parentView, windowAndroid, null, isTablet);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,6 +126,7 @@ public class SnackbarView implements InsetObserver.WindowInsetObserver {
|
||||
public SnackbarView(
|
||||
Activity activity,
|
||||
OnClickListener listener,
|
||||
+ OnClickListener dismissListener,
|
||||
Snackbar snackbar,
|
||||
ViewGroup parentView,
|
||||
@Nullable WindowAndroid windowAndroid,
|
||||
@@ -154,6 +157,8 @@ public class SnackbarView implements InsetObserver.WindowInsetObserver {
|
||||
(TemplatePreservingTextView) mContainerView.findViewById(R.id.snackbar_message);
|
||||
mActionButtonView = (TextView) mContainerView.findViewById(R.id.snackbar_button);
|
||||
mActionButtonView.setOnClickListener(listener);
|
||||
+ mDismissButtonView = (TextView) mContainerView.findViewById(R.id.snackbar_dismiss);
|
||||
+ mDismissButtonView.setOnClickListener(dismissListener);
|
||||
mProfileImageView = (ImageView) mContainerView.findViewById(R.id.snackbar_profile_image);
|
||||
mEdgeToEdgeSupplier = edgeToEdgeSupplier;
|
||||
if (SnackbarManager.isFloatingSnackbarEnabled()) {
|
||||
@@ -428,6 +433,12 @@ public class SnackbarView implements InsetObserver.WindowInsetObserver {
|
||||
mActionButtonView.setVisibility(View.VISIBLE);
|
||||
mActionButtonView.setContentDescription(snackbar.getActionText());
|
||||
setViewText(mActionButtonView, snackbar.getActionText(), animate);
|
||||
+ String dismissActionText = snackbar.getDismissActionText();
|
||||
+ if (dismissActionText != null) {
|
||||
+ mDismissButtonView.setVisibility(View.VISIBLE);
|
||||
+ mDismissButtonView.setContentDescription(dismissActionText);
|
||||
+ setViewText(mDismissButtonView, dismissActionText, animate);
|
||||
+ }
|
||||
// Set the end margin on the message view to 0 when there is action text.
|
||||
if (mMessageView.getLayoutParams() instanceof LayoutParams) {
|
||||
LayoutParams lp = (LayoutParams) mMessageView.getLayoutParams();
|
||||
diff --git a/content/browser/web_contents/web_contents_android.cc b/content/browser/web_contents/web_contents_android.cc
|
||||
--- a/content/browser/web_contents/web_contents_android.cc
|
||||
+++ b/content/browser/web_contents/web_contents_android.cc
|
||||
@@ -899,6 +899,22 @@ void WebContentsAndroid::SetFocus(JNIEnv* env, jboolean focused) {
|
||||
view->SetFocus(focused);
|
||||
}
|
||||
|
||||
+void WebContentsAndroid::SetPageFrozen(JNIEnv* env, jboolean frozen) {
|
||||
+ // shutdown service workers
|
||||
+ BrowserContext* browser_context =
|
||||
+ web_contents_->GetBrowserContext();
|
||||
+ browser_context->ForEachLoadedStoragePartition(
|
||||
+ [](StoragePartition* partition) {
|
||||
+ scoped_refptr<ServiceWorkerContextWrapper> context =
|
||||
+ static_cast<ServiceWorkerContextWrapper*>(
|
||||
+ partition->GetServiceWorkerContext());
|
||||
+ context->Shutdown();
|
||||
+ });
|
||||
+
|
||||
+ SuspendAllMediaPlayers(env);
|
||||
+ web_contents_->SetPageFrozen(frozen);
|
||||
+}
|
||||
+
|
||||
bool WebContentsAndroid::IsBeingDestroyed(JNIEnv* env) {
|
||||
return web_contents_->IsBeingDestroyed();
|
||||
}
|
||||
diff --git a/content/browser/web_contents/web_contents_android.h b/content/browser/web_contents/web_contents_android.h
|
||||
--- a/content/browser/web_contents/web_contents_android.h
|
||||
+++ b/content/browser/web_contents/web_contents_android.h
|
||||
@@ -194,6 +194,7 @@ class CONTENT_EXPORT WebContentsAndroid {
|
||||
|
||||
void OnScaleFactorChanged(JNIEnv* env);
|
||||
void SetFocus(JNIEnv* env, jboolean focused);
|
||||
+ void SetPageFrozen(JNIEnv* env, jboolean frozen);
|
||||
bool IsBeingDestroyed(JNIEnv* env);
|
||||
|
||||
void SetDisplayCutoutSafeArea(JNIEnv* env,
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3991,8 +3991,10 @@ void WebContentsImpl::Stop() {
|
||||
void WebContentsImpl::SetPageFrozen(bool frozen) {
|
||||
TRACE_EVENT1("content", "WebContentsImpl::SetPageFrozen", "frozen", frozen);
|
||||
|
||||
+#if !BUILDFLAG(IS_ANDROID)
|
||||
// A visible page is never frozen.
|
||||
DCHECK_NE(Visibility::VISIBLE, GetVisibility());
|
||||
+#endif
|
||||
|
||||
primary_frame_tree_.ForEachRenderViewHost(
|
||||
[&frozen](RenderViewHostImpl* rvh) { rvh->SetIsFrozen(frozen); });
|
||||
diff --git a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
|
||||
--- a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
|
||||
+++ b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
|
||||
@@ -1130,6 +1130,12 @@ public class WebContentsImpl
|
||||
WebContentsImplJni.get().setFocus(mNativeWebContentsAndroid, hasFocus);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public void setPageFrozen(boolean frozen) {
|
||||
+ if (mNativeWebContentsAndroid == 0) return;
|
||||
+ WebContentsImplJni.get().setPageFrozen(mNativeWebContentsAndroid, frozen);
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public void setDisplayCutoutSafeArea(Rect insets) {
|
||||
if (mNativeWebContentsAndroid == 0) return;
|
||||
@@ -1450,6 +1456,8 @@ public class WebContentsImpl
|
||||
|
||||
void setFocus(long nativeWebContentsAndroid, boolean focused);
|
||||
|
||||
+ void setPageFrozen(long nativeWebContentsAndroid, boolean frozen);
|
||||
+
|
||||
void setDisplayCutoutSafeArea(
|
||||
long nativeWebContentsAndroid, int top, int left, int bottom, int right);
|
||||
|
||||
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java b/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java
|
||||
--- a/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java
|
||||
+++ b/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java
|
||||
@@ -283,6 +283,8 @@ public interface WebContents extends Parcelable {
|
||||
*/
|
||||
void setFocus(boolean hasFocus);
|
||||
|
||||
+ void setPageFrozen(boolean frozen);
|
||||
+
|
||||
/**
|
||||
* @return true if the renderer is in fullscreen mode.
|
||||
*/
|
||||
diff --git a/content/public/test/android/javatests/src/org/chromium/content_public/browser/test/mock/MockWebContents.java b/content/public/test/android/javatests/src/org/chromium/content_public/browser/test/mock/MockWebContents.java
|
||||
--- a/content/public/test/android/javatests/src/org/chromium/content_public/browser/test/mock/MockWebContents.java
|
||||
+++ b/content/public/test/android/javatests/src/org/chromium/content_public/browser/test/mock/MockWebContents.java
|
||||
@@ -188,6 +188,9 @@ public class MockWebContents implements WebContents, WebContentsObserver.Observa
|
||||
@Override
|
||||
public void setFocus(boolean hasFocus) {}
|
||||
|
||||
+ @Override
|
||||
+ public void setPageFrozen(boolean frozen) {}
|
||||
+
|
||||
@Override
|
||||
public boolean isFullscreenForCurrentTab() {
|
||||
return false;
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Ask-for-restart-on-connection-change.inc b/cromite_flags/chrome/browser/about_flags_cc/Ask-for-restart-on-connection-change.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/Ask-for-restart-on-connection-change.inc
|
||||
@@ -0,0 +1,13 @@
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
+#if BUILDFLAG(IS_ANDROID)
|
||||
+
|
||||
+ {"ask-for-restart-on-connection-change",
|
||||
+ "Restart on connection change",
|
||||
+ "Asks the user whether to restart the browser when the connection changes.",
|
||||
+ kOsAndroid,
|
||||
+ FEATURE_VALUE_TYPE(chrome::android::kAskForRestartOnConnectionChange)},
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
+#endif
|
||||
diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Ask-for-restart-on-connection-change.inc b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Ask-for-restart-on-connection-change.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Ask-for-restart-on-connection-change.inc
|
||||
@@ -0,0 +1,3 @@
|
||||
+CROMITE_FEATURE(kAskForRestartOnConnectionChange,
|
||||
+ "AskForRestartOnConnectionChange",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/Ask-for-restart-on-connection-change.inc b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/Ask-for-restart-on-connection-change.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/Ask-for-restart-on-connection-change.inc
|
||||
@@ -0,0 +1 @@
|
||||
+BASE_DECLARE_FEATURE(kAskForRestartOnConnectionChange);
|
||||
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
|
||||
--- a/third_party/blink/renderer/core/dom/document.cc
|
||||
+++ b/third_party/blink/renderer/core/dom/document.cc
|
||||
@@ -4387,6 +4387,7 @@ void Document::DispatchUnloadEvents(UnloadEventTimingInfo* unload_timing_info) {
|
||||
}
|
||||
|
||||
void Document::DispatchFreezeEvent() {
|
||||
+ DLOG(INFO) << "---Document::DispatchFreezeEvent";
|
||||
SetFreezingInProgress(true);
|
||||
DispatchEvent(*Event::Create(event_type_names::kFreeze));
|
||||
SetFreezingInProgress(false);
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -3178,6 +3178,7 @@ void LocalFrame::DidFreeze() {
|
||||
LoaderFreezeMode freeze_mode = GetLoaderFreezeMode();
|
||||
GetDocument()->Fetcher()->SetDefersLoading(freeze_mode);
|
||||
Loader().SetDefersLoading(freeze_mode);
|
||||
+ DLOG(INFO) << "---LocalFrame::DidFreeze end " << (int)freeze_mode;
|
||||
}
|
||||
|
||||
void LocalFrame::DidResume() {
|
||||
@@ -3192,6 +3193,7 @@ void LocalFrame::DidResume() {
|
||||
GetDocument()->Fetcher()->SetDefersLoading(LoaderFreezeMode::kNone);
|
||||
Loader().SetDefersLoading(LoaderFreezeMode::kNone);
|
||||
|
||||
+ DLOG(INFO) << "---LocalFrame::DidResume";
|
||||
GetDocument()->DispatchEvent(*Event::Create(event_type_names::kResume));
|
||||
// TODO(fmeawad): Move the following logic to the page once we have a
|
||||
// PageResourceCoordinator in Blink
|
||||
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl.cc b/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl.cc
|
||||
--- a/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl.cc
|
||||
+++ b/third_party/blink/renderer/platform/scheduler/main_thread/frame_scheduler_impl.cc
|
||||
@@ -998,7 +998,9 @@ SchedulingLifecycleState FrameSchedulerImpl::CalculateLifecycleState(
|
||||
if (!parent_page_scheduler_)
|
||||
return SchedulingLifecycleState::kNotThrottled;
|
||||
if (parent_page_scheduler_->IsFrozen()) {
|
||||
+#if !BUILDFLAG(IS_ANDROID)
|
||||
DCHECK(!parent_page_scheduler_->IsPageVisible());
|
||||
+#endif
|
||||
return SchedulingLifecycleState::kStopped;
|
||||
}
|
||||
if (subresource_loading_paused_ && type == ObserverType::kLoader)
|
||||
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.cc b/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.cc
|
||||
--- a/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.cc
|
||||
+++ b/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl.cc
|
||||
@@ -238,10 +238,12 @@ void PageSchedulerImpl::SetPageFrozen(bool frozen) {
|
||||
// it is desirable to reject the page freeze to prevent the scheduler from
|
||||
// being put in a bad state. See https://crbug.com/873214 for context of how
|
||||
// this can happen on the browser side.
|
||||
+#if !BUILDFLAG(IS_ANDROID)
|
||||
if (frozen && IsPageVisible()) {
|
||||
DCHECK(false);
|
||||
return;
|
||||
}
|
||||
+#endif
|
||||
PolicyUpdater policy_updater;
|
||||
SetPageFrozenImpl(frozen, policy_updater);
|
||||
}
|
||||
@@ -801,7 +803,12 @@ bool PageSchedulerImpl::IsBackgrounded() const {
|
||||
// expire immediately when a page is backgrounded, which is undesirable in
|
||||
// headless mode. To prevent that, a page is never considerer backgrounded
|
||||
// when virtual time is enabled.
|
||||
- return !IsPageVisible() && !IsAudioPlaying() &&
|
||||
+#if BUILDFLAG(IS_ANDROID)
|
||||
+ bool page_visible = true;
|
||||
+#else
|
||||
+ bool page_visible = IsPageVisible();
|
||||
+#endif
|
||||
+ return !page_visible && !IsAudioPlaying() &&
|
||||
!main_thread_scheduler_->IsVirtualTimeEnabled();
|
||||
}
|
||||
|
||||
--
|
||||
@@ -3,101 +3,51 @@ Date: Sun, 25 Mar 2018 21:49:37 +0200
|
||||
Subject: AudioBuffer, AnalyserNode: fp mitigations
|
||||
|
||||
Truncate base latency precision to two digits
|
||||
|
||||
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
||||
---
|
||||
.../AudioBuffer-AnalyserNode-fp-mitigations.inc | 8 ++++++++
|
||||
.../AudioBuffer-AnalyserNode-fp-mitigations.inc | 3 +++
|
||||
.../AudioBuffer-AnalyserNode-fp-mitigations.inc | 1 +
|
||||
.../renderer/modules/webaudio/audio_buffer.cc | 14 ++++++++++++++
|
||||
.../blink/renderer/modules/webaudio/audio_buffer.h | 2 ++
|
||||
.../renderer/modules/webaudio/audio_context.cc | 5 ++++-
|
||||
.../modules/webaudio/base_audio_context.cc | 12 ++++++++++++
|
||||
.../renderer/modules/webaudio/base_audio_context.h | 2 ++
|
||||
.../modules/webaudio/offline_audio_context.cc | 1 +
|
||||
.../renderer/modules/webaudio/realtime_analyser.cc | 7 +++++++
|
||||
.../platform/runtime_enabled_features.json5 | 5 ++---
|
||||
11 files changed, 56 insertions(+), 4 deletions(-)
|
||||
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/AudioBuffer-AnalyserNode-fp-mitigations.inc
|
||||
create mode 100644 cromite_flags/third_party/blink/common/features_cc/AudioBuffer-AnalyserNode-fp-mitigations.inc
|
||||
create mode 100644 cromite_flags/third_party/blink/common/features_h/AudioBuffer-AnalyserNode-fp-mitigations.inc
|
||||
.../blink/renderer/modules/webaudio/analyser_node.idl | 8 ++++----
|
||||
.../blink/renderer/modules/webaudio/audio_buffer.idl | 6 ------
|
||||
.../blink/renderer/modules/webaudio/audio_context.cc | 4 +++-
|
||||
3 files changed, 7 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/cromite_flags/chrome/browser/about_flags_cc/AudioBuffer-AnalyserNode-fp-mitigations.inc b/cromite_flags/chrome/browser/about_flags_cc/AudioBuffer-AnalyserNode-fp-mitigations.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/chrome/browser/about_flags_cc/AudioBuffer-AnalyserNode-fp-mitigations.inc
|
||||
@@ -0,0 +1,8 @@
|
||||
+#ifdef FLAG_SECTION
|
||||
+
|
||||
+ {"fingerprinting-audio-context-data-noise",
|
||||
+ "Enable Audio Context fingerprint deception",
|
||||
+ "Scale the output values of rendered data with a randomly selected factor.", kOsAll,
|
||||
+ FEATURE_VALUE_TYPE(blink::features::kAudioContextShuffleEnabled)},
|
||||
+
|
||||
+#endif
|
||||
diff --git a/cromite_flags/third_party/blink/common/features_cc/AudioBuffer-AnalyserNode-fp-mitigations.inc b/cromite_flags/third_party/blink/common/features_cc/AudioBuffer-AnalyserNode-fp-mitigations.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/third_party/blink/common/features_cc/AudioBuffer-AnalyserNode-fp-mitigations.inc
|
||||
@@ -0,0 +1,3 @@
|
||||
+CROMITE_FEATURE(kAudioContextShuffleEnabled,
|
||||
+ "AudioContextShuffleEnabled",
|
||||
+ base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
diff --git a/cromite_flags/third_party/blink/common/features_h/AudioBuffer-AnalyserNode-fp-mitigations.inc b/cromite_flags/third_party/blink/common/features_h/AudioBuffer-AnalyserNode-fp-mitigations.inc
|
||||
new file mode 100644
|
||||
--- /dev/null
|
||||
+++ b/cromite_flags/third_party/blink/common/features_h/AudioBuffer-AnalyserNode-fp-mitigations.inc
|
||||
@@ -0,0 +1 @@
|
||||
+BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAudioContextShuffleEnabled);
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/audio_buffer.cc b/third_party/blink/renderer/modules/webaudio/audio_buffer.cc
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_buffer.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.cc
|
||||
@@ -199,6 +199,20 @@ AudioBuffer::AudioBuffer(AudioBus* bus)
|
||||
}
|
||||
}
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/analyser_node.idl b/third_party/blink/renderer/modules/webaudio/analyser_node.idl
|
||||
--- a/third_party/blink/renderer/modules/webaudio/analyser_node.idl
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/analyser_node.idl
|
||||
@@ -40,10 +40,10 @@
|
||||
|
||||
+void AudioBuffer::ShuffleAudioData() {
|
||||
+ for (unsigned i = 0; i < channels_.size(); ++i) {
|
||||
+ if (NotShared<DOMFloat32Array> array = getChannelData(i)) {
|
||||
+ size_t len = array->length();
|
||||
+ if (len > 0) {
|
||||
+ base::span<float> destination = array->AsSpan();
|
||||
+ for (unsigned j = 0; j < len; ++j) {
|
||||
+ destination[j] = BaseAudioContext::ShuffleAudioData(destination[j], j);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
NotShared<DOMFloat32Array> AudioBuffer::getChannelData(
|
||||
unsigned channel_index,
|
||||
ExceptionState& exception_state) {
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/audio_buffer.h b/third_party/blink/renderer/modules/webaudio/audio_buffer.h
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_buffer.h
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.h
|
||||
@@ -116,6 +116,8 @@ class MODULES_EXPORT AudioBuffer final : public ScriptWrappable {
|
||||
// Copies the current frequency data into the passed array.
|
||||
// If the array has fewer elements than the frequencyBinCount, the excess elements will be dropped.
|
||||
- [HighEntropy, Measure] void getFloatFrequencyData(Float32Array array);
|
||||
- [HighEntropy, Measure] void getByteFrequencyData(Uint8Array array);
|
||||
+ //[HighEntropy, Measure] void getFloatFrequencyData(Float32Array array);
|
||||
+ //[HighEntropy, Measure] void getByteFrequencyData(Uint8Array array);
|
||||
|
||||
std::unique_ptr<SharedAudioBuffer> CreateSharedAudioBuffer();
|
||||
// Real-time waveform data
|
||||
- [HighEntropy, Measure] void getFloatTimeDomainData(Float32Array array);
|
||||
- [HighEntropy, Measure] void getByteTimeDomainData(Uint8Array array);
|
||||
+ //[HighEntropy, Measure] void getFloatTimeDomainData(Float32Array array);
|
||||
+ //[HighEntropy, Measure] void getByteTimeDomainData(Uint8Array array);
|
||||
};
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
|
||||
@@ -37,12 +37,6 @@
|
||||
|
||||
+ void ShuffleAudioData();
|
||||
+
|
||||
private:
|
||||
static DOMFloat32Array* CreateFloat32ArrayOrNull(
|
||||
uint32_t length,
|
||||
// Channel access
|
||||
readonly attribute unsigned long numberOfChannels;
|
||||
- [HighEntropy=Direct, Measure, RaisesException] Float32Array getChannelData(
|
||||
- unsigned long channelIndex);
|
||||
- [HighEntropy, Measure, RaisesException] void copyFromChannel(
|
||||
- Float32Array destination,
|
||||
- unsigned long channelNumber,
|
||||
- optional unsigned long bufferOffset = 0);
|
||||
[RaisesException] void copyToChannel(
|
||||
Float32Array source,
|
||||
unsigned long channelNumber,
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/audio_context.cc b/third_party/blink/renderer/modules/webaudio/audio_context.cc
|
||||
--- a/third_party/blink/renderer/modules/webaudio/audio_context.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/audio_context.cc
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/common/mediastream/media_devices.h"
|
||||
#include "third_party/blink/public/platform/browser_interface_broker_proxy.h"
|
||||
+#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/platform/modules/webrtc/webrtc_logging.h"
|
||||
#include "third_party/blink/public/platform/web_audio_latency_hint.h"
|
||||
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
|
||||
@@ -660,7 +661,9 @@ double AudioContext::baseLatency() const {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(main_thread_sequence_checker_);
|
||||
@@ -458,7 +458,9 @@ double AudioContext::baseLatency() const {
|
||||
DCHECK(IsMainThread());
|
||||
DCHECK(destination());
|
||||
|
||||
- return base_latency_;
|
||||
@@ -106,117 +56,7 @@ diff --git a/third_party/blink/renderer/modules/webaudio/audio_context.cc b/thir
|
||||
+ return double(l)/100;
|
||||
}
|
||||
|
||||
double AudioContext::outputLatency() const {
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/base_audio_context.cc b/third_party/blink/renderer/modules/webaudio/base_audio_context.cc
|
||||
--- a/third_party/blink/renderer/modules/webaudio/base_audio_context.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/base_audio_context.cc
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "base/metrics/histogram_functions.h"
|
||||
#include "build/build_config.h"
|
||||
+#include "third_party/blink/public/common/features.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"
|
||||
@@ -715,6 +716,17 @@ LocalDOMWindow* BaseAudioContext::GetWindow() const {
|
||||
return To<LocalDOMWindow>(GetExecutionContext());
|
||||
}
|
||||
|
||||
+/*static*/
|
||||
+float BaseAudioContext::ShuffleAudioData(float data, unsigned index) {
|
||||
+ if (base::FeatureList::IsEnabled(features::kAudioContextShuffleEnabled)) {
|
||||
+ float rnd = 1.0f +
|
||||
+ (base::RandDouble() / 10000.0) *
|
||||
+ (base::RandInt(0,10) > 5 ? 1.f : -1.f);
|
||||
+ return data * rnd;
|
||||
+ }
|
||||
+ return data;
|
||||
+}
|
||||
+
|
||||
void BaseAudioContext::NotifySourceNodeStartedProcessing(AudioNode* node) {
|
||||
DCHECK(IsMainThread());
|
||||
DeferredTaskHandler::GraphAutoLocker locker(this);
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/base_audio_context.h b/third_party/blink/renderer/modules/webaudio/base_audio_context.h
|
||||
--- a/third_party/blink/renderer/modules/webaudio/base_audio_context.h
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/base_audio_context.h
|
||||
@@ -327,6 +327,8 @@ class MODULES_EXPORT BaseAudioContext
|
||||
// if the execution context does not exist.
|
||||
bool CheckExecutionContextAndThrowIfNecessary(ExceptionState&);
|
||||
|
||||
+ static float ShuffleAudioData(float data, unsigned index);
|
||||
+
|
||||
protected:
|
||||
enum class ContextType { kRealtimeContext, kOfflineContext };
|
||||
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/offline_audio_context.cc b/third_party/blink/renderer/modules/webaudio/offline_audio_context.cc
|
||||
--- a/third_party/blink/renderer/modules/webaudio/offline_audio_context.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/offline_audio_context.cc
|
||||
@@ -372,6 +372,7 @@ void OfflineAudioContext::FireCompletionEvent() {
|
||||
if (!rendered_buffer) {
|
||||
return;
|
||||
}
|
||||
+ rendered_buffer->ShuffleAudioData();
|
||||
|
||||
// Call the offline rendering completion event listener and resolve the
|
||||
// promise too.
|
||||
diff --git a/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc b/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc
|
||||
--- a/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc
|
||||
+++ b/third_party/blink/renderer/modules/webaudio/realtime_analyser.cc
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <bit>
|
||||
#include <complex>
|
||||
|
||||
+#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"
|
||||
@@ -160,6 +161,7 @@ void RealtimeAnalyser::GetFloatTimeDomainData(
|
||||
input_buffer[(i + write_index - fft_size + kInputBufferSize) %
|
||||
kInputBufferSize];
|
||||
|
||||
+ value = BaseAudioContext::ShuffleAudioData(value, i);
|
||||
destination[i] = value;
|
||||
}
|
||||
}
|
||||
@@ -187,6 +189,8 @@ void RealtimeAnalyser::GetByteTimeDomainData(DOMUint8Array* destination_array) {
|
||||
input_buffer[(i + write_index - fft_size + kInputBufferSize) %
|
||||
kInputBufferSize];
|
||||
|
||||
+ value = BaseAudioContext::ShuffleAudioData(value, i);
|
||||
+
|
||||
// Scale from nominal -1 -> +1 to unsigned byte.
|
||||
double scaled_value = 128 * (value + 1);
|
||||
|
||||
@@ -306,6 +310,8 @@ void RealtimeAnalyser::ConvertToByteData(DOMUint8Array* destination_array) {
|
||||
double scaled_value =
|
||||
UCHAR_MAX * (db_mag - min_decibels) * range_scale_factor;
|
||||
|
||||
+ scaled_value = BaseAudioContext::ShuffleAudioData(scaled_value, i);
|
||||
+
|
||||
// Clip to valid range.
|
||||
destination[i] =
|
||||
static_cast<unsigned char>(ClampTo(scaled_value, 0, UCHAR_MAX));
|
||||
@@ -325,6 +331,7 @@ void RealtimeAnalyser::ConvertFloatToDb(DOMFloat32Array* destination_array) {
|
||||
float linear_value = source[i];
|
||||
double db_mag = audio_utilities::LinearToDecibels(linear_value);
|
||||
destination[i] = static_cast<float>(db_mag);
|
||||
+ destination[i] = BaseAudioContext::ShuffleAudioData(destination[i], i);
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
@@ -562,9 +562,8 @@
|
||||
{
|
||||
// AudioContext.playoutStats interface.
|
||||
// https://chromestatus.com/feature/5172818344148992
|
||||
- name: "AudioContextPlayoutStats",
|
||||
- origin_trial_feature_name: "AudioContextPlayoutStats",
|
||||
- status: "experimental",
|
||||
+ name: "AudioContextPlayoutStats", // keep AudioContextPlayoutStats
|
||||
+ status: "experimental", // experimental
|
||||
},
|
||||
{
|
||||
name: "AudioContextSetSinkId",
|
||||
--
|
||||
MediaElementAudioSourceNode* AudioContext::createMediaElementSource(
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user