mirror of
https://github.com/imputnet/helium.git
synced 2026-08-20 00:57:32 +02:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2450f37f62 |
@@ -11,8 +11,6 @@ permissions:
|
||||
jobs:
|
||||
notify:
|
||||
runs-on: ubuntu-latest
|
||||
# skip if the PR is from a fork
|
||||
if: github.event.pull_request.head.repo.full_name == github.repository
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PR: ${{ github.event.pull_request.number }}
|
||||
|
||||
@@ -1 +1 @@
|
||||
150.0.7871.181
|
||||
150.0.7871.46
|
||||
|
||||
@@ -7,18 +7,18 @@ sha256 = 00a87050fa3f941d04d67fb5763991e0b8ea399a88b505ab0e56dd263f06864c
|
||||
output_path = ./third_party/search_engines_data/resources_internal
|
||||
|
||||
[onboarding]
|
||||
version = 202607132006
|
||||
version = 202606171625
|
||||
url = https://github.com/imputnet/helium-onboarding/releases/download/%(version)s/helium-onboarding-%(version)s.tar.gz
|
||||
download_filename = onboarding-page-%(version)s.tar.gz
|
||||
sha256 = 668b5d3a95a5f991e6673803004ad753500f8a016dbacfed60dc91c7cad0b242
|
||||
sha256 = 1cd79da9daf391524f130b5a3a2e93d87eb7bf882ff6341ab14da1a2f7e6ebe5
|
||||
output_path = ./components/helium_onboarding
|
||||
|
||||
# If you are bumping this, you *NEED* to re-strip the assets.json
|
||||
# file *every time* by using `devutils/clear-ublock-assets.js`.
|
||||
[ublock_origin]
|
||||
version = 1.72.2
|
||||
version = 1.71.0
|
||||
url = https://github.com/imputnet/uBlock/releases/download/%(version)s/uBlock0_%(version)s.chromium.zip
|
||||
sha256 = 6ea10a863eb343ddcc317fdda9c65ccb2799c74d0de06ad75aded04d38d63dca
|
||||
sha256 = 3797501b9083c431d876f138d8a594a13d931925c46f75877612d2d548a4698e
|
||||
download_filename = ublock-origin-%(version)s.zip
|
||||
output_path = third_party/ublock
|
||||
strip_leading_dirs = uBlock0.chromium
|
||||
|
||||
@@ -16,11 +16,11 @@ the process has finished.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import multiprocessing
|
||||
import os
|
||||
import sys
|
||||
|
||||
from itertools import repeat
|
||||
from multiprocessing import Pool
|
||||
from pathlib import Path, PurePosixPath
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'utils'))
|
||||
@@ -338,7 +338,7 @@ def compute_lists(source_tree, search_regex, processes): # pylint: disable=too-m
|
||||
unused_patterns = UnusedPatterns()
|
||||
|
||||
# Launch multiple processes iterating over the source tree
|
||||
with multiprocessing.Pool(processes) as procpool:
|
||||
with Pool(processes) as procpool:
|
||||
returned_data = procpool.starmap(
|
||||
compute_lists_proc,
|
||||
zip(source_tree.rglob('*'), repeat(source_tree), repeat(search_regex)))
|
||||
@@ -427,6 +427,4 @@ def main(args_list=None):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if os.name == 'posix':
|
||||
multiprocessing.set_start_method('fork')
|
||||
main()
|
||||
|
||||
@@ -1038,7 +1038,6 @@ chrome/browser/extensions/api/braille_display_private/braille_display_private_ap
|
||||
chrome/browser/extensions/api/content_settings/content_settings_apitest.cc
|
||||
chrome/browser/extensions/api/context_menus/extension_context_menu_browsertest.cc
|
||||
chrome/browser/extensions/api/contextual_tasks_private/contextual_tasks_messaging_browsertest.cc
|
||||
chrome/browser/extensions/api/contextual_tasks_private/contextual_tasks_private_apitest.cc
|
||||
chrome/browser/extensions/api/debugger/debugger_apitest.cc
|
||||
chrome/browser/extensions/api/debugger/extension_dev_tools_infobar_delegate.cc
|
||||
chrome/browser/extensions/api/declarative_content/content_predicate.h
|
||||
@@ -4540,6 +4539,7 @@ extensions/browser/updater/extension_downloader_test_helper.cc
|
||||
extensions/browser/updater/extension_downloader_unittest.cc
|
||||
extensions/browser/updater/safe_manifest_parser.h
|
||||
extensions/browser/updater/safe_manifest_parser_unittest.cc
|
||||
extensions/browser/updater/update_data_provider_unittest.cc
|
||||
extensions/common/api/PRESUBMIT.py
|
||||
extensions/common/api/extensions_manifest_types.json
|
||||
extensions/common/api/i18n.json
|
||||
|
||||
@@ -26,7 +26,6 @@ owners:
|
||||
fi:
|
||||
fil:
|
||||
fr:
|
||||
- Maxokie
|
||||
fr-CA:
|
||||
gl:
|
||||
gu:
|
||||
|
||||
@@ -22,29 +22,6 @@ You are a professional translator for browser UI strings. Translate all provided
|
||||
|
||||
10. **Browser style**: Helium is a Chromium-based browser. Use terminology and phrasing that match established browser UI translations for the target language, especially Chromium/Chrome-style translations for common browser concepts.
|
||||
|
||||
11. **ICU plural messages**: some messages use ICU MessageFormat plural syntax. For example:
|
||||
|
||||
```text
|
||||
{MINUTES, plural,
|
||||
=1 {minute}
|
||||
other {minutes}}
|
||||
```
|
||||
|
||||
Keep the argument name (`MINUTES`), the keyword `plural`, exact-number selectors such as `=0` or `=1`, plural-category selectors (`zero`, `one`, `two`, `few`, `many`, and `other`), any `offset:n`, `#` characters, and the surrounding braces as syntax. Translate only the human-readable text inside each selector's braces. `#` means “insert the locale-formatted count”; preserve it exactly and do not add it when the source does not contain it.
|
||||
|
||||
Do not assume every language has only English-style singular and plural forms. Keep every exact-number branch from the source (such as `=0` and `=1`), always include `other`, and use exactly the CLDR cardinal plural categories the target language requires — adding any that are missing from the source and removing any source-language categories (such as `one`, `few`, `many`) that the target language does not use. Consult the [Unicode CLDR Language Plural Rules chart](https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html) for the categories used by each language, the counts assigned to each category, and minimal-pair examples. The chart determines which selector applies to a number; choose the actual translated wording from the message's grammatical context. Exact-number selectors match before language categories: `=1` means only the number 1, while a category such as `one` can cover other numbers too. For example, Russian needs the source above translated as:
|
||||
|
||||
```text
|
||||
{MINUTES, plural,
|
||||
=1 {минута}
|
||||
one {минута}
|
||||
few {минуты}
|
||||
many {минут}
|
||||
other {минуты}}
|
||||
```
|
||||
|
||||
Here `=1` handles 1, `one` handles values such as 21 and 31, `few` handles values such as 2–4 and 22–24, and `many` handles values such as 0, 5–20, and 25–30. Use the categories and wording appropriate for `{{language_code}}`; the Russian example illustrates the mechanism, not a pattern to copy into other languages. Preserve the message's intent: if the source omits the number because it is displayed separately in the UI, do not insert it into the translation.
|
||||
|
||||
## Input
|
||||
|
||||
You will receive a JSON array of objects, each with:
|
||||
|
||||
@@ -575,24 +575,6 @@
|
||||
"context": "In Title Case: The name of the Search with Engine command in the content area context menu",
|
||||
"message": "&Search with <ph name=\"SEARCH_ENGINE\">$1<ex>DuckDuckGo</ex></ph>"
|
||||
},
|
||||
{
|
||||
"name": "IDS_FORCE_PASTE",
|
||||
"source": "chrome/app/generated_resources.grd",
|
||||
"context": "The label for a command that pastes text without invoking page paste handlers",
|
||||
"message": "Force paste"
|
||||
},
|
||||
{
|
||||
"name": "IDS_FORCE_PASTE",
|
||||
"source": "chrome/app/generated_resources.grd",
|
||||
"context": "In Title Case: The label for a command that pastes text without invoking page paste handlers",
|
||||
"message": "Force Paste"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_SHIFT_RIGHT_CLICK_CONTEXT_MENU",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Label for the checkbox which makes Shift+right click show the browser context menu even when a page blocks it.",
|
||||
"message": "Force context menu with Shift+Right Click"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_PERMISSIONS_DESCRIPTION_NORMAL",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
@@ -756,84 +738,6 @@
|
||||
"context": "macOS-only link on the browser shortcuts Settings page that opens the system keyboard shortcuts settings.",
|
||||
"message": "System Settings > Keyboard > Keyboard Shortcuts > App Shortcuts"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_HELIUM_CRASH_REPORTING_TITLE",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Title of the setting that controls crash reporting",
|
||||
"message": "Crash reporting"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_HELIUM_CRASH_REPORTING_DESCRIPTION",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Description of the setting that controls crash reporting",
|
||||
"message": "Choose whether Helium can ask to send crash reports or send them automatically. Disabling reports will delete all pending reports."
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_HELIUM_CRASH_REPORTING_DISABLED",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Crash reporting option that disables prompts and submissions",
|
||||
"message": "Disabled"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_HELIUM_CRASH_REPORTING_ASK",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Crash reporting option that prompts after a crash",
|
||||
"message": "Ask after a crash"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_HELIUM_CRASH_REPORTING_AUTOMATIC",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Crash reporting option that automatically submits reports",
|
||||
"message": "Send automatically"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_NOISE",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Title of the settings page for Helium's fingerprinting protection feature.",
|
||||
"message": "Fingerprinting protection"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_NOISE_LINK_DESCRIPTION",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Description of the fingerprinting protection link on the Privacy and security settings page.",
|
||||
"message": "Manage how Helium protects you against fingerprinting"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_NOISE_TOGGLE_DESCRIPTION",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Description of the global fingerprinting protection toggle.",
|
||||
"message": "Make it harder for sites to fingerprint your browser and device"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_NOISE_DESCRIPTION",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Description of how Helium protects against browser fingerprinting.",
|
||||
"message": "When fingerprinting protection is enabled, Helium adds noise to certain browser features to make it harder for sites to track and profile you. Each site sees consistent randomized information during your browsing session to reduce the chances of detection."
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_NOISE_DISCLAIMER",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Disclaimer shown below the fingerprinting protection description explaining that Helium makes fingerprint recovery harder but cannot prevent fingerprinting completely.",
|
||||
"message": "Fingerprinting cannot be fully prevented, but Helium's analysis defenses make it harder to recover the original fingerprint."
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_NOISE_CUSTOM_DESCRIPTION",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "General explanation of fingerprinting protection site rules and wildcard behavior.",
|
||||
"message": "When the general fingerprinting protection feature is enabled, sites listed below follow a custom setting. Inserting \"[*.]\" before a domain name applies it to the entire domain."
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_NOISE_EXCEPTIONS_TITLE",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Title above the list of sites where fingerprinting protection is disabled.",
|
||||
"message": "Sites without fingerprinting protection"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_NOISE_ALLOW_OVERRIDES_TITLE",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Title above the list of sites where fingerprinting protection is explicitly allowed, overriding broader site exceptions.",
|
||||
"message": "Overrides to allow fingerprinting protection"
|
||||
},
|
||||
{
|
||||
"name": "IDS_POLICY_SOURCE_HOP",
|
||||
"source": "components/policy_strings.grdp",
|
||||
@@ -882,54 +786,6 @@
|
||||
"context": "The text explaining the the installation location is a Helium component.",
|
||||
"message": "Helium component"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_CRASH_REPORTING_DIALOG_TITLE",
|
||||
"source": "components/new_or_sad_tab_strings.grdp",
|
||||
"context": "Title of the dialog asking whether to send one or more Helium crash reports. The report count is shown for multiple reports. [ICU Syntax]",
|
||||
"message": "{COUNT, plural, =1 {Would you like to send a crash report?} other {Would you like to send # crash reports?}}"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_CRASH_REPORTING_DIALOG_DESCRIPTION",
|
||||
"source": "components/new_or_sad_tab_strings.grdp",
|
||||
"context": "Introductory paragraph shown when one or more Helium crash reports are available.",
|
||||
"message": "Helium closed unexpectedly. A crash report could help us fix the issue you ran into and prevent it from happening again."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_CRASH_REPORTING_DIALOG_PRIVACY",
|
||||
"source": "components/new_or_sad_tab_strings.grdp",
|
||||
"context": "Paragraph warning that a crash report may contain sensitive information from Helium's memory.",
|
||||
"message": "A crash report may incidentally include some sensitive data present in Helium's memory at the time of crash."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_CRASH_REPORTING_DIALOG_OPTIONAL",
|
||||
"source": "components/new_or_sad_tab_strings.grdp",
|
||||
"context": "Paragraph explaining that no crash report has been sent yet and that sending reports is optional.",
|
||||
"message": "Nothing has been sent yet. Sending a crash report is optional."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_CRASH_REPORTING_DIALOG_SEND_REPORT",
|
||||
"source": "components/new_or_sad_tab_strings.grdp",
|
||||
"context": "In Title Case: Button label for sending one or more crash reports. The report count is shown for multiple reports. [ICU Syntax]",
|
||||
"message": "{COUNT, plural, =1 {Send Report} other {Send # Reports}}"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_CRASH_REPORTING_DIALOG_SEND_REPORT",
|
||||
"source": "components/new_or_sad_tab_strings.grdp",
|
||||
"context": "Button label for sending one or more crash reports. The report count is shown for multiple reports. [ICU Syntax]",
|
||||
"message": "{COUNT, plural, =1 {Send report} other {Send # reports}}"
|
||||
},
|
||||
{
|
||||
"name": "IDS_CRASH_DISABLED_MESSAGE",
|
||||
"source": "components/components_chromium_strings.grd",
|
||||
"context": "The explanatory message for helium://crashes when crash reporting is disabled",
|
||||
"message": "Crash reporting is disabled in Helium settings or by policy."
|
||||
},
|
||||
{
|
||||
"name": "IDS_CRASH_BUG_LINK_LABEL",
|
||||
"source": "components/crash_strings.grdp",
|
||||
"context": "Link text for creating an issue with additional details in Helium's GitHub repo",
|
||||
"message": "Create an issue with details"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_BROWSER_LAYOUT",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
@@ -1104,60 +960,6 @@
|
||||
"context": "Text on a toast notification that is shown when a link opens a new tab while Zen Mode is enabled.",
|
||||
"message": "New tab opened"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_NATIVE_FRAME_MATERIALS",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Label for the toggle which enables or disables native system materials on the browser frame.",
|
||||
"message": "Use native frame materials (experimental)"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_NATIVE_FRAME_MATERIALS_DESCRIPTION",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Description for the toggle which enables native system materials on the browser frame.",
|
||||
"message": "Applies native materials to the browser frame surfaces. May cause UI clarity issues."
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_SHOW_ZOOM_INDICATOR",
|
||||
"source": "chrome/app/settings_strings.grdp",
|
||||
"context": "Label for the checkbox which shows the current page zoom percentage in the address bar.",
|
||||
"message": "Show the zoom indicator in the address bar"
|
||||
},
|
||||
{
|
||||
"name": "IDS_PAGE_INFO_HELIUM_NOISE_HEADER",
|
||||
"source": "components/page_info_strings.grdp",
|
||||
"context": "The title of the fingerprinting protection row and subpage in Page Info.",
|
||||
"message": "Fingerprinting protection"
|
||||
},
|
||||
{
|
||||
"name": "IDS_PAGE_INFO_HELIUM_NOISE_TOOLTIP",
|
||||
"source": "components/page_info_strings.grdp",
|
||||
"context": "Tooltip for the fingerprinting protection row in Page Info.",
|
||||
"message": "Manage fingerprinting protection for this site"
|
||||
},
|
||||
{
|
||||
"name": "IDS_PAGE_INFO_HELIUM_NOISE_DESCRIPTION",
|
||||
"source": "components/page_info_strings.grdp",
|
||||
"context": "Explanation of how Helium fingerprinting protection works.",
|
||||
"message": "When fingerprinting protection is enabled, Helium adds noise to certain browser features to make it harder for sites to track and profile you."
|
||||
},
|
||||
{
|
||||
"name": "IDS_PAGE_INFO_HELIUM_NOISE_BREAKAGE",
|
||||
"source": "components/page_info_strings.grdp",
|
||||
"context": "Explanation of how disabling Helium's fingerprinting protection may fix privacy-invasive websites, but will reduce user's privacy.",
|
||||
"message": "Turning off the protection will reduce your privacy, but may fix site features that require fingerprinting."
|
||||
},
|
||||
{
|
||||
"name": "IDS_PAGE_INFO_HELIUM_NOISE_GLOBALLY_DISABLED",
|
||||
"source": "components/page_info_strings.grdp",
|
||||
"context": "Explanation shown when the site toggle is unavailable because fingerprinting protection is disabled globally.",
|
||||
"message": "Fingerprinting protection is turned off in Helium settings."
|
||||
},
|
||||
{
|
||||
"name": "IDS_PAGE_INFO_HELIUM_NOISE_SETTINGS_BUTTON",
|
||||
"source": "components/page_info_strings.grdp",
|
||||
"context": "A button label that opens Helium's global fingerprinting protection settings page.",
|
||||
"message": "Manage fingerprinting protection"
|
||||
},
|
||||
{
|
||||
"name": "IDS_CONTENT_CONTEXT_SYSTEM_TRANSLATE",
|
||||
"source": "chrome/app/generated_resources.grd",
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
{
|
||||
"name": "IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_DESCRIPTION_WARNING",
|
||||
"source": "Do not use this field unless you know exactly what you are doing. Never paste URLs from other people here, they are trying to steal your data. We are not responsible for any damages caused by using a custom server and will not be able to help you.",
|
||||
"message": "Verwende dieses Feld nur, wenn du genau weißt, was du tust. Füge hier niemals URLs von anderen Personen ein – sie versuchen, deine Daten zu stehlen. Wir übernehmen keine Haftung für Schäden, die durch die Nutzung eines eigenen Servers entstehen, und können dir in diesem Fall auch nicht helfen."
|
||||
"message": "Verwende dieses Feld nur, wenn du genau weißt, was du tust. Füge niemals URLs von anderen Personen hier ein – diese versuchen, deine Daten zu stehlen. Wir übernehmen keine Haftung für Schäden, die durch die Nutzung eines eigenen Servers entstehen, und können dir nicht helfen."
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_ARIA_LABEL",
|
||||
@@ -747,7 +747,7 @@
|
||||
{
|
||||
"name": "IDS_SETTINGS_ACCESSIBILITY_TOAST_TOGGLE_DESCRIPTION",
|
||||
"source": "Shows a toast notification when you copy content, such as links and images, or open a new background tab in Frameless mode",
|
||||
"message": "Zeigt eine Toast-Benachrichtigung an, wenn Sie Inhalte wie Links und Bilder kopieren oder im Rahmenlosen Modus einen neuen Hintergrundtab öffnen"
|
||||
"message": "Zeigt eine Toast-Benachrichtigung an, wenn Sie Inhalte wie Links und Bilder kopieren oder im Rahmenloser Modus einen neuen Hintergrundtab öffnen"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_BROWSER_ZEN_MODE",
|
||||
|
||||
+7
-324
@@ -453,12 +453,12 @@
|
||||
{
|
||||
"name": "IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_MESSAGE",
|
||||
"source": "Helium needs Full Disk Access to import your Bookmarks from Safari.",
|
||||
"message": "Helium a besoin de l’Accès complet au disque pour importer vos favoris depuis Safari."
|
||||
"message": "Helium a besoin de l’Accès complet au disque pour importer tes favoris depuis Safari."
|
||||
},
|
||||
{
|
||||
"name": "IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_LINK",
|
||||
"source": "Learn how to grant Full Disk Access from your System Preferences.",
|
||||
"message": "Découvrez comment accorder l’Accès complet au disque depuis vos Préférences Système."
|
||||
"message": "Découvre comment accorder l’Accès complet au disque depuis tes Préférences Système."
|
||||
},
|
||||
{
|
||||
"name": "IDS_IMPORT_FULL_DISK_ACCESS_DIALOG_OPEN_SETTINGS",
|
||||
@@ -658,17 +658,17 @@
|
||||
{
|
||||
"name": "IDS_SETTINGS_SHORTCUTS_RESET_DIALOG_DESCRIPTION",
|
||||
"source": "All keyboard shortcuts will be reset to their default values. Any custom shortcuts you've set will be lost.",
|
||||
"message": "Tous les raccourcis clavier seront rétablis à leurs valeurs par défaut. Tous les raccourcis personnalisés que vous avez définis seront perdus."
|
||||
"message": "Tous les raccourcis clavier seront rétablis à leurs valeurs par défaut. Tous les raccourcis personnalisés que tu as définis seront perdus."
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_SHORTCUTS_PRESS_SHORTCUT",
|
||||
"source": "Press a combination of keys to create a new shortcut",
|
||||
"message": "Appuyez sur une combinaison de touches pour créer un raccourci"
|
||||
"message": "Appuie sur une combinaison de touches pour créer un raccourci"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_SHORTCUTS_NEED_KEY",
|
||||
"source": "Include a key that is not a modifier.",
|
||||
"message": "Incluez une touche qui n’est pas un modificateur."
|
||||
"message": "Inclue une touche qui n’est pas un modificateur."
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_SHORTCUTS_WILL_OVERRIDE",
|
||||
@@ -688,7 +688,7 @@
|
||||
{
|
||||
"name": "IDS_SETTINGS_SHORTCUTS_MAC_SYSTEM_SETTINGS_NOTICE",
|
||||
"source": "Some keyboard shortcuts are protected and can't be changed here. To change them, go to:",
|
||||
"message": "Certains raccourcis clavier sont protégés et ne peuvent pas être modifiés ici. Pour les modifier, allez dans :"
|
||||
"message": "Certains raccourcis clavier sont protégés et ne peuvent pas être modifiés ici. Pour les modifier, va dans :"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_SHORTCUTS_MAC_SYSTEM_SETTINGS_LINK",
|
||||
@@ -778,7 +778,7 @@
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_PASSWORD_INSTALLED",
|
||||
"source": "Installed",
|
||||
"message": "Installé"
|
||||
"message": "Installé dans"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_PASSWORD_INSTALL",
|
||||
@@ -824,322 +824,5 @@
|
||||
"name": "IDS_HELIUM_ONBOARDING_DATA_IMPORT_BOOKMARKS",
|
||||
"source": "Bookmarks",
|
||||
"message": "Favoris"
|
||||
},
|
||||
{
|
||||
"name": "IDS_CONTENT_CONTEXT_SEARCHWEBWITH",
|
||||
"source": "&Search with <ph name=\"SEARCH_ENGINE\">$1<ex>DuckDuckGo</ex></ph>",
|
||||
"message": "&Rechercher avec <ph name=\"SEARCH_ENGINE\">$1<ex>DuckDuckGo</ex></ph>"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_NATIVE_FRAME_MATERIALS",
|
||||
"source": "Use native frame materials (experimental)",
|
||||
"message": "Utiliser les matériaux natifs du cadre (expérimental)"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_NATIVE_FRAME_MATERIALS_DESCRIPTION",
|
||||
"source": "Applies native materials to the browser frame surfaces. May cause UI clarity issues.",
|
||||
"message": "Applique des matériaux natifs aux surfaces du cadre du navigateur. Peut nuire à la lisibilité de l'interface."
|
||||
},
|
||||
{
|
||||
"name": "IDS_CONTENT_CONTEXT_SYSTEM_TRANSLATE",
|
||||
"source": "Translate “<ph name=\"SELECTION_TEXT\">$1<ex>Bonjour</ex></ph>”",
|
||||
"message": "Traduire « <ph name=\"SELECTION_TEXT\">$1<ex>Bonjour</ex></ph> »"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_PAGE_TITLE",
|
||||
"source": "Helium Setup",
|
||||
"message": "Configuration d'Helium"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_BUTTON_USE_DEFAULTS",
|
||||
"source": "Use defaults",
|
||||
"message": "Utiliser les paramètres par défaut"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_BUTTON_LETS_GO",
|
||||
"source": "Let's go!",
|
||||
"message": "C'est parti !"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_PARTNER_TITLE",
|
||||
"source": "Helium Partner",
|
||||
"message": "Partenaire Helium"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_PARTNER_TOOLTIP",
|
||||
"source": "Paying for this service will support\nthe development of Helium.",
|
||||
"message": "Payer pour ce service soutiendra\nle développement d'Helium."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_WELCOME_GREETING",
|
||||
"source": "Meet Helium",
|
||||
"message": "Découvrez Helium"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_WELCOME_BODY",
|
||||
"source": "Configure your browser just the way you want it, or use\nthe default preset with best privacy and comfort.",
|
||||
"message": "Configurez votre navigateur exactement comme vous le souhaitez, ou utilisez\nle préréglage par défaut, optimisé pour la confidentialité et le confort."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_WELCOME_TERMS_NOTE",
|
||||
"source": "By continuing, you agree to the",
|
||||
"message": "En continuant, vous acceptez la"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_WELCOME_TERMS_PRIVACY",
|
||||
"source": "privacy policy",
|
||||
"message": "politique de confidentialité"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_WELCOME_TERMS_AND",
|
||||
"source": "and",
|
||||
"message": "et les"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_WELCOME_TERMS_USE",
|
||||
"source": "terms of use",
|
||||
"message": "conditions d'utilisation"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_WELCOME_FOOTER",
|
||||
"source": "You can skip setup and come back later, but Helium services won't work without it.",
|
||||
"message": "Vous pouvez ignorer la configuration et y revenir plus tard, mais les services Helium ne fonctionneront pas sans elle."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_FINISH_TITLE",
|
||||
"source": "Ready to browse?",
|
||||
"message": "Prêt à naviguer ?",
|
||||
"feminine": "Prête à naviguer ?"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_FINISH_BODY",
|
||||
"source": "The setup is complete, thank you for choosing Helium.\nTime to enjoy the Internet again.",
|
||||
"message": "La configuration est terminée, merci d'avoir choisi Helium.\nIl est temps de profiter à nouveau d'Internet."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_TITLE",
|
||||
"source": "Helium services",
|
||||
"message": "Services Helium"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_SUBTITLE",
|
||||
"source": "Services are not active until you consent to using them.\nChanges will be applied after you go to the next page.",
|
||||
"message": "Les services ne sont pas actifs tant que vous n'avez pas consenti à leur utilisation.\nLes modifications seront appliquées lorsque vous passerez à la page suivante."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_CONNECTION_TITLE",
|
||||
"source": "Allow connecting to Helium services",
|
||||
"message": "Autoriser la connexion aux services Helium"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_CONNECTION_DESC",
|
||||
"source": "Helium services provide additional functionality, such as: extension downloads, native !bangs, filter list updates, and browser updates. When disabled, none of these features will work, but Helium will not make any web requests.",
|
||||
"message": "Les services Helium offrent des fonctionnalités supplémentaires, telles que : le téléchargement d'extensions, les !bangs natifs, la mise à jour des listes de filtres et les mises à jour du navigateur. Lorsqu'ils sont désactivés, aucune de ces fonctionnalités ne fonctionne, mais Helium n'effectue aucune requête web."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_BANGS_TITLE",
|
||||
"source": "Allow downloading the !bangs list",
|
||||
"message": "Autoriser le téléchargement de la liste des !bangs"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_BANGS_DESC",
|
||||
"source": "Helium will fetch a list of bangs that help you browse the Internet faster, such as !w or !gh. When disabled, bangs will not work.",
|
||||
"message": "Helium récupérera une liste de bangs qui vous aident à naviguer sur Internet plus rapidement, tels que !w ou !gh. Lorsque cette option est désactivée, les bangs ne fonctionneront pas."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_EXTENSIONS_TITLE",
|
||||
"source": "Proxy extension downloads and updates",
|
||||
"message": "Faire passer les téléchargements et mises à jour d'extensions par un proxy"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_EXTENSIONS_DESC",
|
||||
"source": "When enabled, Helium will proxy extension downloads and updates to protect your privacy. When disabled, downloading and updating extensions will not work.",
|
||||
"message": "Lorsque cette option est activée, Helium relaiera via proxy les téléchargements et mises à jour d'extensions pour protéger votre vie privée. Lorsqu'elle est désactivée, le téléchargement et la mise à jour des extensions ne fonctionneront pas."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_UBLOCK_TITLE",
|
||||
"source": "Allow downloading filter lists for uBlock Origin",
|
||||
"message": "Autoriser le téléchargement des listes de filtres pour uBlock Origin"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_UBLOCK_DESC",
|
||||
"source": "Helium will fetch fresh filter lists for uBlock Origin. All requests to lists are proxied to protect your privacy. When disabled, default filter lists will be loaded from local storage, which are only updated along with Helium. Optional filter lists will be requested without proxying.",
|
||||
"message": "Helium récupérera des listes de filtres à jour pour uBlock Origin. Toutes les requêtes vers les listes sont acheminées via un proxy pour protéger votre vie privée. Lorsque cette option est désactivée, les listes de filtres par défaut seront chargées depuis le stockage local et ne seront mises à jour qu'en même temps que Helium. Les listes de filtres optionnelles seront demandées sans passer par le proxy."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_AUTOUPDATES_TITLE",
|
||||
"source": "Allow automatic browser updates",
|
||||
"message": "Autoriser les mises à jour automatiques du navigateur"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_AUTOUPDATES_DESC",
|
||||
"source": "Helium will automatically check for updates and install them. This includes browser and component updates. We recommend keeping this setting enabled to ensure you get the latest features and security updates.",
|
||||
"message": "Helium recherchera automatiquement les mises à jour et les installera. Cela inclut les mises à jour du navigateur et des composants. Nous vous recommandons de conserver ce paramètre activé afin de bénéficier des dernières fonctionnalités et mises à jour de sécurité."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_AUTOUPDATES_TITLE_LINUX",
|
||||
"source": "Allow automatic component updates",
|
||||
"message": "Autoriser les mises à jour automatiques des composants"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_AUTOUPDATES_DESC_LINUX",
|
||||
"source": "Helium will automatically check for component updates and install them. We recommend keeping this setting enabled. On Linux, browser updates are handled by your distro's package manager. Please check for Helium package updates at least every week.",
|
||||
"message": "Helium recherchera automatiquement les mises à jour des composants et les installera. Nous vous recommandons de conserver ce paramètre activé. Sous Linux, les mises à jour du navigateur sont gérées par le gestionnaire de paquets de votre distribution. Veuillez rechercher les mises à jour du paquet Helium au moins une fois par semaine."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_SPELLCHECK_TITLE",
|
||||
"source": "Allow downloading dictionary files for spell checking",
|
||||
"message": "Autoriser le téléchargement des fichiers de dictionnaire pour la vérification orthographique"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_SPELLCHECK_DESC",
|
||||
"source": "Helium will fetch dictionary files used for spell checking when requested. When disabled, spell checking will not work.",
|
||||
"message": "Helium récupérera les fichiers de dictionnaire utilisés pour la vérification orthographique lorsque cela est demandé. Lorsque cette option est désactivée, la vérification orthographique ne fonctionnera pas."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_INSTANCE_TITLE",
|
||||
"source": "Use your own instance of Helium services",
|
||||
"message": "Utiliser votre propre instance des services Helium"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SERVICES_INSTANCE_DESC",
|
||||
"source": "You can host your own instance of Helium services and use it in your browser instead of the pre-hosted server. If you have one, you can set it in Helium settings.",
|
||||
"message": "Vous pouvez héberger votre propre instance des services Helium et l'utiliser dans votre navigateur à la place du serveur préhébergé. Si vous en avez une, vous pouvez la définir dans les paramètres d'Helium."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SEARCH_SUBTITLE",
|
||||
"source": "You can change your choice later in Settings.\nEngines are ordered by privacy.",
|
||||
"message": "Vous pourrez modifier votre choix plus tard dans les paramètres.\nLes moteurs sont classés selon leur respect de la confidentialité."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SEARCH_CATEGORIES_PRIVATE",
|
||||
"source": "A privacy-first search engine which\ndoesn't profile or track you.",
|
||||
"message": "Un moteur de recherche privilégiant la confidentialité, qui\nne vous profile pas et ne vous suit pas."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SEARCH_CATEGORIES_SMALL",
|
||||
"source": "Transparent, but not privacy-focused.\nOffers better privacy than mainstream\nsearch engines.",
|
||||
"message": "Transparent, mais non axé sur la confidentialité.\nOffre une meilleure confidentialité que les\nmoteurs de recherche grand public."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SEARCH_CATEGORIES_MAINSTREAM",
|
||||
"source": "A mainstream search engine which\ncollects extensive personal data.",
|
||||
"message": "Un moteur de recherche grand public qui\ncollecte de nombreuses données personnelles."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SEARCH_CATEGORIES_CUSTOM",
|
||||
"source": "A custom search engine. Its privacy\nwasn't verified by Helium.",
|
||||
"message": "Un moteur de recherche personnalisé. Son respect\nde la vie privée n’a pas été vérifié par Helium."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SEARCH_ENGINES_DUCKDUCKGO",
|
||||
"source": "Privacy-focused. Relies on Bing results but promises to never track or profile you.",
|
||||
"message": "Axé sur la confidentialité. S'appuie sur les résultats de Bing, mais promet de ne jamais vous suivre ni vous profiler."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SEARCH_ENGINES_KAGI",
|
||||
"source": "Privacy-focused. Customizable results without ads or tracking. Requires a paid account.",
|
||||
"message": "Axé sur la confidentialité. Résultats personnalisables, sans publicité ni suivi. Nécessite un compte payant."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SEARCH_ENGINES_QWANT",
|
||||
"source": "Based in Europe. Uses Bing results. Sends tracking data to Microsoft.",
|
||||
"message": "Basé en Europe. Utilise les résultats de Bing. Envoie des données de suivi à Microsoft."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SEARCH_ENGINES_ECOSIA",
|
||||
"source": "May plant trees for clicking ads. Relies on Bing and Google. Sends tracking data to Microsoft and Google.",
|
||||
"message": "Peut planter des arbres lorsque vous cliquez sur des publicités. S'appuie sur Bing et Google. Envoie des données de suivi à Microsoft et Google."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SEARCH_ENGINES_BING",
|
||||
"source": "Collects extensive personal data. Privacy controls are buried and limited. Subjectively overwhelming UI.",
|
||||
"message": "Collecte de nombreuses données personnelles. Les contrôles de confidentialité sont difficiles à trouver et limités. Interface subjectivement surchargée."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_SEARCH_ENGINES_GOOGLE",
|
||||
"source": "It's Google. It dominates the search market, collects extensive personal data, and profiles you.",
|
||||
"message": "C'est Google. Il domine le marché de la recherche, collecte de nombreuses données personnelles et vous profile."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_DEFAULT_BROWSER_TITLE",
|
||||
"source": "Ready to switch to Helium?",
|
||||
"message": "Prêt à passer à Helium ?",
|
||||
"feminine": "Prête à passer à Helium ?"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_DEFAULT_BROWSER_SUBTITLE",
|
||||
"source": "Better privacy, speed, and comfort. All in one click.\nLet's make links open in Helium by default.",
|
||||
"message": "Plus de confidentialité, de rapidité et de confort. Le tout en un clic.\nFaisons en sorte que les liens s'ouvrent dans Helium par défaut."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_DEFAULT_BROWSER_YES_DESC",
|
||||
"source": "Make Helium my default browser.",
|
||||
"message": "Définir Helium comme mon navigateur par défaut."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_DEFAULT_BROWSER_NO_DESC",
|
||||
"source": "Just trying Helium for now.",
|
||||
"message": "J'essaie simplement Helium pour l'instant."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_DATA_IMPORT_TITLE",
|
||||
"source": "Take your stuff with you",
|
||||
"message": "Emportez vos données avec vous"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_DATA_IMPORT_SUBTITLE",
|
||||
"source": "Transfer your most important bookmarks, history,\n and extensions from other browsers.",
|
||||
"message": "Transférez vos favoris, votre historique\n et vos extensions les plus importants depuis d'autres navigateurs."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_PASSWORD_TITLE",
|
||||
"source": "Password manager",
|
||||
"message": "Gestionnaire de mots de passe"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_PASSWORD_SUBTITLE",
|
||||
"source": "Helium doesn't have a built-in password manager, by design.\n Would you like to install a browser-agnostic one?",
|
||||
"message": "Helium ne dispose pas de gestionnaire de mots de passe intégré, et ce, à dessein.\n Souhaitez-vous en installer un indépendant du navigateur ?"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_PASSWORD_SETUP_GUIDE",
|
||||
"source": "Setup",
|
||||
"message": "Configuration"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_PASSWORD_ERROR",
|
||||
"source": "Error:",
|
||||
"message": "Erreur :"
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_PASSWORD_MANAGERS_PROTON_PASS",
|
||||
"source": "Secure and privacy-focused password manager by Proton. Stores data in Europe. All clients are open-source. Free with an optional paid plan.",
|
||||
"message": "Gestionnaire de mots de passe sécurisé et axé sur la confidentialité, proposé par Proton. Stocke les données en Europe. Tous les clients sont open source. Gratuit, avec une formule payante facultative."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_PASSWORD_MANAGERS_BITWARDEN",
|
||||
"source": "The most popular open-source password manager. Offers data storage in Europe or US. Free with an optional paid plan. Can be self-hosted.",
|
||||
"message": "Le gestionnaire de mots de passe open source le plus populaire. Propose un stockage des données en Europe ou aux États-Unis. Gratuit, avec une formule payante facultative. Peut être auto-hébergé."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_PASSWORD_MANAGERS_ONE_PASSWORD",
|
||||
"source": "Popular, paid, and closed-source password manager. Offers data storage in Europe or US. May not work correctly with Helium due to negligence.",
|
||||
"message": "Gestionnaire de mots de passe populaire, payant et à code source fermé. Propose un stockage des données en Europe ou aux États-Unis. Peut ne pas fonctionner correctement avec Helium par négligence."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_PASSWORD_MANAGERS_DASHLANE",
|
||||
"source": "Popular, paid, and closed-source password manager. Stores data in Europe. Known for aggressive upselling tactics.",
|
||||
"message": "Gestionnaire de mots de passe populaire, payant et à code source fermé. Stocke les données en Europe. Connu pour ses techniques de vente incitative agressives."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_PASSWORD_MANAGERS_ICLOUD_PASSWORDS",
|
||||
"source": "Free password manager by Apple. Will nag you about using Safari and require re-authentication on browser restart. Can't generate passwords.",
|
||||
"message": "Gestionnaire de mots de passe gratuit d'Apple. Vous incitera sans cesse à utiliser Safari et exigera une nouvelle authentification à chaque redémarrage du navigateur. Ne peut pas générer de mots de passe."
|
||||
},
|
||||
{
|
||||
"name": "IDS_HELIUM_ONBOARDING_PASSWORD_MANAGERS_KEE_PASS_XC",
|
||||
"source": "Local, free, and open-source password manager for advanced users. Requires technical knowledge to set up and use.",
|
||||
"message": "Gestionnaire de mots de passe local, gratuit et open source, destiné aux utilisateurs avancés. Nécessite des connaissances techniques pour être configuré et utilisé."
|
||||
}
|
||||
]
|
||||
|
||||
@@ -732,12 +732,12 @@
|
||||
{
|
||||
"name": "IDS_TAB_CXMENU_COPY_URL",
|
||||
"source": "Copy URL",
|
||||
"message": "复制链接地址"
|
||||
"message": "复制链接"
|
||||
},
|
||||
{
|
||||
"name": "IDS_TAB_CXMENU_COPY_URLS",
|
||||
"source": "Copy URLs",
|
||||
"message": "复制多个链接地址"
|
||||
"message": "复制多个网址"
|
||||
},
|
||||
{
|
||||
"name": "IDS_SETTINGS_ACCESSIBILITY_TOAST_TOGGLE_TITLE",
|
||||
|
||||
@@ -3052,7 +3052,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
+#endif // BRAVE_UTILITY_IMPORTER_CHROME_IMPORTER_H_
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -11506,6 +11506,20 @@ Check your passwords anytime in <ph name
|
||||
@@ -11500,6 +11500,20 @@ Check your passwords anytime in <ph name
|
||||
<message name="IDS_IMPORT_FROM_SAFARI" desc="browser combo box: Safari">
|
||||
Safari
|
||||
</message>
|
||||
|
||||
@@ -575,7 +575,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// entire group has been collected and is ready to be written to the profile.
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -11495,6 +11495,15 @@ Check your passwords anytime in <ph name
|
||||
@@ -11489,6 +11489,15 @@ Check your passwords anytime in <ph name
|
||||
Microsoft Edge
|
||||
</message>
|
||||
</if>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
#include "components/viz/common/switches.h"
|
||||
#include "components/viz/host/gpu_client.h"
|
||||
#include "components/viz/host/host_frame_sink_manager.h"
|
||||
@@ -3860,6 +3861,8 @@ void RenderProcessHostImpl::PropagateBro
|
||||
@@ -3861,6 +3862,8 @@ void RenderProcessHostImpl::PropagateBro
|
||||
switches::kEnableWebGLDraftExtensions,
|
||||
switches::kEnableWebGPUDeveloperFeatures,
|
||||
switches::kFileUrlPathAlias,
|
||||
@@ -176,7 +176,7 @@
|
||||
// - ScriptSchedulingType::kInOrder
|
||||
--- a/third_party/blink/renderer/core/dom/element.cc
|
||||
+++ b/third_party/blink/renderer/core/dom/element.cc
|
||||
@@ -3462,6 +3462,9 @@ Vector<gfx::RectF> Element::GetClientRec
|
||||
@@ -3461,6 +3461,9 @@ Vector<gfx::RectF> Element::GetClientRec
|
||||
}
|
||||
Vector<gfx::RectF> result;
|
||||
for (auto& quad : quads) {
|
||||
@@ -186,7 +186,7 @@
|
||||
result.emplace_back(quad.BoundingBox());
|
||||
}
|
||||
return result;
|
||||
@@ -3491,6 +3494,9 @@ gfx::RectF Element::GetBoundingClientRec
|
||||
@@ -3490,6 +3493,9 @@ gfx::RectF Element::GetBoundingClientRec
|
||||
DCHECK(element_layout_object);
|
||||
GetDocument().AdjustRectForScrollAndAbsoluteZoom(result,
|
||||
*element_layout_object);
|
||||
@@ -335,7 +335,7 @@
|
||||
#include "third_party/skia/include/core/SkImage.h"
|
||||
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
|
||||
@@ -2982,6 +2982,12 @@
|
||||
@@ -2971,6 +2971,12 @@
|
||||
status: "stable",
|
||||
},
|
||||
{
|
||||
|
||||
@@ -183,63 +183,3 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
--- a/chrome/app/chrome_crash_reporter_client.cc
|
||||
+++ b/chrome/app/chrome_crash_reporter_client.cc
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/string_split.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
+#include "base/version_info/version_info.h"
|
||||
#include "build/branding_buildflags.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/common/channel_info.h"
|
||||
@@ -130,7 +131,7 @@ bool ChromeCrashReporterClient::GetCrash
|
||||
void ChromeCrashReporterClient::GetProductInfo(ProductInfo* product_info) {
|
||||
CHECK(product_info);
|
||||
product_info->product_name = "Helium";
|
||||
- product_info->version = UpdaterVersion();
|
||||
+ product_info->version = version_info::GetHeliumVersionNumber();
|
||||
product_info->channel =
|
||||
chrome::GetChannelName(chrome::WithExtendedStable(true));
|
||||
}
|
||||
--- a/components/crash/core/app/crashpad_win.cc
|
||||
+++ b/components/crash/core/app/crashpad_win.cc
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "base/strings/string_split.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
+#include "base/version_info/version_info.h"
|
||||
#include "base/win/windows_version.h"
|
||||
#include "build/branding_buildflags.h"
|
||||
#include "build/build_config.h"
|
||||
@@ -39,7 +40,7 @@ void GetPlatformCrashpadAnnotations(
|
||||
crash_reporter_client->GetProductNameAndVersion(
|
||||
exe_file, &product_name, &version, &special_build, &channel_name);
|
||||
(*annotations)["prod"] = base::WideToUTF8(product_name);
|
||||
- (*annotations)["ver"] = base::WideToUTF8(version);
|
||||
+ (*annotations)["ver"] = version_info::GetHeliumVersionNumber();
|
||||
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
// Empty means stable.
|
||||
const bool allow_empty_channel = true;
|
||||
--- a/components/crash/core/app/crashpad_mac.mm
|
||||
+++ b/components/crash/core/app/crashpad_mac.mm
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
+#include "base/version_info/version_info.h"
|
||||
#include "build/branding_buildflags.h"
|
||||
#include "components/crash/core/app/crash_reporter_client.h"
|
||||
#include "third_party/crashpad/crashpad/client/crash_report_database.h"
|
||||
@@ -77,10 +78,7 @@ std::map<std::string, std::string> GetPr
|
||||
}
|
||||
}
|
||||
|
||||
- NSString* version =
|
||||
- base::apple::ObjCCast<NSString>([base::apple::FrameworkBundle()
|
||||
- objectForInfoDictionaryKey:@"CFBundleShortVersionString"]);
|
||||
- process_annotations["ver"] = base::SysNSStringToUTF8(version);
|
||||
+ process_annotations["ver"] = version_info::GetHeliumVersionNumber();
|
||||
|
||||
process_annotations["plat"] = std::string("OS X");
|
||||
} // @autoreleasepool
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
switch (t_url->policy_origin()) {
|
||||
case TemplateURLData::PolicyOrigin::kDefaultSearchProvider:
|
||||
return false;
|
||||
@@ -1644,11 +1658,39 @@ void TemplateURLService::Load() {
|
||||
@@ -1644,11 +1658,37 @@ void TemplateURLService::Load() {
|
||||
|
||||
if (web_data_service_) {
|
||||
load_handle_ = web_data_service_->GetKeywords(this);
|
||||
@@ -165,10 +165,8 @@
|
||||
|
||||
+void TemplateURLService::LoadBangs() {
|
||||
+ VLOG(2) << "LoadBangs() called";
|
||||
+ bang_manager_->LoadBangs(
|
||||
+ url_loader_factory_, prefs_.get(),
|
||||
+ base::BindOnce(&TemplateURLService::BangsLoadedCallback,
|
||||
+ weak_ptr_factory_.GetWeakPtr()));
|
||||
+ bang_manager_->LoadBangs(url_loader_factory_, prefs_.get(),
|
||||
+ base::BindOnce(&TemplateURLService::BangsLoadedCallback, base::Unretained(this)));
|
||||
+}
|
||||
+
|
||||
+void TemplateURLService::BangsLoadedCallback() {
|
||||
@@ -193,7 +191,7 @@
|
||||
base::CallbackListSubscription TemplateURLService::RegisterOnLoadedCallback(
|
||||
base::OnceClosure callback) {
|
||||
return loaded_ ? base::CallbackListSubscription()
|
||||
@@ -2636,6 +2678,13 @@ void TemplateURLService::Init() {
|
||||
@@ -2636,6 +2676,13 @@ void TemplateURLService::Init() {
|
||||
&TemplateURLService::OnDefaultSearchProviderGUIDChanged,
|
||||
base::Unretained(this)));
|
||||
|
||||
@@ -379,8 +377,7 @@
|
||||
+
|
||||
+ url_loader_->DownloadToString(
|
||||
+ url_loader_factory.get(),
|
||||
+ base::BindOnce(&BangManager::OnSimpleLoaderComplete,
|
||||
+ weak_ptr_factory_.GetWeakPtr()),
|
||||
+ base::BindOnce(&BangManager::OnSimpleLoaderComplete, base::Unretained(this)),
|
||||
+ 5e6 /* 5 MB */
|
||||
+ );
|
||||
+}
|
||||
@@ -487,10 +484,11 @@
|
||||
+ return bangs_;
|
||||
+}
|
||||
+
|
||||
+} // namespace Bangs
|
||||
+}
|
||||
+
|
||||
--- /dev/null
|
||||
+++ b/components/search_engines/template_url_bang_manager.h
|
||||
@@ -0,0 +1,76 @@
|
||||
@@ -0,0 +1,75 @@
|
||||
+// Copyright 2025 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
@@ -552,16 +550,15 @@
|
||||
+ void LoadManifestFromString(const std::string& manifest);
|
||||
+ BangCategory GetCategoryFromJSONObject(std::string_view sc) const;
|
||||
+
|
||||
+ // Weak factory for callbacks.
|
||||
+ base::WeakPtrFactory<BangManager> weak_ptr_factory_{this};
|
||||
+ // SimpleURLLoader instance.
|
||||
+ std::unique_ptr<network::SimpleURLLoader> url_loader_;
|
||||
+
|
||||
+ std::vector<Bang> bangs_;
|
||||
+ bool load_pending_ = false;
|
||||
+ bool load_pending_;
|
||||
+ std::vector<base::OnceClosure> callbacks_;
|
||||
+ std::map<size_t, BangCategory> category_map_;
|
||||
+
|
||||
+ // Weak factory for callbacks.
|
||||
+ base::WeakPtrFactory<BangManager> weak_ptr_factory_{this};
|
||||
+ };
|
||||
+}
|
||||
+
|
||||
@@ -682,7 +679,7 @@
|
||||
|
||||
--- a/components/search_engines/template_url.cc
|
||||
+++ b/components/search_engines/template_url.cc
|
||||
@@ -1755,6 +1755,8 @@ bool TemplateURL::IsBetterThanConflictin
|
||||
@@ -1752,6 +1752,8 @@ bool TemplateURL::IsBetterThanConflictin
|
||||
: base::Time(),
|
||||
// Prefer engines that CANNOT be auto-replaced.
|
||||
!engine->safe_for_autoreplace(),
|
||||
@@ -704,7 +701,7 @@
|
||||
// Sanity check for https://crbug.com/781703.
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -63,6 +63,11 @@ bool ShouldAccessExtensionService(const
|
||||
@@ -83,6 +83,11 @@ bool ShouldAccessExtensionService(const
|
||||
prefs.GetBoolean(prefs::kHeliumExtProxyEnabled);
|
||||
}
|
||||
|
||||
@@ -718,14 +715,14 @@
|
||||
return GetDummyURL();
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -20,6 +20,7 @@ const char kHeliumDummyOrigin[] =
|
||||
|
||||
bool ShouldAccessServices(const PrefService& prefs);
|
||||
@@ -29,6 +29,7 @@ COMPONENT_EXPORT(HELIUM) void ConfigureP
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetExtensionUpdateURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -2355,6 +2355,9 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
|
||||
@@ -12,20 +12,16 @@
|
||||
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -22,11 +22,13 @@ bool ShouldAccessServices(const PrefServ
|
||||
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessUpdateService(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetExtensionUpdateURL(const PrefService& prefs);
|
||||
@@ -35,6 +35,9 @@ COMPONENT_EXPORT(HELIUM) GURL GetExtensi
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetSpellcheckURL(const PrefService& prefs);
|
||||
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessUpdateService(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetBrowserUpdateURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
+
|
||||
} // namespace helium
|
||||
|
||||
#endif // COMPONENTS_HELIUM_SERVICES_HELIUM_SERVICES_HELPERS_H_
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -6,6 +6,7 @@
|
||||
@@ -65,7 +61,7 @@
|
||||
|
||||
std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_) {
|
||||
if (user_url_.empty()) {
|
||||
@@ -73,6 +96,11 @@ bool ShouldFetchBangs(const PrefService&
|
||||
@@ -93,6 +116,11 @@ bool ShouldFetchBangs(const PrefService&
|
||||
prefs.GetBoolean(prefs::kHeliumBangsEnabled);
|
||||
}
|
||||
|
||||
@@ -77,7 +73,7 @@
|
||||
GURL GetExtensionUpdateURL(const PrefService& prefs) {
|
||||
if (!ShouldAccessExtensionService(prefs)) {
|
||||
return GetDummyURL();
|
||||
@@ -98,6 +126,24 @@ GURL GetSpellcheckURL(const PrefService&
|
||||
@@ -118,6 +146,24 @@ GURL GetSpellcheckURL(const PrefService&
|
||||
return GetServicesBaseURL(prefs).Resolve("/dict/");
|
||||
}
|
||||
|
||||
@@ -101,7 +97,7 @@
|
||||
+
|
||||
void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
ConfigurePrefChangeRegistrarForServices(registrar, observer);
|
||||
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
@@ -99,6 +99,11 @@
|
||||
|
||||
@@ -20,32 +20,3 @@
|
||||
MAC_CREATOR_CODE=Cr24
|
||||
-MAC_TEAM_ID=
|
||||
+MAC_TEAM_ID=S4Q33XPHB4
|
||||
--- a/chrome/app/chrome_crash_reporter_client.cc
|
||||
+++ b/chrome/app/chrome_crash_reporter_client.cc
|
||||
@@ -129,25 +129,7 @@ bool ChromeCrashReporterClient::GetCrash
|
||||
|
||||
void ChromeCrashReporterClient::GetProductInfo(ProductInfo* product_info) {
|
||||
CHECK(product_info);
|
||||
-
|
||||
-#if BUILDFLAG(IS_ANDROID)
|
||||
- product_info->product_name = "Chrome_Android";
|
||||
-#elif BUILDFLAG(IS_CHROMEOS)
|
||||
- product_info->product_name = "Chrome_ChromeOS";
|
||||
-#elif BUILDFLAG(IS_LINUX)
|
||||
-#if defined(ADDRESS_SANITIZER)
|
||||
- product_info->product_name = "Chrome_Linux_ASan";
|
||||
-#else
|
||||
- product_info->product_name = "Chrome_Linux";
|
||||
-#endif // defined(ADDRESS_SANITIZER)
|
||||
-#elif BUILDFLAG(IS_MAC)
|
||||
- product_info->product_name = "Chrome_Mac";
|
||||
-#elif BUILDFLAG(IS_WIN)
|
||||
- product_info->product_name = "Chrome";
|
||||
-#else
|
||||
- NOTREACHED();
|
||||
-#endif
|
||||
-
|
||||
+ product_info->product_name = "Helium";
|
||||
product_info->version = UpdaterVersion();
|
||||
product_info->channel =
|
||||
chrome::GetChannelName(chrome::WithExtendedStable(true));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -11963,6 +11963,9 @@ Check your passwords anytime in <ph name
|
||||
@@ -11957,6 +11957,9 @@ Check your passwords anytime in <ph name
|
||||
<message name="IDS_TAB_CXMENU_CLOSETABSBELOW" desc="The label of the 'Close Tabs Below' Tab context menu item.">
|
||||
Close tabs below
|
||||
</message>
|
||||
@@ -10,7 +10,7 @@
|
||||
<message name="IDS_TAB_CXMENU_CLOSEALLTABS" desc="The label of the 'Close All Tabs' Tab context menu item.">
|
||||
Close all tabs
|
||||
</message>
|
||||
@@ -12085,6 +12088,9 @@ Check your passwords anytime in <ph name
|
||||
@@ -12079,6 +12082,9 @@ Check your passwords anytime in <ph name
|
||||
<message name="IDS_TAB_CXMENU_CLOSETABSBELOW" desc="In Title Case: The label of the 'Close Tabs Below' Tab context menu item.">
|
||||
Close Tabs Below
|
||||
</message>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "net/base/url_util.h"
|
||||
#include "url/gurl.h"
|
||||
@@ -101,6 +102,12 @@ bool ShouldAccessUpdateService(const Pre
|
||||
@@ -121,6 +122,12 @@ bool ShouldAccessUpdateService(const Pre
|
||||
prefs.GetBoolean(prefs::kHeliumUpdateFetchingEnabled);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
bool ShouldAccessUBlockAssets(const PrefService& prefs) {
|
||||
return ShouldAccessServices(prefs) &&
|
||||
prefs.GetBoolean(prefs::kHeliumUBlockAssetsEnabled);
|
||||
@@ -149,6 +156,14 @@ GURL GetBrowserUpdateURL(const PrefServi
|
||||
@@ -169,6 +176,14 @@ GURL GetBrowserUpdateURL(const PrefServi
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -52,22 +52,16 @@
|
||||
return GetDummyURL();
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -23,6 +23,7 @@ bool ShouldAccessServices(const PrefServ
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessUpdateService(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessComponentUpdateService(const PrefService& prefs);
|
||||
@@ -41,6 +41,9 @@ COMPONENT_EXPORT(HELIUM) GURL GetBrowser
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessUBlockAssets(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
@@ -30,6 +31,7 @@ COMPONENT_EXPORT(HELIUM) GURL GetExtensi
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetSpellcheckURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetBrowserUpdateURL(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetComponentUpdateURL(const PrefService* prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetUBlockAssetsURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessComponentUpdateService(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetComponentUpdateURL(const PrefService* prefs);
|
||||
+
|
||||
} // namespace helium
|
||||
|
||||
#endif // COMPONENTS_HELIUM_SERVICES_HELIUM_SERVICES_HELPERS_H_
|
||||
--- a/chrome/browser/component_updater/chrome_component_updater_configurator.cc
|
||||
+++ b/chrome/browser/component_updater/chrome_component_updater_configurator.cc
|
||||
@@ -26,11 +26,14 @@
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
--- a/components/captive_portal/content/BUILD.gn
|
||||
+++ b/components/captive_portal/content/BUILD.gn
|
||||
@@ -33,6 +33,7 @@ source_set("content") {
|
||||
|
||||
deps = [
|
||||
"//components/embedder_support",
|
||||
+ "//components/helium_services",
|
||||
"//content/public/browser",
|
||||
"//third_party/blink/public/common",
|
||||
]
|
||||
--- a/components/captive_portal/content/captive_portal_service.cc
|
||||
+++ b/components/captive_portal/content/captive_portal_service.cc
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "build/build_config.h"
|
||||
#include "components/captive_portal/core/captive_portal_types.h"
|
||||
#include "components/embedder_support/pref_names.h"
|
||||
+#include "components/helium_services/helium_services_helpers.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
@@ -63,10 +64,11 @@ CaptivePortalService::CaptivePortalServi
|
||||
const base::TickClock* clock_for_testing,
|
||||
network::mojom::URLLoaderFactory* loader_factory_for_testing)
|
||||
: browser_context_(browser_context),
|
||||
+ pref_service_(pref_service),
|
||||
state_(STATE_IDLE),
|
||||
enabled_(false),
|
||||
last_detection_result_(RESULT_INTERNET_CONNECTED),
|
||||
- test_url_(CaptivePortalDetector::GetDefaultUrl()),
|
||||
+ test_url_(helium::GetConnectivityCheckURL(*pref_service)),
|
||||
tick_clock_for_testing_(clock_for_testing) {
|
||||
network::mojom::URLLoaderFactory* loader_factory;
|
||||
if (loader_factory_for_testing) {
|
||||
@@ -87,6 +89,11 @@ CaptivePortalService::CaptivePortalServi
|
||||
embedder_support::kAlternateErrorPagesEnabled, pref_service,
|
||||
base::BindRepeating(&CaptivePortalService::UpdateEnabledState,
|
||||
base::Unretained(this)));
|
||||
+ helium_services_pref_change_registrar_.Init(pref_service);
|
||||
+ helium::ConfigurePrefChangeRegistrarForServices(
|
||||
+ helium_services_pref_change_registrar_,
|
||||
+ base::BindRepeating(&CaptivePortalService::UpdateTestURL,
|
||||
+ base::Unretained(this)));
|
||||
ResetBackoffEntry(last_detection_result_);
|
||||
|
||||
UpdateEnabledState();
|
||||
@@ -260,6 +267,10 @@ void CaptivePortalService::UpdateEnabled
|
||||
}
|
||||
}
|
||||
|
||||
+void CaptivePortalService::UpdateTestURL() {
|
||||
+ test_url_ = helium::GetConnectivityCheckURL(*pref_service_);
|
||||
+}
|
||||
+
|
||||
base::TimeTicks CaptivePortalService::GetCurrentTimeTicks() const {
|
||||
if (tick_clock_for_testing_)
|
||||
return tick_clock_for_testing_->NowTicks();
|
||||
--- a/components/captive_portal/content/captive_portal_service.h
|
||||
+++ b/components/captive_portal/content/captive_portal_service.h
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "components/captive_portal/core/captive_portal_detector.h"
|
||||
#include "components/captive_portal/core/captive_portal_types.h"
|
||||
#include "components/keyed_service/core/keyed_service.h"
|
||||
+#include "components/prefs/pref_change_registrar.h"
|
||||
#include "components/prefs/pref_member.h"
|
||||
#include "net/base/backoff_entry.h"
|
||||
#include "services/network/public/cpp/shared_url_loader_factory.h"
|
||||
@@ -33,6 +34,7 @@ class URLLoaderFactory;
|
||||
class Browser;
|
||||
class CaptivePortalBrowserTest;
|
||||
class HttpsUpgradesBrowserTest;
|
||||
+class PrefService;
|
||||
|
||||
namespace captive_portal {
|
||||
|
||||
@@ -164,6 +166,9 @@ class CaptivePortalService : public Keye
|
||||
// Android, since it lacks the Browser class.
|
||||
void UpdateEnabledState();
|
||||
|
||||
+ // Updates |test_url_| from the active Helium services settings.
|
||||
+ void UpdateTestURL();
|
||||
+
|
||||
base::TimeTicks GetCurrentTimeTicks() const;
|
||||
|
||||
bool DetectionInProgress() const;
|
||||
@@ -180,6 +185,10 @@ class CaptivePortalService : public Keye
|
||||
// The BrowserContext that owns this CaptivePortalService.
|
||||
const raw_ptr<content::BrowserContext> browser_context_;
|
||||
|
||||
+ // Owned by the same BrowserContext/Profile that owns this KeyedService and
|
||||
+ // outlives it.
|
||||
+ const raw_ptr<PrefService> pref_service_;
|
||||
+
|
||||
State state_;
|
||||
|
||||
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory_;
|
||||
@@ -211,6 +220,8 @@ class CaptivePortalService : public Keye
|
||||
// URL that returns a 204 response code when connected to the Internet.
|
||||
GURL test_url_;
|
||||
|
||||
+ PrefChangeRegistrar helium_services_pref_change_registrar_;
|
||||
+
|
||||
// The pref member for whether navigation errors should be resolved with a web
|
||||
// service. Actually called "alternate_error_pages", since it's also used for
|
||||
// the Link Doctor.
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -56,6 +56,18 @@ bool ShouldAccessServices(const PrefServ
|
||||
return prefs.GetBoolean(prefs::kHeliumServicesEnabled);
|
||||
}
|
||||
|
||||
+GURL GetConnectivityCheckURL(const PrefService& prefs) {
|
||||
+ if (!ShouldAccessServices(prefs)) {
|
||||
+ return GetDummyURL();
|
||||
+ }
|
||||
+
|
||||
+ GURL::Replacements replacements;
|
||||
+ replacements.SetSchemeStr(url::kHttpScheme);
|
||||
+ return GetServicesBaseURL(prefs)
|
||||
+ .ReplaceComponents(replacements)
|
||||
+ .Resolve("/connectivitycheck");
|
||||
+}
|
||||
+
|
||||
void ConfigurePrefChangeRegistrarForServices(
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -22,6 +22,7 @@ bool ShouldAccessServices(const PrefServ
|
||||
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetConnectivityCheckURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarForServices(
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -12038,6 +12038,12 @@ Check your passwords anytime in <ph name
|
||||
@@ -12032,6 +12032,12 @@ Check your passwords anytime in <ph name
|
||||
<message name="IDS_TAB_CXMENU_HIBERNATE_OTHER_TABS" desc="The label of the 'Hibernate other tabs' Tab context menu item.">
|
||||
Hibernate other tabs
|
||||
</message>
|
||||
@@ -13,7 +13,7 @@
|
||||
<message name="IDS_TAB_CXMENU_CLOSETAB" desc="The label of the tab context menu item for closing one or more tabs.">
|
||||
Close
|
||||
</message>
|
||||
@@ -12163,6 +12169,12 @@ Check your passwords anytime in <ph name
|
||||
@@ -12157,6 +12163,12 @@ Check your passwords anytime in <ph name
|
||||
<message name="IDS_TAB_CXMENU_HIBERNATE_OTHER_TABS" desc="In Title Case: The label of the 'Hibernate Other Tabs' Tab context menu item.">
|
||||
Hibernate Other Tabs
|
||||
</message>
|
||||
|
||||
@@ -1,215 +0,0 @@
|
||||
--- a/chrome/app/chrome_crash_reporter_client.cc
|
||||
+++ b/chrome/app/chrome_crash_reporter_client.cc
|
||||
@@ -119,7 +119,7 @@ base::FilePath ChromeCrashReporterClient
|
||||
}
|
||||
|
||||
bool ChromeCrashReporterClient::GetShouldDumpLargerDumps() {
|
||||
- return chrome::GetChannel() != version_info::Channel::STABLE;
|
||||
+ return false;
|
||||
}
|
||||
#endif // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
|
||||
|
||||
--- a/chrome/app/chrome_crash_reporter_client_win.cc
|
||||
+++ b/chrome/app/chrome_crash_reporter_client_win.cc
|
||||
@@ -99,7 +99,7 @@ void ChromeCrashReporterClient::GetProdu
|
||||
bool ChromeCrashReporterClient::GetShouldDumpLargerDumps() {
|
||||
// Capture larger dumps for Google Chrome beta, dev, and canary channels, and
|
||||
// Chromium builds. The Google Chrome stable channel uses smaller dumps.
|
||||
- return install_static::GetChromeChannel() != version_info::Channel::STABLE;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
bool ChromeCrashReporterClient::ReportingIsEnforcedByPolicy(
|
||||
--- a/components/crash/core/app/crashpad.cc
|
||||
+++ b/components/crash/core/app/crashpad.cc
|
||||
@@ -183,8 +183,7 @@ bool InitializeCrashpadImpl(bool initial
|
||||
// On Android crashpad doesn't handle uploads. Android uses
|
||||
// //components/minidump_uploader which queries metrics sample/consent opt
|
||||
// in from preferences.
|
||||
- CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
|
||||
- SetUploadConsent(crash_reporter_client->GetCollectStatsConsent());
|
||||
+ SetUploadConsent(false);
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
@@ -192,6 +191,12 @@ bool InitializeCrashpadImpl(bool initial
|
||||
|
||||
} // namespace
|
||||
|
||||
+bool DisableCrashpadUploadsAtStartup(const base::FilePath& database_path) {
|
||||
+ std::unique_ptr<crashpad::CrashReportDatabase> database =
|
||||
+ crashpad::CrashReportDatabase::Initialize(database_path);
|
||||
+ return database && database->GetSettings()->SetUploadsEnabled(false);
|
||||
+}
|
||||
+
|
||||
bool InitializeCrashpad(bool initial_client, const std::string& process_type) {
|
||||
return InitializeCrashpadImpl(initial_client, process_type, std::string(),
|
||||
base::FilePath(), std::vector<std::string>(),
|
||||
--- a/chrome/common/crash_keys.cc
|
||||
+++ b/chrome/common/crash_keys.cc
|
||||
@@ -7,9 +7,11 @@
|
||||
#include <array>
|
||||
#include <deque>
|
||||
#include <string_view>
|
||||
+#include <vector>
|
||||
|
||||
#include "base/base_switches.h"
|
||||
#include "base/command_line.h"
|
||||
+#include "base/files/file_path.h"
|
||||
#include "base/format_macros.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/strings/strcat.h"
|
||||
@@ -105,6 +107,28 @@ void HandleEnableDisableFeatures(const b
|
||||
"commandline-disabled-feature");
|
||||
}
|
||||
|
||||
+std::string SanitizeFeatureList(std::string_view feature_list) {
|
||||
+ std::vector<std::string> sanitized_features;
|
||||
+ for (std::string feature :
|
||||
+ base::SplitString(feature_list, ",", base::TRIM_WHITESPACE,
|
||||
+ base::SPLIT_WANT_NONEMPTY)) {
|
||||
+ const size_t separator = feature.find_first_of("<:");
|
||||
+ if (separator != std::string::npos) {
|
||||
+ feature.resize(separator);
|
||||
+ }
|
||||
+ bool valid = !feature.empty();
|
||||
+ for (size_t i = 0; valid && i < feature.size(); ++i) {
|
||||
+ const char c = feature[i];
|
||||
+ valid = base::IsAsciiAlphaNumeric(c) || c == '_' || c == '-' ||
|
||||
+ c == '.' || (i == 0 && c == '*');
|
||||
+ }
|
||||
+ if (valid) {
|
||||
+ sanitized_features.push_back(feature);
|
||||
+ }
|
||||
+ }
|
||||
+ return base::JoinString(sanitized_features, ",");
|
||||
+}
|
||||
+
|
||||
// Return true if we DON'T want to upload this flag to the crash server.
|
||||
bool IsBoringSwitch(const std::string& flag) {
|
||||
static const auto kIgnoreSwitches = std::to_array<std::string_view>({
|
||||
@@ -211,9 +235,24 @@ void AppendStringAnnotationsCommandLineS
|
||||
}
|
||||
|
||||
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) {
|
||||
- SetStringAnnotations(command_line);
|
||||
- HandleEnableDisableFeatures(command_line);
|
||||
- SetSwitchesFromCommandLine(command_line, &IsBoringSwitch);
|
||||
+ // Keep useful switch and feature names without copying arbitrary values into
|
||||
+ // crash reports.
|
||||
+ base::CommandLine sanitized(command_line.GetProgram());
|
||||
+ for (const auto& entry : command_line.GetSwitches()) {
|
||||
+ const std::string& name = entry.first;
|
||||
+ if (name == kStringAnnotationsSwitch) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (name == switches::kEnableFeatures ||
|
||||
+ name == switches::kDisableFeatures) {
|
||||
+ sanitized.AppendSwitchASCII(
|
||||
+ name, SanitizeFeatureList(command_line.GetSwitchValueASCII(name)));
|
||||
+ } else {
|
||||
+ sanitized.AppendSwitch(name);
|
||||
+ }
|
||||
+ }
|
||||
+ HandleEnableDisableFeatures(sanitized);
|
||||
+ SetSwitchesFromCommandLine(sanitized, &IsBoringSwitch);
|
||||
}
|
||||
|
||||
} // namespace crash_keys
|
||||
--- a/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc
|
||||
+++ b/third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc
|
||||
@@ -201,8 +201,6 @@ void CrashReportUploadThread::ProcessPen
|
||||
// Don’t attempt an upload if there’s no URL to upload to. Allow upload if
|
||||
// it has been explicitly requested by the user, otherwise, respect the
|
||||
// upload-enabled state stored in the database’s settings.
|
||||
- database_->SkipReportUpload(report.uuid,
|
||||
- Metrics::CrashSkippedReason::kUploadsDisabled);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -312,7 +310,9 @@ CrashReportUploadThread::UploadResult Cr
|
||||
if (kv.first == kMinidumpKey) {
|
||||
LOG(WARNING) << "reserved key " << kv.first << ", discarding value "
|
||||
<< kv.second;
|
||||
- } else {
|
||||
+ } else if (kv.first == "prod" || kv.first == "ver" ||
|
||||
+ kv.first == "plat" || kv.first == "ptype" ||
|
||||
+ kv.first == "channel") {
|
||||
http_multipart_builder.SetFormData(kv.first, kv.second);
|
||||
}
|
||||
}
|
||||
@@ -350,7 +350,6 @@ CrashReportUploadThread::UploadResult Cr
|
||||
} kURLParameterMappings[] = {
|
||||
{"prod", "product"},
|
||||
{"ver", "version"},
|
||||
- {"guid", "guid"},
|
||||
};
|
||||
|
||||
for (const auto& parameter_mapping : kURLParameterMappings) {
|
||||
--- a/third_party/crashpad/crashpad/client/settings.cc
|
||||
+++ b/third_party/crashpad/crashpad/client/settings.cc
|
||||
@@ -154,12 +154,7 @@ SettingsReader::~SettingsReader() = defa
|
||||
|
||||
bool SettingsReader::GetClientID(UUID* client_id) {
|
||||
DCHECK(initialized().is_valid());
|
||||
-
|
||||
- Data settings;
|
||||
- if (!OpenAndReadSettings(&settings))
|
||||
- return false;
|
||||
-
|
||||
- *client_id = settings.client_id;
|
||||
+ client_id->InitializeToZero();
|
||||
return true;
|
||||
}
|
||||
|
||||
--- a/components/crash/core/app/crashpad.h
|
||||
+++ b/components/crash/core/app/crashpad.h
|
||||
@@ -78,6 +78,9 @@ namespace crash_reporter {
|
||||
// On iOS, this will return false if Crashpad initialization fails.
|
||||
bool InitializeCrashpad(bool initial_client, const std::string& process_type);
|
||||
|
||||
+// Disables uploads in the Crashpad database before its handler starts.
|
||||
+bool DisableCrashpadUploadsAtStartup(const base::FilePath& database_path);
|
||||
+
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// This is the same as InitializeCrashpad(), but rather than launching a
|
||||
// crashpad_handler executable, relaunches the executable at |exe_path| or the
|
||||
--- a/components/crash/core/app/crashpad_linux.cc
|
||||
+++ b/components/crash/core/app/crashpad_linux.cc
|
||||
@@ -165,6 +165,10 @@ bool PlatformCrashpadInitialization(
|
||||
crash_reporter_client->GetCrashDumpLocation(database_path);
|
||||
crash_reporter_client->GetCrashMetricsLocation(&metrics_path);
|
||||
|
||||
+ if (!DisableCrashpadUploadsAtStartup(*database_path)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
base::FilePath handler_path;
|
||||
if (!base::PathService::Get(base::DIR_EXE, &handler_path)) {
|
||||
return false;
|
||||
--- a/components/crash/core/app/crashpad_mac.mm
|
||||
+++ b/components/crash/core/app/crashpad_mac.mm
|
||||
@@ -153,6 +153,10 @@ bool PlatformCrashpadInitialization(
|
||||
crash_reporter_client->GetCrashDumpLocation(database_path);
|
||||
crash_reporter_client->GetCrashMetricsLocation(&metrics_path);
|
||||
|
||||
+ if (!DisableCrashpadUploadsAtStartup(*database_path)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
std::string url = crash_reporter_client->GetUploadUrl();
|
||||
|
||||
std::vector<std::string> arguments;
|
||||
--- a/components/crash/core/app/crashpad_win.cc
|
||||
+++ b/components/crash/core/app/crashpad_win.cc
|
||||
@@ -87,6 +87,10 @@ bool PlatformCrashpadInitialization(
|
||||
if (crash_reporter_client->GetCrashDumpLocation(&database_path_str))
|
||||
*database_path = base::FilePath(database_path_str);
|
||||
|
||||
+ if (!DisableCrashpadUploadsAtStartup(*database_path)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
std::wstring metrics_path_str;
|
||||
if (crash_reporter_client->GetCrashMetricsLocation(&metrics_path_str)) {
|
||||
metrics_path = base::FilePath(metrics_path_str);
|
||||
@@ -1,600 +0,0 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -727,6 +727,12 @@ inline constexpr char kSplitViewDragAndD
|
||||
// recently used tabs.
|
||||
inline constexpr char kCtrlTabMru[] = "browser.ctrl_tab_mru";
|
||||
|
||||
+// Controls whether desktop crash reports are disabled, offered to the user, or
|
||||
+// uploaded automatically. This preference is registered in Local State and is
|
||||
+// shared by all profiles.
|
||||
+inline constexpr char kHeliumCrashReportingMode[] =
|
||||
+ "helium.crash_reporting.mode";
|
||||
+
|
||||
// A boolean pref set to true if Gemini integration be enabled. This is managed
|
||||
// by enterprise policy.
|
||||
inline constexpr char kGeminiSettings[] = "browser.gemini_settings";
|
||||
--- a/chrome/browser/prefs/browser_prefs.cc
|
||||
+++ b/chrome/browser/prefs/browser_prefs.cc
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "chrome/browser/browser_process_impl.h"
|
||||
#include "chrome/browser/chrome_content_browser_client.h"
|
||||
#include "chrome/browser/component_updater/component_updater_prefs.h"
|
||||
+#include "chrome/browser/crash_upload_list/helium_crash_reporting.h"
|
||||
#include "chrome/browser/download/download_prefs.h"
|
||||
#include "chrome/browser/engagement/important_sites_util.h"
|
||||
#include "chrome/browser/enterprise/reporting/prefs.h"
|
||||
@@ -1326,6 +1327,9 @@ void RegisterLocalState(PrefRegistrySimp
|
||||
breadcrumbs::RegisterPrefs(registry);
|
||||
browser_shutdown::RegisterPrefs(registry);
|
||||
BrowserProcessImpl::RegisterPrefs(registry);
|
||||
+ registry->RegisterIntegerPref(
|
||||
+ prefs::kHeliumCrashReportingMode,
|
||||
+ static_cast<int>(helium::CrashReportingMode::kAsk));
|
||||
ChromeContentBrowserClient::RegisterLocalStatePrefs(registry);
|
||||
#if BUILDFLAG(CHROME_FOR_TESTING)
|
||||
chrome_for_testing::RegisterPrefs(registry);
|
||||
--- a/chrome/browser/chrome_browser_main.cc
|
||||
+++ b/chrome/browser/chrome_browser_main.cc
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "chrome/browser/browser_process_impl.h"
|
||||
#include "chrome/browser/chrome_browser_main_extra_parts.h"
|
||||
#include "chrome/browser/component_updater/registration.h"
|
||||
+#include "chrome/browser/crash_upload_list/helium_crash_reporting.h"
|
||||
#include "chrome/browser/enterprise/browser_management/management_service_factory.h"
|
||||
#include "chrome/browser/enterprise/chrome_browser_main_extra_parts_enterprise.h"
|
||||
#include "chrome/browser/first_run/bookmark_importer.h"
|
||||
@@ -1237,6 +1238,8 @@ int ChromeBrowserMainParts::PreCreateThr
|
||||
browser_process_->Init();
|
||||
}
|
||||
|
||||
+ helium::InitializeCrashReportingMode();
|
||||
+
|
||||
#if !BUILDFLAG(IS_CHROMEOS)
|
||||
std::optional<std::string> managed_by =
|
||||
policy::GetManagedBy(browser_process_->browser_policy_connector()
|
||||
--- a/components/crash/core/app/crash_reporter_client.cc
|
||||
+++ b/components/crash/core/app/crash_reporter_client.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/crash/core/app/crash_reporter_client.h"
|
||||
|
||||
+#include "base/command_line.h"
|
||||
#include "build/branding_buildflags.h"
|
||||
#include "build/build_config.h"
|
||||
|
||||
@@ -27,6 +28,10 @@ CrashReporterClient* g_client = nullptr;
|
||||
const char kDefaultUploadURL[] = "https://clients2.google.com/cr/report";
|
||||
#endif
|
||||
|
||||
+#if !BUILDFLAG(IS_WIN)
|
||||
+constexpr char kCrashServerUrlCommandLine[] = "custom-crash-server-url";
|
||||
+#endif
|
||||
+
|
||||
} // namespace
|
||||
|
||||
ProductInfo::ProductInfo() = default;
|
||||
@@ -146,8 +151,15 @@ void CrashReporterClient::GetSanitizatio
|
||||
#endif
|
||||
|
||||
std::string CrashReporterClient::GetUploadUrl() {
|
||||
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && defined(OFFICIAL_BUILD)
|
||||
- return kDefaultUploadURL;
|
||||
+#if !BUILDFLAG(IS_WIN)
|
||||
+ const auto* command_line = base::CommandLine::ForCurrentProcess();
|
||||
+ if (command_line->HasSwitch(kCrashServerUrlCommandLine)) {
|
||||
+ return command_line->GetSwitchValueASCII(kCrashServerUrlCommandLine);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+#if defined(OFFICIAL_BUILD)
|
||||
+ return "https://crash.helium.computer/crash";
|
||||
#else
|
||||
return std::string();
|
||||
#endif
|
||||
--- a/components/crash/core/app/crashpad.cc
|
||||
+++ b/components/crash/core/app/crashpad.cc
|
||||
@@ -247,26 +247,37 @@ void DestroyCrashpadClient() {
|
||||
}
|
||||
|
||||
#if !BUILDFLAG(IS_CHROMEOS)
|
||||
-void SetUploadConsent(bool consent) {
|
||||
+namespace {
|
||||
+
|
||||
+void ApplyUploadConsent(bool consent) {
|
||||
if (!g_database)
|
||||
return;
|
||||
|
||||
- bool enable_uploads = false;
|
||||
+ bool policy_enabled = true;
|
||||
CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
|
||||
- if (!crash_reporter_client->ReportingIsEnforcedByPolicy(&enable_uploads)) {
|
||||
- // Breakpad provided a --disable-breakpad switch to disable crash dumping
|
||||
- // (not just uploading) here. Crashpad doesn't need it: dumping is enabled
|
||||
- // unconditionally and uploading is gated on consent, which tests/bots
|
||||
- // shouldn't have. As a precaution, uploading is also disabled on bots even
|
||||
- // if consent is present.
|
||||
- enable_uploads = consent && !crash_reporter_client->IsRunningUnattended();
|
||||
- }
|
||||
+ const bool reporting_disabled_by_policy =
|
||||
+ crash_reporter_client->ReportingIsEnforcedByPolicy(&policy_enabled) &&
|
||||
+ !policy_enabled;
|
||||
|
||||
crashpad::Settings* settings = g_database->GetSettings();
|
||||
- settings->SetUploadsEnabled(enable_uploads &&
|
||||
- crash_reporter_client->GetCollectStatsInSample());
|
||||
+ settings->SetUploadsEnabled(consent && !reporting_disabled_by_policy &&
|
||||
+ !crash_reporter_client->IsRunningUnattended());
|
||||
+}
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
+void SetUploadConsent(bool) {
|
||||
+ // Helium manages crash upload consent through SetUploadConsentFromUser(),
|
||||
+ // this function is stubbed out and the callers are ignored.
|
||||
}
|
||||
|
||||
+void SetUploadConsentFromUser(bool consent) {
|
||||
+#if BUILDFLAG(IS_WIN)
|
||||
+ SetUploadConsentFromUser_ExportThunk(consent);
|
||||
+#else
|
||||
+ internal::SetUploadConsentFromUserImpl(consent);
|
||||
+#endif
|
||||
+}
|
||||
#endif // !BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
@@ -358,6 +369,14 @@ void RequestSingleCrashUpload(const std:
|
||||
#endif
|
||||
}
|
||||
|
||||
+bool DeleteCrashReport(const std::string& local_id) {
|
||||
+#if BUILDFLAG(IS_WIN)
|
||||
+ return DeleteCrashReport_ExportThunk(local_id.c_str());
|
||||
+#else
|
||||
+ return DeleteCrashReportImpl(local_id);
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
std::optional<base::FilePath> GetCrashpadDatabasePath() {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
base::FilePath::StringType::const_pointer path =
|
||||
@@ -448,6 +467,24 @@ void RequestSingleCrashUploadImpl(const
|
||||
g_database->RequestUpload(uuid);
|
||||
}
|
||||
|
||||
+bool DeleteCrashReportImpl(const std::string& local_id) {
|
||||
+ if (!g_database)
|
||||
+ return false;
|
||||
+
|
||||
+ crashpad::UUID uuid;
|
||||
+ if (!uuid.InitializeFromString(local_id))
|
||||
+ return false;
|
||||
+
|
||||
+ // Explicit upload requests bypass the global upload toggle. Move the report
|
||||
+ // out of the pending state first so a deletion failure cannot authorize a
|
||||
+ // later upload.
|
||||
+ g_database->SkipReportUpload(
|
||||
+ uuid, crashpad::Metrics::CrashSkippedReason::kUploadsDisabled);
|
||||
+ const auto status = g_database->DeleteReport(uuid);
|
||||
+ return status == crashpad::CrashReportDatabase::kNoError ||
|
||||
+ status == crashpad::CrashReportDatabase::kReportNotFound;
|
||||
+}
|
||||
+
|
||||
base::FilePath::StringType::const_pointer GetCrashpadDatabasePathImpl() {
|
||||
if (!g_database_path)
|
||||
return nullptr;
|
||||
@@ -472,6 +509,10 @@ void ClearReportsBetweenImpl(time_t begi
|
||||
|
||||
namespace internal {
|
||||
|
||||
+void SetUploadConsentFromUserImpl(bool consent) {
|
||||
+ ApplyUploadConsent(consent);
|
||||
+}
|
||||
+
|
||||
crashpad::CrashReportDatabase* GetCrashReportDatabase() {
|
||||
return g_database;
|
||||
}
|
||||
--- a/components/crash/core/app/crashpad.h
|
||||
+++ b/components/crash/core/app/crashpad.h
|
||||
@@ -139,6 +139,10 @@ void DestroyCrashpadClient();
|
||||
// running.
|
||||
void SetUploadConsent(bool consent);
|
||||
|
||||
+// Enables or disables uploads in response to Helium's explicit user consent.
|
||||
+// Unlike SetUploadConsent(), this must only be called from Helium-owned UI.
|
||||
+void SetUploadConsentFromUser(bool consent);
|
||||
+
|
||||
#endif // !BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
enum class ReportUploadState {
|
||||
@@ -166,6 +170,11 @@ void GetReports(std::vector<Report>* rep
|
||||
// Requests a user triggered upload for a crash report with a given id.
|
||||
void RequestSingleCrashUpload(const std::string& local_id);
|
||||
|
||||
+// Permanently deletes the crash report with the given id. Any explicit upload
|
||||
+// request is cleared before deletion so a deletion failure cannot leave the
|
||||
+// report uploadable.
|
||||
+bool DeleteCrashReport(const std::string& local_id);
|
||||
+
|
||||
void DumpWithoutCrashing();
|
||||
|
||||
#if BUILDFLAG(IS_IOS)
|
||||
@@ -224,6 +233,9 @@ void GetReportsImpl(std::vector<Report>*
|
||||
// The implementation function for RequestSingleCrashUpload.
|
||||
void RequestSingleCrashUploadImpl(const std::string& local_id);
|
||||
|
||||
+// The implementation function for DeleteCrashReport.
|
||||
+bool DeleteCrashReportImpl(const std::string& local_id);
|
||||
+
|
||||
// The implementation function for GetCrashpadDatabasePath.
|
||||
base::FilePath::StringType::const_pointer GetCrashpadDatabasePathImpl();
|
||||
|
||||
@@ -291,6 +303,10 @@ bool GetHandlerSocket(int* sock, pid_t*
|
||||
|
||||
namespace internal {
|
||||
|
||||
+// Applies explicit Helium user consent in the module that owns the Crashpad
|
||||
+// database. On Windows this is invoked through chrome_elf.dll.
|
||||
+void SetUploadConsentFromUserImpl(bool consent);
|
||||
+
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// Returns platform specific annotations. This is broken out on Windows only so
|
||||
// that it may be reused by GetCrashKeysForKasko.
|
||||
--- a/chrome/browser/crash_upload_list/BUILD.gn
|
||||
+++ b/chrome/browser/crash_upload_list/BUILD.gn
|
||||
@@ -12,6 +12,8 @@ static_library("crash_upload_list") {
|
||||
sources = [
|
||||
"crash_upload_list.cc",
|
||||
"crash_upload_list.h",
|
||||
+ "helium_crash_reporting.cc",
|
||||
+ "helium_crash_reporting.h",
|
||||
]
|
||||
|
||||
if (is_android) {
|
||||
@@ -29,10 +31,15 @@ static_library("crash_upload_list") {
|
||||
}
|
||||
|
||||
deps = [
|
||||
+ "//chrome/browser:browser_process",
|
||||
+ "//chrome/common",
|
||||
"//chrome/common:constants",
|
||||
"//components/crash/core/app",
|
||||
"//components/crash/core/browser",
|
||||
+ "//components/metrics:metrics_pref_names",
|
||||
+ "//components/prefs",
|
||||
"//components/upload_list",
|
||||
+ "//third_party/crashpad/crashpad/client",
|
||||
]
|
||||
|
||||
if (is_android) {
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/crash_upload_list/helium_crash_reporting.cc
|
||||
@@ -0,0 +1,149 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+#include "chrome/browser/crash_upload_list/helium_crash_reporting.h"
|
||||
+
|
||||
+#include <vector>
|
||||
+
|
||||
+#include "base/functional/bind.h"
|
||||
+#include "base/logging.h"
|
||||
+#include "base/no_destructor.h"
|
||||
+#include "chrome/browser/browser_process.h"
|
||||
+#include "chrome/common/pref_names.h"
|
||||
+#include "components/crash/core/app/crashpad.h"
|
||||
+#include "components/metrics/metrics_pref_names.h"
|
||||
+#include "components/prefs/pref_change_registrar.h"
|
||||
+#include "components/prefs/pref_service.h"
|
||||
+
|
||||
+namespace helium {
|
||||
+
|
||||
+namespace {
|
||||
+
|
||||
+void DeletePendingReports(bool include_explicitly_requested) {
|
||||
+ std::vector<crash_reporter::Report> reports;
|
||||
+ crash_reporter::GetReports(&reports);
|
||||
+
|
||||
+ for (const auto& report : reports) {
|
||||
+ if (report.state != crash_reporter::ReportUploadState::Pending &&
|
||||
+ report.state !=
|
||||
+ crash_reporter::ReportUploadState::Pending_UserRequested) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (!include_explicitly_requested &&
|
||||
+ report.state ==
|
||||
+ crash_reporter::ReportUploadState::Pending_UserRequested) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (!crash_reporter::DeleteCrashReport(report.local_id)) {
|
||||
+ LOG(ERROR) << "Failed to delete crash report: " << report.local_id;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
+CrashReportingMode GetCrashReportingMode() {
|
||||
+ PrefService* local_state = g_browser_process->local_state();
|
||||
+ CHECK(local_state);
|
||||
+
|
||||
+ const int value =
|
||||
+ local_state->GetInteger(prefs::kHeliumCrashReportingMode);
|
||||
+ CHECK(IsValidCrashReportingMode(value));
|
||||
+
|
||||
+ return static_cast<CrashReportingMode>(value);
|
||||
+}
|
||||
+
|
||||
+bool UploadsDisabledByPolicy() {
|
||||
+ PrefService* local_state = g_browser_process->local_state();
|
||||
+ if (!local_state) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ const PrefService::Preference* preference =
|
||||
+ local_state->FindPreference(metrics::prefs::kMetricsReportingEnabled);
|
||||
+ return preference && preference->IsManaged() &&
|
||||
+ !local_state->GetBoolean(metrics::prefs::kMetricsReportingEnabled);
|
||||
+}
|
||||
+
|
||||
+void InitializeCrashReportingMode() {
|
||||
+ PrefService* local_state = g_browser_process->local_state();
|
||||
+ if (!local_state) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ const int stored_mode =
|
||||
+ local_state->GetInteger(prefs::kHeliumCrashReportingMode);
|
||||
+ if (!IsValidCrashReportingMode(stored_mode)) {
|
||||
+ LOG(ERROR) << "Invalid crash reporting mode " << stored_mode
|
||||
+ << "; resetting to default";
|
||||
+ local_state->SetInteger(
|
||||
+ prefs::kHeliumCrashReportingMode,
|
||||
+ static_cast<int>(CrashReportingMode::kAsk));
|
||||
+ }
|
||||
+
|
||||
+ static base::NoDestructor<PrefChangeRegistrar> policy_registrar;
|
||||
+ policy_registrar->Init(local_state);
|
||||
+ if (!policy_registrar->IsObserved(
|
||||
+ metrics::prefs::kMetricsReportingEnabled)) {
|
||||
+ policy_registrar->Add(
|
||||
+ metrics::prefs::kMetricsReportingEnabled,
|
||||
+ base::BindRepeating(&helium::InitializeCrashReportingMode));
|
||||
+ }
|
||||
+
|
||||
+ crash_reporter::SetUploadConsentFromUser(false);
|
||||
+
|
||||
+ if (UploadsDisabledByPolicy()) {
|
||||
+ // Policy overrides the stored mode without changing the user's selection.
|
||||
+ // Explicit requests bypass Crashpad's global upload toggle, so discard
|
||||
+ // those reports as well while reporting is forbidden by policy.
|
||||
+ DeletePendingReports(/*include_explicitly_requested=*/true);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ const CrashReportingMode mode = GetCrashReportingMode();
|
||||
+ switch (mode) {
|
||||
+ case CrashReportingMode::kDisabled:
|
||||
+ // Disabled mode must not retain any uploadable reports.
|
||||
+ DeletePendingReports(/*include_explicitly_requested=*/true);
|
||||
+ return;
|
||||
+ case CrashReportingMode::kAsk:
|
||||
+ // Leave reports pending so the crash dialog can offer them.
|
||||
+ return;
|
||||
+ case CrashReportingMode::kAutomatic:
|
||||
+ // Allow Crashpad to upload pending reports without prompting.
|
||||
+ crash_reporter::SetUploadConsentFromUser(true);
|
||||
+ return;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void SetCrashReportingMode(CrashReportingMode mode) {
|
||||
+ PrefService* local_state = g_browser_process->local_state();
|
||||
+ if (!local_state) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // Make mode changes prospective: stop uploads and discard existing
|
||||
+ // reports before applying the new mode. Explicitly requested reports are
|
||||
+ // preserved unless reporting is disabled by the user or policy.
|
||||
+ crash_reporter::SetUploadConsentFromUser(false);
|
||||
+
|
||||
+ const bool uploads_disabled_by_policy = UploadsDisabledByPolicy();
|
||||
+ DeletePendingReports(
|
||||
+ /*include_explicitly_requested=*/
|
||||
+ uploads_disabled_by_policy || mode == CrashReportingMode::kDisabled);
|
||||
+
|
||||
+ if (uploads_disabled_by_policy) {
|
||||
+ // Preserve the user's stored selection while policy is enforced.
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ local_state->SetInteger(prefs::kHeliumCrashReportingMode,
|
||||
+ static_cast<int>(mode));
|
||||
+ if (mode == CrashReportingMode::kAutomatic) {
|
||||
+ crash_reporter::SetUploadConsentFromUser(true);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+} // namespace helium
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/crash_upload_list/helium_crash_reporting.h
|
||||
@@ -0,0 +1,39 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+#ifndef CHROME_BROWSER_CRASH_UPLOAD_LIST_HELIUM_CRASH_REPORTING_H_
|
||||
+#define CHROME_BROWSER_CRASH_UPLOAD_LIST_HELIUM_CRASH_REPORTING_H_
|
||||
+
|
||||
+namespace helium {
|
||||
+
|
||||
+enum class CrashReportingMode {
|
||||
+ kDisabled = -1,
|
||||
+ kAsk,
|
||||
+ kAutomatic,
|
||||
+};
|
||||
+
|
||||
+constexpr bool IsValidCrashReportingMode(int value) {
|
||||
+ return value >= static_cast<int>(CrashReportingMode::kDisabled) &&
|
||||
+ value <= static_cast<int>(CrashReportingMode::kAutomatic);
|
||||
+}
|
||||
+
|
||||
+CrashReportingMode GetCrashReportingMode();
|
||||
+
|
||||
+// Returns true only when policy explicitly disables crash reporting. A policy
|
||||
+// that enables reporting does not constitute user consent.
|
||||
+bool UploadsDisabledByPolicy();
|
||||
+
|
||||
+// Applies the stored mode at startup and discards all pending reports when
|
||||
+// reporting is disabled by the user or policy.
|
||||
+void InitializeCrashReportingMode();
|
||||
+
|
||||
+// Disables consent, discards existing unrequested reports, stores `mode`, and
|
||||
+// then enables consent only when `mode` is automatic. Explicitly requested
|
||||
+// reports are also discarded when reporting is disabled by the user or policy.
|
||||
+// If policy disables crash reporting, the stored mode is preserved.
|
||||
+void SetCrashReportingMode(CrashReportingMode mode);
|
||||
+
|
||||
+} // namespace helium
|
||||
+
|
||||
+#endif // CHROME_BROWSER_CRASH_UPLOAD_LIST_HELIUM_CRASH_REPORTING_H_
|
||||
--- a/chrome/chrome_elf/chrome_elf.def
|
||||
+++ b/chrome/chrome_elf/chrome_elf.def
|
||||
@@ -9,10 +9,12 @@ EXPORTS
|
||||
DumpHungProcessWithPtype_ExportThunk
|
||||
GetCrashpadDatabasePath_ExportThunk
|
||||
ClearReportsBetween_ExportThunk
|
||||
+ DeleteCrashReport_ExportThunk
|
||||
GetCrashReports_ExportThunk
|
||||
InjectDumpForHungInput_ExportThunk
|
||||
RequestSingleCrashUpload_ExportThunk
|
||||
SetUploadConsent_ExportThunk
|
||||
+ SetUploadConsentFromUser_ExportThunk
|
||||
GetUploadConsent_ExportThunk
|
||||
GetProductInfo_ExportThunk
|
||||
|
||||
--- a/components/crash/core/app/crash_export_stubs.cc
|
||||
+++ b/components/crash/core/app/crash_export_stubs.cc
|
||||
@@ -15,6 +15,10 @@
|
||||
|
||||
void RequestSingleCrashUpload_ExportThunk(const char* local_id) {}
|
||||
|
||||
+bool DeleteCrashReport_ExportThunk(const char* local_id) {
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
size_t GetCrashReports_ExportThunk(crash_reporter::Report* reports,
|
||||
size_t reports_size) {
|
||||
return 0;
|
||||
@@ -28,6 +32,8 @@ int CrashForException_ExportThunk(EXCEPT
|
||||
|
||||
void SetUploadConsent_ExportThunk(bool consent) {}
|
||||
|
||||
+void SetUploadConsentFromUser_ExportThunk(bool consent) {}
|
||||
+
|
||||
bool GetUploadConsent_ExportThunk() {
|
||||
return crash_reporter::GetCrashReporterClient()->GetCollectStatsConsent();
|
||||
}
|
||||
--- a/components/crash/core/app/crash_export_thunks.cc
|
||||
+++ b/components/crash/core/app/crash_export_thunks.cc
|
||||
@@ -20,6 +20,10 @@ void RequestSingleCrashUpload_ExportThun
|
||||
crash_reporter::RequestSingleCrashUploadImpl(local_id);
|
||||
}
|
||||
|
||||
+bool DeleteCrashReport_ExportThunk(const char* local_id) {
|
||||
+ return crash_reporter::DeleteCrashReportImpl(local_id);
|
||||
+}
|
||||
+
|
||||
size_t GetCrashReports_ExportThunk(crash_reporter::Report* reports,
|
||||
size_t reports_size) {
|
||||
static_assert(std::is_trivially_copyable<crash_reporter::Report>::value,
|
||||
@@ -56,6 +60,10 @@ void SetUploadConsent_ExportThunk(bool c
|
||||
crash_reporter::SetUploadConsent(consent);
|
||||
}
|
||||
|
||||
+void SetUploadConsentFromUser_ExportThunk(bool consent) {
|
||||
+ crash_reporter::internal::SetUploadConsentFromUserImpl(consent);
|
||||
+}
|
||||
+
|
||||
bool GetUploadConsent_ExportThunk() {
|
||||
return crash_reporter::GetCrashReporterClient()->GetCollectStatsConsent();
|
||||
}
|
||||
--- a/components/crash/core/app/crash_export_thunks.h
|
||||
+++ b/components/crash/core/app/crash_export_thunks.h
|
||||
@@ -29,6 +29,10 @@ extern "C" {
|
||||
// crash report upload. See CrashUploadListCrashpad.
|
||||
void RequestSingleCrashUpload_ExportThunk(const char* local_id);
|
||||
|
||||
+// This function may be invoked across module boundaries to permanently delete
|
||||
+// a single crash report. See crash_reporter::DeleteCrashReport.
|
||||
+bool DeleteCrashReport_ExportThunk(const char* local_id);
|
||||
+
|
||||
// This function may be invoked across module boundaries to retrieve the crash
|
||||
// list. It copies up to |report_count| reports into |reports| and returns the
|
||||
// number of reports available. If the return value is less than or equal to
|
||||
@@ -53,6 +57,10 @@ int CrashForException_ExportThunk(EXCEPT
|
||||
// not enforced to avoid blocking startup code on synchronizing them.
|
||||
void SetUploadConsent_ExportThunk(bool consent);
|
||||
|
||||
+// This function may be invoked across module boundaries to update upload
|
||||
+// consent granted explicitly through Helium's crash reporting UI.
|
||||
+void SetUploadConsentFromUser_ExportThunk(bool consent);
|
||||
+
|
||||
// Returns the current upload consent state.
|
||||
// This function is used by JS Error reporting which lives in chrome.dll.
|
||||
bool GetUploadConsent_ExportThunk();
|
||||
--- a/chrome/app/chrome_crash_reporter_client_win.cc
|
||||
+++ b/chrome/app/chrome_crash_reporter_client_win.cc
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <assert.h>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
+#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -26,6 +27,13 @@
|
||||
#include "components/crash/core/app/crashpad.h"
|
||||
#include "components/version_info/channel.h"
|
||||
|
||||
+namespace {
|
||||
+
|
||||
+constexpr wchar_t kCrashServerUrlCommandLine[] =
|
||||
+ L"custom-crash-server-url";
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
ChromeCrashReporterClient::ChromeCrashReporterClient() = default;
|
||||
|
||||
ChromeCrashReporterClient::~ChromeCrashReporterClient() = default;
|
||||
@@ -96,6 +104,17 @@ void ChromeCrashReporterClient::GetProdu
|
||||
product_info->channel = base::WideToUTF8(channel_name);
|
||||
}
|
||||
|
||||
+std::string ChromeCrashReporterClient::GetUploadUrl() {
|
||||
+ std::optional<std::wstring> upload_url =
|
||||
+ install_static::GetCommandLineSwitch(::GetCommandLine(),
|
||||
+ kCrashServerUrlCommandLine);
|
||||
+ if (upload_url.has_value()) {
|
||||
+ return base::WideToUTF8(*upload_url);
|
||||
+ }
|
||||
+
|
||||
+ return CrashReporterClient::GetUploadUrl();
|
||||
+}
|
||||
+
|
||||
bool ChromeCrashReporterClient::GetShouldDumpLargerDumps() {
|
||||
// Capture larger dumps for Google Chrome beta, dev, and canary channels, and
|
||||
// Chromium builds. The Google Chrome stable channel uses smaller dumps.
|
||||
--- a/chrome/app/chrome_crash_reporter_client_win.h
|
||||
+++ b/chrome/app/chrome_crash_reporter_client_win.h
|
||||
@@ -30,6 +30,7 @@ class ChromeCrashReporterClient : public
|
||||
std::wstring* special_build,
|
||||
std::wstring* channel_name) override;
|
||||
void GetProductInfo(ProductInfo* product_info) override;
|
||||
+ std::string GetUploadUrl() override;
|
||||
bool GetShouldDumpLargerDumps() override;
|
||||
|
||||
bool GetCrashDumpLocation(std::wstring* crash_dir) override;
|
||||
@@ -1741,17 +1741,35 @@
|
||||
// clang-format off
|
||||
static base::NoDestructor<std::vector<KeyboardShortcutData>> keys({
|
||||
// cmd shift cntrl option vkeycode command
|
||||
@@ -183,6 +183,21 @@ const std::vector<KeyboardShortcutData>&
|
||||
@@ -183,6 +183,39 @@ const std::vector<KeyboardShortcutData>&
|
||||
return *keys;
|
||||
}
|
||||
|
||||
+namespace {
|
||||
+
|
||||
+const std::vector<KeyboardShortcutData>&
|
||||
+GetShortcutsNotPresentInMainMenuForShortcutSettings() {
|
||||
+ static const base::NoDestructor<std::vector<KeyboardShortcutData>> keys([]() {
|
||||
+ std::vector<KeyboardShortcutData> result =
|
||||
+ GetShortcutsNotPresentInMainMenu();
|
||||
+ const std::vector<KeyboardShortcutData>& delayed_shortcuts =
|
||||
+ GetDelayedShortcutsNotPresentInMainMenuImpl();
|
||||
+ result.insert(result.end(), delayed_shortcuts.begin(),
|
||||
+ delayed_shortcuts.end());
|
||||
+ return result;
|
||||
+ }());
|
||||
+ return *keys;
|
||||
+}
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
+const std::vector<KeyboardShortcutAcceleratorData>&
|
||||
+GetShortcutSettingsAcceleratorsNotPresentInMainMenu() {
|
||||
+ static const base::NoDestructor<std::vector<KeyboardShortcutAcceleratorData>>
|
||||
+ accelerators([]() {
|
||||
+ std::vector<KeyboardShortcutAcceleratorData> result;
|
||||
+ for (const KeyboardShortcutData& shortcut :
|
||||
+ GetShortcutsNotPresentInMainMenu()) {
|
||||
+ GetShortcutsNotPresentInMainMenuForShortcutSettings()) {
|
||||
+ result.push_back(
|
||||
+ {shortcut.chrome_command, AcceleratorFromShortcut(shortcut)});
|
||||
+ }
|
||||
@@ -1763,7 +1781,7 @@
|
||||
const std::vector<NSMenuItem*>& GetMenuItemsNotPresentInMainMenu() {
|
||||
static base::NoDestructor<std::vector<NSMenuItem*>> menu_items([]() {
|
||||
std::vector<NSMenuItem*> menu_items;
|
||||
@@ -241,7 +256,7 @@ int DelayedWebContentsCommandForKeyEvent
|
||||
@@ -241,7 +274,7 @@ int DelayedWebContentsCommandForKeyEvent
|
||||
|
||||
// Scan through keycodes and see if it corresponds to one of the non-menu
|
||||
// shortcuts.
|
||||
|
||||
@@ -498,7 +498,7 @@
|
||||
|
||||
// Changes in the profile name.
|
||||
pref_change_registrar_.Add(
|
||||
@@ -1709,6 +1714,8 @@ void ProfileImpl::UpdateAvatarInStorage(
|
||||
@@ -1713,6 +1718,8 @@ void ProfileImpl::UpdateAvatarInStorage(
|
||||
GetPrefs()->GetBoolean(prefs::kProfileUsingDefaultAvatar));
|
||||
entry->SetIsUsingGAIAPicture(
|
||||
GetPrefs()->GetBoolean(prefs::kProfileUsingGAIAAvatar));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/components/search/ntp_features.cc
|
||||
+++ b/components/search/ntp_features.cc
|
||||
@@ -246,7 +246,7 @@ BASE_FEATURE(kNtpStarterChip, base::FEAT
|
||||
@@ -243,7 +243,7 @@ BASE_FEATURE(kNtpNextCanvasChip, base::F
|
||||
BASE_FEATURE(kNtpOneGoogleBarAsyncBarParts, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
// If enabled, a footer will show on the NTP.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -116,7 +116,7 @@ BASE_FEATURE(kExtensionsCollapseMainMenu
|
||||
@@ -98,7 +98,7 @@ BASE_FEATURE(kExtensionsCollapseMainMenu
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
|
||||
// Shows an infobar on PDFs offering to become the default PDF viewer if Chrome
|
||||
// isn't the default already.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -250,13 +250,7 @@ BASE_FEATURE(kPasswordSaveUpdateDropdown
|
||||
@@ -232,13 +232,7 @@ BASE_FEATURE(kPasswordSaveUpdateDropdown
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -403,7 +403,7 @@ BASE_FEATURE(kTabsFromOtherDevicesSidePa
|
||||
@@ -385,7 +385,7 @@ BASE_FEATURE(kTabsFromOtherDevicesSidePa
|
||||
BASE_FEATURE(kTabsFromOtherDevicesSidePanelPinnedByDefault,
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/components/search/ntp_features.cc
|
||||
+++ b/components/search/ntp_features.cc
|
||||
@@ -288,7 +288,7 @@ BASE_FEATURE(kNtpShortcutsRedesign, base
|
||||
|
||||
// If enabled, the bookmark bar may be auto-removed on the NTP and new
|
||||
// visibility settings are added.
|
||||
-BASE_FEATURE(kNtpSimplificationBookmarkBar, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+BASE_FEATURE(kNtpSimplificationBookmarkBar, base::FEATURE_ENABLED_BY_DEFAULT);
|
||||
|
||||
// If enabled, the bookmark bar time interval and number of times it's shown on
|
||||
// the NTP before auto-hiding is decreased for testing.
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -64,8 +64,8 @@ BASE_FEATURE_PARAM(bool,
|
||||
"back-forward",
|
||||
true);
|
||||
@@ -54,8 +54,8 @@ BASE_FEATURE(kInfoBarInlineLinks, base::
|
||||
BASE_FEATURE(kTabStripDeclutter, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
BASE_FEATURE(kToolbarGlowUp, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
BASE_FEATURE(kMenuSimplification, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
-BASE_FEATURE(kTabGroupColorRefresh, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
-BASE_FEATURE(kWebuiRefresh2026, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -230,13 +230,7 @@ bool IsTabGroupHoverCardsEnabled() {
|
||||
@@ -212,13 +212,7 @@ bool IsTabGroupHoverCardsEnabled() {
|
||||
|
||||
// Enables preview images in tab-hover cards.
|
||||
// https://crbug.com/41439486
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -13190,11 +13190,496 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
@@ -13168,11 +13168,496 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
// AboutFlagsHistogramTest unit test to verify this process).
|
||||
};
|
||||
|
||||
@@ -498,7 +498,7 @@
|
||||
FlagsStateSingleton(const FlagsStateSingleton&) = delete;
|
||||
FlagsStateSingleton& operator=(const FlagsStateSingleton&) = delete;
|
||||
~FlagsStateSingleton() override = default;
|
||||
@@ -13213,7 +13698,7 @@ class FlagsStateSingleton : public flags
|
||||
@@ -13191,7 +13676,7 @@ class FlagsStateSingleton : public flags
|
||||
|
||||
void RestoreDefaultState() {
|
||||
flags_state_ =
|
||||
@@ -507,7 +507,7 @@
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -13546,7 +14031,7 @@ base::span<const FeatureEntry> GetFeatur
|
||||
@@ -13524,7 +14009,7 @@ base::span<const FeatureEntry> GetFeatur
|
||||
!entries_for_testing->empty()) {
|
||||
return *entries_for_testing;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#endif // USE_AURA
|
||||
|
||||
#if defined(USE_AURA)
|
||||
@@ -4705,11 +4705,13 @@ const FeatureEntry::FeatureVariation kTo
|
||||
@@ -4695,11 +4695,13 @@ const FeatureEntry::FeatureVariation kCa
|
||||
// calculate and verify checksum.
|
||||
//
|
||||
// When adding a new choice, add it to the end of the list.
|
||||
|
||||
@@ -1,241 +0,0 @@
|
||||
--- a/chrome/app/chrome_command_ids.h
|
||||
+++ b/chrome/app/chrome_command_ids.h
|
||||
@@ -172,6 +172,7 @@
|
||||
#define IDC_COPY 36001
|
||||
#define IDC_PASTE 36003
|
||||
#define IDC_EDIT_MENU 36004
|
||||
+#define IDC_FORCE_PASTE 36005
|
||||
|
||||
// Find-in-page
|
||||
#define IDC_FIND 37000
|
||||
@@ -399,6 +400,7 @@
|
||||
#define IDC_CONTENT_CONTEXT_ROTATECW 50142
|
||||
#define IDC_CONTENT_CONTEXT_ROTATECCW 50143
|
||||
// Edit items.
|
||||
+#define IDC_CONTENT_CONTEXT_FORCE_PASTE 50149
|
||||
#define IDC_CONTENT_CONTEXT_COPY 50150
|
||||
#define IDC_CONTENT_CONTEXT_CUT 50151
|
||||
#define IDC_CONTENT_CONTEXT_PASTE 50152
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -1441,6 +1441,9 @@ are declared in tools/grit/grit_args.gni
|
||||
<message name="IDS_PASTE" desc="The text label of the Paste menu item" meaning="'Paste' menu command in sentence case">
|
||||
&Paste
|
||||
</message>
|
||||
+ <message name="IDS_FORCE_PASTE" desc="The label for a command that pastes text without invoking page paste handlers">
|
||||
+ Force paste
|
||||
+ </message>
|
||||
<message name="IDS_DELETE" desc="The text label of the Delete menu item (which deletes selected text without copying to clipboard)">
|
||||
&Delete
|
||||
</message>
|
||||
@@ -1586,6 +1589,9 @@ are declared in tools/grit/grit_args.gni
|
||||
<message name="IDS_PASTE" desc="In Title Case: The text label of the Paste menu item" meaning="'Paste' menu command for Mac">
|
||||
&Paste
|
||||
</message>
|
||||
+ <message name="IDS_FORCE_PASTE" desc="In Title Case: The label for a command that pastes text without invoking page paste handlers">
|
||||
+ Force Paste
|
||||
+ </message>
|
||||
<message name="IDS_DELETE" desc="In Title Case: The text label of the Delete menu item (which deletes selected text without copying to clipboard)">
|
||||
&Delete
|
||||
</message>
|
||||
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
|
||||
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
|
||||
@@ -617,6 +617,7 @@ const std::map<int, int>& GetIdcToUmaMap
|
||||
{IDC_CONTENT_CONTEXT_LISTEN_TO_THIS_PAGE, 164},
|
||||
{IDC_CONTENT_CONTEXT_DICTATION, 165},
|
||||
{IDC_CONTENT_CONTEXT_ADD_LINK_TO_READING_LIST, 166},
|
||||
+ {IDC_CONTENT_CONTEXT_FORCE_PASTE, 167},
|
||||
// To add new items:
|
||||
// - Add one more line above this comment block, using the UMA value
|
||||
// from the line below this comment block.
|
||||
@@ -2902,6 +2903,8 @@ void RenderViewContextMenu::AppendOtherE
|
||||
menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_PASTE_AND_MATCH_STYLE,
|
||||
IDS_CONTENT_CONTEXT_PASTE_AND_MATCH_STYLE);
|
||||
}
|
||||
+ menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_FORCE_PASTE,
|
||||
+ IDS_FORCE_PASTE);
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Insert a submenu of clipboard history descriptors.
|
||||
@@ -3371,6 +3374,7 @@ bool RenderViewContextMenu::IsCommandIdE
|
||||
return IsPasteEnabled();
|
||||
|
||||
case IDC_CONTENT_CONTEXT_PASTE_AND_MATCH_STYLE:
|
||||
+ case IDC_CONTENT_CONTEXT_FORCE_PASTE:
|
||||
return IsPasteAndMatchStyleEnabled();
|
||||
|
||||
case IDC_CONTENT_CONTEXT_DELETE:
|
||||
@@ -3932,6 +3936,10 @@ void RenderViewContextMenu::ExecuteComma
|
||||
source_web_contents_->PasteAndMatchStyle();
|
||||
break;
|
||||
|
||||
+ case IDC_CONTENT_CONTEXT_FORCE_PASTE:
|
||||
+ chrome::ForcePaste(source_web_contents_);
|
||||
+ break;
|
||||
+
|
||||
case IDC_CONTENT_CONTEXT_DELETE:
|
||||
source_web_contents_->Delete();
|
||||
break;
|
||||
--- a/chrome/browser/ui/browser_command_controller.cc
|
||||
+++ b/chrome/browser/ui/browser_command_controller.cc
|
||||
@@ -992,6 +992,9 @@ bool BrowserCommandController::ExecuteCo
|
||||
InvokeAction(actions::kActionPaste,
|
||||
browser_->GetActions()->root_action_item());
|
||||
break;
|
||||
+ case IDC_FORCE_PASTE:
|
||||
+ ForcePaste(browser_);
|
||||
+ break;
|
||||
|
||||
// Find-in-page
|
||||
case IDC_FIND:
|
||||
@@ -1667,6 +1670,7 @@ void BrowserCommandController::InitComma
|
||||
command_updater_.UpdateCommandEnabled(IDC_SHOW_AI_MODE_OMNIBOX_BUTTON, true);
|
||||
|
||||
// Window management commands
|
||||
+ command_updater_.UpdateCommandEnabled(IDC_FORCE_PASTE, true);
|
||||
command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true);
|
||||
command_updater_.UpdateCommandEnabled(
|
||||
IDC_NEW_TAB, !browser_->app_controller() ||
|
||||
--- a/chrome/browser/ui/browser_commands.cc
|
||||
+++ b/chrome/browser/ui/browser_commands.cc
|
||||
@@ -181,10 +181,12 @@
|
||||
#include "components/zoom/page_zoom.h"
|
||||
#include "components/zoom/zoom_controller.h"
|
||||
#include "content/public/browser/browsing_data_remover.h"
|
||||
+#include "content/public/browser/clipboard_types.h"
|
||||
#include "content/public/browser/devtools_agent_host.h"
|
||||
#include "content/public/browser/navigation_controller.h"
|
||||
#include "content/public/browser/navigation_entry.h"
|
||||
#include "content/public/browser/page_navigator.h"
|
||||
+#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
@@ -549,6 +551,19 @@ using content::WebContents;
|
||||
namespace chrome {
|
||||
namespace {
|
||||
|
||||
+void OnForcePasteTextRead(base::WeakPtr<content::WebContents> web_contents,
|
||||
+ content::GlobalRenderFrameHostId focused_frame_id,
|
||||
+ std::u16string text) {
|
||||
+ if (!web_contents || text.empty()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ content::RenderFrameHost* focused_frame = web_contents->GetFocusedFrame();
|
||||
+ if (focused_frame && focused_frame->GetGlobalId() == focused_frame_id) {
|
||||
+ web_contents->InsertText(text);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
const extensions::Extension* GetExtensionForBrowser(
|
||||
BrowserWindowInterface* browser) {
|
||||
@@ -2667,6 +2682,30 @@ bool CanCopyUrl(BrowserWindowInterface*
|
||||
!sharing_hub::SharingIsDisabledByPolicy(browser->GetProfile());
|
||||
}
|
||||
|
||||
+void ForcePaste(BrowserWindowInterface* browser) {
|
||||
+ if (!browser) {
|
||||
+ return;
|
||||
+ }
|
||||
+ ForcePaste(browser->GetTabStripModel()->GetActiveWebContents());
|
||||
+}
|
||||
+
|
||||
+void ForcePaste(content::WebContents* web_contents) {
|
||||
+ if (!web_contents) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ content::RenderFrameHost* focused_frame = web_contents->GetFocusedFrame();
|
||||
+ if (!focused_frame) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ ui::Clipboard::GetForCurrentThread()->ReadText(
|
||||
+ ui::ClipboardBuffer::kCopyPaste,
|
||||
+ content::CreateDataEndpoint(*focused_frame),
|
||||
+ base::BindOnce(&OnForcePasteTextRead, web_contents->GetWeakPtr(),
|
||||
+ focused_frame->GetGlobalId()));
|
||||
+}
|
||||
+
|
||||
bool IsWebAppOrCustomTab(const BrowserWindowInterface* browser) {
|
||||
return web_app::AppBrowserController::IsWebApp(browser);
|
||||
}
|
||||
--- a/chrome/browser/ui/browser_commands.h
|
||||
+++ b/chrome/browser/ui/browser_commands.h
|
||||
@@ -328,6 +328,8 @@ void CopyURL(BrowserWindowInterface* bro
|
||||
content::WebContents* web_contents);
|
||||
void CopyURLs(const std::vector<content::WebContents*>& web_contentses);
|
||||
bool CanCopyUrl(BrowserWindowInterface* browser);
|
||||
+void ForcePaste(BrowserWindowInterface* browser);
|
||||
+void ForcePaste(content::WebContents* web_contents);
|
||||
// Returns true if the browser window is for a web app or custom tab.
|
||||
bool IsWebAppOrCustomTab(const BrowserWindowInterface* browser);
|
||||
// Moves the WebContents of a hosted app Browser to a tabbed Browser. Returns
|
||||
--- a/chrome/browser/ui/browser_shortcuts/browser_shortcut_metadata.cc
|
||||
+++ b/chrome/browser/ui/browser_shortcuts/browser_shortcut_metadata.cc
|
||||
@@ -83,6 +83,8 @@ std::optional<BrowserShortcutCommandLabe
|
||||
return Label(IDS_SHORTCUT_COMMAND_BACK);
|
||||
case IDC_FORWARD:
|
||||
return Label(IDS_SHORTCUT_COMMAND_FORWARD);
|
||||
+ case IDC_FORCE_PASTE:
|
||||
+ return Label(IDS_FORCE_PASTE);
|
||||
case IDC_HOME:
|
||||
return Label(IDS_SHORTCUT_COMMAND_HOME);
|
||||
case IDC_RELOAD:
|
||||
@@ -250,6 +252,7 @@ std::vector<int> GetBrowserShortcutComma
|
||||
|
||||
commands.push_back(ShouldUseCopyPageUrlLabel(prefs) ? IDC_DEV_TOOLS_INSPECT
|
||||
: IDC_COPY_URL);
|
||||
+ commands.push_back(IDC_FORCE_PASTE);
|
||||
return commands;
|
||||
}
|
||||
|
||||
--- a/tools/metrics/histograms/metadata/ui/enums.xml
|
||||
+++ b/tools/metrics/histograms/metadata/ui/enums.xml
|
||||
@@ -367,6 +367,7 @@ chromium-metrics-reviews@google.com.
|
||||
<int value="164" label="IDC_CONTENT_CONTEXT_LISTEN_TO_THIS_PAGE"/>
|
||||
<int value="165" label="IDC_CONTENT_CONTEXT_DICTATION"/>
|
||||
<int value="166" label="IDC_CONTENT_CONTEXT_ADD_LINK_TO_READING_LIST"/>
|
||||
+ <int value="167" label="IDC_CONTENT_CONTEXT_FORCE_PASTE"/>
|
||||
</enum>
|
||||
|
||||
<!-- LINT.ThenChange(//chrome/browser/renderer_context_menu/render_view_context_menu.cc:RenderViewContextMenuItem) -->
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -6852,6 +6852,12 @@ void WebContentsImpl::Replace(const std:
|
||||
input_handler->Replace(word);
|
||||
}
|
||||
|
||||
+void WebContentsImpl::InsertText(const std::u16string& text) {
|
||||
+ OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::InsertText");
|
||||
+ last_interaction_time_ = ui::EventTimeForNow();
|
||||
+ ExecuteEditCommand("InsertText", text);
|
||||
+}
|
||||
+
|
||||
void WebContentsImpl::ReplaceMisspelling(const std::u16string& word) {
|
||||
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::ReplaceMisspelling");
|
||||
auto* input_handler = GetFocusedFrameWidgetInputHandler();
|
||||
--- a/content/browser/web_contents/web_contents_impl.h
|
||||
+++ b/content/browser/web_contents/web_contents_impl.h
|
||||
@@ -534,6 +534,7 @@ class CONTENT_EXPORT WebContentsImpl
|
||||
void ScrollToTopOfDocument() override;
|
||||
void ScrollToBottomOfDocument() override;
|
||||
void Replace(const std::u16string& word) override;
|
||||
+ void InsertText(const std::u16string& text) override;
|
||||
void ReplaceMisspelling(const std::u16string& word) override;
|
||||
void NotifyContextMenuClosed(
|
||||
const GURL& link_followed,
|
||||
--- a/content/public/browser/web_contents.h
|
||||
+++ b/content/public/browser/web_contents.h
|
||||
@@ -1154,6 +1154,9 @@ class WebContents : public PageNavigator
|
||||
// Replaces the currently selected word or a word around the cursor.
|
||||
virtual void Replace(const std::u16string& word) = 0;
|
||||
|
||||
+ // Inserts text at the cursor or replaces the current selection.
|
||||
+ virtual void InsertText(const std::u16string& text) = 0;
|
||||
+
|
||||
// Replaces the misspelling in the current selection.
|
||||
virtual void ReplaceMisspelling(const std::u16string& word) = 0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -11942,6 +11942,12 @@ Check your passwords anytime in <ph name
|
||||
@@ -11936,6 +11936,12 @@ Check your passwords anytime in <ph name
|
||||
<message name="IDS_TAB_CXMENU_DUPLICATE" desc="The label of the 'Duplicate' Tab context menu item.">
|
||||
Duplicate
|
||||
</message>
|
||||
@@ -13,7 +13,7 @@
|
||||
<message name="IDS_TAB_CXMENU_CLOSETAB" desc="The label of the tab context menu item for closing one or more tabs.">
|
||||
Close
|
||||
</message>
|
||||
@@ -12058,6 +12064,12 @@ Check your passwords anytime in <ph name
|
||||
@@ -12052,6 +12058,12 @@ Check your passwords anytime in <ph name
|
||||
<message name="IDS_TAB_CXMENU_DUPLICATE" desc="In Title Case: The label of the 'Duplicate' Tab context menu item.">
|
||||
Duplicate
|
||||
</message>
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAIPageContentIncludePopupWindows);
|
||||
--- /dev/null
|
||||
+++ b/content/browser/helium_noise/noise_token_data.cc
|
||||
@@ -0,0 +1,106 @@
|
||||
@@ -0,0 +1,112 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
@@ -93,19 +93,25 @@
|
||||
+
|
||||
+#include "content/browser/helium_noise/noise_token_data.h"
|
||||
+
|
||||
+#include <array>
|
||||
+#include <cstdint>
|
||||
+#include <memory>
|
||||
+#include <string>
|
||||
+#include <string_view>
|
||||
+
|
||||
+#include "base/containers/span.h"
|
||||
+#include "base/hash/hash.h"
|
||||
+#include "base/numerics/byte_conversions.h"
|
||||
+#include "base/rand_util.h"
|
||||
+#include "base/strings/strcat.h"
|
||||
+#include "base/strings/string_number_conversions.h"
|
||||
+#include "base/supports_user_data.h"
|
||||
+#include "base/types/pass_key.h"
|
||||
+#include "base/unguessable_token.h"
|
||||
+#include "content/public/browser/browser_context.h"
|
||||
+#include "crypto/hash.h"
|
||||
+#include "net/base/network_anonymization_key.h"
|
||||
+#include "net/base/schemeful_site.h"
|
||||
+#include "third_party/blink/public/common/features.h"
|
||||
+#include "url/origin.h"
|
||||
+#include "url/scheme_host_port.h"
|
||||
+
|
||||
+namespace content {
|
||||
+
|
||||
@@ -191,7 +197,7 @@
|
||||
+} // namespace content
|
||||
--- /dev/null
|
||||
+++ b/content/browser/helium_noise/noise_token_data.h
|
||||
@@ -0,0 +1,53 @@
|
||||
@@ -0,0 +1,50 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
@@ -203,19 +209,16 @@
|
||||
+#ifndef CONTENT_BROWSER_HELIUM_NOISE_NOISE_TOKEN_DATA_H_
|
||||
+#define CONTENT_BROWSER_HELIUM_NOISE_NOISE_TOKEN_DATA_H_
|
||||
+
|
||||
+#include "base/containers/flat_map.h"
|
||||
+#include "base/supports_user_data.h"
|
||||
+#include "content/common/content_export.h"
|
||||
+#include "third_party/blink/public/common/helium_noise/noise_token.h"
|
||||
+#include <cstdint>
|
||||
+
|
||||
+namespace url {
|
||||
+class Origin;
|
||||
+} // namespace url
|
||||
+#include "base/containers/flat_map.h"
|
||||
+#include "base/rand_util.h"
|
||||
+#include "content/public/browser/browser_context.h"
|
||||
+#include "third_party/blink/public/common/helium_noise/noise_token.h"
|
||||
+#include "url/origin.h"
|
||||
+
|
||||
+namespace content {
|
||||
+
|
||||
+class BrowserContext;
|
||||
+
|
||||
+// A user data class that generates and stores BrowserContext-associated noise
|
||||
+// tokens used for noising fingerprintable data.
|
||||
+class CONTENT_EXPORT HeliumNoiseTokenData
|
||||
@@ -308,7 +311,7 @@
|
||||
+} // namespace blink
|
||||
--- /dev/null
|
||||
+++ b/third_party/blink/renderer/core/helium_noise/helium_noise_hash.h
|
||||
@@ -0,0 +1,43 @@
|
||||
@@ -0,0 +1,44 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
@@ -323,6 +326,7 @@
|
||||
+#include <cstdint>
|
||||
+
|
||||
+#include "third_party/blink/renderer/core/core_export.h"
|
||||
+#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
|
||||
+
|
||||
+namespace blink {
|
||||
+
|
||||
@@ -467,7 +471,7 @@
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/third_party/blink/public/common/helium_noise/noise_token_mojom_traits.h
|
||||
@@ -0,0 +1,66 @@
|
||||
@@ -0,0 +1,63 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
@@ -479,11 +483,8 @@
|
||||
+#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_HELIUM_NOISE_NOISE_TOKEN_MOJOM_TRAITS_H_
|
||||
+#define THIRD_PARTY_BLINK_PUBLIC_COMMON_HELIUM_NOISE_NOISE_TOKEN_MOJOM_TRAITS_H_
|
||||
+
|
||||
+#include <cstdint>
|
||||
+
|
||||
+#include "base/notreached.h"
|
||||
+#include "mojo/public/cpp/bindings/enum_traits.h"
|
||||
+#include "mojo/public/cpp/bindings/struct_traits.h"
|
||||
+
|
||||
+#include "third_party/blink/public/common/common_export.h"
|
||||
+#include "third_party/blink/public/common/helium_noise/noise_token.h"
|
||||
+#include "third_party/blink/public/mojom/helium_noise/noise_token.mojom-shared.h"
|
||||
@@ -505,7 +506,7 @@
|
||||
+ }
|
||||
+
|
||||
+ static blink::HeliumNoiseFeature FromMojom(
|
||||
+ blink::mojom::HeliumNoiseFeature input) {
|
||||
+ blink::mojom::HeliumNoiseFeature input) {
|
||||
+ switch (input) {
|
||||
+ case blink::mojom::HeliumNoiseFeature::kCanvas:
|
||||
+ return blink::HeliumNoiseFeature::kCanvas;
|
||||
@@ -534,17 +535,6 @@
|
||||
+} // namespace mojo
|
||||
+
|
||||
+#endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_HELIUM_NOISE_NOISE_TOKEN_MOJOM_TRAITS_H_
|
||||
--- a/third_party/blink/public/common/BUILD.gn
|
||||
+++ b/third_party/blink/public/common/BUILD.gn
|
||||
@@ -161,6 +161,8 @@ source_set("headers") {
|
||||
"frame/user_activation_state.h",
|
||||
"frame/user_activation_update_source.h",
|
||||
"frame/view_transition_state.h",
|
||||
+ "helium_noise/noise_token.h",
|
||||
+ "helium_noise/noise_token_mojom_traits.h",
|
||||
"history/session_history_constants.h",
|
||||
"indexeddb/indexed_db_default_mojom_traits.h",
|
||||
"indexeddb/indexeddb_key.h",
|
||||
--- /dev/null
|
||||
+++ b/third_party/blink/public/mojom/helium_noise/BUILD.gn
|
||||
@@ -0,0 +1,40 @@
|
||||
@@ -590,14 +580,14 @@
|
||||
+}
|
||||
--- a/third_party/blink/public/mojom/BUILD.gn
|
||||
+++ b/third_party/blink/public/mojom/BUILD.gn
|
||||
@@ -326,6 +326,7 @@ mojom("mojom_platform") {
|
||||
@@ -325,6 +325,7 @@ mojom("mojom_platform") {
|
||||
"//skia/public/mojom",
|
||||
"//third_party/blink/public/mojom/content_extraction",
|
||||
"//third_party/blink/public/mojom/fingerprinting_protection",
|
||||
"//third_party/blink/public/mojom/gpu",
|
||||
+ "//third_party/blink/public/mojom/helium_noise",
|
||||
"//third_party/blink/public/mojom/gpu",
|
||||
"//third_party/blink/public/mojom/origin_trials:origin_trial_feature",
|
||||
"//third_party/blink/public/mojom/origin_trials:origin_trial_state",
|
||||
"//third_party/blink/public/mojom/quota",
|
||||
@@ -1400,6 +1401,7 @@ mojom("mojom_core") {
|
||||
"//services/viz/public/mojom",
|
||||
"//skia/public/mojom",
|
||||
@@ -990,7 +980,7 @@
|
||||
#include "content/browser/interest_group/ad_auction_headers_util.h"
|
||||
#include "content/browser/loader/browser_initiated_resource_request.h"
|
||||
#include "content/browser/loader/cached_navigation_url_loader.h"
|
||||
@@ -9428,6 +9429,22 @@ void NavigationRequest::ReadyToCommitNav
|
||||
@@ -9426,6 +9427,22 @@ void NavigationRequest::ReadyToCommitNav
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1015,15 +1005,7 @@
|
||||
}
|
||||
--- a/content/browser/renderer_host/navigation_request.h
|
||||
+++ b/content/browser/renderer_host/navigation_request.h
|
||||
@@ -80,6 +80,7 @@
|
||||
#include "services/network/public/mojom/shared_dictionary_access_observer.mojom.h"
|
||||
#include "services/network/public/mojom/trust_token_access_observer.mojom-shared.h"
|
||||
#include "services/network/public/mojom/web_sandbox_flags.mojom-shared.h"
|
||||
+#include "third_party/blink/public/common/helium_noise/noise_token.h"
|
||||
#include "third_party/blink/public/common/runtime_feature_state/runtime_feature_state_context.h"
|
||||
#include "third_party/blink/public/common/tokens/tokens.h"
|
||||
#include "third_party/blink/public/mojom/confidence_level.mojom.h"
|
||||
@@ -1529,6 +1530,16 @@ class CONTENT_EXPORT NavigationRequest
|
||||
@@ -1529,6 +1529,16 @@ class CONTENT_EXPORT NavigationRequest
|
||||
|
||||
bool is_ad_tagged() const { return is_ad_tagged_; }
|
||||
|
||||
@@ -1040,7 +1022,7 @@
|
||||
// Called when the browser process is about to process beforeunload handlers
|
||||
// for this navigation, including sending an IPC to the renderer process to
|
||||
// run beforeunload handlers when necessary.
|
||||
@@ -3612,6 +3623,10 @@ class CONTENT_EXPORT NavigationRequest
|
||||
@@ -3612,6 +3622,10 @@ class CONTENT_EXPORT NavigationRequest
|
||||
blink::mojom::ConfidenceLevel confidence_level_ =
|
||||
blink::mojom::ConfidenceLevel::kHigh;
|
||||
|
||||
@@ -1093,15 +1075,7 @@
|
||||
std::optional<SkColor> main_document_theme_color_;
|
||||
--- a/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
|
||||
@@ -284,6 +284,7 @@
|
||||
#include "third_party/blink/public/common/frame/fenced_frame_sandbox_flags.h"
|
||||
#include "third_party/blink/public/common/frame/frame_owner_element_type.h"
|
||||
#include "third_party/blink/public/common/frame/frame_policy.h"
|
||||
+#include "third_party/blink/public/common/helium_noise/noise_token.h"
|
||||
#include "third_party/blink/public/common/loader/inter_process_time_ticks_converter.h"
|
||||
#include "third_party/blink/public/common/loader/resource_type_util.h"
|
||||
#include "third_party/blink/public/common/messaging/transferable_message.h"
|
||||
@@ -12801,6 +12802,22 @@ void RenderFrameHostImpl::CommitNavigati
|
||||
@@ -12794,6 +12794,22 @@ void RenderFrameHostImpl::CommitNavigati
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1124,7 +1098,7 @@
|
||||
bool is_srcdoc = common_params->url.IsAboutSrcdoc();
|
||||
if (is_srcdoc) {
|
||||
// TODO(wjmaclean): initialize this in NavigationRequest's constructor
|
||||
@@ -16409,6 +16426,15 @@ bool RenderFrameHostImpl::DidCommitNavig
|
||||
@@ -16400,6 +16416,15 @@ bool RenderFrameHostImpl::DidCommitNavig
|
||||
document_associated_data_->owned_page()->set_last_main_document_source_id(
|
||||
ukm::ConvertToSourceId(navigation_request->GetNavigationId(),
|
||||
ukm::SourceIdType::NAVIGATION_ID));
|
||||
@@ -1142,15 +1116,7 @@
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
@@ -87,6 +87,7 @@
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "third_party/abseil-cpp/absl/container/flat_hash_map.h"
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
+#include "third_party/blink/public/common/helium_noise/noise_token.h"
|
||||
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
|
||||
#include "third_party/blink/public/mojom/page/prerender_page_param.mojom.h"
|
||||
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
|
||||
@@ -453,6 +454,17 @@ bool RenderViewHostImpl::CreateRenderVie
|
||||
@@ -453,6 +453,17 @@ bool RenderViewHostImpl::CreateRenderVie
|
||||
DCHECK_EQ(&frame_tree_node->frame_tree(), frame_tree_);
|
||||
params->navigation_metrics_token = navigation_metrics_token;
|
||||
|
||||
@@ -1182,15 +1148,7 @@
|
||||
web_view->SetWebPreferences(params->web_preferences);
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -60,6 +60,7 @@
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
|
||||
#include "third_party/blink/public/common/css/page_orientation.h"
|
||||
#include "third_party/blink/public/common/frame/frame_owner_element_type.h"
|
||||
+#include "third_party/blink/public/common/helium_noise/noise_token.h"
|
||||
#include "third_party/blink/public/common/tokens/tokens.h"
|
||||
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
|
||||
#include "third_party/blink/public/mojom/fenced_frame/fenced_frame.mojom.h"
|
||||
@@ -683,7 +684,8 @@ class HeaderAndFooterContext {
|
||||
@@ -683,7 +683,8 @@ class HeaderAndFooterContext {
|
||||
/*browsing_context_group_token=*/base::UnguessableToken::Create(),
|
||||
/*color_provider_colors=*/nullptr,
|
||||
/*history_index=*/-1,
|
||||
@@ -1200,7 +1158,7 @@
|
||||
view->GetSettings()->SetJavaScriptEnabled(true);
|
||||
return view;
|
||||
}
|
||||
@@ -976,7 +978,8 @@ void PrepareFrameAndViewForPrint::CopySe
|
||||
@@ -976,7 +977,8 @@ void PrepareFrameAndViewForPrint::CopySe
|
||||
/*browsing_context_group_token=*/base::UnguessableToken::Create(),
|
||||
/*color_provider_colors=*/nullptr,
|
||||
/*history_index=*/-1,
|
||||
@@ -1212,15 +1170,7 @@
|
||||
web_view, this, nullptr, mojo::NullRemote(), blink::LocalFrameToken(),
|
||||
--- a/components/plugins/renderer/webview_plugin.cc
|
||||
+++ b/components/plugins/renderer/webview_plugin.cc
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "gin/converter.h"
|
||||
#include "mojo/public/cpp/bindings/pending_remote.h"
|
||||
#include "skia/ext/platform_canvas.h"
|
||||
+#include "third_party/blink/public/common/helium_noise/noise_token.h"
|
||||
#include "third_party/blink/public/common/input/web_coalesced_input_event.h"
|
||||
#include "third_party/blink/public/common/page/page_zoom.h"
|
||||
#include "third_party/blink/public/common/tokens/tokens.h"
|
||||
@@ -279,7 +280,8 @@ WebViewPlugin::WebViewHelper::WebViewHel
|
||||
@@ -279,7 +279,8 @@ WebViewPlugin::WebViewHelper::WebViewHel
|
||||
/*browsing_context_group_token=*/base::UnguessableToken(),
|
||||
/*color_provider_colors=*/nullptr,
|
||||
/*history_index=*/-1,
|
||||
@@ -1230,302 +1180,3 @@
|
||||
// ApplyWebPreferences before making a WebLocalFrame so that the frame sees a
|
||||
// consistent view of our preferences.
|
||||
blink::WebView::ApplyWebPreferences(parent_web_preferences, web_view_);
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -3275,6 +3275,9 @@ inline constexpr char kSharedWorkerExten
|
||||
inline constexpr char kImportDialogExtensions[] =
|
||||
"import_dialog_extensions";
|
||||
|
||||
+// Whether Helium Noise is enabled globally.
|
||||
+inline constexpr char kHeliumNoiseEnabled[] = "helium.noise.enabled";
|
||||
+
|
||||
// Boolean indicating whether clearing window.name when the navigation is
|
||||
// top-level, cross-site and swaps BrowsingContextGroup is allowed or not.
|
||||
inline constexpr char kClearWindowNameForNewBrowsingContextGroup[] =
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -333,6 +333,10 @@ source_set("chrome_content_browser_clien
|
||||
]
|
||||
}
|
||||
|
||||
+source_set("helium_noise_settings_headers") {
|
||||
+ public = [ "helium_noise/helium_noise_settings.h" ]
|
||||
+}
|
||||
+
|
||||
source_set("command_updater_impl") {
|
||||
public = [
|
||||
"command_observer.h",
|
||||
@@ -635,6 +639,8 @@ source_set("core") {
|
||||
"font_family_cache.cc",
|
||||
"font_family_cache.h",
|
||||
"global_features.cc",
|
||||
+ "helium_noise/helium_noise_settings.cc",
|
||||
+ "helium_noise/helium_noise_settings.h",
|
||||
"icon_manager.cc",
|
||||
"memory_details.cc",
|
||||
"net_benchmarking.cc",
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/helium_noise/helium_noise_settings.cc
|
||||
@@ -0,0 +1,117 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+#include "chrome/browser/helium_noise/helium_noise_settings.h"
|
||||
+
|
||||
+#include "base/feature_list.h"
|
||||
+#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
||||
+#include "chrome/browser/profiles/profile.h"
|
||||
+#include "chrome/common/pref_names.h"
|
||||
+#include "components/content_settings/core/browser/host_content_settings_map.h"
|
||||
+#include "components/content_settings/core/common/content_settings.h"
|
||||
+#include "components/content_settings/core/common/content_settings_types.h"
|
||||
+#include "components/prefs/pref_service.h"
|
||||
+#include "third_party/blink/public/common/features.h"
|
||||
+#include "url/gurl.h"
|
||||
+#include "url/origin.h"
|
||||
+
|
||||
+namespace helium_noise {
|
||||
+
|
||||
+namespace {
|
||||
+
|
||||
+Profile* GetProfile(content::BrowserContext* browser_context) {
|
||||
+ if (!browser_context) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+ return Profile::FromBrowserContext(browser_context);
|
||||
+}
|
||||
+
|
||||
+GURL GetOriginUrl(const GURL& url) {
|
||||
+ return url::Origin::Create(url).GetURL();
|
||||
+}
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
+HeliumNoiseState GetHeliumNoiseState(
|
||||
+ content::BrowserContext* browser_context,
|
||||
+ const GURL& url) {
|
||||
+ if (!base::FeatureList::IsEnabled(blink::features::kHeliumNoise)) {
|
||||
+ return HeliumNoiseState::kUnavailable;
|
||||
+ }
|
||||
+
|
||||
+ Profile* profile = GetProfile(browser_context);
|
||||
+ if (!profile) {
|
||||
+ return HeliumNoiseState::kUnavailable;
|
||||
+ }
|
||||
+
|
||||
+ if (!profile->GetPrefs()->GetBoolean(prefs::kHeliumNoiseEnabled)) {
|
||||
+ return HeliumNoiseState::kGloballyDisabled;
|
||||
+ }
|
||||
+
|
||||
+ if (!CanSetHeliumNoiseForOrigin(url)) {
|
||||
+ return HeliumNoiseState::kEnabled;
|
||||
+ }
|
||||
+
|
||||
+ HostContentSettingsMap* settings_map =
|
||||
+ HostContentSettingsMapFactory::GetForProfile(profile);
|
||||
+ if (!settings_map) {
|
||||
+ return HeliumNoiseState::kEnabled;
|
||||
+ }
|
||||
+
|
||||
+ const ContentSetting noise_setting = settings_map->GetContentSetting(
|
||||
+ url, GURL(), ContentSettingsType::HELIUM_NOISE);
|
||||
+ if (noise_setting == CONTENT_SETTING_BLOCK) {
|
||||
+ return HeliumNoiseState::kDisabledForSite;
|
||||
+ }
|
||||
+
|
||||
+ return HeliumNoiseState::kEnabled;
|
||||
+}
|
||||
+
|
||||
+bool IsHeliumNoiseEnabled(content::BrowserContext* browser_context,
|
||||
+ const GURL& url) {
|
||||
+ return GetHeliumNoiseState(browser_context, url) ==
|
||||
+ HeliumNoiseState::kEnabled;
|
||||
+}
|
||||
+
|
||||
+bool CanSetHeliumNoiseForOrigin(const GURL& url) {
|
||||
+ return url.is_valid() && url.SchemeIsHTTPOrHTTPS() &&
|
||||
+ !url::Origin::Create(url).opaque();
|
||||
+}
|
||||
+
|
||||
+void SetHeliumNoiseEnabledForOrigin(content::BrowserContext* browser_context,
|
||||
+ const GURL& url,
|
||||
+ bool enabled) {
|
||||
+ Profile* profile = GetProfile(browser_context);
|
||||
+ if (!profile || !CanSetHeliumNoiseForOrigin(url)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ HostContentSettingsMap* settings_map =
|
||||
+ HostContentSettingsMapFactory::GetForProfile(profile);
|
||||
+ if (!settings_map) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (!enabled) {
|
||||
+ settings_map->SetNarrowestContentSetting(
|
||||
+ url, GURL(), ContentSettingsType::HELIUM_NOISE,
|
||||
+ CONTENT_SETTING_BLOCK);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ settings_map->SetNarrowestContentSetting(
|
||||
+ url, GURL(), ContentSettingsType::HELIUM_NOISE,
|
||||
+ CONTENT_SETTING_DEFAULT);
|
||||
+
|
||||
+ // If a broader exception still applies, override it for this origin only.
|
||||
+ const ContentSetting noise_setting = settings_map->GetContentSetting(
|
||||
+ url, GURL(), ContentSettingsType::HELIUM_NOISE);
|
||||
+ if (noise_setting == CONTENT_SETTING_BLOCK) {
|
||||
+ settings_map->SetNarrowestContentSetting(
|
||||
+ url, GURL(), ContentSettingsType::HELIUM_NOISE,
|
||||
+ CONTENT_SETTING_ALLOW);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+} // namespace helium_noise
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/helium_noise/helium_noise_settings.h
|
||||
@@ -0,0 +1,38 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+#ifndef CHROME_BROWSER_HELIUM_NOISE_HELIUM_NOISE_SETTINGS_H_
|
||||
+#define CHROME_BROWSER_HELIUM_NOISE_HELIUM_NOISE_SETTINGS_H_
|
||||
+
|
||||
+class GURL;
|
||||
+
|
||||
+namespace content {
|
||||
+class BrowserContext;
|
||||
+}
|
||||
+
|
||||
+namespace helium_noise {
|
||||
+
|
||||
+enum class HeliumNoiseState {
|
||||
+ kUnavailable,
|
||||
+ kGloballyDisabled,
|
||||
+ kDisabledForSite,
|
||||
+ kEnabled,
|
||||
+};
|
||||
+
|
||||
+HeliumNoiseState GetHeliumNoiseState(
|
||||
+ content::BrowserContext* browser_context,
|
||||
+ const GURL& url);
|
||||
+
|
||||
+bool IsHeliumNoiseEnabled(content::BrowserContext* browser_context,
|
||||
+ const GURL& url);
|
||||
+
|
||||
+bool CanSetHeliumNoiseForOrigin(const GURL& url);
|
||||
+
|
||||
+void SetHeliumNoiseEnabledForOrigin(content::BrowserContext* browser_context,
|
||||
+ const GURL& url,
|
||||
+ bool enabled);
|
||||
+
|
||||
+} // namespace helium_noise
|
||||
+
|
||||
+#endif // CHROME_BROWSER_HELIUM_NOISE_HELIUM_NOISE_SETTINGS_H_
|
||||
--- a/chrome/browser/chrome_content_browser_client.cc
|
||||
+++ b/chrome/browser/chrome_content_browser_client.cc
|
||||
@@ -94,6 +94,7 @@
|
||||
#include "chrome/browser/favicon/favicon_utils.h"
|
||||
#include "chrome/browser/font_family_cache.h"
|
||||
#include "chrome/browser/headless/headless_mode_util.h"
|
||||
+#include "chrome/browser/helium_noise/helium_noise_settings.h"
|
||||
#include "chrome/browser/hid/chrome_hid_delegate.h"
|
||||
#include "chrome/browser/history/history_service_factory.h"
|
||||
#include "chrome/browser/interstitials/enterprise_util.h"
|
||||
@@ -1548,6 +1549,7 @@ void ChromeContentBrowserClient::Registe
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(prefs::kDisable3DAPIs, false);
|
||||
registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, false);
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumNoiseEnabled, true);
|
||||
// Register user prefs for mapping SitePerProcess and IsolateOrigins in
|
||||
// user policy in addition to the same named ones in Local State (which are
|
||||
// used for mapping the command-line flags).
|
||||
@@ -9420,6 +9422,12 @@ ChromeContentBrowserClient::GetClipboard
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
+bool ChromeContentBrowserClient::HeliumNoiseEnabled(
|
||||
+ content::BrowserContext* browser_context,
|
||||
+ const GURL& origin) {
|
||||
+ return helium_noise::IsHeliumNoiseEnabled(browser_context, origin);
|
||||
+}
|
||||
+
|
||||
bool ChromeContentBrowserClient::UsePrefetchPrerenderIntegration() {
|
||||
return base::FeatureList::IsEnabled(features::kBookmarkTriggerForPrefetch) ||
|
||||
base::FeatureList::IsEnabled(
|
||||
--- a/chrome/browser/chrome_content_browser_client.h
|
||||
+++ b/chrome/browser/chrome_content_browser_client.h
|
||||
@@ -1217,6 +1217,9 @@ class ChromeContentBrowserClient : publi
|
||||
std::optional<std::vector<std::u16string>> GetClipboardTypesIfPolicyApplied(
|
||||
const ui::ClipboardSequenceNumberToken& seqno) override;
|
||||
|
||||
+ bool HeliumNoiseEnabled(content::BrowserContext* browser_context,
|
||||
+ const GURL& origin) override;
|
||||
+
|
||||
bool UsePrefetchPrerenderIntegration() override;
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
--- a/components/content_settings/core/common/content_settings_types.mojom
|
||||
+++ b/components/content_settings/core/common/content_settings_types.mojom
|
||||
@@ -487,5 +487,8 @@ enum ContentSettingsType {
|
||||
// - ALLOW: Skip the prompt and allow adding sub apps.
|
||||
// - BLOCK: Skip the prompt and block adding sub apps.
|
||||
SUB_APPS_WITHOUT_PROMPTS,
|
||||
+
|
||||
+ // Whether Helium Noise is enabled for a top-level origin.
|
||||
+ HELIUM_NOISE,
|
||||
};
|
||||
// LINT.ThenChange(//components/content_settings/core/browser/content_settings_uma_util.cc:kHistogramValue)
|
||||
--- a/components/content_settings/core/browser/content_settings_registry.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_registry.cc
|
||||
@@ -843,6 +843,17 @@ void ContentSettingsRegistry::Init() {
|
||||
WebsiteSettingsRegistry::DESKTOP,
|
||||
ContentSettingsInfo::DONT_INHERIT_IN_INCOGNITO,
|
||||
PermissionSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY);
|
||||
+
|
||||
+ Register(ContentSettingsType::HELIUM_NOISE, "helium-noise",
|
||||
+ CONTENT_SETTING_ALLOW, WebsiteSettingsInfo::UNSYNCABLE,
|
||||
+ /*allowlisted_primary_schemes=*/{},
|
||||
+ /*valid_settings=*/
|
||||
+ {CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK},
|
||||
+ WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE,
|
||||
+ WebsiteSettingsRegistry::DESKTOP |
|
||||
+ WebsiteSettingsRegistry::PLATFORM_ANDROID,
|
||||
+ ContentSettingsInfo::DONT_INHERIT_IN_INCOGNITO,
|
||||
+ PermissionSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS);
|
||||
}
|
||||
|
||||
void ContentSettingsRegistry::Register(
|
||||
--- a/chrome/browser/ui/webui/settings/site_settings_helper.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/site_settings_helper.cc
|
||||
@@ -260,6 +260,7 @@ constexpr auto kContentSettingsTypeGroup
|
||||
{ContentSettingsType::SUSPICIOUS_NOTIFICATION_SHOW_ORIGINAL, nullptr},
|
||||
{ContentSettingsType::LOCAL_NETWORK_ACCESS, nullptr},
|
||||
{ContentSettingsType::SUB_APPS_WITHOUT_PROMPTS, nullptr},
|
||||
+ {ContentSettingsType::HELIUM_NOISE, nullptr},
|
||||
});
|
||||
|
||||
static_assert(
|
||||
--- a/components/content_settings/core/browser/content_settings_uma_util.cc
|
||||
+++ b/components/content_settings/core/browser/content_settings_uma_util.cc
|
||||
@@ -166,6 +166,7 @@ constexpr auto kHistogramValue = base::M
|
||||
{ContentSettingsType::LOCAL_NETWORK, 143},
|
||||
{ContentSettingsType::LOOPBACK_NETWORK, 144},
|
||||
{ContentSettingsType::SUB_APPS_WITHOUT_PROMPTS, 145},
|
||||
+ {ContentSettingsType::HELIUM_NOISE, 146},
|
||||
|
||||
// As mentioned at the top, please don't forget to update ContentType in
|
||||
// enums.xml when you add entries here!
|
||||
--- a/tools/metrics/histograms/enums.xml
|
||||
+++ b/tools/metrics/histograms/enums.xml
|
||||
@@ -2496,6 +2496,7 @@ Called by update_net_error_codes.py.-->
|
||||
<int value="143" label="Local network access - Local"/>
|
||||
<int value="144" label="Local network access - Loopback"/>
|
||||
<int value="145" label="Add Sub Apps without prompts"/>
|
||||
+ <int value="146" label="Helium Noise"/>
|
||||
</enum>
|
||||
|
||||
<!-- LINT.ThenChange(//components/content_settings/core/browser/content_settings_uma_util.cc:kHistogramValue) -->
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#endif /* CHROME_BROWSER_HELIUM_FLAG_ENTRIES_H_ */
|
||||
--- a/content/browser/helium_noise/noise_token_data.cc
|
||||
+++ b/content/browser/helium_noise/noise_token_data.cc
|
||||
@@ -59,6 +59,8 @@ HeliumNoiseTokenData::HeliumNoiseTokenDa
|
||||
@@ -65,6 +65,8 @@ HeliumNoiseTokenData::HeliumNoiseTokenDa
|
||||
blink::HeliumNoiseToken(base::RandUint64());
|
||||
session_tokens_[blink::HeliumNoiseFeature::kAudio] =
|
||||
blink::HeliumNoiseToken(base::RandUint64());
|
||||
@@ -148,7 +148,7 @@
|
||||
ExecutionContext* NavigatorBase::GetUAExecutionContext() const {
|
||||
--- a/third_party/blink/public/common/helium_noise/noise_token_mojom_traits.h
|
||||
+++ b/third_party/blink/public/common/helium_noise/noise_token_mojom_traits.h
|
||||
@@ -30,6 +30,8 @@ struct BLINK_COMMON_EXPORT
|
||||
@@ -27,6 +27,8 @@ struct BLINK_COMMON_EXPORT
|
||||
return blink::mojom::HeliumNoiseFeature::kCanvas;
|
||||
case blink::HeliumNoiseFeature::kAudio:
|
||||
return blink::mojom::HeliumNoiseFeature::kAudio;
|
||||
@@ -157,7 +157,7 @@
|
||||
}
|
||||
NOTREACHED();
|
||||
}
|
||||
@@ -41,6 +43,8 @@ struct BLINK_COMMON_EXPORT
|
||||
@@ -38,6 +40,8 @@ struct BLINK_COMMON_EXPORT
|
||||
return blink::HeliumNoiseFeature::kCanvas;
|
||||
case blink::mojom::HeliumNoiseFeature::kAudio:
|
||||
return blink::HeliumNoiseFeature::kAudio;
|
||||
|
||||
@@ -608,7 +608,7 @@
|
||||
+#endif // CHROME_BROWSER_UI_WEBUI_ONBOARDING_ONBOARDING_HANDLER_H_
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -53,12 +53,14 @@ GURL GetDummyURL() {
|
||||
@@ -53,7 +53,8 @@ GURL GetDummyURL() {
|
||||
}
|
||||
|
||||
bool ShouldAccessServices(const PrefService& prefs) {
|
||||
@@ -617,13 +617,15 @@
|
||||
+ prefs.GetBoolean(prefs::kHeliumServicesConsented);
|
||||
}
|
||||
|
||||
void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
GURL GetConnectivityCheckURL(const PrefService& prefs) {
|
||||
@@ -71,6 +72,7 @@ GURL GetConnectivityCheckURL(const PrefS
|
||||
void ConfigurePrefChangeRegistrarForServices(
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
+ registrar.Add(prefs::kHeliumServicesConsented, observer);
|
||||
registrar.Add(prefs::kHeliumServicesOrigin, observer);
|
||||
registrar.Add(prefs::kHeliumSchemaVersion, observer);
|
||||
registrar.Add(pref_name, observer);
|
||||
}
|
||||
--- a/chrome/browser/ui/incognito_allowed_url.cc
|
||||
+++ b/chrome/browser/ui/incognito_allowed_url.cc
|
||||
@@ -52,7 +52,8 @@ bool IsHostAllowedInIncognito(const GURL
|
||||
|
||||
@@ -257,8 +257,8 @@
|
||||
#include "components/helium_services/pref_names.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "net/base/url_util.h"
|
||||
@@ -57,6 +58,28 @@ bool ShouldAccessServices(const PrefServ
|
||||
prefs.GetBoolean(prefs::kHeliumServicesConsented);
|
||||
@@ -77,6 +78,28 @@ void ConfigurePrefChangeRegistrarForServ
|
||||
registrar.Add(prefs::kHeliumSchemaVersion, observer);
|
||||
}
|
||||
|
||||
+bool ShouldAccessExtensionService(const PrefService& prefs) {
|
||||
@@ -285,21 +285,21 @@
|
||||
+
|
||||
void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
ConfigurePrefChangeRegistrarForServices(registrar, observer);
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -20,8 +20,11 @@ const char kHeliumDummyOrigin[] =
|
||||
|
||||
bool ShouldAccessServices(const PrefService& prefs);
|
||||
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetExtensionUpdateURL(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
|
||||
COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
@@ -28,6 +28,11 @@ COMPONENT_EXPORT(HELIUM) void ConfigureP
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
+
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetExtensionUpdateURL(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
|
||||
+
|
||||
} // namespace helium
|
||||
|
||||
#endif // COMPONENTS_HELIUM_SERVICES_HELIUM_SERVICES_HELPERS_H_
|
||||
--- a/chrome/browser/extensions/BUILD.gn
|
||||
+++ b/chrome/browser/extensions/BUILD.gn
|
||||
@@ -581,6 +581,7 @@ source_set("extensions") {
|
||||
@@ -399,7 +399,7 @@
|
||||
}
|
||||
|
||||
void ExtensionUpdater::Stop() {
|
||||
@@ -554,7 +563,7 @@ void ExtensionUpdater::CheckNow(CheckPar
|
||||
@@ -550,7 +559,7 @@ void ExtensionUpdater::CheckNow(CheckPar
|
||||
// OnExtensionDownloadFinished for each extension that was checked.
|
||||
downloader_->StartAllPending(extension_cache_);
|
||||
|
||||
@@ -408,7 +408,7 @@
|
||||
update_service_->StartUpdateCheck(
|
||||
update_check_params, params.update_found_callback,
|
||||
base::BindOnce(&ExtensionUpdater::OnUpdateServiceFinished,
|
||||
@@ -777,8 +786,8 @@ void ExtensionUpdater::CleanUpCrxFileIfN
|
||||
@@ -773,8 +782,8 @@ void ExtensionUpdater::CleanUpCrxFileIfN
|
||||
bool ExtensionUpdater::CanUseUpdateService(
|
||||
const Extension* extension,
|
||||
const PendingExtensionInfo* info) const {
|
||||
@@ -418,7 +418,7 @@
|
||||
+ return false;
|
||||
}
|
||||
|
||||
// UpdateService can only update extensions that have been installed on the
|
||||
// UpdateService can only update extensions from the store. If `update_url`
|
||||
--- a/extensions/browser/webstore_installer.cc
|
||||
+++ b/extensions/browser/webstore_installer.cc
|
||||
@@ -28,8 +28,10 @@
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -63,6 +63,11 @@ bool ShouldAccessExtensionService(const
|
||||
@@ -83,6 +83,11 @@ bool ShouldAccessExtensionService(const
|
||||
prefs.GetBoolean(prefs::kHeliumExtProxyEnabled);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
bool ShouldFetchBangs(const PrefService& prefs) {
|
||||
return ShouldAccessServices(prefs) &&
|
||||
prefs.GetBoolean(prefs::kHeliumBangsEnabled);
|
||||
@@ -85,6 +90,14 @@ GURL GetWebstoreSnippetURL(const PrefSer
|
||||
@@ -105,6 +110,14 @@ GURL GetWebstoreSnippetURL(const PrefSer
|
||||
base::StringPrintf("/ext/cws_snippet?id=%s", id));
|
||||
}
|
||||
|
||||
@@ -71,17 +71,17 @@
|
||||
+
|
||||
void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
ConfigurePrefChangeRegistrarForServices(registrar, observer);
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -26,6 +26,7 @@ COMPONENT_EXPORT(HELIUM) GURL GetService
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
@@ -33,6 +33,7 @@ COMPONENT_EXPORT(HELIUM) bool ShouldFetc
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetExtensionUpdateURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetSpellcheckURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
|
||||
} // namespace helium
|
||||
|
||||
--- a/components/helium_services/pref_names.h
|
||||
+++ b/components/helium_services/pref_names.h
|
||||
@@ -33,6 +33,9 @@ inline constexpr char kHeliumExtProxyEna
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/third_party/search_engines_data/resources/definitions/prepopulated_engines.json
|
||||
+++ b/third_party/search_engines_data/resources/definitions/prepopulated_engines.json
|
||||
@@ -199,6 +199,8 @@
|
||||
@@ -197,6 +197,8 @@
|
||||
"keyword": "kagi.com",
|
||||
"search_url": "https://kagi.com/search?q={searchTerms}",
|
||||
"suggest_url": "https://kagisuggest.com/api/autosuggest?q={searchTerms}",
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
"base_builtin_resource_id": "SEARCH_ENGINE_GOOGLE",
|
||||
"search_url": "https://www.google.com/search?q={searchTerms}",
|
||||
"suggest_url": "https://www.google.com/complete/search?client=chrome&q={searchTerms}",
|
||||
@@ -200,7 +200,7 @@
|
||||
@@ -198,7 +198,7 @@
|
||||
"search_url": "https://kagi.com/search?q={searchTerms}",
|
||||
"suggest_url": "https://kagisuggest.com/api/autosuggest?q={searchTerms}",
|
||||
"new_tab_url": "https://kagi.com/",
|
||||
@@ -45,7 +45,7 @@
|
||||
"base_builtin_resource_id": "SEARCH_ENGINE_KAGI",
|
||||
"type": "SEARCH_ENGINE_KAGI",
|
||||
"id": 115
|
||||
@@ -342,7 +342,7 @@
|
||||
@@ -340,7 +340,7 @@
|
||||
"qwant": {
|
||||
"name": "Qwant",
|
||||
"keyword": "qwant.com",
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
namespace {
|
||||
|
||||
const bool kEnableBuiltinSearchProviderAssets =
|
||||
@@ -2016,18 +2012,6 @@ std::string TemplateURL::GetBuiltinDescr
|
||||
@@ -2013,18 +2009,6 @@ std::string TemplateURL::GetBuiltinDescr
|
||||
}
|
||||
|
||||
std::optional<std::u16string> TemplateURL::GetBuiltinMarketingSnippet() const {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/third_party/search_engines_data/resources/definitions/prepopulated_engines.json
|
||||
+++ b/third_party/search_engines_data/resources/definitions/prepopulated_engines.json
|
||||
@@ -171,31 +171,16 @@
|
||||
@@ -171,31 +171,14 @@
|
||||
"id": 114
|
||||
},
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
- "send_x_geo_header": true,
|
||||
+ "search_url": "https://www.google.com/search?q={searchTerms}",
|
||||
+ "suggest_url": "https://www.google.com/complete/search?client=chrome&q={searchTerms}",
|
||||
+ "image_url": "https://www.google.com/searchbyimage/upload",
|
||||
+ "image_url_post_params": "encoded_image={google:imageThumbnail}",
|
||||
+ "type": "SEARCH_ENGINE_OTHER",
|
||||
"id": 1
|
||||
},
|
||||
|
||||
@@ -471,7 +471,7 @@
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -0,0 +1,67 @@
|
||||
@@ -0,0 +1,72 @@
|
||||
+// Copyright 2025 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
@@ -530,18 +530,23 @@
|
||||
+ return prefs.GetBoolean(prefs::kHeliumServicesEnabled);
|
||||
+}
|
||||
+
|
||||
+void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
+void ConfigurePrefChangeRegistrarForServices(
|
||||
+ PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
+ registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
+ registrar.Add(prefs::kHeliumServicesOrigin, observer);
|
||||
+ registrar.Add(prefs::kHeliumSchemaVersion, observer);
|
||||
+}
|
||||
+
|
||||
+void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
+ PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
+ ConfigurePrefChangeRegistrarForServices(registrar, observer);
|
||||
+ registrar.Add(pref_name, observer);
|
||||
+}
|
||||
+
|
||||
+} // namespace helium
|
||||
--- /dev/null
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -0,0 +1,30 @@
|
||||
@@ -0,0 +1,32 @@
|
||||
+// Copyright 2025 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
@@ -567,6 +572,8 @@
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
+COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
+COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarForServices(
|
||||
+ PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
+COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
+ PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
+} // namespace helium
|
||||
@@ -683,7 +690,7 @@
|
||||
+#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SERVICES_SCHEMA_HANDLER_H_
|
||||
--- /dev/null
|
||||
+++ b/components/helium_services/schema.cc
|
||||
@@ -0,0 +1,40 @@
|
||||
@@ -0,0 +1,46 @@
|
||||
+// Copyright 2025 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
@@ -717,7 +724,13 @@
|
||||
+ 1,
|
||||
+ "Automatic component updates are now available. They're managed by the same toggle that enables automatic browser updates.\n"
|
||||
+ "From now on, you'll be notified about major changes to Helium services. Even though these notifications are extremely rare, you can choose to ignore them and accept all future changes automatically."
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ 2,
|
||||
+ "Helium now checks whether the browser is behind a captive portal by sending an empty connectivity request "
|
||||
+ "to the configured Helium services origin when captive portal detection runs.\nThis is tied to the main "
|
||||
+ "Helium Services connection setting."
|
||||
+ },
|
||||
+ });
|
||||
+
|
||||
+ return kHeliumSchemaChangelog;
|
||||
@@ -740,7 +753,7 @@
|
||||
+
|
||||
+namespace helium {
|
||||
+
|
||||
+inline constexpr int kHeliumCurrentSchemaVersion = 1;
|
||||
+inline constexpr int kHeliumCurrentSchemaVersion = 2;
|
||||
+
|
||||
+using ServicesChangelog = const base::
|
||||
+ fixed_flat_map<int, std::string_view, kHeliumCurrentSchemaVersion>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/app/chromium_strings.grd
|
||||
+++ b/chrome/app/chromium_strings.grd
|
||||
@@ -1062,6 +1062,10 @@ Chromium is unable to recover your setti
|
||||
@@ -1056,6 +1056,10 @@ Chromium is unable to recover your setti
|
||||
Customize and control Chromium. Update is available.
|
||||
</message>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<message name="IDS_APPMENU_TOOLTIP_ALERT" desc="The tooltip to show for the browser menu when a non-update alert is displayed">
|
||||
Customize and control Chromium. Something needs your attention - click for details.
|
||||
</message>
|
||||
@@ -1794,6 +1798,11 @@ Chromium is unable to recover your setti
|
||||
@@ -1788,6 +1792,11 @@ Chromium is unable to recover your setti
|
||||
Chromium couldn't update to the latest version, so you're missing out on new features and security fixes.
|
||||
</message>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
Update Chromium
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -13363,6 +13363,9 @@ Check your passwords anytime in <ph name
|
||||
@@ -13357,6 +13357,9 @@ Check your passwords anytime in <ph name
|
||||
<message name="IDS_APP_MENU_BUTTON_UPDATE" desc="Short label next to app-menu button when an update is available.">
|
||||
Update
|
||||
</message>
|
||||
|
||||
@@ -1,254 +0,0 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -664,6 +664,11 @@ inline constexpr char kNewTabNextToActiv
|
||||
// when cycling through tabs with Ctrl+Tab.
|
||||
inline constexpr char kTabCyclingMRU[] = "helium.browser.mru_tab_cycling";
|
||||
|
||||
+// A boolean pref set to true if Shift+right-click should bypass page context
|
||||
+// menu handlers and show the browser context menu.
|
||||
+inline constexpr char kShiftRightClickContextMenu[] =
|
||||
+ "helium.browser.shift_right_click_context_menu";
|
||||
+
|
||||
// A boolean pref set to true if a Home button to open the Home pages should be
|
||||
// visible on the toolbar.
|
||||
inline constexpr char kShowHomeButton[] = "browser.show_home_button";
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -123,6 +123,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
|
||||
registry->RegisterBooleanPref(prefs::kTabCyclingMRU, false);
|
||||
|
||||
+ registry->RegisterBooleanPref(prefs::kShiftRightClickContextMenu, true);
|
||||
+
|
||||
registry->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, true,
|
||||
pref_registration_flags);
|
||||
registry->RegisterBooleanPref(prefs::kShowHomeButton, false,
|
||||
--- a/third_party/blink/renderer/core/frame/settings.json5
|
||||
+++ b/third_party/blink/renderer/core/frame/settings.json5
|
||||
@@ -806,6 +806,11 @@
|
||||
initial: false,
|
||||
},
|
||||
|
||||
+ {
|
||||
+ name: "shiftRightClickContextMenuEnabled",
|
||||
+ initial: true,
|
||||
+ },
|
||||
+
|
||||
// If true, context menu will be shown on any long press event.
|
||||
// Used on Android to prevent a context menu from being shown in certain situations
|
||||
// (i.e. long pressing an empty div)
|
||||
--- a/third_party/blink/renderer/core/input/event_handler.cc
|
||||
+++ b/third_party/blink/renderer/core/input/event_handler.cc
|
||||
@@ -87,6 +87,7 @@
|
||||
#include "third_party/blink/renderer/core/loader/resource/image_resource_content.h"
|
||||
#include "third_party/blink/renderer/core/page/autoscroll_controller.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/drag_state.h"
|
||||
#include "third_party/blink/renderer/core/page/frame_tree.h"
|
||||
#include "third_party/blink/renderer/core/page/page.h"
|
||||
@@ -2163,6 +2164,17 @@ WebInputEventResult EventHandler::SendCo
|
||||
// |SelectionController::sendContextMenuEvent()|.
|
||||
document.UpdateStyleAndLayout(DocumentUpdateReason::kContextMenu);
|
||||
|
||||
+ if (frame_->GetSettings()->GetShiftRightClickContextMenuEnabled() &&
|
||||
+ event.button == WebPointerProperties::Button::kRight &&
|
||||
+ (event.GetModifiers() & WebInputEvent::Modifiers::kShiftKey)) {
|
||||
+ Page* page = document.GetPage();
|
||||
+ if (page && page->GetContextMenuController().ShowContextMenuForUserInput(
|
||||
+ frame_, position_in_contents, event.GetMenuSourceType())) {
|
||||
+ return WebInputEventResult::kHandledSystem;
|
||||
+ }
|
||||
+ return WebInputEventResult::kNotHandled;
|
||||
+ }
|
||||
+
|
||||
Element* target_element = override_target_element
|
||||
? override_target_element
|
||||
: mev.InnerPossiblyPseudoElement();
|
||||
--- a/third_party/blink/renderer/core/page/context_menu_controller.cc
|
||||
+++ b/third_party/blink/renderer/core/page/context_menu_controller.cc
|
||||
@@ -439,6 +439,13 @@ bool ContextMenuController::ShowContextM
|
||||
return ShowContextMenu(frame, point, source_type, nullptr);
|
||||
}
|
||||
|
||||
+bool ContextMenuController::ShowContextMenuForUserInput(
|
||||
+ LocalFrame* frame,
|
||||
+ const PhysicalOffset& point,
|
||||
+ ui::mojom::blink::MenuSourceType source_type) {
|
||||
+ return ShowContextMenu(frame, point, source_type);
|
||||
+}
|
||||
+
|
||||
bool ContextMenuController::ShowContextMenu(
|
||||
LocalFrame* frame,
|
||||
const PhysicalOffset& point,
|
||||
--- a/third_party/blink/renderer/core/page/context_menu_controller.h
|
||||
+++ b/third_party/blink/renderer/core/page/context_menu_controller.h
|
||||
@@ -64,6 +64,10 @@ class CORE_EXPORT ContextMenuController
|
||||
float y,
|
||||
ContextMenuProvider*);
|
||||
|
||||
+ bool ShowContextMenuForUserInput(LocalFrame*,
|
||||
+ const PhysicalOffset&,
|
||||
+ ui::mojom::blink::MenuSourceType);
|
||||
+
|
||||
void CustomContextMenuItemSelected(unsigned action);
|
||||
|
||||
Node* ContextMenuImageNodeForFrame(LocalFrame*);
|
||||
--- a/third_party/blink/public/web/web_settings.h
|
||||
+++ b/third_party/blink/public/web/web_settings.h
|
||||
@@ -201,6 +201,7 @@ class WebSettings {
|
||||
UScriptCode = USCRIPT_COMMON) = 0;
|
||||
virtual void SetShouldPrintBackgrounds(bool) = 0;
|
||||
virtual void SetShouldClearDocumentBackground(bool) = 0;
|
||||
+ virtual void SetShiftRightClickContextMenuEnabled(bool) = 0;
|
||||
virtual void SetShowContextMenuOnMouseUp(bool) = 0;
|
||||
virtual void SetShrinksViewportContentToFit(bool) = 0;
|
||||
virtual void SetSmartInsertDeleteEnabled(bool) = 0;
|
||||
--- a/third_party/blink/renderer/core/exported/web_settings_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_settings_impl.cc
|
||||
@@ -476,6 +476,10 @@ void WebSettingsImpl::SetSmoothScrollFor
|
||||
settings_->SetSmoothScrollForFindEnabled(enabled);
|
||||
}
|
||||
|
||||
+void WebSettingsImpl::SetShiftRightClickContextMenuEnabled(bool enabled) {
|
||||
+ settings_->SetShiftRightClickContextMenuEnabled(enabled);
|
||||
+}
|
||||
+
|
||||
void WebSettingsImpl::SetShowContextMenuOnMouseUp(bool enabled) {
|
||||
settings_->SetShowContextMenuOnMouseUp(enabled);
|
||||
}
|
||||
--- a/third_party/blink/renderer/core/exported/web_settings_impl.h
|
||||
+++ b/third_party/blink/renderer/core/exported/web_settings_impl.h
|
||||
@@ -155,6 +155,7 @@ class CORE_EXPORT WebSettingsImpl final
|
||||
UScriptCode = USCRIPT_COMMON) override;
|
||||
void SetShouldPrintBackgrounds(bool) override;
|
||||
void SetShouldClearDocumentBackground(bool) override;
|
||||
+ void SetShiftRightClickContextMenuEnabled(bool) override;
|
||||
void SetShowContextMenuOnMouseUp(bool) override;
|
||||
void SetShrinksViewportContentToFit(bool) override;
|
||||
void SetSmartInsertDeleteEnabled(bool) override;
|
||||
--- a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
|
||||
+++ b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
|
||||
@@ -57,6 +57,8 @@ bool StructTraits<blink::mojom::WebPrefe
|
||||
out->minimum_font_size = data.minimum_font_size();
|
||||
out->minimum_logical_font_size = data.minimum_logical_font_size();
|
||||
out->context_menu_on_mouse_up = data.context_menu_on_mouse_up();
|
||||
+ out->shift_right_click_context_menu_enabled =
|
||||
+ data.shift_right_click_context_menu_enabled();
|
||||
out->javascript_enabled = data.javascript_enabled();
|
||||
out->web_security_enabled = data.web_security_enabled();
|
||||
out->loads_images_automatically = data.loads_images_automatically();
|
||||
--- a/chrome/browser/chrome_content_browser_client.cc
|
||||
+++ b/chrome/browser/chrome_content_browser_client.cc
|
||||
@@ -4736,6 +4736,8 @@ void ChromeContentBrowserClient::Overrid
|
||||
web_prefs->javascript_can_access_clipboard =
|
||||
prefs->GetBoolean(prefs::kWebKitJavascriptCanAccessClipboard);
|
||||
web_prefs->tabs_to_links = prefs->GetBoolean(prefs::kWebkitTabsToLinks);
|
||||
+ web_prefs->shift_right_click_context_menu_enabled =
|
||||
+ prefs->GetBoolean(prefs::kShiftRightClickContextMenu);
|
||||
|
||||
if (!prefs->GetBoolean(prefs::kWebKitJavascriptEnabled)) {
|
||||
web_prefs->javascript_enabled = false;
|
||||
--- a/chrome/browser/ui/prefs/pref_watcher.cc
|
||||
+++ b/chrome/browser/ui/prefs/pref_watcher.cc
|
||||
@@ -53,6 +53,7 @@ const char* const kWebPrefsToObserve[] =
|
||||
prefs::kDisable3DAPIs,
|
||||
prefs::kEnableHyperlinkAuditing,
|
||||
prefs::kSubresourceFilterHighlightAds,
|
||||
+ prefs::kShiftRightClickContextMenu,
|
||||
prefs::kWebKitAllowRunningInsecureContent,
|
||||
prefs::kWebKitDefaultFixedFontSize,
|
||||
prefs::kWebKitDefaultFontSize,
|
||||
--- a/third_party/blink/public/common/web_preferences/web_preferences.h
|
||||
+++ b/third_party/blink/public/common/web_preferences/web_preferences.h
|
||||
@@ -62,6 +62,7 @@ struct BLINK_COMMON_EXPORT WebPreference
|
||||
int minimum_logical_font_size = 6;
|
||||
std::string default_encoding = "ISO-8859-1";
|
||||
bool context_menu_on_mouse_up = BUILDFLAG(IS_WIN);
|
||||
+ bool shift_right_click_context_menu_enabled = true;
|
||||
bool javascript_enabled = true;
|
||||
bool web_security_enabled = true;
|
||||
bool loads_images_automatically = true;
|
||||
--- a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
|
||||
+++ b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
|
||||
@@ -83,6 +83,11 @@ struct BLINK_COMMON_EXPORT StructTraits<
|
||||
return r.context_menu_on_mouse_up;
|
||||
}
|
||||
|
||||
+ static bool shift_right_click_context_menu_enabled(
|
||||
+ const blink::web_pref::WebPreferences& r) {
|
||||
+ return r.shift_right_click_context_menu_enabled;
|
||||
+ }
|
||||
+
|
||||
static bool javascript_enabled(const blink::web_pref::WebPreferences& r) {
|
||||
return r.javascript_enabled;
|
||||
}
|
||||
--- a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
|
||||
+++ b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
|
||||
@@ -128,6 +128,7 @@ struct WebPreferences {
|
||||
int32 minimum_logical_font_size;
|
||||
string default_encoding;
|
||||
bool context_menu_on_mouse_up;
|
||||
+ bool shift_right_click_context_menu_enabled;
|
||||
bool javascript_enabled;
|
||||
bool web_security_enabled;
|
||||
bool loads_images_automatically;
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -1830,6 +1830,8 @@ void WebView::ApplyWebPreferences(const
|
||||
prefs.main_frame_resizes_are_orientation_changes);
|
||||
|
||||
settings->SetShowContextMenuOnMouseUp(prefs.context_menu_on_mouse_up);
|
||||
+ settings->SetShiftRightClickContextMenuEnabled(
|
||||
+ prefs.shift_right_click_context_menu_enabled);
|
||||
settings->SetAlwaysShowContextMenuOnTouch(
|
||||
prefs.always_show_context_menu_on_touch);
|
||||
settings->SetSmoothScrollForFindEnabled(prefs.smooth_scroll_for_find_enabled);
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -265,6 +265,9 @@
|
||||
<message name="IDS_SETTINGS_CYCLE_TABS_IN_MRU_ORDER" desc="Label for the checkbox which enables or disables cycling through tabs in MRU order when using Ctrl+Tab.">
|
||||
Cycle through tabs in most recently used order with Ctrl+Tab
|
||||
</message>
|
||||
+ <message name="IDS_SETTINGS_SHIFT_RIGHT_CLICK_CONTEXT_MENU" desc="Label for the checkbox which makes Shift+right click show the browser context menu even when a page blocks it.">
|
||||
+ Force context menu with Shift+Right Click
|
||||
+ </message>
|
||||
<message name="IDS_SETTINGS_SHOW_HOME_BUTTON" desc="Label for the checkbox which enables or disables showing the home button in the toolbar.">
|
||||
Show home button
|
||||
</message>
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -281,6 +281,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kTabCyclingMRU] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
+ (*s_allowlist)[::prefs::kShiftRightClickContextMenu] =
|
||||
+ settings_api::PrefType::kBoolean;
|
||||
|
||||
(*s_allowlist)[::prefs::kShowHomeButton] = settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kShowForwardButton] =
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -549,6 +549,8 @@ void AddAppearanceStrings(content::WebUI
|
||||
{"systemMode", IDS_NTP_CUSTOMIZE_CHROME_COLOR_SCHEME_MODE_SYSTEM_LABEL},
|
||||
{"openNewTabNextToActive", IDS_SETTINGS_NEW_TAB_NEXT_TO_ACTIVE_BUTTON},
|
||||
{"cycleTabsInMRUOrder", IDS_SETTINGS_CYCLE_TABS_IN_MRU_ORDER},
|
||||
+ {"shiftRightClickContextMenu",
|
||||
+ IDS_SETTINGS_SHIFT_RIGHT_CLICK_CONTEXT_MENU},
|
||||
{"showHomeButton", IDS_SETTINGS_SHOW_HOME_BUTTON},
|
||||
{"showBookmarksBar", IDS_SETTINGS_SHOW_BOOKMARKS_BAR},
|
||||
{"bookmarksBar", IDS_SETTINGS_BOOKMARKS_BAR},
|
||||
--- a/chrome/browser/resources/settings/appearance_page/appearance_behavior_page.html
|
||||
+++ b/chrome/browser/resources/settings/appearance_page/appearance_behavior_page.html
|
||||
@@ -11,6 +11,11 @@
|
||||
label="$i18n{cycleTabsInMRUOrder}">
|
||||
</settings-toggle-button>
|
||||
|
||||
+ <settings-toggle-button class="hr" id="shiftRightClickContextMenu"
|
||||
+ pref="{{prefs.helium.browser.shift_right_click_context_menu}}"
|
||||
+ label="$i18n{shiftRightClickContextMenu}">
|
||||
+ </settings-toggle-button>
|
||||
+
|
||||
<settings-toggle-button class="hr" id="copyPageUrlShortcut"
|
||||
pref="{{prefs.helium.settings.a11y.copy_page_url_shortcut}}"
|
||||
label="$i18n{copyPageUrlShortcut}">
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -101,6 +101,11 @@ bool ShouldAccessUpdateService(const Pre
|
||||
@@ -121,6 +121,11 @@ bool ShouldAccessUpdateService(const Pre
|
||||
prefs.GetBoolean(prefs::kHeliumUpdateFetchingEnabled);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
GURL GetExtensionUpdateURL(const PrefService& prefs) {
|
||||
if (!ShouldAccessExtensionService(prefs)) {
|
||||
return GetDummyURL();
|
||||
@@ -144,6 +149,14 @@ GURL GetBrowserUpdateURL(const PrefServi
|
||||
@@ -164,6 +169,14 @@ GURL GetBrowserUpdateURL(const PrefServi
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -26,24 +26,19 @@
|
||||
+
|
||||
void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
ConfigurePrefChangeRegistrarForServices(registrar, observer);
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -23,12 +23,14 @@ bool ShouldAccessServices(const PrefServ
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
@@ -38,6 +38,9 @@ COMPONENT_EXPORT(HELIUM) GURL GetSpellch
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessUpdateService(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessUBlockAssets(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetExtensionUpdateURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetSpellcheckURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetBrowserUpdateURL(const PrefService& prefs);
|
||||
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessUBlockAssets(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetUBlockAssetsURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
+
|
||||
} // namespace helium
|
||||
|
||||
#endif // COMPONENTS_HELIUM_SERVICES_HELIUM_SERVICES_HELPERS_H_
|
||||
--- a/components/helium_services/pref_names.h
|
||||
+++ b/components/helium_services/pref_names.h
|
||||
@@ -39,6 +39,8 @@ inline constexpr char kHeliumUpdateFetch
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
--- a/third_party/ublock/manifest.json
|
||||
+++ b/third_party/ublock/manifest.json
|
||||
@@ -114,5 +114,6 @@
|
||||
"version": "1.72.2",
|
||||
"version": "1.71.0",
|
||||
"web_accessible_resources": [
|
||||
"/web_accessible_resources/*"
|
||||
- ]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -2451,6 +2451,9 @@
|
||||
@@ -2448,6 +2448,9 @@
|
||||
<message name="IDS_SETTINGS_SEARCH_ENGINES_ADD_SITE_SEARCH" desc="Title for a dialog that allows adding a new site search engine.">
|
||||
Add site search
|
||||
</message>
|
||||
@@ -32,7 +32,7 @@
|
||||
{"advancedPageTitle", IDS_SETTINGS_ADVANCED},
|
||||
{"back", IDS_ACCNAME_BACK},
|
||||
{"basicPageTitle", IDS_SETTINGS_BASIC},
|
||||
@@ -3037,6 +3038,8 @@ void AddSearchEnginesStrings(content::We
|
||||
@@ -3035,6 +3036,8 @@ void AddSearchEnginesStrings(content::We
|
||||
IDS_SETTINGS_SEARCH_ENGINES_PAGE_EXPLANATION},
|
||||
{"searchEnginesAddSiteSearch",
|
||||
IDS_SETTINGS_SEARCH_ENGINES_ADD_SITE_SEARCH},
|
||||
|
||||
@@ -1,347 +0,0 @@
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -1718,6 +1718,21 @@
|
||||
<message name="IDS_SETTINGS_HELIUM_SERVICES_DESCRIPTION" desc="Description of the controls available on the Helium services settings page">
|
||||
Manage what Helium services are allowed in your browser
|
||||
</message>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_CRASH_REPORTING_TITLE" desc="Title of the setting that controls crash reporting">
|
||||
+ Crash reporting
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_CRASH_REPORTING_DESCRIPTION" desc="Description of the setting that controls crash reporting">
|
||||
+ Choose whether Helium can ask to send crash reports or send them automatically. Disabling reports will delete all pending reports.
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_CRASH_REPORTING_DISABLED" desc="Crash reporting option that disables prompts and submissions">
|
||||
+ Disabled
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_CRASH_REPORTING_ASK" desc="Crash reporting option that prompts after a crash">
|
||||
+ Ask after a crash
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_CRASH_REPORTING_AUTOMATIC" desc="Crash reporting option that automatically submits reports">
|
||||
+ Send automatically
|
||||
+ </message>
|
||||
<message name="IDS_SETTINGS_HELIUM_SCHEMA_NOTICE_TITLE" desc="Title of the alert shown when Helium services have a change in behavior">
|
||||
Updates to Helium services:
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -2349,6 +2349,15 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
{"securityPageDescription", IDS_SETTINGS_SECURITY_DESCRIPTION_NORMAL},
|
||||
{"heliumServicesTitle", IDS_SETTINGS_HELIUM_SERVICES},
|
||||
{"heliumServicesDescription", IDS_SETTINGS_HELIUM_SERVICES_DESCRIPTION},
|
||||
+ {"heliumCrashReportingTitle",
|
||||
+ IDS_SETTINGS_HELIUM_CRASH_REPORTING_TITLE},
|
||||
+ {"heliumCrashReportingDescription",
|
||||
+ IDS_SETTINGS_HELIUM_CRASH_REPORTING_DESCRIPTION},
|
||||
+ {"heliumCrashReportingDisabled",
|
||||
+ IDS_SETTINGS_HELIUM_CRASH_REPORTING_DISABLED},
|
||||
+ {"heliumCrashReportingAsk", IDS_SETTINGS_HELIUM_CRASH_REPORTING_ASK},
|
||||
+ {"heliumCrashReportingAutomatic",
|
||||
+ IDS_SETTINGS_HELIUM_CRASH_REPORTING_AUTOMATIC},
|
||||
{"heliumServicesSetupPendingText", IDS_SETTINGS_HELIUM_SERVICES_SETUP_PENDING_TEXT},
|
||||
{"heliumServicesSetupPendingButton", IDS_SETTINGS_HELIUM_SERVICES_SETUP_PENDING_BUTTON},
|
||||
{"heliumServicesToggle", IDS_SETTINGS_HELIUM_SERVICES_TOGGLE},
|
||||
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
@@ -112,6 +112,21 @@
|
||||
</cr-collapse>
|
||||
</div>
|
||||
</template>
|
||||
+ <div class="cr-row hr">
|
||||
+ <div class="flex label-wrapper" aria-hidden="true">
|
||||
+ <div class="label">$i18n{heliumCrashReportingTitle}</div>
|
||||
+ <div class="cr-secondary-text label">
|
||||
+ $i18n{heliumCrashReportingDescription}
|
||||
+ </div>
|
||||
+ </div>
|
||||
+ <settings-dropdown-menu id="crashReportingControl"
|
||||
+ label="$i18n{heliumCrashReportingTitle}"
|
||||
+ pref="[[crashReportingPref_]]"
|
||||
+ menu-options="[[crashReportingOptions_]]"
|
||||
+ no-set-pref
|
||||
+ on-settings-control-change="onCrashReportingChange_">
|
||||
+ </settings-dropdown-menu>
|
||||
+ </div>
|
||||
</div>
|
||||
|
||||
|
||||
--- a/chrome/browser/resources/settings/privacy_page/services_page.ts
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/services_page.ts
|
||||
@@ -2,6 +2,7 @@
|
||||
// You can use, redistribute, and/or modify this source code under
|
||||
// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
|
||||
+import '../controls/settings_dropdown_menu.js';
|
||||
import '../controls/settings_toggle_button.js';
|
||||
import '../settings_page/settings_subpage.js';
|
||||
import 'chrome://resources/cr_elements/cr_button/cr_button.js';
|
||||
@@ -14,14 +15,33 @@ import {PrefsMixin} from '/shared/settin
|
||||
import {HelpBubbleMixin} from 'chrome://resources/cr_components/help_bubble/help_bubble_mixin.js';
|
||||
import type {CrInputElement} from 'chrome://resources/cr_elements/cr_input/cr_input.js';
|
||||
import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js';
|
||||
+import {WebUiListenerMixin} from 'chrome://resources/cr_elements/web_ui_listener_mixin.js';
|
||||
+import {sendWithPromise} from 'chrome://resources/js/cr.js';
|
||||
+import {loadTimeData} from 'chrome://resources/js/load_time_data.js';
|
||||
import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
|
||||
|
||||
+import type {
|
||||
+ DropdownMenuOptionList,
|
||||
+ SettingsDropdownMenuElement,
|
||||
+} from '../controls/settings_dropdown_menu.js';
|
||||
import type {HeliumServicesChangeHandler} from './changelog_proxy.js';
|
||||
import {HeliumServicesChangeHandlerImpl} from './changelog_proxy.js';
|
||||
import {getTemplate} from './services_page.html.js';
|
||||
|
||||
const SettingsHeliumServicesPageElementBase =
|
||||
- HelpBubbleMixin(I18nMixin(PrefsMixin(PolymerElement)));
|
||||
+ HelpBubbleMixin(WebUiListenerMixin(
|
||||
+ I18nMixin(PrefsMixin(PolymerElement))));
|
||||
+
|
||||
+enum CrashReportingMode {
|
||||
+ DISABLED = -1,
|
||||
+ ASK = 0,
|
||||
+ AUTOMATIC = 1,
|
||||
+}
|
||||
+
|
||||
+interface HeliumCrashReportingState {
|
||||
+ mode: CrashReportingMode;
|
||||
+ managed: boolean;
|
||||
+}
|
||||
|
||||
export class SettingsHeliumServicesPageElement extends
|
||||
SettingsHeliumServicesPageElementBase {
|
||||
@@ -40,10 +60,39 @@ export class SettingsHeliumServicesPageE
|
||||
return {
|
||||
ignoreChecked_: Boolean,
|
||||
changes_: Array,
|
||||
+ crashReportingOptions_: {
|
||||
+ type: Array,
|
||||
+ readOnly: true,
|
||||
+ value: () => [
|
||||
+ {
|
||||
+ value: CrashReportingMode.DISABLED,
|
||||
+ name: loadTimeData.getString('heliumCrashReportingDisabled'),
|
||||
+ },
|
||||
+ {
|
||||
+ value: CrashReportingMode.ASK,
|
||||
+ name: loadTimeData.getString('heliumCrashReportingAsk'),
|
||||
+ },
|
||||
+ {
|
||||
+ value: CrashReportingMode.AUTOMATIC,
|
||||
+ name: loadTimeData.getString('heliumCrashReportingAutomatic'),
|
||||
+ },
|
||||
+ ],
|
||||
+ },
|
||||
+ crashReportingPref_: {
|
||||
+ type: Object,
|
||||
+ value: () => ({
|
||||
+ key: '',
|
||||
+ type: chrome.settingsPrivate.PrefType.NUMBER,
|
||||
+ value: CrashReportingMode.ASK,
|
||||
+ }),
|
||||
+ },
|
||||
};
|
||||
}
|
||||
|
||||
declare private changes_: string[];
|
||||
+ declare private crashReportingOptions_: DropdownMenuOptionList;
|
||||
+ declare private crashReportingPref_:
|
||||
+ chrome.settingsPrivate.PrefObject<number>;
|
||||
declare private ignoreChecked_: boolean;
|
||||
|
||||
private toOrigin(thing: string) {
|
||||
@@ -71,6 +120,30 @@ export class SettingsHeliumServicesPageE
|
||||
override ready() {
|
||||
super.ready();
|
||||
this.requestChangelog();
|
||||
+ const update = (state: HeliumCrashReportingState) =>
|
||||
+ this.setCrashReportingState_(state);
|
||||
+ this.addWebUiListener('helium-crash-reporting-change', update);
|
||||
+ sendWithPromise<HeliumCrashReportingState>('getHeliumCrashReporting')
|
||||
+ .then(update);
|
||||
+ }
|
||||
+
|
||||
+ private setCrashReportingState_(state: HeliumCrashReportingState) {
|
||||
+ const pref: chrome.settingsPrivate.PrefObject<number> = {
|
||||
+ key: '',
|
||||
+ type: chrome.settingsPrivate.PrefType.NUMBER,
|
||||
+ value: state.mode,
|
||||
+ };
|
||||
+ if (state.managed) {
|
||||
+ pref.enforcement = chrome.settingsPrivate.Enforcement.ENFORCED;
|
||||
+ pref.controlledBy = chrome.settingsPrivate.ControlledBy.USER_POLICY;
|
||||
+ }
|
||||
+ this.crashReportingPref_ = pref;
|
||||
+ }
|
||||
+
|
||||
+ private onCrashReportingChange_(event: Event) {
|
||||
+ const control = event.target as SettingsDropdownMenuElement;
|
||||
+ const mode = Number.parseInt(control.getSelectedValue(), 10);
|
||||
+ chrome.send('setHeliumCrashReportingMode', [mode]);
|
||||
}
|
||||
|
||||
protected onOriginOverrideKeydown_(event: KeyboardEvent) {
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/webui/settings/helium_crash_reporting_handler.cc
|
||||
@@ -0,0 +1,83 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+#include "chrome/browser/ui/webui/settings/helium_crash_reporting_handler.h"
|
||||
+
|
||||
+#include "base/functional/bind.h"
|
||||
+#include "base/values.h"
|
||||
+#include "chrome/browser/browser_process.h"
|
||||
+#include "chrome/browser/crash_upload_list/helium_crash_reporting.h"
|
||||
+#include "chrome/common/pref_names.h"
|
||||
+#include "components/metrics/metrics_pref_names.h"
|
||||
+#include "content/public/browser/web_ui.h"
|
||||
+
|
||||
+namespace settings {
|
||||
+
|
||||
+HeliumCrashReportingHandler::HeliumCrashReportingHandler() = default;
|
||||
+HeliumCrashReportingHandler::~HeliumCrashReportingHandler() = default;
|
||||
+
|
||||
+void HeliumCrashReportingHandler::RegisterMessages() {
|
||||
+ web_ui()->RegisterMessageCallback(
|
||||
+ "getHeliumCrashReporting",
|
||||
+ base::BindRepeating(&HeliumCrashReportingHandler::HandleGetState,
|
||||
+ base::Unretained(this)));
|
||||
+ web_ui()->RegisterMessageCallback(
|
||||
+ "setHeliumCrashReportingMode",
|
||||
+ base::BindRepeating(&HeliumCrashReportingHandler::HandleSetMode,
|
||||
+ base::Unretained(this)));
|
||||
+}
|
||||
+
|
||||
+void HeliumCrashReportingHandler::OnJavascriptAllowed() {
|
||||
+ pref_member_ = std::make_unique<IntegerPrefMember>();
|
||||
+ pref_member_->Init(
|
||||
+ prefs::kHeliumCrashReportingMode, g_browser_process->local_state(),
|
||||
+ base::BindRepeating(&HeliumCrashReportingHandler::OnPrefChanged,
|
||||
+ base::Unretained(this)));
|
||||
+ policy_pref_member_ = std::make_unique<BooleanPrefMember>();
|
||||
+ policy_pref_member_->Init(
|
||||
+ metrics::prefs::kMetricsReportingEnabled,
|
||||
+ g_browser_process->local_state(),
|
||||
+ base::BindRepeating(&HeliumCrashReportingHandler::OnPrefChanged,
|
||||
+ base::Unretained(this)));
|
||||
+}
|
||||
+
|
||||
+void HeliumCrashReportingHandler::OnJavascriptDisallowed() {
|
||||
+ policy_pref_member_.reset();
|
||||
+ pref_member_.reset();
|
||||
+}
|
||||
+
|
||||
+base::DictValue HeliumCrashReportingHandler::CreateState() const {
|
||||
+ CHECK(pref_member_);
|
||||
+ const bool managed = helium::UploadsDisabledByPolicy();
|
||||
+ const helium::CrashReportingMode mode =
|
||||
+ managed ? helium::CrashReportingMode::kDisabled
|
||||
+ : helium::GetCrashReportingMode();
|
||||
+
|
||||
+ return base::DictValue()
|
||||
+ .Set("mode", static_cast<int>(mode))
|
||||
+ .Set("managed", managed);
|
||||
+}
|
||||
+
|
||||
+void HeliumCrashReportingHandler::HandleGetState(const base::ListValue& args) {
|
||||
+ AllowJavascript();
|
||||
+ CHECK_EQ(args.size(), 1u);
|
||||
+ ResolveJavascriptCallback(args[0], CreateState());
|
||||
+}
|
||||
+
|
||||
+void HeliumCrashReportingHandler::HandleSetMode(const base::ListValue& args) {
|
||||
+ CHECK_EQ(args.size(), 1u);
|
||||
+
|
||||
+ const int mode = args[0].GetInt();
|
||||
+ if (!helium::IsValidCrashReportingMode(mode)) {
|
||||
+ return;
|
||||
+ }
|
||||
+ helium::SetCrashReportingMode(
|
||||
+ static_cast<helium::CrashReportingMode>(mode));
|
||||
+}
|
||||
+
|
||||
+void HeliumCrashReportingHandler::OnPrefChanged() {
|
||||
+ FireWebUIListener("helium-crash-reporting-change", CreateState());
|
||||
+}
|
||||
+
|
||||
+} // namespace settings
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/webui/settings/helium_crash_reporting_handler.h
|
||||
@@ -0,0 +1,39 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_HELIUM_CRASH_REPORTING_HANDLER_H_
|
||||
+#define CHROME_BROWSER_UI_WEBUI_SETTINGS_HELIUM_CRASH_REPORTING_HANDLER_H_
|
||||
+
|
||||
+#include <memory>
|
||||
+
|
||||
+#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
|
||||
+#include "components/prefs/pref_member.h"
|
||||
+
|
||||
+namespace settings {
|
||||
+
|
||||
+class HeliumCrashReportingHandler : public SettingsPageUIHandler {
|
||||
+ public:
|
||||
+ HeliumCrashReportingHandler();
|
||||
+ HeliumCrashReportingHandler(const HeliumCrashReportingHandler&) = delete;
|
||||
+ HeliumCrashReportingHandler& operator=(const HeliumCrashReportingHandler&) =
|
||||
+ delete;
|
||||
+ ~HeliumCrashReportingHandler() override;
|
||||
+
|
||||
+ void RegisterMessages() override;
|
||||
+ void OnJavascriptAllowed() override;
|
||||
+ void OnJavascriptDisallowed() override;
|
||||
+
|
||||
+ private:
|
||||
+ base::DictValue CreateState() const;
|
||||
+ void HandleGetState(const base::ListValue& args);
|
||||
+ void HandleSetMode(const base::ListValue& args);
|
||||
+ void OnPrefChanged();
|
||||
+
|
||||
+ std::unique_ptr<IntegerPrefMember> pref_member_;
|
||||
+ std::unique_ptr<BooleanPrefMember> policy_pref_member_;
|
||||
+};
|
||||
+
|
||||
+} // namespace settings
|
||||
+
|
||||
+#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_HELIUM_CRASH_REPORTING_HANDLER_H_
|
||||
--- a/chrome/browser/ui/webui/settings/settings_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_ui.cc
|
||||
@@ -71,6 +71,7 @@
|
||||
#include "chrome/browser/ui/webui/settings/font_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/glic_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/hats_handler.h"
|
||||
+#include "chrome/browser/ui/webui/settings/helium_crash_reporting_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/import_data_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/metrics_reporting_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/on_startup_handler.h"
|
||||
@@ -264,6 +265,7 @@ SettingsUI::SettingsUI(content::WebUI* w
|
||||
|
||||
AddSettingsPageUIHandler(
|
||||
std::make_unique<MediaDevicesSelectionHandler>(profile));
|
||||
+ AddSettingsPageUIHandler(std::make_unique<HeliumCrashReportingHandler>());
|
||||
#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && !BUILDFLAG(IS_CHROMEOS)
|
||||
AddSettingsPageUIHandler(std::make_unique<MetricsReportingHandler>());
|
||||
#endif
|
||||
--- a/chrome/browser/ui/BUILD.gn
|
||||
+++ b/chrome/browser/ui/BUILD.gn
|
||||
@@ -523,6 +523,7 @@ static_library("ui") {
|
||||
"//components/metrics:content",
|
||||
"//components/metrics/debug",
|
||||
"//components/metrics/debug:resources",
|
||||
+ "//components/metrics:metrics_pref_names",
|
||||
"//components/metrics/private_metrics",
|
||||
"//components/metrics/structured/buildflags",
|
||||
"//components/metrics_services_manager",
|
||||
@@ -1293,6 +1294,8 @@ static_library("ui") {
|
||||
"webui/settings/glic_handler.h",
|
||||
"webui/settings/hats_handler.cc",
|
||||
"webui/settings/hats_handler.h",
|
||||
+ "webui/settings/helium_crash_reporting_handler.cc",
|
||||
+ "webui/settings/helium_crash_reporting_handler.h",
|
||||
"webui/settings/import_data_handler.cc",
|
||||
"webui/settings/import_data_handler.h",
|
||||
"webui/settings/languages_handler.cc",
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -4180,6 +4180,45 @@
|
||||
@@ -4177,6 +4177,45 @@
|
||||
<message name="IDS_SETTINGS_SYSTEM_FEATURE_NOTIFICATIONS_LABEL" desc="Label for the toggle that enables Chrome system notifications about features.">
|
||||
Show system notifications about Chrome features and tips
|
||||
</message>
|
||||
@@ -1024,7 +1024,7 @@
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/browser_process_platform_part.h"
|
||||
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
||||
@@ -4178,6 +4179,26 @@ void AddSystemStrings(content::WebUIData
|
||||
@@ -4176,6 +4177,26 @@ void AddSystemStrings(content::WebUIData
|
||||
{"isolationStateLabel", IDS_SETTINGS_SYSTEM_ISOLATION_STATE_LABEL},
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
{"proxySettingsLabel", IDS_SETTINGS_SYSTEM_PROXY_SETTINGS_LABEL},
|
||||
@@ -1051,7 +1051,7 @@
|
||||
#if BUILDFLAG(IS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
{"featureNotificationsLabel",
|
||||
IDS_SETTINGS_SYSTEM_FEATURE_NOTIFICATIONS_LABEL},
|
||||
@@ -4188,6 +4209,9 @@ void AddSystemStrings(content::WebUIData
|
||||
@@ -4186,6 +4207,9 @@ void AddSystemStrings(content::WebUIData
|
||||
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
};
|
||||
html_source->AddLocalizedStrings(kLocalizedStrings);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -3892,6 +3892,21 @@
|
||||
@@ -3889,6 +3889,21 @@
|
||||
<message name="IDS_SETTINGS_PICK_AN_AVATAR" desc="Title of the edit avatar selection section on the manage profile page.">
|
||||
Pick an avatar
|
||||
</message>
|
||||
@@ -263,7 +263,7 @@
|
||||
}
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -2212,6 +2212,10 @@ void AddPeopleStrings(content::WebUIData
|
||||
@@ -2210,6 +2210,10 @@ void AddPeopleStrings(content::WebUIData
|
||||
{"nameYourProfile", IDS_SETTING_NAME_YOUR_PROFILE},
|
||||
{"pickThemeColor", IDS_SETTINGS_PICK_A_THEME_COLOR},
|
||||
{"pickAvatar", IDS_SETTINGS_PICK_AN_AVATAR},
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<message name="IDS_SETTINGS_RESET_TO_DEFAULT_THEME" desc="Accessibility label of the button which resets the browser theme back to the default value">
|
||||
Reset to default theme
|
||||
</message>
|
||||
@@ -313,6 +313,9 @@
|
||||
@@ -310,6 +310,9 @@
|
||||
<message name="IDS_SETTINGS_AUTO_PIN_NEW_TAB_GROUPS" desc="Label for the checkbox which enables or disables auto pin new tab groups.">
|
||||
Automatically pin new tab groups created on any device to the bookmarks bar
|
||||
</message>
|
||||
@@ -21,7 +21,7 @@
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -568,7 +568,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
@@ -566,7 +566,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
IDS_SETTINGS_ALLOW_SPLIT_VIEW_DRAG_AND_DROP},
|
||||
{"showTabGroupsInBookmarksBar",
|
||||
IDS_SETTINGS_SHOW_TAB_GROUPS_IN_BOOKMARKS_BAR},
|
||||
@@ -30,7 +30,7 @@
|
||||
{"hoverCardTitle", IDS_SETTINGS_HOVER_CARD_TITLE},
|
||||
{"showHoverCardImages", IDS_SETTINGS_SHOW_HOVER_CARD_IMAGES},
|
||||
{"showHoverCardMemoryUsage", IDS_SETTINGS_SHOW_HOVER_CARD_MEMORY_USAGE},
|
||||
@@ -604,9 +604,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
@@ -602,9 +602,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
{"classicTheme", IDS_SETTINGS_CLASSIC_THEME},
|
||||
{"useClassicTheme", IDS_SETTINGS_USE_CLASSIC_THEME},
|
||||
#endif
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{"loading", IDS_HISTORY_LOADING},
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -2186,7 +2186,7 @@ void AddSyncControlsStrings(content::Web
|
||||
@@ -2184,7 +2184,7 @@ void AddSyncControlsStrings(content::Web
|
||||
void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
|
||||
static constexpr webui::LocalizedString kLocalizedStrings[] = {
|
||||
// Top level people strings:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -1983,6 +1983,9 @@
|
||||
@@ -1980,6 +1980,9 @@
|
||||
<message name="IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_TEXT" desc="The text of a confirmation dialog that confirms that the user want to send the 'Do Not Track' header">
|
||||
Enabling "Do Not Track" means that a request will be included with your browsing traffic. Any effect depends on whether a website responds to the request, and how the request is interpreted. For example, some websites may respond to this request by showing you ads that aren't based on other websites you've visited. Many websites will still collect and use your browsing data - for example to improve security, to provide content, services, ads and recommendations on their websites, and to generate reporting statistics.
|
||||
</message>
|
||||
@@ -10,7 +10,7 @@
|
||||
<message name="IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_LEARN_MORE_ACCESSIBILITY_LABEL" desc="The accessibility label for a link to learn more about Do Not Track">
|
||||
Learn more about Do Not Track
|
||||
</message>
|
||||
@@ -3342,6 +3345,9 @@
|
||||
@@ -3339,6 +3342,9 @@
|
||||
<message name="IDS_SETTINGS_TRACKING_PROTECTION_SITES_ALLOWED_COOKIES_DESCRIPTION" desc="Description of the section on the Tracking Protection settings page that lets users manage which sites are allowed to use third-party cookies. Explains how to use a wildcard to create an exception for an entire domain.">
|
||||
Affects the sites listed here. Inserting “[*.]” before a domain name creates an exception for the entire domain. For example, adding “[*.]google.com” means that third-party cookies can also be active for mail.google.com, because it’s part of google.com.
|
||||
</message>
|
||||
@@ -22,7 +22,7 @@
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -2335,7 +2335,7 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
@@ -2333,7 +2333,7 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
{"privacyPageMore", IDS_SETTINGS_PRIVACY_MORE},
|
||||
{"doNotTrack", IDS_SETTINGS_ENABLE_DO_NOT_TRACK},
|
||||
{"doNotTrackDialogTitle", IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_TITLE},
|
||||
@@ -31,7 +31,7 @@
|
||||
{"doNotTrackDialogLearnMoreA11yLabel",
|
||||
IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_LEARN_MORE_ACCESSIBILITY_LABEL},
|
||||
// TODO(crbug.com/40122957): This string is no longer used. Remove.
|
||||
@@ -3155,7 +3155,7 @@ void AddSiteSettingsStrings(content::Web
|
||||
@@ -3153,7 +3153,7 @@ void AddSiteSettingsStrings(content::Web
|
||||
{"trackingProtectionSitesAllowedCookiesTitle",
|
||||
IDS_SETTINGS_TRACKING_PROTECTION_SITES_ALLOWED_COOKIES_TITLE},
|
||||
{"trackingProtectionSitesAllowedCookiesDescription",
|
||||
|
||||
@@ -1,377 +0,0 @@
|
||||
--- a/chrome/browser/resources/settings/site_settings/constants.ts
|
||||
+++ b/chrome/browser/resources/settings/site_settings/constants.ts
|
||||
@@ -30,6 +30,7 @@ export enum ContentSettingsTypes {
|
||||
FILE_SYSTEM_WRITE = 'file-system-write',
|
||||
GEOLOCATION = 'location',
|
||||
HAND_TRACKING = 'hand-tracking',
|
||||
+ HELIUM_NOISE = 'helium-noise',
|
||||
HID_DEVICES = 'hid-devices',
|
||||
IDLE_DETECTION = 'idle-detection',
|
||||
IMAGES = 'images',
|
||||
--- a/chrome/browser/ui/webui/settings/site_settings_helper.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/site_settings_helper.cc
|
||||
@@ -260,7 +260,7 @@ constexpr auto kContentSettingsTypeGroup
|
||||
{ContentSettingsType::SUSPICIOUS_NOTIFICATION_SHOW_ORIGINAL, nullptr},
|
||||
{ContentSettingsType::LOCAL_NETWORK_ACCESS, nullptr},
|
||||
{ContentSettingsType::SUB_APPS_WITHOUT_PROMPTS, nullptr},
|
||||
- {ContentSettingsType::HELIUM_NOISE, nullptr},
|
||||
+ {ContentSettingsType::HELIUM_NOISE, "helium-noise"},
|
||||
});
|
||||
|
||||
static_assert(
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -2301,6 +2301,32 @@
|
||||
<message name="IDS_SETTINGS_CLEAR_DATA_DESCRIPTION" desc="Description for delete browsing data button in Privacy options. 'History' refers to browsing history. 'Cookies' refers to the technical meaning of a cookie, i.e. data saved by a website on the user's computer, as in when a website saves your preferences.">
|
||||
Delete history, cookies, cache, and more
|
||||
</message>
|
||||
+
|
||||
+ <!-- Helium Noise -->
|
||||
+ <message name="IDS_SETTINGS_NOISE" desc="Title of the settings page for Helium's fingerprinting protection feature.">
|
||||
+ Fingerprinting protection
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_NOISE_LINK_DESCRIPTION" desc="Description of the fingerprinting protection link on the Privacy and security settings page.">
|
||||
+ Manage how Helium protects you against fingerprinting
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_NOISE_TOGGLE_DESCRIPTION" desc="Description of the global fingerprinting protection toggle.">
|
||||
+ Make it harder for sites to fingerprint your browser and device
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_NOISE_DESCRIPTION" desc="Description of how Helium protects against browser fingerprinting.">
|
||||
+ When fingerprinting protection is enabled, Helium adds noise to certain browser features to make it harder for sites to track and profile you. Each site sees consistent randomized information during your browsing session to reduce the chances of detection.
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_NOISE_DISCLAIMER" desc="Disclaimer shown below the fingerprinting protection description explaining that Helium makes fingerprint recovery harder but cannot prevent fingerprinting completely.">
|
||||
+ Fingerprinting cannot be fully prevented, but Helium's analysis defenses make it harder to recover the original fingerprint.
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_NOISE_CUSTOM_DESCRIPTION" desc="General explanation of fingerprinting protection site rules and wildcard behavior.">
|
||||
+ When the general fingerprinting protection feature is enabled, sites listed below follow a custom setting. Inserting "[*.]" before a domain name applies it to the entire domain.
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_NOISE_EXCEPTIONS_TITLE" desc="Title above the list of sites where fingerprinting protection is disabled.">
|
||||
+ Sites without fingerprinting protection
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_NOISE_ALLOW_OVERRIDES_TITLE" desc="Title above the list of sites where fingerprinting protection is explicitly allowed, overriding broader site exceptions.">
|
||||
+ Overrides to allow fingerprinting protection
|
||||
+ </message>
|
||||
<message name="IDS_SETTINGS_TITLE_AND_COUNT" desc="The title of a section in the settings page with a count of the total number of items in the section">
|
||||
<ph name="TITLE">$1<ex>Block</ex></ph> - <ph name="COUNT">$2<ex>42</ex></ph>
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -126,6 +126,7 @@
|
||||
#include "net/base/url_util.h"
|
||||
#include "net/net_buildflags.h"
|
||||
#include "services/device/public/cpp/device_features.h"
|
||||
+#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/common/features_generated.h"
|
||||
#include "ui/accessibility/accessibility_features.h"
|
||||
#include "ui/accessibility/accessibility_switches.h"
|
||||
@@ -2347,6 +2348,14 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
{"siteSettingsSublabel", IDS_SETTINGS_PERMISSIONS_DESCRIPTION_NORMAL},
|
||||
{"securityPageTitle", IDS_SETTINGS_SECURITY},
|
||||
{"securityPageDescription", IDS_SETTINGS_SECURITY_DESCRIPTION_NORMAL},
|
||||
+ {"noiseTitle", IDS_SETTINGS_NOISE},
|
||||
+ {"noiseLinkDescription", IDS_SETTINGS_NOISE_LINK_DESCRIPTION},
|
||||
+ {"noiseToggleDescription", IDS_SETTINGS_NOISE_TOGGLE_DESCRIPTION},
|
||||
+ {"noiseDescription", IDS_SETTINGS_NOISE_DESCRIPTION},
|
||||
+ {"noiseDisclaimer", IDS_SETTINGS_NOISE_DISCLAIMER},
|
||||
+ {"noiseExceptionsTitle", IDS_SETTINGS_NOISE_EXCEPTIONS_TITLE},
|
||||
+ {"noiseCustomDescription", IDS_SETTINGS_NOISE_CUSTOM_DESCRIPTION},
|
||||
+ {"noiseAllowOverridesTitle", IDS_SETTINGS_NOISE_ALLOW_OVERRIDES_TITLE},
|
||||
{"heliumServicesTitle", IDS_SETTINGS_HELIUM_SERVICES},
|
||||
{"heliumServicesDescription", IDS_SETTINGS_HELIUM_SERVICES_DESCRIPTION},
|
||||
{"heliumCrashReportingTitle",
|
||||
@@ -2664,6 +2673,9 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
{"securityJavascriptGuardrailsManageSiteExceptionsDesc",
|
||||
IDS_SETTINGS_SECURITY_JAVASCRIPT_GUARDRAILS_MANAGE_SITE_EXCEPTIONS_DESCRIPTION}};
|
||||
html_source->AddLocalizedStrings(kLocalizedStrings);
|
||||
+ html_source->AddBoolean(
|
||||
+ "heliumNoiseAvailable",
|
||||
+ base::FeatureList::IsEnabled(blink::features::kHeliumNoise));
|
||||
|
||||
html_source->AddString("cookiesSettingsHelpCenterURL",
|
||||
chrome::kCookiesSettingsHelpCenterURL);
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -575,6 +575,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[safety_hub_prefs::kUnusedSitePermissionsRevocationEnabled] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
+ (*s_allowlist)[::prefs::kHeliumNoiseEnabled] =
|
||||
+ settings_api::PrefType::kBoolean;
|
||||
|
||||
#if BUILDFLAG(ENABLE_COMPOSE)
|
||||
(*s_allowlist)[prefs::kEnableProactiveNudge] =
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/noise_page.html
|
||||
@@ -0,0 +1,38 @@
|
||||
+<!-- Copyright 2026 The Helium Authors
|
||||
+ You can use, redistribute, and/or modify this source code under
|
||||
+ the terms of the GPL-3.0 license that can be found in the LICENSE file. -->
|
||||
+
|
||||
+<style include="cr-shared-style settings-shared">
|
||||
+ #description {
|
||||
+ padding: var(--cr-section-vertical-padding) var(--cr-section-padding);
|
||||
+ }
|
||||
+
|
||||
+ #description p {
|
||||
+ margin: 0;
|
||||
+ }
|
||||
+
|
||||
+ #description p + p {
|
||||
+ margin-top: var(--cr-section-vertical-padding);
|
||||
+ }
|
||||
+</style>
|
||||
+
|
||||
+<settings-subpage page-title="$i18n{noiseTitle}"
|
||||
+ route-path$="[[routePath]]">
|
||||
+ <settings-toggle-button id="noiseToggle"
|
||||
+ pref="{{prefs.helium.noise.enabled}}"
|
||||
+ label="$i18n{noiseTitle}"
|
||||
+ sub-label="$i18n{noiseToggleDescription}">
|
||||
+ </settings-toggle-button>
|
||||
+
|
||||
+ <div id="description" class="cr-secondary-text">
|
||||
+ <p>$i18n{noiseDescription}</p>
|
||||
+ <p id="disclaimer">$i18n{noiseDisclaimer}</p>
|
||||
+ </div>
|
||||
+
|
||||
+ <category-setting-exceptions
|
||||
+ category="[[contentSettingsTypesEnum_.HELIUM_NOISE]]"
|
||||
+ description="$i18n{noiseCustomDescription}"
|
||||
+ allow-header="$i18n{noiseAllowOverridesTitle}"
|
||||
+ block-header="$i18n{noiseExceptionsTitle}">
|
||||
+ </category-setting-exceptions>
|
||||
+</settings-subpage>
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/noise_page.ts
|
||||
@@ -0,0 +1,51 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+import '/shared/settings/prefs/prefs.js';
|
||||
+import '../controls/settings_toggle_button.js';
|
||||
+import '../settings_page/settings_subpage.js';
|
||||
+import '../settings_shared.css.js';
|
||||
+import '../site_settings/category_setting_exceptions.js';
|
||||
+
|
||||
+import {PrefsMixin} from '/shared/settings/prefs/prefs_mixin.js';
|
||||
+import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
|
||||
+
|
||||
+import {SettingsViewMixin} from '../settings_page/settings_view_mixin.js';
|
||||
+import {ContentSettingsTypes} from '../site_settings/constants.js';
|
||||
+
|
||||
+import {getTemplate} from './noise_page.html.js';
|
||||
+
|
||||
+const SettingsNoisePageElementBase =
|
||||
+ SettingsViewMixin(PrefsMixin(PolymerElement));
|
||||
+
|
||||
+export class SettingsNoisePageElement extends SettingsNoisePageElementBase {
|
||||
+ static get is() {
|
||||
+ return 'settings-noise-page';
|
||||
+ }
|
||||
+
|
||||
+ static get template() {
|
||||
+ return getTemplate();
|
||||
+ }
|
||||
+
|
||||
+ static get properties() {
|
||||
+ return {
|
||||
+ contentSettingsTypesEnum_: {
|
||||
+ type: Object,
|
||||
+ value: ContentSettingsTypes,
|
||||
+ },
|
||||
+ };
|
||||
+ }
|
||||
+
|
||||
+ override focusBackButton() {
|
||||
+ this.shadowRoot!.querySelector('settings-subpage')!.focusBackButton();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+declare global {
|
||||
+ interface HTMLElementTagNameMap {
|
||||
+ 'settings-noise-page': SettingsNoisePageElement;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+customElements.define(SettingsNoisePageElement.is, SettingsNoisePageElement);
|
||||
--- a/chrome/browser/resources/settings/BUILD.gn
|
||||
+++ b/chrome/browser/resources/settings/BUILD.gn
|
||||
@@ -134,6 +134,7 @@ build_webui("build") {
|
||||
"performance_page/tab_discard/exception_tabbed_add_dialog.ts",
|
||||
"privacy_page/cookies_page.ts",
|
||||
"privacy_page/do_not_track_toggle.ts",
|
||||
+ "privacy_page/noise_page.ts",
|
||||
"privacy_page/personalization_options.ts",
|
||||
"privacy_page/privacy_guide/privacy_guide_ad_topics_fragment.ts",
|
||||
"privacy_page/privacy_guide/privacy_guide_completion_fragment.ts",
|
||||
--- a/chrome/browser/resources/settings/lazy_load.ts
|
||||
+++ b/chrome/browser/resources/settings/lazy_load.ts
|
||||
@@ -23,6 +23,7 @@ import './clear_browsing_data_dialog/cle
|
||||
import './clear_browsing_data_dialog/clear_browsing_data_time_picker.js';
|
||||
import './glic_page/glic_login_permissions_page.js';
|
||||
import './privacy_page/cookies_page.js';
|
||||
+import './privacy_page/noise_page.js';
|
||||
import './privacy_page/privacy_guide/privacy_guide_dialog.js';
|
||||
import './privacy_page/privacy_guide/privacy_guide_page.js';
|
||||
import './privacy_page/security/security_keys_subpage.js';
|
||||
@@ -247,6 +248,7 @@ export {SettingsSyncEncryptionOptionsEle
|
||||
export {NetworkPredictionOptions} from './performance_page/constants.js';
|
||||
export {SettingsCookiesPageElement} from './privacy_page/cookies_page.js';
|
||||
export {SettingsDoNotTrackToggleElement} from './privacy_page/do_not_track_toggle.js';
|
||||
+export {SettingsNoisePageElement} from './privacy_page/noise_page.js';
|
||||
export {SettingsPersonalizationOptionsElement} from './privacy_page/personalization_options.js';
|
||||
export {PrivacyGuideStep} from './privacy_page/privacy_guide/constants.js';
|
||||
export {PrivacyGuideAdTopicsFragmentElement} from './privacy_page/privacy_guide/privacy_guide_ad_topics_fragment.js';
|
||||
--- a/chrome/browser/resources/settings/router.ts
|
||||
+++ b/chrome/browser/resources/settings/router.ts
|
||||
@@ -30,6 +30,7 @@ export interface SettingsRoutes {
|
||||
DEFAULT_BROWSER: Route;
|
||||
DOWNLOADS: Route;
|
||||
EDIT_DICTIONARY: Route;
|
||||
+ NOISE: Route;
|
||||
FONTS: Route;
|
||||
GEMINI: Route;
|
||||
GEMINI_LOGIN: Route;
|
||||
--- a/chrome/browser/resources/settings/route.ts
|
||||
+++ b/chrome/browser/resources/settings/route.ts
|
||||
@@ -18,6 +18,10 @@ function addPrivacyChildRoutes(r: Partia
|
||||
r.CLEAR_BROWSER_DATA = r.PRIVACY.createChild('/clearBrowserData');
|
||||
r.CLEAR_BROWSER_DATA.isNavigableDialog = true;
|
||||
|
||||
+ if (loadTimeData.getBoolean('heliumNoiseAvailable')) {
|
||||
+ r.NOISE = r.PRIVACY.createChild('noise');
|
||||
+ }
|
||||
+
|
||||
r.HELIUM_SERVICES = r.PRIVACY.createChild('services');
|
||||
|
||||
const visibility = pageVisibility || {};
|
||||
--- a/chrome/browser/resources/settings/privacy_page/privacy_page.html
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html
|
||||
@@ -16,6 +16,16 @@
|
||||
label="$i18n{clearBrowsingData}"
|
||||
sub-label="$i18n{clearBrowsingDataDescription}"
|
||||
on-click="onClearBrowsingDataClick_"></cr-link-row>
|
||||
+ <template is="dom-if" if="[[heliumNoiseAvailable_]]">
|
||||
+ <cr-link-row id="noiseLinkRow"
|
||||
+ start-icon="settings20:shield"
|
||||
+ class="hr"
|
||||
+ label="$i18n{noiseTitle}"
|
||||
+ sub-label="$i18n{noiseLinkDescription}"
|
||||
+ on-click="onNoiseClick_"
|
||||
+ role-description="$i18n{subpageArrowRoleDescription}">
|
||||
+ </cr-link-row>
|
||||
+ </template>
|
||||
<template is="dom-if" if="[[false]]">
|
||||
<cr-link-row id="thirdPartyCookiesLinkRow"
|
||||
start-icon="privacy:cookie"
|
||||
--- a/chrome/browser/resources/settings/privacy_page/privacy_page.ts
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/privacy_page.ts
|
||||
@@ -81,6 +81,11 @@ export class SettingsPrivacyPageElement
|
||||
value: () => loadTimeData.getBoolean('isAdPrivacyAvailable'),
|
||||
},
|
||||
|
||||
+ heliumNoiseAvailable_: {
|
||||
+ type: Boolean,
|
||||
+ value: () => loadTimeData.getBoolean('heliumNoiseAvailable'),
|
||||
+ },
|
||||
+
|
||||
// The label of the confirmation toast that is displayed after deletion
|
||||
// from 'Delete Browsing data' is completed.
|
||||
dbdDeletionConfirmationToastLabel_: {
|
||||
@@ -100,6 +105,7 @@ export class SettingsPrivacyPageElement
|
||||
declare private isPrivacySandboxRestricted_: boolean;
|
||||
declare private isPrivacySandboxRestrictedNoticeEnabled_: boolean;
|
||||
declare private isAdPrivacyAvailable_: boolean;
|
||||
+ declare private heliumNoiseAvailable_: boolean;
|
||||
declare private dbdDeletionConfirmationToastLabel_: string;
|
||||
declare private shouldShowDbdDeletionConfirmationToast_: boolean;
|
||||
|
||||
@@ -128,6 +134,12 @@ export class SettingsPrivacyPageElement
|
||||
Router.getInstance().navigateTo(routes.COOKIES);
|
||||
}
|
||||
|
||||
+ private onNoiseClick_() {
|
||||
+ this.interactedWithPage_();
|
||||
+
|
||||
+ Router.getInstance().navigateTo(routes.NOISE);
|
||||
+ }
|
||||
+
|
||||
private onCbdDialogClosed_() {
|
||||
Router.getInstance().navigateTo(routes.CLEAR_BROWSER_DATA.parent!);
|
||||
|
||||
@@ -233,6 +245,10 @@ export class SettingsPrivacyPageElement
|
||||
override getFocusConfig() {
|
||||
const map = new Map();
|
||||
|
||||
+ if (routes.NOISE) {
|
||||
+ map.set(routes.NOISE.path, '#noiseLinkRow');
|
||||
+ }
|
||||
+
|
||||
if (routes.HELIUM_SERVICES) {
|
||||
map.set(routes.HELIUM_SERVICES.path, '#heliumServicesLinkRow');
|
||||
}
|
||||
@@ -264,6 +280,9 @@ export class SettingsPrivacyPageElement
|
||||
override getAssociatedControlFor(childViewId: string): HTMLElement {
|
||||
let triggerId: string|null = null;
|
||||
switch (childViewId) {
|
||||
+ case 'noise':
|
||||
+ triggerId = 'noiseLinkRow';
|
||||
+ break;
|
||||
case 'heliumServices':
|
||||
triggerId = 'heliumServicesLinkRow';
|
||||
break;
|
||||
--- a/chrome/browser/resources/settings/privacy_page/privacy_page_index.html
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/privacy_page_index.html
|
||||
@@ -93,6 +93,18 @@
|
||||
</settings-cookies-page>
|
||||
</template>
|
||||
|
||||
+ <template is="dom-if" if="[[heliumNoiseAvailable_]]" restamp>
|
||||
+ <template is="dom-if" if="[[renderView_(
|
||||
+ routes_.NOISE, currentRoute, inSearchMode)]]"
|
||||
+ update-when-false>
|
||||
+ <settings-noise-page slot="view"
|
||||
+ id="noise" data-parent-view-id="privacy"
|
||||
+ prefs="{{prefs}}"
|
||||
+ route-path$="[[routes_.NOISE.path]]">
|
||||
+ </settings-noise-page>
|
||||
+ </template>
|
||||
+ </template>
|
||||
+
|
||||
<template is="dom-if" if="[[!enableBundledSecuritySettings_]]">
|
||||
<template is="dom-if" if="[[renderView_(
|
||||
routes_.SECURITY, currentRoute, inSearchMode)]]" update-when-false>
|
||||
--- a/chrome/browser/resources/settings/privacy_page/privacy_page_index.ts
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/privacy_page_index.ts
|
||||
@@ -178,6 +178,12 @@ export class SettingsPrivacyPageIndexEle
|
||||
value: () => loadTimeData.getBoolean('isAdPrivacyAvailable'),
|
||||
},
|
||||
|
||||
+ heliumNoiseAvailable_: {
|
||||
+ type: Boolean,
|
||||
+ readOnly: true,
|
||||
+ value: () => loadTimeData.getBoolean('heliumNoiseAvailable'),
|
||||
+ },
|
||||
+
|
||||
isPrivacySandboxTopicsAndFledgeAvailable_: {
|
||||
type: Boolean,
|
||||
readOnly: true,
|
||||
@@ -217,6 +223,7 @@ export class SettingsPrivacyPageIndexEle
|
||||
declare private enableWebAppInstallation_: boolean;
|
||||
declare private enableWebBluetoothNewPermissionsBackend_: boolean;
|
||||
declare private isAdPrivacyAvailable_: boolean;
|
||||
+ declare private heliumNoiseAvailable_: boolean;
|
||||
declare private isPrivacySandboxTopicsAndFledgeAvailable_: boolean;
|
||||
|
||||
private pendingViewSwitching_: PromiseResolver<void> = new PromiseResolver();
|
||||
--- a/chrome/common/webui_url_constants.h
|
||||
+++ b/chrome/common/webui_url_constants.h
|
||||
@@ -590,6 +590,7 @@ inline constexpr char kExperimentalAISet
|
||||
inline constexpr char kFileSystemSettingsSubpage[] =
|
||||
"content/filesystem/siteDetails";
|
||||
inline constexpr char kFileSystemSubpage[] = "content/filesystem";
|
||||
+inline constexpr char kNoiseSubPage[] = "privacy/noise";
|
||||
inline constexpr char kGlicSettingsSubpage[] = "ai/gemini";
|
||||
inline constexpr char kGlicLoginSettingsSubpage[] = "ai/gemini/login";
|
||||
inline constexpr char kGoogleServicesSubpage[] = "googleServices";
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -1996,6 +1996,12 @@
|
||||
@@ -1993,6 +1993,12 @@
|
||||
users to manage security settings">
|
||||
Security
|
||||
</message>
|
||||
@@ -15,7 +15,7 @@
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -2340,9 +2340,9 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
@@ -2338,9 +2338,9 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_LEARN_MORE_ACCESSIBILITY_LABEL},
|
||||
// TODO(crbug.com/40122957): This string is no longer used. Remove.
|
||||
{"permissionsPageTitle", IDS_SETTINGS_PERMISSIONS},
|
||||
|
||||
@@ -188,19 +188,7 @@
|
||||
<div
|
||||
class="hr"
|
||||
hidden="[[!showHr_(
|
||||
@@ -160,11 +138,6 @@
|
||||
</settings-radio-group>
|
||||
</div>
|
||||
</template>
|
||||
- <div
|
||||
- class="hr"
|
||||
- hidden="[[!showHr_(
|
||||
- pageVisibility.homeButton, pageVisibility.bookmarksBar)]]">
|
||||
- </div>
|
||||
<template is="dom-if"
|
||||
if="[[!ntpSimplificationBookmarksBarEnabled_]]">
|
||||
<settings-toggle-button id="showBookmarksBar"
|
||||
@@ -250,12 +223,6 @@
|
||||
@@ -250,12 +228,6 @@
|
||||
hidden="[[showProjectsPanelEnabled_]]">
|
||||
</settings-toggle-button>
|
||||
|
||||
@@ -213,7 +201,7 @@
|
||||
<template is="dom-if" if="[[showCtrlTabMru_]]">
|
||||
<settings-toggle-button class="hr" id="ctrlTabMru"
|
||||
pref="{{prefs.browser.ctrl_tab_mru}}"
|
||||
@@ -370,10 +337,6 @@
|
||||
@@ -370,10 +342,6 @@
|
||||
</settings-toggle-button>
|
||||
</if>
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
Signed in to <ph name="EMAIL">$1<ex>abcd@google.com</ex></ph>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -2046,8 +2046,8 @@ void AddPersonalizationOptionsStrings(co
|
||||
@@ -2044,8 +2044,8 @@ void AddPersonalizationOptionsStrings(co
|
||||
{"enablePersonalizationLoggingDesc",
|
||||
IDS_SETTINGS_ENABLE_LOGGING_PREF_DESC},
|
||||
{"spellingDescription", IDS_SETTINGS_SPELLING_PREF_DESC},
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
warning_summary_ = l10n_util::GetStringUTF16(
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -3241,6 +3241,10 @@ are declared in tools/grit/grit_args.gni
|
||||
@@ -3235,6 +3235,10 @@ are declared in tools/grit/grit_args.gni
|
||||
desc="Status text for a download item that was interrupted because the file path name is too long.">
|
||||
File name or location is too long
|
||||
</message>
|
||||
@@ -101,7 +101,7 @@
|
||||
<message name="IDS_DOWNLOAD_BUBBLE_INTERRUPTED_SUBPAGE_SUMMARY_PATH_TOO_LONG"
|
||||
desc="Subpage summary text for a download item that was interrupted because the file path name is too long.">
|
||||
Try using a shorter file name or saving to a different folder
|
||||
@@ -3261,6 +3265,10 @@ are declared in tools/grit/grit_args.gni
|
||||
@@ -3255,6 +3259,10 @@ are declared in tools/grit/grit_args.gni
|
||||
desc="Status text for a download item that had something go wrong.">
|
||||
Something went wrong
|
||||
</message>
|
||||
|
||||
@@ -1,272 +0,0 @@
|
||||
--- a/chrome/browser/ui/startup/BUILD.gn
|
||||
+++ b/chrome/browser/ui/startup/BUILD.gn
|
||||
@@ -137,8 +137,10 @@ source_set("impl") {
|
||||
"//cc/base",
|
||||
"//chrome/app:branded_strings",
|
||||
"//chrome/app:generated_resources",
|
||||
+ "//chrome/app/vector_icons",
|
||||
"//chrome/browser:browser_features",
|
||||
"//chrome/browser:browser_process",
|
||||
+ "//chrome/browser/crash_upload_list",
|
||||
"//chrome/browser:defaults",
|
||||
"//chrome/browser/actor",
|
||||
"//chrome/browser/devtools",
|
||||
@@ -160,6 +162,7 @@ source_set("impl") {
|
||||
"//chrome/common:constants",
|
||||
"//chrome/common:non_code_constants",
|
||||
"//components/autofill/core/common",
|
||||
+ "//components/crash/core/app",
|
||||
"//components/history_clusters/core",
|
||||
"//components/infobars/content",
|
||||
"//components/infobars/core",
|
||||
@@ -183,6 +186,8 @@ source_set("impl") {
|
||||
"//services/webnn/public/mojom:features",
|
||||
"//third_party/abseil-cpp:absl",
|
||||
"//third_party/blink/public:runtime_features_for_public",
|
||||
+ "//third_party/crashpad/crashpad/client",
|
||||
+ "//third_party/crashpad/crashpad/util",
|
||||
"//ui/base",
|
||||
"//ui/gfx:native_ui_types",
|
||||
"//url",
|
||||
@@ -198,6 +203,8 @@ source_set("impl") {
|
||||
"features.cc",
|
||||
"google_api_keys_infobar_delegate.cc",
|
||||
"google_chrome_scheme_util.cc",
|
||||
+ "helium_crash_dialog_controller.cc",
|
||||
+ "helium_crash_dialog_controller.h",
|
||||
"infobar_utils.cc",
|
||||
"launch_mode_recorder.cc",
|
||||
"obsolete_system_infobar_delegate.cc",
|
||||
--- a/components/new_or_sad_tab_strings.grdp
|
||||
+++ b/components/new_or_sad_tab_strings.grdp
|
||||
@@ -24,6 +24,28 @@
|
||||
<message name="IDS_SAD_TAB_RELOAD_LABEL" desc="Button label in the sad tab page for reloading a page." formatter_data="android_java">
|
||||
Reload
|
||||
</message>
|
||||
+ <message name="IDS_HELIUM_CRASH_REPORTING_DIALOG_TITLE" desc="Title of the dialog asking whether to send one or more Helium crash reports. The report count is shown for multiple reports. [ICU Syntax]">
|
||||
+ {COUNT, plural, =1 {Would you like to send a crash report?} other {Would you like to send # crash reports?}}
|
||||
+ </message>
|
||||
+ <message name="IDS_HELIUM_CRASH_REPORTING_DIALOG_DESCRIPTION" desc="Introductory paragraph shown when one or more Helium crash reports are available.">
|
||||
+ Helium closed unexpectedly. A crash report could help us fix the issue you ran into and prevent it from happening again.
|
||||
+ </message>
|
||||
+ <message name="IDS_HELIUM_CRASH_REPORTING_DIALOG_PRIVACY" desc="Paragraph warning that a crash report may contain sensitive information from Helium's memory.">
|
||||
+ A crash report may incidentally include some sensitive data present in Helium's memory at the time of crash.
|
||||
+ </message>
|
||||
+ <message name="IDS_HELIUM_CRASH_REPORTING_DIALOG_OPTIONAL" desc="Paragraph explaining that no crash report has been sent yet and that sending reports is optional.">
|
||||
+ Nothing has been sent yet. Sending a crash report is optional.
|
||||
+ </message>
|
||||
+ <if expr="use_titlecase">
|
||||
+ <message name="IDS_HELIUM_CRASH_REPORTING_DIALOG_SEND_REPORT" desc="In Title Case: Button label for sending one or more crash reports. The report count is shown for multiple reports. [ICU Syntax]">
|
||||
+ {COUNT, plural, =1 {Send Report} other {Send # Reports}}
|
||||
+ </message>
|
||||
+ </if>
|
||||
+ <if expr="not use_titlecase">
|
||||
+ <message name="IDS_HELIUM_CRASH_REPORTING_DIALOG_SEND_REPORT" desc="Button label for sending one or more crash reports. The report count is shown for multiple reports. [ICU Syntax]">
|
||||
+ {COUNT, plural, =1 {Send report} other {Send # reports}}
|
||||
+ </message>
|
||||
+ </if>
|
||||
<if expr="is_android or is_ios">
|
||||
<message name="IDS_SAD_TAB_SEND_FEEDBACK_LABEL" desc="Button label in the sad tab page for sending feedback. This label replaces the reload button after a crash happens twice in a row." formatter_data="android_java">
|
||||
Send Feedback
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/startup/helium_crash_dialog_controller.cc
|
||||
@@ -0,0 +1,163 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+#include "chrome/browser/ui/startup/helium_crash_dialog_controller.h"
|
||||
+
|
||||
+#include <memory>
|
||||
+#include <set>
|
||||
+#include <string>
|
||||
+#include <utility>
|
||||
+#include <vector>
|
||||
+
|
||||
+#include "base/functional/bind.h"
|
||||
+#include "base/i18n/message_formatter.h"
|
||||
+#include "base/no_destructor.h"
|
||||
+#include "chrome/app/vector_icons/vector_icons.h"
|
||||
+#include "chrome/browser/crash_upload_list/helium_crash_reporting.h"
|
||||
+#include "chrome/browser/profiles/profile.h"
|
||||
+#include "chrome/browser/ui/browser_window/public/browser_window_interface.h"
|
||||
+#include "chrome/browser/ui/dialogs/browser_dialogs.h"
|
||||
+#include "chrome/grit/generated_resources.h"
|
||||
+#include "components/crash/core/app/crashpad.h"
|
||||
+#include "components/strings/grit/components_strings.h"
|
||||
+#include "ui/base/l10n/l10n_util.h"
|
||||
+#include "ui/base/mojom/dialog_button.mojom.h"
|
||||
+#include "ui/base/models/dialog_model.h"
|
||||
+#include "ui/base/models/dialog_model_host.h"
|
||||
+#include "ui/base/models/image_model.h"
|
||||
+#include "ui/color/color_id.h"
|
||||
+
|
||||
+namespace {
|
||||
+
|
||||
+constexpr int kCrashDialogIconSize = 32;
|
||||
+
|
||||
+std::set<std::string>& ReservedReportIds() {
|
||||
+ static base::NoDestructor<std::set<std::string>> reports;
|
||||
+ return *reports;
|
||||
+}
|
||||
+
|
||||
+class HeliumCrashDialogDelegate : public ui::DialogModelDelegate {
|
||||
+ public:
|
||||
+ explicit HeliumCrashDialogDelegate(std::vector<std::string> report_ids)
|
||||
+ : report_ids_(std::move(report_ids)) {}
|
||||
+
|
||||
+ HeliumCrashDialogDelegate(const HeliumCrashDialogDelegate&) = delete;
|
||||
+ HeliumCrashDialogDelegate& operator=(const HeliumCrashDialogDelegate&) =
|
||||
+ delete;
|
||||
+ ~HeliumCrashDialogDelegate() override = default;
|
||||
+
|
||||
+ void OnDontAskAgain(const ui::Event&) {
|
||||
+ Resolve(/*upload=*/false);
|
||||
+ helium::SetCrashReportingMode(helium::CrashReportingMode::kDisabled);
|
||||
+ dialog_model()->host()->Close();
|
||||
+ }
|
||||
+
|
||||
+ void OnAccepted() { Resolve(/*upload=*/true); }
|
||||
+
|
||||
+ void OnDismissed() { Resolve(/*upload=*/false); }
|
||||
+
|
||||
+ private:
|
||||
+ void Resolve(bool upload) {
|
||||
+ if (resolved_) {
|
||||
+ return;
|
||||
+ }
|
||||
+ resolved_ = true;
|
||||
+
|
||||
+ const bool can_upload = upload && !helium::UploadsDisabledByPolicy();
|
||||
+ for (const std::string& report_id : report_ids_) {
|
||||
+ ReservedReportIds().erase(report_id);
|
||||
+ if (can_upload) {
|
||||
+ crash_reporter::RequestSingleCrashUpload(report_id);
|
||||
+ } else {
|
||||
+ crash_reporter::DeleteCrashReport(report_id);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ const std::vector<std::string> report_ids_;
|
||||
+ bool resolved_ = false;
|
||||
+};
|
||||
+
|
||||
+std::u16string FormatPluralString(int message_id, size_t report_count) {
|
||||
+ return base::i18n::MessageFormatter::FormatWithNamedArgs(
|
||||
+ l10n_util::GetStringUTF16(message_id), "COUNT",
|
||||
+ static_cast<int>(report_count));
|
||||
+}
|
||||
+
|
||||
+std::unique_ptr<ui::DialogModel> BuildCrashDialog(
|
||||
+ std::vector<std::string> report_ids) {
|
||||
+ const size_t report_count = report_ids.size();
|
||||
+ auto delegate =
|
||||
+ std::make_unique<HeliumCrashDialogDelegate>(std::move(report_ids));
|
||||
+ HeliumCrashDialogDelegate* delegate_ptr = delegate.get();
|
||||
+
|
||||
+ return ui::DialogModel::Builder(std::move(delegate))
|
||||
+ .SetTitle(FormatPluralString(IDS_HELIUM_CRASH_REPORTING_DIALOG_TITLE,
|
||||
+ report_count))
|
||||
+ .SetIcon(ui::ImageModel::FromVectorIcon(
|
||||
+ kSadTabIcon, ui::kColorIcon, kCrashDialogIconSize))
|
||||
+ .AddParagraph(ui::DialogModelLabel(
|
||||
+ IDS_HELIUM_CRASH_REPORTING_DIALOG_DESCRIPTION))
|
||||
+ .AddParagraph(ui::DialogModelLabel(
|
||||
+ IDS_HELIUM_CRASH_REPORTING_DIALOG_PRIVACY))
|
||||
+ .AddParagraph(ui::DialogModelLabel(
|
||||
+ IDS_HELIUM_CRASH_REPORTING_DIALOG_OPTIONAL))
|
||||
+ .AddExtraButton(
|
||||
+ base::BindRepeating(&HeliumCrashDialogDelegate::OnDontAskAgain,
|
||||
+ base::Unretained(delegate_ptr)),
|
||||
+ ui::DialogModel::Button::Params().SetLabel(
|
||||
+ l10n_util::GetStringUTF16(
|
||||
+ IDS_TAB_GROUP_DELETION_DIALOG_DONT_ASK)))
|
||||
+ .AddCancelButton(
|
||||
+ base::BindOnce(&HeliumCrashDialogDelegate::OnDismissed,
|
||||
+ base::Unretained(delegate_ptr)),
|
||||
+ ui::DialogModel::Button::Params().SetLabel(
|
||||
+ l10n_util::GetStringUTF16(IDS_NO_THANKS)))
|
||||
+ .AddOkButton(base::BindOnce(&HeliumCrashDialogDelegate::OnAccepted,
|
||||
+ base::Unretained(delegate_ptr)),
|
||||
+ ui::DialogModel::Button::Params().SetLabel(
|
||||
+ FormatPluralString(
|
||||
+ IDS_HELIUM_CRASH_REPORTING_DIALOG_SEND_REPORT,
|
||||
+ report_count)))
|
||||
+ .OverrideDefaultButton(ui::mojom::DialogButton::kNone)
|
||||
+ .OverrideShowCloseButton(/*show_close_button=*/true)
|
||||
+ .SetCloseActionCallback(
|
||||
+ base::BindOnce(&HeliumCrashDialogDelegate::OnDismissed,
|
||||
+ base::Unretained(delegate_ptr)))
|
||||
+ .SetDialogDestroyingCallback(
|
||||
+ base::BindOnce(&HeliumCrashDialogDelegate::OnDismissed,
|
||||
+ base::Unretained(delegate_ptr)))
|
||||
+ .Build();
|
||||
+}
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
+void MaybeShowHeliumCrashDialog(BrowserWindowInterface* browser) {
|
||||
+ if (!browser || browser->GetType() != BrowserWindowInterface::TYPE_NORMAL ||
|
||||
+ !browser->GetProfile()->IsRegularProfile()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (helium::UploadsDisabledByPolicy() ||
|
||||
+ helium::GetCrashReportingMode() != helium::CrashReportingMode::kAsk) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ std::vector<crash_reporter::Report> reports;
|
||||
+ crash_reporter::GetReports(&reports);
|
||||
+ std::vector<std::string> report_ids;
|
||||
+ for (const auto& report : reports) {
|
||||
+ if (report.state != crash_reporter::ReportUploadState::Pending ||
|
||||
+ !ReservedReportIds().insert(report.local_id).second) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ report_ids.emplace_back(report.local_id);
|
||||
+ }
|
||||
+ if (report_ids.empty()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ chrome::ShowBrowserModal(browser->GetBrowserForMigrationOnly(),
|
||||
+ BuildCrashDialog(std::move(report_ids)));
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/startup/helium_crash_dialog_controller.h
|
||||
@@ -0,0 +1,12 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+#ifndef CHROME_BROWSER_UI_STARTUP_HELIUM_CRASH_DIALOG_CONTROLLER_H_
|
||||
+#define CHROME_BROWSER_UI_STARTUP_HELIUM_CRASH_DIALOG_CONTROLLER_H_
|
||||
+
|
||||
+class BrowserWindowInterface;
|
||||
+
|
||||
+void MaybeShowHeliumCrashDialog(BrowserWindowInterface* browser);
|
||||
+
|
||||
+#endif // CHROME_BROWSER_UI_STARTUP_HELIUM_CRASH_DIALOG_CONTROLLER_H_
|
||||
--- a/chrome/browser/ui/startup/infobar_utils.cc
|
||||
+++ b/chrome/browser/ui/startup/infobar_utils.cc
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "chrome/browser/ui/startup/bad_flags_prompt.h"
|
||||
#include "chrome/browser/ui/startup/bidding_and_auction_consented_debugging_infobar_delegate.h"
|
||||
#include "chrome/browser/ui/startup/google_api_keys_infobar_delegate.h"
|
||||
+#include "chrome/browser/ui/startup/helium_crash_dialog_controller.h"
|
||||
#include "chrome/browser/ui/startup/obsolete_system_infobar_delegate.h"
|
||||
#include "chrome/browser/ui/startup/oscryptasync_availability_infobar_delegate.h"
|
||||
#include "chrome/browser/ui/startup/startup_browser_creator.h"
|
||||
@@ -164,6 +165,10 @@ void AddInfoBarsIfNecessary(BrowserWindo
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (is_post_crash_launch) {
|
||||
+ MaybeShowHeliumCrashDialog(browser);
|
||||
+ }
|
||||
+
|
||||
// The below info bars are only added to the first profile which is
|
||||
// launched. Other profiles might be restoring the browsing sessions
|
||||
// asynchronously, so we cannot add the info bars to the focused tabs here.
|
||||
@@ -1,180 +0,0 @@
|
||||
--- a/chrome/browser/ui/webui/crashes/crashes_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/crashes/crashes_ui.cc
|
||||
@@ -17,17 +17,20 @@
|
||||
#include "base/values.h"
|
||||
#include "base/version_info/version_info.h"
|
||||
#include "build/build_config.h"
|
||||
+#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/crash_upload_list/crash_upload_list.h"
|
||||
-#include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
|
||||
-#include "chrome/browser/metrics/metrics_reporting_state.h"
|
||||
+#include "chrome/browser/crash_upload_list/helium_crash_reporting.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/signin/identity_manager_factory.h"
|
||||
+#include "chrome/common/pref_names.h"
|
||||
#include "chrome/common/webui_url_constants.h"
|
||||
#include "chrome/grit/branded_strings.h"
|
||||
+#include "components/crash/core/app/crashpad.h"
|
||||
#include "components/crash/core/browser/crashes_ui_util.h"
|
||||
#include "components/grit/components_scaled_resources.h"
|
||||
#include "components/grit/crashes_resources.h"
|
||||
#include "components/grit/crashes_resources_map.h"
|
||||
+#include "components/prefs/pref_service.h"
|
||||
#include "components/signin/public/base/consent_level.h"
|
||||
#include "components/signin/public/identity_manager/identity_manager.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
@@ -178,8 +181,11 @@ void CrashesDOMHandler::OnUploadListAvai
|
||||
}
|
||||
|
||||
void CrashesDOMHandler::UpdateUI() {
|
||||
+ const helium::CrashReportingMode crash_reporting_mode =
|
||||
+ helium::GetCrashReportingMode();
|
||||
bool crash_reporting_enabled =
|
||||
- ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled();
|
||||
+ crash_reporting_mode == helium::CrashReportingMode::kAutomatic &&
|
||||
+ !helium::UploadsDisabledByPolicy();
|
||||
|
||||
bool system_crash_reporter = false;
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
@@ -203,23 +209,22 @@ void CrashesDOMHandler::UpdateUI() {
|
||||
#endif
|
||||
bool allow_manual_uploads =
|
||||
manual_uploads_supported &&
|
||||
- (crash_reporting_enabled || !metrics::IsMetricsReportingPolicyManaged());
|
||||
+ crash_reporting_mode != helium::CrashReportingMode::kDisabled &&
|
||||
+ !helium::UploadsDisabledByPolicy();
|
||||
|
||||
// Show crash reports regardless of |crash_reporting_enabled| when it is
|
||||
// possible to manually upload reports.
|
||||
- bool upload_list = manual_uploads_supported || crash_reporting_enabled;
|
||||
-
|
||||
base::ListValue crash_list;
|
||||
- if (upload_list) {
|
||||
- crash_reporter::UploadListToValue(upload_list_.get(), &crash_list);
|
||||
- }
|
||||
+ crash_reporter::UploadListToValue(upload_list_.get(), &crash_list);
|
||||
|
||||
base::DictValue result;
|
||||
result.Set("enabled", crash_reporting_enabled);
|
||||
+ result.Set("reportingAvailable",
|
||||
+ crash_reporting_enabled || allow_manual_uploads);
|
||||
result.Set("dynamicBackend", system_crash_reporter);
|
||||
result.Set("manualUploads", allow_manual_uploads);
|
||||
result.Set("crashes", std::move(crash_list));
|
||||
- result.Set("version", version_info::GetVersionNumber());
|
||||
+ result.Set("version", version_info::GetHeliumVersionNumber());
|
||||
result.Set("os", base::SysInfo::OperatingSystemName() + " " +
|
||||
base::SysInfo::OperatingSystemVersion());
|
||||
result.Set("isGoogleAccount", is_internal);
|
||||
@@ -228,9 +233,10 @@ void CrashesDOMHandler::UpdateUI() {
|
||||
|
||||
void CrashesDOMHandler::HandleRequestSingleCrashUpload(
|
||||
const base::ListValue& args) {
|
||||
- // Only allow manual uploads if crash uploads aren’t disabled by policy.
|
||||
- if (!ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled() &&
|
||||
- metrics::IsMetricsReportingPolicyManaged()) {
|
||||
+ const helium::CrashReportingMode crash_reporting_mode =
|
||||
+ helium::GetCrashReportingMode();
|
||||
+ if (crash_reporting_mode == helium::CrashReportingMode::kDisabled ||
|
||||
+ helium::UploadsDisabledByPolicy()) {
|
||||
return;
|
||||
}
|
||||
|
||||
--- a/components/crash/core/browser/resources/crashes.ts
|
||||
+++ b/components/crash/core/browser/resources/crashes.ts
|
||||
@@ -62,6 +62,7 @@ interface CrashData {
|
||||
|
||||
interface UpdateCrashListParams {
|
||||
enabled: boolean;
|
||||
+ reportingAvailable: boolean;
|
||||
dynamicBackend: boolean;
|
||||
manualUploads: boolean;
|
||||
crashes: CrashData[];
|
||||
@@ -75,6 +76,7 @@ interface UpdateCrashListParams {
|
||||
*/
|
||||
function updateCrashList({
|
||||
enabled,
|
||||
+ reportingAvailable,
|
||||
dynamicBackend,
|
||||
manualUploads,
|
||||
crashes,
|
||||
@@ -87,7 +89,7 @@ function updateCrashList({
|
||||
|
||||
const crashList = getRequiredElement('crashList');
|
||||
|
||||
- getRequiredElement('disabledMode').hidden = enabled;
|
||||
+ getRequiredElement('disabledMode').hidden = reportingAvailable;
|
||||
getRequiredElement('crashUploadStatus').hidden = !enabled || !dynamicBackend;
|
||||
|
||||
const template = crashList.querySelector('template');
|
||||
@@ -210,37 +212,18 @@ function updateCrashList({
|
||||
*/
|
||||
function fileBug(crashId: string, os: string, version: string) {
|
||||
const commentLines = [
|
||||
- 'IMPORTANT: Your crash has already been automatically reported ' +
|
||||
- 'to our crash system. Please file this bug only if you can provide ' +
|
||||
- 'more information about it.',
|
||||
- '',
|
||||
- '',
|
||||
- 'Chrome Version: ' + version,
|
||||
- 'Operating System: ' + os,
|
||||
- '',
|
||||
- 'URL (if applicable) where crash occurred:',
|
||||
- '',
|
||||
- 'Can you reproduce this crash?',
|
||||
- '',
|
||||
- 'What steps will reproduce this crash? (If it\'s not ' +
|
||||
- 'reproducible, what were you doing just before the crash?)',
|
||||
- '1.',
|
||||
- '2.',
|
||||
- '3.',
|
||||
- '',
|
||||
- '****DO NOT CHANGE BELOW THIS LINE****',
|
||||
- 'Crash ID: crash/' + crashId,
|
||||
+ `Crash ID: ${crashId}`,
|
||||
+ 'IMPORTANT: Your crash has already been reported to our crash system. ' +
|
||||
+ 'Please file this issue only if you can provide more information ' +
|
||||
+ 'about it.',
|
||||
];
|
||||
const params: {[key: string]: string} = {
|
||||
- template: 'Crash Report',
|
||||
- comment: commentLines.join('\n'),
|
||||
- // TODO(scottmg): Use add_labels to add 'User-Submitted' rather than
|
||||
- // duplicating the template's labels (the first two) once
|
||||
- // https://bugs.chromium.org/p/monorail/issues/detail?id=1488 is done.
|
||||
- labels:
|
||||
- 'Restrict-View-EditIssue,Stability-Crash,User-Submitted,Pri-3,Type-Bug',
|
||||
+ template: 'bug-report.yml',
|
||||
+ version,
|
||||
+ os,
|
||||
+ additional: commentLines.join('\n'),
|
||||
};
|
||||
- let href = 'https://bugs.chromium.org/p/chromium/issues/entry';
|
||||
+ let href = 'https://github.com/imputnet/helium/issues/new';
|
||||
for (const param in params) {
|
||||
href = appendParam(href, param, params[param]!);
|
||||
}
|
||||
--- a/components/components_chromium_strings.grd
|
||||
+++ b/components/components_chromium_strings.grd
|
||||
@@ -267,7 +267,7 @@
|
||||
|
||||
<!-- chrome://crashes strings -->
|
||||
<message name="IDS_CRASH_DISABLED_MESSAGE" desc="The explanatory message for chrome://crashes when crash reporting is disabled">
|
||||
- Crash reporting is not available in Chromium.
|
||||
+ Crash reporting is disabled in Helium settings or by policy.
|
||||
</message>
|
||||
|
||||
<!-- Version UI -->
|
||||
--- a/components/crash_strings.grdp
|
||||
+++ b/components/crash_strings.grdp
|
||||
@@ -43,8 +43,8 @@
|
||||
Size:
|
||||
</message>
|
||||
|
||||
- <message name="IDS_CRASH_BUG_LINK_LABEL" desc="Link text for filing a crash bug on chrome://crashes">
|
||||
- Provide additional details
|
||||
+ <message name="IDS_CRASH_BUG_LINK_LABEL" desc="Link text for creating an issue with additional details in Helium's GitHub repo">
|
||||
+ Create an issue with details
|
||||
</message>
|
||||
<message name="IDS_CRASH_NO_CRASHES_MESSAGE" desc="The explanatory message for chrome://crashes when there are no crashes">
|
||||
You have no recently reported crashes. Crashes that occurred when crash reporting was disabled will not appear here.
|
||||
@@ -58,7 +58,7 @@
|
||||
}
|
||||
|
||||
void BrowserView::OnWidgetBoundsChanged(views::Widget* widget,
|
||||
@@ -5551,7 +5574,20 @@ void BrowserView::LoadAccelerators() {
|
||||
@@ -5545,7 +5568,20 @@ void BrowserView::LoadAccelerators() {
|
||||
browser_->GetProfile()->IsOffTheRecord() &&
|
||||
browser_->GetProfile()->GetOTRProfileID().IsCaptivePortal();
|
||||
#endif
|
||||
@@ -80,7 +80,7 @@
|
||||
for (const auto& entry : accelerator_list) {
|
||||
// In app mode, only allow accelerators of allowlisted commands to pass
|
||||
// through.
|
||||
@@ -5578,11 +5614,13 @@ void BrowserView::LoadAccelerators() {
|
||||
@@ -5572,11 +5608,13 @@ void BrowserView::LoadAccelerators() {
|
||||
#endif
|
||||
|
||||
ui::Accelerator accelerator(entry.keycode, entry.modifiers);
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
|
||||
// Register the Esc accelerators (both press and release) to ensure they are
|
||||
@@ -5602,6 +5640,33 @@ void BrowserView::LoadAccelerators() {
|
||||
@@ -5596,6 +5634,33 @@ void BrowserView::LoadAccelerators() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,47 +1,164 @@
|
||||
--- a/chrome/browser/ui/views/frame/custom_floating_corner.cc
|
||||
+++ b/chrome/browser/ui/views/frame/custom_floating_corner.cc
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
#include "base/i18n/rtl.h"
|
||||
#include "chrome/browser/ui/color/chrome_color_provider_utils.h"
|
||||
-#include "chrome/browser/ui/layout_constants.h"
|
||||
#include "chrome/browser/ui/views/frame/browser_view.h"
|
||||
+#include "chrome/browser/ui/views/helium/frame_corner_radius.h"
|
||||
#include "third_party/skia/include/core/SkPathBuilder.h"
|
||||
#include "ui/base/metadata/metadata_impl_macros.h"
|
||||
#include "ui/base/ui_base_features.h"
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "ui/gfx/color_utils.h"
|
||||
#include "ui/gfx/scoped_canvas.h"
|
||||
#include "ui/views/controls/separator.h"
|
||||
-#include "ui/views/layout/layout_provider.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -48,13 +47,11 @@ CustomFloatingCorner::CornerOrientation
|
||||
CustomFloatingCorner::CustomFloatingCorner(
|
||||
BrowserView& browser_view,
|
||||
CornerOrientation orientation,
|
||||
- views::ShapeContextTokens corner_radius_token,
|
||||
ColorChoice color,
|
||||
std::optional<ui::ColorId> stroke_color,
|
||||
bool is_vertical_window_edge)
|
||||
: CustomCorners(browser_view),
|
||||
orientation_(orientation),
|
||||
- corner_radius_token_(corner_radius_token),
|
||||
color_(color),
|
||||
stroke_color_(stroke_color),
|
||||
is_vertical_window_edge_(is_vertical_window_edge) {
|
||||
@@ -82,16 +79,6 @@ void CustomFloatingCorner::SetOrientatio
|
||||
SchedulePaint();
|
||||
}
|
||||
|
||||
-void CustomFloatingCorner::SetCornerRadius(
|
||||
- views::ShapeContextTokens corner_radius_token) {
|
||||
- if (corner_radius_token == corner_radius_token_) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- corner_radius_token_ = corner_radius_token;
|
||||
- PreferredSizeChanged();
|
||||
-}
|
||||
-
|
||||
void CustomFloatingCorner::SetStroke(std::optional<ui::ColorId> stroke_color,
|
||||
bool is_vertical_window_edge) {
|
||||
if (stroke_color_ == stroke_color &&
|
||||
@@ -114,19 +101,8 @@ void CustomFloatingCorner::SetStroke(std
|
||||
|
||||
gfx::Size CustomFloatingCorner::CalculatePreferredSize(
|
||||
const views::SizeBounds& available_size) const {
|
||||
- // This can return nullptr when there is no Widget (for context, see
|
||||
- // http://crbug.com/40178332). The nullptr dereference does not always
|
||||
- // crash due to compiler optimizations, so CHECKing here ensures we crash.
|
||||
- CHECK(GetLayoutProvider());
|
||||
- const float corner_radius =
|
||||
- GetLayoutProvider()->GetCornerRadiusMetric(corner_radius_token_);
|
||||
- const float horizontal_size =
|
||||
- corner_radius + (stroke_color_ ? views::Separator::kThickness : 0);
|
||||
- const float vertical_size =
|
||||
- corner_radius + (stroke_color_ && !is_vertical_window_edge_
|
||||
- ? views::Separator::kThickness
|
||||
- : 0);
|
||||
- return gfx::Size(horizontal_size, vertical_size);
|
||||
+ const int corner_radius = GetGenericFrameRadius();
|
||||
+ return gfx::Size(corner_radius, corner_radius);
|
||||
}
|
||||
|
||||
void CustomFloatingCorner::OnPaint(gfx::Canvas* canvas) {
|
||||
@@ -136,9 +112,8 @@ void CustomFloatingCorner::OnPaint(gfx::
|
||||
gfx::ScopedCanvas scoped(canvas);
|
||||
|
||||
// This assumes that the view has gotten its preferred size, however, it will
|
||||
- // scale gracefully if it is not that size. The view should be the preferred
|
||||
- // corner radius in each dimension, plus the stroke thickness if there is a
|
||||
- // stroke.
|
||||
+ // scale gracefully if it is not that size. The view is the outer corner
|
||||
+ // radius; the stroked arc is inset by the separator thickness.
|
||||
const bool has_stroke = stroke_color_.has_value();
|
||||
const bool extend_vertical = has_stroke && !is_vertical_window_edge_;
|
||||
const SkVector corner_radius(
|
||||
--- a/chrome/browser/ui/views/frame/custom_floating_corner.h
|
||||
+++ b/chrome/browser/ui/views/frame/custom_floating_corner.h
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "ui/base/metadata/metadata_header_macros.h"
|
||||
#include "ui/color/color_id.h"
|
||||
#include "ui/views/background.h"
|
||||
-#include "ui/views/layout/layout_provider.h"
|
||||
#include "ui/views/layout/layout_types.h"
|
||||
#include "ui/views/view.h"
|
||||
|
||||
@@ -39,7 +38,6 @@ class CustomFloatingCorner : public view
|
||||
|
||||
CustomFloatingCorner(BrowserView& browser_view,
|
||||
CornerOrientation orientation,
|
||||
- views::ShapeContextTokens corner_radius_token,
|
||||
ColorChoice color,
|
||||
std::optional<ui::ColorId> stroke_color = std::nullopt,
|
||||
bool is_vertical_window_edge = false);
|
||||
@@ -51,9 +49,6 @@ class CustomFloatingCorner : public view
|
||||
// Sets the corner orientation.
|
||||
void SetOrientation(CornerOrientation orientation);
|
||||
|
||||
- // Set the corner radius.
|
||||
- void SetCornerRadius(views::ShapeContextTokens corner_radius_token);
|
||||
-
|
||||
// Sets a stroke, or no stroke (std::nullopt). If `is_vertical_window_edge` is
|
||||
// true, the stroke ends outside the vertical bounds of the corner.
|
||||
void SetStroke(std::optional<ui::ColorId> stroke_color,
|
||||
@@ -74,7 +69,6 @@ class CustomFloatingCorner : public view
|
||||
void SchedulePaintHost() override;
|
||||
|
||||
CornerOrientation orientation_;
|
||||
- views::ShapeContextTokens corner_radius_token_;
|
||||
ColorChoice color_;
|
||||
std::optional<ui::ColorId> stroke_color_;
|
||||
bool is_vertical_window_edge_ = false;
|
||||
--- a/chrome/browser/ui/views/frame/multi_contents_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/multi_contents_view.cc
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "chrome/browser/ui/views/frame/contents_container_view.h"
|
||||
#include "chrome/browser/ui/views/frame/contents_separator.h"
|
||||
#include "chrome/browser/ui/views/frame/contents_web_view.h"
|
||||
-#include "chrome/browser/ui/views/frame/custom_floating_corner.h"
|
||||
#include "chrome/browser/ui/views/frame/multi_contents_background_view.h"
|
||||
#include "chrome/browser/ui/views/frame/multi_contents_drop_target_view.h"
|
||||
#include "chrome/browser/ui/views/frame/multi_contents_resize_area.h"
|
||||
@@ -62,7 +61,6 @@ void MultiContentsView::ContentsSeparato
|
||||
top_separator = nullptr;
|
||||
@@ -63,6 +63,7 @@ void MultiContentsView::ContentsSeparato
|
||||
leading_separator = nullptr;
|
||||
trailing_separator = nullptr;
|
||||
- corner_separator = nullptr;
|
||||
corner_separator = nullptr;
|
||||
+ trailing_corner_separator = nullptr;
|
||||
leading_side_chrome_attached = false;
|
||||
trailing_side_chrome_attached = false;
|
||||
}
|
||||
@@ -117,15 +115,6 @@ MultiContentsView::MultiContentsView(
|
||||
contents_separators_.trailing_separator->SetProperty(
|
||||
views::kElementIdentifierKey, kContentsSeparatorTrailingEdgeElementId);
|
||||
|
||||
- contents_separators_.corner_separator =
|
||||
- AddChildView(std::make_unique<CustomFloatingCorner>(
|
||||
- *browser_view_, CustomFloatingCorner::CornerOrientation::kTopLeading,
|
||||
@@ -120,12 +121,17 @@ MultiContentsView::MultiContentsView(
|
||||
contents_separators_.corner_separator =
|
||||
AddChildView(std::make_unique<CustomFloatingCorner>(
|
||||
*browser_view_, CustomFloatingCorner::CornerOrientation::kTopLeading,
|
||||
- views::ShapeContextTokens::kContentSeparatorRadius,
|
||||
- CustomFloatingCorner::ToolbarTheme(),
|
||||
- kColorToolbarContentAreaSeparator));
|
||||
- contents_separators_.corner_separator->SetProperty(
|
||||
- views::kElementIdentifierKey, kContentsSeparatorTopCornerElementId);
|
||||
-
|
||||
CustomFloatingCorner::ToolbarTheme(),
|
||||
kColorToolbarContentAreaSeparator));
|
||||
contents_separators_.corner_separator->SetProperty(
|
||||
views::kElementIdentifierKey, kContentsSeparatorTopCornerElementId);
|
||||
|
||||
+ contents_separators_.trailing_corner_separator =
|
||||
+ AddChildView(std::make_unique<CustomFloatingCorner>(
|
||||
+ *browser_view_, CustomFloatingCorner::CornerOrientation::kTopTrailing,
|
||||
+ CustomFloatingCorner::ToolbarTheme(),
|
||||
+ kColorToolbarContentAreaSeparator));
|
||||
+
|
||||
for (auto* contents_container_view : contents_container_views_) {
|
||||
auto& view_map = container_focusable_map_[contents_container_view];
|
||||
|
||||
@@ -662,8 +651,6 @@ gfx::Rect MultiContentsView::CalculateSe
|
||||
@@ -664,6 +670,9 @@ gfx::Rect MultiContentsView::CalculateSe
|
||||
false, gfx::Rect());
|
||||
child_layouts.emplace_back(contents_separators_.trailing_separator.get(),
|
||||
child_layouts.emplace_back(contents_separators_.corner_separator.get(),
|
||||
false, gfx::Rect());
|
||||
- child_layouts.emplace_back(contents_separators_.corner_separator.get(),
|
||||
- false, gfx::Rect());
|
||||
+ child_layouts.emplace_back(
|
||||
+ contents_separators_.trailing_corner_separator.get(), false,
|
||||
+ gfx::Rect());
|
||||
return available_space;
|
||||
}
|
||||
|
||||
@@ -680,6 +667,7 @@ gfx::Rect MultiContentsView::CalculateSe
|
||||
@@ -680,6 +689,7 @@ gfx::Rect MultiContentsView::CalculateSe
|
||||
gfx::Rect(available_space.origin(), {width, separator_height}));
|
||||
|
||||
const bool should_show_leading =
|
||||
@@ -49,7 +166,7 @@
|
||||
drop_target_view_->side() == MultiContentsDropTargetView::DropSide::START;
|
||||
const int leading_separator_width =
|
||||
should_show_leading
|
||||
@@ -690,6 +678,7 @@ gfx::Rect MultiContentsView::CalculateSe
|
||||
@@ -690,6 +700,7 @@ gfx::Rect MultiContentsView::CalculateSe
|
||||
gfx::Rect(available_space.origin(), {leading_separator_width, height}));
|
||||
|
||||
const bool should_show_trailing =
|
||||
@@ -57,51 +174,44 @@
|
||||
drop_target_view_->side() == MultiContentsDropTargetView::DropSide::END;
|
||||
|
||||
const int trailing_separator_width =
|
||||
@@ -701,29 +690,6 @@ gfx::Rect MultiContentsView::CalculateSe
|
||||
@@ -701,7 +712,6 @@ gfx::Rect MultiContentsView::CalculateSe
|
||||
gfx::Rect(available_space.right() - trailing_separator_width,
|
||||
available_space.y(), trailing_separator_width, height));
|
||||
|
||||
- // Place the corner separator and set its orientation.
|
||||
- auto* const corner_separator = contents_separators_.corner_separator.get();
|
||||
- const auto corner_preferred_size = corner_separator->GetPreferredSize();
|
||||
- views::ChildLayout corner_layout(
|
||||
- corner_separator, contents_separators_.should_show_top &&
|
||||
- (should_show_leading || should_show_trailing));
|
||||
- if (corner_layout.visible) {
|
||||
- if (should_show_leading) {
|
||||
- corner_layout.bounds =
|
||||
- gfx::Rect(available_space.origin(), corner_preferred_size);
|
||||
- corner_separator->SetOrientation(
|
||||
- CustomFloatingCorner::CornerOrientation::kTopLeading);
|
||||
- } else {
|
||||
- corner_layout.bounds = gfx::Rect(
|
||||
- gfx::Point(available_space.right() - corner_preferred_size.width(),
|
||||
- available_space.y()),
|
||||
- corner_preferred_size);
|
||||
- corner_separator->SetOrientation(
|
||||
- CustomFloatingCorner::CornerOrientation::kTopTrailing);
|
||||
- }
|
||||
- }
|
||||
- child_layouts.push_back(corner_layout);
|
||||
-
|
||||
auto* const corner_separator = contents_separators_.corner_separator.get();
|
||||
const auto corner_preferred_size = corner_separator->GetPreferredSize();
|
||||
views::ChildLayout corner_layout(
|
||||
@@ -724,6 +734,22 @@ gfx::Rect MultiContentsView::CalculateSe
|
||||
}
|
||||
child_layouts.push_back(corner_layout);
|
||||
|
||||
+ auto* const trailing_corner_separator =
|
||||
+ contents_separators_.trailing_corner_separator.get();
|
||||
+ views::ChildLayout trailing_corner_layout(
|
||||
+ trailing_corner_separator,
|
||||
+ contents_separators_.should_show_top && should_show_leading &&
|
||||
+ should_show_trailing);
|
||||
+ if (trailing_corner_layout.visible) {
|
||||
+ trailing_corner_layout.bounds = gfx::Rect(
|
||||
+ gfx::Point(available_space.right() - corner_preferred_size.width(),
|
||||
+ available_space.y()),
|
||||
+ corner_preferred_size);
|
||||
+ trailing_corner_separator->SetOrientation(
|
||||
+ CustomFloatingCorner::CornerOrientation::kTopTrailing);
|
||||
+ }
|
||||
+ child_layouts.push_back(trailing_corner_layout);
|
||||
+
|
||||
return gfx::Rect(available_space.x() + leading_separator_width,
|
||||
available_space.y() + separator_height,
|
||||
width - trailing_separator_width - leading_separator_width,
|
||||
--- a/chrome/browser/ui/views/frame/multi_contents_view.h
|
||||
+++ b/chrome/browser/ui/views/frame/multi_contents_view.h
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
class BrowserView;
|
||||
class ContentsWebView;
|
||||
-class CustomFloatingCorner;
|
||||
class MultiContentsBackgroundView;
|
||||
class MultiContentsDropTargetView;
|
||||
class MultiContentsResizeArea;
|
||||
@@ -220,7 +219,6 @@ class MultiContentsView
|
||||
raw_ptr<views::View> top_separator = nullptr;
|
||||
@@ -221,6 +221,7 @@ class MultiContentsView
|
||||
raw_ptr<views::View> leading_separator = nullptr;
|
||||
raw_ptr<views::View> trailing_separator = nullptr;
|
||||
- raw_ptr<CustomFloatingCorner> corner_separator = nullptr;
|
||||
raw_ptr<CustomFloatingCorner> corner_separator = nullptr;
|
||||
+ raw_ptr<CustomFloatingCorner> trailing_corner_separator = nullptr;
|
||||
|
||||
bool should_show_top = false;
|
||||
bool leading_side_chrome_attached = false;
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
+}
|
||||
--- a/chrome/browser/ui/BUILD.gn
|
||||
+++ b/chrome/browser/ui/BUILD.gn
|
||||
@@ -3276,6 +3276,7 @@ static_library("ui") {
|
||||
@@ -3273,6 +3273,7 @@ static_library("ui") {
|
||||
"views/frame/immersive_mode_controller_mac.mm",
|
||||
"views/frame/immersive_mode_overlay_views_mac.h",
|
||||
"views/frame/immersive_mode_overlay_views_mac.mm",
|
||||
@@ -64,7 +64,7 @@
|
||||
"views/tab_contents/chrome_web_contents_view_delegate_views_mac.h",
|
||||
"views/tab_contents/chrome_web_contents_view_delegate_views_mac.mm",
|
||||
"webui/help/version_updater_mac.mm",
|
||||
@@ -3964,6 +3965,8 @@ static_library("ui") {
|
||||
@@ -3961,6 +3962,8 @@ static_library("ui") {
|
||||
"views/global_media_controls/media_toolbar_button_contextual_menu.h",
|
||||
"views/global_media_controls/media_toolbar_button_view.cc",
|
||||
"views/global_media_controls/media_toolbar_button_view.h",
|
||||
|
||||
@@ -1,659 +0,0 @@
|
||||
--- a/chrome/browser/ui/page_info/chrome_page_info_ui_delegate.cc
|
||||
+++ b/chrome/browser/ui/page_info/chrome_page_info_ui_delegate.cc
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "chrome/browser/ui/ui_features.h"
|
||||
#include "chrome/common/chrome_features.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
+#include "chrome/common/webui_url_constants.h"
|
||||
#include "components/content_settings/core/common/content_settings_types.h"
|
||||
#include "components/content_settings/core/common/features.h"
|
||||
#include "components/page_info/core/about_this_site_service.h"
|
||||
@@ -200,6 +201,12 @@ void ChromePageInfoUiDelegate::ShowPriva
|
||||
chrome::ShowPrivacySandboxSettings(browser);
|
||||
}
|
||||
|
||||
+void ChromePageInfoUiDelegate::ShowNoiseSettings() {
|
||||
+ BrowserWindowInterface* browser =
|
||||
+ GlobalBrowserCollection::GetInstance()->FindBrowserWithTab(web_contents_);
|
||||
+ chrome::ShowSettingsSubPage(browser, chrome::kNoiseSubPage);
|
||||
+}
|
||||
+
|
||||
std::u16string ChromePageInfoUiDelegate::GetPermissionDetail(
|
||||
ContentSettingsType type) {
|
||||
switch (type) {
|
||||
--- a/chrome/browser/ui/page_info/chrome_page_info_ui_delegate.h
|
||||
+++ b/chrome/browser/ui/page_info/chrome_page_info_ui_delegate.h
|
||||
@@ -76,6 +76,9 @@ class ChromePageInfoUiDelegate : public
|
||||
// Opens Privacy Sandbox settings page.
|
||||
void ShowPrivacySandboxSettings();
|
||||
|
||||
+ // Opens Noise settings page.
|
||||
+ void ShowNoiseSettings();
|
||||
+
|
||||
// PageInfoUiDelegate implementation
|
||||
bool IsBlockAutoPlayEnabled() override;
|
||||
bool IsMultipleTabsOpen() override;
|
||||
--- a/components/page_info/page_info.cc
|
||||
+++ b/components/page_info/page_info.cc
|
||||
@@ -843,6 +843,10 @@ void PageInfo::OnSitePermissionChanged(
|
||||
PresentSitePermissions();
|
||||
}
|
||||
|
||||
+void PageInfo::OnHeliumNoiseSettingChanged() {
|
||||
+ show_info_bar_ = true;
|
||||
+}
|
||||
+
|
||||
void PageInfo::OnSiteChosenObjectDeleted(const ChooserUIInfo& ui_info,
|
||||
const base::Value& object) {
|
||||
permissions::ObjectPermissionContextBase* context =
|
||||
--- a/components/page_info/page_info.h
|
||||
+++ b/components/page_info/page_info.h
|
||||
@@ -203,6 +203,10 @@ class PageInfo : private content_setting
|
||||
std::optional<url::Origin> requesting_origin,
|
||||
bool is_one_time);
|
||||
|
||||
+ // Marks the current page for a reload prompt after its Helium Noise setting
|
||||
+ // changes. The setting itself is owned by the Chrome-layer Noise helper.
|
||||
+ void OnHeliumNoiseSettingChanged();
|
||||
+
|
||||
// This method is called whenever access to an object is revoked.
|
||||
void OnSiteChosenObjectDeleted(const ChooserUIInfo& ui_info,
|
||||
const base::Value& object);
|
||||
--- a/components/page_info_strings.grdp
|
||||
+++ b/components/page_info_strings.grdp
|
||||
@@ -1015,6 +1015,26 @@
|
||||
Your organization has blocked this site because it violates a policy.
|
||||
</message>
|
||||
|
||||
+ <!-- Helium Noise strings -->
|
||||
+ <message name="IDS_PAGE_INFO_HELIUM_NOISE_HEADER" desc="The title of the fingerprinting protection row and subpage in Page Info.">
|
||||
+ Fingerprinting protection
|
||||
+ </message>
|
||||
+ <message name="IDS_PAGE_INFO_HELIUM_NOISE_TOOLTIP" desc="Tooltip for the fingerprinting protection row in Page Info.">
|
||||
+ Manage fingerprinting protection for this site
|
||||
+ </message>
|
||||
+ <message name="IDS_PAGE_INFO_HELIUM_NOISE_DESCRIPTION" desc="Explanation of how Helium fingerprinting protection works.">
|
||||
+ When fingerprinting protection is enabled, Helium adds noise to certain browser features to make it harder for sites to track and profile you.
|
||||
+ </message>
|
||||
+ <message name="IDS_PAGE_INFO_HELIUM_NOISE_BREAKAGE" desc="Explanation of how disabling Helium's fingerprinting protection may fix privacy-invasive websites, but will reduce user's privacy.">
|
||||
+ Turning off the protection will reduce your privacy, but may fix site features that require fingerprinting.
|
||||
+ </message>
|
||||
+ <message name="IDS_PAGE_INFO_HELIUM_NOISE_GLOBALLY_DISABLED" desc="Explanation shown when the site toggle is unavailable because fingerprinting protection is disabled globally.">
|
||||
+ Fingerprinting protection is turned off in Helium settings.
|
||||
+ </message>
|
||||
+ <message name="IDS_PAGE_INFO_HELIUM_NOISE_SETTINGS_BUTTON" desc="A button label that opens Helium's global fingerprinting protection settings page.">
|
||||
+ Manage fingerprinting protection
|
||||
+ </message>
|
||||
+
|
||||
<!-- Ad privacy strings -->
|
||||
<message name="IDS_PAGE_INFO_AD_PRIVACY_HEADER" desc="A label that represents the new ad-related settings. 1) Navigate to any site. 2) Click the icon (often a lock) to the left of the URL in the address bar. Information about the page you're viewing appears. The 'Ad privacy' label will appear above the 'Site settings' button.">
|
||||
Ad privacy
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/views/page_info/page_info_noise_content_view.cc
|
||||
@@ -0,0 +1,160 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+#include "chrome/browser/ui/views/page_info/page_info_noise_content_view.h"
|
||||
+
|
||||
+#include <memory>
|
||||
+
|
||||
+#include "base/check.h"
|
||||
+#include "base/functional/bind.h"
|
||||
+#include "base/functional/callback_helpers.h"
|
||||
+#include "chrome/browser/helium_noise/helium_noise_settings.h"
|
||||
+#include "chrome/browser/ui/color/chrome_color_id.h"
|
||||
+#include "chrome/browser/ui/layout_constants.h"
|
||||
+#include "chrome/browser/ui/page_info/chrome_page_info_ui_delegate.h"
|
||||
+#include "chrome/browser/ui/views/chrome_layout_provider.h"
|
||||
+#include "chrome/browser/ui/views/controls/rich_controls_container_view.h"
|
||||
+#include "chrome/browser/ui/views/controls/rich_hover_button.h"
|
||||
+#include "chrome/browser/ui/views/page_info/page_info_view_factory.h"
|
||||
+#include "components/page_info/page_info.h"
|
||||
+#include "components/strings/grit/components_strings.h"
|
||||
+#include "content/public/browser/web_contents.h"
|
||||
+#include "ui/base/l10n/l10n_util.h"
|
||||
+#include "ui/gfx/geometry/insets.h"
|
||||
+#include "ui/views/accessibility/view_accessibility.h"
|
||||
+#include "ui/views/controls/button/toggle_button.h"
|
||||
+#include "ui/views/controls/label.h"
|
||||
+#include "ui/views/controls/styled_label.h"
|
||||
+#include "ui/views/layout/box_layout_view.h"
|
||||
+#include "ui/views/style/typography.h"
|
||||
+
|
||||
+PageInfoNoiseContentView::PageInfoNoiseContentView(
|
||||
+ PageInfo* presenter,
|
||||
+ ChromePageInfoUiDelegate* ui_delegate)
|
||||
+ : presenter_(presenter), ui_delegate_(ui_delegate),
|
||||
+ web_contents_(ui_delegate_->GetWebContents()->GetWeakPtr()) {
|
||||
+
|
||||
+ ChromeLayoutProvider* layout_provider = ChromeLayoutProvider::Get();
|
||||
+ SetOrientation(views::LayoutOrientation::kVertical);
|
||||
+ SetProperty(
|
||||
+ views::kMarginsKey,
|
||||
+ gfx::Insets::TLBR(
|
||||
+ 0, 0,
|
||||
+ layout_provider->GetDistanceMetric(
|
||||
+ DISTANCE_CONTENT_LIST_VERTICAL_MULTI),
|
||||
+ 0));
|
||||
+
|
||||
+ const helium_noise::HeliumNoiseState noise_state =
|
||||
+ helium_noise::GetHeliumNoiseState(web_contents_->GetBrowserContext(),
|
||||
+ presenter_->site_url());
|
||||
+
|
||||
+ const auto button_insets = layout_provider->GetInsetsMetric(
|
||||
+ ChromeInsetsMetric::INSETS_PAGE_INFO_HOVER_BUTTON);
|
||||
+ auto* description_label =
|
||||
+ AddChildView(std::make_unique<views::StyledLabel>());
|
||||
+ description_label->SetText(
|
||||
+ l10n_util::GetStringUTF16(IDS_PAGE_INFO_HELIUM_NOISE_DESCRIPTION));
|
||||
+ description_label->SetDefaultTextStyle(views::style::STYLE_BODY_3);
|
||||
+ description_label->SetDefaultEnabledColorId(kColorPageInfoForeground);
|
||||
+ description_label->SetProperty(views::kMarginsKey, button_insets);
|
||||
+ description_label->SizeToFit(PageInfoViewFactory::kMinBubbleWidth -
|
||||
+ button_insets.width());
|
||||
+
|
||||
+ const int vertical_margin = layout_provider->GetDistanceMetric(
|
||||
+ DISTANCE_CONTENT_LIST_VERTICAL_MULTI);
|
||||
+ const int side_margin =
|
||||
+ layout_provider->GetInsetsMetric(views::INSETS_DIALOG).left();
|
||||
+ if (noise_state == helium_noise::HeliumNoiseState::kGloballyDisabled) {
|
||||
+ auto* globally_disabled_label = AddChildView(std::make_unique<views::Label>(
|
||||
+ l10n_util::GetStringUTF16(
|
||||
+ IDS_PAGE_INFO_HELIUM_NOISE_GLOBALLY_DISABLED),
|
||||
+ views::style::CONTEXT_LABEL, views::style::STYLE_BODY_4));
|
||||
+ globally_disabled_label->SetEnabledColor(
|
||||
+ kColorPageInfoSubtitleForeground);
|
||||
+ globally_disabled_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
|
||||
+ globally_disabled_label->SetMultiLine(true);
|
||||
+ globally_disabled_label->SetMaximumWidth(
|
||||
+ PageInfoViewFactory::kMinBubbleWidth - side_margin * 2);
|
||||
+ globally_disabled_label->SetProperty(
|
||||
+ views::kMarginsKey, gfx::Insets::VH(vertical_margin, side_margin));
|
||||
+ } else {
|
||||
+ auto* breakage_container =
|
||||
+ AddChildView(std::make_unique<views::BoxLayoutView>());
|
||||
+ breakage_container->SetOrientation(views::LayoutOrientation::kVertical);
|
||||
+ breakage_container->SetProperty(
|
||||
+ views::kMarginsKey, gfx::Insets::VH(vertical_margin, side_margin));
|
||||
+
|
||||
+ auto* breakage_title = breakage_container->AddChildView(
|
||||
+ std::make_unique<views::Label>(
|
||||
+ l10n_util::GetStringUTF16(
|
||||
+ IDS_PAGE_INFO_COOKIES_SITE_NOT_WORKING_TITLE),
|
||||
+ views::style::CONTEXT_DIALOG_BODY_TEXT,
|
||||
+ views::style::STYLE_BODY_3_MEDIUM));
|
||||
+ breakage_title->SetEnabledColor(kColorPageInfoForeground);
|
||||
+ breakage_title->SetHorizontalAlignment(gfx::ALIGN_LEFT);
|
||||
+
|
||||
+ auto* breakage_description = breakage_container->AddChildView(
|
||||
+ std::make_unique<views::Label>(
|
||||
+ l10n_util::GetStringUTF16(IDS_PAGE_INFO_HELIUM_NOISE_BREAKAGE),
|
||||
+ views::style::CONTEXT_LABEL, views::style::STYLE_BODY_4));
|
||||
+ breakage_description->SetEnabledColor(kColorPageInfoSubtitleForeground);
|
||||
+ breakage_description->SetHorizontalAlignment(gfx::ALIGN_LEFT);
|
||||
+ breakage_description->SetMultiLine(true);
|
||||
+ breakage_description->SetMaximumWidth(
|
||||
+ PageInfoViewFactory::kMinBubbleWidth - side_margin * 2);
|
||||
+
|
||||
+ setting_row_ =
|
||||
+ AddChildView(std::make_unique<RichControlsContainerView>());
|
||||
+ setting_row_->SetIcon(PageInfoViewFactory::GetNoiseIcon(
|
||||
+ noise_state == helium_noise::HeliumNoiseState::kEnabled));
|
||||
+ setting_row_->SetTitle(
|
||||
+ l10n_util::GetStringUTF16(IDS_PAGE_INFO_HELIUM_NOISE_HEADER));
|
||||
+
|
||||
+ toggle_button_ = setting_row_->AddControl(
|
||||
+ std::make_unique<views::ToggleButton>(base::BindRepeating(
|
||||
+ &PageInfoNoiseContentView::OnToggleButtonPressed,
|
||||
+ base::Unretained(this))));
|
||||
+ toggle_button_->SetID(
|
||||
+ PageInfoViewFactory::VIEW_ID_PAGE_INFO_HELIUM_NOISE_TOGGLE);
|
||||
+ toggle_button_->GetViewAccessibility().SetName(
|
||||
+ l10n_util::GetStringUTF16(IDS_PAGE_INFO_HELIUM_NOISE_HEADER));
|
||||
+ toggle_button_->SetIsOn(noise_state ==
|
||||
+ helium_noise::HeliumNoiseState::kEnabled);
|
||||
+ toggle_button_->SetEnabled(
|
||||
+ noise_state != helium_noise::HeliumNoiseState::kUnavailable);
|
||||
+ toggle_button_->SetPreferredSize(gfx::Size(
|
||||
+ toggle_button_->GetPreferredSize().width(),
|
||||
+ setting_row_->GetFirstLineHeight()));
|
||||
+ }
|
||||
+
|
||||
+ AddChildView(PageInfoViewFactory::CreateSeparator(
|
||||
+ layout_provider->GetDistanceMetric(
|
||||
+ DISTANCE_HORIZONTAL_SEPARATOR_PADDING_PAGE_INFO_VIEW)));
|
||||
+ auto* settings_button = AddChildView(std::make_unique<RichHoverButton>(
|
||||
+ base::BindRepeating(&ChromePageInfoUiDelegate::ShowNoiseSettings,
|
||||
+ base::Unretained(ui_delegate_)),
|
||||
+ PageInfoViewFactory::GetSiteSettingsIcon(),
|
||||
+ l10n_util::GetStringUTF16(IDS_PAGE_INFO_HELIUM_NOISE_SETTINGS_BUTTON),
|
||||
+ std::u16string(), PageInfoViewFactory::GetLaunchIcon()));
|
||||
+ settings_button->SetTitleTextStyleAndColor(
|
||||
+ views::style::STYLE_BODY_3_MEDIUM, kColorPageInfoForeground);
|
||||
+
|
||||
+ presenter_->InitializeUiState(this, base::DoNothing());
|
||||
+}
|
||||
+
|
||||
+PageInfoNoiseContentView::~PageInfoNoiseContentView() = default;
|
||||
+
|
||||
+void PageInfoNoiseContentView::OnToggleButtonPressed() {
|
||||
+ if (!web_contents_ || !setting_row_ || !toggle_button_ ||
|
||||
+ !toggle_button_->GetEnabled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ helium_noise::SetHeliumNoiseEnabledForOrigin(
|
||||
+ web_contents_->GetBrowserContext(), presenter_->site_url(),
|
||||
+ toggle_button_->GetIsOn());
|
||||
+ setting_row_->SetIcon(
|
||||
+ PageInfoViewFactory::GetNoiseIcon(toggle_button_->GetIsOn()));
|
||||
+ presenter_->OnHeliumNoiseSettingChanged();
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/views/page_info/page_info_noise_content_view.h
|
||||
@@ -0,0 +1,43 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+#ifndef CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_NOISE_CONTENT_VIEW_H_
|
||||
+#define CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_NOISE_CONTENT_VIEW_H_
|
||||
+
|
||||
+#include "base/memory/raw_ptr.h"
|
||||
+#include "base/memory/weak_ptr.h"
|
||||
+#include "components/page_info/page_info_ui.h"
|
||||
+#include "ui/views/layout/flex_layout_view.h"
|
||||
+
|
||||
+class ChromePageInfoUiDelegate;
|
||||
+class PageInfo;
|
||||
+class RichControlsContainerView;
|
||||
+
|
||||
+namespace content {
|
||||
+class WebContents;
|
||||
+}
|
||||
+
|
||||
+namespace views {
|
||||
+class ToggleButton;
|
||||
+}
|
||||
+
|
||||
+// Content for the Helium Noise subpage in Page Info.
|
||||
+class PageInfoNoiseContentView : public views::FlexLayoutView,
|
||||
+ public PageInfoUI {
|
||||
+ public:
|
||||
+ PageInfoNoiseContentView(PageInfo* presenter,
|
||||
+ ChromePageInfoUiDelegate* ui_delegate);
|
||||
+ ~PageInfoNoiseContentView() override;
|
||||
+
|
||||
+ private:
|
||||
+ void OnToggleButtonPressed();
|
||||
+
|
||||
+ const raw_ptr<PageInfo, DanglingUntriaged> presenter_;
|
||||
+ const raw_ptr<ChromePageInfoUiDelegate, DanglingUntriaged> ui_delegate_;
|
||||
+ base::WeakPtr<content::WebContents> web_contents_;
|
||||
+ raw_ptr<RichControlsContainerView> setting_row_ = nullptr;
|
||||
+ raw_ptr<views::ToggleButton> toggle_button_ = nullptr;
|
||||
+};
|
||||
+
|
||||
+#endif // CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_NOISE_CONTENT_VIEW_H_
|
||||
--- a/chrome/browser/ui/BUILD.gn
|
||||
+++ b/chrome/browser/ui/BUILD.gn
|
||||
@@ -203,6 +203,7 @@ static_library("ui") {
|
||||
"//chrome/browser:flags",
|
||||
"//chrome/browser:font_pref",
|
||||
"//chrome/browser:global_features",
|
||||
+ "//chrome/browser:helium_noise_settings_headers",
|
||||
"//chrome/browser:icon_manager",
|
||||
"//chrome/browser:renderer_preferences_util",
|
||||
"//chrome/browser:resources_util",
|
||||
@@ -4139,6 +4140,8 @@ static_library("ui") {
|
||||
"views/page_info/page_info_merchant_trust_controller.h",
|
||||
"views/page_info/page_info_merchant_trust_coordinator.cc",
|
||||
"views/page_info/page_info_merchant_trust_coordinator.h",
|
||||
+ "views/page_info/page_info_noise_content_view.cc",
|
||||
+ "views/page_info/page_info_noise_content_view.h",
|
||||
"views/page_info/page_info_permission_content_view.cc",
|
||||
"views/page_info/page_info_permission_content_view.h",
|
||||
"views/page_info/page_info_security_content_view.cc",
|
||||
--- /dev/null
|
||||
+++ b/components/vector_icons/shield_check.icon
|
||||
@@ -0,0 +1,52 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+CANVAS_DIMENSIONS, 20,
|
||||
+FILL_RULE_NONZERO,
|
||||
+MOVE_TO, 9.13f, 10.81f,
|
||||
+LINE_TO, 7.88f, 9.56f,
|
||||
+CUBIC_TO, 7.73f, 9.41f, 7.55f, 9.33f, 7.36f, 9.33f,
|
||||
+CUBIC_TO, 7.16f, 9.33f, 6.99f, 9.41f, 6.83f, 9.56f,
|
||||
+CUBIC_TO, 6.68f, 9.72f, 6.6f, 9.89f, 6.6f, 10.1f,
|
||||
+CUBIC_TO, 6.6f, 10.3f, 6.68f, 10.48f, 6.83f, 10.63f,
|
||||
+LINE_TO, 8.58f, 12.4f,
|
||||
+CUBIC_TO, 8.73f, 12.55f, 8.91f, 12.63f, 9.11f, 12.63f,
|
||||
+CUBIC_TO, 9.32f, 12.63f, 9.49f, 12.55f, 9.65f, 12.4f,
|
||||
+LINE_TO, 13.19f, 8.85f,
|
||||
+CUBIC_TO, 13.34f, 8.7f, 13.42f, 8.53f, 13.42f, 8.33f,
|
||||
+CUBIC_TO, 13.42f, 8.14f, 13.34f, 7.97f, 13.19f, 7.81f,
|
||||
+CUBIC_TO, 13.03f, 7.66f, 12.86f, 7.58f, 12.65f, 7.58f,
|
||||
+CUBIC_TO, 12.45f, 7.58f, 12.27f, 7.66f, 12.13f, 7.81f,
|
||||
+LINE_TO, 9.13f, 10.81f,
|
||||
+CLOSE,
|
||||
+MOVE_TO, 9.75f, 17.91f,
|
||||
+CUBIC_TO, 9.67f, 17.9f, 9.59f, 17.88f, 9.52f, 17.85f,
|
||||
+CUBIC_TO, 7.7f, 17.26f, 6.24f, 16.15f, 5.15f, 14.54f,
|
||||
+CUBIC_TO, 4.05f, 12.93f, 3.5f, 11.17f, 3.5f, 9.27f,
|
||||
+V_LINE_TO, 5.52f,
|
||||
+CUBIC_TO, 3.5f, 5.21f, 3.59f, 4.92f, 3.76f, 4.67f,
|
||||
+CUBIC_TO, 3.93f, 4.42f, 4.17f, 4.24f, 4.46f, 4.13f,
|
||||
+LINE_TO, 9.46f, 2.21f,
|
||||
+CUBIC_TO, 9.64f, 2.14f, 9.82f, 2.1f, 10, 2.1f,
|
||||
+CUBIC_TO, 10.18f, 2.1f, 10.36f, 2.14f, 10.54f, 2.21f,
|
||||
+LINE_TO, 15.54f, 4.13f,
|
||||
+CUBIC_TO, 15.83f, 4.24f, 16.07f, 4.42f, 16.24f, 4.67f,
|
||||
+CUBIC_TO, 16.41f, 4.92f, 16.5f, 5.21f, 16.5f, 5.52f,
|
||||
+V_LINE_TO, 9.27f,
|
||||
+CUBIC_TO, 16.5f, 11.17f, 15.95f, 12.93f, 14.85f, 14.54f,
|
||||
+CUBIC_TO, 13.76f, 16.15f, 12.3f, 17.26f, 10.48f, 17.85f,
|
||||
+CUBIC_TO, 10.41f, 17.88f, 10.33f, 17.9f, 10.25f, 17.91f,
|
||||
+CUBIC_TO, 10.17f, 17.91f, 10.08f, 17.92f, 10, 17.92f,
|
||||
+CUBIC_TO, 9.92f, 17.92f, 9.83f, 17.91f, 9.75f, 17.91f,
|
||||
+CLOSE,
|
||||
+MOVE_TO, 10, 16.44f,
|
||||
+CUBIC_TO, 11.44f, 15.99f, 12.64f, 15.09f, 13.58f, 13.75f,
|
||||
+CUBIC_TO, 14.53f, 12.41f, 15, 10.91f, 15, 9.27f,
|
||||
+V_LINE_TO, 5.52f,
|
||||
+LINE_TO, 10, 3.6f,
|
||||
+LINE_TO, 5, 5.52f,
|
||||
+V_LINE_TO, 9.27f,
|
||||
+CUBIC_TO, 5, 10.91f, 5.47f, 12.41f, 6.42f, 13.75f,
|
||||
+CUBIC_TO, 7.36f, 15.09f, 8.56f, 15.99f, 10, 16.44f,
|
||||
+CLOSE
|
||||
--- /dev/null
|
||||
+++ b/components/vector_icons/shield_cross.icon
|
||||
@@ -0,0 +1,62 @@
|
||||
+// Copyright 2026 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+CANVAS_DIMENSIONS, 20,
|
||||
+FILL_RULE_NONZERO,
|
||||
+MOVE_TO, 10, 11.04f,
|
||||
+LINE_TO, 11.18f, 12.23f,
|
||||
+CUBIC_TO, 11.34f, 12.38f, 11.51f, 12.46f, 11.71f, 12.46f,
|
||||
+CUBIC_TO, 11.9f, 12.46f, 12.08f, 12.38f, 12.23f, 12.23f,
|
||||
+CUBIC_TO, 12.38f, 12.08f, 12.46f, 11.9f, 12.46f, 11.71f,
|
||||
+CUBIC_TO, 12.46f, 11.51f, 12.38f, 11.34f, 12.23f, 11.18f,
|
||||
+LINE_TO, 11.04f, 10,
|
||||
+LINE_TO, 12.23f, 8.82f,
|
||||
+CUBIC_TO, 12.38f, 8.66f, 12.46f, 8.49f, 12.46f, 8.29f,
|
||||
+CUBIC_TO, 12.46f, 8.1f, 12.38f, 7.92f, 12.23f, 7.77f,
|
||||
+CUBIC_TO, 12.08f, 7.62f, 11.9f, 7.54f, 11.71f, 7.54f,
|
||||
+CUBIC_TO, 11.51f, 7.54f, 11.34f, 7.62f, 11.18f, 7.77f,
|
||||
+LINE_TO, 10, 8.96f,
|
||||
+LINE_TO, 8.82f, 7.77f,
|
||||
+CUBIC_TO, 8.66f, 7.62f, 8.49f, 7.54f, 8.29f, 7.54f,
|
||||
+CUBIC_TO, 8.1f, 7.54f, 7.92f, 7.62f, 7.77f, 7.77f,
|
||||
+CUBIC_TO, 7.62f, 7.92f, 7.54f, 8.1f, 7.54f, 8.29f,
|
||||
+CUBIC_TO, 7.54f, 8.49f, 7.62f, 8.66f, 7.77f, 8.82f,
|
||||
+LINE_TO, 8.96f, 10,
|
||||
+LINE_TO, 7.77f, 11.18f,
|
||||
+CUBIC_TO, 7.62f, 11.34f, 7.54f, 11.51f, 7.54f, 11.71f,
|
||||
+CUBIC_TO, 7.54f, 11.9f, 7.62f, 12.08f, 7.77f, 12.23f,
|
||||
+CUBIC_TO, 7.92f, 12.38f, 8.1f, 12.46f, 8.29f, 12.46f,
|
||||
+CUBIC_TO, 8.49f, 12.46f, 8.66f, 12.38f, 8.82f, 12.23f,
|
||||
+LINE_TO, 10, 11.04f,
|
||||
+CLOSE,
|
||||
+MOVE_TO, 9.75f, 17.91f,
|
||||
+CUBIC_TO, 9.67f, 17.9f, 9.59f, 17.88f, 9.52f, 17.85f,
|
||||
+CUBIC_TO, 7.7f, 17.26f, 6.24f, 16.15f, 5.15f, 14.54f,
|
||||
+CUBIC_TO, 4.05f, 12.93f, 3.5f, 11.17f, 3.5f, 9.27f,
|
||||
+V_LINE_TO, 5.52f,
|
||||
+CUBIC_TO, 3.5f, 5.21f, 3.59f, 4.92f, 3.76f, 4.67f,
|
||||
+CUBIC_TO, 3.93f, 4.42f, 4.17f, 4.24f, 4.46f, 4.13f,
|
||||
+LINE_TO, 9.46f, 2.21f,
|
||||
+CUBIC_TO, 9.64f, 2.14f, 9.82f, 2.1f, 10, 2.1f,
|
||||
+CUBIC_TO, 10.18f, 2.1f, 10.36f, 2.14f, 10.54f, 2.21f,
|
||||
+LINE_TO, 15.54f, 4.13f,
|
||||
+CUBIC_TO, 15.83f, 4.24f, 16.07f, 4.42f, 16.24f, 4.67f,
|
||||
+CUBIC_TO, 16.41f, 4.92f, 16.5f, 5.21f, 16.5f, 5.52f,
|
||||
+V_LINE_TO, 9.27f,
|
||||
+CUBIC_TO, 16.5f, 11.17f, 15.95f, 12.93f, 14.85f, 14.54f,
|
||||
+CUBIC_TO, 13.76f, 16.15f, 12.3f, 17.26f, 10.48f, 17.85f,
|
||||
+CUBIC_TO, 10.41f, 17.88f, 10.33f, 17.9f, 10.25f, 17.91f,
|
||||
+CUBIC_TO, 10.17f, 17.91f, 10.08f, 17.92f, 10, 17.92f,
|
||||
+CUBIC_TO, 9.92f, 17.92f, 9.83f, 17.91f, 9.75f, 17.91f,
|
||||
+CLOSE,
|
||||
+MOVE_TO, 10, 16.44f,
|
||||
+CUBIC_TO, 11.44f, 15.99f, 12.64f, 15.09f, 13.58f, 13.75f,
|
||||
+CUBIC_TO, 14.53f, 12.41f, 15, 10.91f, 15, 9.27f,
|
||||
+V_LINE_TO, 5.52f,
|
||||
+LINE_TO, 10, 3.6f,
|
||||
+LINE_TO, 5, 5.52f,
|
||||
+V_LINE_TO, 9.27f,
|
||||
+CUBIC_TO, 5, 10.91f, 5.47f, 12.41f, 6.42f, 13.75f,
|
||||
+CUBIC_TO, 7.36f, 15.09f, 8.56f, 15.99f, 10, 16.44f,
|
||||
+CLOSE
|
||||
--- a/components/vector_icons/BUILD.gn
|
||||
+++ b/components/vector_icons/BUILD.gn
|
||||
@@ -405,6 +405,8 @@ if (current_toolchain == default_toolcha
|
||||
"settings_old.icon",
|
||||
"settings_outline_old.icon",
|
||||
"shield.icon",
|
||||
+ "shield_check.icon",
|
||||
+ "shield_cross.icon",
|
||||
"shopping_bag.icon",
|
||||
"shopping_bag_old.icon",
|
||||
"shopping_bag_refresh_old.icon",
|
||||
--- a/chrome/browser/ui/views/page_info/page_info_view_factory.cc
|
||||
+++ b/chrome/browser/ui/views/page_info/page_info_view_factory.cc
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "chrome/browser/ui/views/page_info/page_info_main_view.h"
|
||||
#include "chrome/browser/ui/views/page_info/page_info_merchant_trust_content_view.h"
|
||||
#include "chrome/browser/ui/views/page_info/page_info_navigation_handler.h"
|
||||
+#include "chrome/browser/ui/views/page_info/page_info_noise_content_view.h"
|
||||
#include "chrome/browser/ui/views/page_info/page_info_permission_content_view.h"
|
||||
#include "chrome/browser/ui/views/page_info/page_info_security_content_view.h"
|
||||
#include "components/content_settings/core/browser/permission_settings_registry.h"
|
||||
@@ -187,6 +188,14 @@ std::unique_ptr<views::View> PageInfoVie
|
||||
std::make_unique<PageInfoCookiesContentView>(presenter_));
|
||||
}
|
||||
|
||||
+std::unique_ptr<views::View> PageInfoViewFactory::CreateNoisePageView() {
|
||||
+ return std::make_unique<PageInfoSubpageView>(
|
||||
+ CreateSubpageHeader(
|
||||
+ l10n_util::GetStringUTF16(IDS_PAGE_INFO_HELIUM_NOISE_HEADER),
|
||||
+ presenter_->GetSubjectNameForDisplay()),
|
||||
+ std::make_unique<PageInfoNoiseContentView>(presenter_, ui_delegate_));
|
||||
+}
|
||||
+
|
||||
std::unique_ptr<views::View>
|
||||
PageInfoViewFactory::CreateMerchantTrustPageView() {
|
||||
return std::make_unique<PageInfoSubpageView>(
|
||||
@@ -903,6 +912,12 @@ const ui::ImageModel PageInfoViewFactory
|
||||
}
|
||||
|
||||
// static
|
||||
+const ui::ImageModel PageInfoViewFactory::GetNoiseIcon(bool enabled) {
|
||||
+ return GetImageModel(enabled ? vector_icons::kShieldCheckIcon
|
||||
+ : vector_icons::kShieldCrossIcon);
|
||||
+}
|
||||
+
|
||||
+// static
|
||||
const ui::ImageModel PageInfoViewFactory::GetOpenSubpageIcon() {
|
||||
// GetIconSize() does not work for subpage icons because the default size of
|
||||
// features::IsRoundedIconsEnabled() ? vector_icons::kArrowRightFlippableIcon
|
||||
--- a/chrome/browser/ui/views/page_info/page_info_view_factory.h
|
||||
+++ b/chrome/browser/ui/views/page_info/page_info_view_factory.h
|
||||
@@ -42,6 +42,7 @@ class PageInfoViewFactory {
|
||||
VIEW_ID_PAGE_INFO_BLOCK_THIRD_PARTY_COOKIES_SUBTITLE,
|
||||
VIEW_ID_PAGE_INFO_LINK_OR_BUTTON_COOKIE_DIALOG,
|
||||
VIEW_ID_PAGE_INFO_LINK_OR_BUTTON_COOKIES_SUBPAGE,
|
||||
+ VIEW_ID_PAGE_INFO_LINK_OR_BUTTON_NOISE_SUBPAGE,
|
||||
VIEW_ID_PAGE_INFO_LINK_OR_BUTTON_PRIVACY_SITE_DATA_SUBPAGE,
|
||||
VIEW_ID_PAGE_INFO_COOKIES_DESCRIPTION_LABEL,
|
||||
VIEW_ID_PAGE_INFO_LINK_OR_BUTTON_RWS_SETTINGS,
|
||||
@@ -76,6 +77,7 @@ class PageInfoViewFactory {
|
||||
VIEW_ID_PAGE_INFO_EXTENDED_SITE_INFO_SECTION,
|
||||
VIEW_ID_PAGE_INFO_COOKIES_SYNC,
|
||||
VIEW_ID_PAGE_INFO_PERMISSION_SUBTITLE_LABEL,
|
||||
+ VIEW_ID_PAGE_INFO_HELIUM_NOISE_TOGGLE,
|
||||
};
|
||||
|
||||
// Creates a separator view with padding on top and bottom. Use with flex
|
||||
@@ -114,6 +116,9 @@ class PageInfoViewFactory {
|
||||
// Returns the icon for the secure connection button.
|
||||
static const ui::ImageModel GetConnectionSecureIcon();
|
||||
|
||||
+ // Returns the Helium Noise icon for the given enabled state.
|
||||
+ static const ui::ImageModel GetNoiseIcon(bool enabled);
|
||||
+
|
||||
// Returns the icon for a button which opens a subpage within page info.
|
||||
static const ui::ImageModel GetOpenSubpageIcon();
|
||||
|
||||
@@ -134,6 +139,7 @@ class PageInfoViewFactory {
|
||||
content::WebContents* web_contents);
|
||||
[[nodiscard]] std::unique_ptr<views::View> CreateAdPersonalizationPageView();
|
||||
[[nodiscard]] std::unique_ptr<views::View> CreateCookiesPageView();
|
||||
+ [[nodiscard]] std::unique_ptr<views::View> CreateNoisePageView();
|
||||
[[nodiscard]] std::unique_ptr<views::View> CreateMerchantTrustPageView();
|
||||
|
||||
private:
|
||||
--- a/chrome/browser/ui/views/page_info/page_info_navigation_handler.h
|
||||
+++ b/chrome/browser/ui/views/page_info/page_info_navigation_handler.h
|
||||
@@ -20,6 +20,7 @@ class PageInfoNavigationHandler {
|
||||
virtual void OpenPermissionPage(ContentSettingsType type) = 0;
|
||||
virtual void OpenAdPersonalizationPage() = 0;
|
||||
virtual void OpenCookiesPage() = 0;
|
||||
+ virtual void OpenNoisePage() = 0;
|
||||
virtual void OpenMerchantTrustPage() = 0;
|
||||
virtual void CloseBubble() = 0;
|
||||
};
|
||||
--- a/chrome/browser/ui/views/page_info/page_info_bubble_view.cc
|
||||
+++ b/chrome/browser/ui/views/page_info/page_info_bubble_view.cc
|
||||
@@ -318,6 +318,15 @@ void PageInfoBubbleView::OpenCookiesPage
|
||||
AnnouncePageOpened(l10n_util::GetStringUTF16(IDS_PAGE_INFO_COOKIES));
|
||||
}
|
||||
|
||||
+void PageInfoBubbleView::OpenNoisePage() {
|
||||
+ std::unique_ptr<views::View> noise_page_view =
|
||||
+ view_factory_->CreateNoisePageView();
|
||||
+ noise_page_view->SetID(PageInfoViewFactory::VIEW_ID_PAGE_INFO_CURRENT_VIEW);
|
||||
+ page_container_->SwitchToPage(std::move(noise_page_view));
|
||||
+ AnnouncePageOpened(
|
||||
+ l10n_util::GetStringUTF16(IDS_PAGE_INFO_HELIUM_NOISE_HEADER));
|
||||
+}
|
||||
+
|
||||
void PageInfoBubbleView::OpenMerchantTrustPage() {
|
||||
CHECK(merchant_trust_coordinator_);
|
||||
auto title = l10n_util::GetStringUTF16(IDS_PAGE_INFO_MERCHANT_TRUST_HEADER);
|
||||
--- a/chrome/browser/ui/views/page_info/page_info_bubble_view.h
|
||||
+++ b/chrome/browser/ui/views/page_info/page_info_bubble_view.h
|
||||
@@ -45,6 +45,7 @@ class PageInfoBubbleView : public PageIn
|
||||
void OpenPermissionPage(ContentSettingsType type) override;
|
||||
void OpenAdPersonalizationPage() override;
|
||||
void OpenCookiesPage() override;
|
||||
+ void OpenNoisePage() override;
|
||||
void OpenMerchantTrustPage() override;
|
||||
void CloseBubble() override;
|
||||
|
||||
--- a/chrome/browser/ui/views/page_info/page_info_main_view.cc
|
||||
+++ b/chrome/browser/ui/views/page_info/page_info_main_view.cc
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
+#include "chrome/browser/helium_noise/helium_noise_settings.h"
|
||||
#include "chrome/browser/lookalikes/safety_tip_ui_helper.h"
|
||||
#include "chrome/browser/page_info/page_info_features.h"
|
||||
#include "chrome/browser/ui/color/chrome_color_id.h"
|
||||
@@ -40,6 +41,7 @@
|
||||
#include "components/vector_icons/vector_icons.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
+#include "content/public/browser/web_contents.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/base/metadata/metadata_impl_macros.h"
|
||||
#include "ui/base/models/image_model.h"
|
||||
@@ -131,6 +133,7 @@ PageInfoMainView::PageInfoMainView(
|
||||
#endif
|
||||
|
||||
security_container_view_ = AddChildView(CreateContainerView());
|
||||
+ MaybeAddNoiseButton();
|
||||
|
||||
permissions_view_ = AddChildView(std::make_unique<views::View>());
|
||||
permissions_view_->SetLayoutManager(std::make_unique<views::FlexLayout>())
|
||||
@@ -218,6 +221,39 @@ void PageInfoMainView::SetCookieInfo(con
|
||||
views::style::STYLE_BODY_4, kColorPageInfoSubtitleForeground);
|
||||
}
|
||||
|
||||
+void PageInfoMainView::MaybeAddNoiseButton() {
|
||||
+ content::WebContents* web_contents = ui_delegate_->GetWebContents();
|
||||
+ if (!web_contents ||
|
||||
+ !helium_noise::CanSetHeliumNoiseForOrigin(presenter_->site_url())) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ const helium_noise::HeliumNoiseState noise_state =
|
||||
+ helium_noise::GetHeliumNoiseState(web_contents->GetBrowserContext(),
|
||||
+ presenter_->site_url());
|
||||
+ if (noise_state == helium_noise::HeliumNoiseState::kUnavailable) {
|
||||
+ return;
|
||||
+ }
|
||||
+ const bool noise_enabled =
|
||||
+ noise_state == helium_noise::HeliumNoiseState::kEnabled;
|
||||
+
|
||||
+ noise_container_view_ = AddChildView(CreateContainerView());
|
||||
+ auto* noise_button =
|
||||
+ noise_container_view_->AddChildView(std::make_unique<RichHoverButton>(
|
||||
+ base::BindRepeating(&PageInfoNavigationHandler::OpenNoisePage,
|
||||
+ base::Unretained(navigation_handler_)),
|
||||
+ PageInfoViewFactory::GetNoiseIcon(noise_enabled),
|
||||
+ l10n_util::GetStringUTF16(IDS_PAGE_INFO_HELIUM_NOISE_HEADER),
|
||||
+ /*subtitle_text=*/std::u16string(),
|
||||
+ PageInfoViewFactory::GetOpenSubpageIcon()));
|
||||
+ noise_button->SetTooltipText(
|
||||
+ l10n_util::GetStringUTF16(IDS_PAGE_INFO_HELIUM_NOISE_TOOLTIP));
|
||||
+ noise_button->SetID(
|
||||
+ PageInfoViewFactory::VIEW_ID_PAGE_INFO_LINK_OR_BUTTON_NOISE_SUBPAGE);
|
||||
+ noise_button->SetTitleTextStyleAndColor(views::style::STYLE_BODY_3_MEDIUM,
|
||||
+ kColorPageInfoForeground);
|
||||
+}
|
||||
+
|
||||
void PageInfoMainView::SetPermissionInfo(
|
||||
const PermissionInfoList& permission_info_list,
|
||||
ChosenObjectInfoList chosen_object_info_list) {
|
||||
@@ -618,6 +654,11 @@ gfx::Size PageInfoMainView::CalculatePre
|
||||
width =
|
||||
std::max(width, security_container_view_->GetPreferredSize().width());
|
||||
}
|
||||
+
|
||||
+ if (noise_container_view_) {
|
||||
+ width =
|
||||
+ std::max(width, noise_container_view_->GetPreferredSize().width());
|
||||
+ }
|
||||
return gfx::Size(width,
|
||||
GetLayoutManager()->GetPreferredHeightForWidth(this, width));
|
||||
}
|
||||
--- a/chrome/browser/ui/views/page_info/page_info_main_view.h
|
||||
+++ b/chrome/browser/ui/views/page_info/page_info_main_view.h
|
||||
@@ -129,6 +129,8 @@ class PageInfoMainView : public views::V
|
||||
// the label depending on the number of visible permissions.
|
||||
void UpdateResetButton(const PermissionInfoList& permission_info_list);
|
||||
|
||||
+ void MaybeAddNoiseButton();
|
||||
+
|
||||
void OnMerchantTrustDataFetched(
|
||||
const GURL& url,
|
||||
std::optional<page_info::MerchantData> merchant_data);
|
||||
@@ -223,6 +225,8 @@ class PageInfoMainView : public views::V
|
||||
|
||||
raw_ptr<views::View> security_container_view_ = nullptr;
|
||||
|
||||
+ raw_ptr<views::View> noise_container_view_ = nullptr;
|
||||
+
|
||||
raw_ptr<views::LabelButton, AcrossTasksDanglingUntriaged> reset_button_ =
|
||||
nullptr;
|
||||
|
||||
@@ -310,7 +310,7 @@
|
||||
// Updating the top, left and right insets for contents container view when
|
||||
--- a/chrome/browser/ui/views/frame/multi_contents_view.h
|
||||
+++ b/chrome/browser/ui/views/frame/multi_contents_view.h
|
||||
@@ -169,10 +169,13 @@ class MultiContentsView
|
||||
@@ -170,10 +170,13 @@ class MultiContentsView
|
||||
MultiContentsViewDropTargetController& drop_target_controller() const;
|
||||
|
||||
bool IsDragAndDropEnabled() const;
|
||||
@@ -324,7 +324,7 @@
|
||||
void SetAttachedSideChromeVisibility(bool leading_attached,
|
||||
bool trailing_attached);
|
||||
void SetSplitViewInsets(const gfx::Insets& insets);
|
||||
@@ -265,8 +268,6 @@ class MultiContentsView
|
||||
@@ -268,8 +271,6 @@ class MultiContentsView
|
||||
// `MultiContentsView`. Returns 0 if not in a split view.
|
||||
int GetMinViewSize(gfx::Rect available_space) const;
|
||||
|
||||
@@ -333,7 +333,7 @@
|
||||
void UpdateContentsBorderAndOverlay() const;
|
||||
|
||||
double CalculateRatioWithSnapPoints(double start_size,
|
||||
@@ -331,6 +332,7 @@ class MultiContentsView
|
||||
@@ -334,6 +335,7 @@ class MultiContentsView
|
||||
PrefChangeRegistrar pref_change_registrar_;
|
||||
bool is_drag_drop_pref_enabled_ = false;
|
||||
bool is_rounded_frame_pref_enabled_ = false;
|
||||
@@ -379,7 +379,7 @@
|
||||
#endif // CHROME_BROWSER_UI_VIEWS_INFOBARS_INFOBAR_CONTAINER_VIEW_H_
|
||||
--- a/chrome/browser/ui/views/frame/multi_contents_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/multi_contents_view.cc
|
||||
@@ -507,8 +507,9 @@ views::ProposedLayout MultiContentsView:
|
||||
@@ -524,8 +524,9 @@ views::ProposedLayout MultiContentsView:
|
||||
available_space.Inset(split_view_insets_);
|
||||
} else if (should_use_rounded_frame) {
|
||||
gfx::Insets single_insets(kSplitViewContentInset);
|
||||
@@ -391,7 +391,7 @@
|
||||
single_insets.set_left(contents_separators_.leading_side_chrome_attached
|
||||
? 0
|
||||
: kSplitViewContentInset);
|
||||
@@ -646,8 +647,9 @@ gfx::Rect MultiContentsView::CalculateDr
|
||||
@@ -663,8 +664,9 @@ gfx::Rect MultiContentsView::CalculateDr
|
||||
available_space.x() + (is_drop_target_on_start ? drop_target_width : 0);
|
||||
int top_margin = 0;
|
||||
if (IsInSplitView() || should_use_rounded_frame) {
|
||||
@@ -403,7 +403,7 @@
|
||||
} else if (contents_separators_.should_show_top) {
|
||||
top_margin =
|
||||
contents_separators_.top_separator->GetPreferredSize().height();
|
||||
@@ -880,10 +882,18 @@ void MultiContentsView::OnRoundedFramePr
|
||||
@@ -940,10 +942,18 @@ void MultiContentsView::OnRoundedFramePr
|
||||
}
|
||||
|
||||
void MultiContentsView::SetShouldShowTopSeparator(bool should_show) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -680,6 +680,11 @@ inline constexpr char kHeliumLayout[] =
|
||||
@@ -675,6 +675,11 @@ inline constexpr char kHeliumLayout[] =
|
||||
inline constexpr char kHeliumVerticalRightAligned[] =
|
||||
"helium.browser.vertical_right_aligned";
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
inline constexpr char kShowHomeButton[] = "browser.show_home_button";
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -127,6 +127,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
@@ -125,6 +125,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
|
||||
registry->RegisterBooleanPref(prefs::kHeliumRoundedFrame, true);
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
// Update the internal margins for touch layout.
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -289,6 +289,9 @@
|
||||
@@ -286,6 +286,9 @@
|
||||
<message name="IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN" desc="Label for the toggle that displays vertical tabs on the right side of the browser window.">
|
||||
Show vertical tabs on right side
|
||||
</message>
|
||||
@@ -205,14 +205,14 @@
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -559,6 +559,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
@@ -558,6 +558,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
{"browserLayoutCompact", IDS_SETTINGS_BROWSER_LAYOUT_COMPACT},
|
||||
{"browserLayoutVertical", IDS_SETTINGS_BROWSER_LAYOUT_VERTICAL},
|
||||
{"tabStripRightAlign", IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN},
|
||||
+ {"centeredLocationBar", IDS_SETTINGS_CENTERED_LOCATION_BAR},
|
||||
{"verticalCollapseShortcut", IDS_SETTINGS_VERTICAL_COLLAPSE_SHORTCUT},
|
||||
{"shiftRightClickContextMenu",
|
||||
IDS_SETTINGS_SHIFT_RIGHT_CLICK_CONTEXT_MENU},
|
||||
{"showHomeButton", IDS_SETTINGS_SHOW_HOME_BUTTON},
|
||||
{"showBookmarksBar", IDS_SETTINGS_SHOW_BOOKMARKS_BAR},
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -214,6 +214,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
@@ -243,7 +243,7 @@
|
||||
pref="{{prefs.helium.browser.vertical_right_aligned}}"
|
||||
label="$i18n{tabStripRightAlign}">
|
||||
</settings-toggle-button>
|
||||
+ <settings-toggle-button class="hr"
|
||||
+ <settings-toggle-button
|
||||
+ hidden="[[!showCenteredLocationBarSetting_(
|
||||
+ prefs.helium.browser.layout.value)]]"
|
||||
+ pref="{{prefs.helium.browser.centered_location_bar}}"
|
||||
@@ -252,16 +252,3 @@
|
||||
</div>
|
||||
|
||||
<div
|
||||
--- a/chrome/browser/ui/views/frame/browser_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/browser_view.cc
|
||||
@@ -2916,6 +2916,10 @@ void BrowserView::NotifyWidgetSizeConstr
|
||||
}
|
||||
|
||||
void BrowserView::OnWidgetShowStateChanged(views::Widget* widget) {
|
||||
+ if (toolbar_) {
|
||||
+ toolbar_->InvalidateLayout();
|
||||
+ }
|
||||
+
|
||||
// `display-state` @media feature value in renderer needs to be updated.
|
||||
SynchronizeRenderWidgetHostVisualPropertiesForMainFrame();
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
void BrowserView::OnProjectsPanelStateChanged(
|
||||
ProjectsPanelStateController* controller) {
|
||||
projects_panel_container_->OnProjectsPanelStateChanged(controller);
|
||||
@@ -3835,9 +3866,10 @@ void BrowserView::ReparentTabStripAndWeb
|
||||
@@ -3831,9 +3862,10 @@ void BrowserView::ReparentTabStripAndWeb
|
||||
// The TabStrip must be placed in the same position before the reparenting
|
||||
// to maintain the correct Z-order to ensure it can receive mouse events.
|
||||
// See crbug.com/454852658.
|
||||
@@ -156,7 +156,7 @@
|
||||
|
||||
// Reparent PWA views that were moved for immersive and ChromeOS tablet
|
||||
// mode.
|
||||
@@ -4989,6 +5021,16 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -4979,6 +5011,16 @@ void BrowserView::AddedToWidget() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#define IDC_ADD_NEW_TAB_TO_GROUP 34100
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -10418,6 +10418,51 @@ Keep your key file in a safe place. You
|
||||
@@ -10406,6 +10406,51 @@ Keep your key file in a safe place. You
|
||||
Bottom
|
||||
</message>
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
#include "chrome/browser/ui/intent_picker_tab_helper.h"
|
||||
#include "chrome/browser/ui/lens/lens_search_controller.h"
|
||||
#include "chrome/browser/ui/location_bar/location_bar.h"
|
||||
@@ -2370,6 +2371,20 @@ void ToggleVerticalTabsExpandOnHover(Bro
|
||||
@@ -2355,6 +2356,20 @@ void ToggleVerticalTabsExpandOnHover(Bro
|
||||
controller->SetExpandOnHoverEnabled(!controller->IsExpandOnHoverEnabled());
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
case IDC_TAKE_SCREENSHOT:
|
||||
@@ -1669,6 +1684,15 @@ void BrowserCommandController::InitComma
|
||||
@@ -1666,6 +1681,15 @@ void BrowserCommandController::InitComma
|
||||
command_updater_.UpdateCommandEnabled(IDC_SHOW_SEARCH_TOOLS, true);
|
||||
command_updater_.UpdateCommandEnabled(IDC_SHOW_AI_MODE_OMNIBOX_BUTTON, true);
|
||||
|
||||
@@ -164,8 +164,8 @@
|
||||
+ true);
|
||||
+
|
||||
// Window management commands
|
||||
command_updater_.UpdateCommandEnabled(IDC_FORCE_PASTE, true);
|
||||
command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true);
|
||||
command_updater_.UpdateCommandEnabled(
|
||||
--- a/chrome/browser/ui/views/frame/system_menu_model_builder.h
|
||||
+++ b/chrome/browser/ui/views/frame/system_menu_model_builder.h
|
||||
@@ -62,6 +62,7 @@ class SystemMenuModelBuilder {
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
} // namespace tabs
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -673,6 +673,13 @@ inline constexpr char kShiftRightClickCo
|
||||
@@ -668,6 +668,13 @@ inline constexpr char kTabCyclingMRU[] =
|
||||
// frame.
|
||||
inline constexpr char kHeliumRoundedFrame[] = "helium.browser.rounded_frame";
|
||||
|
||||
@@ -275,7 +275,7 @@
|
||||
// A boolean pref set to true if a Home button to open the Home pages should be
|
||||
// visible on the toolbar.
|
||||
inline constexpr char kShowHomeButton[] = "browser.show_home_button";
|
||||
@@ -1363,18 +1370,6 @@ inline constexpr char kProjectsPanelPinn
|
||||
@@ -1352,18 +1359,6 @@ inline constexpr char kProjectsPanelPinn
|
||||
inline constexpr char kEverythingMenuPinnedToTabstrip[] =
|
||||
"everything_menu.pinned_to_tabstrip";
|
||||
|
||||
@@ -771,7 +771,7 @@
|
||||
void StartPasswordManagerTutorial();
|
||||
--- a/chrome/browser/glic/suggestions/contextual_cueing_helper.cc
|
||||
+++ b/chrome/browser/glic/suggestions/contextual_cueing_helper.cc
|
||||
@@ -499,10 +499,6 @@ ContextualCueingHelper::AutoOpenGlicSide
|
||||
@@ -504,10 +504,6 @@ ContextualCueingHelper::AutoOpenGlicSide
|
||||
Profile* profile =
|
||||
Profile::FromBrowserContext(web_contents()->GetBrowserContext());
|
||||
bool vertical_tabs_enabled = false;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/prefs/browser_prefs.cc
|
||||
+++ b/chrome/browser/prefs/browser_prefs.cc
|
||||
@@ -971,6 +971,12 @@ constexpr char kContextualCueingEnterpri
|
||||
@@ -970,6 +970,12 @@ constexpr char kContextualCueingEnterpri
|
||||
inline constexpr char kRealboxContextMenuAnimationState[] =
|
||||
"realbox.context_menu_animation_state";
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// Register local state used only for migration (clearing or moving to a new
|
||||
// key).
|
||||
void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
|
||||
@@ -1279,6 +1285,10 @@ void RegisterProfilePrefsForMigration(
|
||||
@@ -1278,6 +1284,10 @@ void RegisterProfilePrefsForMigration(
|
||||
registry->RegisterInt64Pref(kSafeBrowsingModuleLastCooldownStartAt, 0);
|
||||
registry->RegisterBooleanPref(kSafeBrowsingModuleOpened, false);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// Deprecated 04/2026.
|
||||
registry->RegisterIntegerPref(kPreallocatedAddressesVersion, 1);
|
||||
registry->RegisterListPref(kPreallocatedAddresses);
|
||||
@@ -2568,6 +2578,25 @@ void MigrateObsoleteProfilePrefs(PrefSer
|
||||
@@ -2564,6 +2574,25 @@ void MigrateObsoleteProfilePrefs(PrefSer
|
||||
// Added 06/2026.
|
||||
profile_prefs->ClearPref(kRealboxContextMenuAnimationState);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -685,6 +685,10 @@ inline constexpr char kHeliumVerticalRig
|
||||
@@ -680,6 +680,10 @@ inline constexpr char kHeliumVerticalRig
|
||||
inline constexpr char kHeliumCenteredLocationBar[] =
|
||||
"helium.browser.centered_location_bar";
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
inline constexpr char kShowHomeButton[] = "browser.show_home_button";
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -129,6 +129,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
@@ -127,6 +127,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
|
||||
registry->RegisterBooleanPref(prefs::kHeliumCenteredLocationBar, false);
|
||||
|
||||
@@ -243,7 +243,7 @@
|
||||
GURL GetContextualTasksInnerFrameURL() const override;
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -292,6 +292,9 @@
|
||||
@@ -289,6 +289,9 @@
|
||||
<message name="IDS_SETTINGS_CENTERED_LOCATION_BAR" desc="Label for the toggle to use a centered address bar.">
|
||||
Center the address bar
|
||||
</message>
|
||||
@@ -255,14 +255,14 @@
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -561,6 +561,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
@@ -560,6 +560,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
{"tabStripRightAlign", IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN},
|
||||
{"centeredLocationBar", IDS_SETTINGS_CENTERED_LOCATION_BAR},
|
||||
{"verticalCollapseShortcut", IDS_SETTINGS_VERTICAL_COLLAPSE_SHORTCUT},
|
||||
+ {"minimalLocationBar", IDS_SETTINGS_MINIMAL_LOCATION_BAR},
|
||||
{"shiftRightClickContextMenu",
|
||||
IDS_SETTINGS_SHIFT_RIGHT_CLICK_CONTEXT_MENU},
|
||||
{"showHomeButton", IDS_SETTINGS_SHOW_HOME_BUTTON},
|
||||
{"showBookmarksBar", IDS_SETTINGS_SHOW_BOOKMARKS_BAR},
|
||||
{"bookmarksBar", IDS_SETTINGS_BOOKMARKS_BAR},
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -216,6 +216,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
@@ -280,7 +280,7 @@
|
||||
pref="{{prefs.helium.browser.centered_location_bar}}"
|
||||
label="$i18n{centeredLocationBar}">
|
||||
</settings-toggle-button>
|
||||
+ <settings-toggle-button class="hr"
|
||||
+ <settings-toggle-button
|
||||
+ pref="{{prefs.helium.browser.minimal_location_bar}}"
|
||||
+ label="$i18n{minimalLocationBar}">
|
||||
+ </settings-toggle-button>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
settings_api::PrefType::kBoolean;
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -271,6 +271,24 @@
|
||||
@@ -268,6 +268,24 @@
|
||||
<message name="IDS_SETTINGS_ROUNDED_FRAME" desc="Label for the toggle which enables or disables a rounded frame around web contents.">
|
||||
Show a rounded frame around web contents
|
||||
</message>
|
||||
@@ -41,7 +41,7 @@
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -553,6 +553,12 @@ void AddAppearanceStrings(content::WebUI
|
||||
@@ -552,6 +552,12 @@ void AddAppearanceStrings(content::WebUI
|
||||
{"openNewTabNextToActive", IDS_SETTINGS_NEW_TAB_NEXT_TO_ACTIVE_BUTTON},
|
||||
{"cycleTabsInMRUOrder", IDS_SETTINGS_CYCLE_TABS_IN_MRU_ORDER},
|
||||
{"roundedFrame", IDS_SETTINGS_ROUNDED_FRAME},
|
||||
@@ -51,9 +51,9 @@
|
||||
+ {"browserLayoutCompact", IDS_SETTINGS_BROWSER_LAYOUT_COMPACT},
|
||||
+ {"browserLayoutVertical", IDS_SETTINGS_BROWSER_LAYOUT_VERTICAL},
|
||||
+ {"tabStripRightAlign", IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN},
|
||||
{"shiftRightClickContextMenu",
|
||||
IDS_SETTINGS_SHIFT_RIGHT_CLICK_CONTEXT_MENU},
|
||||
{"showHomeButton", IDS_SETTINGS_SHOW_HOME_BUTTON},
|
||||
{"showBookmarksBar", IDS_SETTINGS_SHOW_BOOKMARKS_BAR},
|
||||
{"bookmarksBar", IDS_SETTINGS_BOOKMARKS_BAR},
|
||||
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.ts
|
||||
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.ts
|
||||
@@ -83,6 +83,15 @@ export enum SystemTheme {
|
||||
@@ -162,8 +162,8 @@
|
||||
+ menu-options="[[browserLayoutOptions_]]">
|
||||
+ </settings-dropdown-menu>
|
||||
+ </div>
|
||||
+ <div class="list-frame indented-toggles">
|
||||
+ <settings-toggle-button class="hr"
|
||||
+ <div class="list-frame hover-card-toggles">
|
||||
+ <settings-toggle-button
|
||||
+ hidden="[[!showVerticalSettings_]]"
|
||||
+ pref="{{prefs.helium.browser.vertical_right_aligned}}"
|
||||
+ label="$i18n{tabStripRightAlign}">
|
||||
@@ -173,7 +173,7 @@
|
||||
<div
|
||||
class="hr"
|
||||
hidden="[[!showHr_(
|
||||
@@ -166,61 +185,6 @@
|
||||
@@ -171,61 +190,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -956,6 +956,11 @@ inline constexpr char kPrefersDefaultScr
|
||||
@@ -945,6 +945,11 @@ inline constexpr char kPrefersDefaultScr
|
||||
inline constexpr char kCopyPageUrlShortcut[] =
|
||||
"helium.settings.a11y.copy_page_url_shortcut";
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// asking the user to set up automatic updates when Keystone promotion is
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -183,6 +183,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
@@ -181,6 +181,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
base::ListValue());
|
||||
|
||||
registry->RegisterBooleanPref(prefs::kCopyPageUrlShortcut, true);
|
||||
@@ -76,7 +76,7 @@
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
profile_pref_registrar_.Add(
|
||||
prefs::kPrintingEnabled,
|
||||
@@ -1409,6 +1422,20 @@ bool BrowserCommandController::ExecuteCo
|
||||
@@ -1406,6 +1419,20 @@ bool BrowserCommandController::ExecuteCo
|
||||
copy ? IDC_COPY_URL : IDC_DEV_TOOLS_INSPECT,
|
||||
disposition, time_stamp);
|
||||
}
|
||||
@@ -97,7 +97,7 @@
|
||||
// Hosted App commands
|
||||
case IDC_COPY_URL:
|
||||
CopyURL(browser_, browser_->tab_strip_model()->GetActiveWebContents());
|
||||
@@ -2495,7 +2522,11 @@ void BrowserCommandController::UpdateSav
|
||||
@@ -2491,7 +2518,11 @@ void BrowserCommandController::UpdateSav
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
VK_NEXT, IDC_MOVE_TAB_NEXT, VIRTKEY, CONTROL, SHIFT
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -4774,6 +4774,16 @@
|
||||
@@ -4730,6 +4730,16 @@
|
||||
Enable quick page link copying with Ctrl+Shift+C
|
||||
</message>
|
||||
</if>
|
||||
@@ -185,17 +185,17 @@
|
||||
<message name="IDS_SETTINGS_AI_PAGE_MAIN_TITLE" desc="This string is the title of a card that sets the context for the ‘AI innovations’ section of Chrome’s settings. Here, the user can see settings related to AI (artificial intelligence) in this section; these settings include Help me write and more. This title is before the ‘Things to consider’ subheading and bullet points. We want users to read this card and understand the considerations that apply to all Chrome’s AI features. The tone should be motivating." formatter_data="android_java">
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -559,6 +559,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
@@ -558,6 +558,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
{"browserLayoutCompact", IDS_SETTINGS_BROWSER_LAYOUT_COMPACT},
|
||||
{"browserLayoutVertical", IDS_SETTINGS_BROWSER_LAYOUT_VERTICAL},
|
||||
{"tabStripRightAlign", IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN},
|
||||
+ {"verticalCollapseShortcut", IDS_SETTINGS_VERTICAL_COLLAPSE_SHORTCUT},
|
||||
{"shiftRightClickContextMenu",
|
||||
IDS_SETTINGS_SHIFT_RIGHT_CLICK_CONTEXT_MENU},
|
||||
{"showHomeButton", IDS_SETTINGS_SHOW_HOME_BUTTON},
|
||||
{"showBookmarksBar", IDS_SETTINGS_SHOW_BOOKMARKS_BAR},
|
||||
{"bookmarksBar", IDS_SETTINGS_BOOKMARKS_BAR},
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -677,6 +677,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
@@ -673,6 +673,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kCopyPageUrlShortcut] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
@@ -206,7 +206,7 @@
|
||||
// Accounts / Users / People.
|
||||
--- a/chrome/browser/resources/settings/appearance_page/appearance_behavior_page.html
|
||||
+++ b/chrome/browser/resources/settings/appearance_page/appearance_behavior_page.html
|
||||
@@ -21,6 +21,11 @@
|
||||
@@ -16,6 +16,11 @@
|
||||
label="$i18n{copyPageUrlShortcut}">
|
||||
</settings-toggle-button>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -777,6 +777,16 @@ inline constexpr char kShowMenuButton[]
|
||||
@@ -766,6 +766,16 @@ inline constexpr char kShowMenuButton[]
|
||||
// the toolbar.
|
||||
inline constexpr char kShowMediaButton[] = "helium.browser.show_media_button";
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
inline constexpr char kGeminiSettings[] = "browser.gemini_settings";
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -156,6 +156,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
@@ -154,6 +154,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
registry->RegisterBooleanPref(prefs::kShowExtensionsButton, true);
|
||||
registry->RegisterBooleanPref(prefs::kShowMenuButton, true);
|
||||
registry->RegisterBooleanPref(prefs::kShowMediaButton, true);
|
||||
@@ -502,7 +502,7 @@
|
||||
bool should_show_glic_button_ = false;
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -314,6 +314,10 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
@@ -312,6 +312,10 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kShowMediaButton] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
|
||||
@@ -676,7 +676,7 @@
|
||||
/*align_leading=*/true,
|
||||
/*expand=*/false),
|
||||
+ TabChildConfig(alert_indicator_, kIconDesignWidth, kDefaultPadding,
|
||||
+ /*align_leading=*/true,
|
||||
+ /*align_leading=*/false,
|
||||
+ /*expand=*/false, /*decorate_on_collapse=*/true),
|
||||
TabChildConfig(title_, kTitleMinWidth, kDefaultPadding,
|
||||
/*align_leading=*/true,
|
||||
@@ -1027,7 +1027,7 @@
|
||||
bool BrowserView::ShouldDrawWebAppFrameToolbar() const {
|
||||
return !IsUnframedModeEnabled() &&
|
||||
GetFrameView()->ShouldShowWebAppFrameToolbar();
|
||||
@@ -1601,7 +1587,21 @@ void BrowserView::OnVerticalTabStripMode
|
||||
@@ -1601,7 +1587,20 @@ void BrowserView::OnVerticalTabStripMode
|
||||
std::move(selection_state));
|
||||
}
|
||||
|
||||
@@ -1037,11 +1037,10 @@
|
||||
+ // when the vertical-vs-horizontal state actually changes; for in-vertical
|
||||
+ // property changes (e.g. right-alignment) a layout pass is sufficient.
|
||||
+ const bool vertical_initialized =
|
||||
+ vertical_tab_strip_region_view_->GetTabStripView() != nullptr;
|
||||
+ vertical_tab_strip_region_view_->root_node_for_testing() != nullptr;
|
||||
+ const bool should_be_vertical = controller->ShouldDisplayVerticalTabs();
|
||||
+ if (vertical_initialized == should_be_vertical) {
|
||||
+ // Mode is unchanged; just re-layout so alignment-dependent views update.
|
||||
+ vertical_tab_strip_region_view_->InvalidateLayout();
|
||||
+ InvalidateLayout();
|
||||
+ return;
|
||||
+ }
|
||||
@@ -1050,7 +1049,7 @@
|
||||
horizontal_tab_strip_region_view_->ResetTabStrip();
|
||||
vertical_tab_strip_region_view_->InitializeTabStrip();
|
||||
} else {
|
||||
@@ -4234,13 +4234,23 @@ const views::Widget* BrowserView::GetWid
|
||||
@@ -4230,13 +4229,23 @@ const views::Widget* BrowserView::GetWid
|
||||
}
|
||||
|
||||
void BrowserView::CreateTabSearchBubble() {
|
||||
@@ -1076,7 +1075,7 @@
|
||||
tab_search_host->CloseTabSearchBubble();
|
||||
}
|
||||
}
|
||||
@@ -4280,34 +4290,21 @@ void BrowserView::UpdateTabSearchBubbleH
|
||||
@@ -4276,34 +4285,21 @@ void BrowserView::UpdateTabSearchBubbleH
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1126,7 +1125,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5094,9 +5091,6 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -5084,9 +5080,6 @@ void BrowserView::AddedToWidget() {
|
||||
layout_views.horizontal_tab_strip_region_view =
|
||||
horizontal_tab_strip_region_view_;
|
||||
layout_views.vertical_tab_strip_region_view = vertical_tab_strip_region_view_;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</if>
|
||||
|
||||
<!-- Appearance Page -->
|
||||
@@ -295,6 +301,18 @@
|
||||
@@ -292,6 +298,18 @@
|
||||
<message name="IDS_SETTINGS_MINIMAL_LOCATION_BAR" desc="Label for the toggle that enables the minimal address bar.">
|
||||
Minimal address bar
|
||||
</message>
|
||||
@@ -34,7 +34,7 @@
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -286,9 +286,9 @@ void AddA11yStrings(content::WebUIDataSo
|
||||
@@ -285,9 +285,9 @@ void AddA11yStrings(content::WebUIDataSo
|
||||
{"focusHighlightLabel",
|
||||
IDS_SETTINGS_ACCESSIBILITY_FOCUS_HIGHLIGHT_DESCRIPTION},
|
||||
{"toastAlertLevelTitle",
|
||||
@@ -46,7 +46,7 @@
|
||||
#endif
|
||||
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
|
||||
{"overscrollHistoryNavigationTitle",
|
||||
@@ -559,6 +559,10 @@ void AddAppearanceStrings(content::WebUI
|
||||
@@ -558,6 +558,10 @@ void AddAppearanceStrings(content::WebUI
|
||||
{"browserLayoutCompact", IDS_SETTINGS_BROWSER_LAYOUT_COMPACT},
|
||||
{"browserLayoutVertical", IDS_SETTINGS_BROWSER_LAYOUT_VERTICAL},
|
||||
{"tabStripRightAlign", IDS_SETTINGS_TAB_STRIP_RIGHT_ALIGN},
|
||||
@@ -77,19 +77,19 @@
|
||||
</settings-toggle-button>
|
||||
</div>
|
||||
|
||||
+ <settings-toggle-button class="hr"
|
||||
+ <settings-toggle-button
|
||||
+ pref="{{prefs.helium.browser.zen_mode}}"
|
||||
+ label="$i18n{browserZenMode}"
|
||||
+ sub-label="$i18n{browserZenModeDescription}">
|
||||
+ </settings-toggle-button>
|
||||
+ <div class="list-frame indented-toggles"
|
||||
+ <div class="list-frame hover-card-toggles"
|
||||
+ hidden="[[!prefs.helium.browser.zen_mode.value]]">
|
||||
+ <settings-toggle-button class="hr"
|
||||
+ <settings-toggle-button
|
||||
+ pref="{{prefs.helium.browser.zen_mode_sidebar_pinned}}"
|
||||
+ hidden="[[!showVerticalSettings_]]"
|
||||
+ label="$i18n{zenModePinSidebar}">
|
||||
+ </settings-toggle-button>
|
||||
+ <settings-toggle-button class="hr"
|
||||
+ <settings-toggle-button
|
||||
+ pref="{{prefs.helium.browser.zen_mode_top_chrome_pinned}}"
|
||||
+ label="$i18n{zenModePinToolbar}">
|
||||
+ </settings-toggle-button>
|
||||
@@ -145,7 +145,7 @@
|
||||
registry->RegisterIntegerPref(prefs::kVerticalTabsUncollapsedWidth,
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -680,6 +680,17 @@ inline constexpr char kHeliumLayout[] =
|
||||
@@ -675,6 +675,17 @@ inline constexpr char kHeliumLayout[] =
|
||||
inline constexpr char kHeliumVerticalRightAligned[] =
|
||||
"helium.browser.vertical_right_aligned";
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
{ui::VKEY_R, ui::EF_PLATFORM_ACCELERATOR, IDC_RELOAD},
|
||||
--- a/chrome/browser/ui/browser_command_controller.cc
|
||||
+++ b/chrome/browser/ui/browser_command_controller.cc
|
||||
@@ -1948,6 +1948,8 @@ void BrowserCommandController::InitComma
|
||||
@@ -1944,6 +1944,8 @@ void BrowserCommandController::InitComma
|
||||
// These are always enabled; the menu determines their menu item visibility.
|
||||
command_updater_.UpdateCommandEnabled(IDC_UPGRADE_DIALOG, true);
|
||||
command_updater_.UpdateCommandEnabled(IDC_HELIUM_SERVICES_OPEN, true);
|
||||
@@ -238,7 +238,7 @@
|
||||
{IDC_SHOW_BOOKMARK_MANAGER, ui::EF_COMMAND_DOWN | ui::EF_ALT_DOWN,
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -19259,6 +19259,9 @@ Please help our engineers fix this probl
|
||||
@@ -19247,6 +19247,9 @@ Please help our engineers fix this probl
|
||||
<message name="IDS_LINK_COPIED_TOAST_BODY" desc="Text on a toast notification that is shown when a link is successfully copied.">
|
||||
Link copied
|
||||
</message>
|
||||
|
||||
@@ -157,18 +157,10 @@
|
||||
if (vertical_initialized == should_be_vertical) {
|
||||
// Mode is unchanged; just re-layout so alignment-dependent views update.
|
||||
+ UpdateZenCollapseButtonVisibility();
|
||||
vertical_tab_strip_region_view_->InvalidateLayout();
|
||||
InvalidateLayout();
|
||||
return;
|
||||
@@ -1604,6 +1692,7 @@ void BrowserView::OnVerticalTabStripMode
|
||||
if (should_be_vertical) {
|
||||
horizontal_tab_strip_region_view_->ResetTabStrip();
|
||||
vertical_tab_strip_region_view_->InitializeTabStrip();
|
||||
+ MaybeExpandVerticalTabStripForZenMode();
|
||||
} else {
|
||||
vertical_tab_strip_region_view_->ResetTabStrip();
|
||||
horizontal_tab_strip_region_view_->InitializeTabStrip();
|
||||
@@ -1636,10 +1725,428 @@ void BrowserView::OnToolbarTabStripState
|
||||
}
|
||||
@@ -1635,10 +1723,424 @@ void BrowserView::OnToolbarTabStripState
|
||||
toolbar_->UpdateToolbarLayout();
|
||||
}
|
||||
|
||||
@@ -182,10 +174,16 @@
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (IsZenModeSideChromePinned()) {
|
||||
+ const bool side_chrome_pinned = IsZenModeSideChromePinned();
|
||||
+ if (side_chrome_pinned) {
|
||||
+ zen_side_chrome_animation_.Reset(1);
|
||||
+ } else {
|
||||
+ MaybeExpandVerticalTabStripForZenMode();
|
||||
+ } else if (auto* controller =
|
||||
+ tabs::VerticalTabStripStateController::From(browser_);
|
||||
+ controller && controller->IsCollapsed()) {
|
||||
+ controller->RequestCollapse(false);
|
||||
+ }
|
||||
+
|
||||
+ if (!side_chrome_pinned) {
|
||||
+ UpdateZenModeRevealFromCursor();
|
||||
+ }
|
||||
+
|
||||
@@ -223,23 +221,6 @@
|
||||
+ InvalidateLayout();
|
||||
+}
|
||||
+
|
||||
+// Unpinned sidebar floats in zen mode, so we make sure that VTS is usable
|
||||
+// in that state by expanding it when it's attached, not pinned, and collapsed.
|
||||
+void BrowserView::MaybeExpandVerticalTabStripForZenMode() {
|
||||
+ const bool vertical_initialized =
|
||||
+ vertical_tab_strip_region_view_ &&
|
||||
+ vertical_tab_strip_region_view_->GetTabStripView() != nullptr;
|
||||
+ if (!zen_mode_enabled_ || IsZenModeSideChromePinned() ||
|
||||
+ !ShouldDrawVerticalTabStrip() || !vertical_initialized) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ auto* controller = tabs::VerticalTabStripStateController::From(browser_);
|
||||
+ if (controller && controller->IsCollapsed()) {
|
||||
+ controller->RequestCollapse(false);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void BrowserView::UpdateZenModeState() {
|
||||
+ const bool zen_mode_enabled = IsZenModeEnabled();
|
||||
+ UpdateZenModeEventMonitor();
|
||||
@@ -270,7 +251,14 @@
|
||||
+ UpdateZenModeReveal(/*reveal_top=*/false, /*reveal_side=*/false);
|
||||
+ }
|
||||
+
|
||||
+ MaybeExpandVerticalTabStripForZenMode();
|
||||
+ // Force the vertical tab strip expanded when not pinned.
|
||||
+ if (auto* controller =
|
||||
+ tabs::VerticalTabStripStateController::From(browser_)) {
|
||||
+ if (zen_mode_enabled_ && !IsZenModeSideChromePinned() &&
|
||||
+ controller->IsCollapsed()) {
|
||||
+ controller->RequestCollapse(false);
|
||||
+ }
|
||||
+ }
|
||||
+ UpdateZenCollapseButtonVisibility();
|
||||
+
|
||||
+ if (!zen_mode_enabled_) {
|
||||
@@ -597,7 +585,7 @@
|
||||
void BrowserView::OnProjectsPanelStateChanged(
|
||||
ProjectsPanelStateController* controller) {
|
||||
projects_panel_container_->OnProjectsPanelStateChanged(controller);
|
||||
@@ -2351,6 +2858,8 @@ void BrowserView::FullscreenStateChanged
|
||||
@@ -2350,6 +2852,8 @@ void BrowserView::FullscreenStateChanged
|
||||
!GetFocusManager()->GetFocusedView());
|
||||
}
|
||||
}
|
||||
@@ -606,7 +594,7 @@
|
||||
}
|
||||
|
||||
ToolbarButtonProvider* BrowserView::toolbar_button_provider() {
|
||||
@@ -2401,6 +2910,13 @@ void BrowserView::SetFocusToLocationBar(
|
||||
@@ -2400,6 +2904,13 @@ void BrowserView::SetFocusToLocationBar(
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -620,7 +608,7 @@
|
||||
LocationBar* location_bar = GetLocationBar();
|
||||
location_bar->FocusLocation(is_user_initiated,
|
||||
/*clear_focus_if_failed=*/true);
|
||||
@@ -3084,7 +3600,7 @@ bool BrowserView::IsToolbarVisible() con
|
||||
@@ -3079,7 +3590,7 @@ bool BrowserView::IsToolbarVisible() con
|
||||
}
|
||||
|
||||
bool BrowserView::IsToolbarShowing() const {
|
||||
@@ -629,7 +617,7 @@
|
||||
}
|
||||
|
||||
bool BrowserView::IsLocationBarVisible() const {
|
||||
@@ -4172,6 +4688,11 @@ void BrowserView::OnWidgetActivationChan
|
||||
@@ -4167,6 +4678,11 @@ void BrowserView::OnWidgetActivationChan
|
||||
}
|
||||
}
|
||||
|
||||
@@ -641,7 +629,7 @@
|
||||
browser_->GetFeatures()
|
||||
.extension_keybinding_registry()
|
||||
->OnHostActivationChanged(active);
|
||||
@@ -5026,6 +5547,8 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -5015,6 +5531,8 @@ void BrowserView::AddedToWidget() {
|
||||
base::BindRepeating(&BrowserView::OnToolbarTabStripStateChanged,
|
||||
base::Unretained(this)));
|
||||
OnToolbarTabStripStateChanged(helium_layout_controller);
|
||||
@@ -650,7 +638,7 @@
|
||||
}
|
||||
|
||||
UpdateTabSearchBubbleHost();
|
||||
@@ -5110,6 +5633,9 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -5099,6 +5617,9 @@ void BrowserView::AddedToWidget() {
|
||||
// once per browser instance.
|
||||
auto* toolbar_button_provider = ToolbarButtonProvider::From(browser_);
|
||||
CHECK(toolbar_button_provider);
|
||||
@@ -660,15 +648,7 @@
|
||||
|
||||
// `AutofillBubbleHandlerImpl` depends on the ToolbarButtonProvider so it must
|
||||
// be constructed following the check above.
|
||||
@@ -5154,6 +5680,7 @@ void BrowserView::AddedToWidget() {
|
||||
tabs::VerticalTabStripStateController::From(browser_)) {
|
||||
if (vertical_tab_strip_state_controller->ShouldDisplayVerticalTabs()) {
|
||||
vertical_tab_strip_region_view_->InitializeTabStrip();
|
||||
+ MaybeExpandVerticalTabStripForZenMode();
|
||||
} else {
|
||||
horizontal_tab_strip_region_view_->InitializeTabStrip();
|
||||
}
|
||||
@@ -5166,6 +5693,8 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -5155,6 +5676,8 @@ void BrowserView::AddedToWidget() {
|
||||
}
|
||||
|
||||
void BrowserView::RemovedFromWidget() {
|
||||
@@ -677,7 +657,7 @@
|
||||
CHECK(GetFocusManager());
|
||||
focus_manager_observation_.Reset();
|
||||
}
|
||||
@@ -5194,6 +5723,14 @@ void BrowserView::OnThemeChanged() {
|
||||
@@ -5183,6 +5706,14 @@ void BrowserView::OnThemeChanged() {
|
||||
}
|
||||
|
||||
FrameColorsChanged();
|
||||
@@ -692,7 +672,7 @@
|
||||
}
|
||||
|
||||
bool BrowserView::GetDropFormats(
|
||||
@@ -5457,6 +5994,9 @@ void BrowserView::UpdateFastResizeForCon
|
||||
@@ -5446,6 +5977,9 @@ void BrowserView::UpdateFastResizeForCon
|
||||
}
|
||||
|
||||
int BrowserView::GetClientAreaTop() {
|
||||
@@ -702,7 +682,7 @@
|
||||
views::View* top_view = toolbar_;
|
||||
|
||||
// Get the top of the top view in browser view coordinates.
|
||||
@@ -6068,6 +6608,56 @@ void BrowserView::OnWillChangeFocus(View
|
||||
@@ -6057,6 +6591,56 @@ void BrowserView::OnWillChangeFocus(View
|
||||
}
|
||||
void BrowserView::OnDidChangeFocus(View* focused_before, View* focused_now) {
|
||||
UpdateAccessibleNameForRootView();
|
||||
@@ -850,7 +830,7 @@
|
||||
// Testing interface:
|
||||
views::View* GetContentsContainerForTest() { return contents_container_; }
|
||||
BrowserViewLayout* GetBrowserViewLayoutForTesting() {
|
||||
@@ -915,6 +950,27 @@ class BrowserView : public BrowserWindow
|
||||
@@ -915,6 +950,26 @@ class BrowserView : public BrowserWindow
|
||||
|
||||
void OnProjectsPanelStateChanged(ProjectsPanelStateController* controller);
|
||||
|
||||
@@ -858,7 +838,6 @@
|
||||
+ void OnZenModeSideChromePinnedPrefChanged();
|
||||
+ void OnZenModeTopChromePinnedPrefChanged();
|
||||
+ void UpdateZenModeState();
|
||||
+ void MaybeExpandVerticalTabStripForZenMode();
|
||||
+ void UpdateZenCollapseButtonVisibility();
|
||||
+ void UpdateZenModeEventMonitor();
|
||||
+ void StartZenCollapseTimer(base::TimeDelta delay);
|
||||
@@ -878,7 +857,7 @@
|
||||
// Callback for the loading animation(s) associated with this view.
|
||||
void LoadingAnimationTimerCallback();
|
||||
void LoadingAnimationCallback(base::TimeTicks timestamp);
|
||||
@@ -1363,6 +1419,9 @@ class BrowserView : public BrowserWindow
|
||||
@@ -1363,6 +1418,9 @@ class BrowserView : public BrowserWindow
|
||||
base::ScopedObservation<views::Widget, views::WidgetObserver>
|
||||
widget_observation_{this};
|
||||
|
||||
@@ -888,7 +867,7 @@
|
||||
bool interactive_resize_in_progress_ = false;
|
||||
|
||||
// The last bounds we notified about in TryNotifyWindowBoundsChanged().
|
||||
@@ -1417,6 +1476,14 @@ class BrowserView : public BrowserWindow
|
||||
@@ -1417,6 +1475,14 @@ class BrowserView : public BrowserWindow
|
||||
|
||||
std::unique_ptr<TabCyclingEventHandler> tab_cycling_event_handler_;
|
||||
|
||||
@@ -1249,17 +1228,7 @@
|
||||
}
|
||||
|
||||
// TODO(crbug.com/469425263): Ensure correct layout calculations for the
|
||||
@@ -878,7 +984,8 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
top_container_layout.bounds = GetTopContainerBoundsInParent(
|
||||
top_container_local_bounds, parent_params);
|
||||
|
||||
- if (layout_data_->tab_strip_type == TabStripType::kVertical) {
|
||||
+ if (layout_data_->tab_strip_type == TabStripType::kVertical &&
|
||||
+ !zen.floating_vertical_tab_strip) {
|
||||
auto& top_container_children = top_container_layout.children;
|
||||
auto bookmarks_child = top_container_children.find(views().bookmark_bar);
|
||||
if (bookmarks_child != top_container_children.end() &&
|
||||
@@ -900,15 +1007,40 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
@@ -900,15 +1006,40 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
if (const auto* toolbar_layout =
|
||||
top_container_layout.GetLayoutFor(views().toolbar);
|
||||
toolbar_layout && !toolbar_layout->bounds.IsEmpty()) {
|
||||
@@ -1302,7 +1271,7 @@
|
||||
}
|
||||
|
||||
if (dynamic_tab_strip) {
|
||||
@@ -916,15 +1048,21 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
@@ -916,15 +1047,21 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
|
||||
const int tabstrip_height =
|
||||
views().horizontal_tab_strip_region_view->GetPreferredSize().height();
|
||||
@@ -1332,7 +1301,7 @@
|
||||
}
|
||||
|
||||
// Lay out the main area background.
|
||||
@@ -1059,7 +1197,8 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
@@ -1059,7 +1196,8 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
params.SetTop(top_container_layout.bounds.bottom());
|
||||
}
|
||||
|
||||
@@ -1342,7 +1311,7 @@
|
||||
if (delegate().IsVerticalTabStripRightAligned()) {
|
||||
trailing_side_chrome_attached = true;
|
||||
} else {
|
||||
@@ -1102,14 +1241,21 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
@@ -1102,14 +1240,21 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
const auto& separator_info = layout_data_->separator_info;
|
||||
views().multi_contents_view->SetTopChromeAttachmentState(
|
||||
infobar_visible && should_use_rounded_frame,
|
||||
@@ -1367,7 +1336,7 @@
|
||||
const bool include_leading_inset =
|
||||
separator_info.shadow_box ||
|
||||
!(horizontal_layout.has_side_panel() && side_panel_leading);
|
||||
@@ -1121,7 +1267,7 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
@@ -1121,7 +1266,7 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
base::ClampRound((1.0 - side_panel_reveal_amount) * default_inset);
|
||||
|
||||
const gfx::Insets contents_insets = gfx::Insets::TLBR(
|
||||
@@ -1376,7 +1345,7 @@
|
||||
include_leading_inset ? default_inset : panel_side_inset, default_inset,
|
||||
include_trailing_inset ? default_inset : panel_side_inset);
|
||||
|
||||
@@ -1235,6 +1381,8 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
@@ -1235,6 +1380,8 @@ BrowserViewTabbedLayoutImpl::CalculatePr
|
||||
|
||||
views().vertical_tab_strip_region_view->SetHasLeadingExclusionForLayout(
|
||||
has_leading_exclusion);
|
||||
@@ -1385,7 +1354,7 @@
|
||||
|
||||
const int padding =
|
||||
GetLayoutConstant(LayoutConstant::kVerticalTabStripHorizontalPadding);
|
||||
@@ -1263,6 +1411,8 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
|
||||
@@ -1263,6 +1410,8 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
|
||||
IsDynamicTabStrip(layout_data_->tab_strip_type);
|
||||
const bool show_dynamic_tab_strip =
|
||||
ShowDynamicTabStrip(layout_data_->tab_strip_type);
|
||||
@@ -1394,7 +1363,7 @@
|
||||
|
||||
if (IsParentedTo(views().horizontal_tab_strip_region_view,
|
||||
views().top_container)) {
|
||||
@@ -1271,12 +1421,19 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
|
||||
@@ -1271,12 +1420,19 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
|
||||
const int leading_margin = GetHorizontalTabStripLeadingMargin(params);
|
||||
tabstrip_bounds = GetBoundsWithExclusion(
|
||||
params, views().horizontal_tab_strip_region_view, leading_margin);
|
||||
@@ -1417,7 +1386,7 @@
|
||||
}
|
||||
|
||||
// Lay out toolbar. If toolbar is in the top-most row, it will go into the
|
||||
@@ -1297,21 +1454,26 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
|
||||
@@ -1297,21 +1453,26 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
|
||||
params.visual_client_area.y(),
|
||||
params.visual_client_area.width(),
|
||||
views().toolbar->GetPreferredSize().height());
|
||||
@@ -1448,7 +1417,7 @@
|
||||
}
|
||||
|
||||
// Lay out the bookmarks bar if one is present.
|
||||
@@ -1320,24 +1482,33 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
|
||||
@@ -1320,24 +1481,33 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
|
||||
const gfx::Rect bookmarks_bounds(
|
||||
params.visual_client_area.x(), params.visual_client_area.y(),
|
||||
params.visual_client_area.width(),
|
||||
@@ -1489,7 +1458,7 @@
|
||||
}
|
||||
|
||||
return gfx::Rect(params.visual_client_area.x(), original_top,
|
||||
@@ -1345,13 +1516,60 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
|
||||
@@ -1345,13 +1515,60 @@ gfx::Rect BrowserViewTabbedLayoutImpl::C
|
||||
params.visual_client_area.y() - original_top);
|
||||
}
|
||||
|
||||
@@ -1611,7 +1580,7 @@
|
||||
// AppMenuIconController::Delegate:
|
||||
--- a/chrome/browser/ui/browser_command_controller.cc
|
||||
+++ b/chrome/browser/ui/browser_command_controller.cc
|
||||
@@ -1423,7 +1423,17 @@ bool BrowserCommandController::ExecuteCo
|
||||
@@ -1420,7 +1420,17 @@ bool BrowserCommandController::ExecuteCo
|
||||
disposition, time_stamp);
|
||||
}
|
||||
case IDC_CTRL_S_SHORTCUT: {
|
||||
@@ -1629,7 +1598,7 @@
|
||||
if (ShouldToggleVerticalCollapse(prefs)) {
|
||||
auto* controller =
|
||||
tabs::VerticalTabStripStateController::From(browser_);
|
||||
@@ -1436,6 +1446,14 @@ bool BrowserCommandController::ExecuteCo
|
||||
@@ -1433,6 +1443,14 @@ bool BrowserCommandController::ExecuteCo
|
||||
return ExecuteCommandWithDisposition(IDC_SAVE_PAGE, disposition,
|
||||
time_stamp);
|
||||
}
|
||||
@@ -1646,7 +1615,7 @@
|
||||
CopyURL(browser_, browser_->tab_strip_model()->GetActiveWebContents());
|
||||
--- a/chrome/browser/ui/views/frame/multi_contents_view.h
|
||||
+++ b/chrome/browser/ui/views/frame/multi_contents_view.h
|
||||
@@ -83,6 +83,9 @@ class MultiContentsView
|
||||
@@ -84,6 +84,9 @@ class MultiContentsView
|
||||
const gfx::RoundedCornersF& background_radii() const;
|
||||
void SetBackgroundRadii(const gfx::RoundedCornersF& radii);
|
||||
|
||||
@@ -1656,7 +1625,7 @@
|
||||
// Returns true if more than one WebContents is displayed.
|
||||
bool IsInSplitView() const;
|
||||
|
||||
@@ -228,6 +231,14 @@ class MultiContentsView
|
||||
@@ -231,6 +234,14 @@ class MultiContentsView
|
||||
bool trailing_side_chrome_attached = false;
|
||||
};
|
||||
|
||||
@@ -1671,7 +1640,7 @@
|
||||
static constexpr int kMinWebContentsSize = 200;
|
||||
static constexpr int kConstrainedMinWebContentsSize = 50;
|
||||
static constexpr double kMinWebContentsSizePercentage = 0.1;
|
||||
@@ -241,6 +252,7 @@ class MultiContentsView
|
||||
@@ -244,6 +255,7 @@ class MultiContentsView
|
||||
// available space after the layout.
|
||||
gfx::Rect CalculateDropTargetLayout(
|
||||
const gfx::Rect& available_space,
|
||||
@@ -1679,7 +1648,7 @@
|
||||
std::vector<views::ChildLayout>& child_layouts) const;
|
||||
|
||||
// Adds separator layouts to the given list and returns the remaining
|
||||
@@ -268,6 +280,9 @@ class MultiContentsView
|
||||
@@ -271,6 +283,9 @@ class MultiContentsView
|
||||
// `MultiContentsView`. Returns 0 if not in a split view.
|
||||
int GetMinViewSize(gfx::Rect available_space) const;
|
||||
|
||||
@@ -1689,7 +1658,7 @@
|
||||
void UpdateContentsBorderAndOverlay() const;
|
||||
|
||||
double CalculateRatioWithSnapPoints(double start_size,
|
||||
@@ -317,10 +332,11 @@ class MultiContentsView
|
||||
@@ -320,10 +335,11 @@ class MultiContentsView
|
||||
// a resize action began. Nullopt if not currently resizing.
|
||||
std::optional<int> initial_start_size_on_resize_;
|
||||
|
||||
@@ -1727,7 +1696,7 @@
|
||||
#include "chrome/browser/ui/views/tabs/shared/drop_arrow.h"
|
||||
#include "chrome/browser/ui/views/tabs/vertical/root_tab_collection_node.h"
|
||||
#include "chrome/browser/ui/views/tabs/vertical/tab_collection_node.h"
|
||||
@@ -319,7 +320,46 @@ void VerticalTabStripRegionView::SetHasL
|
||||
@@ -319,7 +320,45 @@ void VerticalTabStripRegionView::SetHasL
|
||||
}
|
||||
|
||||
void VerticalTabStripRegionView::SetIsExitingExpandOnHoverForLayout(
|
||||
@@ -1740,7 +1709,6 @@
|
||||
+ return;
|
||||
+ }
|
||||
+ zen_mode_floating_style_ = floating;
|
||||
+ UpdateResizeAreaVisibility();
|
||||
+ SetClipLayerToVisibleBounds(floating);
|
||||
+ UpdateInteriorMargin();
|
||||
+
|
||||
@@ -1775,16 +1743,6 @@
|
||||
}
|
||||
|
||||
bool VerticalTabStripRegionView::WillWrapDueToOverflow(
|
||||
@@ -837,8 +877,7 @@ void VerticalTabStripRegionView::OnResiz
|
||||
}
|
||||
|
||||
if (done_resizing) {
|
||||
- resize_area_->SetVisible(!state_controller_->IsCollapsed() ||
|
||||
- !state_controller_->IsExpandOnHoverEnabled());
|
||||
+ UpdateResizeAreaVisibility();
|
||||
base::RecordAction(base::UserMetricsAction(
|
||||
new_state.collapsed ? "VerticalTabs_TabStrip_ResizeToCollapsed"
|
||||
: "VerticalTabs_TabStrip_ResizeToUncollapsed"));
|
||||
@@ -979,7 +1018,21 @@ void VerticalTabStripRegionView::ClearTa
|
||||
void VerticalTabStripRegionView::UpdateInteriorMargin() {
|
||||
const int padding = GetLayoutConstant(
|
||||
@@ -1808,53 +1766,6 @@
|
||||
}
|
||||
|
||||
void VerticalTabStripRegionView::OnCollapseStateChanged(
|
||||
@@ -988,9 +1041,7 @@ void VerticalTabStripRegionView::OnColla
|
||||
// the collapsing state.
|
||||
bool collapsed = state != tabs::VerticalTabStripCollapseState::kExpanded;
|
||||
|
||||
- resize_area_->SetVisible(!collapsed ||
|
||||
- !state_controller_->IsExpandOnHoverEnabled() ||
|
||||
- resize_area_->is_resizing());
|
||||
+ UpdateResizeAreaVisibility();
|
||||
|
||||
resize_area_width_ = collapsed ? kCollapsedResizeAreaWidth : kResizeAreaWidth;
|
||||
|
||||
@@ -1004,6 +1055,22 @@ void VerticalTabStripRegionView::OnColla
|
||||
}
|
||||
}
|
||||
|
||||
+void VerticalTabStripRegionView::UpdateResizeAreaVisibility() {
|
||||
+ if (zen_mode_floating_style_) {
|
||||
+ resize_area_->SetVisible(false);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ const bool is_fully_expanded =
|
||||
+ state_controller_->GetCollapseState() ==
|
||||
+ tabs::VerticalTabStripCollapseState::kExpanded;
|
||||
+ const bool can_resize_collapsed_tab_strip =
|
||||
+ !state_controller_->IsExpandOnHoverEnabled() ||
|
||||
+ resize_area_->is_resizing();
|
||||
+
|
||||
+ resize_area_->SetVisible(is_fully_expanded || can_resize_collapsed_tab_strip);
|
||||
+}
|
||||
+
|
||||
void VerticalTabStripRegionView::UpdateColors() {
|
||||
SchedulePaint();
|
||||
}
|
||||
@@ -1049,9 +1116,9 @@ void VerticalTabStripRegionView::OnChild
|
||||
hover_tab_selector_->CancelTabTransition();
|
||||
}
|
||||
|
||||
-void VerticalTabStripRegionView::OnExpandOnHoverEnabledChanged(bool enabled) {
|
||||
- resize_area_->SetVisible(!state_controller_->IsCollapsed() || !enabled ||
|
||||
- resize_area_->is_resizing());
|
||||
+void VerticalTabStripRegionView::OnExpandOnHoverEnabledChanged(
|
||||
+ bool /*enabled*/) {
|
||||
+ UpdateResizeAreaVisibility();
|
||||
UpdateExpandOnHoverState();
|
||||
}
|
||||
|
||||
--- a/chrome/browser/ui/views/frame/vertical_tab_strip_region_view.h
|
||||
+++ b/chrome/browser/ui/views/frame/vertical_tab_strip_region_view.h
|
||||
@@ -99,8 +99,11 @@ class VerticalTabStripRegionView final
|
||||
@@ -1869,7 +1780,7 @@
|
||||
TabDragTarget* GetTabDragTarget(const gfx::Point& point_in_screen);
|
||||
|
||||
// views::View:
|
||||
@@ -229,10 +232,9 @@ class VerticalTabStripRegionView final
|
||||
@@ -229,8 +232,6 @@ class VerticalTabStripRegionView final
|
||||
views::View* SetTabStripView(std::unique_ptr<views::View> view);
|
||||
void ClearTabStripView(views::View* view);
|
||||
|
||||
@@ -1877,11 +1788,8 @@
|
||||
-
|
||||
void OnCollapseStateChanged(
|
||||
tabs::VerticalTabStripCollapseState collapse_state);
|
||||
+ void UpdateResizeAreaVisibility();
|
||||
|
||||
void UpdateColors();
|
||||
|
||||
@@ -294,6 +296,7 @@ class VerticalTabStripRegionView final
|
||||
@@ -294,6 +295,7 @@ class VerticalTabStripRegionView final
|
||||
|
||||
// Whether a leading exclusion exists due to window controls.
|
||||
bool has_leading_exclusion_ = false;
|
||||
@@ -2010,7 +1918,7 @@
|
||||
|
||||
#include "base/check_deref.h"
|
||||
#include "base/feature_list.h"
|
||||
@@ -55,8 +56,18 @@
|
||||
@@ -56,8 +57,18 @@
|
||||
|
||||
namespace {
|
||||
constexpr int kSnapDistance = 15;
|
||||
@@ -2029,7 +1937,7 @@
|
||||
void MultiContentsView::ContentsSeparators::Reset() {
|
||||
top_separator = nullptr;
|
||||
leading_separator = nullptr;
|
||||
@@ -426,6 +437,41 @@ int MultiContentsView::GetInactiveIndex(
|
||||
@@ -443,6 +454,41 @@ int MultiContentsView::GetInactiveIndex(
|
||||
return active_index_ == 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
@@ -2071,7 +1979,7 @@
|
||||
void MultiContentsView::OnWebContentsFocused(views::WebView* web_view) {
|
||||
if (IsInSplitView()) {
|
||||
// Check whether the widget is visible as otherwise during browser hide,
|
||||
@@ -488,16 +534,17 @@ views::ProposedLayout MultiContentsView:
|
||||
@@ -505,16 +551,17 @@ views::ProposedLayout MultiContentsView:
|
||||
|
||||
gfx::Rect available_space = gfx::Rect(width, height);
|
||||
|
||||
@@ -2094,7 +2002,7 @@
|
||||
}
|
||||
|
||||
available_space =
|
||||
@@ -507,9 +554,7 @@ views::ProposedLayout MultiContentsView:
|
||||
@@ -524,9 +571,7 @@ views::ProposedLayout MultiContentsView:
|
||||
available_space.Inset(split_view_insets_);
|
||||
} else if (should_use_rounded_frame) {
|
||||
gfx::Insets single_insets(kSplitViewContentInset);
|
||||
@@ -2105,7 +2013,7 @@
|
||||
single_insets.set_left(contents_separators_.leading_side_chrome_attached
|
||||
? 0
|
||||
: kSplitViewContentInset);
|
||||
@@ -612,6 +657,7 @@ void MultiContentsView::BeforeApplyLayou
|
||||
@@ -629,6 +674,7 @@ void MultiContentsView::BeforeApplyLayou
|
||||
|
||||
gfx::Rect MultiContentsView::CalculateDropTargetLayout(
|
||||
const gfx::Rect& available_space,
|
||||
@@ -2113,7 +2021,7 @@
|
||||
std::vector<views::ChildLayout>& child_layouts) const {
|
||||
CHECK(IsDragAndDropEnabled());
|
||||
if (!drop_target_view_->GetVisible()) {
|
||||
@@ -625,19 +671,17 @@ gfx::Rect MultiContentsView::CalculateDr
|
||||
@@ -642,19 +688,17 @@ gfx::Rect MultiContentsView::CalculateDr
|
||||
const bool is_drop_target_on_start =
|
||||
drop_target_view_->side() == MultiContentsDropTargetView::DropSide::START;
|
||||
const bool should_use_rounded_frame = ShouldUseRoundedFrame();
|
||||
@@ -2138,7 +2046,7 @@
|
||||
UpdateContentsBorderAndOverlay();
|
||||
|
||||
const int drop_target_x =
|
||||
@@ -646,10 +690,8 @@ gfx::Rect MultiContentsView::CalculateDr
|
||||
@@ -663,10 +707,8 @@ gfx::Rect MultiContentsView::CalculateDr
|
||||
const int remaining_space_x =
|
||||
available_space.x() + (is_drop_target_on_start ? drop_target_width : 0);
|
||||
int top_margin = 0;
|
||||
@@ -2151,7 +2059,34 @@
|
||||
} else if (contents_separators_.should_show_top) {
|
||||
top_margin =
|
||||
contents_separators_.top_separator->GetPreferredSize().height();
|
||||
@@ -791,6 +833,12 @@ bool MultiContentsView::ShouldUseRounded
|
||||
@@ -737,10 +779,14 @@ gfx::Rect MultiContentsView::CalculateSe
|
||||
gfx::Rect(available_space.right() - trailing_separator_width,
|
||||
available_space.y(), trailing_separator_width, height));
|
||||
|
||||
+ const bool show_floating_corners =
|
||||
+ !browser_view_->IsZenModeEnabledForLayout();
|
||||
+
|
||||
auto* const corner_separator = contents_separators_.corner_separator.get();
|
||||
const auto corner_preferred_size = corner_separator->GetPreferredSize();
|
||||
views::ChildLayout corner_layout(
|
||||
- corner_separator, contents_separators_.should_show_top &&
|
||||
+ corner_separator, show_floating_corners &&
|
||||
+ contents_separators_.should_show_top &&
|
||||
(should_show_leading || should_show_trailing));
|
||||
if (corner_layout.visible) {
|
||||
if (should_show_leading) {
|
||||
@@ -763,8 +809,8 @@ gfx::Rect MultiContentsView::CalculateSe
|
||||
contents_separators_.trailing_corner_separator.get();
|
||||
views::ChildLayout trailing_corner_layout(
|
||||
trailing_corner_separator,
|
||||
- contents_separators_.should_show_top && should_show_leading &&
|
||||
- should_show_trailing);
|
||||
+ show_floating_corners && contents_separators_.should_show_top &&
|
||||
+ should_show_leading && should_show_trailing);
|
||||
if (trailing_corner_layout.visible) {
|
||||
trailing_corner_layout.bounds = gfx::Rect(
|
||||
gfx::Point(available_space.right() - corner_preferred_size.width(),
|
||||
@@ -851,6 +897,12 @@ bool MultiContentsView::ShouldUseRounded
|
||||
!is_fullscreen;
|
||||
}
|
||||
|
||||
@@ -2164,7 +2099,7 @@
|
||||
void MultiContentsView::UpdateContentsBorderAndOverlay() const {
|
||||
const views::Widget* widget = browser_view_->GetWidget();
|
||||
const bool is_fullscreen = widget && widget->IsFullscreen();
|
||||
@@ -804,17 +852,25 @@ void MultiContentsView::UpdateContentsBo
|
||||
@@ -864,17 +916,25 @@ void MultiContentsView::UpdateContentsBo
|
||||
const bool is_drop_target_on_end =
|
||||
is_drop_target_visible &&
|
||||
drop_target_view_->side() == MultiContentsDropTargetView::DropSide::END;
|
||||
@@ -2199,7 +2134,7 @@
|
||||
|
||||
for (auto* contents_container_view : contents_container_views_) {
|
||||
const bool is_active =
|
||||
@@ -833,6 +889,8 @@ void MultiContentsView::UpdateContentsBo
|
||||
@@ -893,6 +953,8 @@ void MultiContentsView::UpdateContentsBo
|
||||
contents_container_view->UpdateBorderAndOverlay(
|
||||
is_in_split, should_round_contents, is_active,
|
||||
is_active && active_contents_view_highlighted_,
|
||||
@@ -2208,7 +2143,7 @@
|
||||
use_system_bottom_left_radius && is_first_view,
|
||||
use_system_bottom_right_radius && is_last_view);
|
||||
}
|
||||
@@ -894,9 +952,7 @@ void MultiContentsView::SetTopChromeAtta
|
||||
@@ -954,9 +1016,7 @@ void MultiContentsView::SetTopChromeAtta
|
||||
}
|
||||
top_edge_attached_to_infobar_ = top_edge_attached_to_infobar;
|
||||
contents_separators_.should_show_top = should_show_top_separator;
|
||||
@@ -2219,7 +2154,7 @@
|
||||
// This can be called during BrowserView layout, so protect against creating a
|
||||
// layout loop.
|
||||
InvalidateLayout(/*avoid_propagate_during_layout=*/true);
|
||||
@@ -911,11 +967,7 @@ void MultiContentsView::SetAttachedSideC
|
||||
@@ -971,11 +1031,7 @@ void MultiContentsView::SetAttachedSideC
|
||||
}
|
||||
contents_separators_.leading_side_chrome_attached = leading_attached;
|
||||
contents_separators_.trailing_side_chrome_attached = trailing_attached;
|
||||
|
||||
@@ -275,7 +275,7 @@
|
||||
raw_ptr<views::ImageView> icon_view_ = nullptr;
|
||||
--- a/chrome/browser/ui/views/frame/multi_contents_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/multi_contents_view.cc
|
||||
@@ -614,27 +614,50 @@ gfx::Rect MultiContentsView::CalculateDr
|
||||
@@ -631,27 +631,50 @@ gfx::Rect MultiContentsView::CalculateDr
|
||||
std::vector<views::ChildLayout>& child_layouts) const {
|
||||
CHECK(IsDragAndDropEnabled());
|
||||
if (!drop_target_view_->GetVisible()) {
|
||||
@@ -337,7 +337,7 @@
|
||||
|
||||
return gfx::Rect(remaining_space_x, available_space.y(),
|
||||
available_space.width() - drop_target_width,
|
||||
@@ -766,23 +789,30 @@ bool MultiContentsView::ShouldUseRounded
|
||||
@@ -826,23 +849,30 @@ bool MultiContentsView::ShouldUseRounded
|
||||
!is_fullscreen;
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@
|
||||
const bool is_active =
|
||||
--- a/chrome/browser/ui/views/frame/multi_contents_view.h
|
||||
+++ b/chrome/browser/ui/views/frame/multi_contents_view.h
|
||||
@@ -267,7 +267,7 @@ class MultiContentsView
|
||||
@@ -270,7 +270,7 @@ class MultiContentsView
|
||||
|
||||
bool ShouldUseRoundedFrame() const;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,460 +0,0 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -669,6 +669,11 @@ inline constexpr char kTabCyclingMRU[] =
|
||||
inline constexpr char kShiftRightClickContextMenu[] =
|
||||
"helium.browser.shift_right_click_context_menu";
|
||||
|
||||
+// A boolean pref set to true if the zoom indicator should be shown in the
|
||||
+// address bar.
|
||||
+inline constexpr char kShowZoomIndicator[] =
|
||||
+ "helium.browser.show_zoom_indicator";
|
||||
+
|
||||
// A boolean pref set to true if web contents should be shown inside a rounded
|
||||
// frame.
|
||||
inline constexpr char kHeliumRoundedFrame[] = "helium.browser.rounded_frame";
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -125,6 +125,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
|
||||
registry->RegisterBooleanPref(prefs::kShiftRightClickContextMenu, true);
|
||||
|
||||
+ registry->RegisterBooleanPref(prefs::kShowZoomIndicator, true);
|
||||
+
|
||||
registry->RegisterBooleanPref(prefs::kHeliumRoundedFrame, true);
|
||||
|
||||
registry->RegisterBooleanPref(prefs::kHeliumNativeFrameMaterials, false);
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -340,7 +340,7 @@ BASE_FEATURE_PARAM(bool,
|
||||
kPageActionsMigrationZoom,
|
||||
&kPageActionsMigration,
|
||||
"zoom",
|
||||
- false);
|
||||
+ true);
|
||||
|
||||
BASE_FEATURE_PARAM(bool,
|
||||
kPageActionsMigrationCookieControls,
|
||||
--- a/chrome/browser/ui/browser_actions.cc
|
||||
+++ b/chrome/browser/ui/browser_actions.cc
|
||||
@@ -140,6 +140,7 @@
|
||||
#include "components/tabs/public/tab_interface.h"
|
||||
#include "components/user_prefs/user_prefs.h"
|
||||
#include "components/vector_icons/vector_icons.h"
|
||||
+#include "components/zoom/page_zoom.h"
|
||||
#include "ui/accessibility/accessibility_features.h"
|
||||
#include "ui/actions/actions.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
@@ -567,19 +568,14 @@ void BrowserActions::InitializePageActio
|
||||
base::BindRepeating(
|
||||
[](BrowserWindowInterface* bwi, actions::ActionItem* item,
|
||||
actions::ActionInvocationContext context) {
|
||||
- bwi->GetActiveTabInterface()
|
||||
- ->GetTabFeatures()
|
||||
- ->zoom_view_controller()
|
||||
- ->UpdateBubbleVisibility(
|
||||
- /*prefer_to_show_bubble=*/true,
|
||||
- /*from_user_gesture=*/true);
|
||||
+ zoom::PageZoom::Zoom(
|
||||
+ bwi->GetActiveTabInterface()->GetContents(),
|
||||
+ content::PAGE_ZOOM_RESET);
|
||||
},
|
||||
bwi))
|
||||
.SetActionId(kActionZoomNormal)
|
||||
.SetText(l10n_util::GetStringUTF16(IDS_ZOOM_NORMAL))
|
||||
.SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_ZOOM))
|
||||
- .SetImage(ui::ImageModel::FromVectorIcon(
|
||||
- features::IsRoundedIconsEnabled() ? kZoomInIcon : kZoomInOldIcon))
|
||||
.Build());
|
||||
|
||||
// The action does nothing, but is used to configure the page action, which
|
||||
--- a/chrome/browser/ui/views/zoom/zoom_view_controller.cc
|
||||
+++ b/chrome/browser/ui/views/zoom/zoom_view_controller.cc
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "base/i18n/number_formatting.h"
|
||||
#include "base/notreached.h"
|
||||
#include "chrome/app/vector_icons/vector_icons.h"
|
||||
+#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/ui/actions/chrome_action_id.h"
|
||||
#include "chrome/browser/ui/browser_actions.h"
|
||||
#include "chrome/browser/ui/browser_window/public/browser_window_features.h"
|
||||
@@ -20,6 +21,7 @@
|
||||
#include "chrome/browser/ui/views/location_bar/zoom_bubble_coordinator.h"
|
||||
#include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h"
|
||||
#include "chrome/browser/ui/views/page_action/page_action_view.h"
|
||||
+#include "chrome/common/pref_names.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "components/tabs/public/tab_interface.h"
|
||||
#include "components/zoom/zoom_controller.h"
|
||||
@@ -36,6 +38,13 @@ ZoomViewController::ZoomViewController(
|
||||
: tab_interface_(tab_interface),
|
||||
page_action_controller_(page_action_controller) {
|
||||
DCHECK(IsPageActionMigrated(PageActionIconType::kZoom));
|
||||
+ show_zoom_indicator_.Init(
|
||||
+ prefs::kShowZoomIndicator,
|
||||
+ Profile::FromBrowserContext(GetWebContents()->GetBrowserContext())
|
||||
+ ->GetPrefs(),
|
||||
+ base::BindRepeating(&ZoomViewController::UpdatePageActionIconVisibility,
|
||||
+ base::Unretained(this),
|
||||
+ /*is_bubble_visible=*/false));
|
||||
}
|
||||
|
||||
ZoomViewController::~ZoomViewController() = default;
|
||||
@@ -65,69 +74,36 @@ void ZoomViewController::UpdatePageActio
|
||||
zoom::ZoomController::FromWebContents(GetWebContents());
|
||||
CHECK(zoom_controller);
|
||||
|
||||
- auto accessible_text = l10n_util::GetStringFUTF16(
|
||||
- IDS_TOOLTIP_ZOOM, base::FormatPercent(zoom_controller->GetZoomPercent()));
|
||||
+ const std::u16string zoom_percent =
|
||||
+ base::FormatPercent(zoom_controller->GetZoomPercent());
|
||||
+ const std::u16string accessible_text =
|
||||
+ l10n_util::GetStringFUTF16(IDS_TOOLTIP_ZOOM, zoom_percent);
|
||||
|
||||
+ page_action_controller_->OverrideText(kActionZoomNormal, zoom_percent);
|
||||
page_action_controller_->OverrideTooltip(kActionZoomNormal, accessible_text);
|
||||
page_action_controller_->OverrideAccessibleName(kActionZoomNormal,
|
||||
accessible_text);
|
||||
-
|
||||
- switch (zoom_controller->GetZoomRelativeToDefault()) {
|
||||
- case ZoomController::ZOOM_BELOW_DEFAULT_ZOOM:
|
||||
- page_action_controller_->OverrideImage(
|
||||
- kActionZoomNormal,
|
||||
- ui::ImageModel::FromVectorIcon(features::IsRoundedIconsEnabled()
|
||||
- ? kZoomOutIcon
|
||||
- : kZoomMinusChromeRefreshOldIcon));
|
||||
- break;
|
||||
- case ZoomController::ZOOM_AT_DEFAULT_ZOOM:
|
||||
- case ZoomController::ZOOM_ABOVE_DEFAULT_ZOOM:
|
||||
- page_action_controller_->OverrideImage(
|
||||
- kActionZoomNormal,
|
||||
- ui::ImageModel::FromVectorIcon(features::IsRoundedIconsEnabled()
|
||||
- ? kZoomInIcon
|
||||
- : kZoomPlusChromeRefreshOldIcon));
|
||||
- break;
|
||||
- default:
|
||||
- NOTREACHED();
|
||||
- }
|
||||
}
|
||||
|
||||
void ZoomViewController::UpdatePageActionIconVisibility(
|
||||
- bool is_bubble_visible) {
|
||||
+ bool /*is_bubble_visible*/) {
|
||||
zoom::ZoomController* zoom_controller =
|
||||
zoom::ZoomController::FromWebContents(GetWebContents());
|
||||
CHECK(zoom_controller);
|
||||
|
||||
- const bool is_at_default_zoom = zoom_controller->IsAtDefaultZoom();
|
||||
- if (is_at_default_zoom && !is_bubble_visible) {
|
||||
- page_action_controller_->Hide(kActionZoomNormal);
|
||||
- } else {
|
||||
+ if (!zoom_controller->IsAtDefaultZoom() &&
|
||||
+ show_zoom_indicator_.GetValue()) {
|
||||
page_action_controller_->Show(kActionZoomNormal);
|
||||
+ } else {
|
||||
+ page_action_controller_->Hide(kActionZoomNormal);
|
||||
}
|
||||
}
|
||||
|
||||
-void ZoomViewController::UpdateBubbleVisibility(bool prefer_to_show_bubble,
|
||||
- bool from_user_gesture) {
|
||||
- zoom::ZoomController* zoom_controller =
|
||||
- zoom::ZoomController::FromWebContents(GetWebContents());
|
||||
- CHECK(zoom_controller);
|
||||
-
|
||||
- const bool is_at_default_zoom = zoom_controller->IsAtDefaultZoom();
|
||||
- const bool can_bubble_be_visible =
|
||||
- CanBubbleBeVisible(prefer_to_show_bubble, is_at_default_zoom);
|
||||
- if (can_bubble_be_visible) {
|
||||
- if (prefer_to_show_bubble) {
|
||||
- GetBubbleCoordinator()->Show(
|
||||
- GetWebContents(), from_user_gesture ? ZoomBubbleView::USER_GESTURE
|
||||
- : ZoomBubbleView::AUTOMATIC);
|
||||
- } else {
|
||||
- GetBubbleCoordinator()->RefreshIfShowing(GetWebContents());
|
||||
- }
|
||||
- } else {
|
||||
- if (IsBubbleVisible()) {
|
||||
- GetBubbleCoordinator()->Hide();
|
||||
- }
|
||||
+void ZoomViewController::UpdateBubbleVisibility(
|
||||
+ bool /*prefer_to_show_bubble*/,
|
||||
+ bool /*from_user_gesture*/) {
|
||||
+ if (IsBubbleVisible()) {
|
||||
+ GetBubbleCoordinator()->Hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,18 +115,6 @@ bool ZoomViewController::IsBubbleVisible
|
||||
return action_item->GetIsShowingBubble();
|
||||
}
|
||||
|
||||
-bool ZoomViewController::CanBubbleBeVisible(bool prefer_to_show_bubble,
|
||||
- bool is_zoom_at_default) const {
|
||||
- // The zoom bubble should be visible if either:
|
||||
- // 1. The caller prefers to show the bubble (`prefer_to_show_bubble`), or
|
||||
- // 2. The bubble is already visible (`IsBubbleVisible()`).
|
||||
- //
|
||||
- // If neither of these is true, we only show the bubble if the zoom level
|
||||
- // is not at the default (`!is_zoom_at_default`), indicating that zoom is
|
||||
- // active.
|
||||
- return prefer_to_show_bubble || IsBubbleVisible() || !is_zoom_at_default;
|
||||
-}
|
||||
-
|
||||
content::WebContents* ZoomViewController::GetWebContents() const {
|
||||
return tab_interface_->GetContents();
|
||||
}
|
||||
--- a/chrome/browser/ui/views/zoom/zoom_view_controller.h
|
||||
+++ b/chrome/browser/ui/views/zoom/zoom_view_controller.h
|
||||
@@ -5,6 +5,7 @@
|
||||
#ifndef CHROME_BROWSER_UI_VIEWS_ZOOM_ZOOM_VIEW_CONTROLLER_H_
|
||||
#define CHROME_BROWSER_UI_VIEWS_ZOOM_ZOOM_VIEW_CONTROLLER_H_
|
||||
|
||||
+#include "components/prefs/pref_member.h"
|
||||
#include "components/tabs/public/tab_interface.h"
|
||||
|
||||
class ZoomBubbleCoordinator;
|
||||
@@ -57,11 +58,6 @@ class ZoomViewController {
|
||||
// default.
|
||||
void UpdatePageActionIconProperties();
|
||||
|
||||
- // Determines if the page action should be visible under the current zoom
|
||||
- // conditions, factoring in whether the bubble is already visible or allowed.
|
||||
- bool CanBubbleBeVisible(bool prefer_to_show_bubble,
|
||||
- bool is_zoom_at_default) const;
|
||||
-
|
||||
// Helper to retrieve the active WebContents from the tab.
|
||||
content::WebContents* GetWebContents() const;
|
||||
|
||||
@@ -76,6 +72,8 @@ class ZoomViewController {
|
||||
// Unowned reference to the page action controller that will coordinate
|
||||
// requests from this object.
|
||||
const raw_ref<page_actions::PageActionController> page_action_controller_;
|
||||
+
|
||||
+ BooleanPrefMember show_zoom_indicator_;
|
||||
};
|
||||
|
||||
} // namespace zoom
|
||||
--- a/chrome/browser/ui/views/page_action/page_action_view.cc
|
||||
+++ b/chrome/browser/ui/views/page_action/page_action_view.cc
|
||||
@@ -12,11 +12,13 @@
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/task/sequenced_task_runner.h"
|
||||
+#include "chrome/browser/ui/color/chrome_color_id.h"
|
||||
#include "chrome/browser/ui/layout_constants.h"
|
||||
#include "chrome/browser/ui/page_action/page_action_controller.h"
|
||||
#include "chrome/browser/ui/page_action/page_action_model.h"
|
||||
#include "chrome/browser/ui/page_action/page_action_triggers.h"
|
||||
#include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h"
|
||||
+#include "chrome/browser/ui/views/location_bar/location_bar_util.h"
|
||||
#include "chrome/browser/ui/views/page_action/page_action_view_params.h"
|
||||
#include "ui/actions/actions.h"
|
||||
#include "ui/base/metadata/metadata_impl_macros.h"
|
||||
@@ -24,12 +26,15 @@
|
||||
#include "ui/color/color_id.h"
|
||||
#include "ui/events/event.h"
|
||||
#include "ui/gfx/animation/slide_animation.h"
|
||||
+#include "ui/gfx/font.h"
|
||||
#include "ui/gfx/font_list.h"
|
||||
#include "ui/gfx/geometry/insets.h"
|
||||
#include "ui/gfx/paint_vector_icon.h"
|
||||
#include "ui/views/accessibility/view_accessibility.h"
|
||||
#include "ui/views/animation/ink_drop.h"
|
||||
+#include "ui/views/background.h"
|
||||
#include "ui/views/controls/button/single_animated_image_container.h"
|
||||
+#include "ui/views/controls/highlight_path_generator.h"
|
||||
#include "ui/views/view_class_properties.h"
|
||||
#include "ui/views/widget/widget_delegate.h"
|
||||
|
||||
@@ -37,11 +42,13 @@ namespace page_actions {
|
||||
|
||||
PageActionView::PageActionView(actions::ActionItem* action_item,
|
||||
const PageActionViewParams& params,
|
||||
- ui::ElementIdentifier element_identifier)
|
||||
+ ui::ElementIdentifier element_identifier,
|
||||
+ bool text_only)
|
||||
: IconLabelBubbleView(gfx::FontList(), params.icon_label_bubble_delegate),
|
||||
action_item_(action_item->GetAsWeakPtr()),
|
||||
icon_size_(params.icon_size),
|
||||
- icon_insets_(params.icon_insets) {
|
||||
+ icon_insets_(params.icon_insets),
|
||||
+ text_only_(text_only) {
|
||||
CHECK(action_item_->GetActionId().has_value());
|
||||
SetUpForAnimation(base::Milliseconds(600));
|
||||
|
||||
@@ -59,7 +66,19 @@ PageActionView::PageActionView(actions::
|
||||
SetUseTonalColorsWhenExpanded(false);
|
||||
SetBackgroundVisibility(BackgroundVisibility::kWithLabel);
|
||||
UpdateBorder();
|
||||
- SetExpandedLabelAdditionalInsets(views::Inset1D(4, 8));
|
||||
+ SetExpandedLabelAdditionalInsets(
|
||||
+ text_only_ ? views::Inset1D(2, 2) : views::Inset1D(4, 8));
|
||||
+
|
||||
+ if (text_only_) {
|
||||
+ SetFontList(font_list().Derive(
|
||||
+ -3, gfx::Font::NORMAL, gfx::Font::Weight::MEDIUM));
|
||||
+ views::InstallRoundRectHighlightPathGenerator(
|
||||
+ this, gfx::Insets::VH(2, 0), GetCornerRadii());
|
||||
+ image_container_view()->SetPreferredSize(gfx::Size(0, icon_size_));
|
||||
+ label()->SetHorizontalAlignment(gfx::ALIGN_CENTER);
|
||||
+ SetCustomForegroundColorId(kColorOmniboxActionIcon);
|
||||
+ SetCustomBackgroundColorId(kColorOmniboxActionIconHover);
|
||||
+ }
|
||||
|
||||
label_visibility_changed_subscription_ =
|
||||
label()->AddVisibleChangedCallback(base::BindRepeating(
|
||||
@@ -80,7 +99,7 @@ PageActionView::~PageActionView() {
|
||||
}
|
||||
|
||||
bool PageActionView::IsChipVisible() const {
|
||||
- return ShouldShowLabel();
|
||||
+ return !text_only_ && ShouldShowLabel();
|
||||
}
|
||||
|
||||
bool PageActionView::IsAnchoredMessageVisible() const {
|
||||
@@ -173,6 +192,8 @@ void PageActionView::OnPageActionModelCh
|
||||
if (!visible) {
|
||||
ResetSlideAnimation(/*show=*/false);
|
||||
NotifyIsChipShowingChange();
|
||||
+ } else if (text_only_) {
|
||||
+ ResetSlideAnimation(/*show=*/true);
|
||||
} else if (model.ShouldShowSuggestionChip()) {
|
||||
if (model.GetShouldAnimateChipIn()) {
|
||||
AnimateIn(/*string_id=*/std::nullopt);
|
||||
@@ -219,6 +240,18 @@ void PageActionView::OnThemeChanged() {
|
||||
UpdateIconImage();
|
||||
}
|
||||
|
||||
+void PageActionView::UpdateBackground() {
|
||||
+ IconLabelBubbleView::UpdateBackground();
|
||||
+ if (text_only_) {
|
||||
+ if (GetBackground()) {
|
||||
+ SetBackground(views::CreateRoundedRectBackground(
|
||||
+ GetBackgroundColor(), GetCornerRadii(), gfx::Insets::VH(2, 0)));
|
||||
+ }
|
||||
+ ConfigureInkDropForRefresh2023(this, kColorOmniboxIconPressed,
|
||||
+ kColorOmniboxIconPressed);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void PageActionView::OnTouchUiChanged() {
|
||||
IconLabelBubbleView::OnTouchUiChanged();
|
||||
UpdateIconImage();
|
||||
@@ -242,7 +275,7 @@ void PageActionView::UpdateBorder() {
|
||||
}
|
||||
|
||||
bool PageActionView::ShouldShowLabel() const {
|
||||
- return false;
|
||||
+ return text_only_ && IconLabelBubbleView::ShouldShowLabel();
|
||||
}
|
||||
|
||||
bool PageActionView::ShouldShowSeparator() const {
|
||||
@@ -297,7 +330,7 @@ void PageActionView::AnimationEnded(cons
|
||||
}
|
||||
|
||||
void PageActionView::UpdateIconImage() {
|
||||
- if (!GetVisible() || observation_.GetSource() == nullptr ||
|
||||
+ if (text_only_ || !GetVisible() || observation_.GetSource() == nullptr ||
|
||||
observation_.GetSource()->GetImage().IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
@@ -375,6 +408,10 @@ void PageActionView::SetModel(PageAction
|
||||
}
|
||||
|
||||
gfx::Size PageActionView::GetMinimumSize() const {
|
||||
+ if (text_only_) {
|
||||
+ return gfx::Size();
|
||||
+ }
|
||||
+
|
||||
gfx::Size icon_preferred_size = image_container_view()->GetPreferredSize();
|
||||
if (observation_.IsObserving() &&
|
||||
!observation_.GetSource()->GetImage().IsVectorIcon()) {
|
||||
--- a/chrome/browser/ui/views/page_action/page_action_view.h
|
||||
+++ b/chrome/browser/ui/views/page_action/page_action_view.h
|
||||
@@ -44,7 +44,8 @@ class PageActionView : public IconLabelB
|
||||
PageActionView(actions::ActionItem* action_item,
|
||||
|
||||
const PageActionViewParams& params,
|
||||
- ui::ElementIdentifier element_identifier);
|
||||
+ ui::ElementIdentifier element_identifier,
|
||||
+ bool text_only = false);
|
||||
PageActionView(const PageActionView&) = delete;
|
||||
PageActionView& operator=(const PageActionView&) = delete;
|
||||
~PageActionView() override;
|
||||
@@ -100,6 +101,7 @@ class PageActionView : public IconLabelB
|
||||
void ViewHierarchyChanged(
|
||||
const views::ViewHierarchyChangedDetails& details) override;
|
||||
void OnThemeChanged() override;
|
||||
+ void UpdateBackground() override;
|
||||
void OnTouchUiChanged() override;
|
||||
void UpdateBorder() override;
|
||||
bool ShouldShowLabel() const override;
|
||||
@@ -163,6 +165,7 @@ class PageActionView : public IconLabelB
|
||||
|
||||
const int icon_size_;
|
||||
const gfx::Insets icon_insets_;
|
||||
+ const bool text_only_ = false;
|
||||
|
||||
// Subscription to changes in label visibility, used for updating properties
|
||||
// dependent on label visibility and notifying others of chip state changes.
|
||||
--- a/chrome/browser/ui/views/page_action/page_action_container_view.cc
|
||||
+++ b/chrome/browser/ui/views/page_action/page_action_container_view.cc
|
||||
@@ -52,7 +52,8 @@ PageActionContainerView::PageActionConta
|
||||
}
|
||||
|
||||
PageActionView* view = AddChildView(std::make_unique<PageActionView>(
|
||||
- action_item, params, properties.element_identifier));
|
||||
+ action_item, params, properties.element_identifier,
|
||||
+ /*text_only=*/properties.type == PageActionIconType::kZoom));
|
||||
|
||||
page_action_views_[action_item_id] = view;
|
||||
chip_state_changed_callbacks_.push_back(
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -295,6 +295,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kShiftRightClickContextMenu] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
+ (*s_allowlist)[::prefs::kShowZoomIndicator] =
|
||||
+ settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kHeliumRoundedFrame] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -274,6 +274,9 @@
|
||||
<message name="IDS_SETTINGS_SHIFT_RIGHT_CLICK_CONTEXT_MENU" desc="Label for the checkbox which makes Shift+right click show the browser context menu even when a page blocks it.">
|
||||
Force context menu with Shift+Right Click
|
||||
</message>
|
||||
+ <message name="IDS_SETTINGS_SHOW_ZOOM_INDICATOR" desc="Label for the checkbox which shows the current page zoom percentage in the address bar.">
|
||||
+ Show the zoom indicator in the address bar
|
||||
+ </message>
|
||||
<message name="IDS_SETTINGS_ROUNDED_FRAME" desc="Label for the toggle which enables or disables a rounded frame around web contents.">
|
||||
Show a rounded frame around web contents
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -571,6 +571,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
{"minimalLocationBar", IDS_SETTINGS_MINIMAL_LOCATION_BAR},
|
||||
{"shiftRightClickContextMenu",
|
||||
IDS_SETTINGS_SHIFT_RIGHT_CLICK_CONTEXT_MENU},
|
||||
+ {"showZoomIndicator", IDS_SETTINGS_SHOW_ZOOM_INDICATOR},
|
||||
{"showHomeButton", IDS_SETTINGS_SHOW_HOME_BUTTON},
|
||||
{"showBookmarksBar", IDS_SETTINGS_SHOW_BOOKMARKS_BAR},
|
||||
{"bookmarksBar", IDS_SETTINGS_BOOKMARKS_BAR},
|
||||
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.html
|
||||
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.html
|
||||
@@ -327,6 +327,13 @@
|
||||
</template>
|
||||
</select>
|
||||
</div>
|
||||
+ <div class="list-frame indented-toggles"
|
||||
+ hidden="[[!pageVisibility.pageZoom]]">
|
||||
+ <settings-toggle-button id="showZoomIndicator"
|
||||
+ pref="{{prefs.helium.browser.show_zoom_indicator}}"
|
||||
+ label="$i18n{showZoomIndicator}">
|
||||
+ </settings-toggle-button>
|
||||
+ </div>
|
||||
<if expr="is_macosx">
|
||||
<settings-toggle-button class="hr"
|
||||
pref="{{prefs.webkit.webprefs.tabs_to_links}}"
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ui/browser_actions.cc
|
||||
+++ b/chrome/browser/ui/browser_actions.cc
|
||||
@@ -74,8 +74,6 @@
|
||||
@@ -73,8 +73,6 @@
|
||||
#include "chrome/browser/ui/qrcode_generator/qrcode_generator_bubble_controller.h"
|
||||
#include "chrome/browser/ui/read_anything/read_anything_entry_point_controller.h"
|
||||
#include "chrome/browser/ui/search/omnibox_utils.h"
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "chrome/browser/ui/side_panel/side_panel_action_callback.h"
|
||||
#include "chrome/browser/ui/side_panel/side_panel_entry_id.h"
|
||||
#include "chrome/browser/ui/side_panel/side_panel_entry_key.h"
|
||||
@@ -102,7 +100,6 @@
|
||||
@@ -101,7 +99,6 @@
|
||||
#include "chrome/browser/ui/views/location_bar/record_replay_page_action_controller.h"
|
||||
#include "chrome/browser/ui/views/media_router/cast_browser_controller.h"
|
||||
#include "chrome/browser/ui/views/page_info/page_info_view_factory.h"
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "chrome/browser/ui/views/side_panel/comments/comments_side_panel_coordinator.h"
|
||||
#include "chrome/browser/ui/views/side_panel/history/history_side_panel_coordinator.h"
|
||||
#include "chrome/browser/ui/views/side_panel/history_clusters/history_clusters_side_panel_utils.h"
|
||||
@@ -280,24 +277,6 @@ void BrowserActions::InitializeSidePanel
|
||||
@@ -279,24 +276,6 @@ void BrowserActions::InitializeSidePanel
|
||||
kActionSidePanelShowBookmarks, bwi, true)
|
||||
.Build());
|
||||
root_action_item_->AddChild(
|
||||
@@ -42,7 +42,7 @@
|
||||
SidePanelAction(SidePanelEntryId::kAboutThisSite,
|
||||
IDS_PAGE_INFO_ABOUT_THIS_PAGE_TITLE,
|
||||
IDS_PAGE_INFO_ABOUT_THIS_PAGE_TITLE,
|
||||
@@ -314,24 +293,6 @@ void BrowserActions::InitializeSidePanel
|
||||
@@ -313,24 +292,6 @@ void BrowserActions::InitializeSidePanel
|
||||
: vector_icons::kEditChromeRefreshOldIcon,
|
||||
kActionSidePanelShowCustomizeChrome, bwi, false)
|
||||
.Build());
|
||||
@@ -67,7 +67,7 @@
|
||||
if (side_panel::history_clusters::
|
||||
IsHistoryClustersSidePanelSupportedForProfile(profile) &&
|
||||
!HistorySidePanelCoordinator::IsSupported()) {
|
||||
@@ -411,53 +372,6 @@ void BrowserActions::InitializeSidePanel
|
||||
@@ -410,53 +371,6 @@ void BrowserActions::InitializeSidePanel
|
||||
.Build());
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
if (CommentsSidePanelCoordinator::IsSupported()) {
|
||||
root_action_item_->AddChild(
|
||||
SidePanelAction(SidePanelEntryId::kComments,
|
||||
@@ -748,68 +662,6 @@ void BrowserActions::InitializePageActio
|
||||
@@ -744,68 +658,6 @@ void BrowserActions::InitializePageActio
|
||||
base::BindRepeating(
|
||||
[](BrowserWindowInterface* bwi, actions::ActionItem* item,
|
||||
actions::ActionInvocationContext context) {
|
||||
@@ -190,7 +190,7 @@
|
||||
auto* tab_interface = bwi->GetActiveTabInterface();
|
||||
CHECK(tab_interface);
|
||||
|
||||
@@ -1038,44 +890,6 @@ void BrowserActions::InitializeChromeMen
|
||||
@@ -1034,44 +886,6 @@ void BrowserActions::InitializeChromeMen
|
||||
: kDeveloperToolsOldIcon)
|
||||
.Build());
|
||||
|
||||
@@ -235,7 +235,7 @@
|
||||
root_action_item_->AddChild(
|
||||
actions::ActionItem::Builder(
|
||||
base::BindRepeating(
|
||||
@@ -1131,80 +945,6 @@ void BrowserActions::InitializeChromeMen
|
||||
@@ -1127,80 +941,6 @@ void BrowserActions::InitializeChromeMen
|
||||
.SetVisible(!sharing_hub::SharingIsDisabledByPolicy(profile))
|
||||
.Build());
|
||||
|
||||
@@ -316,7 +316,7 @@
|
||||
// TODO(crbug.com/435220196): Ideally this action would have
|
||||
// ChromeLabsCoordinator passed in as a dependency directly.
|
||||
if (IsChromeLabsEnabled() && !web_app::AppBrowserController::IsWebApp(bwi)) {
|
||||
@@ -1224,37 +964,6 @@ void BrowserActions::InitializeChromeMen
|
||||
@@ -1220,37 +960,6 @@ void BrowserActions::InitializeChromeMen
|
||||
.Build());
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
|
||||
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
|
||||
@@ -520,7 +520,6 @@ void LocationBarView::Init() {
|
||||
}
|
||||
params.types_enabled.push_back(PageActionIconType::kPwaInstall);
|
||||
params.types_enabled.push_back(PageActionIconType::kTranslate);
|
||||
- params.types_enabled.push_back(PageActionIconType::kZoom);
|
||||
|
||||
params.types_enabled.push_back(PageActionIconType::kMemorySaver);
|
||||
params.types_enabled.push_back(PageActionIconType::kFederation);
|
||||
--- a/chrome/browser/ui/web_applications/app_browser_controller.cc
|
||||
+++ b/chrome/browser/ui/web_applications/app_browser_controller.cc
|
||||
@@ -446,7 +446,6 @@ AppBrowserController::GetTitleBarPageAct
|
||||
|
||||
std::vector<PageActionIconType> types_enabled;
|
||||
types_enabled.push_back(PageActionIconType::kFind);
|
||||
- types_enabled.push_back(PageActionIconType::kZoom);
|
||||
types_enabled.push_back(PageActionIconType::kFileSystemAccess);
|
||||
|
||||
return types_enabled;
|
||||
--- a/chrome/browser/ui/views/zoom/zoom_view_controller.cc
|
||||
+++ b/chrome/browser/ui/views/zoom/zoom_view_controller.cc
|
||||
@@ -95,16 +95,7 @@ void ZoomViewController::UpdatePageActio
|
||||
|
||||
void ZoomViewController::UpdatePageActionIconVisibility(
|
||||
bool is_bubble_visible) {
|
||||
- zoom::ZoomController* zoom_controller =
|
||||
- zoom::ZoomController::FromWebContents(GetWebContents());
|
||||
- CHECK(zoom_controller);
|
||||
-
|
||||
- const bool is_at_default_zoom = zoom_controller->IsAtDefaultZoom();
|
||||
- if (is_at_default_zoom && !is_bubble_visible) {
|
||||
- page_action_controller_->Hide(kActionZoomNormal);
|
||||
- } else {
|
||||
- page_action_controller_->Show(kActionZoomNormal);
|
||||
- }
|
||||
+ page_action_controller_->Hide(kActionZoomNormal);
|
||||
}
|
||||
|
||||
void ZoomViewController::UpdateBubbleVisibility(bool prefer_to_show_bubble,
|
||||
@@ -141,14 +132,7 @@ bool ZoomViewController::IsBubbleVisible
|
||||
|
||||
bool ZoomViewController::CanBubbleBeVisible(bool prefer_to_show_bubble,
|
||||
bool is_zoom_at_default) const {
|
||||
- // The zoom bubble should be visible if either:
|
||||
- // 1. The caller prefers to show the bubble (`prefer_to_show_bubble`), or
|
||||
- // 2. The bubble is already visible (`IsBubbleVisible()`).
|
||||
- //
|
||||
- // If neither of these is true, we only show the bubble if the zoom level
|
||||
- // is not at the default (`!is_zoom_at_default`), indicating that zoom is
|
||||
- // active.
|
||||
- return prefer_to_show_bubble || IsBubbleVisible() || !is_zoom_at_default;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
content::WebContents* ZoomViewController::GetWebContents() const {
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -669,6 +669,10 @@ inline constexpr char kTabCyclingMRU[] =
|
||||
inline constexpr char kShiftRightClickContextMenu[] =
|
||||
"helium.browser.shift_right_click_context_menu";
|
||||
@@ -664,6 +664,10 @@ inline constexpr char kNewTabNextToActiv
|
||||
// when cycling through tabs with Ctrl+Tab.
|
||||
inline constexpr char kTabCyclingMRU[] = "helium.browser.mru_tab_cycling";
|
||||
|
||||
+// A boolean pref set to true if web contents should be shown inside a rounded
|
||||
+// frame.
|
||||
@@ -13,9 +13,9 @@
|
||||
inline constexpr char kShowHomeButton[] = "browser.show_home_button";
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -125,6 +125,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
@@ -123,6 +123,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
|
||||
registry->RegisterBooleanPref(prefs::kShiftRightClickContextMenu, true);
|
||||
registry->RegisterBooleanPref(prefs::kTabCyclingMRU, false);
|
||||
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumRoundedFrame, true);
|
||||
+
|
||||
@@ -24,9 +24,9 @@
|
||||
registry->RegisterBooleanPref(prefs::kShowHomeButton, false,
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -268,6 +268,9 @@
|
||||
<message name="IDS_SETTINGS_SHIFT_RIGHT_CLICK_CONTEXT_MENU" desc="Label for the checkbox which makes Shift+right click show the browser context menu even when a page blocks it.">
|
||||
Force context menu with Shift+Right Click
|
||||
@@ -265,6 +265,9 @@
|
||||
<message name="IDS_SETTINGS_CYCLE_TABS_IN_MRU_ORDER" desc="Label for the checkbox which enables or disables cycling through tabs in MRU order when using Ctrl+Tab.">
|
||||
Cycle through tabs in most recently used order with Ctrl+Tab
|
||||
</message>
|
||||
+ <message name="IDS_SETTINGS_ROUNDED_FRAME" desc="Label for the toggle which enables or disables a rounded frame around web contents.">
|
||||
+ Show a rounded frame around web contents
|
||||
@@ -36,19 +36,19 @@
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -552,6 +552,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
@@ -551,6 +551,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
{"systemMode", IDS_NTP_CUSTOMIZE_CHROME_COLOR_SCHEME_MODE_SYSTEM_LABEL},
|
||||
{"openNewTabNextToActive", IDS_SETTINGS_NEW_TAB_NEXT_TO_ACTIVE_BUTTON},
|
||||
{"cycleTabsInMRUOrder", IDS_SETTINGS_CYCLE_TABS_IN_MRU_ORDER},
|
||||
+ {"roundedFrame", IDS_SETTINGS_ROUNDED_FRAME},
|
||||
{"shiftRightClickContextMenu",
|
||||
IDS_SETTINGS_SHIFT_RIGHT_CLICK_CONTEXT_MENU},
|
||||
{"showHomeButton", IDS_SETTINGS_SHOW_HOME_BUTTON},
|
||||
{"showBookmarksBar", IDS_SETTINGS_SHOW_BOOKMARKS_BAR},
|
||||
{"bookmarksBar", IDS_SETTINGS_BOOKMARKS_BAR},
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -283,6 +283,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
@@ -281,6 +281,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kShiftRightClickContextMenu] =
|
||||
(*s_allowlist)[::prefs::kTabCyclingMRU] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
+ (*s_allowlist)[::prefs::kHeliumRoundedFrame] =
|
||||
+ settings_api::PrefType::kBoolean;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
void SelectedKeywordView::SetLabelForCurrentWidth() {
|
||||
--- a/components/search_engines/template_url.cc
|
||||
+++ b/components/search_engines/template_url.cc
|
||||
@@ -2464,11 +2464,7 @@ std::u16string TemplateURL::GetFullName(
|
||||
@@ -2461,11 +2461,7 @@ std::u16string TemplateURL::GetFullName(
|
||||
if (is_ask_type()) {
|
||||
return l10n_util::GetStringFUTF16(IDS_OMNIBOX_SELECTED_KEYWORD_ASK_TEXT,
|
||||
short_name);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -7904,6 +7904,9 @@ Keep your key file in a safe place. You
|
||||
@@ -7898,6 +7898,9 @@ Keep your key file in a safe place. You
|
||||
<message name="IDS_NTP_CUSTOMIZE_CHROME_CHANGE_THEME_LABEL" desc="The label for the action button for changing Chrome theme in the New Tab Page customize chrome side panel.">
|
||||
Change theme
|
||||
</message>
|
||||
|
||||
@@ -610,7 +610,7 @@
|
||||
gfx::ImageSkia AlertIndicatorButton::GetImageToPaint() {
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -220,7 +220,7 @@ bool IsTabGroupMenuMoreEntryPointsEnable
|
||||
@@ -202,7 +202,7 @@ bool IsTabGroupMenuMoreEntryPointsEnable
|
||||
return base::FeatureList::IsEnabled(kTabGroupMenuMoreEntryPoints);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/chrome/common/pref_names.h
|
||||
+++ b/chrome/common/pref_names.h
|
||||
@@ -733,6 +733,30 @@ inline constexpr char kCtrlTabMru[] = "b
|
||||
inline constexpr char kHeliumCrashReportingMode[] =
|
||||
"helium.crash_reporting.mode";
|
||||
@@ -722,6 +722,30 @@ inline constexpr char kSplitViewDragAndD
|
||||
// recently used tabs.
|
||||
inline constexpr char kCtrlTabMru[] = "browser.ctrl_tab_mru";
|
||||
|
||||
+// A boolean pref set to true if the Back button should be visible on the
|
||||
+// toolbar.
|
||||
@@ -33,7 +33,7 @@
|
||||
inline constexpr char kGeminiSettings[] = "browser.gemini_settings";
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -144,6 +144,13 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
@@ -142,6 +142,13 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
registry->RegisterBooleanPref(prefs::kPinSplitTabButton, false,
|
||||
pref_registration_flags);
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true);
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -294,6 +294,20 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
@@ -292,6 +292,20 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
(*s_allowlist)[::prefs::kSplitViewDragAndDropEnabled] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
|
||||
@@ -579,7 +579,7 @@
|
||||
// The container (and extensions-menu button) should not be visible if we have
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -10898,6 +10898,9 @@ Keep your key file in a safe place. You
|
||||
@@ -10886,6 +10886,9 @@ Keep your key file in a safe place. You
|
||||
<message name="IDS_ACCNAME_FIND" desc="The accessible name for the find button.">
|
||||
Find
|
||||
</message>
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
--- a/chrome/browser/ui/views/frame/browser_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/browser_view.cc
|
||||
@@ -4603,6 +4603,12 @@ views::CloseRequestResult BrowserView::O
|
||||
|
||||
int BrowserView::NonClientHitTest(const gfx::Point& point) {
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
+ // AppKit can re-enter hit testing while the browser widget is being torn
|
||||
+ // down, either before or after this view has been detached from its widget.
|
||||
+ if (!browser_widget_ || !GetWidget()) {
|
||||
+ return HTNOWHERE;
|
||||
+ }
|
||||
+
|
||||
// The top container while in immersive fullscreen on macOS lives in another
|
||||
// Widget (OverlayWidgetMac). This means that BrowserView does not need to
|
||||
// consult BrowserViewLayout::NonClientHitTest() to calculate the hit test.
|
||||
@@ -4662,6 +4668,18 @@ int BrowserView::NonClientHitTest(const
|
||||
@@ -4662,6 +4662,18 @@ int BrowserView::NonClientHitTest(const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
};
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -13798,6 +13798,9 @@ Check your passwords anytime in <ph name
|
||||
@@ -13786,6 +13786,9 @@ Check your passwords anytime in <ph name
|
||||
<message name="IDS_EXTENSIONS_INSTALL_LOCATION_SHARED_MODULE" desc="The text explaining the the installation of the extension was because of extensions that depend on this shared module">
|
||||
Installed because of dependent extension(s).
|
||||
</message>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
--- a/BUILD.gn
|
||||
+++ b/BUILD.gn
|
||||
@@ -462,14 +462,6 @@ group("gn_all") {
|
||||
@@ -457,14 +457,6 @@ group("gn_all") {
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
+3
-13
@@ -7,6 +7,7 @@ inox-patchset/disable-rlz.patch
|
||||
|
||||
iridium-browser/safe-browsing-disable-reporting.patch
|
||||
|
||||
ungoogled-chromium/disable-crash-reporter.patch
|
||||
ungoogled-chromium/disable-google-host-detection.patch
|
||||
ungoogled-chromium/toggle-translation-via-switch.patch
|
||||
ungoogled-chromium/disable-untraceable-urls.patch
|
||||
@@ -105,6 +106,7 @@ helium/core/disable-unsupported-importers.patch
|
||||
helium/core/fix-building-without-safebrowsing.patch
|
||||
helium/core/services-prefs.patch
|
||||
helium/core/services-schema-nag.patch
|
||||
helium/core/connectivity-check.patch
|
||||
helium/core/override-chrome-protocol.patch
|
||||
helium/core/onboarding-page.patch
|
||||
helium/core/change-chromium-branding.patch
|
||||
@@ -194,12 +196,6 @@ helium/core/simplify-context-menu.patch
|
||||
helium/core/disable-pdf-infobar.patch
|
||||
helium/core/enable-screenshots.patch
|
||||
helium/core/enable-glow-up-features.patch
|
||||
helium/core/enable-bookmark-bar-settings.patch
|
||||
helium/core/force-paste-action.patch
|
||||
helium/core/shift-right-click-context-menu.patch
|
||||
|
||||
helium/core/crash-reporter-privacy-tweaks.patch
|
||||
helium/core/crash-reporting-prefs.patch
|
||||
|
||||
helium/settings/settings-page-icons.patch
|
||||
helium/settings/move-search-suggest.patch
|
||||
@@ -223,8 +219,6 @@ helium/settings/add-search-engine-button.patch
|
||||
helium/settings/custom-profile-avatar-ui.patch
|
||||
helium/settings/custom-keyboard-shortcuts-page.patch
|
||||
helium/settings/clear-browsing-data-popup.patch
|
||||
helium/settings/crash-reporting-settings.patch
|
||||
helium/settings/helium-noise-settings.patch
|
||||
|
||||
helium/hop/setup.patch
|
||||
helium/hop/disable-password-manager.patch
|
||||
@@ -293,9 +287,8 @@ helium/ui/licenses-in-credits.patch
|
||||
helium/ui/remove-autofill-link-to-password-manager.patch
|
||||
helium/ui/fix-caption-button-bounds.patch
|
||||
helium/ui/find-bar.patch
|
||||
helium/ui/remove-zoom-action.patch
|
||||
helium/ui/custom-keyboard-shortcuts-wiring.patch
|
||||
helium/ui/crash-dialog.patch
|
||||
helium/ui/crashes-webui-fixes.patch
|
||||
|
||||
helium/ui/layout/migrate-prefs.patch
|
||||
helium/ui/layout/core.patch
|
||||
@@ -321,6 +314,3 @@ helium/ui/hide-pip-live-caption-button.patch
|
||||
helium/ui/disable-ink-ripple-effect.patch
|
||||
helium/ui/dont-antialias-rects.patch
|
||||
helium/ui/fix-windows-ui-position.patch
|
||||
helium/ui/native-frame-materials.patch
|
||||
helium/ui/page-zoom-indicator.patch
|
||||
helium/ui/helium-noise-page-info.patch
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "base/feature_list.h"
|
||||
#include "base/types/to_address.h"
|
||||
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
|
||||
@@ -214,6 +215,10 @@ void BookmarkBarController::OnSplitTabCh
|
||||
@@ -208,6 +209,10 @@ void BookmarkBarController::OnSplitTabCh
|
||||
}
|
||||
|
||||
bool BookmarkBarController::ShouldShowBookmarkBar() const {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "extensions/buildflags/buildflags.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "net/base/filename_util.h"
|
||||
@@ -1176,10 +1177,12 @@ DownloadConfirmationReason DownloadTarge
|
||||
@@ -1170,10 +1171,12 @@ DownloadConfirmationReason DownloadTarge
|
||||
return DownloadConfirmationReason::SAVE_AS;
|
||||
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -4708,10 +4708,12 @@ const FeatureEntry::FeatureVariation kTo
|
||||
@@ -4698,10 +4698,12 @@ const FeatureEntry::FeatureVariation kCa
|
||||
#include "chrome/browser/ungoogled_flag_choices.h"
|
||||
#include "chrome/browser/bromite_flag_choices.h"
|
||||
#include "chrome/browser/ungoogled_platform_flag_choices.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -4704,7 +4704,13 @@ const FeatureEntry::FeatureVariation kTo
|
||||
@@ -4694,7 +4694,13 @@ const FeatureEntry::FeatureVariation kCa
|
||||
// calculate and verify checksum.
|
||||
//
|
||||
// When adding a new choice, add it to the end of the list.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user