mirror of
https://github.com/imputnet/helium.git
synced 2026-08-20 00:57:32 +02:00
Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b563c0d01 | |||
| 824cf71ff3 | |||
| 63be29609d | |||
| d1cdab8975 | |||
| b5c22404c6 | |||
| d6f4210a41 | |||
| a939d1d8b0 | |||
| 76fbefad51 | |||
| 95a1030f70 | |||
| 7375679377 | |||
| 2ee49a1059 | |||
| 1be2432a9a | |||
| 5d96434aa0 | |||
| 56d1a136ab | |||
| 688af14009 | |||
| 1341de3a37 | |||
| 4e6eda294f | |||
| f32b04755e | |||
| 75d044b9a6 | |||
| 0ec967b7d6 | |||
| 5354646288 | |||
| f03eea9638 | |||
| 42e783c0bb | |||
| 4cfbfe2710 | |||
| 7c51e1f0f6 | |||
| b45d47cf07 | |||
| c4482c5655 | |||
| 8930f2ae91 | |||
| 714939df2c | |||
| db5ddc92c1 | |||
| e64526ce10 | |||
| b82e2921d4 | |||
| a16ae4bd88 | |||
| 07018baf2e | |||
| f4937943ca | |||
| d27f87f754 | |||
| a2b3cd02bb | |||
| 20915c82d9 | |||
| 7c45f2fcd6 | |||
| 8cb698e496 | |||
| 009a2e74c7 | |||
| 89699b019b |
+2
-2
@@ -36,7 +36,7 @@ validate_with_source_task:
|
||||
rm -rf chromium_download_cache
|
||||
mkdir chromium_download_cache
|
||||
# Attempt to download tarball
|
||||
./utils/downloads.py retrieve -i extras.ini -c chromium_download_cache &
|
||||
./utils/downloads.py retrieve -i deps.ini -c chromium_download_cache &
|
||||
if ! ./utils/downloads.py retrieve -i downloads.ini -c chromium_download_cache ; then
|
||||
# If tarball is not available, attempt a clone
|
||||
./utils/clone.py -o chromium_src
|
||||
@@ -48,7 +48,7 @@ validate_with_source_task:
|
||||
wait
|
||||
unpack_source_script: |
|
||||
if [ ! -d chromium_src ]; then
|
||||
for file in downloads extras; do
|
||||
for file in downloads deps; do
|
||||
./utils/downloads.py unpack -i $file.ini -c chromium_download_cache chromium_src
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -44,6 +44,7 @@ runs:
|
||||
|
||||
# get versions and compare them after submodule update
|
||||
version_before=$(get_version)
|
||||
export version_before
|
||||
|
||||
pushd "$HELIUM_DIR"
|
||||
git fetch origin main
|
||||
@@ -64,10 +65,11 @@ runs:
|
||||
fi
|
||||
|
||||
version_after=$(get_version)
|
||||
export version_after
|
||||
|
||||
mkdir -p build/{src,download_cache}
|
||||
|
||||
for file in "$HELIUM_DIR/downloads.ini" "$HELIUM_DIR/extras.ini" "$PLATFORM_DIR/downloads.ini"; do
|
||||
for file in "$HELIUM_DIR/downloads.ini" "$HELIUM_DIR/deps.ini" "$PLATFORM_DIR/downloads.ini"; do
|
||||
if ! [ -f "$file" ]; then continue; fi
|
||||
|
||||
run_upstream utils/downloads.py retrieve \
|
||||
@@ -94,6 +96,12 @@ runs:
|
||||
git config user.name "helium-bot"
|
||||
git config user.email "helium-bot@imput.net"
|
||||
git add -u patches helium-chromium revision.txt
|
||||
|
||||
PLATFORM_HOOK="$PLATFORM_DIR/.github/bump-hook.sh"
|
||||
if [ -f "$PLATFORM_HOOK" ]; then
|
||||
"$PLATFORM_HOOK";
|
||||
fi
|
||||
|
||||
if ! git status | tail -1 | grep -q 'nothing to commit'; then
|
||||
git commit -m "$TITLE"
|
||||
git push origin update
|
||||
|
||||
@@ -1 +1 @@
|
||||
143.0.7499.40
|
||||
143.0.7499.169
|
||||
|
||||
@@ -7,10 +7,10 @@ sha256 = 00a87050fa3f941d04d67fb5763991e0b8ea399a88b505ab0e56dd263f06864c
|
||||
output_path = ./third_party/search_engines_data/resources_internal
|
||||
|
||||
[onboarding]
|
||||
version = 202511061712
|
||||
version = 202601021812
|
||||
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 = 5728d2c6806f3f918f7fd0b358935fd4daa34c1117703c564917ede1dac8e199
|
||||
sha256 = c184dd8ece06c032c7202efd1c1da5a64f287f25c938e552fb43b864444ca1c2
|
||||
output_path = ./components/helium_onboarding
|
||||
|
||||
# If you are bumping this, you *NEED* to re-strip the assets.json
|
||||
@@ -101,11 +101,11 @@ def c_all_new_headers_have_correct_guard():
|
||||
for _line in file[0]:
|
||||
line = str(_line)
|
||||
|
||||
if '#ifndef' in line:
|
||||
if expected["ifndef"] in line:
|
||||
assert found["define"] is None
|
||||
assert found["ifndef"] is None
|
||||
found["ifndef"] = line
|
||||
elif '#define' in line:
|
||||
elif expected["define"] in line:
|
||||
assert found["ifndef"] is not None
|
||||
assert found["define"] is None
|
||||
found["define"] = line
|
||||
|
||||
@@ -2155,6 +2155,7 @@ chrome/browser/ui/webui/management/management_ui_handler_unittest.cc
|
||||
chrome/browser/ui/webui/media_router/cast_feedback_ui.cc
|
||||
chrome/browser/ui/webui/nearby_internals/quick_pair/quick_pair_handler.cc
|
||||
chrome/browser/ui/webui/new_tab_footer/new_tab_footer_handler_browsertest.cc
|
||||
chrome/browser/ui/webui/new_tab_page/action_chips/action_chips_generator_unittest.cc
|
||||
chrome/browser/ui/webui/new_tab_page/action_chips/action_chips_handler_unittest.cc
|
||||
chrome/browser/ui/webui/new_tab_page/foo/foo_handler.cc
|
||||
chrome/browser/ui/webui/new_tab_page/new_tab_page_handler_unittest.cc
|
||||
@@ -8252,6 +8253,7 @@ third_party/devtools-frontend/src/front_end/panels/timeline/TimelineTreeView.ts
|
||||
third_party/devtools-frontend/src/front_end/panels/timeline/TimelineUIUtils.test.ts
|
||||
third_party/devtools-frontend/src/front_end/panels/timeline/TimingsTrackAppender.ts
|
||||
third_party/devtools-frontend/src/front_end/panels/timeline/components/DetailsView.ts
|
||||
third_party/devtools-frontend/src/front_end/panels/timeline/components/ExportTraceOptions.ts
|
||||
third_party/devtools-frontend/src/front_end/panels/timeline/components/FieldSettingsDialog.ts
|
||||
third_party/devtools-frontend/src/front_end/panels/timeline/components/LiveMetricsView.ts
|
||||
third_party/devtools-frontend/src/front_end/panels/timeline/components/SidebarInsightsTab.test.ts
|
||||
|
||||
@@ -267,14 +267,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// Supervised Users. This setting is queried in our Tast tests (b/241943380).
|
||||
--- a/chrome/browser/ui/webui/settings/settings_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_ui.cc
|
||||
@@ -63,6 +63,7 @@
|
||||
#include "chrome/browser/ui/webui/settings/font_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/hats_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/import_data_handler.h"
|
||||
@@ -58,6 +58,7 @@
|
||||
#include "chrome/browser/ui/webui/settings/about_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/accessibility_main_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/appearance_handler.h"
|
||||
+#include "chrome/browser/ui/webui/settings/brave_import_data_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/metrics_reporting_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/on_startup_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/password_manager_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/browser_lifetime_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/downloads_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/font_handler.h"
|
||||
@@ -203,6 +204,7 @@ void SettingsUI::RegisterProfilePrefs(
|
||||
registry->RegisterBooleanPref(prefs::kImportDialogHistory, true);
|
||||
registry->RegisterBooleanPref(prefs::kImportDialogSavedPasswords, true);
|
||||
|
||||
@@ -700,7 +700,7 @@
|
||||
// Sanity check for https://crbug.com/781703.
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -66,6 +66,11 @@ bool ShouldAccessExtensionService(const
|
||||
@@ -67,6 +67,11 @@ bool ShouldAccessExtensionService(const
|
||||
prefs.GetBoolean(prefs::kHeliumExtProxyEnabled);
|
||||
}
|
||||
|
||||
@@ -714,9 +714,9 @@
|
||||
return GetDummyURL();
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -18,6 +18,7 @@ const char kHeliumDefaultOrigin[] =
|
||||
const char kHeliumDummyOrigin[] =
|
||||
"https://helium-services-are-disabled.qjz9zk";
|
||||
@@ -20,6 +20,7 @@ const char kHeliumDummyOrigin[] =
|
||||
|
||||
bool ShouldAccessServices(const PrefService& prefs);
|
||||
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
@@ -724,19 +724,19 @@
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -2125,6 +2125,9 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
{"heliumServicesToggle", IDS_SETTINGS_HELIUM_SERVICES_TOGGLE},
|
||||
{"heliumServicesToggleDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_TOGGLE_DESCRIPTION},
|
||||
@@ -2134,6 +2134,9 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE},
|
||||
{"heliumExtProxyToggleDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE_DESCRIPTION},
|
||||
+ {"heliumBangsToggle", IDS_SETTINGS_HELIUM_SERVICES_BANGS_TOGGLE},
|
||||
+ {"heliumBangsToggleDescription",
|
||||
+ IDS_SETTINGS_HELIUM_SERVICES_BANGS_TOGGLE_DESCRIPTION},
|
||||
{"heliumExtProxyToggle",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE},
|
||||
{"heliumExtProxyToggleDescription",
|
||||
{"heliumOriginOverride", IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE},
|
||||
{"heliumOriginOverrideDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_DESCRIPTION},
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -1981,6 +1981,12 @@
|
||||
@@ -1990,6 +1990,12 @@
|
||||
<message name="IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE_DESCRIPTION" desc="Description of the toggle for enabling/disabling of downloading and proxying extensions">
|
||||
When enabled, Helium will proxy extension downloads and updates to protect your privacy. When disabled, downloading and updating extensions will not work.
|
||||
</message>
|
||||
@@ -751,7 +751,7 @@
|
||||
</message>
|
||||
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
@@ -50,6 +50,11 @@
|
||||
@@ -92,6 +92,11 @@
|
||||
label="$i18n{heliumExtProxyToggle}"
|
||||
sub-label="$i18n{heliumExtProxyToggleDescription}">
|
||||
</settings-toggle-button>
|
||||
@@ -765,9 +765,9 @@
|
||||
</template>
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -211,6 +211,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
|
||||
{
|
||||
@@ -213,6 +213,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
registry->RegisterIntegerPref(prefs::kHeliumSchemaVersion, 0);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumDisableSchemaAlerts, false);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumServicesEnabled, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumBangsEnabled, true);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumExtProxyEnabled, true);
|
||||
@@ -786,7 +786,7 @@
|
||||
(*s_allowlist)[::prefs::kHeliumServicesConsented] =
|
||||
--- a/components/helium_services/pref_names.h
|
||||
+++ b/components/helium_services/pref_names.h
|
||||
@@ -24,6 +24,9 @@ inline constexpr char kHeliumDidOnboardi
|
||||
@@ -30,6 +30,9 @@ inline constexpr char kHeliumDidOnboardi
|
||||
inline constexpr char kHeliumExtProxyEnabled[] =
|
||||
"helium.services.ext_proxy";
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
TODO: guard services_page.html with is_mac
|
||||
|
||||
--- a/components/helium_services/pref_names.h
|
||||
+++ b/components/helium_services/pref_names.h
|
||||
@@ -27,6 +27,9 @@ inline constexpr char kHeliumExtProxyEna
|
||||
@@ -33,6 +33,9 @@ inline constexpr char kHeliumExtProxyEna
|
||||
inline constexpr char kHeliumBangsEnabled[] =
|
||||
"helium.services.bangs";
|
||||
|
||||
@@ -14,7 +12,7 @@ TODO: guard services_page.html with is_mac
|
||||
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -20,11 +20,13 @@ const char kHeliumDummyOrigin[] =
|
||||
@@ -22,11 +22,13 @@ bool ShouldAccessServices(const PrefServ
|
||||
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
@@ -30,15 +28,7 @@ TODO: guard services_page.html with is_mac
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <optional>
|
||||
|
||||
#include "base/functional/bind.h"
|
||||
+#include "base/strings/stringprintf.h"
|
||||
#include "components/helium_services/pref_names.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "net/base/url_util.h"
|
||||
@@ -15,6 +16,12 @@
|
||||
@@ -16,6 +16,12 @@
|
||||
|
||||
namespace helium {
|
||||
|
||||
@@ -51,7 +41,7 @@ TODO: guard services_page.html with is_mac
|
||||
std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_) {
|
||||
if (user_url_.empty()) {
|
||||
return std::nullopt;
|
||||
@@ -76,6 +83,11 @@ bool ShouldFetchBangs(const PrefService&
|
||||
@@ -77,6 +83,11 @@ bool ShouldFetchBangs(const PrefService&
|
||||
prefs.GetBoolean(prefs::kHeliumBangsEnabled);
|
||||
}
|
||||
|
||||
@@ -63,7 +53,7 @@ TODO: guard services_page.html with is_mac
|
||||
GURL GetExtensionUpdateURL(const PrefService& prefs) {
|
||||
if (!ShouldAccessExtensionService(prefs)) {
|
||||
return GetDummyURL();
|
||||
@@ -101,6 +113,20 @@ GURL GetSpellcheckURL(const PrefService&
|
||||
@@ -102,6 +113,20 @@ GURL GetSpellcheckURL(const PrefService&
|
||||
return GetServicesBaseURL(prefs).Resolve("/dict/");
|
||||
}
|
||||
|
||||
@@ -86,26 +76,24 @@ TODO: guard services_page.html with is_mac
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
@@ -62,6 +62,13 @@
|
||||
@@ -104,6 +104,11 @@
|
||||
sub-label="$i18n{heliumSpellcheckToggleDescription}">
|
||||
</settings-toggle-button>
|
||||
</if>
|
||||
+ <if expr="is_macosx">
|
||||
+ <settings-toggle-button id="updatesToggleButton"
|
||||
+ pref="{{prefs.helium.services.browser_updates}}"
|
||||
+ label="$i18n{heliumUpdatesToggle}"
|
||||
+ sub-label="$i18n{heliumUpdatesToggleDescription}">
|
||||
+ </settings-toggle-button>
|
||||
+ </if>
|
||||
+ <settings-toggle-button id="updatesToggleButton"
|
||||
+ pref="{{prefs.helium.services.browser_updates}}"
|
||||
+ label="$i18n{heliumUpdatesToggle}"
|
||||
+ sub-label="$i18n{heliumUpdatesToggleDescription}">
|
||||
+ </settings-toggle-button>
|
||||
</cr-collapse>
|
||||
</div>
|
||||
</template>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -2135,6 +2135,10 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE},
|
||||
{"heliumExtProxyToggleDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE_DESCRIPTION},
|
||||
@@ -2140,6 +2140,10 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
{"heliumSpellcheckToggle", IDS_SETTINGS_HELIUM_SERVICES_SPELLCHECK_TOGGLE},
|
||||
{"heliumSpellcheckToggleDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_SPELLCHECK_TOGGLE_DESCRIPTION},
|
||||
+ {"heliumUpdatesToggle",
|
||||
+ IDS_SETTINGS_HELIUM_SERVICES_UPDATE},
|
||||
+ {"heliumUpdatesToggleDescription",
|
||||
@@ -126,7 +114,7 @@ TODO: guard services_page.html with is_mac
|
||||
(*s_allowlist)[::prefs::kHeliumServicesConsented] =
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -217,6 +217,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
@@ -219,6 +219,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
registry->RegisterStringPref(prefs::kHeliumServicesOrigin, "");
|
||||
registry->RegisterBooleanPref(prefs::kHeliumDidOnboarding, false);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumServicesConsented, false);
|
||||
@@ -136,16 +124,23 @@ TODO: guard services_page.html with is_mac
|
||||
registry->RegisterBooleanPref(
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -1996,6 +1996,12 @@
|
||||
@@ -2005,6 +2005,19 @@
|
||||
<message name="IDS_SETTINGS_HELIUM_SERVICES_SPELLCHECK_TOGGLE_DESCRIPTION" desc="Description of the for enabling/disabling of downloading spellcheck files">
|
||||
Helium will fetch dictionary files used for spell checking when requested. When disabled, spell checking will not work.
|
||||
</message>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_UPDATE" desc="Toggle for automatic update downloads">
|
||||
+ Allow automatic browser updates
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_UPDATE_DESCRIPTION" desc="Description of the toggle for automatic update downloads">
|
||||
+ Helium will automatically download and install browser updates as they become available. We recommend keeping this setting enabled to ensure you get the latest security patches and features.
|
||||
+ Allow automatic browser and component updates
|
||||
+ </message>
|
||||
+ <if expr="is_macosx">
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_UPDATE_DESCRIPTION" desc="Description of the toggle for automatic update downloads">
|
||||
+ Helium will automatically download and install browser and component updates as they become available. We recommend keeping this setting enabled to ensure you get the latest features and security updates.
|
||||
+ </message>
|
||||
+ </if>
|
||||
+ <if expr="not is_macosx">
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_UPDATE_DESCRIPTION" desc="Description of the toggle for automatic update downloads">
|
||||
+ Helium will automatically download and install browser and component updates as they become available. We recommend keeping this setting enabled to ensure you get the latest features and security updates. Automatic core browser updates are not available on this platform yet, but component updates are. Please use external software to keep Helium up to date.
|
||||
+ </message>
|
||||
+ </if>
|
||||
<message name="IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE" desc="Text input for overriding the Helium services server">
|
||||
Use your own instance of Helium services
|
||||
</message>
|
||||
|
||||
@@ -0,0 +1,220 @@
|
||||
--- a/components/component_updater/component_updater_url_constants.cc
|
||||
+++ b/components/component_updater/component_updater_url_constants.cc
|
||||
@@ -15,9 +15,9 @@ namespace component_updater {
|
||||
// The value of |kDefaultUrlSource| can be overridden with
|
||||
// --component-updater=url-source=someurl.
|
||||
const char kUpdaterJSONDefaultUrl[] =
|
||||
- "https://update.googleapis.com/service/update2/json";
|
||||
+ "trk:345:https://update.googleapis.com/service/update2/json";
|
||||
|
||||
const char kUpdaterJSONFallbackUrl[] =
|
||||
- "http://update.googleapis.com/service/update2/json";
|
||||
+ "trk:346:http://update.googleapis.com/service/update2/json";
|
||||
|
||||
} // namespace component_updater
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "components/helium_services/pref_names.h"
|
||||
+#include "components/helium_services/schema.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "net/base/url_util.h"
|
||||
#include "url/gurl.h"
|
||||
@@ -88,6 +89,12 @@ bool ShouldAccessUpdateService(const Pre
|
||||
prefs.GetBoolean(prefs::kHeliumUpdateFetchingEnabled);
|
||||
}
|
||||
|
||||
+bool ShouldAccessComponentUpdateService(const PrefService& prefs) {
|
||||
+ return ShouldAccessServices(prefs) &&
|
||||
+ HasAcceptedSchema(prefs, 1) &&
|
||||
+ prefs.GetBoolean(prefs::kHeliumUpdateFetchingEnabled);
|
||||
+}
|
||||
+
|
||||
bool ShouldAccessUBlockAssets(const PrefService& prefs) {
|
||||
return ShouldAccessServices(prefs) &&
|
||||
prefs.GetBoolean(prefs::kHeliumUBlockAssetsEnabled);
|
||||
@@ -132,6 +139,14 @@ GURL GetBrowserUpdateURL(const PrefServi
|
||||
#endif
|
||||
}
|
||||
|
||||
+GURL GetComponentUpdateURL(const PrefService* prefs) {
|
||||
+ if (!prefs || !ShouldAccessComponentUpdateService(*prefs)) {
|
||||
+ return GetDummyURL();
|
||||
+ }
|
||||
+
|
||||
+ return GetServicesBaseURL(*prefs).Resolve("/com");
|
||||
+}
|
||||
+
|
||||
GURL GetUBlockAssetsURL(const PrefService& prefs) {
|
||||
if (!ShouldAccessUBlockAssets(prefs)) {
|
||||
return GetDummyURL();
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -23,6 +23,7 @@ bool ShouldAccessServices(const PrefServ
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessUpdateService(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessComponentUpdateService(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessUBlockAssets(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
@@ -30,6 +31,7 @@ COMPONENT_EXPORT(HELIUM) GURL GetExtensi
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetSpellcheckURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetBrowserUpdateURL(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetComponentUpdateURL(const PrefService* prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetUBlockAssetsURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
--- a/chrome/browser/component_updater/chrome_component_updater_configurator.cc
|
||||
+++ b/chrome/browser/component_updater/chrome_component_updater_configurator.cc
|
||||
@@ -26,11 +26,14 @@
|
||||
#include "chrome/browser/component_updater/component_updater_utils.h"
|
||||
#include "chrome/browser/component_updater/updater_state.h"
|
||||
#include "chrome/browser/net/system_network_context_manager.h"
|
||||
+#include "chrome/browser/profiles/profile.h"
|
||||
+#include "chrome/browser/profiles/profile_manager.h"
|
||||
#include "chrome/browser/update_client/chrome_update_query_params_delegate.h"
|
||||
#include "chrome/common/channel_info.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#include "components/component_updater/component_updater_command_line_config_policy.h"
|
||||
#include "components/component_updater/configurator_impl.h"
|
||||
+#include "components/helium_services/helium_services_helpers.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "components/services/patch/content/patch_service.h"
|
||||
#include "components/services/unzip/content/unzip_service.h"
|
||||
@@ -55,6 +58,26 @@
|
||||
namespace component_updater {
|
||||
namespace {
|
||||
|
||||
+PrefService* GetProfilePrefs() {
|
||||
+ // Browser process and profile manager are usually
|
||||
+ // not null, but they may be during tests.
|
||||
+ if (!g_browser_process) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ ProfileManager* pm = g_browser_process->profile_manager();
|
||||
+ if (!pm) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ Profile* profile = pm->GetLastUsedProfileIfLoaded();
|
||||
+ if (!profile) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ return profile->GetPrefs();
|
||||
+}
|
||||
+
|
||||
class ChromeConfigurator : public update_client::Configurator {
|
||||
public:
|
||||
ChromeConfigurator(const base::CommandLine* cmdline,
|
||||
@@ -154,12 +177,12 @@ base::TimeDelta ChromeConfigurator::Upda
|
||||
|
||||
std::vector<GURL> ChromeConfigurator::UpdateUrl() const {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
- return configurator_impl_.UpdateUrl();
|
||||
+ return {helium::GetComponentUpdateURL(GetProfilePrefs())};
|
||||
}
|
||||
|
||||
std::vector<GURL> ChromeConfigurator::PingUrl() const {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
- return configurator_impl_.PingUrl();
|
||||
+ return {helium::GetComponentUpdateURL(GetProfilePrefs())};
|
||||
}
|
||||
|
||||
std::string ChromeConfigurator::GetProdId() const {
|
||||
--- a/components/component_updater/component_installer.cc
|
||||
+++ b/components/component_updater/component_installer.cc
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
+#include "base/containers/fixed_flat_set.h"
|
||||
#include "base/files/file_enumerator.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
@@ -111,7 +112,21 @@ void ComponentInstaller::Register(Compon
|
||||
|
||||
std::vector<uint8_t> public_key_hash;
|
||||
installer_policy_->GetHash(&public_key_hash);
|
||||
+
|
||||
+ static constexpr auto kAllowedComponents =
|
||||
+ base::MakeFixedFlatSet<std::string_view>(
|
||||
+ base::sorted_unique,
|
||||
+ {
|
||||
+ "hfnkpimlhhgieaddgfemjhofmfblmnib", // CRLSet
|
||||
+ }
|
||||
+ );
|
||||
+
|
||||
const auto crx_id = update_client::GetCrxIdFromPublicKeyHash(public_key_hash);
|
||||
+
|
||||
+ if (!kAllowedComponents.contains(crx_id)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
Register(base::BindOnce(&ComponentUpdateService::RegisterComponent,
|
||||
base::Unretained(cus)),
|
||||
std::move(callback), cus->GetRegisteredVersion(crx_id),
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -6957,6 +6957,9 @@ Keep your key file in a safe place. You
|
||||
<message name="IDS_COMPONENTS_SVC_STATUS_UPDATE_ERROR" desc="Service Status">
|
||||
Update error
|
||||
</message>
|
||||
+ <message name="IDS_COMPONENTS_SVC_STATUS_ERROR_HELIUM_SERVICES" desc="Service Status">
|
||||
+ Component updates are disabled. See Helium services in settings.
|
||||
+ </message>
|
||||
<message name="IDS_COMPONENTS_UNKNOWN" desc="Service Status">
|
||||
Unknown
|
||||
</message>
|
||||
--- a/chrome/browser/ui/webui/components/components_handler.cc
|
||||
+++ b/chrome/browser/ui/webui/components/components_handler.cc
|
||||
@@ -12,8 +12,12 @@
|
||||
#include "base/notreached.h"
|
||||
#include "base/values.h"
|
||||
#include "build/build_config.h"
|
||||
+#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
+#include "components/helium_services/helium_services_helpers.h"
|
||||
+#include "components/prefs/pref_service.h"
|
||||
#include "components/update_client/crx_update_item.h"
|
||||
+#include "content/public/browser/web_contents.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
|
||||
ComponentsHandler::ComponentsHandler(
|
||||
@@ -82,6 +86,20 @@ void ComponentsHandler::OnEvent(const up
|
||||
|
||||
std::u16string ComponentsHandler::ServiceStatusToString(
|
||||
update_client::ComponentState state) {
|
||||
+
|
||||
+ if (state == update_client::ComponentState::kUpdateError) {
|
||||
+ Profile* profile = Profile::FromBrowserContext(
|
||||
+ web_ui()->GetWebContents()->GetBrowserContext());
|
||||
+
|
||||
+ if (profile) {
|
||||
+ PrefService* prefs = profile->GetPrefs();
|
||||
+ if (prefs && !helium::ShouldAccessComponentUpdateService(*prefs)) {
|
||||
+ return l10n_util::GetStringUTF16(
|
||||
+ IDS_COMPONENTS_SVC_STATUS_ERROR_HELIUM_SERVICES);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
switch (state) {
|
||||
case update_client::ComponentState::kNew:
|
||||
return l10n_util::GetStringUTF16(IDS_COMPONENTS_SVC_STATUS_NEW);
|
||||
--- a/chrome/browser/ui/webui/components/components_handler.h
|
||||
+++ b/chrome/browser/ui/webui/components/components_handler.h
|
||||
@@ -40,7 +40,7 @@ class ComponentsHandler : public content
|
||||
void OnEvent(const update_client::CrxUpdateItem& item) override;
|
||||
|
||||
private:
|
||||
- static std::u16string ServiceStatusToString(
|
||||
+ std::u16string ServiceStatusToString(
|
||||
update_client::ComponentState state);
|
||||
|
||||
base::Value::List LoadComponents();
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -670,7 +670,7 @@ bool HasTabSearchToolbarButton() {
|
||||
@@ -665,7 +665,7 @@ bool HasTabSearchToolbarButton() {
|
||||
return is_tab_search_moving;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -307,13 +307,7 @@ bool IsTabGroupMenuMoreEntryPointsEnable
|
||||
@@ -306,13 +306,7 @@ bool IsTabGroupMenuMoreEntryPointsEnable
|
||||
|
||||
// Enables preview images in tab-hover cards.
|
||||
// https://crbug.com/928954
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
if (tab_search_action.has_value()) {
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -620,7 +620,7 @@ BASE_FEATURE(kByDateHistoryInSidePanel,
|
||||
@@ -619,7 +619,7 @@ BASE_FEATURE(kByDateHistoryInSidePanel,
|
||||
|
||||
BASE_FEATURE(kTabStripBrowserApi, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
|
||||
// This serves as a "kill-switch" for migrating the Tab Search feature to be a
|
||||
// toolbar button for non-ChromeOS users in the US.
|
||||
@@ -655,6 +655,8 @@ bool HasTabSearchToolbarButton() {
|
||||
return false;
|
||||
}
|
||||
@@ -650,6 +650,8 @@ static std::string GetCountryCode() {
|
||||
}
|
||||
|
||||
bool HasTabSearchToolbarButton() {
|
||||
+ return true;
|
||||
+
|
||||
static const bool is_tab_search_moving = [] {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -13643,11 +13643,328 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
@@ -13667,11 +13667,328 @@ const FeatureEntry kFeatureEntries[] = {
|
||||
// AboutFlagsHistogramTest unit test to verify this process).
|
||||
};
|
||||
|
||||
@@ -330,7 +330,7 @@
|
||||
FlagsStateSingleton(const FlagsStateSingleton&) = delete;
|
||||
FlagsStateSingleton& operator=(const FlagsStateSingleton&) = delete;
|
||||
~FlagsStateSingleton() override = default;
|
||||
@@ -13666,7 +13983,7 @@ class FlagsStateSingleton : public flags
|
||||
@@ -13690,7 +14007,7 @@ class FlagsStateSingleton : public flags
|
||||
|
||||
void RestoreDefaultState() {
|
||||
flags_state_ =
|
||||
@@ -339,7 +339,7 @@
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -13990,7 +14307,7 @@ base::span<const FeatureEntry> GetFeatur
|
||||
@@ -14014,7 +14331,7 @@ base::span<const FeatureEntry> GetFeatur
|
||||
!entries_for_testing->empty()) {
|
||||
return *entries_for_testing;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#endif // USE_AURA
|
||||
|
||||
#if defined(USE_AURA)
|
||||
@@ -5200,11 +5200,13 @@ const FeatureEntry::FeatureVariation kPr
|
||||
@@ -5222,11 +5222,13 @@ const FeatureEntry::FeatureVariation kPr
|
||||
// calculate and verify checksum.
|
||||
//
|
||||
// When adding a new choice, add it to the end of the list.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -145,7 +145,7 @@
|
||||
@@ -133,7 +133,7 @@
|
||||
"Return generic values for WebGLDebugRendererInfo to remove a potential data leak while preventing potential website breakage. ungoogled-chromium flag.",
|
||||
kOsAll, FEATURE_WITH_PARAMS_VALUE_TYPE(blink::features::kSpoofWebGLInfo, kSpoofWebGLChoices, "SpoofWebGLInfo")},
|
||||
{"increase-incognito-storage-quota",
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
|
||||
void BrowserCommandController::TabStateChanged() {
|
||||
@@ -1176,6 +1178,14 @@ bool BrowserCommandController::ExecuteCo
|
||||
@@ -1179,6 +1181,14 @@ bool BrowserCommandController::ExecuteCo
|
||||
case IDC_DUPLICATE_TARGET_TAB:
|
||||
DuplicateKeyboardFocusedTab(browser_);
|
||||
break;
|
||||
@@ -66,7 +66,7 @@
|
||||
// Hosted App commands
|
||||
case IDC_COPY_URL:
|
||||
CopyURL(browser_, browser_->tab_strip_model()->GetActiveWebContents());
|
||||
@@ -1926,6 +1936,12 @@ void BrowserCommandController::UpdateCom
|
||||
@@ -1929,6 +1939,12 @@ void BrowserCommandController::UpdateCom
|
||||
|
||||
bool dev_tools_enabled = DevToolsWindow::AllowDevToolsFor(
|
||||
profile(), browser_->tab_strip_model()->GetActiveWebContents());
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/components/helium_services/pref_names.h
|
||||
+++ b/components/helium_services/pref_names.h
|
||||
@@ -7,12 +7,20 @@
|
||||
|
||||
namespace prefs {
|
||||
@@ -13,12 +13,20 @@ inline constexpr char kHeliumSchemaVersi
|
||||
inline constexpr char kHeliumDisableSchemaAlerts[] =
|
||||
"helium.services.disable_schema_alerts";
|
||||
|
||||
+inline constexpr char kHeliumPrefPrefix[] = "helium.";
|
||||
+
|
||||
@@ -23,8 +23,8 @@
|
||||
#endif // COMPONENTS_HELIUM_SERVICES_PREF_NAMES_H_
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -208,6 +208,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
{
|
||||
@@ -210,6 +210,8 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
registry->RegisterBooleanPref(prefs::kHeliumDisableSchemaAlerts, false);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumServicesEnabled, true);
|
||||
registry->RegisterStringPref(prefs::kHeliumServicesOrigin, "");
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumDidOnboarding, false);
|
||||
@@ -160,36 +160,36 @@
|
||||
+
|
||||
+#include "chrome/browser/profiles/profile.h"
|
||||
+#include "chrome/browser/ui/webui/onboarding/onboarding_handler.h"
|
||||
+#include "chrome/browser/ui/webui/settings/brave_import_data_handler.h"
|
||||
+#include "chrome/browser/ui/webui/settings/search_engines_handler.h"
|
||||
+#include "chrome/browser/ui/webui/settings/settings_default_browser_handler.h"
|
||||
+#include "chrome/browser/ui/webui/settings/brave_import_data_handler.h"
|
||||
+#include "chrome/common/webui_url_constants.h"
|
||||
+#include "content/public/browser/web_ui_controller.h"
|
||||
+#include "content/public/browser/web_ui_data_source.h"
|
||||
+#include "components/helium_onboarding/resources/grit/helium_onboarding_generated.h"
|
||||
+#include "components/helium_onboarding/resources/grit/helium_onboarding_generated_map.h"
|
||||
+#include "content/public/browser/web_ui_controller.h"
|
||||
+#include "content/public/browser/web_ui_data_source.h"
|
||||
+#include "ui/webui/webui_util.h"
|
||||
+
|
||||
+HeliumOnboardingPage::HeliumOnboardingPage(content::WebUI* web_ui) : WebUIController(web_ui) {
|
||||
+ Profile* profile = Profile::FromWebUI(web_ui);
|
||||
+ content::WebUIDataSource* source =
|
||||
+ content::WebUIDataSource::CreateAndAdd(profile, chrome::kHeliumSetupHost);
|
||||
+HeliumOnboardingPage::HeliumOnboardingPage(content::WebUI* web_ui)
|
||||
+ : WebUIController(web_ui) {
|
||||
+ Profile* profile = Profile::FromWebUI(web_ui);
|
||||
+ content::WebUIDataSource* source =
|
||||
+ content::WebUIDataSource::CreateAndAdd(profile, chrome::kHeliumSetupHost);
|
||||
+
|
||||
+ webui::SetupWebUIDataSource(
|
||||
+ source, kHeliumOnboardingGenerated,
|
||||
+ IDR_HELIUM_ONBOARDING_INDEX_HTML);
|
||||
+ webui::SetupWebUIDataSource(source, kHeliumOnboardingGenerated,
|
||||
+ IDR_HELIUM_ONBOARDING_INDEX_HTML);
|
||||
+
|
||||
+ source->UseStringsJs();
|
||||
+ source->DisableTrustedTypesCSP();
|
||||
+ source->UseStringsJs();
|
||||
+ source->DisableTrustedTypesCSP();
|
||||
+
|
||||
+ web_ui->AddMessageHandler(
|
||||
+ std::make_unique<OnboardingMessageHandler>(profile));
|
||||
+ web_ui->AddMessageHandler(
|
||||
+ std::make_unique<settings::SearchEnginesHandler>(profile));
|
||||
+ web_ui->AddMessageHandler(
|
||||
+ std::make_unique<settings::DefaultBrowserHandler>());
|
||||
+ web_ui->AddMessageHandler(
|
||||
+ std::make_unique<settings::BraveImportDataHandler>());
|
||||
+ web_ui->AddMessageHandler(
|
||||
+ std::make_unique<OnboardingMessageHandler>(profile));
|
||||
+ web_ui->AddMessageHandler(
|
||||
+ std::make_unique<settings::SearchEnginesHandler>(profile));
|
||||
+ web_ui->AddMessageHandler(
|
||||
+ std::make_unique<settings::DefaultBrowserHandler>());
|
||||
+ web_ui->AddMessageHandler(
|
||||
+ std::make_unique<settings::BraveImportDataHandler>());
|
||||
+}
|
||||
+
|
||||
+HeliumOnboardingPage::~HeliumOnboardingPage() = default;
|
||||
@@ -204,8 +204,8 @@
|
||||
+#define CHROME_BROWSER_UI_WEBUI_ONBOARDING_ONBOARDING_PAGE_UI_H_
|
||||
+
|
||||
+#include "chrome/common/webui_url_constants.h"
|
||||
+#include "content/public/browser/webui_config.h"
|
||||
+#include "content/public/browser/web_ui_controller.h"
|
||||
+#include "content/public/browser/webui_config.h"
|
||||
+
|
||||
+class HeliumOnboardingPage;
|
||||
+
|
||||
@@ -213,23 +213,23 @@
|
||||
+ : public content::DefaultWebUIConfig<HeliumOnboardingPage> {
|
||||
+ public:
|
||||
+ HeliumOnboardingPageConfig()
|
||||
+ : DefaultWebUIConfig(content::kChromeUIScheme,
|
||||
+ chrome::kHeliumSetupHost) {}
|
||||
+ : DefaultWebUIConfig(content::kChromeUIScheme, chrome::kHeliumSetupHost) {
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+class HeliumOnboardingPage : public content::WebUIController {
|
||||
+public:
|
||||
+ explicit HeliumOnboardingPage(content::WebUI* web_ui);
|
||||
+ public:
|
||||
+ explicit HeliumOnboardingPage(content::WebUI* web_ui);
|
||||
+
|
||||
+ HeliumOnboardingPage(const HeliumOnboardingPage&) = delete;
|
||||
+ HeliumOnboardingPage& operator=(const HeliumOnboardingPage&) = delete;
|
||||
+ ~HeliumOnboardingPage() override;
|
||||
+ HeliumOnboardingPage(const HeliumOnboardingPage&) = delete;
|
||||
+ HeliumOnboardingPage& operator=(const HeliumOnboardingPage&) = delete;
|
||||
+ ~HeliumOnboardingPage() override;
|
||||
+};
|
||||
+
|
||||
+#endif // CHROME_BROWSER_UI_WEBUI_ONBOARDING_ONBOARDING_PAGE_UI_H_
|
||||
+#endif // CHROME_BROWSER_UI_WEBUI_ONBOARDING_ONBOARDING_PAGE_UI_H_
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/webui/onboarding/onboarding_handler.cc
|
||||
@@ -0,0 +1,190 @@
|
||||
@@ -0,0 +1,188 @@
|
||||
+// 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.
|
||||
@@ -248,6 +248,7 @@
|
||||
+#include "chrome/browser/themes/theme_service_factory.h"
|
||||
+#include "chrome/browser/ui/color/chrome_color_id.h"
|
||||
+#include "components/helium_services/pref_names.h"
|
||||
+#include "components/helium_services/schema.h"
|
||||
+#include "components/prefs/pref_change_registrar.h"
|
||||
+#include "components/prefs/pref_service.h"
|
||||
+#include "content/public/browser/web_contents.h"
|
||||
@@ -255,174 +256,171 @@
|
||||
+#include "ui/gfx/color_utils.h"
|
||||
+
|
||||
+OnboardingMessageHandler::OnboardingMessageHandler(Profile* profile)
|
||||
+ : profile_(profile),
|
||||
+ pref_service_(profile->GetPrefs()) {
|
||||
+ pref_change_registrar_.Init(pref_service_);
|
||||
+ : profile_(profile), pref_service_(profile->GetPrefs()) {
|
||||
+ pref_change_registrar_.Init(pref_service_);
|
||||
+
|
||||
+ for (const auto [ key, _ ] : GetPreferencesDict()) {
|
||||
+ pref_change_registrar_.Add(
|
||||
+ prefs::kHeliumPrefPrefix + key,
|
||||
+ base::BindRepeating(
|
||||
+ &OnboardingMessageHandler::OnPreferencesChanged,
|
||||
+ base::Unretained(this)
|
||||
+ )
|
||||
+ );
|
||||
+ }
|
||||
+ for (const auto [key, _] : GetPreferencesDict()) {
|
||||
+ pref_change_registrar_.Add(
|
||||
+ prefs::kHeliumPrefPrefix + key,
|
||||
+ base::BindRepeating(&OnboardingMessageHandler::OnPreferencesChanged,
|
||||
+ base::Unretained(this)));
|
||||
+ }
|
||||
+
|
||||
+ ThemeServiceFactory::GetForProfile(profile_)->AddObserver(this);
|
||||
+ ThemeServiceFactory::GetForProfile(profile_)->AddObserver(this);
|
||||
+}
|
||||
+
|
||||
+OnboardingMessageHandler::~OnboardingMessageHandler() {
|
||||
+ ThemeServiceFactory::GetForProfile(profile_)->RemoveObserver(this);
|
||||
+ ThemeServiceFactory::GetForProfile(profile_)->RemoveObserver(this);
|
||||
+}
|
||||
+
|
||||
+base::Value::Dict OnboardingMessageHandler::GetPreferencesDict() {
|
||||
+ std::vector<PrefService::PreferenceValueAndStore> values =
|
||||
+ pref_service_->GetPreferencesValueAndStore();
|
||||
+ base::Value::Dict output;
|
||||
+ std::vector<PrefService::PreferenceValueAndStore> values =
|
||||
+ pref_service_->GetPreferencesValueAndStore();
|
||||
+ base::Value::Dict output;
|
||||
+
|
||||
+ for (const auto& [name, value, _] : values) {
|
||||
+ if (!base::StartsWith(name, prefs::kHeliumPrefPrefix,
|
||||
+ base::CompareCase::SENSITIVE)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ output.Set(
|
||||
+ name.substr(sizeof(prefs::kHeliumPrefPrefix) - 1),
|
||||
+ value.Clone()
|
||||
+ );
|
||||
+ for (const auto& [name, value, _] : values) {
|
||||
+ if (!base::StartsWith(name, prefs::kHeliumPrefPrefix,
|
||||
+ base::CompareCase::SENSITIVE)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ return output;
|
||||
+ output.Set(name.substr(sizeof(prefs::kHeliumPrefPrefix) - 1),
|
||||
+ value.Clone());
|
||||
+ }
|
||||
+
|
||||
+ return output;
|
||||
+}
|
||||
+
|
||||
+void OnboardingMessageHandler::OnThemeChanged() {
|
||||
+ AllowJavascript();
|
||||
+ FireWebUIListener("ntp-background-changed", GetNTPBackgroundColor());
|
||||
+ AllowJavascript();
|
||||
+ FireWebUIListener("ntp-background-changed", GetNTPBackgroundColor());
|
||||
+}
|
||||
+
|
||||
+void OnboardingMessageHandler::OnPreferencesChanged() {
|
||||
+ AllowJavascript();
|
||||
+ FireWebUIListener("helium-prefs-changed", GetPreferencesDict());
|
||||
+ AllowJavascript();
|
||||
+ FireWebUIListener("helium-prefs-changed", GetPreferencesDict());
|
||||
+}
|
||||
+
|
||||
+void OnboardingMessageHandler::RegisterMessages() {
|
||||
+ web_ui()->RegisterMessageCallback(
|
||||
+ "getPrefs",
|
||||
+ base::BindRepeating(&OnboardingMessageHandler::HandleGetPreferences,
|
||||
+ base::Unretained(this)));
|
||||
+
|
||||
+ web_ui()->RegisterMessageCallback(
|
||||
+ "setPref",
|
||||
+ base::BindRepeating(&OnboardingMessageHandler::HandleSetPreference,
|
||||
+ base::Unretained(this)));
|
||||
+
|
||||
+ web_ui()->RegisterMessageCallback(
|
||||
+ "getProfileName",
|
||||
+ base::BindRepeating(&OnboardingMessageHandler::HandleGetProfileName,
|
||||
+ base::Unretained(this)));
|
||||
+
|
||||
+ web_ui()->RegisterMessageCallback(
|
||||
+ "setProfileName",
|
||||
+ base::BindRepeating(&OnboardingMessageHandler::HandleSetProfileName,
|
||||
+ base::Unretained(this)));
|
||||
+
|
||||
+ web_ui()->RegisterMessageCallback(
|
||||
+ "getBackgroundColor",
|
||||
+ base::BindRepeating(&OnboardingMessageHandler::HandleGetBackgroundColor,
|
||||
+ base::Unretained(this)));
|
||||
+ web_ui()->RegisterMessageCallback(
|
||||
+ "getPrefs",
|
||||
+ base::BindRepeating(&OnboardingMessageHandler::HandleGetPreferences,
|
||||
+ base::Unretained(this)));
|
||||
+ web_ui()->RegisterMessageCallback(
|
||||
+ "setPref",
|
||||
+ base::BindRepeating(&OnboardingMessageHandler::HandleSetPreference,
|
||||
+ base::Unretained(this)));
|
||||
+ web_ui()->RegisterMessageCallback(
|
||||
+ "acceptLatestSchema",
|
||||
+ base::BindRepeating(&OnboardingMessageHandler::HandleAcceptSchema,
|
||||
+ base::Unretained(this)));
|
||||
+ web_ui()->RegisterMessageCallback(
|
||||
+ "getProfileName",
|
||||
+ base::BindRepeating(&OnboardingMessageHandler::HandleGetProfileName,
|
||||
+ base::Unretained(this)));
|
||||
+ web_ui()->RegisterMessageCallback(
|
||||
+ "setProfileName",
|
||||
+ base::BindRepeating(&OnboardingMessageHandler::HandleSetProfileName,
|
||||
+ base::Unretained(this)));
|
||||
+ web_ui()->RegisterMessageCallback(
|
||||
+ "getBackgroundColor",
|
||||
+ base::BindRepeating(&OnboardingMessageHandler::HandleGetBackgroundColor,
|
||||
+ base::Unretained(this)));
|
||||
+}
|
||||
+
|
||||
+base::Value OnboardingMessageHandler::GetNTPBackgroundColor() {
|
||||
+ return base::Value(
|
||||
+ color_utils::SkColorToRgbaString(
|
||||
+ web_ui()
|
||||
+ ->GetWebContents()
|
||||
+ ->GetColorProvider().GetColor(kColorNewTabPageBackground)
|
||||
+ )
|
||||
+ );
|
||||
+ return base::Value(color_utils::SkColorToRgbaString(
|
||||
+ web_ui()->GetWebContents()->GetColorProvider().GetColor(
|
||||
+ kColorNewTabPageBackground)));
|
||||
+}
|
||||
+
|
||||
+void OnboardingMessageHandler::HandleGetBackgroundColor(const base::Value::List& args) {
|
||||
+ CHECK_EQ(1U, args.size());
|
||||
+ const auto& callback_id = args[0].GetString();
|
||||
+void OnboardingMessageHandler::HandleGetBackgroundColor(
|
||||
+ const base::Value::List& args) {
|
||||
+ CHECK_EQ(1U, args.size());
|
||||
+ const auto& callback_id = args[0].GetString();
|
||||
+
|
||||
+ AllowJavascript();
|
||||
+ ResolveJavascriptCallback(
|
||||
+ base::Value(callback_id), GetNTPBackgroundColor());
|
||||
+ AllowJavascript();
|
||||
+ ResolveJavascriptCallback(base::Value(callback_id), GetNTPBackgroundColor());
|
||||
+}
|
||||
+
|
||||
+void OnboardingMessageHandler::HandleGetPreferences(const base::Value::List& args) {
|
||||
+ CHECK_EQ(1U, args.size());
|
||||
+ const auto& callback_id = args[0].GetString();
|
||||
+void OnboardingMessageHandler::HandleGetPreferences(
|
||||
+ const base::Value::List& args) {
|
||||
+ CHECK_EQ(1U, args.size());
|
||||
+ const auto& callback_id = args[0].GetString();
|
||||
+
|
||||
+ AllowJavascript();
|
||||
+ ResolveJavascriptCallback(
|
||||
+ base::Value(callback_id), base::Value(GetPreferencesDict()));
|
||||
+ AllowJavascript();
|
||||
+ ResolveJavascriptCallback(base::Value(callback_id),
|
||||
+ base::Value(GetPreferencesDict()));
|
||||
+}
|
||||
+
|
||||
+void OnboardingMessageHandler::HandleGetProfileName(const base::Value::List& args) {
|
||||
+ CHECK_EQ(1U, args.size());
|
||||
+ const auto& callback_id = args[0].GetString();
|
||||
+void OnboardingMessageHandler::HandleGetProfileName(
|
||||
+ const base::Value::List& args) {
|
||||
+ CHECK_EQ(1U, args.size());
|
||||
+ const auto& callback_id = args[0].GetString();
|
||||
+
|
||||
+ ProfileAttributesEntry* entry =
|
||||
+ g_browser_process->profile_manager()
|
||||
+ ->GetProfileAttributesStorage()
|
||||
+ .GetProfileAttributesWithPath(profile_->GetPath());
|
||||
+ ProfileAttributesEntry* entry =
|
||||
+ g_browser_process->profile_manager()
|
||||
+ ->GetProfileAttributesStorage()
|
||||
+ .GetProfileAttributesWithPath(profile_->GetPath());
|
||||
+
|
||||
+ if (!entry) {
|
||||
+ return RejectJavascriptCallback(callback_id, "entry not found");
|
||||
+ }
|
||||
+ if (!entry) {
|
||||
+ return RejectJavascriptCallback(callback_id, "entry not found");
|
||||
+ }
|
||||
+
|
||||
+ AllowJavascript();
|
||||
+ ResolveJavascriptCallback(
|
||||
+ base::Value(callback_id),
|
||||
+ base::Value(entry->GetLocalProfileName()));
|
||||
+ AllowJavascript();
|
||||
+ ResolveJavascriptCallback(base::Value(callback_id),
|
||||
+ base::Value(entry->GetLocalProfileName()));
|
||||
+}
|
||||
+
|
||||
+void OnboardingMessageHandler::HandleSetProfileName(const base::Value::List& args) {
|
||||
+ CHECK_EQ(1U, args.size());
|
||||
+ std::u16string new_name = base::UTF8ToUTF16(args[0].GetString());
|
||||
+ base::TrimWhitespace(new_name, base::TRIM_ALL, &new_name);
|
||||
+void OnboardingMessageHandler::HandleSetProfileName(
|
||||
+ const base::Value::List& args) {
|
||||
+ CHECK_EQ(1U, args.size());
|
||||
+ std::u16string new_name = base::UTF8ToUTF16(args[0].GetString());
|
||||
+ base::TrimWhitespace(new_name, base::TRIM_ALL, &new_name);
|
||||
+
|
||||
+ if (!new_name.empty()) {
|
||||
+ profiles::UpdateProfileName(profile_, new_name);
|
||||
+ }
|
||||
+ if (!new_name.empty()) {
|
||||
+ profiles::UpdateProfileName(profile_, new_name);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void OnboardingMessageHandler::HandleSetPreference(const base::Value::List& args) {
|
||||
+ if (args.size() == 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+void OnboardingMessageHandler::HandleSetPreference(
|
||||
+ const base::Value::List& args) {
|
||||
+ if (args.size() == 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ AllowJavascript();
|
||||
+ AllowJavascript();
|
||||
+
|
||||
+ const auto& callback_id = args[0].GetString();
|
||||
+ if (args.size() != 3) {
|
||||
+ return RejectJavascriptCallback(callback_id, "invalid arguments");
|
||||
+ }
|
||||
+ const auto& callback_id = args[0].GetString();
|
||||
+ if (args.size() != 3) {
|
||||
+ return RejectJavascriptCallback(callback_id, "invalid arguments");
|
||||
+ }
|
||||
+
|
||||
+ if (!args[1].is_string()) {
|
||||
+ return RejectJavascriptCallback(callback_id, "pref is not a string");
|
||||
+ }
|
||||
+ if (!args[1].is_string()) {
|
||||
+ return RejectJavascriptCallback(callback_id, "pref is not a string");
|
||||
+ }
|
||||
+
|
||||
+ const auto& pref_name = prefs::kHeliumPrefPrefix + args[1].GetString();
|
||||
+ auto* pref = pref_service_->FindPreference(pref_name);
|
||||
+ if (!pref) {
|
||||
+ return RejectJavascriptCallback(callback_id, pref_name + " does not exist");
|
||||
+ }
|
||||
+ const auto& pref_name = prefs::kHeliumPrefPrefix + args[1].GetString();
|
||||
+ auto* pref = pref_service_->FindPreference(pref_name);
|
||||
+ if (!pref) {
|
||||
+ return RejectJavascriptCallback(callback_id, pref_name + " does not exist");
|
||||
+ }
|
||||
+
|
||||
+ if (args[2].type() != pref->GetType()) {
|
||||
+ return RejectJavascriptCallback(callback_id, "invalid value type");
|
||||
+ }
|
||||
+ if (args[2].type() != pref->GetType()) {
|
||||
+ return RejectJavascriptCallback(callback_id, "invalid value type");
|
||||
+ }
|
||||
+
|
||||
+ pref_service_->Set(pref_name, args[2].Clone());
|
||||
+ pref_service_->Set(pref_name, args[2].Clone());
|
||||
+
|
||||
+ ResolveJavascriptCallback(callback_id, {});
|
||||
+ ResolveJavascriptCallback(callback_id, {});
|
||||
+}
|
||||
+
|
||||
+void OnboardingMessageHandler::HandleAcceptSchema(const base::Value::List&) {
|
||||
+ helium::AcceptCurrentSchema(*pref_service_);
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/webui/onboarding/onboarding_handler.h
|
||||
@@ -0,0 +1,51 @@
|
||||
@@ -0,0 +1,52 @@
|
||||
+// 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.
|
||||
@@ -437,10 +435,10 @@
|
||||
+#include "base/memory/weak_ptr.h"
|
||||
+#include "base/values.h"
|
||||
+#include "chrome/browser/profiles/profile.h"
|
||||
+#include "components/prefs/pref_service.h"
|
||||
+#include "components/prefs/pref_change_registrar.h"
|
||||
+#include "content/public/browser/web_ui_message_handler.h"
|
||||
+#include "chrome/browser/themes/theme_service_observer.h"
|
||||
+#include "components/prefs/pref_change_registrar.h"
|
||||
+#include "components/prefs/pref_service.h"
|
||||
+#include "content/public/browser/web_ui_message_handler.h"
|
||||
+
|
||||
+class OnboardingMessageHandler : public content::WebUIMessageHandler,
|
||||
+ public ThemeServiceObserver {
|
||||
@@ -455,6 +453,7 @@
|
||||
+ private:
|
||||
+ base::Value::Dict GetPreferencesDict();
|
||||
+ void HandleGetPreferences(const base::Value::List& args);
|
||||
+ void HandleAcceptSchema(const base::Value::List& args);
|
||||
+ void HandleSetPreference(const base::Value::List& args);
|
||||
+ void HandleGetProfileName(const base::Value::List& args);
|
||||
+ void HandleSetProfileName(const base::Value::List& args);
|
||||
@@ -473,7 +472,7 @@
|
||||
+ base::WeakPtrFactory<OnboardingMessageHandler> weak_ptr_factory_{this};
|
||||
+};
|
||||
+
|
||||
+#endif // CHROME_BROWSER_UI_WEBUI_ONBOARDING_ONBOARDING_HANDLER_H_
|
||||
+#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,18 @@ GURL GetDummyURL() {
|
||||
@@ -494,8 +493,8 @@
|
||||
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
|
||||
@@ -48,7 +48,8 @@ bool IsHostAllowedInIncognito(const GURL
|
||||
@@ -533,9 +532,9 @@
|
||||
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -1947,6 +1947,12 @@
|
||||
<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
|
||||
@@ -1956,6 +1956,12 @@
|
||||
<message name="IDS_SETTINGS_HELIUM_SCHEMA_IGNORE" desc="Checkbox label to ignore any future services change alerts">
|
||||
Don't notify me again
|
||||
</message>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_SETUP_PENDING_TEXT" desc="Description shown in services settings when user has not completed onboarding">
|
||||
+ Helium services are not available until setup is complete to ensure your privacy and consent.
|
||||
@@ -559,9 +558,9 @@
|
||||
(*s_allowlist)[::prefs::kPrivacyGuideViewed] =
|
||||
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
@@ -2,10 +2,42 @@
|
||||
.label-wrapper {
|
||||
padding: var(--cr-section-vertical-padding) 0;
|
||||
@@ -25,10 +25,42 @@
|
||||
margin-top: var(--cr-changelog-padding);
|
||||
padding-top: calc(var(--cr-changelog-padding) / 2);
|
||||
}
|
||||
+
|
||||
+ #onboarding-link {
|
||||
@@ -599,10 +598,10 @@
|
||||
+ </template>
|
||||
+
|
||||
+ <template is="dom-if" if="[[prefs.helium.services.user_consented.value]]">
|
||||
<settings-toggle-button id="servicesToggleButton"
|
||||
pref="{{prefs.helium.services.enabled}}"
|
||||
label="$i18n{heliumServicesToggle}"
|
||||
@@ -15,6 +47,7 @@
|
||||
<template is="dom-if" if="[[changes_.length]]">
|
||||
<div id="changelog-notice">
|
||||
<div id="changelog-title">$i18n{heliumSchemaUpdatedTitle}</div>
|
||||
@@ -57,6 +89,7 @@
|
||||
<cr-collapse id="servicesCollapse" opened="[[prefs.helium.services.enabled.value]]">
|
||||
</cr-collapse>
|
||||
</div>
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
--- a/content/common/url_schemes.cc
|
||||
+++ b/content/common/url_schemes.cc
|
||||
@@ -33,6 +33,7 @@ const char* const kDefaultSavableSchemes
|
||||
@@ -30,6 +30,7 @@ const char* const kDefaultSavableSchemes
|
||||
url::kFileSystemScheme,
|
||||
kChromeDevToolsScheme,
|
||||
kChromeUIScheme,
|
||||
+ kHeliumUIScheme,
|
||||
url::kDataScheme,
|
||||
url::kJavaScriptScheme,
|
||||
url::kMailToScheme,
|
||||
@@ -68,6 +69,7 @@ void RegisterContentSchemes(bool should_
|
||||
url::kDataScheme
|
||||
};
|
||||
|
||||
@@ -60,6 +61,7 @@ void RegisterContentSchemes(bool should_
|
||||
|
||||
url::AddStandardScheme(kChromeDevToolsScheme, url::SCHEME_WITH_HOST);
|
||||
url::AddStandardScheme(kChromeUIScheme, url::SCHEME_WITH_HOST);
|
||||
@@ -36,7 +36,7 @@
|
||||
url::AddStandardScheme(kChromeUIUntrustedScheme, url::SCHEME_WITH_HOST);
|
||||
url::AddStandardScheme(kChromeErrorScheme, url::SCHEME_WITH_HOST);
|
||||
for (auto& scheme : schemes.standard_schemes)
|
||||
@@ -78,6 +80,7 @@ void RegisterContentSchemes(bool should_
|
||||
@@ -70,6 +72,7 @@ void RegisterContentSchemes(bool should_
|
||||
|
||||
schemes.secure_schemes.push_back(kChromeDevToolsScheme);
|
||||
schemes.secure_schemes.push_back(kChromeUIScheme);
|
||||
@@ -44,7 +44,7 @@
|
||||
schemes.secure_schemes.push_back(kChromeUIUntrustedScheme);
|
||||
schemes.secure_schemes.push_back(kChromeErrorScheme);
|
||||
for (auto& scheme : schemes.secure_schemes)
|
||||
@@ -98,6 +101,7 @@ void RegisterContentSchemes(bool should_
|
||||
@@ -90,6 +93,7 @@ void RegisterContentSchemes(bool should_
|
||||
url::AddNoAccessScheme(scheme.c_str());
|
||||
|
||||
schemes.cors_enabled_schemes.push_back(kChromeUIScheme);
|
||||
@@ -52,7 +52,7 @@
|
||||
schemes.cors_enabled_schemes.push_back(kChromeUIUntrustedScheme);
|
||||
for (auto& scheme : schemes.cors_enabled_schemes)
|
||||
url::AddCorsEnabledScheme(scheme.c_str());
|
||||
@@ -126,6 +130,7 @@ void RegisterContentSchemes(bool should_
|
||||
@@ -118,6 +122,7 @@ void RegisterContentSchemes(bool should_
|
||||
// service workers don't work for chrome[-untrusted]:// when the flag is not
|
||||
// enabled.
|
||||
schemes.service_worker_schemes.push_back(kChromeUIScheme);
|
||||
@@ -350,7 +350,7 @@
|
||||
#include "components/user_education/common/feature_promo/feature_promo_controller.h"
|
||||
#include "components/web_modal/web_contents_modal_dialog_manager.h"
|
||||
#include "components/webapps/common/web_app_id.h"
|
||||
@@ -2441,7 +2442,12 @@ bool IsDebuggerAttachedToCurrentTab(Brow
|
||||
@@ -2447,7 +2448,12 @@ bool IsDebuggerAttachedToCurrentTab(Brow
|
||||
|
||||
void CopyURL(BrowserWindowInterface* bwi, content::WebContents* web_contents) {
|
||||
ui::ScopedClipboardWriter scw(ui::ClipboardBuffer::kCopyPaste);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/common/chrome_features.cc
|
||||
+++ b/chrome/common/chrome_features.cc
|
||||
@@ -1181,7 +1181,7 @@ BASE_FEATURE(kHttpsFirstBalancedMode, ba
|
||||
@@ -1185,7 +1185,7 @@ BASE_FEATURE(kHttpsFirstBalancedMode, ba
|
||||
// Automatically enables HTTPS-First Mode in a balanced configuration when
|
||||
// possible.
|
||||
BASE_FEATURE(kHttpsFirstBalancedModeAutoEnable,
|
||||
|
||||
@@ -177,9 +177,9 @@
|
||||
(*s_allowlist)[::prefs::kHeliumServicesConsented] =
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -211,6 +211,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
|
||||
{
|
||||
@@ -213,6 +213,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
registry->RegisterIntegerPref(prefs::kHeliumSchemaVersion, 0);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumDisableSchemaAlerts, false);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumServicesEnabled, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumExtProxyEnabled, true);
|
||||
registry->RegisterStringPref(prefs::kHeliumServicesOrigin, "");
|
||||
@@ -187,7 +187,7 @@
|
||||
registry->RegisterBooleanPref(prefs::kHeliumServicesConsented, false);
|
||||
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
@@ -45,6 +45,11 @@
|
||||
@@ -87,6 +87,11 @@
|
||||
</settings-toggle-button>
|
||||
<div class="cr-col">
|
||||
<cr-collapse id="servicesCollapse" opened="[[prefs.helium.services.enabled.value]]">
|
||||
@@ -201,10 +201,10 @@
|
||||
</template>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -2125,6 +2125,10 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
{"heliumServicesToggle", IDS_SETTINGS_HELIUM_SERVICES_TOGGLE},
|
||||
{"heliumServicesToggleDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_TOGGLE_DESCRIPTION},
|
||||
@@ -2130,6 +2130,10 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
IDS_SETTINGS_HELIUM_SCHEMA_NOTICE_DESCRIPTION},
|
||||
{"heliumGotIt", IDS_SETTINGS_GOT_IT},
|
||||
{"heliumSchemaIgnore", IDS_SETTINGS_HELIUM_SCHEMA_IGNORE},
|
||||
+ {"heliumExtProxyToggle",
|
||||
+ IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE},
|
||||
+ {"heliumExtProxyToggleDescription",
|
||||
@@ -214,7 +214,7 @@
|
||||
IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_DESCRIPTION},
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -1975,6 +1975,12 @@
|
||||
@@ -1984,6 +1984,12 @@
|
||||
<message name="IDS_SETTINGS_HELIUM_SERVICES_TOGGLE_DESCRIPTION" desc="Description of the toggle for enabling/disabling of all Helium services">
|
||||
When enabled, Helium will be able to connect to anonymous web services to provide additional functionality. When disabled, additional features will not work.
|
||||
</message>
|
||||
@@ -229,7 +229,7 @@
|
||||
</message>
|
||||
--- a/components/helium_services/pref_names.h
|
||||
+++ b/components/helium_services/pref_names.h
|
||||
@@ -21,6 +21,9 @@ inline constexpr char kHeliumServicesCon
|
||||
@@ -27,6 +27,9 @@ inline constexpr char kHeliumServicesCon
|
||||
inline constexpr char kHeliumDidOnboarding[] =
|
||||
"helium.completed_onboarding";
|
||||
|
||||
@@ -241,7 +241,15 @@
|
||||
#endif // COMPONENTS_HELIUM_SERVICES_PREF_NAMES_H_
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -61,6 +61,28 @@ bool ShouldAccessServices(const PrefServ
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <optional>
|
||||
|
||||
#include "base/functional/bind.h"
|
||||
+#include "base/strings/stringprintf.h"
|
||||
#include "components/helium_services/pref_names.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "net/base/url_util.h"
|
||||
@@ -61,6 +62,28 @@ bool ShouldAccessServices(const PrefServ
|
||||
|| prefs.HasPrefPath(prefs::kHeliumServicesEnabled));
|
||||
}
|
||||
|
||||
@@ -272,9 +280,9 @@
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -18,8 +18,11 @@ const char kHeliumDefaultOrigin[] =
|
||||
const char kHeliumDummyOrigin[] =
|
||||
"https://helium-services-are-disabled.qjz9zk";
|
||||
@@ -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);
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -66,6 +66,11 @@ bool ShouldAccessExtensionService(const
|
||||
@@ -67,6 +67,11 @@ bool ShouldAccessExtensionService(const
|
||||
prefs.GetBoolean(prefs::kHeliumExtProxyEnabled);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
bool ShouldFetchBangs(const PrefService& prefs) {
|
||||
return ShouldAccessServices(prefs) &&
|
||||
prefs.GetBoolean(prefs::kHeliumBangsEnabled);
|
||||
@@ -88,6 +93,14 @@ GURL GetWebstoreSnippetURL(const PrefSer
|
||||
@@ -89,6 +94,14 @@ GURL GetWebstoreSnippetURL(const PrefSer
|
||||
base::StringPrintf("/ext/cws_snippet?id=%s", id));
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -24,6 +24,7 @@ COMPONENT_EXPORT(HELIUM) GURL GetService
|
||||
@@ -26,6 +26,7 @@ COMPONENT_EXPORT(HELIUM) GURL GetService
|
||||
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);
|
||||
@@ -84,7 +84,7 @@
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
--- a/components/helium_services/pref_names.h
|
||||
+++ b/components/helium_services/pref_names.h
|
||||
@@ -27,6 +27,9 @@ inline constexpr char kHeliumExtProxyEna
|
||||
@@ -33,6 +33,9 @@ inline constexpr char kHeliumExtProxyEna
|
||||
inline constexpr char kHeliumBangsEnabled[] =
|
||||
"helium.services.bangs";
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
(*s_allowlist)[::prefs::kHeliumServicesConsented] =
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -213,6 +213,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
@@ -215,6 +215,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
registry->RegisterBooleanPref(prefs::kHeliumServicesEnabled, true);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumBangsEnabled, true);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumExtProxyEnabled, true);
|
||||
@@ -128,7 +128,7 @@
|
||||
registry->RegisterBooleanPref(prefs::kHeliumServicesConsented, false);
|
||||
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
@@ -55,6 +55,13 @@
|
||||
@@ -97,6 +97,13 @@
|
||||
label="$i18n{heliumBangsToggle}"
|
||||
sub-label="$i18n{heliumBangsToggleDescription}">
|
||||
</settings-toggle-button>
|
||||
@@ -154,7 +154,7 @@
|
||||
</if>
|
||||
</if>
|
||||
<if expr="is_chromeos">
|
||||
@@ -1987,6 +1990,12 @@
|
||||
@@ -1996,6 +1999,12 @@
|
||||
<message name="IDS_SETTINGS_HELIUM_SERVICES_BANGS_TOGGLE_DESCRIPTION" desc="Description of the toggle for enabling/disabling of downloading bangs">
|
||||
Helium will fetch a list of bangs that help you browse the Internet faster, such as !w or !gh. When disabled, bangs will not work.
|
||||
</message>
|
||||
@@ -178,16 +178,16 @@
|
||||
#endif
|
||||
#endif // !BUILDFLAG(IS_CHROMEOS)
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
@@ -2128,6 +2128,9 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
@@ -2137,6 +2137,9 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
{"heliumBangsToggle", IDS_SETTINGS_HELIUM_SERVICES_BANGS_TOGGLE},
|
||||
{"heliumBangsToggleDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_BANGS_TOGGLE_DESCRIPTION},
|
||||
+ {"heliumSpellcheckToggle", IDS_SETTINGS_HELIUM_SERVICES_SPELLCHECK_TOGGLE},
|
||||
+ {"heliumSpellcheckToggleDescription",
|
||||
+ IDS_SETTINGS_HELIUM_SERVICES_SPELLCHECK_TOGGLE_DESCRIPTION},
|
||||
{"heliumExtProxyToggle",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_EXT_PROXY_TOGGLE},
|
||||
{"heliumExtProxyToggleDescription",
|
||||
{"heliumOriginOverride", IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE},
|
||||
{"heliumOriginOverrideDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_DESCRIPTION},
|
||||
--- a/chrome/common/features.gni
|
||||
+++ b/chrome/common/features.gni
|
||||
@@ -10,6 +10,7 @@ import("//components/compose/features.gn
|
||||
|
||||
@@ -19,15 +19,6 @@
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
if (url_source_override_.is_valid()) {
|
||||
return {GURL(url_source_override_)};
|
||||
@@ -123,7 +125,7 @@ bool ConfiguratorImpl::EnabledDeltas() c
|
||||
|
||||
bool ConfiguratorImpl::EnabledComponentUpdates() const {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
bool ConfiguratorImpl::EnabledBackgroundDownloader() const {
|
||||
@@ -133,7 +135,7 @@ bool ConfiguratorImpl::EnabledBackground
|
||||
|
||||
bool ConfiguratorImpl::EnabledCupSigning() const {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/build/config/chrome_build.gni
|
||||
+++ b/build/config/chrome_build.gni
|
||||
@@ -101,4 +101,4 @@ declare_args() {
|
||||
@@ -92,4 +92,4 @@ declare_args() {
|
||||
|
||||
# Whether to enable built-in branding assets (logos & marketing snippets) for
|
||||
# search providers in choice UIs.
|
||||
-enable_builtin_search_provider_assets = is_internal_chrome_branded
|
||||
-enable_builtin_search_provider_assets = is_chrome_branded
|
||||
+enable_builtin_search_provider_assets = true
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "components/safe_browsing/core/common/features.h"
|
||||
#include "components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h"
|
||||
#include "components/saved_tab_groups/public/features.h"
|
||||
@@ -2662,14 +2660,9 @@ void AddSearchStrings(content::WebUIData
|
||||
@@ -2667,14 +2665,9 @@ void AddSearchStrings(content::WebUIData
|
||||
html_source->AddString("searchExplanationLearnMoreURL",
|
||||
chrome::kOmniboxLearnMoreURL);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -1941,6 +1941,31 @@
|
||||
@@ -1941,6 +1941,40 @@
|
||||
<message name="IDS_SETTINGS_SECURITY_DESCRIPTION" desc="Description of the controls available on the security settings page">
|
||||
Safe Browsing (protection from dangerous sites) and other security settings
|
||||
</message>
|
||||
@@ -10,6 +10,15 @@
|
||||
+ <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_SCHEMA_NOTICE_TITLE" desc="Title of the alert shown when Helium services have a change in behavior">
|
||||
+ Updates to Helium services:
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SCHEMA_NOTICE_DESCRIPTION" desc="Description of the alert shown when Helium services have a change in behavior">
|
||||
+ These changes are not active until you dismiss this notice.
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SCHEMA_IGNORE" desc="Checkbox label to ignore any future services change alerts">
|
||||
+ Don't notify me again
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_TOGGLE" desc="Global toggle for enabling/disabling of all Helium services">
|
||||
+ Allow connecting to Helium services
|
||||
+ </message>
|
||||
@@ -34,7 +43,7 @@
|
||||
Google Advanced Protection Program
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -2117,6 +2117,18 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
@@ -2117,6 +2117,23 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
{"siteSettingsSublabel", IDS_SETTINGS_PERMISSIONS_DESCRIPTION},
|
||||
{"securityPageTitle", IDS_SETTINGS_SECURITY},
|
||||
{"securityPageDescription", IDS_SETTINGS_SECURITY_DESCRIPTION},
|
||||
@@ -43,6 +52,11 @@
|
||||
+ {"heliumServicesToggle", IDS_SETTINGS_HELIUM_SERVICES_TOGGLE},
|
||||
+ {"heliumServicesToggleDescription",
|
||||
+ IDS_SETTINGS_HELIUM_SERVICES_TOGGLE_DESCRIPTION},
|
||||
+ {"heliumSchemaUpdatedTitle", IDS_SETTINGS_HELIUM_SCHEMA_NOTICE_TITLE},
|
||||
+ {"heliumSchemaUpdatedDescription",
|
||||
+ IDS_SETTINGS_HELIUM_SCHEMA_NOTICE_DESCRIPTION},
|
||||
+ {"heliumGotIt", IDS_SETTINGS_GOT_IT},
|
||||
+ {"heliumSchemaIgnore", IDS_SETTINGS_HELIUM_SCHEMA_IGNORE},
|
||||
+ {"heliumOriginOverride", IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE},
|
||||
+ {"heliumOriginOverrideDescription",
|
||||
+ IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_DESCRIPTION},
|
||||
@@ -151,17 +165,67 @@
|
||||
"privacy_sandbox/privacy_sandbox_ad_measurement_subpage.ts",
|
||||
"privacy_sandbox/privacy_sandbox_fledge_subpage.ts",
|
||||
"privacy_sandbox/privacy_sandbox_interest_item.ts",
|
||||
@@ -390,6 +391,7 @@ build_webui("build") {
|
||||
"languages_page/languages_util.ts",
|
||||
"people_page/import_data_browser_proxy.ts",
|
||||
"people_page/manage_profile_browser_proxy.ts",
|
||||
+ "privacy_page/changelog_proxy.ts",
|
||||
"system_page/system_page_browser_proxy.ts",
|
||||
]
|
||||
}
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
@@ -0,0 +1,47 @@
|
||||
@@ -0,0 +1,89 @@
|
||||
+<style include="cr-shared-style settings-shared">
|
||||
+ .label-wrapper {
|
||||
+ padding: var(--cr-section-vertical-padding) 0;
|
||||
+ }
|
||||
+
|
||||
+ #changelog-notice {
|
||||
+ --cr-changelog-padding: 16px;
|
||||
+ border-radius: calc(var(--cr-changelog-padding) / 2);
|
||||
+ margin: var(--cr-changelog-padding);
|
||||
+ margin-top: 0;
|
||||
+ padding: var(--cr-changelog-padding);
|
||||
+ background: var(--md-background-color);
|
||||
+ }
|
||||
+
|
||||
+ #changelog-title {
|
||||
+ font-size: 15px;
|
||||
+ font-weight: 500;
|
||||
+ }
|
||||
+
|
||||
+ #changelog-notice-actions {
|
||||
+ --cr-checkbox-label-padding-start: 8px;
|
||||
+ display: flex;
|
||||
+ gap: var(--cr-changelog-padding);
|
||||
+ border-top: var(--cr-separator-line);
|
||||
+ margin-top: var(--cr-changelog-padding);
|
||||
+ padding-top: calc(var(--cr-changelog-padding) / 2);
|
||||
+ }
|
||||
+</style>
|
||||
+
|
||||
+<settings-subpage page-title="$i18n{heliumServicesTitle}" route-path$="[[routePath]]">
|
||||
+<div class="cr-col first">
|
||||
+ <template is="dom-if" if="[[changes_.length]]">
|
||||
+ <div id="changelog-notice">
|
||||
+ <div id="changelog-title">$i18n{heliumSchemaUpdatedTitle}</div>
|
||||
+ <ul>
|
||||
+ <template is="dom-repeat" items="[[changes_]]" as="change">
|
||||
+ <li>[[change]]</li>
|
||||
+ </template>
|
||||
+ </ul>
|
||||
+ <div id="changelog-description">
|
||||
+ $i18n{heliumSchemaUpdatedDescription}
|
||||
+ </div>
|
||||
+ <div id="changelog-notice-actions">
|
||||
+ <cr-button on-click="onAcknowledgedChangelog_">$i18n{heliumGotIt}</cr-button>
|
||||
+ <cr-checkbox id="checkbox" checked="{{ignoreChecked_}}">
|
||||
+ $i18n{heliumSchemaIgnore}
|
||||
+ </cr-checkbox>
|
||||
+ </div>
|
||||
+ </div>
|
||||
+ </template>
|
||||
+ <settings-toggle-button id="servicesToggleButton"
|
||||
+ pref="{{prefs.helium.services.enabled}}"
|
||||
+ label="$i18n{heliumServicesToggle}"
|
||||
@@ -203,24 +267,29 @@
|
||||
+</settings-subpage>
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/services_page.ts
|
||||
@@ -0,0 +1,67 @@
|
||||
@@ -0,0 +1,97 @@
|
||||
+// Copyright 2025 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+import {HelpBubbleMixin} from 'chrome://resources/cr_components/help_bubble/help_bubble_mixin.js';
|
||||
+import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js';
|
||||
+import {PrefsMixin} from '/shared/settings/prefs/prefs_mixin.js';
|
||||
+import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
|
||||
+import {getTemplate} from './services_page.html.js';
|
||||
+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 {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.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)));
|
||||
+
|
||||
+export class SettingsHeliumServicesPageElement
|
||||
+ extends SettingsHeliumServicesPageElementBase
|
||||
+{
|
||||
+export class SettingsHeliumServicesPageElement extends
|
||||
+ SettingsHeliumServicesPageElementBase {
|
||||
+ private changeProxy_: HeliumServicesChangeHandler =
|
||||
+ HeliumServicesChangeHandlerImpl.getInstance();
|
||||
+
|
||||
+ static get is() {
|
||||
+ return 'settings-helium-services-page';
|
||||
+ }
|
||||
@@ -230,9 +299,15 @@
|
||||
+ }
|
||||
+
|
||||
+ static get properties() {
|
||||
+ return {};
|
||||
+ return {
|
||||
+ ignoreChecked_: Boolean,
|
||||
+ changes_: Array,
|
||||
+ };
|
||||
+ }
|
||||
+
|
||||
+ declare private changes_: string[];
|
||||
+ declare private ignoreChecked_: boolean;
|
||||
+
|
||||
+ private toOrigin(thing: string) {
|
||||
+ try {
|
||||
+ return new URL(thing).origin;
|
||||
@@ -241,6 +316,25 @@
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private updateChangelogState(changes: string[]) {
|
||||
+ this.changes_ = changes.flatMap(ch => ch.split('\n'));
|
||||
+ }
|
||||
+
|
||||
+ private requestChangelog() {
|
||||
+ this.changeProxy_.requestChangelog().then(
|
||||
+ this.updateChangelogState.bind(this));
|
||||
+ }
|
||||
+
|
||||
+ private onAcknowledgedChangelog_() {
|
||||
+ this.changeProxy_.acknowledgeChanges(this.ignoreChecked_);
|
||||
+ this.requestChangelog();
|
||||
+ }
|
||||
+
|
||||
+ override ready() {
|
||||
+ super.ready();
|
||||
+ this.requestChangelog();
|
||||
+ }
|
||||
+
|
||||
+ protected onOriginOverrideKeydown_(event: KeyboardEvent) {
|
||||
+ const target = event.target as CrInputElement;
|
||||
+
|
||||
@@ -299,11 +393,13 @@
|
||||
#include "components/policy/core/common/policy_pref_names.h"
|
||||
#include "components/pref_registry/pref_registry_syncable.h"
|
||||
#include "components/prefs/pref_registry_simple.h"
|
||||
@@ -204,6 +205,11 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
@@ -204,6 +205,13 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
false);
|
||||
#endif
|
||||
|
||||
+ {
|
||||
+ registry->RegisterIntegerPref(prefs::kHeliumSchemaVersion, 0);
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumDisableSchemaAlerts, false);
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumServicesEnabled, true);
|
||||
+ registry->RegisterStringPref(prefs::kHeliumServicesOrigin, "");
|
||||
+ }
|
||||
@@ -336,7 +432,7 @@
|
||||
settings_api::PrefType::kBoolean;
|
||||
--- /dev/null
|
||||
+++ b/components/helium_services/BUILD.gn
|
||||
@@ -0,0 +1,20 @@
|
||||
@@ -0,0 +1,22 @@
|
||||
+# 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.
|
||||
@@ -346,6 +442,8 @@
|
||||
+ "helium_services_helpers.cc",
|
||||
+ "helium_services_helpers.h",
|
||||
+ "pref_names.h",
|
||||
+ "schema.cc",
|
||||
+ "schema.h",
|
||||
+ ]
|
||||
+
|
||||
+ public_deps = [
|
||||
@@ -359,7 +457,7 @@
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -0,0 +1,66 @@
|
||||
@@ -0,0 +1,67 @@
|
||||
+// 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.
|
||||
@@ -422,13 +520,14 @@
|
||||
+ PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
+ registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
+ registrar.Add(prefs::kHeliumServicesOrigin, observer);
|
||||
+ registrar.Add(prefs::kHeliumSchemaVersion, observer);
|
||||
+ registrar.Add(pref_name, observer);
|
||||
+}
|
||||
+
|
||||
+} // namespace helium
|
||||
--- /dev/null
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -0,0 +1,28 @@
|
||||
@@ -0,0 +1,30 @@
|
||||
+// 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.
|
||||
@@ -449,6 +548,8 @@
|
||||
+const char kHeliumDummyOrigin[] =
|
||||
+ "https://helium-services-are-disabled.qjz9zk";
|
||||
+
|
||||
+bool ShouldAccessServices(const PrefService& prefs);
|
||||
+
|
||||
+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_);
|
||||
@@ -459,7 +560,7 @@
|
||||
+#endif // COMPONENTS_HELIUM_SERVICES_HELIUM_SERVICES_HELPERS_H_
|
||||
--- /dev/null
|
||||
+++ b/components/helium_services/pref_names.h
|
||||
@@ -0,0 +1,18 @@
|
||||
@@ -0,0 +1,24 @@
|
||||
+// 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.
|
||||
@@ -469,6 +570,12 @@
|
||||
+
|
||||
+namespace prefs {
|
||||
+
|
||||
+inline constexpr char kHeliumSchemaVersion[] =
|
||||
+ "helium.services.schema_version";
|
||||
+
|
||||
+inline constexpr char kHeliumDisableSchemaAlerts[] =
|
||||
+ "helium.services.disable_schema_alerts";
|
||||
+
|
||||
+inline constexpr char kHeliumServicesEnabled[] =
|
||||
+ "helium.services.enabled";
|
||||
+
|
||||
@@ -478,3 +585,252 @@
|
||||
+} // namespace prefs
|
||||
+
|
||||
+#endif // COMPONENTS_HELIUM_SERVICES_PREF_NAMES_H_
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/changelog_proxy.ts
|
||||
@@ -0,0 +1,40 @@
|
||||
+// 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.
|
||||
+
|
||||
+/**
|
||||
+ * @fileoverview A helper object used from the "Helium services" section
|
||||
+ * to request a changelog (if one exists).
|
||||
+ */
|
||||
+
|
||||
+// clang-format off
|
||||
+import {sendWithPromise} from 'chrome://resources/js/cr.js';
|
||||
+// clang-format on
|
||||
+
|
||||
+export interface HeliumServicesChangeHandler {
|
||||
+ // Get the pending changes to Helium services to announce
|
||||
+ // to the user.
|
||||
+ requestChangelog(): Promise<string[]>;
|
||||
+ acknowledgeChanges(ignoreAllChangelogs: boolean): void;
|
||||
+}
|
||||
+
|
||||
+export class HeliumServicesChangeHandlerImpl implements
|
||||
+ HeliumServicesChangeHandler {
|
||||
+ requestChangelog() {
|
||||
+ return sendWithPromise('getServicesSchemaChangelog');
|
||||
+ }
|
||||
+
|
||||
+ acknowledgeChanges(ignoreAllChangelogs: boolean) {
|
||||
+ chrome.send('updateServicesSchemaVersion', [ignoreAllChangelogs]);
|
||||
+ }
|
||||
+
|
||||
+ static getInstance(): HeliumServicesChangeHandler {
|
||||
+ return instance || (instance = new HeliumServicesChangeHandlerImpl());
|
||||
+ }
|
||||
+
|
||||
+ static setInstance(obj: HeliumServicesChangeHandler) {
|
||||
+ instance = obj;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+let instance: HeliumServicesChangeHandler|null = null;
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/webui/settings/services_schema_handler.h
|
||||
@@ -0,0 +1,36 @@
|
||||
+// Copyright 2025 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SERVICES_SCHEMA_HANDLER_H_
|
||||
+#define CHROME_BROWSER_UI_WEBUI_SETTINGS_SERVICES_SCHEMA_HANDLER_H_
|
||||
+
|
||||
+#include <optional>
|
||||
+#include <string>
|
||||
+
|
||||
+#include "base/memory/raw_ptr.h"
|
||||
+#include "base/values.h"
|
||||
+#include "content/public/browser/web_ui_message_handler.h"
|
||||
+
|
||||
+class Profile;
|
||||
+class PrefService;
|
||||
+
|
||||
+class HeliumServicesSchemaHandler : public content::WebUIMessageHandler {
|
||||
+ public:
|
||||
+ explicit HeliumServicesSchemaHandler(Profile* profile);
|
||||
+ HeliumServicesSchemaHandler(const HeliumServicesSchemaHandler&) = delete;
|
||||
+ HeliumServicesSchemaHandler& operator=(const HeliumServicesSchemaHandler&) =
|
||||
+ delete;
|
||||
+ ~HeliumServicesSchemaHandler() override;
|
||||
+
|
||||
+ // SettingsPageUIHandler:
|
||||
+ void RegisterMessages() override;
|
||||
+
|
||||
+ private:
|
||||
+ void HandleChangelogRequest(const base::Value::List&);
|
||||
+ void HandleChangelogAcknowledgment(const base::Value::List&);
|
||||
+
|
||||
+ raw_ptr<PrefService> pref_service_ = nullptr;
|
||||
+};
|
||||
+
|
||||
+#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SERVICES_SCHEMA_HANDLER_H_
|
||||
--- /dev/null
|
||||
+++ b/components/helium_services/schema.cc
|
||||
@@ -0,0 +1,40 @@
|
||||
+// 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.
|
||||
+
|
||||
+#include "components/helium_services/schema.h"
|
||||
+
|
||||
+#include "components/helium_services/helium_services_helpers.h"
|
||||
+#include "components/helium_services/pref_names.h"
|
||||
+#include "components/prefs/pref_service.h"
|
||||
+
|
||||
+namespace helium {
|
||||
+
|
||||
+bool HasAcceptedSchema(const PrefService& prefs, int version) {
|
||||
+ return prefs.GetBoolean(prefs::kHeliumDisableSchemaAlerts) ||
|
||||
+ prefs.GetInteger(prefs::kHeliumSchemaVersion) >= version;
|
||||
+}
|
||||
+
|
||||
+void AcceptCurrentSchema(PrefService& prefs) {
|
||||
+ prefs.SetInteger(prefs::kHeliumSchemaVersion, kHeliumCurrentSchemaVersion);
|
||||
+}
|
||||
+
|
||||
+bool ShouldShowSchemaNotification(const PrefService& prefs) {
|
||||
+ return ShouldAccessServices(prefs) &&
|
||||
+ !HasAcceptedSchema(prefs, kHeliumCurrentSchemaVersion);
|
||||
+}
|
||||
+
|
||||
+ServicesChangelog& GetChangelog() {
|
||||
+ static constexpr auto kHeliumSchemaChangelog =
|
||||
+ base::MakeFixedFlatMap<int, std::string_view>({
|
||||
+ {
|
||||
+ 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."
|
||||
+ }
|
||||
+ });
|
||||
+
|
||||
+ return kHeliumSchemaChangelog;
|
||||
+}
|
||||
+
|
||||
+} // namespace helium
|
||||
--- /dev/null
|
||||
+++ b/components/helium_services/schema.h
|
||||
@@ -0,0 +1,30 @@
|
||||
+// Copyright 2025 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+#ifndef COMPONENTS_HELIUM_SERVICES_SCHEMA_H_
|
||||
+#define COMPONENTS_HELIUM_SERVICES_SCHEMA_H_
|
||||
+
|
||||
+#include "base/component_export.h"
|
||||
+#include "base/containers/fixed_flat_map.h"
|
||||
+#include "components/prefs/pref_service.h"
|
||||
+
|
||||
+namespace helium {
|
||||
+
|
||||
+inline constexpr int kHeliumCurrentSchemaVersion = 1;
|
||||
+
|
||||
+using ServicesChangelog = const base::
|
||||
+ fixed_flat_map<int, std::string_view, kHeliumCurrentSchemaVersion>;
|
||||
+
|
||||
+#define EX COMPONENT_EXPORT(HELIUM)
|
||||
+
|
||||
+EX bool HasAcceptedSchema(const PrefService& prefs, int version);
|
||||
+EX void AcceptCurrentSchema(PrefService& prefs);
|
||||
+EX bool ShouldShowSchemaNotification(const PrefService& prefs);
|
||||
+EX ServicesChangelog& GetChangelog();
|
||||
+
|
||||
+#undef EX
|
||||
+
|
||||
+} // namespace helium
|
||||
+
|
||||
+#endif // COMPONENTS_HELIUM_SERVICES_SCHEMA_H_
|
||||
--- a/chrome/browser/ui/BUILD.gn
|
||||
+++ b/chrome/browser/ui/BUILD.gn
|
||||
@@ -1296,6 +1296,8 @@ static_library("ui") {
|
||||
"webui/settings/saved_info_handler.h",
|
||||
"webui/settings/search_engines_handler.cc",
|
||||
"webui/settings/search_engines_handler.h",
|
||||
+ "webui/settings/services_schema_handler.cc",
|
||||
+ "webui/settings/services_schema_handler.h",
|
||||
"webui/settings/settings_clear_browsing_data_handler.cc",
|
||||
"webui/settings/settings_clear_browsing_data_handler.h",
|
||||
"webui/settings/settings_localized_strings_privacy_sandbox_provider.cc",
|
||||
--- /dev/null
|
||||
+++ b/chrome/browser/ui/webui/settings/services_schema_handler.cc
|
||||
@@ -0,0 +1,58 @@
|
||||
+// 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.
|
||||
+
|
||||
+#include "chrome/browser/ui/webui/settings/services_schema_handler.h"
|
||||
+
|
||||
+#include "base/functional/bind.h"
|
||||
+#include "base/values.h"
|
||||
+#include "chrome/browser/profiles/profile.h"
|
||||
+#include "components/helium_services/pref_names.h"
|
||||
+#include "components/helium_services/schema.h"
|
||||
+#include "components/prefs/pref_service.h"
|
||||
+
|
||||
+HeliumServicesSchemaHandler::HeliumServicesSchemaHandler(Profile* profile)
|
||||
+ : pref_service_(profile->GetPrefs()) {}
|
||||
+
|
||||
+HeliumServicesSchemaHandler::~HeliumServicesSchemaHandler() = default;
|
||||
+
|
||||
+void HeliumServicesSchemaHandler::RegisterMessages() {
|
||||
+ web_ui()->RegisterMessageCallback(
|
||||
+ "getServicesSchemaChangelog",
|
||||
+ base::BindRepeating(&HeliumServicesSchemaHandler::HandleChangelogRequest,
|
||||
+ base::Unretained(this)));
|
||||
+ web_ui()->RegisterMessageCallback(
|
||||
+ "updateServicesSchemaVersion",
|
||||
+ base::BindRepeating(
|
||||
+ &HeliumServicesSchemaHandler::HandleChangelogAcknowledgment,
|
||||
+ base::Unretained(this)));
|
||||
+}
|
||||
+
|
||||
+void HeliumServicesSchemaHandler::HandleChangelogRequest(
|
||||
+ const base::Value::List& args) {
|
||||
+ CHECK_EQ(1U, args.size());
|
||||
+ const auto& callback_id = args[0].GetString();
|
||||
+ base::Value::List out;
|
||||
+
|
||||
+ if (helium::ShouldShowSchemaNotification(*pref_service_)) {
|
||||
+ int user_version = pref_service_->GetInteger(prefs::kHeliumSchemaVersion);
|
||||
+ auto& changelog = helium::GetChangelog();
|
||||
+
|
||||
+ for (auto it = changelog.upper_bound(user_version); it != changelog.end();
|
||||
+ ++it) {
|
||||
+ out.Append(it->second);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ AllowJavascript();
|
||||
+ ResolveJavascriptCallback(base::Value(callback_id), std::move(out));
|
||||
+}
|
||||
+
|
||||
+void HeliumServicesSchemaHandler::HandleChangelogAcknowledgment(
|
||||
+ const base::Value::List& args) {
|
||||
+ CHECK_EQ(1U, args.size());
|
||||
+ bool ignore_alerts = args[0].GetBool();
|
||||
+
|
||||
+ helium::AcceptCurrentSchema(*pref_service_);
|
||||
+ pref_service_->SetBoolean(prefs::kHeliumDisableSchemaAlerts, ignore_alerts);
|
||||
+}
|
||||
--- a/chrome/browser/ui/webui/settings/settings_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_ui.cc
|
||||
@@ -76,6 +76,7 @@
|
||||
#include "chrome/browser/ui/webui/settings/safety_hub_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/saved_info_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/search_engines_handler.h"
|
||||
+#include "chrome/browser/ui/webui/settings/services_schema_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h"
|
||||
#include "chrome/browser/ui/webui/settings/settings_localized_strings_provider.h"
|
||||
#include "chrome/browser/ui/webui/settings/settings_media_devices_selection_handler.h"
|
||||
@@ -252,6 +253,8 @@ SettingsUI::SettingsUI(content::WebUI* w
|
||||
AddSettingsPageUIHandler(std::make_unique<ProtocolHandlersHandler>(profile));
|
||||
AddSettingsPageUIHandler(std::make_unique<PrivacySandboxHandler>());
|
||||
AddSettingsPageUIHandler(std::make_unique<SearchEnginesHandler>(profile));
|
||||
+ AddSettingsPageUIHandler(
|
||||
+ std::make_unique<HeliumServicesSchemaHandler>(profile));
|
||||
AddSettingsPageUIHandler(std::make_unique<SecureDnsHandler>());
|
||||
AddSettingsPageUIHandler(std::make_unique<SiteSettingsHandler>(profile));
|
||||
AddSettingsPageUIHandler(std::make_unique<StartupPagesHandler>(web_ui));
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
--- a/chrome/app/chromium_strings.grd
|
||||
+++ b/chrome/app/chromium_strings.grd
|
||||
@@ -956,6 +956,10 @@ Chromium is unable to recover your setti
|
||||
Customize and control Chromium. Update is available.
|
||||
</message>
|
||||
|
||||
+ <message name="IDS_APPMENU_TOOLTIP_HELIUM_SERVICES_UPDATE" desc="The tooltip to show for the browser menu when Helium services schema changes">
|
||||
+ Helium services have been updated. Please review the changes.
|
||||
+ </message>
|
||||
+
|
||||
<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>
|
||||
@@ -1620,6 +1624,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>
|
||||
|
||||
+ <!-- Helium services schema change bubble -->
|
||||
+ <message name="IDS_HELIUM_SERVICES_SCHEMA_MENU_ITEM" desc="Text for the bubble that notifies the user of a schema change in Helium services.">
|
||||
+ Review Helium services updates
|
||||
+ </message>
|
||||
+
|
||||
<!-- User menu errors -->
|
||||
<message name="IDS_SYNC_ERROR_USER_MENU_UPGRADE_BUTTON" desc="Button in the header of desktop user menu that prompts the user to update Chrome to fix the out-of-date Chrome client error.">
|
||||
Update Chromium
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -13186,6 +13186,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>
|
||||
+ <message name="IDS_APP_MENU_BUTTON_HELIUM_SERVICES_UPDATE" desc="Short label next to app-menu button when Helium services behavior changes.">
|
||||
+ Services updated
|
||||
+ </message>
|
||||
<if expr="is_win or is_macosx or is_linux">
|
||||
<message name="IDS_APP_MENU_BUTTON_UPDATE_ALT1" desc="Alternate short label next to app-menu button when an update is available.">
|
||||
Finish update
|
||||
--- a/chrome/app/chrome_command_ids.h
|
||||
+++ b/chrome/app/chrome_command_ids.h
|
||||
@@ -301,6 +301,7 @@
|
||||
#define IDC_SHOW_COMMENTS_SIDE_PANEL 40297
|
||||
#define IDC_RECENT_TABS_SEE_DEVICE_TABS 40298
|
||||
#define IDC_SHOW_AI_MODE_OMNIBOX_BUTTON 40299
|
||||
+#define IDC_HELIUM_SERVICES_OPEN 40300
|
||||
|
||||
// Spell-check
|
||||
// Insert any additional suggestions before _LAST; these have to be consecutive.
|
||||
--- a/chrome/browser/ui/chrome_pages.h
|
||||
+++ b/chrome/browser/ui/chrome_pages.h
|
||||
@@ -138,6 +138,7 @@ void ShowSafeBrowsingEnhancedProtectionW
|
||||
safe_browsing::SafeBrowsingSettingReferralMethod referral_method);
|
||||
void ShowImportDialog(Browser* browser);
|
||||
void ShowAboutChrome(Browser* browser);
|
||||
+void ShowHeliumServices(Browser* browser);
|
||||
void ShowSearchEngineSettings(Browser* browser);
|
||||
void ShowWebStore(Browser* browser, std::string_view utm_source_value);
|
||||
void ShowPrivacySandboxSettings(Browser* browser);
|
||||
--- a/chrome/browser/ui/chrome_pages.cc
|
||||
+++ b/chrome/browser/ui/chrome_pages.cc
|
||||
@@ -615,6 +615,11 @@ void ShowAboutChrome(Browser* browser) {
|
||||
ShowSingletonTabIgnorePathOverwriteNTP(browser, GURL(kChromeUIHelpURL));
|
||||
}
|
||||
|
||||
+void ShowHeliumServices(Browser* browser) {
|
||||
+ ShowSingletonTabIgnorePathOverwriteNTP(
|
||||
+ browser, GURL("chrome://settings/privacy/services"));
|
||||
+}
|
||||
+
|
||||
void ShowSearchEngineSettings(Browser* browser) {
|
||||
base::RecordAction(UserMetricsAction("EditSearchEngines"));
|
||||
ShowSettingsSubPage(browser, kSearchEnginesSubPage);
|
||||
--- a/chrome/browser/ui/browser_command_controller.cc
|
||||
+++ b/chrome/browser/ui/browser_command_controller.cc
|
||||
@@ -1067,6 +1067,9 @@ bool BrowserCommandController::ExecuteCo
|
||||
case IDC_UPGRADE_DIALOG:
|
||||
OpenUpdateChromeDialog(browser_);
|
||||
break;
|
||||
+ case IDC_HELIUM_SERVICES_OPEN:
|
||||
+ ShowHeliumServices(browser_->GetBrowserForOpeningWebUi());
|
||||
+ break;
|
||||
case IDC_OPEN_SAFETY_HUB:
|
||||
ShowSettingsSubPage(browser_->GetBrowserForOpeningWebUi(),
|
||||
chrome::kSafetyHubSubPage);
|
||||
@@ -1631,6 +1634,7 @@ 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);
|
||||
command_updater_.UpdateCommandEnabled(IDC_SET_BROWSER_AS_DEFAULT, true);
|
||||
|
||||
// Safety Hub commands.
|
||||
--- a/chrome/browser/ui/toolbar/app_menu_model.h
|
||||
+++ b/chrome/browser/ui/toolbar/app_menu_model.h
|
||||
@@ -281,6 +281,9 @@ class AppMenuModel : public ui::SimpleMe
|
||||
// boolean indicating whether any menu items were added.
|
||||
bool AddDefaultBrowserMenuItems();
|
||||
|
||||
+ // Adds a nag to review Helium services permission changes
|
||||
+ bool AddHeliumSchemaItem();
|
||||
+
|
||||
// Adds the Safety Hub menu notifications to the menu. Returns a boolean
|
||||
// indicating whether any menu items were added.
|
||||
[[nodiscard]] bool AddSafetyHubMenuItem();
|
||||
--- a/chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
+++ b/chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
@@ -104,6 +104,7 @@
|
||||
#include "components/dom_distiller/core/url_utils.h"
|
||||
#include "components/feature_engagement/public/event_constants.h"
|
||||
#include "components/feature_engagement/public/feature_constants.h"
|
||||
+#include "components/helium_services/schema.h"
|
||||
#include "components/lens/lens_features.h"
|
||||
#include "components/omnibox/browser/vector_icons.h"
|
||||
#include "components/password_manager/content/common/web_ui_constants.h"
|
||||
@@ -2062,7 +2063,8 @@ bool AppMenuModel::AddGlobalErrorMenuIte
|
||||
// how update the menu if new errors are added.
|
||||
const GlobalErrorService::GlobalErrorList& errors =
|
||||
GlobalErrorServiceFactory::GetForProfile(browser_->profile())->errors();
|
||||
- bool menu_items_added = false;
|
||||
+ bool menu_items_added = AddHeliumSchemaItem();
|
||||
+
|
||||
for (GlobalError* error : errors) {
|
||||
DCHECK(error);
|
||||
if (error->HasMenuItem()) {
|
||||
@@ -2126,6 +2128,22 @@ bool AppMenuModel::AddSafetyHubMenuItem(
|
||||
return true;
|
||||
}
|
||||
|
||||
+bool AppMenuModel::AddHeliumSchemaItem() {
|
||||
+ if (!helium::ShouldShowSchemaNotification(
|
||||
+ *browser()->profile()->GetPrefs())) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ const auto update_icon = ui::ImageModel::FromVectorIcon(
|
||||
+ omnibox::kProductChromeRefreshIcon, ui::kColorMenuIcon, kDefaultIconSize);
|
||||
+ AddItemWithIcon(
|
||||
+ IDC_HELIUM_SERVICES_OPEN,
|
||||
+ l10n_util::GetStringUTF16(IDS_HELIUM_SERVICES_SCHEMA_MENU_ITEM),
|
||||
+ update_icon);
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
void AppMenuModel::UpdateSettingsItemState() {
|
||||
bool is_disabled =
|
||||
--- a/chrome/browser/ui/toolbar/app_menu_icon_controller.cc
|
||||
+++ b/chrome/browser/ui/toolbar/app_menu_icon_controller.cc
|
||||
@@ -8,11 +8,15 @@
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/app/vector_icons/vector_icons.h"
|
||||
#include "chrome/browser/defaults.h"
|
||||
+#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/ui/global_error/global_error.h"
|
||||
#include "chrome/browser/ui/global_error/global_error_service_factory.h"
|
||||
#include "chrome/browser/ui/ui_features.h"
|
||||
#include "chrome/browser/upgrade_detector/upgrade_detector.h"
|
||||
#include "chrome/common/channel_info.h"
|
||||
+#include "components/helium_services/pref_names.h"
|
||||
+#include "components/helium_services/schema.h"
|
||||
+#include "components/prefs/pref_change_registrar.h"
|
||||
#include "components/version_info/channel.h"
|
||||
#include "ui/gfx/paint_vector_icon.h"
|
||||
|
||||
@@ -109,6 +113,14 @@ AppMenuIconController::AppMenuIconContro
|
||||
GlobalErrorServiceFactory::GetForProfile(profile_));
|
||||
|
||||
upgrade_detector_->AddObserver(this);
|
||||
+
|
||||
+ if (auto* prefs = profile->GetPrefs()) {
|
||||
+ registrar_.Init(prefs);
|
||||
+ registrar_.Add(
|
||||
+ prefs::kHeliumSchemaVersion,
|
||||
+ base::BindRepeating(&AppMenuIconController::OnGlobalErrorsChanged,
|
||||
+ base::Unretained(this)));
|
||||
+ }
|
||||
}
|
||||
|
||||
AppMenuIconController::~AppMenuIconController() {
|
||||
@@ -141,6 +153,12 @@ AppMenuIconController::GetTypeAndSeverit
|
||||
->GetHighestSeverityGlobalErrorWithAppMenuItem()) {
|
||||
return {IconType::kGlobalError, SeverityFromError(error)};
|
||||
}
|
||||
+
|
||||
+ if (auto* prefs = profile_->GetPrefs()) {
|
||||
+ if (helium::ShouldShowSchemaNotification(*prefs)) {
|
||||
+ return {IconType::kHeliumServicesUpdate, Severity::kLow};
|
||||
+ }
|
||||
+ }
|
||||
#endif
|
||||
|
||||
return {IconType::kNone, Severity::kNone};
|
||||
--- a/chrome/browser/ui/toolbar/app_menu_icon_controller.h
|
||||
+++ b/chrome/browser/ui/toolbar/app_menu_icon_controller.h
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "chrome/browser/ui/global_error/global_error_observer.h"
|
||||
#include "chrome/browser/ui/global_error/global_error_service.h"
|
||||
#include "chrome/browser/upgrade_detector/upgrade_observer.h"
|
||||
+#include "components/prefs/pref_change_registrar.h"
|
||||
#include "third_party/skia/include/core/SkColor.h"
|
||||
#include "ui/base/models/image_model.h"
|
||||
|
||||
@@ -29,6 +30,7 @@ class AppMenuIconController : public Glo
|
||||
enum class IconType {
|
||||
kNone,
|
||||
kUpgradeNotification,
|
||||
+ kHeliumServicesUpdate,
|
||||
kGlobalError,
|
||||
};
|
||||
enum class Severity {
|
||||
@@ -93,6 +95,7 @@ class AppMenuIconController : public Glo
|
||||
const raw_ptr<Delegate> delegate_;
|
||||
base::ScopedObservation<GlobalErrorService, GlobalErrorObserver>
|
||||
global_error_observation_{this};
|
||||
+ PrefChangeRegistrar registrar_;
|
||||
};
|
||||
|
||||
#endif // CHROME_BROWSER_UI_TOOLBAR_APP_MENU_ICON_CONTROLLER_H_
|
||||
--- a/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc
|
||||
+++ b/chrome/browser/ui/views/toolbar/browser_app_menu_button.cc
|
||||
@@ -214,6 +214,11 @@ void BrowserAppMenuButton::UpdateTextAnd
|
||||
#else
|
||||
text = l10n_util::GetStringUTF16(IDS_APP_MENU_BUTTON_UPDATE);
|
||||
#endif
|
||||
+ } else if (type_and_severity_.type ==
|
||||
+ AppMenuIconController::IconType::kHeliumServicesUpdate) {
|
||||
+ tooltip_message_id = IDS_APPMENU_TOOLTIP_HELIUM_SERVICES_UPDATE;
|
||||
+ text =
|
||||
+ l10n_util::GetStringUTF16(IDS_APP_MENU_BUTTON_HELIUM_SERVICES_UPDATE);
|
||||
} else {
|
||||
tooltip_message_id = IDS_APPMENU_TOOLTIP_ALERT;
|
||||
const int text_id =
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -104,14 +104,14 @@ BASE_FEATURE(kReloadSelectionModel, base
|
||||
@@ -103,14 +103,14 @@ BASE_FEATURE(kReloadSelectionModel, base
|
||||
// Enforces close tab hotkey to only close the active view of a split tab,
|
||||
// when it is the only tab in selection model.
|
||||
BASE_FEATURE(kCloseActiveTabInSplitViewViaHotkey,
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
// The delay before showing the drop target for the side-by-side drag-and-drop
|
||||
// entrypoint.
|
||||
@@ -149,17 +149,17 @@ BASE_FEATURE_PARAM(int,
|
||||
@@ -148,17 +148,17 @@ BASE_FEATURE_PARAM(int,
|
||||
kSideBySideDropTargetMinWidth,
|
||||
&kSideBySide,
|
||||
"drop_target_min_width",
|
||||
@@ -38,7 +38,7 @@
|
||||
BASE_FEATURE_PARAM(int,
|
||||
kSideBySideDropTargetForLinkTargetWidthPercentage,
|
||||
&kSideBySide,
|
||||
@@ -265,7 +265,7 @@ BASE_FEATURE_PARAM(int,
|
||||
@@ -264,7 +264,7 @@ BASE_FEATURE_PARAM(int,
|
||||
|
||||
// When enabled along with SideBySide flag, split tabs will be restored on
|
||||
// startup.
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
bool IsRestoringSplitViewEnabled() {
|
||||
return base::FeatureList::IsEnabled(features::kSideBySide) &&
|
||||
@@ -274,7 +274,7 @@ bool IsRestoringSplitViewEnabled() {
|
||||
@@ -273,7 +273,7 @@ bool IsRestoringSplitViewEnabled() {
|
||||
|
||||
BASE_FEATURE(kSideBySideLinkMenuNewBadge, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -21,12 +21,14 @@ const char kHeliumDummyOrigin[] =
|
||||
@@ -23,12 +23,14 @@ 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);
|
||||
@@ -46,7 +46,7 @@
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
--- a/components/helium_services/pref_names.h
|
||||
+++ b/components/helium_services/pref_names.h
|
||||
@@ -33,6 +33,8 @@ inline constexpr char kHeliumUpdateFetch
|
||||
@@ -39,6 +39,8 @@ inline constexpr char kHeliumUpdateFetch
|
||||
inline constexpr char kHeliumSpellcheckEnabled[] =
|
||||
"helium.services.spellcheck_files";
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
(*s_allowlist)[::prefs::kHeliumServicesConsented] =
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -218,6 +218,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
@@ -220,6 +220,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
registry->RegisterBooleanPref(prefs::kHeliumDidOnboarding, false);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumServicesConsented, false);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumUpdateFetchingEnabled, true);
|
||||
@@ -217,10 +217,10 @@
|
||||
if ( bin.assetSourceRegistry instanceof Object ) {
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -2002,6 +2002,12 @@
|
||||
<message name="IDS_SETTINGS_HELIUM_SERVICES_UPDATE_DESCRIPTION" desc="Description of the toggle for automatic update downloads">
|
||||
Helium will automatically download and install browser updates as they become available. We recommend keeping this setting enabled to ensure you get the latest security patches and features.
|
||||
</message>
|
||||
@@ -2018,6 +2018,12 @@
|
||||
Helium will automatically download and install browser and component updates as they become available. We recommend keeping this setting enabled to ensure you get the latest features and security updates. Automatic core browser updates are not available on this platform yet, but component updates are. Please use external software to keep Helium up to date.
|
||||
</message>
|
||||
</if>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_UBO" desc="Description of the toggle for uBO filter lists">
|
||||
+ Allow downloading filter lists for uBlock Origin
|
||||
+ </message>
|
||||
@@ -232,10 +232,10 @@
|
||||
</message>
|
||||
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
@@ -69,6 +69,11 @@
|
||||
sub-label="$i18n{heliumUpdatesToggleDescription}">
|
||||
</settings-toggle-button>
|
||||
</if>
|
||||
@@ -109,6 +109,11 @@
|
||||
label="$i18n{heliumUpdatesToggle}"
|
||||
sub-label="$i18n{heliumUpdatesToggleDescription}">
|
||||
</settings-toggle-button>
|
||||
+ <settings-toggle-button id="filterlistToggleButton"
|
||||
+ pref="{{prefs.helium.services.ublock_assets}}"
|
||||
+ label="$i18n{heliumUboToggle}"
|
||||
@@ -246,7 +246,7 @@
|
||||
</template>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -2139,6 +2139,10 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
@@ -2144,6 +2144,10 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
IDS_SETTINGS_HELIUM_SERVICES_UPDATE},
|
||||
{"heliumUpdatesToggleDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_UPDATE_DESCRIPTION},
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
location <= mojom::ManifestLocation::kMaxValue;
|
||||
--- a/chrome/browser/chrome_content_browser_client.cc
|
||||
+++ b/chrome/browser/chrome_content_browser_client.cc
|
||||
@@ -6194,7 +6194,8 @@ void AddChromeSchemeFactories(
|
||||
@@ -6212,7 +6212,8 @@ void AddChromeSchemeFactories(
|
||||
std::vector<std::string> allowed_webui_hosts;
|
||||
// Support for chrome:// scheme if appropriate.
|
||||
if ((extension->is_extension() || extension->is_platform_app()) &&
|
||||
|
||||
@@ -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>
|
||||
@@ -3207,6 +3210,9 @@
|
||||
@@ -3223,6 +3226,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>
|
||||
@@ -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.
|
||||
@@ -2829,7 +2829,7 @@ void AddSiteSettingsStrings(content::Web
|
||||
@@ -2834,7 +2834,7 @@ void AddSiteSettingsStrings(content::Web
|
||||
{"trackingProtectionSitesAllowedCookiesTitle",
|
||||
IDS_SETTINGS_TRACKING_PROTECTION_SITES_ALLOWED_COOKIES_TITLE},
|
||||
{"trackingProtectionSitesAllowedCookiesDescription",
|
||||
|
||||
@@ -52,10 +52,10 @@
|
||||
-#else
|
||||
text = l10n_util::GetStringUTF16(IDS_APP_MENU_BUTTON_UPDATE);
|
||||
-#endif
|
||||
} else {
|
||||
tooltip_message_id = IDS_APPMENU_TOOLTIP_ALERT;
|
||||
const int text_id =
|
||||
@@ -228,37 +199,19 @@ void BrowserAppMenuButton::UpdateTextAnd
|
||||
} else if (type_and_severity_.type ==
|
||||
AppMenuIconController::IconType::kHeliumServicesUpdate) {
|
||||
tooltip_message_id = IDS_APPMENU_TOOLTIP_HELIUM_SERVICES_UPDATE;
|
||||
@@ -233,37 +204,19 @@ void BrowserAppMenuButton::UpdateTextAnd
|
||||
}
|
||||
|
||||
bool BrowserAppMenuButton::ShouldPaintBorder() const {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
+++ b/chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
@@ -739,9 +739,6 @@ SaveAndShareSubMenuModel::SaveAndShareSu
|
||||
@@ -740,9 +740,6 @@ SaveAndShareSubMenuModel::SaveAndShareSu
|
||||
if (!sharing_hub::SharingIsDisabledByPolicy(browser->profile())) {
|
||||
AddItemWithStringIdAndVectorIcon(
|
||||
this, IDC_COPY_URL, IDS_APP_MENU_COPY_LINK, kLinkChromeRefreshIcon);
|
||||
@@ -10,7 +10,7 @@
|
||||
AddItemWithStringIdAndVectorIcon(this, IDC_QRCODE_GENERATOR,
|
||||
IDS_APP_MENU_CREATE_QR_CODE,
|
||||
kQrCodeChromeRefreshIcon);
|
||||
@@ -885,14 +882,6 @@ void ToolsMenuModel::Build(Browser* brow
|
||||
@@ -886,14 +883,6 @@ void ToolsMenuModel::Build(Browser* brow
|
||||
AddItemWithStringIdAndVectorIcon(this, IDC_NAME_WINDOW, IDS_NAME_WINDOW,
|
||||
kNameWindowIcon);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
if (base::FeatureList::IsEnabled(contextual_tasks::kContextualTasks)) {
|
||||
AddItemWithStringIdAndVectorIcon(
|
||||
this, IDC_SHOW_CONTEXTUAL_TASKS_SIDE_PANEL,
|
||||
@@ -901,15 +890,6 @@ void ToolsMenuModel::Build(Browser* brow
|
||||
@@ -902,15 +891,6 @@ void ToolsMenuModel::Build(Browser* brow
|
||||
|
||||
AddSeparator(ui::NORMAL_SEPARATOR);
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
AddItemWithStringIdAndVectorIcon(this, IDC_PERFORMANCE, IDS_SHOW_PERFORMANCE,
|
||||
kPerformanceIcon);
|
||||
SetElementIdentifierAt(GetIndexOfCommandId(IDC_PERFORMANCE).value(),
|
||||
@@ -1760,22 +1740,8 @@ void AppMenuModel::Build() {
|
||||
@@ -1761,22 +1741,8 @@ void AppMenuModel::Build() {
|
||||
// Build (and, by extension, Init) should only be called once.
|
||||
DCHECK_EQ(0u, GetItemCount());
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
AddSeparator(ui::NORMAL_SEPARATOR);
|
||||
}
|
||||
|
||||
@@ -1812,43 +1778,6 @@ void AppMenuModel::Build() {
|
||||
@@ -1813,43 +1779,6 @@ void AppMenuModel::Build() {
|
||||
|
||||
AddSeparator(ui::NORMAL_SEPARATOR);
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
if (!browser_->profile()->IsOffTheRecord()) {
|
||||
auto recent_tabs_sub_menu =
|
||||
std::make_unique<RecentTabsSubMenuModel>(provider_, browser_);
|
||||
@@ -1870,7 +1799,7 @@ void AppMenuModel::Build() {
|
||||
@@ -1871,7 +1800,7 @@ void AppMenuModel::Build() {
|
||||
std::make_unique<BookmarkSubMenuModel>(this, browser_);
|
||||
|
||||
AddSubMenuWithStringIdAndVectorIcon(
|
||||
@@ -119,7 +119,7 @@
|
||||
bookmark_sub_menu_model_.get(), kBookmarksListsMenuIcon);
|
||||
SetElementIdentifierAt(GetIndexOfCommandId(IDC_BOOKMARKS_MENU).value(),
|
||||
kBookmarksMenuItem);
|
||||
@@ -1887,23 +1816,10 @@ void AppMenuModel::Build() {
|
||||
@@ -1888,23 +1817,10 @@ void AppMenuModel::Build() {
|
||||
kTabGroupsMenuItem);
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
|
||||
AddItemWithStringIdAndVectorIcon(this, IDC_CLEAR_BROWSING_DATA,
|
||||
IDS_CLEAR_BROWSING_DATA,
|
||||
@@ -1950,9 +1866,6 @@ void AppMenuModel::Build() {
|
||||
@@ -1951,9 +1867,6 @@ void AppMenuModel::Build() {
|
||||
lens::features::kLensOverlay));
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
CreateFindAndEditSubMenu();
|
||||
|
||||
sub_menus_.push_back(
|
||||
@@ -2001,6 +1914,12 @@ void AppMenuModel::Build() {
|
||||
@@ -2002,6 +1915,12 @@ void AppMenuModel::Build() {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
AddItemWithStringIdAndVectorIcon(this, IDC_OPTIONS, IDS_SETTINGS,
|
||||
kSettingsMenuIcon);
|
||||
|
||||
@@ -2096,34 +2015,21 @@ bool AppMenuModel::AddDefaultBrowserMenu
|
||||
@@ -2098,34 +2017,21 @@ bool AppMenuModel::AddDefaultBrowserMenu
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -217,12 +217,12 @@
|
||||
+ return false;
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
bool AppMenuModel::AddHeliumSchemaItem() {
|
||||
--- a/chrome/browser/ui/toolbar/app_menu_model.h
|
||||
+++ b/chrome/browser/ui/toolbar/app_menu_model.h
|
||||
@@ -281,6 +281,9 @@ class AppMenuModel : public ui::SimpleMe
|
||||
// boolean indicating whether any menu items were added.
|
||||
bool AddDefaultBrowserMenuItems();
|
||||
@@ -284,6 +284,9 @@ class AppMenuModel : public ui::SimpleMe
|
||||
// Adds a nag to review Helium services permission changes
|
||||
bool AddHeliumSchemaItem();
|
||||
|
||||
+ // Adds a nag to relaunch the browser after an update
|
||||
+ bool AddUpgradeMenuItem();
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
#include "components/search_engines/template_url_service.h"
|
||||
#include "components/search_engines/template_url_starter_pack_data.h"
|
||||
#include "components/strings/grit/components_strings.h"
|
||||
@@ -1944,7 +1945,21 @@ void AutocompleteController::UpdateKeywo
|
||||
@@ -1939,7 +1940,21 @@ void AutocompleteController::UpdateKeywo
|
||||
// - For contextual search matches, the description indicates the
|
||||
// alternative UX because they're opened in the side panel.
|
||||
i->description = template_url->AdjustedShortNameForLocaleDirection();
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
padding-top: var(--ntp-one-google-bar-height);
|
||||
--- a/chrome/browser/resources/new_tab_page/app.html
|
||||
+++ b/chrome/browser/resources/new_tab_page/app.html
|
||||
@@ -1,91 +1,4 @@
|
||||
@@ -1,92 +1,4 @@
|
||||
-<!-- #html_wrapper_imports_start
|
||||
-import {nothing} from '//resources/lit/v3_0/lit.rollup.js';
|
||||
-#html_wrapper_imports_end -->
|
||||
@@ -68,7 +68,7 @@
|
||||
- ?ntp-realbox-next-enabled="${this.ntpRealboxNextEnabled_}"
|
||||
- ?cycling-placeholders="${this.searchboxCyclingPlaceholders_}"
|
||||
- @searchbox-input-focus-changed="${this.onInputFocusChanged_}"
|
||||
- ?ntp-next-features-enabled="${this.ntpNextFeaturesEnabled_}">
|
||||
- context-menu-glif-animation-state="${this.contextMenuGlifAnimationState_}">
|
||||
- </cr-searchbox>
|
||||
- ${this.showComposebox_ ? html`
|
||||
- <cr-composebox id="composebox"
|
||||
@@ -88,7 +88,8 @@
|
||||
- ${this.lazyRender_
|
||||
- && this.ntpNextFeaturesEnabled_ && this.isActionChipsVisible_ ? html`
|
||||
- <ntp-action-chips
|
||||
- @action-chip-click="${this.openComposebox_}">
|
||||
- @action-chip-click="${this.openComposebox_}"
|
||||
- @action-chips-retrieval-state-changed="${this.onActionChipsRetrievalStateChanged_}">
|
||||
- </ntp-action-chips>
|
||||
- ` : ''}
|
||||
- ${this.lazyRender_ ? html`
|
||||
@@ -102,8 +103,8 @@
|
||||
${this.lazyRender_ ? html`
|
||||
${this.shortcutsEnabled_ ? html`
|
||||
<cr-most-visited id="mostVisited" .theme="${this.theme_?.mostVisited || null}"
|
||||
@@ -93,54 +6,7 @@ import {nothing} from '//resources/lit/v
|
||||
?expandable-tiles-enabled="${this.ntpNextFeaturesEnabled_}">
|
||||
@@ -95,54 +7,7 @@ import {nothing} from '//resources/lit/v
|
||||
max-tiles-before-show-more="${this.maxTilesBeforeShowMore_}">
|
||||
</cr-most-visited>
|
||||
` : ''}
|
||||
- ${this.middleSlotPromoEnabled_ ? html`
|
||||
@@ -157,7 +158,7 @@
|
||||
<ntp-customize-buttons id="customizeButtons"
|
||||
?modules-shown-to-user="${this.modulesShownToUser}"
|
||||
?show-background-image="${this.showBackgroundImage_}"
|
||||
@@ -162,23 +28,3 @@ import {nothing} from '//resources/lit/v
|
||||
@@ -164,23 +29,3 @@ import {nothing} from '//resources/lit/v
|
||||
` : ''}
|
||||
<div id="contentBottomSpacer"></div>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#endif /* CHROME_BROWSER_HELIUM_FLAG_ENTRIES_H_ */
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -18,6 +18,22 @@
|
||||
@@ -17,6 +17,22 @@
|
||||
|
||||
namespace features {
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
// Reparent PWA views that were moved for immersive mode.
|
||||
if (web_app_frame_toolbar_) {
|
||||
@@ -5196,6 +5202,12 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -5194,6 +5200,12 @@ void BrowserView::AddedToWidget() {
|
||||
|
||||
toolbar_->Init();
|
||||
|
||||
@@ -122,20 +122,23 @@
|
||||
// TODO(pbos): Investigate whether the side panels should be creatable when
|
||||
--- a/chrome/browser/ui/views/frame/layout/browser_view_layout_impl_old.cc
|
||||
+++ b/chrome/browser/ui/views/frame/layout/browser_view_layout_impl_old.cc
|
||||
@@ -406,6 +406,12 @@ void BrowserViewLayoutImplOld::LayoutVer
|
||||
@@ -406,6 +406,15 @@ void BrowserViewLayoutImplOld::LayoutVer
|
||||
void BrowserViewLayoutImplOld::LayoutTabStripRegion(
|
||||
gfx::Rect& available_bounds) {
|
||||
TRACE_EVENT0("ui", "BrowserViewLayout::LayoutTabStripRegion");
|
||||
+
|
||||
+ // If the CAT feature is enabled, then the tab strip is in the toolbar.
|
||||
+ // We shouldn't layout it here.
|
||||
+ if (features::IsHeliumCatEnabled()) {
|
||||
+ // If the CAT feature is enabled and we're in a normal browser,
|
||||
+ // skip laying out the tab strip region. It's laid out in the toolbar.
|
||||
+ // The tab strip isn't drawn in other browser types, so the next
|
||||
+ // if statement will hide it.
|
||||
+ if (features::IsHeliumCatEnabled() && browser()->is_type_normal()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (!delegate().ShouldDrawTabStrip()) {
|
||||
SetViewVisibility(views().tab_strip_region_view, false);
|
||||
views().tab_strip_region_view->SetBounds(0, 0, 0, 0);
|
||||
@@ -458,6 +464,15 @@ void BrowserViewLayoutImplOld::LayoutToo
|
||||
@@ -458,6 +467,15 @@ void BrowserViewLayoutImplOld::LayoutToo
|
||||
toolbar_bounds.set_x(available_bounds.x());
|
||||
toolbar_bounds.set_width(toolbar_bounds.width() - kVerticalTabStripWidth);
|
||||
views().toolbar->SetBoundsRect(toolbar_bounds);
|
||||
@@ -197,7 +200,7 @@
|
||||
show_avatar_button_.Init(
|
||||
prefs::kShowAvatarButton, prefs,
|
||||
base::BindRepeating(&ToolbarView::OnShowAvatarButtonChanged,
|
||||
@@ -573,12 +596,27 @@ void ToolbarView::Init() {
|
||||
@@ -573,12 +596,30 @@ void ToolbarView::Init() {
|
||||
|
||||
InitLayout();
|
||||
|
||||
@@ -218,14 +221,17 @@
|
||||
+ if (features::IsHeliumCatEnabled()) {
|
||||
+ pinned_toolbar_actions_container_->SetProperty(
|
||||
+ views::kFlexBehaviorKey, flex_preferred);
|
||||
+ extensions_container_->SetProperty(
|
||||
+ views::kFlexBehaviorKey, flex_preferred);
|
||||
+
|
||||
+ if (extensions_container_) {
|
||||
+ extensions_container_->SetProperty(
|
||||
+ views::kFlexBehaviorKey, flex_preferred);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (browser_view_->GetSupportsTabStrip()) {
|
||||
browser()->GetTabStripModel()->AddObserver(this);
|
||||
}
|
||||
@@ -703,6 +741,24 @@ bool ToolbarView::IsRectInWindowCaption(
|
||||
@@ -703,6 +744,24 @@ bool ToolbarView::IsRectInWindowCaption(
|
||||
return gfx::ToEnclosingRect(rect_in_target_coords_f);
|
||||
};
|
||||
|
||||
@@ -250,7 +256,7 @@
|
||||
// Check each child view in container_view_ to see if the rect intersects with
|
||||
// any clickable elements. If it does, check if the click is actually on that
|
||||
// element. False if on a clickable element, true if not on a clickable element.
|
||||
@@ -982,8 +1038,12 @@ void ToolbarView::InitLayout() {
|
||||
@@ -982,8 +1041,12 @@ void ToolbarView::InitLayout() {
|
||||
constexpr int kToolbarActionsFlexOrder = kOrderOffset + 2;
|
||||
constexpr int kExtensionsFlexOrder = kOrderOffset + 3;
|
||||
|
||||
@@ -264,7 +270,7 @@
|
||||
views::MaximumFlexSizeRule::kUnbounded)
|
||||
.WithOrder(kLocationBarFlexOrder);
|
||||
|
||||
@@ -999,6 +1059,12 @@ void ToolbarView::InitLayout() {
|
||||
@@ -999,6 +1062,12 @@ void ToolbarView::InitLayout() {
|
||||
location_bar_->SetProperty(views::kMarginsKey,
|
||||
gfx::Insets::VH(0, location_bar_margin));
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
--- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_utils.h
|
||||
+++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_utils.h
|
||||
@@ -11,7 +11,7 @@ class ToolbarButton;
|
||||
class ToolbarButtonProvider;
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
-inline constexpr int kWebAppMenuMargin = 7;
|
||||
+inline constexpr int kWebAppMenuMargin = 4;
|
||||
#endif
|
||||
|
||||
// Makes adjustments to |toolbar_button| for display in a web app frame.
|
||||
--- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_toolbar_button_container.cc
|
||||
+++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_toolbar_button_container.cc
|
||||
@@ -85,7 +85,7 @@ WebAppToolbarButtonContainer::WebAppTool
|
||||
.SetDefault(
|
||||
views::kMarginsKey,
|
||||
gfx::Insets::VH(
|
||||
- 0, HorizontalPaddingBetweenPageActionsAndAppMenuButtons()))
|
||||
+ 0, 9))
|
||||
.SetCollapseMargins(true)
|
||||
.SetIgnoreDefaultMainAxisMargins(true)
|
||||
.SetCrossAxisAlignment(views::LayoutAlignment::kCenter)
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc
|
||||
+++ b/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc
|
||||
@@ -43,7 +43,7 @@
|
||||
@@ -42,7 +42,7 @@
|
||||
namespace {
|
||||
|
||||
// Value from the spec controlling appearance of the shadow.
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#if !defined(USE_AURA)
|
||||
|
||||
@@ -231,8 +231,7 @@ RoundedOmniboxResultsFrame::RoundedOmnib
|
||||
@@ -230,8 +230,7 @@ RoundedOmniboxResultsFrame::RoundedOmnib
|
||||
LocationBarView* location_bar,
|
||||
bool forward_mouse_events)
|
||||
: contents_(contents), forward_mouse_events_(forward_mouse_events) {
|
||||
@@ -19,7 +19,7 @@
|
||||
// Host the contents in its own View to simplify layout and customization.
|
||||
auto contents_host_builder =
|
||||
views::Builder<views::View>()
|
||||
@@ -299,10 +298,10 @@ int RoundedOmniboxResultsFrame::GetNonRe
|
||||
@@ -298,10 +297,10 @@ int RoundedOmniboxResultsFrame::GetNonRe
|
||||
|
||||
// static
|
||||
gfx::Insets RoundedOmniboxResultsFrame::GetLocationBarAlignmentInsets() {
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
--- a/chrome/browser/resources/pdf/elements/viewer_page_selector.css
|
||||
+++ b/chrome/browser/resources/pdf/elements/viewer_page_selector.css
|
||||
@@ -14,7 +14,6 @@
|
||||
color: #fff;
|
||||
direction: ltr;
|
||||
display: flex;
|
||||
- font-size: 0.81rem;
|
||||
text-align: center;
|
||||
|
||||
--page-selector-spacing: 4px;
|
||||
@@ -46,3 +45,8 @@ input {
|
||||
#divider {
|
||||
margin: 0 var(--page-selector-spacing);
|
||||
}
|
||||
+
|
||||
+#content,
|
||||
+input {
|
||||
+ font-size: 12px;
|
||||
+}
|
||||
--- a/chrome/browser/resources/pdf/elements/viewer_thumbnail.css
|
||||
+++ b/chrome/browser/resources/pdf/elements/viewer_thumbnail.css
|
||||
@@ -29,18 +29,22 @@
|
||||
margin-inline-end: auto;
|
||||
margin-inline-start: auto;
|
||||
width: 108px;
|
||||
+ outline-offset: 3px;
|
||||
+ border-radius: 1px;
|
||||
}
|
||||
|
||||
:host([is-active]) #thumbnail {
|
||||
- box-shadow: 0 0 0 6px var(--focus-border-color);
|
||||
+ outline: 2px solid var(--focus-border-color);
|
||||
}
|
||||
|
||||
:host(:focus-visible) #thumbnail {
|
||||
- box-shadow: 0 0 0 2px var(--focus-border-color);
|
||||
+ outline: 2px solid var(--focus-border-color);
|
||||
+ outline-offset: 4px;
|
||||
}
|
||||
|
||||
:host([is-active]:focus-visible) #thumbnail {
|
||||
- box-shadow: 0 0 0 8px var(--focus-border-color);
|
||||
+ outline: 2px solid var(--focus-border-color);
|
||||
+ outline-offset: 3px;
|
||||
}
|
||||
|
||||
#canvas-container {
|
||||
--- a/chrome/browser/resources/pdf/elements/viewer_toolbar.css
|
||||
+++ b/chrome/browser/resources/pdf/elements/viewer_toolbar.css
|
||||
@@ -10,7 +10,7 @@
|
||||
* #css_wrapper_metadata_end */
|
||||
|
||||
:host {
|
||||
- --viewer-pdf-toolbar-height: 56px;
|
||||
+ --viewer-pdf-toolbar-height: 36px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
color: white;
|
||||
display: flex;
|
||||
height: var(--viewer-pdf-toolbar-height);
|
||||
- padding: 0 16px;
|
||||
+ padding: 0 8px;
|
||||
}
|
||||
|
||||
#title {
|
||||
- font-size: 0.87rem;
|
||||
+ font-size: 13px;
|
||||
font-weight: 500;
|
||||
- margin-inline-start: 16px;
|
||||
+ margin-inline-start: 7px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
@@ -130,6 +130,7 @@ input {
|
||||
padding: 0 4px;
|
||||
text-align: center;
|
||||
width: 5ch;
|
||||
+ font-size: 12px;
|
||||
}
|
||||
|
||||
#fit {
|
||||
--- a/chrome/browser/resources/pdf/pdf_viewer.css
|
||||
+++ b/chrome/browser/resources/pdf/pdf_viewer.css
|
||||
@@ -13,7 +13,7 @@
|
||||
* #css_wrapper_metadata_end */
|
||||
|
||||
:host {
|
||||
- --viewer-pdf-sidenav-width: 300px;
|
||||
+ --viewer-pdf-sidenav-width: 180px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
--- a/chrome/browser/resources/pdf/elements/viewer_thumbnail_bar.css
|
||||
+++ b/chrome/browser/resources/pdf/elements/viewer_thumbnail_bar.css
|
||||
@@ -14,11 +14,11 @@
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
+ padding-top: 6px;
|
||||
padding-bottom: 24px;
|
||||
- padding-inline-end: var(--viewer-thumbnail-bar-padding-inline-end);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
viewer-thumbnail {
|
||||
- padding-top: 24px;
|
||||
+ padding-top: 18px;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
--- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_utils.h
|
||||
+++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_utils.h
|
||||
@@ -11,7 +11,7 @@ class ToolbarButton;
|
||||
class ToolbarButtonProvider;
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
-inline constexpr int kWebAppMenuMargin = 7;
|
||||
+inline constexpr int kWebAppMenuMargin = 2;
|
||||
#endif
|
||||
|
||||
// Makes adjustments to |toolbar_button| for display in a web app frame.
|
||||
--- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_toolbar_button_container.cc
|
||||
+++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_toolbar_button_container.cc
|
||||
@@ -85,7 +85,7 @@ WebAppToolbarButtonContainer::WebAppTool
|
||||
.SetDefault(
|
||||
views::kMarginsKey,
|
||||
gfx::Insets::VH(
|
||||
- 0, HorizontalPaddingBetweenPageActionsAndAppMenuButtons()))
|
||||
+ 0, GetLayoutConstant(TOP_BAR_VERTICAL_PADDING) * 2))
|
||||
.SetCollapseMargins(true)
|
||||
.SetIgnoreDefaultMainAxisMargins(true)
|
||||
.SetCrossAxisAlignment(views::LayoutAlignment::kCenter)
|
||||
--- a/chrome/browser/ui/views/location_bar/custom_tab_bar_view.cc
|
||||
+++ b/chrome/browser/ui/views/location_bar/custom_tab_bar_view.cc
|
||||
@@ -145,7 +145,7 @@ class CustomTabBarTitleOriginView : publ
|
||||
views::MaximumFlexSizeRule::kPreferred));
|
||||
location_label_ = AddChildView(std::move(location_label));
|
||||
|
||||
- if (should_show_title) {
|
||||
+ if ((false)) {
|
||||
auto title_label = std::make_unique<views::Label>(
|
||||
std::u16string(), views::style::CONTEXT_LABEL);
|
||||
|
||||
--- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_utils.cc
|
||||
+++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_utils.cc
|
||||
@@ -25,7 +25,7 @@ void ConfigureWebAppToolbarButton(
|
||||
|
||||
int WebAppFrameRightMargin() {
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
- return kWebAppMenuMargin;
|
||||
+ return 10;
|
||||
#else
|
||||
return HorizontalPaddingBetweenPageActionsAndAppMenuButtons();
|
||||
#endif
|
||||
--- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_navigation_button_container.cc
|
||||
+++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_navigation_button_container.cc
|
||||
@@ -31,12 +31,7 @@
|
||||
namespace {
|
||||
|
||||
constexpr int kPaddingBetweenNavigationButtons = 5;
|
||||
-
|
||||
-#if BUILDFLAG(IS_CHROMEOS)
|
||||
constexpr int kWebAppFrameLeftMargin = 2;
|
||||
-#else
|
||||
-constexpr int kWebAppFrameLeftMargin = 7;
|
||||
-#endif
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/ui/webui/resources/cr_components/most_visited/most_visited.ts
|
||||
+++ b/ui/webui/resources/cr_components/most_visited/most_visited.ts
|
||||
@@ -719,7 +719,7 @@ export class MostVisitedElement extends
|
||||
@@ -717,7 +717,7 @@ export class MostVisitedElement extends
|
||||
|
||||
protected getFaviconUrl_(url: Url): string {
|
||||
const faviconUrl = new URL('chrome://favicon2/');
|
||||
@@ -38,7 +38,7 @@
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
outline: none;
|
||||
@@ -184,7 +184,7 @@
|
||||
@@ -187,7 +187,7 @@
|
||||
.tile-icon {
|
||||
align-items: center;
|
||||
background-color: var(--tile-background-color);
|
||||
@@ -47,7 +47,7 @@
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
height: var(--icon-size);
|
||||
@@ -194,8 +194,8 @@
|
||||
@@ -197,8 +197,8 @@
|
||||
}
|
||||
|
||||
.tile-icon img {
|
||||
@@ -58,7 +58,7 @@
|
||||
}
|
||||
|
||||
.managed-tile-icon {
|
||||
@@ -218,7 +218,6 @@ cr-policy-indicator {
|
||||
@@ -221,7 +221,6 @@ cr-policy-indicator {
|
||||
|
||||
.tile-title {
|
||||
align-items: center;
|
||||
@@ -66,7 +66,7 @@
|
||||
color: var(--most-visited-text-color);
|
||||
display: flex;
|
||||
height: var(--title-height);
|
||||
@@ -263,7 +262,7 @@ cr-icon-button {
|
||||
@@ -266,7 +265,7 @@ cr-icon-button {
|
||||
--cr-icon-button-fill-color: var(--icon-button-color);
|
||||
--cr-icon-button-size: 28px;
|
||||
--cr-icon-button-transition: none;
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
}
|
||||
|
||||
bool Tab::ShouldRenderAsNormalTab() const {
|
||||
@@ -1254,15 +1253,25 @@ void Tab::UpdateTabIconNeedsAttentionBlo
|
||||
@@ -1254,15 +1253,29 @@ void Tab::UpdateTabIconNeedsAttentionBlo
|
||||
}
|
||||
|
||||
int Tab::GetWidthOfLargestSelectableRegion() const {
|
||||
@@ -209,6 +209,10 @@
|
||||
+
|
||||
+ int selectable_region = width();
|
||||
+
|
||||
+ if (!ShouldRenderAsNormalTab()) {
|
||||
+ return selectable_region;
|
||||
+ }
|
||||
+
|
||||
+ if (alert_indicator_button_->GetVisible()) {
|
||||
+ selectable_region = alert_indicator_button_->bounds().right();
|
||||
+ }
|
||||
|
||||
@@ -517,7 +517,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
|
||||
@@ -10466,6 +10466,9 @@ Keep your key file in a safe place. You
|
||||
@@ -10469,6 +10469,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,6 +1,6 @@
|
||||
--- a/chrome/browser/ui/views/frame/browser_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/browser_view.cc
|
||||
@@ -4967,6 +4967,18 @@ int BrowserView::NonClientHitTest(const
|
||||
@@ -4964,6 +4964,18 @@ int BrowserView::NonClientHitTest(const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
};
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -13438,6 +13438,9 @@ Check your passwords anytime in <ph name
|
||||
@@ -13444,6 +13444,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,12 +0,0 @@
|
||||
--- a/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc
|
||||
+++ b/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc
|
||||
@@ -17,9 +17,6 @@
|
||||
// static
|
||||
void GoogleApiKeysInfoBarDelegate::Create(
|
||||
infobars::ContentInfoBarManager* infobar_manager) {
|
||||
- infobar_manager->AddInfoBar(
|
||||
- CreateConfirmInfoBar(std::unique_ptr<ConfirmInfoBarDelegate>(
|
||||
- new GoogleApiKeysInfoBarDelegate())));
|
||||
}
|
||||
|
||||
GoogleApiKeysInfoBarDelegate::GoogleApiKeysInfoBarDelegate() = default;
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
--- a/BUILD.gn
|
||||
+++ b/BUILD.gn
|
||||
@@ -459,14 +459,6 @@ group("gn_all") {
|
||||
@@ -458,14 +458,6 @@ group("gn_all") {
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
+4
-11
@@ -2,7 +2,6 @@ upstream-fixes/missing-dependencies.patch
|
||||
upstream-fixes/fix-crash-without-enterprise-cloud-content-analysis.patch
|
||||
upstream-fixes/fix-python-codecs-deprecation.patch
|
||||
upstream-fixes/fix-macos-widget-rect.patch
|
||||
upstream-fixes/fix-macos-fullscreen-ui-breakage.patch
|
||||
|
||||
inox-patchset/fix-building-without-safebrowsing.patch
|
||||
inox-patchset/disable-autofill-download-manager.patch
|
||||
@@ -42,7 +41,6 @@ bromite/disable-fetching-field-trials.patch
|
||||
ungoogled-chromium/add-ungoogled-flag-headers.patch
|
||||
|
||||
inox-patchset/modify-default-prefs.patch
|
||||
inox-patchset/disable-missing-key-warning.patch
|
||||
inox-patchset/disable-battery-status-service.patch
|
||||
|
||||
debian/disable-google-api-warning.patch
|
||||
@@ -56,10 +54,7 @@ bromite/flag-fingerprinting-canvas-image-data-noise.patch
|
||||
|
||||
ungoogled-chromium/add-components-ungoogled.patch
|
||||
ungoogled-chromium/add-ipv6-probing-option.patch
|
||||
ungoogled-chromium/remove-disable-setuid-sandbox-as-bad-flag.patch
|
||||
ungoogled-chromium/disable-intranet-redirect-detector.patch
|
||||
ungoogled-chromium/enable-page-saving-on-more-pages.patch
|
||||
ungoogled-chromium/disable-download-quarantine.patch
|
||||
ungoogled-chromium/fix-building-without-mdns-and-service-discovery.patch
|
||||
ungoogled-chromium/add-flag-to-configure-extension-downloading.patch
|
||||
ungoogled-chromium/add-flag-for-search-engine-collection.patch
|
||||
@@ -79,10 +74,7 @@ ungoogled-chromium/add-flag-to-close-window-with-last-tab.patch
|
||||
ungoogled-chromium/add-flag-to-convert-popups-to-tabs.patch
|
||||
ungoogled-chromium/add-flag-to-disable-local-history-expiration.patch
|
||||
ungoogled-chromium/prepopulated-search-engines.patch
|
||||
ungoogled-chromium/fix-distilled-icons.patch
|
||||
ungoogled-chromium/add-flag-to-clear-data-on-exit.patch
|
||||
ungoogled-chromium/add-flag-for-tabsearch-button.patch
|
||||
ungoogled-chromium/add-flag-for-qr-generator.patch
|
||||
ungoogled-chromium/add-flag-for-grab-handle.patch
|
||||
ungoogled-chromium/add-flag-for-close-confirmation.patch
|
||||
ungoogled-chromium/add-flag-for-custom-ntp.patch
|
||||
@@ -90,7 +82,6 @@ ungoogled-chromium/add-flag-for-tab-hover-cards.patch
|
||||
ungoogled-chromium/add-flag-to-hide-tab-close-buttons.patch
|
||||
ungoogled-chromium/add-flag-to-disable-tls-grease.patch
|
||||
ungoogled-chromium/add-flag-to-change-http-accept-header.patch
|
||||
ungoogled-chromium/add-flag-to-disable-sharing-hub.patch
|
||||
ungoogled-chromium/add-flag-for-disabling-link-drag.patch
|
||||
ungoogled-chromium/add-flag-to-hide-extensions-menu.patch
|
||||
ungoogled-chromium/add-flag-to-hide-fullscreen-exit-ui.patch
|
||||
@@ -100,7 +91,6 @@ ungoogled-chromium/add-flags-for-existing-switches.patch
|
||||
ungoogled-chromium/add-flag-to-reduce-system-info.patch
|
||||
ungoogled-chromium/add-flag-to-remove-client-hints.patch
|
||||
ungoogled-chromium/disable-downloads-page-referrer-url.patch
|
||||
ungoogled-chromium/enable-extra-locales.patch
|
||||
ungoogled-chromium/disable-chromelabs.patch
|
||||
ungoogled-chromium/remove-pac-size-limit.patch
|
||||
ungoogled-chromium/enable-certificate-transparency-and-add-flag.patch
|
||||
@@ -118,6 +108,7 @@ helium/core/add-zen-importer.patch
|
||||
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/override-chrome-protocol.patch
|
||||
helium/core/onboarding-page.patch
|
||||
helium/core/change-chromium-branding.patch
|
||||
@@ -190,6 +181,7 @@ helium/core/webrtc-default-handling-policy.patch
|
||||
helium/core/browser-window-context-menu.patch
|
||||
helium/core/disable-ntp-footer.patch
|
||||
helium/core/tab-cycling-mru.patch
|
||||
helium/core/component-updates.patch
|
||||
|
||||
helium/settings/settings-page-icons.patch
|
||||
helium/settings/move-search-suggest.patch
|
||||
@@ -256,7 +248,7 @@ helium/ui/bangs-ui.patch
|
||||
helium/ui/thinner-infobar.patch
|
||||
helium/ui/reduce-text-button-height.patch
|
||||
helium/ui/smaller-window-grab-handle.patch
|
||||
helium/ui/fix-pwa-toolbar.patch
|
||||
helium/ui/pwa-toolbar.patch
|
||||
helium/ui/top-container.patch
|
||||
helium/ui/status-bubble.patch
|
||||
helium/ui/clean-incognito-guest-ntp.patch
|
||||
@@ -270,3 +262,4 @@ helium/ui/fix-caption-button-bounds.patch
|
||||
helium/ui/find-bar.patch
|
||||
helium/ui/remove-zoom-action.patch
|
||||
helium/ui/experiments/compact-action-toolbar.patch
|
||||
helium/ui/pdf-viewer.patch
|
||||
|
||||
@@ -197,7 +197,7 @@
|
||||
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_CHOICES_H_
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -72,4 +72,8 @@
|
||||
@@ -64,4 +64,8 @@
|
||||
"Remove Grab Handle",
|
||||
"Removes the reserved empty space in the tabstrip for moving the window. ungoogled-chromium flag",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("remove-grab-handle")},
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
}
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -76,4 +76,8 @@
|
||||
@@ -68,4 +68,8 @@
|
||||
"Close Confirmation",
|
||||
"Show a warning prompt when closing the browser window. ungoogled-chromium flag",
|
||||
kOsDesktop, MULTI_VALUE_TYPE(kCloseConfirmation)},
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -100,4 +100,8 @@
|
||||
"Disable Sharing Hub",
|
||||
"Disables the sharing hub button. ungoogled-chromium flag.",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("disable-sharing-hub")},
|
||||
+ {"disable-link-drag",
|
||||
@@ -88,4 +88,8 @@
|
||||
"Custom HTTP Accept Header",
|
||||
"Set a custom value for the Accept header which is sent by the browser with every HTTP request. (e.g. `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8`). ungoogled-chromium flag.",
|
||||
kOsAll, ORIGIN_LIST_VALUE_TYPE("http-accept-header", "")},
|
||||
+ {"disable-link-drag",
|
||||
+ "Disable link drag",
|
||||
+ "Prevents dragging of links and selected text. ungoogled-chromium flag.",
|
||||
+ kOsDesktop, FEATURE_VALUE_TYPE(blink::features::kDisableLinkDrag)},
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
--- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
||||
@@ -84,6 +84,7 @@ class FrameGrabHandle : public views::Vi
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "chrome/browser/ui/views/frame/tab_strip_region_view.h"
|
||||
|
||||
+#include "base/command_line.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
@@ -83,6 +84,7 @@ class FrameGrabHandle : public views::Vi
|
||||
// Reserve some space for the frame to be grabbed by, even if the tabstrip
|
||||
// is full.
|
||||
// TODO(tbergquist): Define this relative to the NTB insets again.
|
||||
@@ -10,11 +18,11 @@
|
||||
};
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -68,4 +68,8 @@
|
||||
"Disable QR Generator",
|
||||
"Disables the QR generator for sharing page links. ungoogled-chromium flag",
|
||||
kOsDesktop, FEATURE_VALUE_TYPE(kDisableQRGenerator)},
|
||||
+ {"remove-grab-handle",
|
||||
@@ -60,4 +60,8 @@
|
||||
"Clear data on exit",
|
||||
"Clears all browsing data on exit. ungoogled-chromium flag",
|
||||
kOsDesktop, FEATURE_VALUE_TYPE(features::kClearDataOnExit)},
|
||||
+ {"remove-grab-handle",
|
||||
+ "Remove Grab Handle",
|
||||
+ "Removes the reserved empty space in the tabstrip for moving the window. ungoogled-chromium flag",
|
||||
+ kOsDesktop, SINGLE_VALUE_TYPE("remove-grab-handle")},
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
substitutions["backgroundPosition"] = GetNewTabBackgroundPositionCSS(tp);
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -112,4 +112,8 @@
|
||||
@@ -100,4 +100,8 @@
|
||||
"Hide Fullscreen Exit UI",
|
||||
"Hides the \"X\" that appears when the mouse cursor is moved towards the top of the window in fullscreen mode. Additionally, this hides the \"Press F11 to exit full screen\" popup. ungoogled-chromium flag.",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("hide-fullscreen-exit-ui")},
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
--- a/chrome/browser/ui/qrcode_generator/qrcode_generator_bubble_controller.cc
|
||||
+++ b/chrome/browser/ui/qrcode_generator/qrcode_generator_bubble_controller.cc
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/prefs/pref_change_registrar.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
+#include "components/sharing_message/features.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
@@ -38,7 +39,7 @@ QRCodeGeneratorBubbleController::~QRCode
|
||||
|
||||
// static
|
||||
bool QRCodeGeneratorBubbleController::IsGeneratorAvailable(const GURL& url) {
|
||||
- if (!url.SchemeIsHTTPOrHTTPS()) {
|
||||
+ if (!url.SchemeIsHTTPOrHTTPS() || base::FeatureList::IsEnabled(kDisableQRGenerator)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -64,4 +64,8 @@
|
||||
"Remove Tabsearch Button",
|
||||
"Removes the tabsearch button from the tabstrip. ungoogled-chromium flag",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("remove-tabsearch-button")},
|
||||
+ {"disable-qr-generator",
|
||||
+ "Disable QR Generator",
|
||||
+ "Disables the QR generator for sharing page links. ungoogled-chromium flag",
|
||||
+ kOsDesktop, FEATURE_VALUE_TYPE(kDisableQRGenerator)},
|
||||
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
|
||||
--- a/components/sharing_message/features.cc
|
||||
+++ b/components/sharing_message/features.cc
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "build/build_config.h"
|
||||
#include "components/sync_preferences/features.h"
|
||||
|
||||
+BASE_FEATURE(kDisableQRGenerator, "DisableQRGenerator", base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
+
|
||||
BASE_FEATURE(kClickToCall, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
|
||||
BASE_FEATURE(kMobilePromoOnDesktop, base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
--- a/components/sharing_message/features.h
|
||||
+++ b/components/sharing_message/features.h
|
||||
@@ -34,4 +34,5 @@ MobilePromoOnDesktopPromoType MobileProm
|
||||
// notification arm, false otherwise.
|
||||
bool IsMobilePromoOnDesktopNotificationsEnabled();
|
||||
|
||||
+BASE_DECLARE_FEATURE(kDisableQRGenerator);
|
||||
#endif // COMPONENTS_SHARING_MESSAGE_FEATURES_H_
|
||||
@@ -69,7 +69,7 @@
|
||||
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_CHOICES_H_
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -80,4 +80,8 @@
|
||||
@@ -72,4 +72,8 @@
|
||||
"Custom New Tab Page",
|
||||
"Allows setting a custom URL for the new tab page. Value can be internal (e.g. `about:blank` or `chrome://new-tab-page`), external (e.g. `example.com`), or local (e.g. `file:///tmp/startpage.html`). This applies for incognito windows as well when not set to a `chrome://` internal page. ungoogled-chromium flag",
|
||||
kOsDesktop, ORIGIN_LIST_VALUE_TYPE("custom-ntp", "")},
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
--- a/chrome/browser/ui/browser_command_controller.cc
|
||||
+++ b/chrome/browser/ui/browser_command_controller.cc
|
||||
@@ -1644,7 +1644,8 @@ void BrowserCommandController::InitComma
|
||||
command_updater_.UpdateCommandEnabled(IDC_WINDOW_CLOSE_OTHER_TABS,
|
||||
normal_window);
|
||||
|
||||
- const bool enable_tab_search_commands = browser_->is_type_normal();
|
||||
+ const bool enable_tab_search_commands = browser_->is_type_normal() &&
|
||||
+ !base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button");
|
||||
command_updater_.UpdateCommandEnabled(IDC_TAB_SEARCH,
|
||||
enable_tab_search_commands);
|
||||
command_updater_.UpdateCommandEnabled(IDC_TAB_SEARCH_CLOSE,
|
||||
--- a/chrome/browser/ui/ui_features.cc
|
||||
+++ b/chrome/browser/ui/ui_features.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "chrome/browser/ui/ui_features.h"
|
||||
|
||||
+#include "base/command_line.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/metrics/field_trial_params.h"
|
||||
#include "base/time/time.h"
|
||||
@@ -656,6 +657,10 @@ static std::string GetCountryCode() {
|
||||
}
|
||||
|
||||
bool HasTabSearchToolbarButton() {
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button")) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
static const bool is_tab_search_moving = [] {
|
||||
if (GetCountryCode() == "us" &&
|
||||
base::FeatureList::IsEnabled(
|
||||
--- a/chrome/browser/ui/views/frame/browser_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/browser_view.cc
|
||||
@@ -4475,6 +4475,9 @@ BookmarkBar::State BrowserView::bookmark
|
||||
}
|
||||
|
||||
void BrowserView::UpdateTabSearchBubbleHost() {
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button")) {
|
||||
+ return;
|
||||
+ }
|
||||
if (!GetIsNormalType()) {
|
||||
return;
|
||||
}
|
||||
--- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "chrome/browser/ui/views/frame/tab_strip_region_view.h"
|
||||
|
||||
+#include "base/command_line.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
@@ -209,6 +210,7 @@ TabStripRegionView::TabStripRegionView(s
|
||||
std::unique_ptr<TabStripActionContainer> tab_strip_action_container;
|
||||
std::unique_ptr<ProductSpecificationsButton> product_specifications_button;
|
||||
if (browser &&
|
||||
+ !base::CommandLine::ForCurrentProcess()->HasSwitch("remove-tabsearch-button") &&
|
||||
(browser->GetType() == BrowserWindowInterface::Type::TYPE_NORMAL)) {
|
||||
if (features::HasTabSearchToolbarButton()) {
|
||||
tab_strip_action_container = std::make_unique<TabStripActionContainer>(
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -60,4 +60,8 @@
|
||||
"Clear data on exit",
|
||||
"Clears all browsing data on exit. ungoogled-chromium flag",
|
||||
kOsDesktop, FEATURE_VALUE_TYPE(features::kClearDataOnExit)},
|
||||
+ {"remove-tabsearch-button",
|
||||
+ "Remove Tabsearch Button",
|
||||
+ "Removes the tabsearch button from the tabstrip. ungoogled-chromium flag",
|
||||
+ kOsDesktop, SINGLE_VALUE_TYPE("remove-tabsearch-button")},
|
||||
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -92,4 +92,8 @@
|
||||
@@ -84,4 +84,8 @@
|
||||
"Disable GREASE for TLS",
|
||||
"Turn off GREASE (Generate Random Extensions And Sustain Extensibility) for TLS connections. ungoogled-chromium flag.",
|
||||
kOsAll, SINGLE_VALUE_TYPE("disable-grease-tls")},
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
--- a/chrome/browser/sharing_hub/sharing_hub_features.cc
|
||||
+++ b/chrome/browser/sharing_hub/sharing_hub_features.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "chrome/browser/sharing_hub/sharing_hub_features.h"
|
||||
|
||||
+#include "base/command_line.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
@@ -36,6 +37,7 @@ bool ScreenshotsDisabledByPolicy(content
|
||||
} // namespace
|
||||
|
||||
bool SharingHubOmniboxEnabled(content::BrowserContext* context) {
|
||||
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("disable-sharing-hub")) return false;
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
return false;
|
||||
#else
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -96,4 +96,8 @@
|
||||
"Custom HTTP Accept Header",
|
||||
"Set a custom value for the Accept header which is sent by the browser with every HTTP request. (e.g. `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8`). ungoogled-chromium flag.",
|
||||
kOsAll, ORIGIN_LIST_VALUE_TYPE("http-accept-header", "")},
|
||||
+ {"disable-sharing-hub",
|
||||
+ "Disable Sharing Hub",
|
||||
+ "Disables the sharing hub button. ungoogled-chromium flag.",
|
||||
+ kOsDesktop, SINGLE_VALUE_TYPE("disable-sharing-hub")},
|
||||
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -88,4 +88,8 @@
|
||||
@@ -80,4 +80,8 @@
|
||||
"Hide tab close buttons",
|
||||
"Hides the close buttons on tabs. ungoogled-chromium flag.",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("hide-tab-close-buttons")},
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
if (!HasAnyExtensions()) {
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -104,4 +104,8 @@
|
||||
@@ -92,4 +92,8 @@
|
||||
"Disable link drag",
|
||||
"Prevents dragging of links and selected text. ungoogled-chromium flag.",
|
||||
kOsDesktop, FEATURE_VALUE_TYPE(blink::features::kDisableLinkDrag)},
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
return !IsRunningInAppMode();
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -108,4 +108,8 @@
|
||||
@@ -96,4 +96,8 @@
|
||||
"Hide Extensions Menu",
|
||||
"Hides the extensions container. This includes the puzzle piece icon as well as any pinned extensions. ungoogled-chromium flag.",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("hide-extensions-menu")},
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -84,4 +84,8 @@
|
||||
@@ -76,4 +76,8 @@
|
||||
"Tab Hover Cards",
|
||||
"Allows removing the tab hover cards or using a tooltip as a replacement. ungoogled-chromium flag.",
|
||||
kOsDesktop, MULTI_VALUE_TYPE(kTabHoverCards)},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -144,4 +144,8 @@
|
||||
@@ -132,4 +132,8 @@
|
||||
"Spoof WebGL Info",
|
||||
"Return generic values for WebGLDebugRendererInfo to remove a potential data leak while preventing potential website breakage. ungoogled-chromium flag.",
|
||||
kOsAll, FEATURE_WITH_PARAMS_VALUE_TYPE(blink::features::kSpoofWebGLInfo, kSpoofWebGLChoices, "SpoofWebGLInfo")},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -128,4 +128,8 @@
|
||||
@@ -116,4 +116,8 @@
|
||||
"Minimal Referrers",
|
||||
"Removes all cross-origin referrers and strips same-origin referrers down to the origin. Has lower precedence than remove-cross-origin-referrers. ungoogled-chromium flag.",
|
||||
kOsAll, FEATURE_VALUE_TYPE(network::features::kMinimalReferrers)},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -132,4 +132,8 @@
|
||||
@@ -120,4 +120,8 @@
|
||||
"Reduced System Info",
|
||||
"Reduces the amount of system information obatainable through headers and javascript, also causes hardwareConcurrency to respond with two cores. ungoogled-chromium flag.",
|
||||
kOsAll, FEATURE_VALUE_TYPE(blink::features::kReducedSystemInfo)},
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#endif // CHROME_BROWSER_UNGOOGLED_FLAG_CHOICES_H_
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -140,4 +140,8 @@
|
||||
@@ -128,4 +128,8 @@
|
||||
"Enforce Certificate Transparency",
|
||||
"Enforce Certificate Transparency for certificates that sites present. This is enabled by default. ungoogled-chromium flag.",
|
||||
kOsAll, FEATURE_VALUE_TYPE(features::kCertificateTransparencyAskBeforeEnabling)},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -5203,10 +5203,12 @@ const FeatureEntry::FeatureVariation kPr
|
||||
@@ -5225,10 +5225,12 @@ const FeatureEntry::FeatureVariation kPr
|
||||
#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/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -116,4 +116,16 @@
|
||||
@@ -104,4 +104,16 @@
|
||||
"Enable themes in Incognito mode",
|
||||
"Allows themes to override Google's built-in Incognito theming. ungoogled-chromium flag.",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("enable-incognito-themes")},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -5199,7 +5199,13 @@ const FeatureEntry::FeatureVariation kPr
|
||||
@@ -5221,7 +5221,13 @@ const FeatureEntry::FeatureVariation kPr
|
||||
// calculate and verify checksum.
|
||||
//
|
||||
// When adding a new choice, add it to the end of the list.
|
||||
|
||||
@@ -1,69 +1,49 @@
|
||||
# Disable some background communication with clients2.google.com
|
||||
|
||||
--- a/chrome/browser/chrome_content_browser_client.cc
|
||||
+++ b/chrome/browser/chrome_content_browser_client.cc
|
||||
@@ -2683,24 +2683,6 @@ void ChromeContentBrowserClient::AppendE
|
||||
command_line->AppendSwitchASCII(switches::kMetricsClientID,
|
||||
client_info->client_id);
|
||||
}
|
||||
-#elif BUILDFLAG(IS_POSIX)
|
||||
-#if !BUILDFLAG(IS_ANDROID)
|
||||
- pid_t pid;
|
||||
- if (crash_reporter::GetHandlerSocket(nullptr, &pid)) {
|
||||
- command_line->AppendSwitchASCII(
|
||||
- crash_reporter::switches::kCrashpadHandlerPid,
|
||||
- base::NumberToString(pid));
|
||||
- }
|
||||
-#endif
|
||||
- std::string switch_value;
|
||||
- std::unique_ptr<metrics::ClientInfo> client_info =
|
||||
- GoogleUpdateSettings::LoadMetricsClientInfo();
|
||||
- if (client_info) {
|
||||
- switch_value = client_info->client_id;
|
||||
- }
|
||||
- switch_value.push_back(',');
|
||||
- switch_value.append(chrome::GetChannelName(chrome::WithExtendedStable(true)));
|
||||
- command_line->AppendSwitchASCII(switches::kEnableCrashReporter, switch_value);
|
||||
--- 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
|
||||
|
||||
if (logging::DialogsAreSuppressed()) {
|
||||
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
|
||||
@@ -72,6 +72,12 @@ void InitializeDatabasePath(const base::
|
||||
}
|
||||
|
||||
bool InitializeCrashpadImpl(bool initial_client,
|
||||
+ const std::string& a, const std::string& b, const base::FilePath& c,
|
||||
+ const std::vector<std::string>& d, bool e, const std::vector<base::FilePath>& f) {
|
||||
@@ -78,6 +78,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;
|
||||
+}
|
||||
+[[maybe_unused]]
|
||||
+bool DeadInitializeCrashpadImpl(bool initial_client,
|
||||
const std::string& process_type,
|
||||
const std::string& user_data_dir,
|
||||
const base::FilePath& exe_path,
|
||||
--- a/components/gwp_asan/client/gwp_asan.cc
|
||||
+++ b/components/gwp_asan/client/gwp_asan.cc
|
||||
@@ -344,6 +344,11 @@ GWP_ASAN_EXPORT std::optional<AllocatorS
|
||||
+#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,
|
||||
}
|
||||
|
||||
// Exported for testing.
|
||||
GWP_ASAN_EXPORT std::optional<AllocatorSettings> GetAllocatorSettings(
|
||||
+ const base::Feature& a, bool b, std::string_view c) {
|
||||
+ return std::nullopt;
|
||||
+}
|
||||
+[[maybe_unused]]
|
||||
+std::optional<AllocatorSettings> DeadGetAllocatorSettings(
|
||||
const base::Feature& feature,
|
||||
bool boost_sampling,
|
||||
std::string_view process_type) {
|
||||
--- a/third_party/crashpad/crashpad/client/crashpad_client_linux.cc
|
||||
+++ b/third_party/crashpad/crashpad/client/crashpad_client_linux.cc
|
||||
@@ -747,8 +747,6 @@ void CrashpadClient::CrashWithoutDump(co
|
||||
// static
|
||||
void CrashpadClient::SetFirstChanceExceptionHandler(
|
||||
FirstChanceHandler handler) {
|
||||
- DCHECK(SignalHandler::Get());
|
||||
- SignalHandler::Get()->SetFirstChanceHandler(handler);
|
||||
}
|
||||
|
||||
// static
|
||||
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.
|
||||
|
||||
@@ -1,247 +0,0 @@
|
||||
# Disables file download quarantining
|
||||
|
||||
--- a/components/download/internal/common/base_file.cc
|
||||
+++ b/components/download/internal/common/base_file.cc
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "components/download/public/common/download_interrupt_reasons_utils.h"
|
||||
#include "components/download/public/common/download_item.h"
|
||||
#include "components/download/public/common/download_stats.h"
|
||||
-#include "components/services/quarantine/quarantine.h"
|
||||
#include "crypto/hash.h"
|
||||
#include "crypto/secure_hash.h"
|
||||
|
||||
@@ -538,94 +537,10 @@ DownloadInterruptReason BaseFile::Publis
|
||||
}
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
-namespace {
|
||||
-
|
||||
-DownloadInterruptReason QuarantineFileResultToReason(
|
||||
- quarantine::mojom::QuarantineFileResult result) {
|
||||
- switch (result) {
|
||||
- case quarantine::mojom::QuarantineFileResult::OK:
|
||||
- return DOWNLOAD_INTERRUPT_REASON_NONE;
|
||||
- case quarantine::mojom::QuarantineFileResult::VIRUS_INFECTED:
|
||||
- return DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED;
|
||||
- case quarantine::mojom::QuarantineFileResult::SECURITY_CHECK_FAILED:
|
||||
- return DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED;
|
||||
- case quarantine::mojom::QuarantineFileResult::BLOCKED_BY_POLICY:
|
||||
- return DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED;
|
||||
- case quarantine::mojom::QuarantineFileResult::ACCESS_DENIED:
|
||||
- return DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED;
|
||||
-
|
||||
- case quarantine::mojom::QuarantineFileResult::FILE_MISSING:
|
||||
- // Don't have a good interrupt reason here. This return code means that
|
||||
- // the file at |full_path_| went missing before QuarantineFile got to
|
||||
- // look at it. Not expected to happen, but we've seen instances where a
|
||||
- // file goes missing immediately after BaseFile closes the handle.
|
||||
- //
|
||||
- // Intentionally using a different error message than
|
||||
- // SECURITY_CHECK_FAILED in order to distinguish the two.
|
||||
- return DOWNLOAD_INTERRUPT_REASON_FILE_FAILED;
|
||||
-
|
||||
- case quarantine::mojom::QuarantineFileResult::ANNOTATION_FAILED:
|
||||
- // This means that the mark-of-the-web couldn't be applied. The file is
|
||||
- // already on the file system under its final target name.
|
||||
- //
|
||||
- // Causes of failed annotations typically aren't transient. E.g. the
|
||||
- // target file system may not support extended attributes or alternate
|
||||
- // streams. We are going to allow these downloads to progress on the
|
||||
- // assumption that failures to apply MOTW can't reliably be introduced
|
||||
- // remotely.
|
||||
- return DOWNLOAD_INTERRUPT_REASON_NONE;
|
||||
- }
|
||||
- return DOWNLOAD_INTERRUPT_REASON_FILE_FAILED;
|
||||
-}
|
||||
-
|
||||
-} // namespace
|
||||
-
|
||||
// static
|
||||
GURL BaseFile::GetEffectiveAuthorityURL(const GURL& source_url,
|
||||
const GURL& referrer_url) {
|
||||
- if (source_url.is_valid()) {
|
||||
- // http{,s} has an authority and are supported.
|
||||
- if (source_url.SchemeIsHTTPOrHTTPS())
|
||||
- return source_url;
|
||||
-
|
||||
- // If the download source is file:// ideally we should copy the MOTW from
|
||||
- // the original file, but given that Chrome/Chromium places strict
|
||||
- // restrictions on which schemes can reference file:// URLs, this code is
|
||||
- // going to assume that at this point it's okay to treat this download as
|
||||
- // being from the local system.
|
||||
- if (source_url.SchemeIsFile())
|
||||
return source_url;
|
||||
-
|
||||
- // ftp:// has an authority.
|
||||
- if (source_url.SchemeIs(url::kFtpScheme))
|
||||
- return source_url;
|
||||
-
|
||||
- if (source_url.SchemeIs(url::kBlobScheme))
|
||||
- return url::Origin::Create(source_url).GetURL();
|
||||
- }
|
||||
-
|
||||
- if (referrer_url.is_valid() && referrer_url.SchemeIsHTTPOrHTTPS())
|
||||
- return referrer_url;
|
||||
-
|
||||
- return GURL();
|
||||
-}
|
||||
-
|
||||
-void BaseFile::OnFileQuarantined(
|
||||
- quarantine::mojom::QuarantineFileResult result) {
|
||||
- DCHECK(on_annotation_done_callback_);
|
||||
- quarantine_service_.reset();
|
||||
- std::move(on_annotation_done_callback_)
|
||||
- .Run(QuarantineFileResultToReason(result));
|
||||
-}
|
||||
-
|
||||
-void BaseFile::OnQuarantineServiceError(const GURL& source_url,
|
||||
- const GURL& referrer_url) {
|
||||
-#if BUILDFLAG(IS_WIN)
|
||||
- OnFileQuarantined(quarantine::SetInternetZoneIdentifierDirectly(
|
||||
- full_path_, source_url, referrer_url));
|
||||
-#else // !BUILDFLAG(IS_WIN)
|
||||
- NOTREACHED() << "In-process quarantine service should not have failed.";
|
||||
-#endif // !BUILDFLAG(IS_WIN)
|
||||
}
|
||||
|
||||
void BaseFile::AnnotateWithSourceInformation(
|
||||
@@ -635,32 +550,8 @@ void BaseFile::AnnotateWithSourceInforma
|
||||
const std::optional<url::Origin>& request_initiator,
|
||||
mojo::PendingRemote<quarantine::mojom::Quarantine> remote_quarantine,
|
||||
OnAnnotationDoneCallback on_annotation_done_callback) {
|
||||
- GURL authority_url = GetEffectiveAuthorityURL(source_url, referrer_url);
|
||||
- if (!remote_quarantine) {
|
||||
-#if BUILDFLAG(IS_WIN)
|
||||
- quarantine::mojom::QuarantineFileResult result =
|
||||
- quarantine::SetInternetZoneIdentifierDirectly(full_path_, authority_url,
|
||||
- referrer_url);
|
||||
-#else
|
||||
- quarantine::mojom::QuarantineFileResult result =
|
||||
- quarantine::mojom::QuarantineFileResult::ANNOTATION_FAILED;
|
||||
-#endif
|
||||
- std::move(on_annotation_done_callback)
|
||||
- .Run(QuarantineFileResultToReason(result));
|
||||
- } else {
|
||||
- quarantine_service_.Bind(std::move(remote_quarantine));
|
||||
-
|
||||
- on_annotation_done_callback_ = std::move(on_annotation_done_callback);
|
||||
-
|
||||
- quarantine_service_.set_disconnect_handler(base::BindOnce(
|
||||
- &BaseFile::OnQuarantineServiceError, weak_factory_.GetWeakPtr(),
|
||||
- authority_url, referrer_url));
|
||||
-
|
||||
- quarantine_service_->QuarantineFile(
|
||||
- full_path_, authority_url, referrer_url, request_initiator, client_guid,
|
||||
- base::BindOnce(&BaseFile::OnFileQuarantined,
|
||||
- weak_factory_.GetWeakPtr()));
|
||||
- }
|
||||
+ std::move(on_annotation_done_callback)
|
||||
+ .Run(DOWNLOAD_INTERRUPT_REASON_NONE);
|
||||
}
|
||||
|
||||
} // namespace download
|
||||
--- a/content/browser/BUILD.gn
|
||||
+++ b/content/browser/BUILD.gn
|
||||
@@ -139,7 +139,6 @@ source_set("browser") {
|
||||
"//components/persistent_cache",
|
||||
"//components/power_monitor",
|
||||
"//components/services/filesystem:lib",
|
||||
- "//components/services/quarantine",
|
||||
"//components/services/storage",
|
||||
"//components/services/storage:filesystem_proxy_factory",
|
||||
"//components/services/storage/dom_storage:local_storage_proto",
|
||||
--- a/content/browser/file_system_access/file_system_access_safe_move_helper.cc
|
||||
+++ b/content/browser/file_system_access/file_system_access_safe_move_helper.cc
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "base/task/thread_pool.h"
|
||||
#include "base/thread_annotations.h"
|
||||
#include "build/build_config.h"
|
||||
-#include "components/services/quarantine/quarantine.h"
|
||||
#include "content/browser/file_system_access/features.h"
|
||||
#include "content/browser/file_system_access/file_system_access_error.h"
|
||||
#include "content/public/browser/content_browser_client.h"
|
||||
@@ -231,22 +230,9 @@ void FileSystemAccessSafeMoveHelper::Did
|
||||
// not exist anymore. In case of error, the source file URL will point to a
|
||||
// valid filesystem location.
|
||||
base::OnceCallback<void(base::File::Error)> result_callback;
|
||||
- if (RequireQuarantine()) {
|
||||
- GURL referrer_url = manager_->is_off_the_record() ? GURL() : context_.url;
|
||||
- mojo::Remote<quarantine::mojom::Quarantine> quarantine_remote;
|
||||
- if (quarantine_connection_callback_) {
|
||||
- quarantine_connection_callback_.Run(
|
||||
- quarantine_remote.BindNewPipeAndPassReceiver());
|
||||
- }
|
||||
- result_callback =
|
||||
- base::BindOnce(&FileSystemAccessSafeMoveHelper::DidFileDoQuarantine,
|
||||
- weak_factory_.GetWeakPtr(), dest_url(), referrer_url,
|
||||
- std::move(quarantine_remote));
|
||||
- } else {
|
||||
result_callback =
|
||||
base::BindOnce(&FileSystemAccessSafeMoveHelper::DidFileSkipQuarantine,
|
||||
weak_factory_.GetWeakPtr());
|
||||
- }
|
||||
manager_->DoFileSystemOperation(
|
||||
FROM_HERE, &storage::FileSystemOperationRunner::Move,
|
||||
std::move(result_callback), source_url(), dest_url(), options_,
|
||||
@@ -263,7 +249,6 @@ void FileSystemAccessSafeMoveHelper::Did
|
||||
void FileSystemAccessSafeMoveHelper::DidFileDoQuarantine(
|
||||
const storage::FileSystemURL& target_url,
|
||||
const GURL& referrer_url,
|
||||
- mojo::Remote<quarantine::mojom::Quarantine> quarantine_remote,
|
||||
base::File::Error result) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
@@ -294,40 +279,9 @@ void FileSystemAccessSafeMoveHelper::Did
|
||||
referrer_url.is_valid() && referrer_url.SchemeIsHTTPOrHTTPS()
|
||||
? referrer_url
|
||||
: GURL();
|
||||
-
|
||||
- if (quarantine_remote) {
|
||||
- quarantine::mojom::Quarantine* raw_quarantine = quarantine_remote.get();
|
||||
- raw_quarantine->QuarantineFile(
|
||||
- target_url.path(), authority_url, referrer_url,
|
||||
- // TODO(crbug.com/351165321): Consider propagating request_initiator
|
||||
- // information here.
|
||||
- /*request_initiator=*/std::nullopt,
|
||||
- GetContentClient()
|
||||
- ->browser()
|
||||
- ->GetApplicationClientGUIDForQuarantineCheck(),
|
||||
- mojo::WrapCallbackWithDefaultInvokeIfNotRun(
|
||||
- base::BindOnce(&FileSystemAccessSafeMoveHelper::DidAnnotateFile,
|
||||
- weak_factory_.GetWeakPtr(),
|
||||
- std::move(quarantine_remote)),
|
||||
- quarantine::mojom::QuarantineFileResult::ANNOTATION_FAILED));
|
||||
- } else {
|
||||
-#if BUILDFLAG(IS_WIN)
|
||||
- base::ThreadPool::PostTaskAndReplyWithResult(
|
||||
- FROM_HERE, {base::MayBlock()},
|
||||
- base::BindOnce(&quarantine::SetInternetZoneIdentifierDirectly,
|
||||
- target_url.path(), authority_url, referrer_url),
|
||||
- base::BindOnce(&FileSystemAccessSafeMoveHelper::DidAnnotateFile,
|
||||
- weak_factory_.GetWeakPtr(),
|
||||
- std::move(quarantine_remote)));
|
||||
-#else
|
||||
- DidAnnotateFile(std::move(quarantine_remote),
|
||||
- quarantine::mojom::QuarantineFileResult::ANNOTATION_FAILED);
|
||||
-#endif
|
||||
- }
|
||||
}
|
||||
|
||||
void FileSystemAccessSafeMoveHelper::DidAnnotateFile(
|
||||
- mojo::Remote<quarantine::mojom::Quarantine> quarantine_remote,
|
||||
quarantine::mojom::QuarantineFileResult result) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
--- a/content/browser/file_system_access/file_system_access_safe_move_helper.h
|
||||
+++ b/content/browser/file_system_access/file_system_access_safe_move_helper.h
|
||||
@@ -66,10 +66,8 @@ class CONTENT_EXPORT FileSystemAccessSaf
|
||||
void DidFileDoQuarantine(
|
||||
const storage::FileSystemURL& target_url,
|
||||
const GURL& referrer_url,
|
||||
- mojo::Remote<quarantine::mojom::Quarantine> quarantine_remote,
|
||||
base::File::Error result);
|
||||
void DidAnnotateFile(
|
||||
- mojo::Remote<quarantine::mojom::Quarantine> quarantine_remote,
|
||||
quarantine::mojom::QuarantineFileResult result);
|
||||
|
||||
void ComputeHashForSourceFile(HashCallback callback);
|
||||
@@ -11,7 +11,7 @@
|
||||
base::FEATURE_DISABLED_BY_DEFAULT);
|
||||
--- a/chrome/browser/ungoogled_flag_entries.h
|
||||
+++ b/chrome/browser/ungoogled_flag_entries.h
|
||||
@@ -136,4 +136,8 @@
|
||||
@@ -124,4 +124,8 @@
|
||||
"Remove Client Hints",
|
||||
"Removes client hints (information sent to servers about your system, similar to a user agent). ungoogled-chromium flag.",
|
||||
kOsAll, FEATURE_VALUE_TYPE(blink::features::kRemoveClientHints)},
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
# Enable extra locales not normally shipped with Chromium on desktop
|
||||
|
||||
--- a/build/config/locales.gni
|
||||
+++ b/build/config/locales.gni
|
||||
@@ -186,12 +186,6 @@ _non_android_locales = [ "cy" ]
|
||||
|
||||
# Setup |platform_pak_locales| for each platform.
|
||||
platform_pak_locales = all_chrome_locales
|
||||
-if (is_android) {
|
||||
- platform_pak_locales -= _non_android_locales
|
||||
- extended_locales -= _non_android_locales
|
||||
-} else {
|
||||
- platform_pak_locales -= extended_locales
|
||||
-}
|
||||
|
||||
# The base list for all platforms except Android excludes the extended locales.
|
||||
# Add or subtract platform specific locales below.
|
||||
--- a/chrome/app/resources/locale_settings_linux.grd
|
||||
+++ b/chrome/app/resources/locale_settings_linux.grd
|
||||
@@ -4,11 +4,11 @@
|
||||
<output filename="grit/platform_locale_settings.h" type="rc_header">
|
||||
<emit emit_type='prepend'></emit>
|
||||
</output>
|
||||
- <if expr="is_android">
|
||||
<output filename="platform_locale_settings_as.pak" type="data_package" lang="as" />
|
||||
<output filename="platform_locale_settings_az.pak" type="data_package" lang="az" />
|
||||
<output filename="platform_locale_settings_be.pak" type="data_package" lang="be" />
|
||||
<output filename="platform_locale_settings_bs.pak" type="data_package" lang="bs" />
|
||||
+ <output filename="platform_locale_settings_cy.pak" type="data_package" lang="cy" />
|
||||
<output filename="platform_locale_settings_eu.pak" type="data_package" lang="eu" />
|
||||
<output filename="platform_locale_settings_fr-CA.pak" type="data_package" lang="fr-CA" />
|
||||
<output filename="platform_locale_settings_gl.pak" type="data_package" lang="gl" />
|
||||
@@ -31,7 +31,6 @@
|
||||
<output filename="platform_locale_settings_uz.pak" type="data_package" lang="uz" />
|
||||
<output filename="platform_locale_settings_zh-HK.pak" type="data_package" lang="zh-HK" />
|
||||
<output filename="platform_locale_settings_zu.pak" type="data_package" lang="zu" />
|
||||
- </if>
|
||||
<output filename="platform_locale_settings_af.pak" type="data_package" lang="af" />
|
||||
<output filename="platform_locale_settings_am.pak" type="data_package" lang="am" />
|
||||
<output filename="platform_locale_settings_ar.pak" type="data_package" lang="ar" />
|
||||
--- a/chrome/app/resources/locale_settings_mac.grd
|
||||
+++ b/chrome/app/resources/locale_settings_mac.grd
|
||||
@@ -4,6 +4,33 @@
|
||||
<output filename="grit/platform_locale_settings.h" type="rc_header">
|
||||
<emit emit_type='prepend'></emit>
|
||||
</output>
|
||||
+ <output filename="platform_locale_settings_as.pak" type="data_package" lang="as" />
|
||||
+ <output filename="platform_locale_settings_az.pak" type="data_package" lang="az" />
|
||||
+ <output filename="platform_locale_settings_be.pak" type="data_package" lang="be" />
|
||||
+ <output filename="platform_locale_settings_bs.pak" type="data_package" lang="bs" />
|
||||
+ <output filename="platform_locale_settings_cy.pak" type="data_package" lang="cy" />
|
||||
+ <output filename="platform_locale_settings_eu.pak" type="data_package" lang="eu" />
|
||||
+ <output filename="platform_locale_settings_fr-CA.pak" type="data_package" lang="fr-CA" />
|
||||
+ <output filename="platform_locale_settings_gl.pak" type="data_package" lang="gl" />
|
||||
+ <output filename="platform_locale_settings_hy.pak" type="data_package" lang="hy" />
|
||||
+ <output filename="platform_locale_settings_is.pak" type="data_package" lang="is" />
|
||||
+ <output filename="platform_locale_settings_ka.pak" type="data_package" lang="ka" />
|
||||
+ <output filename="platform_locale_settings_kk.pak" type="data_package" lang="kk" />
|
||||
+ <output filename="platform_locale_settings_km.pak" type="data_package" lang="km" />
|
||||
+ <output filename="platform_locale_settings_ky.pak" type="data_package" lang="ky" />
|
||||
+ <output filename="platform_locale_settings_lo.pak" type="data_package" lang="lo" />
|
||||
+ <output filename="platform_locale_settings_mk.pak" type="data_package" lang="mk" />
|
||||
+ <output filename="platform_locale_settings_mn.pak" type="data_package" lang="mn" />
|
||||
+ <output filename="platform_locale_settings_my.pak" type="data_package" lang="my" />
|
||||
+ <output filename="platform_locale_settings_ne.pak" type="data_package" lang="ne" />
|
||||
+ <output filename="platform_locale_settings_or.pak" type="data_package" lang="or" />
|
||||
+ <output filename="platform_locale_settings_pa.pak" type="data_package" lang="pa" />
|
||||
+ <output filename="platform_locale_settings_si.pak" type="data_package" lang="si" />
|
||||
+ <output filename="platform_locale_settings_sq.pak" type="data_package" lang="sq" />
|
||||
+ <output filename="platform_locale_settings_sr-Latn.pak" type="data_package" lang="sr-Latn" />
|
||||
+ <output filename="platform_locale_settings_uz.pak" type="data_package" lang="uz" />
|
||||
+ <output filename="platform_locale_settings_zh-HK.pak" type="data_package" lang="zh-HK" />
|
||||
+ <output filename="platform_locale_settings_zu.pak" type="data_package" lang="zu" />
|
||||
<output filename="platform_locale_settings_af.pak" type="data_package" lang="af" />
|
||||
<output filename="platform_locale_settings_am.pak" type="data_package" lang="am" />
|
||||
<output filename="platform_locale_settings_ar.pak" type="data_package" lang="ar" />
|
||||
--- a/chrome/app/resources/locale_settings_win.grd
|
||||
+++ b/chrome/app/resources/locale_settings_win.grd
|
||||
@@ -4,6 +4,33 @@
|
||||
<output filename="grit/platform_locale_settings.h" type="rc_header">
|
||||
<emit emit_type='prepend'></emit>
|
||||
</output>
|
||||
+ <output filename="platform_locale_settings_as.pak" type="data_package" lang="as" />
|
||||
+ <output filename="platform_locale_settings_az.pak" type="data_package" lang="az" />
|
||||
+ <output filename="platform_locale_settings_be.pak" type="data_package" lang="be" />
|
||||
+ <output filename="platform_locale_settings_bs.pak" type="data_package" lang="bs" />
|
||||
+ <output filename="platform_locale_settings_cy.pak" type="data_package" lang="cy" />
|
||||
+ <output filename="platform_locale_settings_eu.pak" type="data_package" lang="eu" />
|
||||
+ <output filename="platform_locale_settings_fr-CA.pak" type="data_package" lang="fr-CA" />
|
||||
+ <output filename="platform_locale_settings_gl.pak" type="data_package" lang="gl" />
|
||||
+ <output filename="platform_locale_settings_hy.pak" type="data_package" lang="hy" />
|
||||
+ <output filename="platform_locale_settings_is.pak" type="data_package" lang="is" />
|
||||
+ <output filename="platform_locale_settings_ka.pak" type="data_package" lang="ka" />
|
||||
+ <output filename="platform_locale_settings_kk.pak" type="data_package" lang="kk" />
|
||||
+ <output filename="platform_locale_settings_km.pak" type="data_package" lang="km" />
|
||||
+ <output filename="platform_locale_settings_ky.pak" type="data_package" lang="ky" />
|
||||
+ <output filename="platform_locale_settings_lo.pak" type="data_package" lang="lo" />
|
||||
+ <output filename="platform_locale_settings_mk.pak" type="data_package" lang="mk" />
|
||||
+ <output filename="platform_locale_settings_mn.pak" type="data_package" lang="mn" />
|
||||
+ <output filename="platform_locale_settings_my.pak" type="data_package" lang="my" />
|
||||
+ <output filename="platform_locale_settings_ne.pak" type="data_package" lang="ne" />
|
||||
+ <output filename="platform_locale_settings_or.pak" type="data_package" lang="or" />
|
||||
+ <output filename="platform_locale_settings_pa.pak" type="data_package" lang="pa" />
|
||||
+ <output filename="platform_locale_settings_si.pak" type="data_package" lang="si" />
|
||||
+ <output filename="platform_locale_settings_sq.pak" type="data_package" lang="sq" />
|
||||
+ <output filename="platform_locale_settings_sr-Latn.pak" type="data_package" lang="sr-Latn" />
|
||||
+ <output filename="platform_locale_settings_uz.pak" type="data_package" lang="uz" />
|
||||
+ <output filename="platform_locale_settings_zh-HK.pak" type="data_package" lang="zh-HK" />
|
||||
+ <output filename="platform_locale_settings_zu.pak" type="data_package" lang="zu" />
|
||||
<output filename="platform_locale_settings_af.pak" type="data_package" lang="af" />
|
||||
<output filename="platform_locale_settings_am.pak" type="data_package" lang="am" />
|
||||
<output filename="platform_locale_settings_ar.pak" type="data_package" lang="ar" />
|
||||
@@ -1,77 +0,0 @@
|
||||
# Add more URL schemes allowed for saving
|
||||
|
||||
--- a/chrome/browser/ui/browser_commands.cc
|
||||
+++ b/chrome/browser/ui/browser_commands.cc
|
||||
@@ -702,11 +702,6 @@ int GetContentRestrictions(const Browser
|
||||
CoreTabHelper* core_tab_helper =
|
||||
CoreTabHelper::FromWebContents(current_tab);
|
||||
content_restrictions = core_tab_helper->content_restrictions();
|
||||
- NavigationEntry* last_committed_entry =
|
||||
- current_tab->GetController().GetLastCommittedEntry();
|
||||
- if (!content::IsSavableURL(last_committed_entry->GetURL())) {
|
||||
- content_restrictions |= CONTENT_RESTRICTION_SAVE;
|
||||
- }
|
||||
}
|
||||
return content_restrictions;
|
||||
}
|
||||
@@ -2050,8 +2045,7 @@ bool CanSavePage(const Browser* browser)
|
||||
policy::DownloadRestriction::ALL_FILES) {
|
||||
return false;
|
||||
}
|
||||
- return !browser->is_type_devtools() &&
|
||||
- !(GetContentRestrictions(browser) & CONTENT_RESTRICTION_SAVE);
|
||||
+ return true;
|
||||
}
|
||||
|
||||
void Print(BrowserWindowInterface* bwi) {
|
||||
--- a/components/offline_pages/core/offline_page_model.cc
|
||||
+++ b/components/offline_pages/core/offline_page_model.cc
|
||||
@@ -21,7 +21,7 @@ OfflinePageModel::SavePageParams::~SaveP
|
||||
|
||||
// static
|
||||
bool OfflinePageModel::CanSaveURL(const GURL& url) {
|
||||
- return url.is_valid() && url.SchemeIsHTTPOrHTTPS();
|
||||
+ return url.is_valid();
|
||||
}
|
||||
|
||||
OfflinePageModel::OfflinePageModel() = default;
|
||||
--- a/content/common/url_schemes.cc
|
||||
+++ b/content/common/url_schemes.cc
|
||||
@@ -24,13 +24,21 @@ namespace {
|
||||
bool g_registered_url_schemes = false;
|
||||
|
||||
const char* const kDefaultSavableSchemes[] = {
|
||||
+ url::kAboutScheme,
|
||||
+ url::kBlobScheme,
|
||||
+ url::kContentScheme,
|
||||
url::kHttpScheme,
|
||||
url::kHttpsScheme,
|
||||
url::kFileScheme,
|
||||
url::kFileSystemScheme,
|
||||
kChromeDevToolsScheme,
|
||||
kChromeUIScheme,
|
||||
- url::kDataScheme
|
||||
+ url::kDataScheme,
|
||||
+ url::kJavaScriptScheme,
|
||||
+ url::kMailToScheme,
|
||||
+ url::kWsScheme,
|
||||
+ url::kWssScheme,
|
||||
+ kViewSourceScheme
|
||||
};
|
||||
|
||||
// These lists are lazily initialized below and are leaked on shutdown to
|
||||
--- a/content/public/common/url_utils.cc
|
||||
+++ b/content/public/common/url_utils.cc
|
||||
@@ -41,11 +41,7 @@ bool HasWebUIOrigin(const url::Origin& o
|
||||
}
|
||||
|
||||
bool IsSavableURL(const GURL& url) {
|
||||
- for (auto& scheme : GetSavableSchemes()) {
|
||||
- if (url.SchemeIs(scheme))
|
||||
- return true;
|
||||
- }
|
||||
- return false;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
bool IsURLHandledByNetworkStack(const GURL& url) {
|
||||
@@ -1603,6 +1603,29 @@
|
||||
#endif
|
||||
}
|
||||
|
||||
--- a/chrome/browser/ui/safety_hub/abusive_notification_permissions_manager.cc
|
||||
+++ b/chrome/browser/ui/safety_hub/abusive_notification_permissions_manager.cc
|
||||
@@ -108,20 +108,7 @@ safe_browsing::NotificationRevocationSou
|
||||
// suspicious notification.
|
||||
bool HasShowOriginalSuspiciousNotification(HostContentSettingsMap* hcsm,
|
||||
GURL url) {
|
||||
- DCHECK(hcsm);
|
||||
- DCHECK(url.is_valid());
|
||||
- base::Value stored_value(hcsm->GetWebsiteSetting(
|
||||
- url, url, ContentSettingsType::SUSPICIOUS_NOTIFICATION_SHOW_ORIGINAL));
|
||||
-
|
||||
- if (stored_value.is_none()) {
|
||||
return false;
|
||||
- }
|
||||
- DCHECK(stored_value.is_dict());
|
||||
- DCHECK(stored_value.GetDict().contains(
|
||||
- safe_browsing::kSuspiciousNotificationShowOriginalKey));
|
||||
- return stored_value.GetDict()
|
||||
- .FindBool(safe_browsing::kSuspiciousNotificationShowOriginalKey)
|
||||
- .value_or(false);
|
||||
}
|
||||
|
||||
// Return true if the url should be considered for suspicious content
|
||||
--- a/chrome/browser/ui/safety_hub/revoked_permissions_service.cc
|
||||
+++ b/chrome/browser/ui/safety_hub/revoked_permissions_service.cc
|
||||
@@ -41,7 +41,6 @@
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
--- a/components/dom_distiller/core/css/distilledpage_common.css
|
||||
+++ b/components/dom_distiller/core/css/distilledpage_common.css
|
||||
@@ -26,6 +26,11 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
+.material-icons {
|
||||
+ font-family: Material Icons;
|
||||
+ font-style: normal !important;
|
||||
+}
|
||||
+
|
||||
/* Remove all margins and padding from certain element and add word wrap. */
|
||||
|
||||
blockquote,
|
||||
@@ -1,12 +0,0 @@
|
||||
# Remove the "--disable-setuid-sandbox" command line flag as a bad flag
|
||||
|
||||
--- a/chrome/browser/ui/startup/bad_flags_prompt.cc
|
||||
+++ b/chrome/browser/ui/startup/bad_flags_prompt.cc
|
||||
@@ -84,7 +84,6 @@ const char* const kBadFlags[] = {
|
||||
sandbox::policy::switches::kDisableGpuSandbox,
|
||||
sandbox::policy::switches::kDisableLandlockSandbox,
|
||||
sandbox::policy::switches::kDisableSeccompFilterSandbox,
|
||||
- sandbox::policy::switches::kDisableSetuidSandbox,
|
||||
sandbox::policy::switches::kNoSandbox,
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
sandbox::policy::switches::kAllowThirdPartyModules,
|
||||
@@ -1,130 +0,0 @@
|
||||
From 1e69bde8508191f45357b8c027bcd63a58d9ea8d Mon Sep 17 00:00:00 2001
|
||||
From: Dana Fried <dfried@chromium.org>
|
||||
Date: Fri, 31 Oct 2025 11:49:22 -0700
|
||||
Subject: [PATCH] [Browser Frame] Abandon reading Mac caption button positions
|
||||
|
||||
These were not reliable during fullscreen transitions in a way that was
|
||||
not possible to accurately filter out. This now uses the old fallback
|
||||
hard-coded constants that were being used in all PWA windows anyway.
|
||||
|
||||
Include-Ci-Only-Tests: chromium.mac:mac15-x64-rel-tests|browser_tests
|
||||
Bug: 453717426
|
||||
Change-Id: Id102a321834c3dac0f56edcacda933c88db0b82a
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7107360
|
||||
Reviewed-by: Darryl James <dljames@chromium.org>
|
||||
Commit-Queue: Dana Fried <dfried@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1538756}
|
||||
---
|
||||
|
||||
--- a/chrome/browser/ui/views/frame/browser_frame_view_mac.h
|
||||
+++ b/chrome/browser/ui/views/frame/browser_frame_view_mac.h
|
||||
@@ -90,9 +90,6 @@ class BrowserFrameViewMac : public Brows
|
||||
FRIEND_TEST_ALL_PREFIXES(BrowserFrameViewMacTest,
|
||||
GetCaptionButtonPlaceholderBounds);
|
||||
|
||||
- // Fetches the caption button bounds from the buttons themselves.
|
||||
- BoundsAndMargins GetCaptionButtonBoundsNative() const;
|
||||
-
|
||||
// Creates an inset from the caption button size which controls for which edge
|
||||
// the captions buttons exists on. Used to position elements like the tabstrip
|
||||
// that are adjacent to the caption buttons.
|
||||
--- a/chrome/browser/ui/views/frame/browser_frame_view_mac.mm
|
||||
+++ b/chrome/browser/ui/views/frame/browser_frame_view_mac.mm
|
||||
@@ -458,96 +458,9 @@ void BrowserFrameViewMac::PaintChildren(
|
||||
}
|
||||
|
||||
BrowserFrameViewMac::BoundsAndMargins
|
||||
-BrowserFrameViewMac::GetCaptionButtonBoundsNative() const {
|
||||
- BoundsAndMargins result;
|
||||
-
|
||||
- // Verify that this is not an out-of-process window.
|
||||
- const auto native_window = GetWidget()->GetNativeWindow();
|
||||
- if (auto* const host =
|
||||
- views::NativeWidgetMacNSWindowHost::GetFromNativeWindow(
|
||||
- native_window);
|
||||
- host && host->application_host()) {
|
||||
- return result;
|
||||
- }
|
||||
-
|
||||
- // Verify that there is a valid NSWindow.
|
||||
- NSWindow* ns_window = native_window.GetNativeNSWindow();
|
||||
- if (!ns_window) {
|
||||
- return result;
|
||||
- }
|
||||
-
|
||||
- // Build a list of caption button bounds.
|
||||
- std::vector<gfx::RectF> button_rects;
|
||||
-
|
||||
- // Also track some other data that will be useful for calculating the visual
|
||||
- // margins of the buttons against the window border.
|
||||
- float min_x = width();
|
||||
- float max_x = 0;
|
||||
- float min_y = height();
|
||||
-
|
||||
- // Chrome coordinates are reversed in RTL but not in the Mac API, so we might
|
||||
- // have to flip them.
|
||||
- const bool is_rtl = base::i18n::IsRTL();
|
||||
-
|
||||
- // Build the list. If any of the buttons are not present or are zero size,
|
||||
- // abort (this will fall back to previous hard-coded values).
|
||||
- for (NSButton* button :
|
||||
- {[ns_window standardWindowButton:NSWindowCloseButton],
|
||||
- [ns_window standardWindowButton:NSWindowMiniaturizeButton],
|
||||
- [ns_window standardWindowButton:NSWindowZoomButton]}) {
|
||||
- if (!button) {
|
||||
- return result;
|
||||
- }
|
||||
- NSRect ns_rect = [button convertRect:[button bounds] toView:nil];
|
||||
-
|
||||
- // When converting from Mac to Chrome coordinates:
|
||||
- // - Y axis is inverted (Mac coordinates start at bottom-left).
|
||||
- // - X axis is inverted in RTL mode only (Mac coordinates are invariant
|
||||
- // while Chrome reverses them).
|
||||
- button_rects.emplace_back(
|
||||
- is_rtl ? width() - (ns_rect.origin.x + ns_rect.size.width)
|
||||
- : ns_rect.origin.x,
|
||||
- height() - (ns_rect.origin.y + ns_rect.size.height), ns_rect.size.width,
|
||||
- ns_rect.size.height);
|
||||
- const auto& rect = button_rects.back();
|
||||
- if (rect.IsEmpty()) {
|
||||
- return result;
|
||||
- }
|
||||
- min_x = std::min(min_x, rect.x());
|
||||
- max_x = std::max(max_x, rect.right());
|
||||
- min_y = std::min(min_y, rect.y());
|
||||
- }
|
||||
-
|
||||
- // Calculate the margins that the buttons are using.
|
||||
- const float block_margin = min_y;
|
||||
- const float inline_margin =
|
||||
- CaptionButtonsOnLeadingEdge() ? min_x : width() - max_x;
|
||||
-
|
||||
- // Accumulate the button bounds.
|
||||
- for (const auto& rect : button_rects) {
|
||||
- result.bounds.Union(rect);
|
||||
- }
|
||||
-
|
||||
- // Apply the margins on the exterior of the region, so that the padding around
|
||||
- // the buttons appears visually symmetrical.
|
||||
- result.margins = gfx::OutsetsF::VH(block_margin, inline_margin);
|
||||
-
|
||||
- return result;
|
||||
-}
|
||||
-
|
||||
-BrowserFrameViewMac::BoundsAndMargins
|
||||
BrowserFrameViewMac::GetCaptionButtonBounds() const {
|
||||
- BoundsAndMargins result = GetCaptionButtonBoundsNative();
|
||||
- if (!result.bounds.IsEmpty()) {
|
||||
- return result;
|
||||
- }
|
||||
+ BoundsAndMargins result;
|
||||
|
||||
- // If that doesn't work, fall back to some hard-coded constants. These will
|
||||
- // apply for app windows, since the app is out of process and the caption
|
||||
- // buttons can't be retrieved. Note that the app window actually positions its
|
||||
- // buttons slightly differently from a standard browser window (it's unclear
|
||||
- // why).
|
||||
- //
|
||||
// These are empirically determined; feel free to change them if they're
|
||||
// not precise.
|
||||
if (@available(macOS 26, *)) {
|
||||
@@ -48,6 +48,16 @@
|
||||
]
|
||||
|
||||
# Disallow depending on content.
|
||||
--- a/components/contextual_tasks/internal/BUILD.gn
|
||||
+++ b/components/contextual_tasks/internal/BUILD.gn
|
||||
@@ -43,6 +43,7 @@ source_set("internal") {
|
||||
"//components/sync/model",
|
||||
"//components/url_formatter",
|
||||
"//net",
|
||||
+ "//third_party/re2",
|
||||
"//ui/gfx",
|
||||
"//url",
|
||||
]
|
||||
--- a/content/browser/BUILD.gn
|
||||
+++ b/content/browser/BUILD.gn
|
||||
@@ -119,6 +119,7 @@ source_set("browser") {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
2
|
||||
8
|
||||
|
||||
Reference in New Issue
Block a user