Compare commits

..

1 Commits

Author SHA1 Message Date
jj 2450f37f62 helium/core: add connectivity/captive portal check
fixes #1104
2026-07-02 17:23:49 +00:00
102 changed files with 803 additions and 4503 deletions
+1 -1
View File
@@ -1 +1 @@
150.0.7871.124
150.0.7871.46
+4 -4
View File
@@ -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
+2 -4
View File
@@ -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()
+1 -1
View File
@@ -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
-23
View File
@@ -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:
-114
View File
@@ -575,24 +575,6 @@
"context": "In Title Case: The name of the Search with Engine command in the content area context menu",
"message": "&amp;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,36 +738,6 @@
"context": "macOS-only link on the browser shortcuts Settings page that opens the system keyboard shortcuts settings.",
"message": "System Settings &gt; Keyboard &gt; Keyboard Shortcuts &gt; 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_POLICY_SOURCE_HOP",
"source": "components/policy_strings.grdp",
@@ -834,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",
@@ -1056,24 +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_CONTENT_CONTEXT_SYSTEM_TRANSLATE",
"source": "chrome/app/generated_resources.grd",
+2 -2
View File
@@ -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",
+2 -2
View File
@@ -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",
+1 -1
View File
@@ -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>
+1 -1
View File
@@ -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
+7 -7
View File
@@ -679,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(),
@@ -701,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);
}
@@ -715,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));
+2 -2
View File
@@ -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>
+10 -16
View File
@@ -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,379 +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,8 @@ CrashReporterClient* g_client = nullptr;
const char kDefaultUploadURL[] = "https://clients2.google.com/cr/report";
#endif
+constexpr char kCrashServerUrlCommandLine[] = "custom-crash-server-url";
+
} // namespace
ProductInfo::ProductInfo() = default;
@@ -146,8 +149,13 @@ void CrashReporterClient::GetSanitizatio
#endif
std::string CrashReporterClient::GetUploadUrl() {
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && defined(OFFICIAL_BUILD)
- return kDefaultUploadURL;
+ const auto* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(kCrashServerUrlCommandLine)) {
+ return command_line->GetSwitchValueASCII(kCrashServerUrlCommandLine);
+ }
+
+#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) {}
+
+void SetUploadConsentFromUser(bool consent) {
+ ApplyUploadConsent(consent);
}
+bool UploadsDisabledByPolicy() {
+ bool policy_enabled = true;
+ return GetCrashReporterClient()->ReportingIsEnforcedByPolicy(
+ &policy_enabled) &&
+ !policy_enabled;
+}
#endif // !BUILDFLAG(IS_CHROMEOS)
#if !BUILDFLAG(IS_ANDROID)
--- a/components/crash/core/app/crashpad.h
+++ b/components/crash/core/app/crashpad.h
@@ -139,6 +139,14 @@ 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);
+
+// Returns true only when policy explicitly disables crash reporting. A policy
+// that enables reporting does not constitute user consent.
+bool UploadsDisabledByPolicy();
+
#endif // !BUILDFLAG(IS_CHROMEOS)
enum class ReportUploadState {
--- 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,153 @@
+// 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"
+#include "third_party/crashpad/crashpad/client/crash_report_database.h"
+
+namespace helium {
+
+namespace {
+
+void DeletePendingReports(bool include_explicitly_requested) {
+ crashpad::CrashReportDatabase* database =
+ crash_reporter::internal::GetCrashReportDatabase();
+ std::vector<crashpad::CrashReportDatabase::Report> reports;
+ if (!database ||
+ database->GetPendingReports(&reports) !=
+ crashpad::CrashReportDatabase::kNoError) {
+ return;
+ }
+
+ for (const auto& report : reports) {
+ if (!include_explicitly_requested && report.upload_explicitly_requested) {
+ continue;
+ }
+
+ crashpad::CrashReportDatabase::OperationStatus skip_status =
+ crashpad::CrashReportDatabase::kNoError;
+ if (report.upload_explicitly_requested) {
+ // Explicit requests bypass the global upload toggle. Clear that state
+ // before deletion so a deletion failure cannot leave the report
+ // uploadable while policy forbids reporting.
+ skip_status = database->SkipReportUpload(
+ report.uuid,
+ crashpad::Metrics::CrashSkippedReason::kUploadsDisabled);
+ }
+
+ const auto delete_status = database->DeleteReport(report.uuid);
+ if (delete_status != crashpad::CrashReportDatabase::kNoError &&
+ delete_status != crashpad::CrashReportDatabase::kReportNotFound) {
+ LOG(ERROR) << "Failed to delete crash report: " << report.uuid.ToString()
+ << " (delete status " << static_cast<int>(delete_status)
+ << ", skip status " << static_cast<int>(skip_status) << ")";
+ }
+ }
+}
+
+} // 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);
+}
+
+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 (crash_reporter::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 =
+ crash_reporter::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,35 @@
+// 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();
+
+// 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_
@@ -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 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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">
&amp;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)">
&amp;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">
&amp;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)">
&amp;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>
+3 -3
View File
@@ -980,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
}
}
@@ -1075,7 +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
@@ -12801,6 +12801,22 @@ void RenderFrameHostImpl::CommitNavigati
@@ -12794,6 +12794,22 @@ void RenderFrameHostImpl::CommitNavigati
}
}
@@ -1098,7 +1098,7 @@
bool is_srcdoc = common_params->url.IsAboutSrcdoc();
if (is_srcdoc) {
// TODO(wjmaclean): initialize this in NavigationRequest's constructor
@@ -16409,6 +16425,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));
+5 -3
View File
@@ -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
},
+19 -6
View File
@@ -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
@@ -4734,6 +4734,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,348 +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,84 @@
+// 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/crash/core/app/crashpad.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 = crash_reporter::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
+1 -1
View File
@@ -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,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>
-294
View File
@@ -1,294 +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,187 @@
+// 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/browser_process.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/common/pref_names.h"
+#include "chrome/grit/generated_resources.h"
+#include "components/crash/core/app/crashpad.h"
+#include "components/prefs/pref_service.h"
+#include "components/strings/grit/components_strings.h"
+#include "third_party/crashpad/crashpad/client/crash_report_database.h"
+#include "third_party/crashpad/crashpad/util/misc/uuid.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<crashpad::UUID>& ReservedReportIds() {
+ static base::NoDestructor<std::set<crashpad::UUID>> reports;
+ return *reports;
+}
+
+crashpad::CrashReportDatabase* GetDatabase() {
+ return crash_reporter::internal::GetCrashReportDatabase();
+}
+
+class HeliumCrashDialogDelegate : public ui::DialogModelDelegate {
+ public:
+ explicit HeliumCrashDialogDelegate(std::vector<crashpad::UUID> 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 && !crash_reporter::UploadsDisabledByPolicy();
+ crashpad::CrashReportDatabase* database = GetDatabase();
+ for (const crashpad::UUID& report_id : report_ids_) {
+ ReservedReportIds().erase(report_id);
+ if (!database) {
+ continue;
+ }
+ if (can_upload) {
+ database->RequestUpload(report_id);
+ } else {
+ database->DeleteReport(report_id);
+ }
+ }
+ }
+
+ const std::vector<crashpad::UUID> 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<crashpad::UUID> 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;
+ }
+
+ PrefService* local_state = g_browser_process->local_state();
+ if (!local_state) {
+ return;
+ }
+
+ if (crash_reporter::UploadsDisabledByPolicy() ||
+ helium::GetCrashReportingMode() != helium::CrashReportingMode::kAsk) {
+ return;
+ }
+
+ crashpad::CrashReportDatabase* database = GetDatabase();
+ std::vector<crashpad::CrashReportDatabase::Report> reports;
+ if (!database ||
+ database->GetPendingReports(&reports) !=
+ crashpad::CrashReportDatabase::kNoError) {
+ return;
+ }
+ std::vector<crashpad::UUID> report_ids;
+ for (const auto& report : reports) {
+ if (report.upload_explicitly_requested ||
+ !ReservedReportIds().insert(report.uuid).second) {
+ continue;
+ }
+ report_ids.push_back(report.uuid);
+ }
+ 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,8 @@ void AddInfoBarsIfNecessary(BrowserWindo
return;
}
+ 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.
-191
View File
@@ -1,191 +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"
@@ -52,6 +55,10 @@ using content::WebUIMessageHandler;
namespace {
+bool CrashUploadsDisabledByPolicy() {
+ return crash_reporter::UploadsDisabledByPolicy();
+}
+
void CreateAndAddCrashesUIHTMLSource(Profile* profile) {
content::WebUIDataSource* source = content::WebUIDataSource::CreateAndAdd(
profile, chrome::kChromeUICrashesHost);
@@ -178,8 +185,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 &&
+ !CrashUploadsDisabledByPolicy();
bool system_crash_reporter = false;
#if BUILDFLAG(IS_CHROMEOS)
@@ -203,23 +213,22 @@ void CrashesDOMHandler::UpdateUI() {
#endif
bool allow_manual_uploads =
manual_uploads_supported &&
- (crash_reporting_enabled || !metrics::IsMetricsReportingPolicyManaged());
+ crash_reporting_mode != helium::CrashReportingMode::kDisabled &&
+ !CrashUploadsDisabledByPolicy();
// 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 +237,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 ||
+ CrashUploadsDisabledByPolicy()) {
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() {
}
}
+173 -63
View File
@@ -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;
+2 -2
View File
@@ -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",
+6 -6
View File
@@ -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>
@@ -211,8 +211,8 @@
{"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();
}
+2 -2
View File
@@ -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() {
}
}
+4 -4
View File
@@ -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 {
+3 -3
View File
@@ -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;
+3 -3
View File
@@ -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>
@@ -260,9 +260,9 @@
{"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>
+6 -6
View File
@@ -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>
@@ -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>
+9 -9
View File
@@ -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
@@ -4748,6 +4748,16 @@
@@ -4730,6 +4730,16 @@
Enable quick page link copying with Ctrl+Shift+C
</message>
</if>
@@ -190,12 +190,12 @@
{"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
@@ -675,6 +675,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;
+6 -7
View File
@@ -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>
@@ -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>
+92 -157
View File
@@ -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
-460
View File
@@ -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
@@ -570,6 +570,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 {
+12 -12
View File
@@ -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
@@ -41,14 +41,14 @@
{"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>
+1 -1
View File
@@ -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);
}
+6 -6
View File
@@ -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, after this view has been detached from its widget.
+ if (!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>
+1 -1
View File
@@ -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 -11
View File
@@ -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,7 +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/hop/setup.patch
helium/hop/disable-password-manager.patch
@@ -292,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
@@ -320,5 +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
@@ -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.
@@ -60,7 +60,7 @@
return GURL(parts.scheme.is_valid() ? text : FixupPath(text));
--- a/content/browser/child_process_security_policy_impl.cc
+++ b/content/browser/child_process_security_policy_impl.cc
@@ -1119,6 +1119,7 @@ void ChildProcessSecurityPolicyImpl::Reg
@@ -1118,6 +1118,7 @@ void ChildProcessSecurityPolicyImpl::Reg
RegisterWebSafeScheme(url::kWssScheme);
#endif // BUILDFLAG(ENABLE_WEBSOCKETS)
RegisterWebSafeScheme(url::kDataScheme);
+12 -2
View File
@@ -136,6 +136,16 @@
return nullptr;
}
--- a/chrome/browser/actor/ui/actor_ui_tab_controller.cc
+++ b/chrome/browser/actor/ui/actor_ui_tab_controller.cc
@@ -50,7 +50,6 @@ ActorUiTabController::ActorUiTabControll
scoped_unowned_user_data_(tab.GetUnownedUserDataHost(), *this) {
CHECK(base::FeatureList::IsEnabled(features::kGlicActorUi));
CHECK(base::FeatureList::IsEnabled(features::kGlicActor));
- CHECK(actor_keyed_service_);
}
ActorUiTabController::~ActorUiTabController() = default;
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -260,12 +260,10 @@ void OnLocalStatePrefsLoaded();
@@ -815,7 +825,7 @@
"//chrome/common",
--- a/chrome/browser/ui/pdf/chrome_pdf_document_helper_client.cc
+++ b/chrome/browser/ui/pdf/chrome_pdf_document_helper_client.cc
@@ -152,22 +152,3 @@ void ChromePDFDocumentHelperClient::SetP
@@ -146,22 +146,3 @@ void ChromePDFDocumentHelperClient::SetP
}
}
@@ -901,7 +911,7 @@
std::make_unique<indigo::IndigoPageActionController>(
--- a/chrome/browser/ui/views/user_education/browser_user_education_service.cc
+++ b/chrome/browser/ui/views/user_education/browser_user_education_service.cc
@@ -925,40 +925,6 @@ void MaybeRegisterChromeFeaturePromos(
@@ -908,40 +908,6 @@ void MaybeRegisterChromeFeaturePromos(
"Triggered when the PDF Viewer opens.")));
#endif
@@ -0,0 +1,49 @@
# Disable some background communication with clients2.google.com
--- a/components/crash/core/app/crash_reporter_client.cc
+++ b/components/crash/core/app/crash_reporter_client.cc
@@ -146,7 +146,7 @@ void CrashReporterClient::GetSanitizatio
#endif
std::string CrashReporterClient::GetUploadUrl() {
-#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && defined(OFFICIAL_BUILD)
+#if 0
return kDefaultUploadURL;
#else
return std::string();
--- a/components/crash/core/app/crashpad.cc
+++ b/components/crash/core/app/crashpad.cc
@@ -73,6 +73,13 @@ bool InitializeCrashpadImpl(bool initial
const std::vector<std::string>& initial_arguments,
bool embedded_handler,
const std::vector<base::FilePath>& attachments) {
+// Crashpad is needed on Linux because it's used as a WASM signal handler.
+// This is not the case on other platforms, and so it can remain entirely
+// disabled there.
+#if !BUILDFLAG(IS_LINUX)
+ return false;
+#endif
+
static bool initialized = false;
DCHECK(!initialized);
initialized = true;
--- a/third_party/crashpad/crashpad/handler/handler_main.cc
+++ b/third_party/crashpad/crashpad/handler/handler_main.cc
@@ -875,7 +875,7 @@ int HandlerMain(int argc,
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
// BUILDFLAG(IS_ANDROID)
case kOptionURL: {
- options.url = optarg;
+ options.url = "";
break;
}
#if BUILDFLAG(IS_CHROMEOS)
@@ -1016,7 +1016,7 @@ int HandlerMain(int argc,
}
ScopedStoppable upload_thread;
- if (!options.url.empty()) {
+ if ((false)) {
// TODO(scottmg): options.rate_limit should be removed when we have a
// configurable database setting to control upload limiting.
// See https://crashpad.chromium.org/bug/23.
@@ -2,7 +2,7 @@
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -584,9 +584,6 @@ group("gn_all") {
@@ -579,9 +579,6 @@ group("gn_all") {
deps += [ "//chrome/test:chrome_app_unittests" ]
}
@@ -168,7 +168,7 @@
using ConnectionType = net::NetworkChangeNotifier::ConnectionType;
#if BUILDFLAG(SAFE_BROWSING_DOWNLOAD_PROTECTION)
@@ -2062,7 +2061,6 @@ void ChromeDownloadManagerDelegate::OnDo
@@ -2046,7 +2045,6 @@ void ChromeDownloadManagerDelegate::OnDo
DownloadItemModel model(item);
model.DetermineAndSetShouldPreferOpeningInBrowser(
target_info.target_path, target_info.is_filetype_handled_safely);
@@ -176,7 +176,7 @@
}
if (ShouldBlockFile(item, target_info.danger_type)) {
MaybeReportDangerousDownloadBlocked(
@@ -2143,50 +2141,20 @@ bool ChromeDownloadManagerDelegate::IsOp
@@ -2127,50 +2125,20 @@ bool ChromeDownloadManagerDelegate::IsOp
bool ChromeDownloadManagerDelegate::ShouldBlockFile(
download::DownloadItem* item,
download::DownloadDangerType danger_type) const {
@@ -233,7 +233,7 @@
<< static_cast<int>(download_restriction);
--- a/chrome/browser/download/download_target_determiner.cc
+++ b/chrome/browser/download/download_target_determiner.cc
@@ -1311,14 +1311,7 @@ DownloadFileType::DangerLevel DownloadTa
@@ -1305,14 +1305,7 @@ DownloadFileType::DangerLevel DownloadTa
std::optional<base::Time>
DownloadTargetDeterminer::GetLastDownloadBypassTimestamp() const {
@@ -1110,7 +1110,7 @@
void OnOptinImpression() override {
--- a/chrome/browser/lifetime/smart_restart_policy.cc
+++ b/chrome/browser/lifetime/smart_restart_policy.cc
@@ -13,7 +13,6 @@
@@ -12,7 +12,6 @@
#include "chrome/browser/ui/startup/startup_browser_creator.h"
#include "chrome/common/chrome_features.h"
#include "components/prefs/pref_service.h"
@@ -3541,7 +3541,7 @@
void SSLBlockingPageBase::PopulateEnhancedProtectionMessage(
--- a/components/sync_preferences/common_syncable_prefs_database.cc
+++ b/components/sync_preferences/common_syncable_prefs_database.cc
@@ -425,9 +425,6 @@ constexpr auto kCommonSyncablePrefsAllow
@@ -424,9 +424,6 @@ constexpr auto kCommonSyncablePrefsAllow
{plus_addresses::prefs::kLastPlusAddressFillingTime,
{syncable_prefs_ids::kLastPlusAddressFillingTime, syncer::PREFERENCES,
PrefSensitivity::kNone, MergeBehavior::kNone}},
@@ -3643,7 +3643,7 @@
auto* rules_monitor_service =
declarative_net_request::RulesMonitorService::Get(browser_context());
@@ -249,13 +242,6 @@ DeclarativeNetRequestUpdateSessionRulesF
@@ -248,13 +241,6 @@ DeclarativeNetRequestUpdateSessionRulesF
return RespondNow(NoArguments());
}
@@ -11,29 +11,6 @@
using extensions::api::settings_private::Enforcement;
using extensions::api::settings_private::PrefObject;
--- a/chrome/browser/resources/settings/site_settings/v8_page.ts
+++ b/chrome/browser/resources/settings/site_settings/v8_page.ts
@@ -13,7 +13,6 @@ import {PrefsMixin} from '/shared/settin
import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js';
import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
-import {SafeBrowsingSetting} from '../privacy_page/security/safe_browsing_types.js';
import {SettingsViewMixin} from '../settings_page/settings_view_mixin.js';
import {ContentSettingsTypes, JavascriptOptimizerSetting} from './constants.js';
@@ -56,11 +55,8 @@ export class V8PageElement extends V8Pag
}
private getBlockForUnfamiliarSitesSubLabel_(): string {
- const safeBrowsingSetting = this.getPref('generated.safe_browsing').value;
return this.i18n(
- safeBrowsingSetting === SafeBrowsingSetting.DISABLED
- ? 'siteSettingsJavascriptOptimizerBlockedUnfamiliarSitesSafeBrowsingOffSubLabel'
- : 'siteSettingsJavascriptOptimizerBlockedUnfamiliarSitesSubLabel');
+ 'siteSettingsJavascriptOptimizerBlockedUnfamiliarSitesSubLabel');
}
}
--- a/chrome/browser/site_protection/site_familiarity_utils.cc
+++ b/chrome/browser/site_protection/site_familiarity_utils.cc
@@ -9,6 +9,7 @@
@@ -2,10 +2,11 @@
# when navigating from the onmibox/realbox
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -1414,23 +1414,6 @@ std::string TemplateURLRef::HandleReplac
@@ -1413,26 +1413,6 @@ std::string TemplateURLRef::HandleReplac
// url.insert(replacement.index, used_www ? "gcx=w&" : "gcx=c&");
break;
case GOOGLE_SEARCH_SOURCE: {
- case GOOGLE_SEARCH_SOURCE: {
- DCHECK(!replacement.is_post_param);
- using OEP = ::metrics::OmniboxEventProto;
- std::string source_param;
@@ -23,6 +24,8 @@
- if (!source_param.empty()) {
- HandleReplacement("source", source_param, replacement, &url);
- }
break;
}
- break;
- }
case GOOGLE_SEARCH_SOURCE_ID: {
DCHECK(!replacement.is_post_param);

Some files were not shown because too many files have changed in this diff Show More